From 65f6cb23d319c0f348563f7896f316e91f002f82 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 18 Apr 2022 14:24:22 -0700 Subject: [PATCH 01/63] Constraints for mapped types with filtering 'as' clauses (#48699) * Constraints for mapped types with filtering 'as' clauses * Add regression test --- src/compiler/checker.ts | 13 ++-- .../mappedTypeConstraints2.errors.txt | 22 ++++++ .../reference/mappedTypeConstraints2.js | 49 ++++++++++++-- .../reference/mappedTypeConstraints2.symbols | 67 +++++++++++++++++++ .../reference/mappedTypeConstraints2.types | 60 +++++++++++++++++ .../types/mapped/mappedTypeConstraints2.ts | 23 +++++++ 6 files changed, 225 insertions(+), 9 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 7a75d6e925f..3f5f51acd71 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -15737,11 +15737,14 @@ namespace ts { return type[cache] = elementType; } } - // If the object type is a mapped type { [P in K]: E }, where K is generic, instantiate E using a mapper - // that substitutes the index type for P. For example, for an index access { [P in K]: Box }[X], we - // construct the type Box. - if (isGenericMappedType(objectType) && !objectType.declaration.nameType) { - return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), t => getSimplifiedType(t, writing)); + // If the object type is a mapped type { [P in K]: E }, where K is generic, or { [P in K as N]: E }, where + // K is generic and N is assignable to P, instantiate E using a mapper that substitutes the index type for P. + // For example, for an index access { [P in K]: Box }[X], we construct the type Box. + if (isGenericMappedType(objectType)) { + const nameType = getNameTypeFromMappedType(objectType); + if (!nameType || isTypeAssignableTo(nameType, getTypeParameterFromMappedType(objectType))) { + return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), t => getSimplifiedType(t, writing)); + } } return type[cache] = type; } diff --git a/tests/baselines/reference/mappedTypeConstraints2.errors.txt b/tests/baselines/reference/mappedTypeConstraints2.errors.txt index 5dcfca6d63f..7950e9d0f54 100644 --- a/tests/baselines/reference/mappedTypeConstraints2.errors.txt +++ b/tests/baselines/reference/mappedTypeConstraints2.errors.txt @@ -41,4 +41,26 @@ tests/cases/conformance/types/mapped/mappedTypeConstraints2.ts(25,57): error TS2 ~~~~~~~~~~~~~~ !!! error TS2322: Type 'Foo[`get${T}`]' is not assignable to type 'T'. !!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Foo[`get${T}`]'. + + // Repro from #48626 + + interface Bounds { + min: number; + max: number; + } + + type NumericBoundsOf = { + [K in keyof T as T[K] extends number | undefined ? K : never]: Bounds; + } + + function validate(obj: T, bounds: NumericBoundsOf) { + for (const [key, val] of Object.entries(obj)) { + const boundsForKey = bounds[key as keyof NumericBoundsOf]; + if (boundsForKey) { + const { min, max } = boundsForKey; + if (min > val || max < val) return false; + } + } + return true; + } \ No newline at end of file diff --git a/tests/baselines/reference/mappedTypeConstraints2.js b/tests/baselines/reference/mappedTypeConstraints2.js index 4c583b32495..3237f1d8b81 100644 --- a/tests/baselines/reference/mappedTypeConstraints2.js +++ b/tests/baselines/reference/mappedTypeConstraints2.js @@ -24,20 +24,53 @@ type Foo = { }; const get = (t: T, foo: Foo): T => foo[`get${t}`]; // Type 'Foo[`get${T}`]' is not assignable to type 'T' + +// Repro from #48626 + +interface Bounds { + min: number; + max: number; +} + +type NumericBoundsOf = { + [K in keyof T as T[K] extends number | undefined ? K : never]: Bounds; +} + +function validate(obj: T, bounds: NumericBoundsOf) { + for (const [key, val] of Object.entries(obj)) { + const boundsForKey = bounds[key as keyof NumericBoundsOf]; + if (boundsForKey) { + const { min, max } = boundsForKey; + if (min > val || max < val) return false; + } + } + return true; +} //// [mappedTypeConstraints2.js] "use strict"; function f1(obj, key) { - var x = obj[key]; + const x = obj[key]; } function f2(obj, key) { - var x = obj[key]; // Error + const x = obj[key]; // Error } function f3(obj, key) { - var x = obj[key]; // Error + const x = obj[key]; // Error +} +const get = (t, foo) => foo[`get${t}`]; // Type 'Foo[`get${T}`]' is not assignable to type 'T' +function validate(obj, bounds) { + for (const [key, val] of Object.entries(obj)) { + const boundsForKey = bounds[key]; + if (boundsForKey) { + const { min, max } = boundsForKey; + if (min > val || max < val) + return false; + } + } + return true; } -var get = function (t, foo) { return foo["get".concat(t)]; }; // Type 'Foo[`get${T}`]' is not assignable to type 'T' //// [mappedTypeConstraints2.d.ts] @@ -63,3 +96,11 @@ declare type Foo = { [RemappedT in T as `get${RemappedT}`]: RemappedT; }; declare const get: (t: T, foo: Foo) => T; +interface Bounds { + min: number; + max: number; +} +declare type NumericBoundsOf = { + [K in keyof T as T[K] extends number | undefined ? K : never]: Bounds; +}; +declare function validate(obj: T, bounds: NumericBoundsOf): boolean; diff --git a/tests/baselines/reference/mappedTypeConstraints2.symbols b/tests/baselines/reference/mappedTypeConstraints2.symbols index 9e1727cae64..90ee329dada 100644 --- a/tests/baselines/reference/mappedTypeConstraints2.symbols +++ b/tests/baselines/reference/mappedTypeConstraints2.symbols @@ -104,3 +104,70 @@ const get = (t: T, foo: Foo): T => foo[`get${t}`]; // Type >foo : Symbol(foo, Decl(mappedTypeConstraints2.ts, 24, 36)) >t : Symbol(t, Decl(mappedTypeConstraints2.ts, 24, 31)) +// Repro from #48626 + +interface Bounds { +>Bounds : Symbol(Bounds, Decl(mappedTypeConstraints2.ts, 24, 71)) + + min: number; +>min : Symbol(Bounds.min, Decl(mappedTypeConstraints2.ts, 28, 18)) + + max: number; +>max : Symbol(Bounds.max, Decl(mappedTypeConstraints2.ts, 29, 16)) +} + +type NumericBoundsOf = { +>NumericBoundsOf : Symbol(NumericBoundsOf, Decl(mappedTypeConstraints2.ts, 31, 1)) +>T : Symbol(T, Decl(mappedTypeConstraints2.ts, 33, 21)) + + [K in keyof T as T[K] extends number | undefined ? K : never]: Bounds; +>K : Symbol(K, Decl(mappedTypeConstraints2.ts, 34, 5)) +>T : Symbol(T, Decl(mappedTypeConstraints2.ts, 33, 21)) +>T : Symbol(T, Decl(mappedTypeConstraints2.ts, 33, 21)) +>K : Symbol(K, Decl(mappedTypeConstraints2.ts, 34, 5)) +>K : Symbol(K, Decl(mappedTypeConstraints2.ts, 34, 5)) +>Bounds : Symbol(Bounds, Decl(mappedTypeConstraints2.ts, 24, 71)) +} + +function validate(obj: T, bounds: NumericBoundsOf) { +>validate : Symbol(validate, Decl(mappedTypeConstraints2.ts, 35, 1)) +>T : Symbol(T, Decl(mappedTypeConstraints2.ts, 37, 18)) +>obj : Symbol(obj, Decl(mappedTypeConstraints2.ts, 37, 36)) +>T : Symbol(T, Decl(mappedTypeConstraints2.ts, 37, 18)) +>bounds : Symbol(bounds, Decl(mappedTypeConstraints2.ts, 37, 43)) +>NumericBoundsOf : Symbol(NumericBoundsOf, Decl(mappedTypeConstraints2.ts, 31, 1)) +>T : Symbol(T, Decl(mappedTypeConstraints2.ts, 37, 18)) + + for (const [key, val] of Object.entries(obj)) { +>key : Symbol(key, Decl(mappedTypeConstraints2.ts, 38, 16)) +>val : Symbol(val, Decl(mappedTypeConstraints2.ts, 38, 20)) +>Object.entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) +>obj : Symbol(obj, Decl(mappedTypeConstraints2.ts, 37, 36)) + + const boundsForKey = bounds[key as keyof NumericBoundsOf]; +>boundsForKey : Symbol(boundsForKey, Decl(mappedTypeConstraints2.ts, 39, 13)) +>bounds : Symbol(bounds, Decl(mappedTypeConstraints2.ts, 37, 43)) +>key : Symbol(key, Decl(mappedTypeConstraints2.ts, 38, 16)) +>NumericBoundsOf : Symbol(NumericBoundsOf, Decl(mappedTypeConstraints2.ts, 31, 1)) +>T : Symbol(T, Decl(mappedTypeConstraints2.ts, 37, 18)) + + if (boundsForKey) { +>boundsForKey : Symbol(boundsForKey, Decl(mappedTypeConstraints2.ts, 39, 13)) + + const { min, max } = boundsForKey; +>min : Symbol(min, Decl(mappedTypeConstraints2.ts, 41, 19)) +>max : Symbol(max, Decl(mappedTypeConstraints2.ts, 41, 24)) +>boundsForKey : Symbol(boundsForKey, Decl(mappedTypeConstraints2.ts, 39, 13)) + + if (min > val || max < val) return false; +>min : Symbol(min, Decl(mappedTypeConstraints2.ts, 41, 19)) +>val : Symbol(val, Decl(mappedTypeConstraints2.ts, 38, 20)) +>max : Symbol(max, Decl(mappedTypeConstraints2.ts, 41, 24)) +>val : Symbol(val, Decl(mappedTypeConstraints2.ts, 38, 20)) + } + } + return true; +} + diff --git a/tests/baselines/reference/mappedTypeConstraints2.types b/tests/baselines/reference/mappedTypeConstraints2.types index e1967ee3453..534e02c8518 100644 --- a/tests/baselines/reference/mappedTypeConstraints2.types +++ b/tests/baselines/reference/mappedTypeConstraints2.types @@ -68,3 +68,63 @@ const get = (t: T, foo: Foo): T => foo[`get${t}`]; // Type >`get${t}` : `get${T}` >t : T +// Repro from #48626 + +interface Bounds { + min: number; +>min : number + + max: number; +>max : number +} + +type NumericBoundsOf = { +>NumericBoundsOf : NumericBoundsOf + + [K in keyof T as T[K] extends number | undefined ? K : never]: Bounds; +} + +function validate(obj: T, bounds: NumericBoundsOf) { +>validate : (obj: T, bounds: NumericBoundsOf) => boolean +>obj : T +>bounds : NumericBoundsOf + + for (const [key, val] of Object.entries(obj)) { +>key : string +>val : any +>Object.entries(obj) : [string, any][] +>Object.entries : { (o: { [s: string]: T; } | ArrayLike): [string, T][]; (o: {}): [string, any][]; } +>Object : ObjectConstructor +>entries : { (o: { [s: string]: T; } | ArrayLike): [string, T][]; (o: {}): [string, any][]; } +>obj : T + + const boundsForKey = bounds[key as keyof NumericBoundsOf]; +>boundsForKey : NumericBoundsOf[keyof NumericBoundsOf] +>bounds[key as keyof NumericBoundsOf] : NumericBoundsOf[keyof NumericBoundsOf] +>bounds : NumericBoundsOf +>key as keyof NumericBoundsOf : keyof NumericBoundsOf +>key : string + + if (boundsForKey) { +>boundsForKey : NumericBoundsOf[keyof NumericBoundsOf] + + const { min, max } = boundsForKey; +>min : number +>max : number +>boundsForKey : NumericBoundsOf[keyof NumericBoundsOf] + + if (min > val || max < val) return false; +>min > val || max < val : boolean +>min > val : boolean +>min : number +>val : any +>max < val : boolean +>max : number +>val : any +>false : false + } + } + return true; +>true : true +} + diff --git a/tests/cases/conformance/types/mapped/mappedTypeConstraints2.ts b/tests/cases/conformance/types/mapped/mappedTypeConstraints2.ts index b77abb21dc9..d0f1703b113 100644 --- a/tests/cases/conformance/types/mapped/mappedTypeConstraints2.ts +++ b/tests/cases/conformance/types/mapped/mappedTypeConstraints2.ts @@ -1,5 +1,6 @@ // @strict: true // @declaration: true +// @target: es2017 type Mapped1 = { [P in K]: { a: P } }; @@ -26,3 +27,25 @@ type Foo = { }; const get = (t: T, foo: Foo): T => foo[`get${t}`]; // Type 'Foo[`get${T}`]' is not assignable to type 'T' + +// Repro from #48626 + +interface Bounds { + min: number; + max: number; +} + +type NumericBoundsOf = { + [K in keyof T as T[K] extends number | undefined ? K : never]: Bounds; +} + +function validate(obj: T, bounds: NumericBoundsOf) { + for (const [key, val] of Object.entries(obj)) { + const boundsForKey = bounds[key as keyof NumericBoundsOf]; + if (boundsForKey) { + const { min, max } = boundsForKey; + if (min > val || max < val) return false; + } + } + return true; +} From d3943fc86fc2f7d828cee58c1dbcac1a6a07aeef Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Mon, 18 Apr 2022 16:18:31 -0700 Subject: [PATCH 02/63] Disallow line break between entity name and type arguments in typeof expression (#48755) --- src/compiler/parser.ts | 3 ++- .../reference/newLineInTypeofInstantiation.js | 9 +++++++++ .../reference/newLineInTypeofInstantiation.symbols | 12 ++++++++++++ .../reference/newLineInTypeofInstantiation.types | 9 +++++++++ tests/cases/compiler/newLineInTypeofInstantiation.ts | 5 +++++ 5 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/newLineInTypeofInstantiation.js create mode 100644 tests/baselines/reference/newLineInTypeofInstantiation.symbols create mode 100644 tests/baselines/reference/newLineInTypeofInstantiation.types create mode 100644 tests/cases/compiler/newLineInTypeofInstantiation.ts diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 247381f0251..e57a3fa98f3 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3189,7 +3189,8 @@ namespace ts { const pos = getNodePos(); parseExpected(SyntaxKind.TypeOfKeyword); const entityName = parseEntityName(/*allowReservedWords*/ true, /*allowPrivateIdentifiers*/ true); - const typeArguments = tryParseTypeArguments(); + // Make sure we perform ASI to prevent parsing the next line's type arguments as part of an instantiation expression. + const typeArguments = !scanner.hasPrecedingLineBreak() ? tryParseTypeArguments() : undefined; return finishNode(factory.createTypeQueryNode(entityName, typeArguments), pos); } diff --git a/tests/baselines/reference/newLineInTypeofInstantiation.js b/tests/baselines/reference/newLineInTypeofInstantiation.js new file mode 100644 index 00000000000..b43b6770305 --- /dev/null +++ b/tests/baselines/reference/newLineInTypeofInstantiation.js @@ -0,0 +1,9 @@ +//// [newLineInTypeofInstantiation.ts] +interface Example { + (a: number): typeof a + + (): void +} + + +//// [newLineInTypeofInstantiation.js] diff --git a/tests/baselines/reference/newLineInTypeofInstantiation.symbols b/tests/baselines/reference/newLineInTypeofInstantiation.symbols new file mode 100644 index 00000000000..2a3ccf8097e --- /dev/null +++ b/tests/baselines/reference/newLineInTypeofInstantiation.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/newLineInTypeofInstantiation.ts === +interface Example { +>Example : Symbol(Example, Decl(newLineInTypeofInstantiation.ts, 0, 0)) + + (a: number): typeof a +>a : Symbol(a, Decl(newLineInTypeofInstantiation.ts, 1, 5)) +>a : Symbol(a, Decl(newLineInTypeofInstantiation.ts, 1, 5)) + + (): void +>T : Symbol(T, Decl(newLineInTypeofInstantiation.ts, 3, 5)) +} + diff --git a/tests/baselines/reference/newLineInTypeofInstantiation.types b/tests/baselines/reference/newLineInTypeofInstantiation.types new file mode 100644 index 00000000000..a57d7df124b --- /dev/null +++ b/tests/baselines/reference/newLineInTypeofInstantiation.types @@ -0,0 +1,9 @@ +=== tests/cases/compiler/newLineInTypeofInstantiation.ts === +interface Example { + (a: number): typeof a +>a : number +>a : number + + (): void +} + diff --git a/tests/cases/compiler/newLineInTypeofInstantiation.ts b/tests/cases/compiler/newLineInTypeofInstantiation.ts new file mode 100644 index 00000000000..99259acec79 --- /dev/null +++ b/tests/cases/compiler/newLineInTypeofInstantiation.ts @@ -0,0 +1,5 @@ +interface Example { + (a: number): typeof a + + (): void +} From 6894f913ec5c7de25f77b121af7323ed6b8eae99 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Tue, 19 Apr 2022 06:06:46 +0000 Subject: [PATCH 03/63] Update package-lock.json --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index fb73528300f..2570922a51e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -638,9 +638,9 @@ "dev": true }, "@types/node": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.24.tgz", - "integrity": "sha512-aveCYRQbgTH9Pssp1voEP7HiuWlD2jW2BO56w+bVrJn04i61yh6mRfoKO6hEYQD9vF+W8Chkwc6j1M36uPkx4g==", + "version": "17.0.25", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.25.tgz", + "integrity": "sha512-wANk6fBrUwdpY4isjWrKTufkrXdu1D2YHCot2fD/DfWxF5sMrVSA+KN7ydckvaTCh0HiqX9IVl0L5/ZoXg5M7w==", "dev": true }, "@types/node-fetch": { From 2e619fdc8016d11c059a5b9f8653cd614a76a3f8 Mon Sep 17 00:00:00 2001 From: Patrick Szmucer Date: Tue, 19 Apr 2022 17:19:25 +0100 Subject: [PATCH 04/63] Fix transformed constructor code when there is code between prologue statements and super call (#48765) --- src/compiler/transformers/es2015.ts | 2 +- .../constructorWithSuperAndPrologue.es5.js | 52 +++++++++++++++++++ ...onstructorWithSuperAndPrologue.es5.symbols | 31 +++++++++++ .../constructorWithSuperAndPrologue.es5.types | 39 ++++++++++++++ .../constructorWithSuperAndPrologue.es5.ts | 17 ++++++ 5 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/constructorWithSuperAndPrologue.es5.js create mode 100644 tests/baselines/reference/constructorWithSuperAndPrologue.es5.symbols create mode 100644 tests/baselines/reference/constructorWithSuperAndPrologue.es5.types create mode 100644 tests/cases/compiler/constructorWithSuperAndPrologue.es5.ts diff --git a/src/compiler/transformers/es2015.ts b/src/compiler/transformers/es2015.ts index 36a0f29d109..38ad28faacc 100644 --- a/src/compiler/transformers/es2015.ts +++ b/src/compiler/transformers/es2015.ts @@ -1146,7 +1146,7 @@ namespace ts { [ ...existingPrologue, ...prologue, - ...(superStatementIndex <= existingPrologue.length ? emptyArray : visitNodes(constructor.body.statements, visitor, isStatement, existingPrologue.length, superStatementIndex)), + ...(superStatementIndex <= existingPrologue.length ? emptyArray : visitNodes(constructor.body.statements, visitor, isStatement, existingPrologue.length, superStatementIndex - existingPrologue.length)), ...statements ] ), diff --git a/tests/baselines/reference/constructorWithSuperAndPrologue.es5.js b/tests/baselines/reference/constructorWithSuperAndPrologue.es5.js new file mode 100644 index 00000000000..a06a4f7a4fa --- /dev/null +++ b/tests/baselines/reference/constructorWithSuperAndPrologue.es5.js @@ -0,0 +1,52 @@ +//// [constructorWithSuperAndPrologue.es5.ts] +// https://github.com/microsoft/TypeScript/issues/48761 +"use strict"; + +class A { + public constructor() { + console.log("A") + } +} + +class B extends A { + constructor() { + "ngInject"; + console.log("B") + super(); + } +} + + +//// [constructorWithSuperAndPrologue.es5.js] +// https://github.com/microsoft/TypeScript/issues/48761 +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var A = /** @class */ (function () { + function A() { + console.log("A"); + } + return A; +}()); +var B = /** @class */ (function (_super) { + __extends(B, _super); + function B() { + "ngInject"; + console.log("B"); + return _super.call(this) || this; + } + return B; +}(A)); diff --git a/tests/baselines/reference/constructorWithSuperAndPrologue.es5.symbols b/tests/baselines/reference/constructorWithSuperAndPrologue.es5.symbols new file mode 100644 index 00000000000..4ec2815f8a4 --- /dev/null +++ b/tests/baselines/reference/constructorWithSuperAndPrologue.es5.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/constructorWithSuperAndPrologue.es5.ts === +// https://github.com/microsoft/TypeScript/issues/48761 +"use strict"; + +class A { +>A : Symbol(A, Decl(constructorWithSuperAndPrologue.es5.ts, 1, 13)) + + public constructor() { + console.log("A") +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) + } +} + +class B extends A { +>B : Symbol(B, Decl(constructorWithSuperAndPrologue.es5.ts, 7, 1)) +>A : Symbol(A, Decl(constructorWithSuperAndPrologue.es5.ts, 1, 13)) + + constructor() { + "ngInject"; + console.log("B") +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) + + super(); +>super : Symbol(A, Decl(constructorWithSuperAndPrologue.es5.ts, 1, 13)) + } +} + diff --git a/tests/baselines/reference/constructorWithSuperAndPrologue.es5.types b/tests/baselines/reference/constructorWithSuperAndPrologue.es5.types new file mode 100644 index 00000000000..7e615a1a660 --- /dev/null +++ b/tests/baselines/reference/constructorWithSuperAndPrologue.es5.types @@ -0,0 +1,39 @@ +=== tests/cases/compiler/constructorWithSuperAndPrologue.es5.ts === +// https://github.com/microsoft/TypeScript/issues/48761 +"use strict"; +>"use strict" : "use strict" + +class A { +>A : A + + public constructor() { + console.log("A") +>console.log("A") : void +>console.log : (...data: any[]) => void +>console : Console +>log : (...data: any[]) => void +>"A" : "A" + } +} + +class B extends A { +>B : B +>A : A + + constructor() { + "ngInject"; +>"ngInject" : "ngInject" + + console.log("B") +>console.log("B") : void +>console.log : (...data: any[]) => void +>console : Console +>log : (...data: any[]) => void +>"B" : "B" + + super(); +>super() : void +>super : typeof A + } +} + diff --git a/tests/cases/compiler/constructorWithSuperAndPrologue.es5.ts b/tests/cases/compiler/constructorWithSuperAndPrologue.es5.ts new file mode 100644 index 00000000000..1f4fc747648 --- /dev/null +++ b/tests/cases/compiler/constructorWithSuperAndPrologue.es5.ts @@ -0,0 +1,17 @@ +// @target: es5 +// https://github.com/microsoft/TypeScript/issues/48761 +"use strict"; + +class A { + public constructor() { + console.log("A") + } +} + +class B extends A { + constructor() { + "ngInject"; + console.log("B") + super(); + } +} From d81a976c14f8464f4b1d4d3ccc0414100e701b33 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Tue, 19 Apr 2022 15:23:25 -0700 Subject: [PATCH 05/63] Ensure enum aliases referenced in other enum members do not get marked as referenced (#48770) * Add test * Ensure enum aliases referenced in other enum members do not get marked as referenced --- src/compiler/checker.ts | 11 ++++-- .../baselines/reference/importElisionEnum.js | 35 +++++++++++++++++++ .../reference/importElisionEnum.symbols | 31 ++++++++++++++++ .../reference/importElisionEnum.types | 32 +++++++++++++++++ tests/cases/compiler/importElisionEnum.ts | 14 ++++++++ 5 files changed, 121 insertions(+), 2 deletions(-) create mode 100644 tests/baselines/reference/importElisionEnum.js create mode 100644 tests/baselines/reference/importElisionEnum.symbols create mode 100644 tests/baselines/reference/importElisionEnum.types create mode 100644 tests/cases/compiler/importElisionEnum.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 3f5f51acd71..9fe998636a3 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -28946,10 +28946,17 @@ namespace ts { prop = getPropertyOfType(apparentType, right.escapedText); } // In `Foo.Bar.Baz`, 'Foo' is not referenced if 'Bar' is a const enum or a module containing only const enums. + // `Foo` is also not referenced in `enum FooCopy { Bar = Foo.Bar }`, because the enum member value gets inlined + // here even if `Foo` is not a const enum. + // // The exceptions are: // 1. if 'isolatedModules' is enabled, because the const enum value will not be inlined, and // 2. if 'preserveConstEnums' is enabled and the expression is itself an export, e.g. `export = Foo.Bar.Baz`. - if (isIdentifier(left) && parentSymbol && (compilerOptions.isolatedModules || !(prop && isConstEnumOrConstEnumOnlyModule(prop)) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) { + if (isIdentifier(left) && parentSymbol && ( + compilerOptions.isolatedModules || + !(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & SymbolFlags.EnumMember && node.parent.kind === SyntaxKind.EnumMember)) || + shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node) + )) { markAliasReferenced(parentSymbol, node); } @@ -40224,7 +40231,7 @@ namespace ts { function isConstantMemberAccess(node: Expression): node is AccessExpression { const type = getTypeOfExpression(node); - if(type === errorType) { + if (type === errorType) { return false; } diff --git a/tests/baselines/reference/importElisionEnum.js b/tests/baselines/reference/importElisionEnum.js new file mode 100644 index 00000000000..31c9a5bd8f6 --- /dev/null +++ b/tests/baselines/reference/importElisionEnum.js @@ -0,0 +1,35 @@ +//// [tests/cases/compiler/importElisionEnum.ts] //// + +//// [enum.ts] +export enum MyEnum { + a = 0, + b, + c, + d +} + +//// [index.ts] +import { MyEnum as MyEnumFromModule } from "./enum"; + +enum MyEnum { + a = MyEnumFromModule.a +} + +//// [enum.js] +"use strict"; +exports.__esModule = true; +exports.MyEnum = void 0; +var MyEnum; +(function (MyEnum) { + MyEnum[MyEnum["a"] = 0] = "a"; + MyEnum[MyEnum["b"] = 1] = "b"; + MyEnum[MyEnum["c"] = 2] = "c"; + MyEnum[MyEnum["d"] = 3] = "d"; +})(MyEnum = exports.MyEnum || (exports.MyEnum = {})); +//// [index.js] +"use strict"; +exports.__esModule = true; +var MyEnum; +(function (MyEnum) { + MyEnum[MyEnum["a"] = 0] = "a"; +})(MyEnum || (MyEnum = {})); diff --git a/tests/baselines/reference/importElisionEnum.symbols b/tests/baselines/reference/importElisionEnum.symbols new file mode 100644 index 00000000000..5e81a547d67 --- /dev/null +++ b/tests/baselines/reference/importElisionEnum.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/enum.ts === +export enum MyEnum { +>MyEnum : Symbol(MyEnum, Decl(enum.ts, 0, 0)) + + a = 0, +>a : Symbol(MyEnum.a, Decl(enum.ts, 0, 20)) + + b, +>b : Symbol(MyEnum.b, Decl(enum.ts, 1, 8)) + + c, +>c : Symbol(MyEnum.c, Decl(enum.ts, 2, 4)) + + d +>d : Symbol(MyEnum.d, Decl(enum.ts, 3, 4)) +} + +=== tests/cases/compiler/index.ts === +import { MyEnum as MyEnumFromModule } from "./enum"; +>MyEnum : Symbol(MyEnumFromModule, Decl(enum.ts, 0, 0)) +>MyEnumFromModule : Symbol(MyEnumFromModule, Decl(index.ts, 0, 8)) + +enum MyEnum { +>MyEnum : Symbol(MyEnum, Decl(index.ts, 0, 52)) + + a = MyEnumFromModule.a +>a : Symbol(MyEnum.a, Decl(index.ts, 2, 13)) +>MyEnumFromModule.a : Symbol(MyEnumFromModule.a, Decl(enum.ts, 0, 20)) +>MyEnumFromModule : Symbol(MyEnumFromModule, Decl(index.ts, 0, 8)) +>a : Symbol(MyEnumFromModule.a, Decl(enum.ts, 0, 20)) +} diff --git a/tests/baselines/reference/importElisionEnum.types b/tests/baselines/reference/importElisionEnum.types new file mode 100644 index 00000000000..17e8b874bf0 --- /dev/null +++ b/tests/baselines/reference/importElisionEnum.types @@ -0,0 +1,32 @@ +=== tests/cases/compiler/enum.ts === +export enum MyEnum { +>MyEnum : MyEnum + + a = 0, +>a : MyEnum.a +>0 : 0 + + b, +>b : MyEnum.b + + c, +>c : MyEnum.c + + d +>d : MyEnum.d +} + +=== tests/cases/compiler/index.ts === +import { MyEnum as MyEnumFromModule } from "./enum"; +>MyEnum : typeof MyEnumFromModule +>MyEnumFromModule : typeof MyEnumFromModule + +enum MyEnum { +>MyEnum : MyEnum + + a = MyEnumFromModule.a +>a : MyEnum +>MyEnumFromModule.a : MyEnumFromModule.a +>MyEnumFromModule : typeof MyEnumFromModule +>a : MyEnumFromModule.a +} diff --git a/tests/cases/compiler/importElisionEnum.ts b/tests/cases/compiler/importElisionEnum.ts new file mode 100644 index 00000000000..89989cc7b53 --- /dev/null +++ b/tests/cases/compiler/importElisionEnum.ts @@ -0,0 +1,14 @@ +// @Filename: enum.ts +export enum MyEnum { + a = 0, + b, + c, + d +} + +// @Filename: index.ts +import { MyEnum as MyEnumFromModule } from "./enum"; + +enum MyEnum { + a = MyEnumFromModule.a +} \ No newline at end of file From ce487e4fd37cd8715191e5f641c08a120de90521 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 19 Apr 2022 17:57:06 -0700 Subject: [PATCH 06/63] Fix meta property symbol lookup (#48773) --- src/compiler/checker.ts | 19 ++++++++++++------- ...rtMeta(module=commonjs,target=es5).symbols | 9 +++++++++ ...eta(module=commonjs,target=esnext).symbols | 9 +++++++++ ...portMeta(module=es2020,target=es5).symbols | 9 +++++++++ ...tMeta(module=es2020,target=esnext).symbols | 9 +++++++++ ...portMeta(module=esnext,target=es5).symbols | 9 +++++++++ ...tMeta(module=esnext,target=esnext).symbols | 9 +++++++++ ...portMeta(module=system,target=es5).symbols | 9 +++++++++ ...tMeta(module=system,target=esnext).symbols | 9 +++++++++ ...importMetaNarrowing(module=es2020).symbols | 2 ++ ...importMetaNarrowing(module=esnext).symbols | 2 ++ ...importMetaNarrowing(module=system).symbols | 2 ++ .../misspelledNewMetaProperty.symbols | 1 - ...esAllowJsImportMeta(module=node12).symbols | 2 ++ ...AllowJsImportMeta(module=nodenext).symbols | 2 ++ ...deModulesImportMeta(module=node12).symbols | 2 ++ ...ModulesImportMeta(module=nodenext).symbols | 2 ++ .../reference/plainJSGrammarErrors.symbols | 1 - .../fourslash/goToDefinitionImportMeta.ts | 2 ++ 19 files changed, 100 insertions(+), 9 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 9fe998636a3..2d3060682ff 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -41982,15 +41982,20 @@ namespace ts { return propertyDeclaration; } } - else if (isMetaProperty(parent)) { - const parentType = getTypeOfNode(parent); - const propertyDeclaration = getPropertyOfType(parentType, (node as Identifier).escapedText); - if (propertyDeclaration) { - return propertyDeclaration; - } - if (parent.keywordToken === SyntaxKind.NewKeyword) { + else if (isMetaProperty(parent) && parent.name === node) { + if (parent.keywordToken === SyntaxKind.NewKeyword && idText(node as Identifier) === "target") { + // `target` in `new.target` return checkNewTargetMetaProperty(parent).symbol; } + // The `meta` in `import.meta` could be given `getTypeOfNode(parent).symbol` (the `ImportMeta` interface symbol), but + // we have a fake expression type made for other reasons already, whose transient `meta` + // member should more exactly be the kind of (declarationless) symbol we want. + // (See #44364 and #45031 for relevant implementation PRs) + if (parent.keywordToken === SyntaxKind.ImportKeyword && idText(node as Identifier) === "meta") { + return getGlobalImportMetaExpressionType().members!.get("meta" as __String); + } + // no other meta properties are valid syntax, thus no others should have symbols + return undefined; } } diff --git a/tests/baselines/reference/importMeta(module=commonjs,target=es5).symbols b/tests/baselines/reference/importMeta(module=commonjs,target=es5).symbols index d012bf0903c..334c5c3c327 100644 --- a/tests/baselines/reference/importMeta(module=commonjs,target=es5).symbols +++ b/tests/baselines/reference/importMeta(module=commonjs,target=es5).symbols @@ -8,6 +8,7 @@ >URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) >import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --)) @@ -20,6 +21,7 @@ const size = import.meta.scriptElement.dataset.size || 300; >size : Symbol(size, Decl(example.ts, 5, 7)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) const image = new Image(); >image : Symbol(image, Decl(example.ts, 7, 7)) @@ -57,6 +59,7 @@ export let x = import.meta; >x : Symbol(x, Decl(moduleLookingFile01.ts, 0, 10)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) export let y = import.metal; >y : Symbol(y, Decl(moduleLookingFile01.ts, 1, 10)) @@ -68,6 +71,7 @@ export let z = import.import.import.malkovich; let globalA = import.meta; >globalA : Symbol(globalA, Decl(scriptLookingFile01.ts, 0, 3)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) let globalB = import.metal; >globalB : Symbol(globalB, Decl(scriptLookingFile01.ts, 1, 3)) @@ -80,11 +84,15 @@ export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta >foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12)) >ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) import.meta = foo; >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12)) // @Filename augmentations.ts @@ -108,5 +116,6 @@ const { a, b, c } = import.meta.wellKnownProperty; >c : Symbol(c, Decl(assignmentTargets.ts, 10, 13)) >import.meta.wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24)) diff --git a/tests/baselines/reference/importMeta(module=commonjs,target=esnext).symbols b/tests/baselines/reference/importMeta(module=commonjs,target=esnext).symbols index d012bf0903c..334c5c3c327 100644 --- a/tests/baselines/reference/importMeta(module=commonjs,target=esnext).symbols +++ b/tests/baselines/reference/importMeta(module=commonjs,target=esnext).symbols @@ -8,6 +8,7 @@ >URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) >import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --)) @@ -20,6 +21,7 @@ const size = import.meta.scriptElement.dataset.size || 300; >size : Symbol(size, Decl(example.ts, 5, 7)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) const image = new Image(); >image : Symbol(image, Decl(example.ts, 7, 7)) @@ -57,6 +59,7 @@ export let x = import.meta; >x : Symbol(x, Decl(moduleLookingFile01.ts, 0, 10)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) export let y = import.metal; >y : Symbol(y, Decl(moduleLookingFile01.ts, 1, 10)) @@ -68,6 +71,7 @@ export let z = import.import.import.malkovich; let globalA = import.meta; >globalA : Symbol(globalA, Decl(scriptLookingFile01.ts, 0, 3)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) let globalB = import.metal; >globalB : Symbol(globalB, Decl(scriptLookingFile01.ts, 1, 3)) @@ -80,11 +84,15 @@ export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta >foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12)) >ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) import.meta = foo; >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12)) // @Filename augmentations.ts @@ -108,5 +116,6 @@ const { a, b, c } = import.meta.wellKnownProperty; >c : Symbol(c, Decl(assignmentTargets.ts, 10, 13)) >import.meta.wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24)) diff --git a/tests/baselines/reference/importMeta(module=es2020,target=es5).symbols b/tests/baselines/reference/importMeta(module=es2020,target=es5).symbols index d012bf0903c..334c5c3c327 100644 --- a/tests/baselines/reference/importMeta(module=es2020,target=es5).symbols +++ b/tests/baselines/reference/importMeta(module=es2020,target=es5).symbols @@ -8,6 +8,7 @@ >URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) >import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --)) @@ -20,6 +21,7 @@ const size = import.meta.scriptElement.dataset.size || 300; >size : Symbol(size, Decl(example.ts, 5, 7)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) const image = new Image(); >image : Symbol(image, Decl(example.ts, 7, 7)) @@ -57,6 +59,7 @@ export let x = import.meta; >x : Symbol(x, Decl(moduleLookingFile01.ts, 0, 10)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) export let y = import.metal; >y : Symbol(y, Decl(moduleLookingFile01.ts, 1, 10)) @@ -68,6 +71,7 @@ export let z = import.import.import.malkovich; let globalA = import.meta; >globalA : Symbol(globalA, Decl(scriptLookingFile01.ts, 0, 3)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) let globalB = import.metal; >globalB : Symbol(globalB, Decl(scriptLookingFile01.ts, 1, 3)) @@ -80,11 +84,15 @@ export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta >foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12)) >ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) import.meta = foo; >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12)) // @Filename augmentations.ts @@ -108,5 +116,6 @@ const { a, b, c } = import.meta.wellKnownProperty; >c : Symbol(c, Decl(assignmentTargets.ts, 10, 13)) >import.meta.wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24)) diff --git a/tests/baselines/reference/importMeta(module=es2020,target=esnext).symbols b/tests/baselines/reference/importMeta(module=es2020,target=esnext).symbols index d012bf0903c..334c5c3c327 100644 --- a/tests/baselines/reference/importMeta(module=es2020,target=esnext).symbols +++ b/tests/baselines/reference/importMeta(module=es2020,target=esnext).symbols @@ -8,6 +8,7 @@ >URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) >import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --)) @@ -20,6 +21,7 @@ const size = import.meta.scriptElement.dataset.size || 300; >size : Symbol(size, Decl(example.ts, 5, 7)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) const image = new Image(); >image : Symbol(image, Decl(example.ts, 7, 7)) @@ -57,6 +59,7 @@ export let x = import.meta; >x : Symbol(x, Decl(moduleLookingFile01.ts, 0, 10)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) export let y = import.metal; >y : Symbol(y, Decl(moduleLookingFile01.ts, 1, 10)) @@ -68,6 +71,7 @@ export let z = import.import.import.malkovich; let globalA = import.meta; >globalA : Symbol(globalA, Decl(scriptLookingFile01.ts, 0, 3)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) let globalB = import.metal; >globalB : Symbol(globalB, Decl(scriptLookingFile01.ts, 1, 3)) @@ -80,11 +84,15 @@ export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta >foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12)) >ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) import.meta = foo; >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12)) // @Filename augmentations.ts @@ -108,5 +116,6 @@ const { a, b, c } = import.meta.wellKnownProperty; >c : Symbol(c, Decl(assignmentTargets.ts, 10, 13)) >import.meta.wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24)) diff --git a/tests/baselines/reference/importMeta(module=esnext,target=es5).symbols b/tests/baselines/reference/importMeta(module=esnext,target=es5).symbols index d012bf0903c..334c5c3c327 100644 --- a/tests/baselines/reference/importMeta(module=esnext,target=es5).symbols +++ b/tests/baselines/reference/importMeta(module=esnext,target=es5).symbols @@ -8,6 +8,7 @@ >URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) >import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --)) @@ -20,6 +21,7 @@ const size = import.meta.scriptElement.dataset.size || 300; >size : Symbol(size, Decl(example.ts, 5, 7)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) const image = new Image(); >image : Symbol(image, Decl(example.ts, 7, 7)) @@ -57,6 +59,7 @@ export let x = import.meta; >x : Symbol(x, Decl(moduleLookingFile01.ts, 0, 10)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) export let y = import.metal; >y : Symbol(y, Decl(moduleLookingFile01.ts, 1, 10)) @@ -68,6 +71,7 @@ export let z = import.import.import.malkovich; let globalA = import.meta; >globalA : Symbol(globalA, Decl(scriptLookingFile01.ts, 0, 3)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) let globalB = import.metal; >globalB : Symbol(globalB, Decl(scriptLookingFile01.ts, 1, 3)) @@ -80,11 +84,15 @@ export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta >foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12)) >ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) import.meta = foo; >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12)) // @Filename augmentations.ts @@ -108,5 +116,6 @@ const { a, b, c } = import.meta.wellKnownProperty; >c : Symbol(c, Decl(assignmentTargets.ts, 10, 13)) >import.meta.wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24)) diff --git a/tests/baselines/reference/importMeta(module=esnext,target=esnext).symbols b/tests/baselines/reference/importMeta(module=esnext,target=esnext).symbols index d012bf0903c..334c5c3c327 100644 --- a/tests/baselines/reference/importMeta(module=esnext,target=esnext).symbols +++ b/tests/baselines/reference/importMeta(module=esnext,target=esnext).symbols @@ -8,6 +8,7 @@ >URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) >import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --)) @@ -20,6 +21,7 @@ const size = import.meta.scriptElement.dataset.size || 300; >size : Symbol(size, Decl(example.ts, 5, 7)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) const image = new Image(); >image : Symbol(image, Decl(example.ts, 7, 7)) @@ -57,6 +59,7 @@ export let x = import.meta; >x : Symbol(x, Decl(moduleLookingFile01.ts, 0, 10)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) export let y = import.metal; >y : Symbol(y, Decl(moduleLookingFile01.ts, 1, 10)) @@ -68,6 +71,7 @@ export let z = import.import.import.malkovich; let globalA = import.meta; >globalA : Symbol(globalA, Decl(scriptLookingFile01.ts, 0, 3)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) let globalB = import.metal; >globalB : Symbol(globalB, Decl(scriptLookingFile01.ts, 1, 3)) @@ -80,11 +84,15 @@ export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta >foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12)) >ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) import.meta = foo; >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12)) // @Filename augmentations.ts @@ -108,5 +116,6 @@ const { a, b, c } = import.meta.wellKnownProperty; >c : Symbol(c, Decl(assignmentTargets.ts, 10, 13)) >import.meta.wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24)) diff --git a/tests/baselines/reference/importMeta(module=system,target=es5).symbols b/tests/baselines/reference/importMeta(module=system,target=es5).symbols index d012bf0903c..334c5c3c327 100644 --- a/tests/baselines/reference/importMeta(module=system,target=es5).symbols +++ b/tests/baselines/reference/importMeta(module=system,target=es5).symbols @@ -8,6 +8,7 @@ >URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) >import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --)) @@ -20,6 +21,7 @@ const size = import.meta.scriptElement.dataset.size || 300; >size : Symbol(size, Decl(example.ts, 5, 7)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) const image = new Image(); >image : Symbol(image, Decl(example.ts, 7, 7)) @@ -57,6 +59,7 @@ export let x = import.meta; >x : Symbol(x, Decl(moduleLookingFile01.ts, 0, 10)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) export let y = import.metal; >y : Symbol(y, Decl(moduleLookingFile01.ts, 1, 10)) @@ -68,6 +71,7 @@ export let z = import.import.import.malkovich; let globalA = import.meta; >globalA : Symbol(globalA, Decl(scriptLookingFile01.ts, 0, 3)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) let globalB = import.metal; >globalB : Symbol(globalB, Decl(scriptLookingFile01.ts, 1, 3)) @@ -80,11 +84,15 @@ export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta >foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12)) >ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) import.meta = foo; >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12)) // @Filename augmentations.ts @@ -108,5 +116,6 @@ const { a, b, c } = import.meta.wellKnownProperty; >c : Symbol(c, Decl(assignmentTargets.ts, 10, 13)) >import.meta.wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24)) diff --git a/tests/baselines/reference/importMeta(module=system,target=esnext).symbols b/tests/baselines/reference/importMeta(module=system,target=esnext).symbols index d012bf0903c..334c5c3c327 100644 --- a/tests/baselines/reference/importMeta(module=system,target=esnext).symbols +++ b/tests/baselines/reference/importMeta(module=system,target=esnext).symbols @@ -8,6 +8,7 @@ >URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) >import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --)) @@ -20,6 +21,7 @@ const size = import.meta.scriptElement.dataset.size || 300; >size : Symbol(size, Decl(example.ts, 5, 7)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) const image = new Image(); >image : Symbol(image, Decl(example.ts, 7, 7)) @@ -57,6 +59,7 @@ export let x = import.meta; >x : Symbol(x, Decl(moduleLookingFile01.ts, 0, 10)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) export let y = import.metal; >y : Symbol(y, Decl(moduleLookingFile01.ts, 1, 10)) @@ -68,6 +71,7 @@ export let z = import.import.import.malkovich; let globalA = import.meta; >globalA : Symbol(globalA, Decl(scriptLookingFile01.ts, 0, 3)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) let globalB = import.metal; >globalB : Symbol(globalB, Decl(scriptLookingFile01.ts, 1, 3)) @@ -80,11 +84,15 @@ export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta >foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12)) >ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) import.meta = foo; >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12)) // @Filename augmentations.ts @@ -108,5 +116,6 @@ const { a, b, c } = import.meta.wellKnownProperty; >c : Symbol(c, Decl(assignmentTargets.ts, 10, 13)) >import.meta.wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16)) +>meta : Symbol(ImportMetaExpression.meta) >wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24)) diff --git a/tests/baselines/reference/importMetaNarrowing(module=es2020).symbols b/tests/baselines/reference/importMetaNarrowing(module=es2020).symbols index f2c77663a50..4d932447a7c 100644 --- a/tests/baselines/reference/importMetaNarrowing(module=es2020).symbols +++ b/tests/baselines/reference/importMetaNarrowing(module=es2020).symbols @@ -7,11 +7,13 @@ declare global { interface ImportMeta {foo?: () => void} }; if (import.meta.foo) { >import.meta.foo : Symbol(ImportMeta.foo, Decl(importMetaNarrowing.ts, 0, 39)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(importMetaNarrowing.ts, 0, 16)) +>meta : Symbol(ImportMetaExpression.meta) >foo : Symbol(ImportMeta.foo, Decl(importMetaNarrowing.ts, 0, 39)) import.meta.foo(); >import.meta.foo : Symbol(ImportMeta.foo, Decl(importMetaNarrowing.ts, 0, 39)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(importMetaNarrowing.ts, 0, 16)) +>meta : Symbol(ImportMetaExpression.meta) >foo : Symbol(ImportMeta.foo, Decl(importMetaNarrowing.ts, 0, 39)) } diff --git a/tests/baselines/reference/importMetaNarrowing(module=esnext).symbols b/tests/baselines/reference/importMetaNarrowing(module=esnext).symbols index f2c77663a50..4d932447a7c 100644 --- a/tests/baselines/reference/importMetaNarrowing(module=esnext).symbols +++ b/tests/baselines/reference/importMetaNarrowing(module=esnext).symbols @@ -7,11 +7,13 @@ declare global { interface ImportMeta {foo?: () => void} }; if (import.meta.foo) { >import.meta.foo : Symbol(ImportMeta.foo, Decl(importMetaNarrowing.ts, 0, 39)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(importMetaNarrowing.ts, 0, 16)) +>meta : Symbol(ImportMetaExpression.meta) >foo : Symbol(ImportMeta.foo, Decl(importMetaNarrowing.ts, 0, 39)) import.meta.foo(); >import.meta.foo : Symbol(ImportMeta.foo, Decl(importMetaNarrowing.ts, 0, 39)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(importMetaNarrowing.ts, 0, 16)) +>meta : Symbol(ImportMetaExpression.meta) >foo : Symbol(ImportMeta.foo, Decl(importMetaNarrowing.ts, 0, 39)) } diff --git a/tests/baselines/reference/importMetaNarrowing(module=system).symbols b/tests/baselines/reference/importMetaNarrowing(module=system).symbols index f2c77663a50..4d932447a7c 100644 --- a/tests/baselines/reference/importMetaNarrowing(module=system).symbols +++ b/tests/baselines/reference/importMetaNarrowing(module=system).symbols @@ -7,11 +7,13 @@ declare global { interface ImportMeta {foo?: () => void} }; if (import.meta.foo) { >import.meta.foo : Symbol(ImportMeta.foo, Decl(importMetaNarrowing.ts, 0, 39)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(importMetaNarrowing.ts, 0, 16)) +>meta : Symbol(ImportMetaExpression.meta) >foo : Symbol(ImportMeta.foo, Decl(importMetaNarrowing.ts, 0, 39)) import.meta.foo(); >import.meta.foo : Symbol(ImportMeta.foo, Decl(importMetaNarrowing.ts, 0, 39)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(importMetaNarrowing.ts, 0, 16)) +>meta : Symbol(ImportMetaExpression.meta) >foo : Symbol(ImportMeta.foo, Decl(importMetaNarrowing.ts, 0, 39)) } diff --git a/tests/baselines/reference/misspelledNewMetaProperty.symbols b/tests/baselines/reference/misspelledNewMetaProperty.symbols index 55ab6fe7a67..d14d7eadeff 100644 --- a/tests/baselines/reference/misspelledNewMetaProperty.symbols +++ b/tests/baselines/reference/misspelledNewMetaProperty.symbols @@ -2,5 +2,4 @@ function foo(){new.targ} >foo : Symbol(foo, Decl(misspelledNewMetaProperty.ts, 0, 0)) >new.targ : Symbol(foo, Decl(misspelledNewMetaProperty.ts, 0, 0)) ->targ : Symbol(foo, Decl(misspelledNewMetaProperty.ts, 0, 0)) diff --git a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).symbols b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).symbols index 02586281af4..89649ba7b33 100644 --- a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).symbols +++ b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).symbols @@ -4,6 +4,7 @@ const x = import.meta.url; >x : Symbol(x, Decl(index.js, 1, 5)) >import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) +>meta : Symbol(ImportMetaExpression.meta) >url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) export {x}; @@ -15,6 +16,7 @@ const x = import.meta.url; >x : Symbol(x, Decl(index.js, 1, 5)) >import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) +>meta : Symbol(ImportMetaExpression.meta) >url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) export {x}; diff --git a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=nodenext).symbols b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=nodenext).symbols index 02586281af4..89649ba7b33 100644 --- a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=nodenext).symbols +++ b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=nodenext).symbols @@ -4,6 +4,7 @@ const x = import.meta.url; >x : Symbol(x, Decl(index.js, 1, 5)) >import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) +>meta : Symbol(ImportMetaExpression.meta) >url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) export {x}; @@ -15,6 +16,7 @@ const x = import.meta.url; >x : Symbol(x, Decl(index.js, 1, 5)) >import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) +>meta : Symbol(ImportMetaExpression.meta) >url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) export {x}; diff --git a/tests/baselines/reference/nodeModulesImportMeta(module=node12).symbols b/tests/baselines/reference/nodeModulesImportMeta(module=node12).symbols index 311b12e19ce..4a9cda0f125 100644 --- a/tests/baselines/reference/nodeModulesImportMeta(module=node12).symbols +++ b/tests/baselines/reference/nodeModulesImportMeta(module=node12).symbols @@ -4,6 +4,7 @@ const x = import.meta.url; >x : Symbol(x, Decl(index.ts, 1, 5)) >import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) +>meta : Symbol(ImportMetaExpression.meta) >url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) export {x}; @@ -15,6 +16,7 @@ const x = import.meta.url; >x : Symbol(x, Decl(index.ts, 1, 5)) >import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) +>meta : Symbol(ImportMetaExpression.meta) >url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) export {x}; diff --git a/tests/baselines/reference/nodeModulesImportMeta(module=nodenext).symbols b/tests/baselines/reference/nodeModulesImportMeta(module=nodenext).symbols index 311b12e19ce..4a9cda0f125 100644 --- a/tests/baselines/reference/nodeModulesImportMeta(module=nodenext).symbols +++ b/tests/baselines/reference/nodeModulesImportMeta(module=nodenext).symbols @@ -4,6 +4,7 @@ const x = import.meta.url; >x : Symbol(x, Decl(index.ts, 1, 5)) >import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) +>meta : Symbol(ImportMetaExpression.meta) >url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) export {x}; @@ -15,6 +16,7 @@ const x = import.meta.url; >x : Symbol(x, Decl(index.ts, 1, 5)) >import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) >import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) +>meta : Symbol(ImportMetaExpression.meta) >url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) export {x}; diff --git a/tests/baselines/reference/plainJSGrammarErrors.symbols b/tests/baselines/reference/plainJSGrammarErrors.symbols index cc3420d34f9..340f1bc2a82 100644 --- a/tests/baselines/reference/plainJSGrammarErrors.symbols +++ b/tests/baselines/reference/plainJSGrammarErrors.symbols @@ -455,7 +455,6 @@ export let noMeta = import.metal function foo() { new.targe } >foo : Symbol(foo, Decl(plainJSGrammarErrors.js, 200, 32)) >new.targe : Symbol(foo, Decl(plainJSGrammarErrors.js, 200, 32)) ->targe : Symbol(foo, Decl(plainJSGrammarErrors.js, 200, 32)) const nullaryDynamicImport = import() >nullaryDynamicImport : Symbol(nullaryDynamicImport, Decl(plainJSGrammarErrors.js, 202, 5)) diff --git a/tests/cases/fourslash/goToDefinitionImportMeta.ts b/tests/cases/fourslash/goToDefinitionImportMeta.ts index 4594fef1b67..723d9208b88 100644 --- a/tests/cases/fourslash/goToDefinitionImportMeta.ts +++ b/tests/cases/fourslash/goToDefinitionImportMeta.ts @@ -11,3 +11,5 @@ ////} verify.goToDefinition("reference", []); + +verify.noErrors(); \ No newline at end of file From 273a567617b104a7a66a8fd923582477dabc8f77 Mon Sep 17 00:00:00 2001 From: John Lusty <54030459+jlusty@users.noreply.github.com> Date: Wed, 20 Apr 2022 16:49:22 +0100 Subject: [PATCH 07/63] Fix handling of prologue statements when there are parameter property declarations (#48775) --- src/compiler/transformers/classFields.ts | 30 +++--- ...ameterPropertiesAndPrivateFields.es2015.js | 72 +++++++++++++++ ...rPropertiesAndPrivateFields.es2015.symbols | 80 ++++++++++++++++ ...terPropertiesAndPrivateFields.es2015.types | 92 +++++++++++++++++++ ...ameterPropertiesAndPrivateFields.es2015.ts | 29 ++++++ 5 files changed, 289 insertions(+), 14 deletions(-) create mode 100644 tests/baselines/reference/constructorWithParameterPropertiesAndPrivateFields.es2015.js create mode 100644 tests/baselines/reference/constructorWithParameterPropertiesAndPrivateFields.es2015.symbols create mode 100644 tests/baselines/reference/constructorWithParameterPropertiesAndPrivateFields.es2015.types create mode 100644 tests/cases/compiler/constructorWithParameterPropertiesAndPrivateFields.es2015.ts diff --git a/src/compiler/transformers/classFields.ts b/src/compiler/transformers/classFields.ts index 3ac842e8aba..cff2be7fb78 100644 --- a/src/compiler/transformers/classFields.ts +++ b/src/compiler/transformers/classFields.ts @@ -1294,7 +1294,7 @@ namespace ts { resumeLexicalEnvironment(); const needsSyntheticConstructor = !constructor && isDerivedClass; - let indexOfFirstStatementAfterSuper = 0; + let indexOfFirstStatementAfterSuperAndPrologue = 0; let prologueStatementCount = 0; let superStatementIndex = -1; let statements: Statement[] = []; @@ -1305,13 +1305,16 @@ namespace ts { // If there was a super call, visit existing statements up to and including it if (superStatementIndex >= 0) { - indexOfFirstStatementAfterSuper = superStatementIndex + 1; + indexOfFirstStatementAfterSuperAndPrologue = superStatementIndex + 1; statements = [ ...statements.slice(0, prologueStatementCount), - ...visitNodes(constructor.body.statements, visitor, isStatement, prologueStatementCount, indexOfFirstStatementAfterSuper - prologueStatementCount), + ...visitNodes(constructor.body.statements, visitor, isStatement, prologueStatementCount, indexOfFirstStatementAfterSuperAndPrologue - prologueStatementCount), ...statements.slice(prologueStatementCount), ]; } + else if (prologueStatementCount >= 0) { + indexOfFirstStatementAfterSuperAndPrologue = prologueStatementCount; + } } if (needsSyntheticConstructor) { @@ -1354,26 +1357,25 @@ namespace ts { } } if (parameterPropertyDeclarationCount > 0) { - const parameterProperties = visitNodes(constructor.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuper, parameterPropertyDeclarationCount); + const parameterProperties = visitNodes(constructor.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuperAndPrologue, parameterPropertyDeclarationCount); // If there was a super() call found, add parameter properties immediately after it if (superStatementIndex >= 0) { addRange(statements, parameterProperties); } - // If a synthetic super() call was added, add them just after it - else if (needsSyntheticConstructor) { + else { + // Add add parameter properties to the top of the constructor after the prologue + let superAndPrologueStatementCount = prologueStatementCount; + // If a synthetic super() call was added, need to account for that + if (needsSyntheticConstructor) superAndPrologueStatementCount++; statements = [ - statements[0], + ...statements.slice(0, superAndPrologueStatementCount), ...parameterProperties, - ...statements.slice(1), + ...statements.slice(superAndPrologueStatementCount), ]; } - // Since there wasn't a super() call, add them to the top of the constructor - else { - statements = [...parameterProperties, ...statements]; - } - indexOfFirstStatementAfterSuper += parameterPropertyDeclarationCount; + indexOfFirstStatementAfterSuperAndPrologue += parameterPropertyDeclarationCount; } } } @@ -1385,7 +1387,7 @@ namespace ts { // Add existing statements after the initial prologues and super call if (constructor) { - addRange(statements, visitNodes(constructor.body!.statements, visitBodyStatement, isStatement, indexOfFirstStatementAfterSuper + prologueStatementCount)); + addRange(statements, visitNodes(constructor.body!.statements, visitBodyStatement, isStatement, indexOfFirstStatementAfterSuperAndPrologue)); } statements = factory.mergeLexicalEnvironment(statements, endLexicalEnvironment()); diff --git a/tests/baselines/reference/constructorWithParameterPropertiesAndPrivateFields.es2015.js b/tests/baselines/reference/constructorWithParameterPropertiesAndPrivateFields.es2015.js new file mode 100644 index 00000000000..9d2e2e71697 --- /dev/null +++ b/tests/baselines/reference/constructorWithParameterPropertiesAndPrivateFields.es2015.js @@ -0,0 +1,72 @@ +//// [constructorWithParameterPropertiesAndPrivateFields.es2015.ts] +// https://github.com/microsoft/TypeScript/issues/48771 + +class A { + readonly #privateField: string; + + constructor(arg: { key: string }, public exposedField: number) { + ({ key: this.#privateField } = arg); + } + + log() { + console.log(this.#privateField); + console.log(this.exposedField); + } +} + +class B { + readonly #privateField: string; + + constructor(arg: { key: string }, public exposedField: number) { + "prologue"; + ({ key: this.#privateField } = arg); + } + + log() { + console.log(this.#privateField); + console.log(this.exposedField); + } +} + + +//// [constructorWithParameterPropertiesAndPrivateFields.es2015.js] +// https://github.com/microsoft/TypeScript/issues/48771 +var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +}; +var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +}; +var _A_privateField, _B_privateField; +class A { + constructor(arg, exposedField) { + var _a; + this.exposedField = exposedField; + _A_privateField.set(this, void 0); + (_a = this, { key: ({ set value(_b) { __classPrivateFieldSet(_a, _A_privateField, _b, "f"); } }).value } = arg); + } + log() { + console.log(__classPrivateFieldGet(this, _A_privateField, "f")); + console.log(this.exposedField); + } +} +_A_privateField = new WeakMap(); +class B { + constructor(arg, exposedField) { + "prologue"; + var _a; + this.exposedField = exposedField; + _B_privateField.set(this, void 0); + (_a = this, { key: ({ set value(_b) { __classPrivateFieldSet(_a, _B_privateField, _b, "f"); } }).value } = arg); + } + log() { + console.log(__classPrivateFieldGet(this, _B_privateField, "f")); + console.log(this.exposedField); + } +} +_B_privateField = new WeakMap(); diff --git a/tests/baselines/reference/constructorWithParameterPropertiesAndPrivateFields.es2015.symbols b/tests/baselines/reference/constructorWithParameterPropertiesAndPrivateFields.es2015.symbols new file mode 100644 index 00000000000..cffef43438a --- /dev/null +++ b/tests/baselines/reference/constructorWithParameterPropertiesAndPrivateFields.es2015.symbols @@ -0,0 +1,80 @@ +=== tests/cases/compiler/constructorWithParameterPropertiesAndPrivateFields.es2015.ts === +// https://github.com/microsoft/TypeScript/issues/48771 + +class A { +>A : Symbol(A, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 0, 0)) + + readonly #privateField: string; +>#privateField : Symbol(A.#privateField, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 2, 9)) + + constructor(arg: { key: string }, public exposedField: number) { +>arg : Symbol(arg, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 5, 14)) +>key : Symbol(key, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 5, 20)) +>exposedField : Symbol(A.exposedField, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 5, 35)) + + ({ key: this.#privateField } = arg); +>key : Symbol(key, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 6, 6)) +>this.#privateField : Symbol(A.#privateField, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 2, 9)) +>this : Symbol(A, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 0, 0)) +>arg : Symbol(arg, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 5, 14)) + } + + log() { +>log : Symbol(A.log, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 7, 3)) + + console.log(this.#privateField); +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>this.#privateField : Symbol(A.#privateField, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 2, 9)) +>this : Symbol(A, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 0, 0)) + + console.log(this.exposedField); +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>this.exposedField : Symbol(A.exposedField, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 5, 35)) +>this : Symbol(A, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 0, 0)) +>exposedField : Symbol(A.exposedField, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 5, 35)) + } +} + +class B { +>B : Symbol(B, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 13, 1)) + + readonly #privateField: string; +>#privateField : Symbol(B.#privateField, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 15, 9)) + + constructor(arg: { key: string }, public exposedField: number) { +>arg : Symbol(arg, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 18, 14)) +>key : Symbol(key, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 18, 20)) +>exposedField : Symbol(B.exposedField, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 18, 35)) + + "prologue"; + ({ key: this.#privateField } = arg); +>key : Symbol(key, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 20, 6)) +>this.#privateField : Symbol(B.#privateField, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 15, 9)) +>this : Symbol(B, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 13, 1)) +>arg : Symbol(arg, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 18, 14)) + } + + log() { +>log : Symbol(B.log, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 21, 3)) + + console.log(this.#privateField); +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>this.#privateField : Symbol(B.#privateField, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 15, 9)) +>this : Symbol(B, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 13, 1)) + + console.log(this.exposedField); +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>this.exposedField : Symbol(B.exposedField, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 18, 35)) +>this : Symbol(B, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 13, 1)) +>exposedField : Symbol(B.exposedField, Decl(constructorWithParameterPropertiesAndPrivateFields.es2015.ts, 18, 35)) + } +} + diff --git a/tests/baselines/reference/constructorWithParameterPropertiesAndPrivateFields.es2015.types b/tests/baselines/reference/constructorWithParameterPropertiesAndPrivateFields.es2015.types new file mode 100644 index 00000000000..ea034c2b054 --- /dev/null +++ b/tests/baselines/reference/constructorWithParameterPropertiesAndPrivateFields.es2015.types @@ -0,0 +1,92 @@ +=== tests/cases/compiler/constructorWithParameterPropertiesAndPrivateFields.es2015.ts === +// https://github.com/microsoft/TypeScript/issues/48771 + +class A { +>A : A + + readonly #privateField: string; +>#privateField : string + + constructor(arg: { key: string }, public exposedField: number) { +>arg : { key: string; } +>key : string +>exposedField : number + + ({ key: this.#privateField } = arg); +>({ key: this.#privateField } = arg) : { key: string; } +>{ key: this.#privateField } = arg : { key: string; } +>{ key: this.#privateField } : { key: string; } +>key : string +>this.#privateField : string +>this : this +>arg : { key: string; } + } + + log() { +>log : () => void + + console.log(this.#privateField); +>console.log(this.#privateField) : void +>console.log : (...data: any[]) => void +>console : Console +>log : (...data: any[]) => void +>this.#privateField : string +>this : this + + console.log(this.exposedField); +>console.log(this.exposedField) : void +>console.log : (...data: any[]) => void +>console : Console +>log : (...data: any[]) => void +>this.exposedField : number +>this : this +>exposedField : number + } +} + +class B { +>B : B + + readonly #privateField: string; +>#privateField : string + + constructor(arg: { key: string }, public exposedField: number) { +>arg : { key: string; } +>key : string +>exposedField : number + + "prologue"; +>"prologue" : "prologue" + + ({ key: this.#privateField } = arg); +>({ key: this.#privateField } = arg) : { key: string; } +>{ key: this.#privateField } = arg : { key: string; } +>{ key: this.#privateField } : { key: string; } +>key : string +>this.#privateField : string +>this : this +>arg : { key: string; } + } + + log() { +>log : () => void + + console.log(this.#privateField); +>console.log(this.#privateField) : void +>console.log : (...data: any[]) => void +>console : Console +>log : (...data: any[]) => void +>this.#privateField : string +>this : this + + console.log(this.exposedField); +>console.log(this.exposedField) : void +>console.log : (...data: any[]) => void +>console : Console +>log : (...data: any[]) => void +>this.exposedField : number +>this : this +>exposedField : number + } +} + diff --git a/tests/cases/compiler/constructorWithParameterPropertiesAndPrivateFields.es2015.ts b/tests/cases/compiler/constructorWithParameterPropertiesAndPrivateFields.es2015.ts new file mode 100644 index 00000000000..ec0fd2464d2 --- /dev/null +++ b/tests/cases/compiler/constructorWithParameterPropertiesAndPrivateFields.es2015.ts @@ -0,0 +1,29 @@ +// @target: es2015 +// https://github.com/microsoft/TypeScript/issues/48771 + +class A { + readonly #privateField: string; + + constructor(arg: { key: string }, public exposedField: number) { + ({ key: this.#privateField } = arg); + } + + log() { + console.log(this.#privateField); + console.log(this.exposedField); + } +} + +class B { + readonly #privateField: string; + + constructor(arg: { key: string }, public exposedField: number) { + "prologue"; + ({ key: this.#privateField } = arg); + } + + log() { + console.log(this.#privateField); + console.log(this.exposedField); + } +} From 45faac7e70174d3738c9b5e290a76a4ebb67d518 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 20 Apr 2022 21:05:10 -0700 Subject: [PATCH 08/63] If we are updating dts of any of the file and it affects global scope, everything needs update in signature and dts emit (#48600) * Add test * Renames * More refactoring * If we are updating dts of any of the file and it affects global scope, everything needs update in signature and dts emit Fixes #42769 --- src/compiler/builder.ts | 196 ++++++++---- src/testRunner/unittests/tsc/incremental.ts | 35 +++ ...in-another-file-through-indirect-import.js | 287 ++++++++++++++++++ ...s-global-through-export-in-another-file.js | 229 ++++++++++++++ 4 files changed, 680 insertions(+), 67 deletions(-) create mode 100644 tests/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file-through-indirect-import.js create mode 100644 tests/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file.js diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts index 9d4ce0595eb..3ee1f663fa2 100644 --- a/src/compiler/builder.ts +++ b/src/compiler/builder.ts @@ -434,25 +434,35 @@ namespace ts { return undefined; } + function removeDiagnosticsOfLibraryFiles(state: BuilderProgramState) { + if (!state.cleanedDiagnosticsOfLibFiles) { + state.cleanedDiagnosticsOfLibFiles = true; + const program = Debug.checkDefined(state.program); + const options = program.getCompilerOptions(); + forEach(program.getSourceFiles(), f => + program.isSourceFileDefaultLibrary(f) && + !skipTypeChecking(f, options, program) && + removeSemanticDiagnosticsOf(state, f.resolvedPath) + ); + } + } + /** * Handles semantic diagnostics and dts emit for affectedFile and files, that are referencing modules that export entities from affected file * This is because even though js emit doesnt change, dts emit / type used can change resulting in need for dts emit and js change */ - function handleDtsMayChangeOfAffectedFile(state: BuilderProgramState, affectedFile: SourceFile, cancellationToken: CancellationToken | undefined, computeHash: BuilderState.ComputeHash, host: BuilderProgramHost) { + function handleDtsMayChangeOfAffectedFile( + state: BuilderProgramState, + affectedFile: SourceFile, + cancellationToken: CancellationToken | undefined, + computeHash: BuilderState.ComputeHash, + host: BuilderProgramHost, + ) { removeSemanticDiagnosticsOf(state, affectedFile.resolvedPath); // If affected files is everything except default library, then nothing more to do if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) { - if (!state.cleanedDiagnosticsOfLibFiles) { - state.cleanedDiagnosticsOfLibFiles = true; - const program = Debug.checkDefined(state.program); - const options = program.getCompilerOptions(); - forEach(program.getSourceFiles(), f => - program.isSourceFileDefaultLibrary(f) && - !skipTypeChecking(f, options, program) && - removeSemanticDiagnosticsOf(state, f.resolvedPath) - ); - } + removeDiagnosticsOfLibraryFiles(state); // When a change affects the global scope, all files are considered to be affected without updating their signature // That means when affected file is handled, its signature can be out of date // To avoid this, ensure that we update the signature for any affected file in this scenario. @@ -467,20 +477,22 @@ namespace ts { ); return; } - else { - Debug.assert(state.hasCalledUpdateShapeSignature.has(affectedFile.resolvedPath) || state.currentAffectedFilesSignatures?.has(affectedFile.resolvedPath), `Signature not updated for affected file: ${affectedFile.fileName}`); - } - - if (!state.compilerOptions.assumeChangesOnlyAffectDirectDependencies) { - forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, (state, path) => handleDtsMayChangeOf(state, path, cancellationToken, computeHash, host)); - } + Debug.assert(state.hasCalledUpdateShapeSignature.has(affectedFile.resolvedPath) || state.currentAffectedFilesSignatures?.has(affectedFile.resolvedPath), `Signature not updated for affected file: ${affectedFile.fileName}`); + if (state.compilerOptions.assumeChangesOnlyAffectDirectDependencies) return; + handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host); } /** * Handle the dts may change, so they need to be added to pending emit if dts emit is enabled, * Also we need to make sure signature is updated for these files */ - function handleDtsMayChangeOf(state: BuilderProgramState, path: Path, cancellationToken: CancellationToken | undefined, computeHash: BuilderState.ComputeHash, host: BuilderProgramHost): void { + function handleDtsMayChangeOf( + state: BuilderProgramState, + path: Path, + cancellationToken: CancellationToken | undefined, + computeHash: BuilderState.ComputeHash, + host: BuilderProgramHost + ): void { removeSemanticDiagnosticsOf(state, path); if (!state.changedFilesSet.has(path)) { @@ -529,16 +541,61 @@ namespace ts { return newSignature !== oldSignature; } + function forEachKeyOfExportedModulesMap( + state: BuilderProgramState, + filePath: Path, + fn: (exportedFromPath: Path) => T | undefined, + ): T | undefined { + // Go through exported modules from cache first + let keys = state.currentAffectedFilesExportedModulesMap!.getKeys(filePath); + const result = keys && forEachKey(keys, fn); + if (result) return result; + + // If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected + keys = state.exportedModulesMap!.getKeys(filePath); + return keys && forEachKey(keys, exportedFromPath => + // If the cache had an updated value, skip + !state.currentAffectedFilesExportedModulesMap!.hasKey(exportedFromPath) && + !state.currentAffectedFilesExportedModulesMap!.deletedKeys()?.has(exportedFromPath) ? + fn(exportedFromPath) : + undefined + ); + } + + function handleDtsMayChangeOfGlobalScope( + state: BuilderProgramState, + filePath: Path, + cancellationToken: CancellationToken | undefined, + computeHash: BuilderState.ComputeHash, + host: BuilderProgramHost, + ): boolean { + if (!state.fileInfos.get(filePath)?.affectsGlobalScope) return false; + // Every file needs to be handled + BuilderState.getAllFilesExcludingDefaultLibraryFile(state, state.program!, /*firstSourceFile*/ undefined) + .forEach(file => handleDtsMayChangeOf( + state, + file.resolvedPath, + cancellationToken, + computeHash, + host, + )); + removeDiagnosticsOfLibraryFiles(state); + return true; + } + /** - * Iterate on referencing modules that export entities from affected file + * Iterate on referencing modules that export entities from affected file and delete diagnostics and add pending emit */ - function forEachReferencingModulesOfExportOfAffectedFile(state: BuilderProgramState, affectedFile: SourceFile, fn: (state: BuilderProgramState, filePath: Path) => void) { + function handleDtsMayChangeOfReferencingExportOfAffectedFile( + state: BuilderProgramState, + affectedFile: SourceFile, + cancellationToken: CancellationToken | undefined, + computeHash: BuilderState.ComputeHash, + host: BuilderProgramHost + ) { // If there was change in signature (dts output) for the changed file, // then only we need to handle pending file emit - if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath)) { - return; - } - + if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath)) return; if (!isChangedSignature(state, affectedFile.resolvedPath)) return; // Since isolated modules dont change js files, files affected by change in signature is itself @@ -551,7 +608,8 @@ namespace ts { const currentPath = queue.pop()!; if (!seenFileNamesMap.has(currentPath)) { seenFileNamesMap.set(currentPath, true); - fn(state, currentPath); + if (handleDtsMayChangeOfGlobalScope(state, currentPath, cancellationToken, computeHash, host)) return; + handleDtsMayChangeOf(state, currentPath, cancellationToken, computeHash, host); if (isChangedSignature(state, currentPath)) { const currentSourceFile = Debug.checkDefined(state.program).getSourceFileByPath(currentPath)!; queue.push(...BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath)); @@ -561,65 +619,69 @@ namespace ts { } Debug.assert(!!state.currentAffectedFilesExportedModulesMap); - const seenFileAndExportsOfFile = new Set(); // Go through exported modules from cache first // If exported modules has path, all files referencing file exported from are affected - state.currentAffectedFilesExportedModulesMap.getKeys(affectedFile.resolvedPath)?.forEach(exportedFromPath => - forEachFilesReferencingPath(state, exportedFromPath, seenFileAndExportsOfFile, fn) - ); - - // If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected - state.exportedModulesMap.getKeys(affectedFile.resolvedPath)?.forEach(exportedFromPath => - // If the cache had an updated value, skip - !state.currentAffectedFilesExportedModulesMap!.hasKey(exportedFromPath) && - !state.currentAffectedFilesExportedModulesMap!.deletedKeys()?.has(exportedFromPath) && - forEachFilesReferencingPath(state, exportedFromPath, seenFileAndExportsOfFile, fn) - ); + forEachKeyOfExportedModulesMap(state, affectedFile.resolvedPath, exportedFromPath => { + if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, cancellationToken, computeHash, host)) return true; + const references = state.referencedMap!.getKeys(exportedFromPath); + return references && forEachKey(references, filePath => + handleDtsMayChangeOfFileAndExportsOfFile( + state, + filePath, + seenFileAndExportsOfFile, + cancellationToken, + computeHash, + host, + ) + ); + }); } /** - * Iterate on files referencing referencedPath + * handle dts and semantic diagnostics on file and iterate on anything that exports this file + * return true when all work is done and we can exit handling dts emit and semantic diagnostics */ - function forEachFilesReferencingPath(state: BuilderProgramState, referencedPath: Path, seenFileAndExportsOfFile: Set, fn: (state: BuilderProgramState, filePath: Path) => void): void { - state.referencedMap!.getKeys(referencedPath)?.forEach(filePath => - forEachFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, fn) - ); - } - - /** - * fn on file and iterate on anything that exports this file - */ - function forEachFileAndExportsOfFile(state: BuilderProgramState, filePath: Path, seenFileAndExportsOfFile: Set, fn: (state: BuilderProgramState, filePath: Path) => void): void { - if (!tryAddToSet(seenFileAndExportsOfFile, filePath)) { - return; - } - - fn(state, filePath); + function handleDtsMayChangeOfFileAndExportsOfFile( + state: BuilderProgramState, + filePath: Path, + seenFileAndExportsOfFile: Set, + cancellationToken: CancellationToken | undefined, + computeHash: BuilderState.ComputeHash, + host: BuilderProgramHost, + ): boolean | undefined { + if (!tryAddToSet(seenFileAndExportsOfFile, filePath)) return undefined; + if (handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, host)) return true; + handleDtsMayChangeOf(state, filePath, cancellationToken, computeHash, host); Debug.assert(!!state.currentAffectedFilesExportedModulesMap); - // Go through exported modules from cache first - // If exported modules has path, all files referencing file exported from are affected - state.currentAffectedFilesExportedModulesMap.getKeys(filePath)?.forEach(exportedFromPath => - forEachFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, fn) - ); - // If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected - state.exportedModulesMap!.getKeys(filePath)?.forEach(exportedFromPath => - // If the cache had an updated value, skip - !state.currentAffectedFilesExportedModulesMap!.hasKey(exportedFromPath) && - !state.currentAffectedFilesExportedModulesMap!.deletedKeys()?.has(exportedFromPath) && - forEachFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, fn) + // If exported modules has path, all files referencing file exported from are affected + forEachKeyOfExportedModulesMap(state, filePath, exportedFromPath => + handleDtsMayChangeOfFileAndExportsOfFile( + state, + exportedFromPath, + seenFileAndExportsOfFile, + cancellationToken, + computeHash, + host, + ) ); // Remove diagnostics of files that import this file (without going to exports of referencing files) state.referencedMap!.getKeys(filePath)?.forEach(referencingFilePath => !seenFileAndExportsOfFile.has(referencingFilePath) && // Not already removed diagnostic file - fn(state, referencingFilePath) // Dont add to seen since this is not yet done with the export removal + handleDtsMayChangeOf( // Dont add to seen since this is not yet done with the export removal + state, + referencingFilePath, + cancellationToken, + computeHash, + host, + ) ); + return undefined; } - /** * This is called after completing operation on the next affected file. * The operations here are postponed to ensure that cancellation during the iteration is handled correctly diff --git a/src/testRunner/unittests/tsc/incremental.ts b/src/testRunner/unittests/tsc/incremental.ts index ec5093e0849..a27b1b90253 100644 --- a/src/testRunner/unittests/tsc/incremental.ts +++ b/src/testRunner/unittests/tsc/incremental.ts @@ -464,5 +464,40 @@ declare global { fs.writeFileSync("/lib/lib.esnext.d.ts", libContent); } }); + + verifyTscWithEdits({ + scenario: "incremental", + subScenario: "change to type that gets used as global through export in another file", + commandLineArgs: ["-p", `src/project`], + fs: () => loadProjectFromFiles({ + "/src/project/tsconfig.json": JSON.stringify({ compilerOptions: { composite: true }, }), + "/src/project/class1.ts": `const a: MagicNumber = 1; +console.log(a);`, + "/src/project/constants.ts": "export default 1;", + "/src/project/types.d.ts": `type MagicNumber = typeof import('./constants').default`, + }), + edits: [{ + subScenario: "Modify imports used in global file", + modifyFs: fs => fs.writeFileSync("/src/project/constants.ts", "export default 2;"), + }], + }); + + verifyTscWithEdits({ + scenario: "incremental", + subScenario: "change to type that gets used as global through export in another file through indirect import", + commandLineArgs: ["-p", `src/project`], + fs: () => loadProjectFromFiles({ + "/src/project/tsconfig.json": JSON.stringify({ compilerOptions: { composite: true }, }), + "/src/project/class1.ts": `const a: MagicNumber = 1; +console.log(a);`, + "/src/project/constants.ts": "export default 1;", + "/src/project/reexport.ts": `export { default as ConstantNumber } from "./constants"`, + "/src/project/types.d.ts": `type MagicNumber = typeof import('./reexport').ConstantNumber`, + }), + edits: [{ + subScenario: "Modify imports used in global file", + modifyFs: fs => fs.writeFileSync("/src/project/constants.ts", "export default 2;"), + }], + }); }); } diff --git a/tests/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file-through-indirect-import.js b/tests/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file-through-indirect-import.js new file mode 100644 index 00000000000..13414c757da --- /dev/null +++ b/tests/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file-through-indirect-import.js @@ -0,0 +1,287 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/class1.ts] +const a: MagicNumber = 1; +console.log(a); + +//// [/src/project/constants.ts] +export default 1; + +//// [/src/project/reexport.ts] +export { default as ConstantNumber } from "./constants" + +//// [/src/project/tsconfig.json] +{"compilerOptions":{"composite":true}} + +//// [/src/project/types.d.ts] +type MagicNumber = typeof import('./reexport').ConstantNumber + + + +Output:: +/lib/tsc -p src/project +exitCode:: ExitStatus.Success + + +//// [/src/project/class1.d.ts] +declare const a = 1; + + +//// [/src/project/class1.js] +var a = 1; +console.log(a); + + +//// [/src/project/constants.d.ts] +declare const _default: 1; +export default _default; + + +//// [/src/project/constants.js] +"use strict"; +exports.__esModule = true; +exports["default"] = 1; + + +//// [/src/project/reexport.d.ts] +export { default as ConstantNumber } from "./constants"; + + +//// [/src/project/reexport.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +exports.__esModule = true; +exports.ConstantNumber = void 0; +var constants_1 = require("./constants"); +__createBinding(exports, constants_1, "default", "ConstantNumber"); + + +//// [/src/project/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","./class1.ts","./constants.ts","./reexport.ts","./types.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"4085502068-const a: MagicNumber = 1;\nconsole.log(a);","affectsGlobalScope":true},"-2659799048-export default 1;","-1476032387-export { default as ConstantNumber } from \"./constants\"",{"version":"2093085814-type MagicNumber = typeof import('./reexport').ConstantNumber","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,5]},"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "./class1.ts", + "./constants.ts", + "./reexport.ts", + "./types.d.ts" + ], + "fileNamesList": [ + [ + "./constants.ts" + ], + [ + "./reexport.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./class1.ts": { + "version": "4085502068-const a: MagicNumber = 1;\nconsole.log(a);", + "signature": "4085502068-const a: MagicNumber = 1;\nconsole.log(a);", + "affectsGlobalScope": true + }, + "./constants.ts": { + "version": "-2659799048-export default 1;", + "signature": "-2659799048-export default 1;" + }, + "./reexport.ts": { + "version": "-1476032387-export { default as ConstantNumber } from \"./constants\"", + "signature": "-1476032387-export { default as ConstantNumber } from \"./constants\"" + }, + "./types.d.ts": { + "version": "2093085814-type MagicNumber = typeof import('./reexport').ConstantNumber", + "signature": "2093085814-type MagicNumber = typeof import('./reexport').ConstantNumber", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true + }, + "referencedMap": { + "./reexport.ts": [ + "./constants.ts" + ], + "./types.d.ts": [ + "./reexport.ts" + ] + }, + "exportedModulesMap": { + "./reexport.ts": [ + "./constants.ts" + ], + "./types.d.ts": [ + "./reexport.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./class1.ts", + "./constants.ts", + "./reexport.ts", + "./types.d.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1099 +} + + + +Change:: Modify imports used in global file +Input:: +//// [/src/project/constants.ts] +export default 2; + + + +Output:: +/lib/tsc -p src/project +src/project/class1.ts:1:7 - error TS2322: Type '1' is not assignable to type '2'. + +1 const a: MagicNumber = 1; +   ~ + + +Found 1 error in src/project/class1.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/class1.d.ts] +declare const a = 2; + + +//// [/src/project/constants.d.ts] +declare const _default: 2; +export default _default; + + +//// [/src/project/constants.js] +"use strict"; +exports.__esModule = true; +exports["default"] = 2; + + +//// [/src/project/reexport.d.ts] file written with same contents +//// [/src/project/reexport.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","./class1.ts","./constants.ts","./reexport.ts","./types.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"4085502068-const a: MagicNumber = 1;\nconsole.log(a);","affectsGlobalScope":true},{"version":"-2659799015-export default 2;","signature":"1573564507-declare const _default: 2;\r\nexport default _default;\r\n"},{"version":"-1476032387-export { default as ConstantNumber } from \"./constants\"","signature":"-1329721329-export { default as ConstantNumber } from \"./constants\";\r\n"},{"version":"2093085814-type MagicNumber = typeof import('./reexport').ConstantNumber","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,[2,[{"file":"./class1.ts","start":6,"length":1,"code":2322,"category":1,"messageText":"Type '1' is not assignable to type '2'."}]],3,4,5]},"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "./class1.ts", + "./constants.ts", + "./reexport.ts", + "./types.d.ts" + ], + "fileNamesList": [ + [ + "./constants.ts" + ], + [ + "./reexport.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./class1.ts": { + "version": "4085502068-const a: MagicNumber = 1;\nconsole.log(a);", + "signature": "4085502068-const a: MagicNumber = 1;\nconsole.log(a);", + "affectsGlobalScope": true + }, + "./constants.ts": { + "version": "-2659799015-export default 2;", + "signature": "1573564507-declare const _default: 2;\r\nexport default _default;\r\n" + }, + "./reexport.ts": { + "version": "-1476032387-export { default as ConstantNumber } from \"./constants\"", + "signature": "-1329721329-export { default as ConstantNumber } from \"./constants\";\r\n" + }, + "./types.d.ts": { + "version": "2093085814-type MagicNumber = typeof import('./reexport').ConstantNumber", + "signature": "2093085814-type MagicNumber = typeof import('./reexport').ConstantNumber", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true + }, + "referencedMap": { + "./reexport.ts": [ + "./constants.ts" + ], + "./types.d.ts": [ + "./reexport.ts" + ] + }, + "exportedModulesMap": { + "./reexport.ts": [ + "./constants.ts" + ], + "./types.d.ts": [ + "./reexport.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + [ + "./class1.ts", + [ + { + "file": "./class1.ts", + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type '1' is not assignable to type '2'." + } + ] + ], + "./constants.ts", + "./reexport.ts", + "./types.d.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1425 +} + diff --git a/tests/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file.js b/tests/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file.js new file mode 100644 index 00000000000..a64e6e273ad --- /dev/null +++ b/tests/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file.js @@ -0,0 +1,229 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/class1.ts] +const a: MagicNumber = 1; +console.log(a); + +//// [/src/project/constants.ts] +export default 1; + +//// [/src/project/tsconfig.json] +{"compilerOptions":{"composite":true}} + +//// [/src/project/types.d.ts] +type MagicNumber = typeof import('./constants').default + + + +Output:: +/lib/tsc -p src/project +exitCode:: ExitStatus.Success + + +//// [/src/project/class1.d.ts] +declare const a = 1; + + +//// [/src/project/class1.js] +var a = 1; +console.log(a); + + +//// [/src/project/constants.d.ts] +declare const _default: 1; +export default _default; + + +//// [/src/project/constants.js] +"use strict"; +exports.__esModule = true; +exports["default"] = 1; + + +//// [/src/project/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","./class1.ts","./constants.ts","./types.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"4085502068-const a: MagicNumber = 1;\nconsole.log(a);","affectsGlobalScope":true},"-2659799048-export default 1;",{"version":"-2080821236-type MagicNumber = typeof import('./constants').default","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "./class1.ts", + "./constants.ts", + "./types.d.ts" + ], + "fileNamesList": [ + [ + "./constants.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./class1.ts": { + "version": "4085502068-const a: MagicNumber = 1;\nconsole.log(a);", + "signature": "4085502068-const a: MagicNumber = 1;\nconsole.log(a);", + "affectsGlobalScope": true + }, + "./constants.ts": { + "version": "-2659799048-export default 1;", + "signature": "-2659799048-export default 1;" + }, + "./types.d.ts": { + "version": "-2080821236-type MagicNumber = typeof import('./constants').default", + "signature": "-2080821236-type MagicNumber = typeof import('./constants').default", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true + }, + "referencedMap": { + "./types.d.ts": [ + "./constants.ts" + ] + }, + "exportedModulesMap": { + "./types.d.ts": [ + "./constants.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./class1.ts", + "./constants.ts", + "./types.d.ts" + ] + }, + "version": "FakeTSVersion", + "size": 988 +} + + + +Change:: Modify imports used in global file +Input:: +//// [/src/project/constants.ts] +export default 2; + + + +Output:: +/lib/tsc -p src/project +src/project/class1.ts:1:7 - error TS2322: Type '1' is not assignable to type '2'. + +1 const a: MagicNumber = 1; +   ~ + + +Found 1 error in src/project/class1.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated + + +//// [/src/project/class1.d.ts] +declare const a = 2; + + +//// [/src/project/constants.d.ts] +declare const _default: 2; +export default _default; + + +//// [/src/project/constants.js] +"use strict"; +exports.__esModule = true; +exports["default"] = 2; + + +//// [/src/project/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","./class1.ts","./constants.ts","./types.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"4085502068-const a: MagicNumber = 1;\nconsole.log(a);","affectsGlobalScope":true},{"version":"-2659799015-export default 2;","signature":"1573564507-declare const _default: 2;\r\nexport default _default;\r\n"},{"version":"-2080821236-type MagicNumber = typeof import('./constants').default","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,[2,[{"file":"./class1.ts","start":6,"length":1,"code":2322,"category":1,"messageText":"Type '1' is not assignable to type '2'."}]],3,4]},"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "./class1.ts", + "./constants.ts", + "./types.d.ts" + ], + "fileNamesList": [ + [ + "./constants.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./class1.ts": { + "version": "4085502068-const a: MagicNumber = 1;\nconsole.log(a);", + "signature": "4085502068-const a: MagicNumber = 1;\nconsole.log(a);", + "affectsGlobalScope": true + }, + "./constants.ts": { + "version": "-2659799015-export default 2;", + "signature": "1573564507-declare const _default: 2;\r\nexport default _default;\r\n" + }, + "./types.d.ts": { + "version": "-2080821236-type MagicNumber = typeof import('./constants').default", + "signature": "-2080821236-type MagicNumber = typeof import('./constants').default", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true + }, + "referencedMap": { + "./types.d.ts": [ + "./constants.ts" + ] + }, + "exportedModulesMap": { + "./types.d.ts": [ + "./constants.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + [ + "./class1.ts", + [ + { + "file": "./class1.ts", + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type '1' is not assignable to type '2'." + } + ] + ], + "./constants.ts", + "./types.d.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1213 +} + From 7a59e45f48bd2295bfc8f5756661180de312ad67 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 21 Apr 2022 11:00:34 -0700 Subject: [PATCH 09/63] During emit, if shape signature for the file is same as version, then update it with emitted d.ts file (#48616) * If we are writing dts file and have used file text as version, we can update the signature when doing actual emit * Make WriteFileCallback Api ready for future * Assert that there is only single source file when emitting d.ts file --- src/compiler/builder.ts | 44 +- src/compiler/builderPublic.ts | 5 + src/compiler/builderState.ts | 2 +- src/compiler/emitter.ts | 4 +- src/compiler/program.ts | 19 +- src/compiler/sys.ts | 6 +- src/compiler/types.ts | 9 +- src/compiler/utilities.ts | 6 +- src/compiler/watch.ts | 2 + src/compiler/watchPublic.ts | 2 + src/harness/virtualFileSystemWithWatch.ts | 1 + .../unittests/tsbuild/outputPaths.ts | 11 +- src/testRunner/unittests/tsc/helpers.ts | 2 + src/testRunner/unittests/tscWatch/helpers.ts | 7 +- .../reference/api/tsserverlibrary.d.ts | 4 +- tests/baselines/reference/api/typescript.d.ts | 4 +- .../reports-syntax-errors-in-config-file.js | 8 +- ...nce-and-both-extend-config-with-include.js | 12 +- ...th-projects-extends-config-with-include.js | 12 +- ...ter-initial-build-doesnt-build-anything.js | 18 +- ...ugh-triple-slash-but-uses-no-references.js | 13 +- ...file-is-referenced-through-triple-slash.js | 24 +- ...d-inferred-type-from-referenced-project.js | 12 +- ...ng-setup-correctly-and-reports-no-error.js | 28 +- ...-emitDeclarationOnly-and-declarationMap.js | 12 +- ...import-project-with-emitDeclarationOnly.js | 12 +- ...mports-project-with-emitDeclarationOnly.js | 23 +- ...es-is-empty-and-references-are-provided.js | 6 +- ...-transitive-module-with-isolatedModules.js | 32 +- .../inferred-type-from-transitive-module.js | 27 +- ...hange-in-signature-with-isolatedModules.js | 42 +- ...based-projects-and-emits-them-correctly.js | 27 +- ...ved-json-files-and-emits-them-correctly.js | 27 +- ...project-correctly-with-preserveSymlinks.js | 12 +- ...-file-from-referenced-project-correctly.js | 12 +- ...t-resolution-options-referenced-project.js | 12 +- ...fiers-across-projects-resolve-correctly.js | 31 +- ...zed-module-specifiers-resolve-correctly.js | 18 +- .../non-module-projects-without-prepend.js | 24 +- ...otDir-is-not-specified-and-is-composite.js | 6 +- ...iles-belong-to-rootDir-and-is-composite.js | 8 +- .../builds-correctly.js | 20 +- ...nfo-file-because-no-rootDir-in-the-base.js | 6 +- ...reports-error-for-same-tsbuildinfo-file.js | 6 +- ...eports-no-error-when-tsbuildinfo-differ.js | 20 +- .../files-containing-json-file.js | 12 +- ...ting-json-module-from-project-reference.js | 12 +- .../resolveJsonModule/include-and-files.js | 12 +- ...r-include-and-file-name-matches-ts-file.js | 12 +- ...nclude-of-json-along-with-other-include.js | 12 +- .../tsbuild/resolveJsonModule/sourcemap.js | 12 +- .../resolveJsonModule/without-outDir.js | 12 +- .../always-builds-under-with-force-option.js | 28 +- .../building-using-buildReferencedProject.js | 18 +- ...uilding-using-getNextInvalidatedProject.js | 6 +- ...rectly-when-declarationDir-is-specified.js | 28 +- ...ilds-correctly-when-outDir-is-specified.js | 28 +- .../sample1/builds-till-project-specified.js | 18 +- .../can-detect-when-and-what-to-rebuild.js | 12 +- ...ojects-if-upstream-projects-have-errors.js | 8 +- .../reference/tsbuild/sample1/explainFiles.js | 40 +- ...it-would-skip-builds-during-a-dry-build.js | 6 +- .../sample1/invalidates-projects-correctly.js | 6 +- .../tsbuild/sample1/listEmittedFiles.js | 40 +- .../reference/tsbuild/sample1/listFiles.js | 40 +- ...-in-tsbuildinfo-doesnt-match-ts-version.js | 34 +- ...uilds-from-start-if-force-option-is-set.js | 22 +- ...uilds-when-extended-config-file-changes.js | 38 +- .../reference/tsbuild/sample1/sample.js | 40 +- .../when-declaration-option-changes.js | 8 +- .../when-esModuleInterop-option-changes.js | 38 +- .../when-logic-specifies-tsBuildInfoFile.js | 28 +- ...roject-uses-different-module-resolution.js | 12 +- .../transitiveReferences/builds-correctly.js | 12 +- ...de-resolution-with-external-module-name.js | 6 +- .../demo/updates-with-circular-reference.js | 38 +- ...for-changes-to-package-json-main-fields.js | 16 +- ...t-correctly-with-cts-and-mts-extensions.js | 18 +- ...se-different-module-resolution-settings.js | 28 +- .../creates-solution-in-watch-mode.js | 36 +- .../incremental-updates-in-verbose-mode.js | 36 +- .../when-file-with-no-error-changes.js | 12 +- ...ing-errors-only-changed-file-is-emitted.js | 55 +- .../when-file-with-no-error-changes.js | 2 +- ...ixing-error-files-all-files-are-emitted.js | 8 +- .../when-preserveWatchOutput-is-not-used.js | 42 +- ...veWatchOutput-is-passed-on-command-line.js | 42 +- ...e-of-program-emit-with-outDir-specified.js | 20 +- ...r-recompilation-because-of-program-emit.js | 20 +- ...-references-watches-only-those-projects.js | 24 +- ...tches-config-files-that-are-not-present.js | 36 +- ...e-down-stream-project-and-then-fixes-it.js | 8 +- ...le-is-added,-and-its-subsequent-updates.js | 52 +- ...hanges-and-reports-found-errors-message.js | 54 +- ...not-start-build-of-referencing-projects.js | 42 +- ...le-is-added,-and-its-subsequent-updates.js | 52 +- ...hanges-and-reports-found-errors-message.js | 54 +- ...not-start-build-of-referencing-projects.js | 42 +- ...project-with-extended-config-is-removed.js | 20 +- .../works-with-extended-source-files.js | 20 +- .../reexport/Reports-errors-correctly.js | 8 +- ...in-another-file-through-indirect-import.js | 16 +- ...s-global-through-export-in-another-file.js | 14 +- .../incremental/noEmit-changes-composite.js | 108 +- .../noEmit-changes-incremental-declaration.js | 108 +- ...t-changes-with-initial-noEmit-composite.js | 58 +- ...-initial-noEmit-incremental-declaration.js | 58 +- ...le-is-added,-the-signatures-are-updated.js | 36 +- ...file-is-added-to-the-referenced-project.js | 6 +- .../errors-for-.d.ts-change.js | 2 +- .../errors-for-.ts-change.js | 35 +- ...g-a-deep-multilevel-import-that-changes.js | 80 +- .../no-circular-import/export.js | 56 +- .../yes-circular-import/exports.js | 62 +- .../with-noEmitOnError-with-incremental.js | 24 +- .../errors-for-.d.ts-change.js | 8 +- .../errors-for-.ts-change.js | 23 +- ...g-a-deep-multilevel-import-that-changes.js | 41 +- .../no-circular-import/export.js | 50 +- .../yes-circular-import/exports.js | 59 +- .../with-noEmitOnError-with-incremental.js | 24 +- .../errors-for-.d.ts-change.js | 38 +- .../errors-for-.ts-change.js | 102 +- ...g-a-deep-multilevel-import-that-changes.js | 1036 ++++++++++------- .../no-circular-import/export.js | 876 ++++++-------- .../yes-circular-import/exports.js | 954 +++++++-------- .../with-noEmitOnError-with-incremental.js | 24 +- .../with-noEmitOnError.js | 24 +- .../errors-for-.d.ts-change.js | 44 +- .../errors-for-.ts-change.js | 54 +- ...g-a-deep-multilevel-import-that-changes.js | 82 +- .../no-circular-import/export.js | 99 +- .../yes-circular-import/exports.js | 114 +- .../with-noEmitOnError-with-incremental.js | 24 +- .../defaultAndD/with-noEmitOnError.js | 24 +- .../errors-for-.d.ts-change.js | 44 +- .../errors-for-.ts-change.js | 64 +- ...g-a-deep-multilevel-import-that-changes.js | 96 +- .../no-circular-import/export.js | 112 +- .../yes-circular-import/exports.js | 128 +- .../with-noEmitOnError-with-incremental.js | 24 +- .../isolatedModulesAndD/with-noEmitOnError.js | 24 +- .../errors-for-.d.ts-change.js | 8 +- .../errors-for-.ts-change.js | 18 +- ...g-a-deep-multilevel-import-that-changes.js | 34 +- .../no-circular-import/export.js | 42 +- .../yes-circular-import/exports.js | 50 +- .../with-noEmitOnError-with-incremental.js | 24 +- .../declarationDir-is-specified.js | 4 +- ...-outDir-and-declarationDir-is-specified.js | 4 +- ...e-is-specified-with-declaration-enabled.js | 4 +- ...file-is-added-to-the-referenced-project.js | 8 +- .../on-sample-project.js | 6 +- ...-different-folders-with-no-files-clause.js | 4 +- ...nsitive-references-in-different-folders.js | 4 +- .../on-transitive-references.js | 4 +- ...roject-uses-different-module-resolution.js | 4 +- ...es-field-when-solution-is-already-built.js | 4 +- ...Symlinks-when-solution-is-already-built.js | 4 +- ...n-has-types-field-with-preserveSymlinks.js | 15 +- ...-package-when-solution-is-already-built.js | 4 +- ...Symlinks-when-solution-is-already-built.js | 4 +- ...th-scoped-package-with-preserveSymlinks.js | 15 +- ...son-has-types-field-with-scoped-package.js | 15 +- .../when-packageJson-has-types-field.js | 15 +- ...ubFolder-when-solution-is-already-built.js | 4 +- ...Symlinks-when-solution-is-already-built.js | 4 +- ...le-from-subFolder-with-preserveSymlinks.js | 15 +- ...-package-when-solution-is-already-built.js | 4 +- ...Symlinks-when-solution-is-already-built.js | 4 +- ...th-scoped-package-with-preserveSymlinks.js | 15 +- ...file-from-subFolder-with-scoped-package.js | 15 +- .../when-referencing-file-from-subFolder.js | 15 +- ...-project-when-solution-is-already-built.js | 16 +- .../with-simple-project.js | 22 +- ...noEmit-with-composite-with-emit-builder.js | 26 +- ...it-with-composite-with-semantic-builder.js | 26 +- ...nError-with-composite-with-emit-builder.js | 6 +- ...or-with-composite-with-semantic-builder.js | 6 +- .../watchApi/semantic-builder-emitOnlyDts.js | 6 +- ...ing-useSourceOfProjectReferenceRedirect.js | 8 +- ...-host-implementing-getParsedCommandLine.js | 8 +- ...ory-with-outDir-and-declaration-enabled.js | 2 +- 183 files changed, 3451 insertions(+), 3923 deletions(-) diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts index 3ee1f663fa2..0485f10cbf0 100644 --- a/src/compiler/builder.ts +++ b/src/compiler/builder.ts @@ -161,6 +161,8 @@ namespace ts { * true if program has been emitted */ programEmitComplete?: true; + /** Stores list of files that change signature during emit - test only */ + filesChangingSignature?: Set; } function hasSameKeys(map1: ReadonlyCollection | undefined, map2: ReadonlyCollection | undefined): boolean { @@ -1150,7 +1152,9 @@ namespace ts { // Otherwise just affected file Debug.checkDefined(state.program).emit( affected === state.program ? undefined : affected as SourceFile, - writeFile || maybeBind(host, host.writeFile), + affected !== state.program && getEmitDeclarations(state.compilerOptions) && !customTransformers ? + getWriteFileUpdatingSignatureCallback(writeFile) : + writeFile || maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles || emitKind === BuilderFileEmit.DtsOnly, customTransformers @@ -1161,6 +1165,34 @@ namespace ts { ); } + function getWriteFileUpdatingSignatureCallback(writeFile: WriteFileCallback | undefined): WriteFileCallback { + return (fileName, text, writeByteOrderMark, onError, sourceFiles, data) => { + if (isDeclarationFileName(fileName)) { + Debug.assert(sourceFiles?.length === 1); + const file = sourceFiles[0]; + const info = state.fileInfos.get(file.resolvedPath)!; + const signature = state.currentAffectedFilesSignatures?.get(file.resolvedPath) || info.signature; + if (signature === file.version) { + const newSignature = (computeHash || generateDjb2Hash)(data?.sourceMapUrlPos !== undefined ? text.substring(0, data.sourceMapUrlPos) : text); + if (newSignature !== file.version) { // Update it + if (host.storeFilesChangingSignatureDuringEmit) (state.filesChangingSignature ||= new Set()).add(file.resolvedPath); + if (state.exportedModulesMap) BuilderState.updateExportedModules(file, file.exportedModulesFromDeclarationEmit, state.currentAffectedFilesExportedModulesMap ||= BuilderState.createManyToManyPathMap()); + if (state.affectedFiles && state.affectedFilesIndex! < state.affectedFiles.length) { + state.currentAffectedFilesSignatures!.set(file.resolvedPath, newSignature); + } + else { + info.signature = newSignature; + if (state.exportedModulesMap) BuilderState.updateExportedFilesMapFromCache(state, state.currentAffectedFilesExportedModulesMap); + } + } + } + } + if (writeFile) writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data); + else if (host.writeFile) host.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data); + else state.program!.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data); + }; + } + /** * Emits the JavaScript and declaration files. * When targetSource file is specified, emits the files corresponding to that source file, @@ -1215,7 +1247,15 @@ namespace ts { } } } - return Debug.checkDefined(state.program).emit(targetSourceFile, writeFile || maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers); + return Debug.checkDefined(state.program).emit( + targetSourceFile, + !outFile(state.compilerOptions) && getEmitDeclarations(state.compilerOptions) && !customTransformers ? + getWriteFileUpdatingSignatureCallback(writeFile) : + writeFile || maybeBind(host, host.writeFile), + cancellationToken, + emitOnlyDtsFiles, + customTransformers + ); } /** diff --git a/src/compiler/builderPublic.ts b/src/compiler/builderPublic.ts index 5d5d2ed25dd..a3527a83f9f 100644 --- a/src/compiler/builderPublic.ts +++ b/src/compiler/builderPublic.ts @@ -20,6 +20,11 @@ namespace ts { */ /*@internal*/ disableUseFileVersionAsSignature?: boolean; + /** + * Store the list of files that update signature during the emit + */ + /*@internal*/ + storeFilesChangingSignatureDuringEmit?: boolean; } /** diff --git a/src/compiler/builderState.ts b/src/compiler/builderState.ts index d78a107472c..f501eda66a1 100644 --- a/src/compiler/builderState.ts +++ b/src/compiler/builderState.ts @@ -450,7 +450,7 @@ namespace ts { /** * Coverts the declaration emit result into exported modules map */ - function updateExportedModules(sourceFile: SourceFile, exportedModulesFromDeclarationEmit: ExportedModulesFromDeclarationEmit | undefined, exportedModulesMapCache: ManyToManyPathMap) { + export function updateExportedModules(sourceFile: SourceFile, exportedModulesFromDeclarationEmit: ExportedModulesFromDeclarationEmit | undefined, exportedModulesMapCache: ManyToManyPathMap) { if (!exportedModulesFromDeclarationEmit) { exportedModulesMapCache.deleteKey(sourceFile.resolvedPath); return; diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index aca15c666a6..28f0d766f72 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -531,6 +531,7 @@ namespace ts { printer.writeFile(sourceFile!, writer, sourceMapGenerator); } + let sourceMapUrlPos; if (sourceMapGenerator) { if (sourceMapDataList) { sourceMapDataList.push({ @@ -548,6 +549,7 @@ namespace ts { if (sourceMappingURL) { if (!writer.isAtStartOfLine()) writer.rawWrite(newLine); + sourceMapUrlPos = writer.getTextPos(); writer.writeComment(`//# ${"sourceMappingURL"}=${sourceMappingURL}`); // Tools can sometimes see this line as a source mapping url comment } @@ -562,7 +564,7 @@ namespace ts { } // Write the output file - writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), !!compilerOptions.emitBOM, sourceFiles); + writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), !!compilerOptions.emitBOM, sourceFiles, { sourceMapUrlPos }); // Reset state writer.clear(); diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 615d52fb68e..c7f886ea311 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -262,7 +262,7 @@ namespace ts { return newValue; }; if (originalWriteFile) { - host.writeFile = (fileName, data, writeByteOrderMark, onError, sourceFiles) => { + host.writeFile = (fileName, data, ...rest) => { const key = toPath(fileName); fileExistsCache.delete(key); @@ -277,7 +277,7 @@ namespace ts { sourceFileCache.delete(key); } } - originalWriteFile.call(host, fileName, data, writeByteOrderMark, onError, sourceFiles); + originalWriteFile.call(host, fileName, data, ...rest); }; } @@ -1340,6 +1340,7 @@ namespace ts { useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(), getFileIncludeReasons: () => fileReasons, structureIsReused, + writeFile, }; onProgramCreateComplete(); @@ -1894,8 +1895,7 @@ namespace ts { getProjectReferenceRedirect, isSourceOfProjectReferenceRedirect, getSymlinkCache, - writeFile: writeFileCallback || ( - (fileName, data, writeByteOrderMark, onError, sourceFiles) => host.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles)), + writeFile: writeFileCallback || writeFile, isEmitBlocked, readFile: f => host.readFile(f), fileExists: f => { @@ -1914,6 +1914,17 @@ namespace ts { }; } + function writeFile( + fileName: string, + text: string, + writeByteOrderMark: boolean, + onError?: (message: string) => void, + sourceFiles?: readonly SourceFile[], + data?: WriteFileCallbackData + ) { + host.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data); + } + function emitBuildInfo(writeFileCallback?: WriteFileCallback): EmitResult { Debug.assert(!outFile(options)); tracing?.push(tracing.Phase.Emit, "emitBuildInfo", {}, /*separateBeginAndEnd*/ true); diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index 48ac670c8be..6cdcc6a26b9 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -1210,11 +1210,13 @@ namespace ts { base64decode?(input: string): string; base64encode?(input: string): string; /*@internal*/ bufferFrom?(input: string, encoding?: string): Buffer; + /*@internal*/ require?(baseDir: string, moduleName: string): RequireResult; + /*@internal*/ defaultWatchFileKind?(): WatchFileKind | undefined; + // For testing /*@internal*/ now?(): Date; /*@internal*/ disableUseFileVersionAsSignature?: boolean; - /*@internal*/ require?(baseDir: string, moduleName: string): RequireResult; - /*@internal*/ defaultWatchFileKind?(): WatchFileKind | undefined; + /*@internal*/ storeFilesChangingSignatureDuringEmit?: boolean; } export interface FileWatcher { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 3a88c1b5c37..1a221cc3932 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3856,12 +3856,16 @@ namespace ts { */ export type ResolvedConfigFileName = string & { _isResolvedConfigFileName: never }; + export interface WriteFileCallbackData { + /*@internal*/ sourceMapUrlPos?: number; + } export type WriteFileCallback = ( fileName: string, - data: string, + text: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: readonly SourceFile[], + data?: WriteFileCallbackData, ) => void; export class OperationCanceledException { } @@ -4067,6 +4071,8 @@ namespace ts { * This implementation handles file exists to be true if file is source of project reference redirect when program is created using useSourceOfProjectReferenceRedirect */ /*@internal*/ fileExists(fileName: string): boolean; + /** Call compilerHost.writeFile on host program was created with */ + /*@internal*/ writeFile: WriteFileCallback; } /*@internal*/ @@ -6782,6 +6788,7 @@ namespace ts { // For testing: /*@internal*/ disableUseFileVersionAsSignature?: boolean; + /*@internal*/ storeFilesChangingSignatureDuringEmit?: boolean; } /** true if --out otherwise source file name */ diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index d44df87c458..1093d9ae384 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -4459,10 +4459,10 @@ namespace ts { return combinePaths(newDirPath, sourceFilePath); } - export function writeFile(host: { writeFile: WriteFileCallback; }, diagnostics: DiagnosticCollection, fileName: string, data: string, writeByteOrderMark: boolean, sourceFiles?: readonly SourceFile[]) { - host.writeFile(fileName, data, writeByteOrderMark, hostErrorMessage => { + export function writeFile(host: { writeFile: WriteFileCallback; }, diagnostics: DiagnosticCollection, fileName: string, text: string, writeByteOrderMark: boolean, sourceFiles?: readonly SourceFile[], data?: WriteFileCallbackData) { + host.writeFile(fileName, text, writeByteOrderMark, hostErrorMessage => { diagnostics.add(createCompilerDiagnostic(Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); - }, sourceFiles); + }, sourceFiles, data); } function ensureDirectoriesExist( diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index b2f7a0a3bc5..6c422d31f0c 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -573,6 +573,7 @@ namespace ts { createHash: maybeBind(host, host.createHash), readDirectory: maybeBind(host, host.readDirectory), disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature, + storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit, }; function writeFile(fileName: string, text: string, writeByteOrderMark: boolean, onError: (message: string) => void) { @@ -637,6 +638,7 @@ namespace ts { createHash: maybeBind(system, system.createHash), createProgram: createProgram || createEmitAndSemanticDiagnosticsBuilderProgram as any as CreateProgram, disableUseFileVersionAsSignature: system.disableUseFileVersionAsSignature, + storeFilesChangingSignatureDuringEmit: system.storeFilesChangingSignatureDuringEmit, }; } diff --git a/src/compiler/watchPublic.ts b/src/compiler/watchPublic.ts index 095c0f69a10..8af1397e19c 100644 --- a/src/compiler/watchPublic.ts +++ b/src/compiler/watchPublic.ts @@ -20,6 +20,7 @@ namespace ts { const host = createCompilerHostWorker(options, /*setParentNodes*/ undefined, system); host.createHash = maybeBind(system, system.createHash); host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature; + host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit; setGetSourceFileAsHashVersioned(host, system); changeCompilerHostLikeToUseCache(host, fileName => toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName)); return host; @@ -114,6 +115,7 @@ namespace ts { writeFile?(path: string, data: string, writeByteOrderMark?: boolean): void; // For testing disableUseFileVersionAsSignature?: boolean; + storeFilesChangingSignatureDuringEmit?: boolean; } export interface WatchCompilerHost extends ProgramHost, WatchHost { diff --git a/src/harness/virtualFileSystemWithWatch.ts b/src/harness/virtualFileSystemWithWatch.ts index 62c6cd042ef..a7229fd2783 100644 --- a/src/harness/virtualFileSystemWithWatch.ts +++ b/src/harness/virtualFileSystemWithWatch.ts @@ -396,6 +396,7 @@ interface Array { length: number; [n: number]: T; }` private readonly currentDirectory: string; public require: ((initialPath: string, moduleName: string) => RequireResult) | undefined; public defaultWatchFileKind?: () => WatchFileKind | undefined; + public storeFilesChangingSignatureDuringEmit = true; watchFile: HostWatchFile; watchDirectory: HostWatchDirectory; constructor( diff --git a/src/testRunner/unittests/tsbuild/outputPaths.ts b/src/testRunner/unittests/tsbuild/outputPaths.ts index 6782a1bba96..72374f84611 100644 --- a/src/testRunner/unittests/tsbuild/outputPaths.ts +++ b/src/testRunner/unittests/tsbuild/outputPaths.ts @@ -55,16 +55,7 @@ namespace ts { } }) }), - edits: [ - noChangeRun, - { - ...noChangeProject, - cleanBuildDiscrepancies: () => new Map([ - ["/src/dist/tsconfig.tsbuildinfo", CleanBuildDescrepancy.CleanFileTextDifferent], // tsbuildinfo will have -p setting when built using -p vs no build happens incrementally because of no change. - ["/src/dist/tsconfig.tsbuildinfo.readable.baseline.txt", CleanBuildDescrepancy.CleanFileTextDifferent] // tsbuildinfo will have -p setting when built using -p vs no build happens incrementally because of no change. - ]), - } - ], + edits, }, ["/src/dist/src/index.js", "/src/dist/src/index.d.ts"]); verify({ diff --git a/src/testRunner/unittests/tsc/helpers.ts b/src/testRunner/unittests/tsc/helpers.ts index b4b6ff3de5f..58d8a83f706 100644 --- a/src/testRunner/unittests/tsc/helpers.ts +++ b/src/testRunner/unittests/tsc/helpers.ts @@ -3,6 +3,7 @@ namespace ts { writtenFiles: Set; baseLine(): { file: string; text: string; }; disableUseFileVersionAsSignature?: boolean; + storeFilesChangingSignatureDuringEmit?: boolean; }; export const noChangeRun: TestTscEdit = { @@ -84,6 +85,7 @@ namespace ts { // Create system const sys = new fakes.System(fs, { executingFilePath: "/lib/tsc", env: environmentVariables }) as TscCompileSystem; if (input.disableUseFileVersionAsSignature) sys.disableUseFileVersionAsSignature = true; + sys.storeFilesChangingSignatureDuringEmit = true; sys.write(`${sys.getExecutingFilePath()} ${commandLineArgs.join(" ")}\n`); sys.exit = exitCode => sys.exitCode = exitCode; worker(sys); diff --git a/src/testRunner/unittests/tscWatch/helpers.ts b/src/testRunner/unittests/tscWatch/helpers.ts index 97d838cdf63..20bdefa5a5b 100644 --- a/src/testRunner/unittests/tscWatch/helpers.ts +++ b/src/testRunner/unittests/tscWatch/helpers.ts @@ -336,7 +336,7 @@ namespace ts.tscWatch { if (!builderProgram) return; if (builderProgram !== oldProgram?.[1]) { const state = builderProgram.getState(); - const internalState = state as unknown as BuilderState; + const internalState = state as unknown as BuilderProgramState; if (state.semanticDiagnosticsPerFile?.size) { baseline.push("Semantic diagnostics in builder refreshed for::"); for (const file of program.getSourceFiles()) { @@ -354,9 +354,12 @@ namespace ts.tscWatch { baseline.push("Shape signatures in builder refreshed for::"); internalState.hasCalledUpdateShapeSignature.forEach((path: Path) => { const info = state.fileInfos.get(path); - if(info?.version === info?.signature || !info?.signature) { + if (info?.version === info?.signature || !info?.signature) { baseline.push(path + " (used version)"); } + else if (internalState.filesChangingSignature?.has(path)) { + baseline.push(path + " (computed .d.ts during emit)"); + } else { baseline.push(path + " (computed .d.ts)"); } diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index a08dea9d05f..0fd5bf9e0a9 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2172,7 +2172,9 @@ declare namespace ts { export type ResolvedConfigFileName = string & { _isResolvedConfigFileName: never; }; - export type WriteFileCallback = (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: readonly SourceFile[]) => void; + export interface WriteFileCallbackData { + } + export type WriteFileCallback = (fileName: string, text: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: readonly SourceFile[], data?: WriteFileCallbackData) => void; export class OperationCanceledException { } export interface CancellationToken { diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 22af7579a03..beb29fd613a 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2172,7 +2172,9 @@ declare namespace ts { export type ResolvedConfigFileName = string & { _isResolvedConfigFileName: never; }; - export type WriteFileCallback = (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: readonly SourceFile[]) => void; + export interface WriteFileCallbackData { + } + export type WriteFileCallback = (fileName: string, text: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: readonly SourceFile[], data?: WriteFileCallbackData) => void; export class OperationCanceledException { } export interface CancellationToken { diff --git a/tests/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file.js b/tests/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file.js index 54ef6410912..9486e97e751 100644 --- a/tests/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file.js +++ b/tests/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file.js @@ -160,7 +160,7 @@ exports.bar = bar; //// [/src/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"9819159940-export function foo() { }export function fooBar() { }","1045484683-export function bar() { }"],"options":{"composite":true,"declaration":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"9819159940-export function foo() { }export function fooBar() { }","signature":"-827728784-export declare function foo(): void;\r\nexport declare function fooBar(): void;\r\n"},{"version":"1045484683-export function bar() { }","signature":"-1357953631-export declare function bar(): void;\r\n"}],"options":{"composite":true,"declaration":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -178,11 +178,11 @@ exports.bar = bar; }, "./a.ts": { "version": "9819159940-export function foo() { }export function fooBar() { }", - "signature": "9819159940-export function foo() { }export function fooBar() { }" + "signature": "-827728784-export declare function foo(): void;\r\nexport declare function fooBar(): void;\r\n" }, "./b.ts": { "version": "1045484683-export function bar() { }", - "signature": "1045484683-export function bar() { }" + "signature": "-1357953631-export declare function bar(): void;\r\n" } }, "options": { @@ -198,6 +198,6 @@ exports.bar = bar; ] }, "version": "FakeTSVersion", - "size": 816 + "size": 1016 } diff --git a/tests/baselines/reference/tsbuild/configFileExtends/when-building-project-uses-reference-and-both-extend-config-with-include.js b/tests/baselines/reference/tsbuild/configFileExtends/when-building-project-uses-reference-and-both-extend-config-with-include.js index 8447b9058d9..84c9301c3a8 100644 --- a/tests/baselines/reference/tsbuild/configFileExtends/when-building-project-uses-reference-and-both-extend-config-with-include.js +++ b/tests/baselines/reference/tsbuild/configFileExtends/when-building-project-uses-reference-and-both-extend-config-with-include.js @@ -72,7 +72,7 @@ exports.a = 1; //// [/src/target-tsc-build/shared/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../lib/lib.d.ts","../../shared/index.ts","../../shared/typings-base/globals.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-22125360210-export const a: Unrestricted = 1;",{"version":"4725476611-type Unrestricted = any;","affectsGlobalScope":true}],"options":{"composite":true,"outDir":"..","rootDir":"../.."},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../lib/lib.d.ts","../../shared/index.ts","../../shared/typings-base/globals.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-22125360210-export const a: Unrestricted = 1;","signature":"-478734393-export declare const a: Unrestricted;\r\n"},{"version":"4725476611-type Unrestricted = any;","affectsGlobalScope":true}],"options":{"composite":true,"outDir":"..","rootDir":"../.."},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/src/target-tsc-build/shared/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -90,7 +90,7 @@ exports.a = 1; }, "../../shared/index.ts": { "version": "-22125360210-export const a: Unrestricted = 1;", - "signature": "-22125360210-export const a: Unrestricted = 1;" + "signature": "-478734393-export declare const a: Unrestricted;\r\n" }, "../../shared/typings-base/globals.d.ts": { "version": "4725476611-type Unrestricted = any;", @@ -112,7 +112,7 @@ exports.a = 1; ] }, "version": "FakeTSVersion", - "size": 901 + "size": 980 } //// [/src/target-tsc-build/webpack/index.d.ts] @@ -127,7 +127,7 @@ exports.b = 1; //// [/src/target-tsc-build/webpack/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../lib/lib.d.ts","../../webpack/index.ts","../../shared/typings-base/globals.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-14405273073-export const b: Unrestricted = 1;",{"version":"4725476611-type Unrestricted = any;","affectsGlobalScope":true}],"options":{"composite":true,"outDir":"..","rootDir":"../.."},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../lib/lib.d.ts","../../webpack/index.ts","../../shared/typings-base/globals.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-14405273073-export const b: Unrestricted = 1;","signature":"-5074241048-export declare const b: Unrestricted;\r\n"},{"version":"4725476611-type Unrestricted = any;","affectsGlobalScope":true}],"options":{"composite":true,"outDir":"..","rootDir":"../.."},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} //// [/src/target-tsc-build/webpack/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -145,7 +145,7 @@ exports.b = 1; }, "../../webpack/index.ts": { "version": "-14405273073-export const b: Unrestricted = 1;", - "signature": "-14405273073-export const b: Unrestricted = 1;" + "signature": "-5074241048-export declare const b: Unrestricted;\r\n" }, "../../shared/typings-base/globals.d.ts": { "version": "4725476611-type Unrestricted = any;", @@ -167,6 +167,6 @@ exports.b = 1; ] }, "version": "FakeTSVersion", - "size": 902 + "size": 982 } diff --git a/tests/baselines/reference/tsbuild/configFileExtends/when-building-solution-with-projects-extends-config-with-include.js b/tests/baselines/reference/tsbuild/configFileExtends/when-building-solution-with-projects-extends-config-with-include.js index d68345571e2..832c2c4a1fb 100644 --- a/tests/baselines/reference/tsbuild/configFileExtends/when-building-solution-with-projects-extends-config-with-include.js +++ b/tests/baselines/reference/tsbuild/configFileExtends/when-building-solution-with-projects-extends-config-with-include.js @@ -73,7 +73,7 @@ exports.a = 1; //// [/src/target-tsc-build/shared/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../lib/lib.d.ts","../../shared/index.ts","../../shared/typings-base/globals.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-22125360210-export const a: Unrestricted = 1;",{"version":"4725476611-type Unrestricted = any;","affectsGlobalScope":true}],"options":{"composite":true,"outDir":"..","rootDir":"../.."},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../lib/lib.d.ts","../../shared/index.ts","../../shared/typings-base/globals.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-22125360210-export const a: Unrestricted = 1;","signature":"-478734393-export declare const a: Unrestricted;\r\n"},{"version":"4725476611-type Unrestricted = any;","affectsGlobalScope":true}],"options":{"composite":true,"outDir":"..","rootDir":"../.."},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/src/target-tsc-build/shared/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -91,7 +91,7 @@ exports.a = 1; }, "../../shared/index.ts": { "version": "-22125360210-export const a: Unrestricted = 1;", - "signature": "-22125360210-export const a: Unrestricted = 1;" + "signature": "-478734393-export declare const a: Unrestricted;\r\n" }, "../../shared/typings-base/globals.d.ts": { "version": "4725476611-type Unrestricted = any;", @@ -113,7 +113,7 @@ exports.a = 1; ] }, "version": "FakeTSVersion", - "size": 901 + "size": 980 } //// [/src/target-tsc-build/webpack/index.d.ts] @@ -128,7 +128,7 @@ exports.b = 1; //// [/src/target-tsc-build/webpack/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../lib/lib.d.ts","../../webpack/index.ts","../../shared/typings-base/globals.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-14405273073-export const b: Unrestricted = 1;",{"version":"4725476611-type Unrestricted = any;","affectsGlobalScope":true}],"options":{"composite":true,"outDir":"..","rootDir":"../.."},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../lib/lib.d.ts","../../webpack/index.ts","../../shared/typings-base/globals.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-14405273073-export const b: Unrestricted = 1;","signature":"-5074241048-export declare const b: Unrestricted;\r\n"},{"version":"4725476611-type Unrestricted = any;","affectsGlobalScope":true}],"options":{"composite":true,"outDir":"..","rootDir":"../.."},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} //// [/src/target-tsc-build/webpack/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -146,7 +146,7 @@ exports.b = 1; }, "../../webpack/index.ts": { "version": "-14405273073-export const b: Unrestricted = 1;", - "signature": "-14405273073-export const b: Unrestricted = 1;" + "signature": "-5074241048-export declare const b: Unrestricted;\r\n" }, "../../shared/typings-base/globals.d.ts": { "version": "4725476611-type Unrestricted = any;", @@ -168,6 +168,6 @@ exports.b = 1; ] }, "version": "FakeTSVersion", - "size": 902 + "size": 982 } diff --git a/tests/baselines/reference/tsbuild/containerOnlyReferenced/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js b/tests/baselines/reference/tsbuild/containerOnlyReferenced/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js index ff5e3de77dd..02f844f3b56 100644 --- a/tests/baselines/reference/tsbuild/containerOnlyReferenced/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js +++ b/tests/baselines/reference/tsbuild/containerOnlyReferenced/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js @@ -112,7 +112,7 @@ exports.x = 10; //// [/src/src/folder/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../lib/lib.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-10726455937-export const x = 10;"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../lib/lib.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-10726455937-export const x = 10;","signature":"-6057683066-export declare const x = 10;\r\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} //// [/src/src/folder/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -129,7 +129,7 @@ exports.x = 10; }, "./index.ts": { "version": "-10726455937-export const x = 10;", - "signature": "-10726455937-export const x = 10;" + "signature": "-6057683066-export declare const x = 10;\r\n" } }, "options": { @@ -143,7 +143,7 @@ exports.x = 10; ] }, "version": "FakeTSVersion", - "size": 726 + "size": 797 } //// [/src/src/folder2/index.d.ts] @@ -158,7 +158,7 @@ exports.x = 10; //// [/src/src/folder2/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../lib/lib.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-10726455937-export const x = 10;"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../lib/lib.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-10726455937-export const x = 10;","signature":"-6057683066-export declare const x = 10;\r\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} //// [/src/src/folder2/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -175,7 +175,7 @@ exports.x = 10; }, "./index.ts": { "version": "-10726455937-export const x = 10;", - "signature": "-10726455937-export const x = 10;" + "signature": "-6057683066-export declare const x = 10;\r\n" } }, "options": { @@ -189,7 +189,7 @@ exports.x = 10; ] }, "version": "FakeTSVersion", - "size": 726 + "size": 797 } //// [/src/tests/index.d.ts] @@ -204,7 +204,7 @@ exports.x = 10; //// [/src/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-10726455937-export const x = 10;"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-10726455937-export const x = 10;","signature":"-6057683066-export declare const x = 10;\r\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} //// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -221,7 +221,7 @@ exports.x = 10; }, "./index.ts": { "version": "-10726455937-export const x = 10;", - "signature": "-10726455937-export const x = 10;" + "signature": "-6057683066-export declare const x = 10;\r\n" } }, "options": { @@ -235,7 +235,7 @@ exports.x = 10; ] }, "version": "FakeTSVersion", - "size": 723 + "size": 794 } diff --git a/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-is-referenced-through-triple-slash-but-uses-no-references.js b/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-is-referenced-through-triple-slash-but-uses-no-references.js index c89cb485b86..525d80ed504 100644 --- a/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-is-referenced-through-triple-slash-but-uses-no-references.js +++ b/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-is-referenced-through-triple-slash-but-uses-no-references.js @@ -112,7 +112,7 @@ exports.getVar = getVar; //// [/src/solution/lib/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../lib/lib.d.ts","../src/common/types.d.ts","../src/common/nominal.ts","../src/subproject/index.ts","../src/subproject2/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"23815050294-declare type MyNominal = T & {\n specialKey: Name;\n};","affectsGlobalScope":true},"4107369137-/// \nexport declare type Nominal = MyNominal;","-25117049605-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;","2747033208-import { MyNominal } from '../subProject/index';\nconst variable = {\n key: 'value' as MyNominal,\n};\nexport function getVar(): keyof typeof variable {\n return 'key';\n}"],"options":{"composite":true,"outDir":"./","rootDir":".."},"fileIdsList":[[2],[3],[4]],"referencedMap":[[3,1],[4,2],[5,3]],"exportedModulesMap":[[3,1],[4,2],[5,3]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../lib/lib.d.ts","../src/common/types.d.ts","../src/common/nominal.ts","../src/subproject/index.ts","../src/subproject2/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"23815050294-declare type MyNominal = T & {\n specialKey: Name;\n};","affectsGlobalScope":true},{"version":"4107369137-/// \nexport declare type Nominal = MyNominal;","signature":"-18894149496-/// \r\nexport declare type Nominal = MyNominal;\r\n"},{"version":"-25117049605-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;","signature":"-21416888433-import { Nominal } from '../common/nominal';\r\nexport declare type MyNominal = Nominal;\r\n"},{"version":"2747033208-import { MyNominal } from '../subProject/index';\nconst variable = {\n key: 'value' as MyNominal,\n};\nexport function getVar(): keyof typeof variable {\n return 'key';\n}","signature":"-5370006151-import { MyNominal } from '../subProject/index';\r\ndeclare const variable: {\r\n key: MyNominal;\r\n};\r\nexport declare function getVar(): keyof typeof variable;\r\nexport {};\r\n"}],"options":{"composite":true,"outDir":"./","rootDir":".."},"fileIdsList":[[2],[3],[4]],"referencedMap":[[3,1],[4,2],[5,3]],"exportedModulesMap":[[4,2],[5,3]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/src/solution/lib/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -148,15 +148,15 @@ exports.getVar = getVar; }, "../src/common/nominal.ts": { "version": "4107369137-/// \nexport declare type Nominal = MyNominal;", - "signature": "4107369137-/// \nexport declare type Nominal = MyNominal;" + "signature": "-18894149496-/// \r\nexport declare type Nominal = MyNominal;\r\n" }, "../src/subproject/index.ts": { "version": "-25117049605-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;", - "signature": "-25117049605-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;" + "signature": "-21416888433-import { Nominal } from '../common/nominal';\r\nexport declare type MyNominal = Nominal;\r\n" }, "../src/subproject2/index.ts": { "version": "2747033208-import { MyNominal } from '../subProject/index';\nconst variable = {\n key: 'value' as MyNominal,\n};\nexport function getVar(): keyof typeof variable {\n return 'key';\n}", - "signature": "2747033208-import { MyNominal } from '../subProject/index';\nconst variable = {\n key: 'value' as MyNominal,\n};\nexport function getVar(): keyof typeof variable {\n return 'key';\n}" + "signature": "-5370006151-import { MyNominal } from '../subProject/index';\r\ndeclare const variable: {\r\n key: MyNominal;\r\n};\r\nexport declare function getVar(): keyof typeof variable;\r\nexport {};\r\n" } }, "options": { @@ -176,9 +176,6 @@ exports.getVar = getVar; ] }, "exportedModulesMap": { - "../src/common/nominal.ts": [ - "../src/common/types.d.ts" - ], "../src/subproject/index.ts": [ "../src/common/nominal.ts" ], @@ -195,6 +192,6 @@ exports.getVar = getVar; ] }, "version": "FakeTSVersion", - "size": 1455 + "size": 2003 } diff --git a/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-is-referenced-through-triple-slash.js b/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-is-referenced-through-triple-slash.js index 60d3869da0b..a6e33d6fe5e 100644 --- a/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-is-referenced-through-triple-slash.js +++ b/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-is-referenced-through-triple-slash.js @@ -92,7 +92,7 @@ exports.__esModule = true; //// [/src/solution/lib/src/common/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../lib/lib.d.ts","../../../src/common/types.d.ts","../../../src/common/nominal.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"23815050294-declare type MyNominal = T & {\n specialKey: Name;\n};","affectsGlobalScope":true},"4107369137-/// \nexport declare type Nominal = MyNominal;"],"options":{"composite":true,"outDir":"../..","rootDir":"../../.."},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../lib/lib.d.ts","../../../src/common/types.d.ts","../../../src/common/nominal.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"23815050294-declare type MyNominal = T & {\n specialKey: Name;\n};","affectsGlobalScope":true},{"version":"4107369137-/// \nexport declare type Nominal = MyNominal;","signature":"-18894149496-/// \r\nexport declare type Nominal = MyNominal;\r\n"}],"options":{"composite":true,"outDir":"../..","rootDir":"../../.."},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} //// [/src/solution/lib/src/common/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -120,7 +120,7 @@ exports.__esModule = true; }, "../../../src/common/nominal.ts": { "version": "4107369137-/// \nexport declare type Nominal = MyNominal;", - "signature": "4107369137-/// \nexport declare type Nominal = MyNominal;" + "signature": "-18894149496-/// \r\nexport declare type Nominal = MyNominal;\r\n" } }, "options": { @@ -133,11 +133,7 @@ exports.__esModule = true; "../../../src/common/types.d.ts" ] }, - "exportedModulesMap": { - "../../../src/common/nominal.ts": [ - "../../../src/common/types.d.ts" - ] - }, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../../../../../lib/lib.d.ts", "../../../src/common/nominal.ts", @@ -145,7 +141,7 @@ exports.__esModule = true; ] }, "version": "FakeTSVersion", - "size": 1081 + "size": 1254 } //// [/src/solution/lib/src/subProject/index.d.ts] @@ -159,7 +155,7 @@ exports.__esModule = true; //// [/src/solution/lib/src/subProject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../lib/lib.d.ts","../../../src/common/types.d.ts","../common/nominal.d.ts","../../../src/subproject/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"23815050294-declare type MyNominal = T & {\n specialKey: Name;\n};","affectsGlobalScope":true},"-18894149496-/// \r\nexport declare type Nominal = MyNominal;\r\n","-25117049605-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;"],"options":{"composite":true,"outDir":"../..","rootDir":"../../.."},"fileIdsList":[[2],[3]],"referencedMap":[[3,1],[4,2]],"exportedModulesMap":[[3,1],[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../lib/lib.d.ts","../../../src/common/types.d.ts","../common/nominal.d.ts","../../../src/subproject/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"23815050294-declare type MyNominal = T & {\n specialKey: Name;\n};","affectsGlobalScope":true},"-18894149496-/// \r\nexport declare type Nominal = MyNominal;\r\n",{"version":"-25117049605-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;","signature":"-21416888433-import { Nominal } from '../common/nominal';\r\nexport declare type MyNominal = Nominal;\r\n"}],"options":{"composite":true,"outDir":"../..","rootDir":"../../.."},"fileIdsList":[[2],[3]],"referencedMap":[[3,1],[4,2]],"exportedModulesMap":[[3,1],[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/src/solution/lib/src/subProject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -195,7 +191,7 @@ exports.__esModule = true; }, "../../../src/subproject/index.ts": { "version": "-25117049605-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;", - "signature": "-25117049605-import { Nominal } from '../common/nominal';\nexport type MyNominal = Nominal;" + "signature": "-21416888433-import { Nominal } from '../common/nominal';\r\nexport declare type MyNominal = Nominal;\r\n" } }, "options": { @@ -227,7 +223,7 @@ exports.__esModule = true; ] }, "version": "FakeTSVersion", - "size": 1267 + "size": 1420 } //// [/src/solution/lib/src/subProject2/index.d.ts] @@ -253,7 +249,7 @@ exports.getVar = getVar; //// [/src/solution/lib/src/subProject2/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../lib/lib.d.ts","../../../src/common/types.d.ts","../common/nominal.d.ts","../subproject/index.d.ts","../../../src/subproject2/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"23815050294-declare type MyNominal = T & {\n specialKey: Name;\n};","affectsGlobalScope":true},"-18894149496-/// \r\nexport declare type Nominal = MyNominal;\r\n","-21416888433-import { Nominal } from '../common/nominal';\r\nexport declare type MyNominal = Nominal;\r\n","2747033208-import { MyNominal } from '../subProject/index';\nconst variable = {\n key: 'value' as MyNominal,\n};\nexport function getVar(): keyof typeof variable {\n return 'key';\n}"],"options":{"composite":true,"outDir":"../..","rootDir":"../../.."},"fileIdsList":[[2],[3],[4]],"referencedMap":[[3,1],[4,2],[5,3]],"exportedModulesMap":[[3,1],[4,2],[5,3]],"semanticDiagnosticsPerFile":[1,3,4,2,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../lib/lib.d.ts","../../../src/common/types.d.ts","../common/nominal.d.ts","../subproject/index.d.ts","../../../src/subproject2/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"23815050294-declare type MyNominal = T & {\n specialKey: Name;\n};","affectsGlobalScope":true},"-18894149496-/// \r\nexport declare type Nominal = MyNominal;\r\n","-21416888433-import { Nominal } from '../common/nominal';\r\nexport declare type MyNominal = Nominal;\r\n",{"version":"2747033208-import { MyNominal } from '../subProject/index';\nconst variable = {\n key: 'value' as MyNominal,\n};\nexport function getVar(): keyof typeof variable {\n return 'key';\n}","signature":"-5370006151-import { MyNominal } from '../subProject/index';\r\ndeclare const variable: {\r\n key: MyNominal;\r\n};\r\nexport declare function getVar(): keyof typeof variable;\r\nexport {};\r\n"}],"options":{"composite":true,"outDir":"../..","rootDir":"../../.."},"fileIdsList":[[2],[3],[4]],"referencedMap":[[3,1],[4,2],[5,3]],"exportedModulesMap":[[3,1],[4,2],[5,3]],"semanticDiagnosticsPerFile":[1,3,4,2,5]},"version":"FakeTSVersion"} //// [/src/solution/lib/src/subProject2/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -297,7 +293,7 @@ exports.getVar = getVar; }, "../../../src/subproject2/index.ts": { "version": "2747033208-import { MyNominal } from '../subProject/index';\nconst variable = {\n key: 'value' as MyNominal,\n};\nexport function getVar(): keyof typeof variable {\n return 'key';\n}", - "signature": "2747033208-import { MyNominal } from '../subProject/index';\nconst variable = {\n key: 'value' as MyNominal,\n};\nexport function getVar(): keyof typeof variable {\n return 'key';\n}" + "signature": "-5370006151-import { MyNominal } from '../subProject/index';\r\ndeclare const variable: {\r\n key: MyNominal;\r\n};\r\nexport declare function getVar(): keyof typeof variable;\r\nexport {};\r\n" } }, "options": { @@ -336,6 +332,6 @@ exports.getVar = getVar; ] }, "version": "FakeTSVersion", - "size": 1518 + "size": 1741 } diff --git a/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-used-inferred-type-from-referenced-project.js b/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-used-inferred-type-from-referenced-project.js index 2fe0ce35336..1ffc26e73ac 100644 --- a/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-used-inferred-type-from-referenced-project.js +++ b/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-used-inferred-type-from-referenced-project.js @@ -72,7 +72,7 @@ exports.__esModule = true; //// [/src/packages/pkg1/lib/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../lib/lib.d.ts","../src/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2072077482-export interface IThing {\n a: string;\n}\nexport interface IThings {\n thing1: IThing;\n}"],"options":{"composite":true,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../lib/lib.d.ts","../src/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2072077482-export interface IThing {\n a: string;\n}\nexport interface IThings {\n thing1: IThing;\n}","signature":"-5386205042-export interface IThing {\r\n a: string;\r\n}\r\nexport interface IThings {\r\n thing1: IThing;\r\n}\r\n"}],"options":{"composite":true,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} //// [/src/packages/pkg1/lib/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -89,7 +89,7 @@ exports.__esModule = true; }, "../src/index.ts": { "version": "-2072077482-export interface IThing {\n a: string;\n}\nexport interface IThings {\n thing1: IThing;\n}", - "signature": "-2072077482-export interface IThing {\n a: string;\n}\nexport interface IThings {\n thing1: IThing;\n}" + "signature": "-5386205042-export interface IThing {\r\n a: string;\r\n}\r\nexport interface IThings {\r\n thing1: IThing;\r\n}\r\n" } }, "options": { @@ -104,7 +104,7 @@ exports.__esModule = true; ] }, "version": "FakeTSVersion", - "size": 819 + "size": 968 } //// [/src/packages/pkg2/lib/src/index.d.ts] @@ -123,7 +123,7 @@ exports.fn4 = fn4; //// [/src/packages/pkg2/lib/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../lib/lib.d.ts","../../pkg1/lib/src/index.d.ts","../src/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-5386205042-export interface IThing {\r\n a: string;\r\n}\r\nexport interface IThings {\r\n thing1: IThing;\r\n}\r\n","8515046367-import { IThings } from '@fluentui/pkg1';\nexport function fn4() {\n const a: IThings = { thing1: { a: 'b' } };\n return a.thing1;\n}"],"options":{"composite":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../lib/lib.d.ts","../../pkg1/lib/src/index.d.ts","../src/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-5386205042-export interface IThing {\r\n a: string;\r\n}\r\nexport interface IThings {\r\n thing1: IThing;\r\n}\r\n",{"version":"8515046367-import { IThings } from '@fluentui/pkg1';\nexport function fn4() {\n const a: IThings = { thing1: { a: 'b' } };\n return a.thing1;\n}","signature":"-9447422063-export declare function fn4(): import(\"@fluentui/pkg1\").IThing;\r\n"}],"options":{"composite":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/src/packages/pkg2/lib/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -150,7 +150,7 @@ exports.fn4 = fn4; }, "../src/index.ts": { "version": "8515046367-import { IThings } from '@fluentui/pkg1';\nexport function fn4() {\n const a: IThings = { thing1: { a: 'b' } };\n return a.thing1;\n}", - "signature": "8515046367-import { IThings } from '@fluentui/pkg1';\nexport function fn4() {\n const a: IThings = { thing1: { a: 'b' } };\n return a.thing1;\n}" + "signature": "-9447422063-export declare function fn4(): import(\"@fluentui/pkg1\").IThing;\r\n" } }, "options": { @@ -174,6 +174,6 @@ exports.fn4 = fn4; ] }, "version": "FakeTSVersion", - "size": 1050 + "size": 1158 } diff --git a/tests/baselines/reference/tsbuild/demo/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js b/tests/baselines/reference/tsbuild/demo/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js index 3bfd6267acf..26009885a75 100644 --- a/tests/baselines/reference/tsbuild/demo/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js +++ b/tests/baselines/reference/tsbuild/demo/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js @@ -220,7 +220,7 @@ Object.defineProperty(exports, "createDog", { enumerable: true, get: function () //// [/src/lib/animals/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../lib/lib.d.ts","../../animals/animal.ts","../../animals/index.ts","../core/utilities.d.ts","../../animals/dog.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-14984181202-export type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n","-5382672599-import Animal from './animal';\r\n\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n","-8177343116-export declare function makeRandomName(): string;\r\nexport declare function lastElementOf(arr: T[]): T | undefined;\r\n","-10991948013-import Animal from '.';\r\nimport { makeRandomName } from '../core/utilities';\r\n\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\n\r\nexport function createDog(): Dog {\r\n return ({\r\n size: \"medium\",\r\n woof: function(this: Dog) {\r\n console.log(`${this.name} says \"Woof\"!`);\r\n },\r\n name: makeRandomName()\r\n });\r\n}\r\n\r\n"],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../animals","strict":true,"target":1},"fileIdsList":[[3,4],[2,5]],"referencedMap":[[5,1],[3,2]],"exportedModulesMap":[[5,1],[3,2]],"semanticDiagnosticsPerFile":[1,2,5,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../lib/lib.d.ts","../../animals/animal.ts","../../animals/index.ts","../core/utilities.d.ts","../../animals/dog.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-14984181202-export type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n","signature":"13427676350-export declare type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n"},{"version":"-5382672599-import Animal from './animal';\r\n\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n","signature":"4477582546-import Animal from './animal';\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n"},"-8177343116-export declare function makeRandomName(): string;\r\nexport declare function lastElementOf(arr: T[]): T | undefined;\r\n",{"version":"-10991948013-import Animal from '.';\r\nimport { makeRandomName } from '../core/utilities';\r\n\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\n\r\nexport function createDog(): Dog {\r\n return ({\r\n size: \"medium\",\r\n woof: function(this: Dog) {\r\n console.log(`${this.name} says \"Woof\"!`);\r\n },\r\n name: makeRandomName()\r\n });\r\n}\r\n\r\n","signature":"10854678623-import Animal from '.';\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\nexport declare function createDog(): Dog;\r\n"}],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../animals","strict":true,"target":1},"fileIdsList":[[3,4],[2,5],[3]],"referencedMap":[[5,1],[3,2]],"exportedModulesMap":[[5,3],[3,2]],"semanticDiagnosticsPerFile":[1,2,5,3,4]},"version":"FakeTSVersion"} //// [/src/lib/animals/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -240,6 +240,9 @@ Object.defineProperty(exports, "createDog", { enumerable: true, get: function () [ "../../animals/animal.ts", "../../animals/dog.ts" + ], + [ + "../../animals/index.ts" ] ], "fileInfos": { @@ -250,11 +253,11 @@ Object.defineProperty(exports, "createDog", { enumerable: true, get: function () }, "../../animals/animal.ts": { "version": "-14984181202-export type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n", - "signature": "-14984181202-export type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n" + "signature": "13427676350-export declare type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n" }, "../../animals/index.ts": { "version": "-5382672599-import Animal from './animal';\r\n\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n", - "signature": "-5382672599-import Animal from './animal';\r\n\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n" + "signature": "4477582546-import Animal from './animal';\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n" }, "../core/utilities.d.ts": { "version": "-8177343116-export declare function makeRandomName(): string;\r\nexport declare function lastElementOf(arr: T[]): T | undefined;\r\n", @@ -262,7 +265,7 @@ Object.defineProperty(exports, "createDog", { enumerable: true, get: function () }, "../../animals/dog.ts": { "version": "-10991948013-import Animal from '.';\r\nimport { makeRandomName } from '../core/utilities';\r\n\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\n\r\nexport function createDog(): Dog {\r\n return ({\r\n size: \"medium\",\r\n woof: function(this: Dog) {\r\n console.log(`${this.name} says \"Woof\"!`);\r\n },\r\n name: makeRandomName()\r\n });\r\n}\r\n\r\n", - "signature": "-10991948013-import Animal from '.';\r\nimport { makeRandomName } from '../core/utilities';\r\n\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\n\r\nexport function createDog(): Dog {\r\n return ({\r\n size: \"medium\",\r\n woof: function(this: Dog) {\r\n console.log(`${this.name} says \"Woof\"!`);\r\n },\r\n name: makeRandomName()\r\n });\r\n}\r\n\r\n" + "signature": "10854678623-import Animal from '.';\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\nexport declare function createDog(): Dog;\r\n" } }, "options": { @@ -290,8 +293,7 @@ Object.defineProperty(exports, "createDog", { enumerable: true, get: function () }, "exportedModulesMap": { "../../animals/dog.ts": [ - "../../animals/index.ts", - "../core/utilities.d.ts" + "../../animals/index.ts" ], "../../animals/index.ts": [ "../../animals/animal.ts", @@ -307,11 +309,11 @@ Object.defineProperty(exports, "createDog", { enumerable: true, get: function () ] }, "version": "FakeTSVersion", - "size": 1903 + "size": 2443 } //// [/src/lib/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../lib/lib.d.ts","../../core/utilities.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"25274411612-\r\nexport function makeRandomName() {\r\n return \"Bob!?! \";\r\n}\r\n\r\nexport function lastElementOf(arr: T[]): T | undefined {\r\n if (arr.length === 0) return undefined;\r\n return arr[arr.length - 1];\r\n}\r\n\r\n"],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../core","strict":true,"target":1},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../lib/lib.d.ts","../../core/utilities.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"25274411612-\r\nexport function makeRandomName() {\r\n return \"Bob!?! \";\r\n}\r\n\r\nexport function lastElementOf(arr: T[]): T | undefined {\r\n if (arr.length === 0) return undefined;\r\n return arr[arr.length - 1];\r\n}\r\n\r\n","signature":"-8177343116-export declare function makeRandomName(): string;\r\nexport declare function lastElementOf(arr: T[]): T | undefined;\r\n"}],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../core","strict":true,"target":1},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} //// [/src/lib/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -328,7 +330,7 @@ Object.defineProperty(exports, "createDog", { enumerable: true, get: function () }, "../../core/utilities.ts": { "version": "25274411612-\r\nexport function makeRandomName() {\r\n return \"Bob!?! \";\r\n}\r\n\r\nexport function lastElementOf(arr: T[]): T | undefined {\r\n if (arr.length === 0) return undefined;\r\n return arr[arr.length - 1];\r\n}\r\n\r\n", - "signature": "25274411612-\r\nexport function makeRandomName() {\r\n return \"Bob!?! \";\r\n}\r\n\r\nexport function lastElementOf(arr: T[]): T | undefined {\r\n if (arr.length === 0) return undefined;\r\n return arr[arr.length - 1];\r\n}\r\n\r\n" + "signature": "-8177343116-export declare function makeRandomName(): string;\r\nexport declare function lastElementOf(arr: T[]): T | undefined;\r\n" } }, "options": { @@ -352,7 +354,7 @@ Object.defineProperty(exports, "createDog", { enumerable: true, get: function () ] }, "version": "FakeTSVersion", - "size": 1149 + "size": 1311 } //// [/src/lib/core/utilities.d.ts] @@ -377,7 +379,7 @@ exports.lastElementOf = lastElementOf; //// [/src/lib/zoo/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../lib/lib.d.ts","../animals/animal.d.ts","../animals/dog.d.ts","../animals/index.d.ts","../../zoo/zoo.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"13427676350-export declare type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n","10854678623-import Animal from '.';\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\nexport declare function createDog(): Dog;\r\n","4477582546-import Animal from './animal';\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n","8797123924-import { Dog, createDog } from '../animals/index';\r\n\r\nexport function createZoo(): Array {\r\n return [\r\n createDog()\r\n ];\r\n}\r\n\r\n"],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../zoo","strict":true,"target":1},"fileIdsList":[[4],[2,3]],"referencedMap":[[3,1],[4,2],[5,1]],"exportedModulesMap":[[3,1],[4,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,3,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../lib/lib.d.ts","../animals/animal.d.ts","../animals/dog.d.ts","../animals/index.d.ts","../../zoo/zoo.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"13427676350-export declare type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n","10854678623-import Animal from '.';\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\nexport declare function createDog(): Dog;\r\n","4477582546-import Animal from './animal';\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n",{"version":"8797123924-import { Dog, createDog } from '../animals/index';\r\n\r\nexport function createZoo(): Array {\r\n return [\r\n createDog()\r\n ];\r\n}\r\n\r\n","signature":"-17433436879-import { Dog } from '../animals/index';\r\nexport declare function createZoo(): Array;\r\n"}],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../zoo","strict":true,"target":1},"fileIdsList":[[4],[2,3]],"referencedMap":[[3,1],[4,2],[5,1]],"exportedModulesMap":[[3,1],[4,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,3,4,5]},"version":"FakeTSVersion"} //// [/src/lib/zoo/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -418,7 +420,7 @@ exports.lastElementOf = lastElementOf; }, "../../zoo/zoo.ts": { "version": "8797123924-import { Dog, createDog } from '../animals/index';\r\n\r\nexport function createZoo(): Array {\r\n return [\r\n createDog()\r\n ];\r\n}\r\n\r\n", - "signature": "8797123924-import { Dog, createDog } from '../animals/index';\r\n\r\nexport function createZoo(): Array {\r\n return [\r\n createDog()\r\n ];\r\n}\r\n\r\n" + "signature": "-17433436879-import { Dog } from '../animals/index';\r\nexport declare function createZoo(): Array;\r\n" } }, "options": { @@ -467,7 +469,7 @@ exports.lastElementOf = lastElementOf; ] }, "version": "FakeTSVersion", - "size": 1670 + "size": 1805 } //// [/src/lib/zoo/zoo.d.ts] diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js index 85cba94d561..8d4b84b50a9 100644 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js @@ -120,7 +120,7 @@ export { C } from "./c"; {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC"} //// [/src/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../lib/lib.d.ts","./src/c.ts","./src/b.ts","./src/a.ts","./src/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n","-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n","-15463561693-import { B } from \"./b\";\n\nexport interface A {\n b: B;\n}\n","1286756397-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n"],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"module":1,"outDir":"./lib","rootDir":"./src","sourceMap":true,"strict":true,"target":1},"fileIdsList":[[3],[2],[4],[2,3,4]],"referencedMap":[[4,1],[3,2],[2,3],[5,4]],"exportedModulesMap":[[4,1],[3,2],[2,3],[5,4]],"semanticDiagnosticsPerFile":[1,4,3,2,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../lib/lib.d.ts","./src/c.ts","./src/b.ts","./src/a.ts","./src/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n","signature":"-2697851509-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n"},{"version":"-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n","signature":"20298635505-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n"},{"version":"-15463561693-import { B } from \"./b\";\n\nexport interface A {\n b: B;\n}\n","signature":"-4206296467-import { B } from \"./b\";\r\nexport interface A {\r\n b: B;\r\n}\r\n"},{"version":"1286756397-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n","signature":"-6009477228-export { A } from \"./a\";\r\nexport { B } from \"./b\";\r\nexport { C } from \"./c\";\r\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"module":1,"outDir":"./lib","rootDir":"./src","sourceMap":true,"strict":true,"target":1},"fileIdsList":[[3],[2],[4],[2,3,4]],"referencedMap":[[4,1],[3,2],[2,3],[5,4]],"exportedModulesMap":[[4,1],[3,2],[2,3],[5,4]],"semanticDiagnosticsPerFile":[1,4,3,2,5]},"version":"FakeTSVersion"} //// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -156,19 +156,19 @@ export { C } from "./c"; }, "./src/c.ts": { "version": "429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n", - "signature": "429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n" + "signature": "-2697851509-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n" }, "./src/b.ts": { "version": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n", - "signature": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n" + "signature": "20298635505-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n" }, "./src/a.ts": { "version": "-15463561693-import { B } from \"./b\";\n\nexport interface A {\n b: B;\n}\n", - "signature": "-15463561693-import { B } from \"./b\";\n\nexport interface A {\n b: B;\n}\n" + "signature": "-4206296467-import { B } from \"./b\";\r\nexport interface A {\r\n b: B;\r\n}\r\n" }, "./src/index.ts": { "version": "1286756397-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n", - "signature": "1286756397-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n" + "signature": "-6009477228-export { A } from \"./a\";\r\nexport { B } from \"./b\";\r\nexport { C } from \"./c\";\r\n" } }, "options": { @@ -225,7 +225,7 @@ export { C } from "./c"; ] }, "version": "FakeTSVersion", - "size": 1328 + "size": 1790 } diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js index 4ff553ac46c..61f540077e3 100644 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js @@ -108,7 +108,7 @@ export { C } from "./c"; //// [/src/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../lib/lib.d.ts","./src/c.ts","./src/b.ts","./src/a.ts","./src/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n","-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n","-15463561693-import { B } from \"./b\";\n\nexport interface A {\n b: B;\n}\n","1286756397-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n"],"options":{"composite":true,"declaration":true,"emitDeclarationOnly":true,"esModuleInterop":true,"module":1,"outDir":"./lib","rootDir":"./src","sourceMap":true,"strict":true,"target":1},"fileIdsList":[[3],[2],[4],[2,3,4]],"referencedMap":[[4,1],[3,2],[2,3],[5,4]],"exportedModulesMap":[[4,1],[3,2],[2,3],[5,4]],"semanticDiagnosticsPerFile":[1,4,3,2,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../lib/lib.d.ts","./src/c.ts","./src/b.ts","./src/a.ts","./src/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n","signature":"-2697851509-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n"},{"version":"-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n","signature":"20298635505-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n"},{"version":"-15463561693-import { B } from \"./b\";\n\nexport interface A {\n b: B;\n}\n","signature":"-4206296467-import { B } from \"./b\";\r\nexport interface A {\r\n b: B;\r\n}\r\n"},{"version":"1286756397-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n","signature":"-6009477228-export { A } from \"./a\";\r\nexport { B } from \"./b\";\r\nexport { C } from \"./c\";\r\n"}],"options":{"composite":true,"declaration":true,"emitDeclarationOnly":true,"esModuleInterop":true,"module":1,"outDir":"./lib","rootDir":"./src","sourceMap":true,"strict":true,"target":1},"fileIdsList":[[3],[2],[4],[2,3,4]],"referencedMap":[[4,1],[3,2],[2,3],[5,4]],"exportedModulesMap":[[4,1],[3,2],[2,3],[5,4]],"semanticDiagnosticsPerFile":[1,4,3,2,5]},"version":"FakeTSVersion"} //// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -144,19 +144,19 @@ export { C } from "./c"; }, "./src/c.ts": { "version": "429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n", - "signature": "429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n" + "signature": "-2697851509-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n" }, "./src/b.ts": { "version": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n", - "signature": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n" + "signature": "20298635505-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n" }, "./src/a.ts": { "version": "-15463561693-import { B } from \"./b\";\n\nexport interface A {\n b: B;\n}\n", - "signature": "-15463561693-import { B } from \"./b\";\n\nexport interface A {\n b: B;\n}\n" + "signature": "-4206296467-import { B } from \"./b\";\r\nexport interface A {\r\n b: B;\r\n}\r\n" }, "./src/index.ts": { "version": "1286756397-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n", - "signature": "1286756397-export { A } from \"./a\";\nexport { B } from \"./b\";\nexport { C } from \"./c\";\n" + "signature": "-6009477228-export { A } from \"./a\";\r\nexport { B } from \"./b\";\r\nexport { C } from \"./c\";\r\n" } }, "options": { @@ -212,7 +212,7 @@ export { C } from "./c"; ] }, "version": "FakeTSVersion", - "size": 1306 + "size": 1768 } diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js index 1c6cd86d434..d76a4888c6d 100644 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js @@ -107,7 +107,7 @@ export interface C { {"version":3,"file":"c.d.ts","sourceRoot":"","sources":["../src/c.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,CAAC;IAChB,CAAC,EAAE,CAAC,CAAC;CACN"} //// [/src/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../lib/lib.d.ts","./src/a.ts","./src/c.ts","./src/b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"11179224639-export class B { prop = \"hello\"; }\n\nexport interface A {\n b: B;\n}\n","429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n","-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n"],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"module":1,"outDir":"./lib","rootDir":"./src","sourceMap":true,"strict":true,"target":1},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,2,4,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../lib/lib.d.ts","./src/a.ts","./src/c.ts","./src/b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"11179224639-export class B { prop = \"hello\"; }\n\nexport interface A {\n b: B;\n}\n","signature":"-4181862109-export declare class B {\r\n prop: string;\r\n}\r\nexport interface A {\r\n b: B;\r\n}\r\n"},{"version":"429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n","signature":"-2697851509-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n"},{"version":"-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n","signature":"20298635505-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"module":1,"outDir":"./lib","rootDir":"./src","sourceMap":true,"strict":true,"target":1},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,2,4,3]},"version":"FakeTSVersion"} //// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -134,15 +134,15 @@ export interface C { }, "./src/a.ts": { "version": "11179224639-export class B { prop = \"hello\"; }\n\nexport interface A {\n b: B;\n}\n", - "signature": "11179224639-export class B { prop = \"hello\"; }\n\nexport interface A {\n b: B;\n}\n" + "signature": "-4181862109-export declare class B {\r\n prop: string;\r\n}\r\nexport interface A {\r\n b: B;\r\n}\r\n" }, "./src/c.ts": { "version": "429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n", - "signature": "429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n" + "signature": "-2697851509-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n" }, "./src/b.ts": { "version": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n", - "signature": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n" + "signature": "20298635505-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n" } }, "options": { @@ -182,7 +182,7 @@ export interface C { ] }, "version": "FakeTSVersion", - "size": 1184 + "size": 1541 } @@ -209,6 +209,8 @@ Output:: [12:04:00 AM] Building project '/src/tsconfig.json'... +[12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... + exitCode:: ExitStatus.Success @@ -216,10 +218,7 @@ exitCode:: ExitStatus.Success //// [/src/lib/a.d.ts.map] {"version":3,"file":"a.d.ts","sourceRoot":"","sources":["../src/a.ts"],"names":[],"mappings":"AAAA,qBAAa,CAAC;IAAG,IAAI,SAAW;CAAE;AAGlC,MAAM,WAAW,CAAC;IAChB,CAAC,EAAE,CAAC,CAAC;CACN"} -//// [/src/lib/b.d.ts] file written with same contents -//// [/src/lib/b.d.ts.map] file written with same contents -//// [/src/lib/c.d.ts] file written with same contents -//// [/src/lib/c.d.ts.map] file written with same contents +//// [/src/lib/b.d.ts] file changed its modified time //// [/src/tsconfig.tsbuildinfo] {"program":{"fileNames":["../lib/lib.d.ts","./src/a.ts","./src/c.ts","./src/b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"6651905050-export class B { prop = \"hello\"; }\n\nclass C { }\nexport interface A {\n b: B;\n}\n","signature":"-4181862109-export declare class B {\r\n prop: string;\r\n}\r\nexport interface A {\r\n b: B;\r\n}\r\n"},{"version":"429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n","signature":"-2697851509-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n"},{"version":"-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n","signature":"20298635505-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"module":1,"outDir":"./lib","rootDir":"./src","sourceMap":true,"strict":true,"target":1},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,2,4,3]},"version":"FakeTSVersion"} @@ -344,7 +343,7 @@ export interface A { //// [/src/lib/c.d.ts] file written with same contents //// [/src/lib/c.d.ts.map] file written with same contents //// [/src/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../lib/lib.d.ts","./src/a.ts","./src/c.ts","./src/b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"5380514971-export class B { prop = \"hello\"; }\n\nclass C { }\nexport interface A {\n b: B; foo: any;\n}\n","signature":"-6995298949-export declare class B {\r\n prop: string;\r\n}\r\nexport interface A {\r\n b: B;\r\n foo: any;\r\n}\r\n"},{"version":"429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n","signature":"-2697851509-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n"},"-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n"],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"module":1,"outDir":"./lib","rootDir":"./src","sourceMap":true,"strict":true,"target":1},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,2,4,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../lib/lib.d.ts","./src/a.ts","./src/c.ts","./src/b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"5380514971-export class B { prop = \"hello\"; }\n\nclass C { }\nexport interface A {\n b: B; foo: any;\n}\n","signature":"-6995298949-export declare class B {\r\n prop: string;\r\n}\r\nexport interface A {\r\n b: B;\r\n foo: any;\r\n}\r\n"},{"version":"429593025-import { A } from \"./a\";\n\nexport interface C {\n a: A;\n}\n","signature":"-2697851509-import { A } from \"./a\";\r\nexport interface C {\r\n a: A;\r\n}\r\n"},{"version":"-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n","signature":"20298635505-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"module":1,"outDir":"./lib","rootDir":"./src","sourceMap":true,"strict":true,"target":1},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,2,4,3]},"version":"FakeTSVersion"} //// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -379,7 +378,7 @@ export interface A { }, "./src/b.ts": { "version": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n", - "signature": "-2273488249-import { C } from \"./c\";\n\nexport interface B {\n b: C;\n}\n" + "signature": "20298635505-import { C } from \"./c\";\r\nexport interface B {\r\n b: C;\r\n}\r\n" } }, "options": { @@ -419,6 +418,6 @@ export interface A { ] }, "version": "FakeTSVersion", - "size": 1469 + "size": 1580 } diff --git a/tests/baselines/reference/tsbuild/emptyFiles/does-not-have-empty-files-diagnostic-when-files-is-empty-and-references-are-provided.js b/tests/baselines/reference/tsbuild/emptyFiles/does-not-have-empty-files-diagnostic-when-files-is-empty-and-references-are-provided.js index e39985e53a2..b8abb5962b5 100644 --- a/tests/baselines/reference/tsbuild/emptyFiles/does-not-have-empty-files-diagnostic-when-files-is-empty-and-references-are-provided.js +++ b/tests/baselines/reference/tsbuild/emptyFiles/does-not-have-empty-files-diagnostic-when-files-is-empty-and-references-are-provided.js @@ -70,7 +70,7 @@ exports.multiply = multiply; //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"5112841898-export function multiply(a: number, b: number) { return a * b; }\r\n"],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"5112841898-export function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7111849992-export declare function multiply(a: number, b: number): number;\r\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -87,7 +87,7 @@ exports.multiply = multiply; }, "./index.ts": { "version": "5112841898-export function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "5112841898-export function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "-7111849992-export declare function multiply(a: number, b: number): number;\r\n" } }, "options": { @@ -104,6 +104,6 @@ exports.multiply = multiply; ] }, "version": "FakeTSVersion", - "size": 837 + "size": 943 } diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module-with-isolatedModules.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module-with-isolatedModules.js index 6b4be6975b5..3a590ffee97 100644 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module-with-isolatedModules.js +++ b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module-with-isolatedModules.js @@ -152,7 +152,7 @@ Object.defineProperty(exports, "bar", { enumerable: true, get: function () { ret //// [/src/obj/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyindex.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"5936740878-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(param: string): void {\r\n});","-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n",{"version":"-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}","affectsGlobalScope":true},"-6956449754-export { default as bar } from './bar';\n","-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);"],"options":{"declaration":true,"outDir":"./","target":1},"fileIdsList":[[3,5],[2]],"referencedMap":[[6,1],[5,2]],"exportedModulesMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,6,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyindex.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"5936740878-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(param: string): void {\r\n});","signature":"11191036521-declare const _default: (param: string) => void;\r\nexport default _default;\r\n"},{"version":"-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n","signature":"-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n"},{"version":"-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}","affectsGlobalScope":true},{"version":"-6956449754-export { default as bar } from './bar';\n","signature":"-6224542381-export { default as bar } from './bar';\r\n"},{"version":"-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"18468008756-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\r\n"}],"options":{"declaration":true,"outDir":"./","target":1},"fileIdsList":[[3,5],[2]],"referencedMap":[[6,1],[5,2]],"exportedModulesMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,6,5]},"version":"FakeTSVersion"} //// [/src/obj/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -182,11 +182,11 @@ Object.defineProperty(exports, "bar", { enumerable: true, get: function () { ret }, "../bar.ts": { "version": "5936740878-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(param: string): void {\r\n});", - "signature": "5936740878-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(param: string): void {\r\n});" + "signature": "11191036521-declare const _default: (param: string) => void;\r\nexport default _default;\r\n" }, "../bundling.ts": { "version": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n", - "signature": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n" + "signature": "-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n" }, "../global.d.ts": { "version": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", @@ -195,11 +195,11 @@ Object.defineProperty(exports, "bar", { enumerable: true, get: function () { ret }, "../lazyindex.ts": { "version": "-6956449754-export { default as bar } from './bar';\n", - "signature": "-6956449754-export { default as bar } from './bar';\n" + "signature": "-6224542381-export { default as bar } from './bar';\r\n" }, "../index.ts": { "version": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", - "signature": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);" + "signature": "18468008756-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\r\n" } }, "options": { @@ -235,7 +235,7 @@ Object.defineProperty(exports, "bar", { enumerable: true, get: function () { ret ] }, "version": "FakeTSVersion", - "size": 1937 + "size": 2690 } @@ -288,7 +288,7 @@ export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex" //// [/src/obj/lazyIndex.d.ts] file written with same contents //// [/src/obj/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyindex.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"747071916-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(): void {\r\n});","signature":"-9232740537-declare const _default: () => void;\r\nexport default _default;\r\n"},"-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n",{"version":"-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}","affectsGlobalScope":true},"-6956449754-export { default as bar } from './bar';\n","-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);"],"options":{"declaration":true,"outDir":"./","target":1},"fileIdsList":[[3,5],[2]],"referencedMap":[[6,1],[5,2]],"exportedModulesMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,6,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyindex.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"747071916-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(): void {\r\n});","signature":"-9232740537-declare const _default: () => void;\r\nexport default _default;\r\n"},{"version":"-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n","signature":"-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n"},{"version":"-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}","affectsGlobalScope":true},{"version":"-6956449754-export { default as bar } from './bar';\n","signature":"-6224542381-export { default as bar } from './bar';\r\n"},{"version":"-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"6256067474-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\r\n"}],"options":{"declaration":true,"outDir":"./","target":1},"fileIdsList":[[3,5],[2]],"referencedMap":[[6,1],[5,2]],"exportedModulesMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,6,5]},"version":"FakeTSVersion"} //// [/src/obj/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -322,7 +322,7 @@ export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex" }, "../bundling.ts": { "version": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n", - "signature": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n" + "signature": "-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n" }, "../global.d.ts": { "version": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", @@ -331,11 +331,11 @@ export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex" }, "../lazyindex.ts": { "version": "-6956449754-export { default as bar } from './bar';\n", - "signature": "-6956449754-export { default as bar } from './bar';\n" + "signature": "-6224542381-export { default as bar } from './bar';\r\n" }, "../index.ts": { "version": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", - "signature": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);" + "signature": "6256067474-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\r\n" } }, "options": { @@ -371,7 +371,7 @@ export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex" ] }, "version": "FakeTSVersion", - "size": 2029 + "size": 2649 } @@ -424,7 +424,7 @@ export declare const lazyBar: LazyAction<(param: string) => void, typeof import( //// [/src/obj/lazyIndex.d.ts] file written with same contents //// [/src/obj/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyindex.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"5936740878-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(param: string): void {\r\n});","signature":"11191036521-declare const _default: (param: string) => void;\r\nexport default _default;\r\n"},"-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n",{"version":"-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}","affectsGlobalScope":true},"-6956449754-export { default as bar } from './bar';\n","-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);"],"options":{"declaration":true,"outDir":"./","target":1},"fileIdsList":[[3,5],[2]],"referencedMap":[[6,1],[5,2]],"exportedModulesMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,6,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyindex.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"5936740878-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(param: string): void {\r\n});","signature":"11191036521-declare const _default: (param: string) => void;\r\nexport default _default;\r\n"},{"version":"-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n","signature":"-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n"},{"version":"-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}","affectsGlobalScope":true},{"version":"-6956449754-export { default as bar } from './bar';\n","signature":"-6224542381-export { default as bar } from './bar';\r\n"},{"version":"-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"18468008756-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\r\n"}],"options":{"declaration":true,"outDir":"./","target":1},"fileIdsList":[[3,5],[2]],"referencedMap":[[6,1],[5,2]],"exportedModulesMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,6,5]},"version":"FakeTSVersion"} //// [/src/obj/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -458,7 +458,7 @@ export declare const lazyBar: LazyAction<(param: string) => void, typeof import( }, "../bundling.ts": { "version": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n", - "signature": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n" + "signature": "-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n" }, "../global.d.ts": { "version": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", @@ -467,11 +467,11 @@ export declare const lazyBar: LazyAction<(param: string) => void, typeof import( }, "../lazyindex.ts": { "version": "-6956449754-export { default as bar } from './bar';\n", - "signature": "-6956449754-export { default as bar } from './bar';\n" + "signature": "-6224542381-export { default as bar } from './bar';\r\n" }, "../index.ts": { "version": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", - "signature": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);" + "signature": "18468008756-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\r\n" } }, "options": { @@ -507,6 +507,6 @@ export declare const lazyBar: LazyAction<(param: string) => void, typeof import( ] }, "version": "FakeTSVersion", - "size": 2056 + "size": 2690 } diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module.js index ddf3fdf8cf5..70ae187dfcd 100644 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module.js +++ b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module.js @@ -152,7 +152,7 @@ Object.defineProperty(exports, "bar", { enumerable: true, get: function () { ret //// [/src/obj/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyindex.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"5936740878-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(param: string): void {\r\n});","-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n",{"version":"-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}","affectsGlobalScope":true},"-6956449754-export { default as bar } from './bar';\n","-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);"],"options":{"declaration":true,"outDir":"./","target":1},"fileIdsList":[[3,5],[2]],"referencedMap":[[6,1],[5,2]],"exportedModulesMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,6,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyindex.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"5936740878-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(param: string): void {\r\n});","signature":"11191036521-declare const _default: (param: string) => void;\r\nexport default _default;\r\n"},{"version":"-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n","signature":"-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n"},{"version":"-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}","affectsGlobalScope":true},{"version":"-6956449754-export { default as bar } from './bar';\n","signature":"-6224542381-export { default as bar } from './bar';\r\n"},{"version":"-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"18468008756-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\r\n"}],"options":{"declaration":true,"outDir":"./","target":1},"fileIdsList":[[3,5],[2]],"referencedMap":[[6,1],[5,2]],"exportedModulesMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,6,5]},"version":"FakeTSVersion"} //// [/src/obj/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -182,11 +182,11 @@ Object.defineProperty(exports, "bar", { enumerable: true, get: function () { ret }, "../bar.ts": { "version": "5936740878-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(param: string): void {\r\n});", - "signature": "5936740878-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(param: string): void {\r\n});" + "signature": "11191036521-declare const _default: (param: string) => void;\r\nexport default _default;\r\n" }, "../bundling.ts": { "version": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n", - "signature": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n" + "signature": "-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n" }, "../global.d.ts": { "version": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", @@ -195,11 +195,11 @@ Object.defineProperty(exports, "bar", { enumerable: true, get: function () { ret }, "../lazyindex.ts": { "version": "-6956449754-export { default as bar } from './bar';\n", - "signature": "-6956449754-export { default as bar } from './bar';\n" + "signature": "-6224542381-export { default as bar } from './bar';\r\n" }, "../index.ts": { "version": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", - "signature": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);" + "signature": "18468008756-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\r\n" } }, "options": { @@ -235,7 +235,7 @@ Object.defineProperty(exports, "bar", { enumerable: true, get: function () { ret ] }, "version": "FakeTSVersion", - "size": 1937 + "size": 2690 } @@ -286,11 +286,10 @@ import { LazyAction } from './bundling'; export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex")>; -//// [/src/obj/index.js] file written with same contents //// [/src/obj/lazyIndex.d.ts] file written with same contents //// [/src/obj/lazyIndex.js] file written with same contents //// [/src/obj/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyindex.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"747071916-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(): void {\r\n});","signature":"-9232740537-declare const _default: () => void;\r\nexport default _default;\r\n"},"-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n",{"version":"-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}","affectsGlobalScope":true},{"version":"-6956449754-export { default as bar } from './bar';\n","signature":"-6224542381-export { default as bar } from './bar';\r\n"},{"version":"-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"6256067474-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\r\n"}],"options":{"declaration":true,"outDir":"./","target":1},"fileIdsList":[[3,5],[2]],"referencedMap":[[6,1],[5,2]],"exportedModulesMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,6,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyindex.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"747071916-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(): void {\r\n});","signature":"-9232740537-declare const _default: () => void;\r\nexport default _default;\r\n"},{"version":"-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n","signature":"-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n"},{"version":"-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}","affectsGlobalScope":true},{"version":"-6956449754-export { default as bar } from './bar';\n","signature":"-6224542381-export { default as bar } from './bar';\r\n"},{"version":"-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"6256067474-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\r\n"}],"options":{"declaration":true,"outDir":"./","target":1},"fileIdsList":[[3,5],[2]],"referencedMap":[[6,1],[5,2]],"exportedModulesMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,6,5]},"version":"FakeTSVersion"} //// [/src/obj/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -324,7 +323,7 @@ export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex" }, "../bundling.ts": { "version": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n", - "signature": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n" + "signature": "-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n" }, "../global.d.ts": { "version": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", @@ -373,7 +372,7 @@ export declare const lazyBar: LazyAction<() => void, typeof import("./lazyIndex" ] }, "version": "FakeTSVersion", - "size": 2282 + "size": 2649 } @@ -427,7 +426,7 @@ export declare const lazyBar: LazyAction<(param: string) => void, typeof import( //// [/src/obj/lazyIndex.d.ts] file written with same contents //// [/src/obj/lazyIndex.js] file written with same contents //// [/src/obj/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyindex.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"5936740878-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(param: string): void {\r\n});","signature":"11191036521-declare const _default: (param: string) => void;\r\nexport default _default;\r\n"},"-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n",{"version":"-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}","affectsGlobalScope":true},{"version":"-6956449754-export { default as bar } from './bar';\n","signature":"-6224542381-export { default as bar } from './bar';\r\n"},"-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);"],"options":{"declaration":true,"outDir":"./","target":1},"fileIdsList":[[3,5],[2]],"referencedMap":[[6,1],[5,2]],"exportedModulesMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,6,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyindex.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"5936740878-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(param: string): void {\r\n});","signature":"11191036521-declare const _default: (param: string) => void;\r\nexport default _default;\r\n"},{"version":"-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n","signature":"-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n"},{"version":"-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}","affectsGlobalScope":true},{"version":"-6956449754-export { default as bar } from './bar';\n","signature":"-6224542381-export { default as bar } from './bar';\r\n"},{"version":"-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"18468008756-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\r\n"}],"options":{"declaration":true,"outDir":"./","target":1},"fileIdsList":[[3,5],[2]],"referencedMap":[[6,1],[5,2]],"exportedModulesMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,6,5]},"version":"FakeTSVersion"} //// [/src/obj/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -461,7 +460,7 @@ export declare const lazyBar: LazyAction<(param: string) => void, typeof import( }, "../bundling.ts": { "version": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n", - "signature": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n" + "signature": "-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n" }, "../global.d.ts": { "version": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", @@ -474,7 +473,7 @@ export declare const lazyBar: LazyAction<(param: string) => void, typeof import( }, "../index.ts": { "version": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", - "signature": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);" + "signature": "18468008756-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\r\n" } }, "options": { @@ -510,6 +509,6 @@ export declare const lazyBar: LazyAction<(param: string) => void, typeof import( ] }, "version": "FakeTSVersion", - "size": 2138 + "size": 2690 } diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js index 8f5d81972d4..9d1918fea05 100644 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js +++ b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js @@ -156,7 +156,7 @@ var bar_2 = require("./bar"); //// [/src/obj/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyindex.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"5936740878-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(param: string): void {\r\n});","-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n",{"version":"-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}","affectsGlobalScope":true},"3017320451-export { default as bar } from './bar';\n\nimport { default as bar } from './bar';\nbar(\"hello\");","-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);"],"options":{"declaration":true,"outDir":"./","target":1},"fileIdsList":[[3,5],[2]],"referencedMap":[[6,1],[5,2]],"exportedModulesMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,6,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyindex.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"5936740878-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(param: string): void {\r\n});","signature":"11191036521-declare const _default: (param: string) => void;\r\nexport default _default;\r\n"},{"version":"-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n","signature":"-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n"},{"version":"-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}","affectsGlobalScope":true},{"version":"3017320451-export { default as bar } from './bar';\n\nimport { default as bar } from './bar';\nbar(\"hello\");","signature":"-6224542381-export { default as bar } from './bar';\r\n"},{"version":"-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"18468008756-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\r\n"}],"options":{"declaration":true,"outDir":"./","target":1},"fileIdsList":[[3,5],[2]],"referencedMap":[[6,1],[5,2]],"exportedModulesMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,6,5]},"version":"FakeTSVersion"} //// [/src/obj/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -186,11 +186,11 @@ var bar_2 = require("./bar"); }, "../bar.ts": { "version": "5936740878-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(param: string): void {\r\n});", - "signature": "5936740878-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(param: string): void {\r\n});" + "signature": "11191036521-declare const _default: (param: string) => void;\r\nexport default _default;\r\n" }, "../bundling.ts": { "version": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n", - "signature": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n" + "signature": "-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n" }, "../global.d.ts": { "version": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", @@ -199,11 +199,11 @@ var bar_2 = require("./bar"); }, "../lazyindex.ts": { "version": "3017320451-export { default as bar } from './bar';\n\nimport { default as bar } from './bar';\nbar(\"hello\");", - "signature": "3017320451-export { default as bar } from './bar';\n\nimport { default as bar } from './bar';\nbar(\"hello\");" + "signature": "-6224542381-export { default as bar } from './bar';\r\n" }, "../index.ts": { "version": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", - "signature": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);" + "signature": "18468008756-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\r\n" } }, "options": { @@ -239,7 +239,7 @@ var bar_2 = require("./bar"); ] }, "version": "FakeTSVersion", - "size": 1994 + "size": 2747 } @@ -280,7 +280,7 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped //// [/src/obj/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyindex.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"747071916-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(): void {\r\n});","signature":"-9232740537-declare const _default: () => void;\r\nexport default _default;\r\n"},"-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n",{"version":"-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}","affectsGlobalScope":true},"3017320451-export { default as bar } from './bar';\n\nimport { default as bar } from './bar';\nbar(\"hello\");","-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);"],"options":{"declaration":true,"outDir":"./","target":1},"fileIdsList":[[3,5],[2]],"referencedMap":[[6,1],[5,2]],"exportedModulesMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,6,[5,[{"file":"../lazyindex.ts","start":85,"length":7,"messageText":"Expected 0 arguments, but got 1.","category":1,"code":2554}]]],"affectedFilesPendingEmit":[[2,1],[6,0],[5,0]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyindex.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"747071916-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(): void {\r\n});","signature":"-9232740537-declare const _default: () => void;\r\nexport default _default;\r\n"},{"version":"-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n","signature":"-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n"},{"version":"-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}","affectsGlobalScope":true},"3017320451-export { default as bar } from './bar';\n\nimport { default as bar } from './bar';\nbar(\"hello\");","-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);"],"options":{"declaration":true,"outDir":"./","target":1},"fileIdsList":[[3,5],[2]],"referencedMap":[[6,1],[5,2]],"exportedModulesMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,6,[5,[{"file":"../lazyindex.ts","start":85,"length":7,"messageText":"Expected 0 arguments, but got 1.","category":1,"code":2554}]]],"affectedFilesPendingEmit":[[2,1],[6,0],[5,0]]},"version":"FakeTSVersion"} //// [/src/obj/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -314,7 +314,7 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped }, "../bundling.ts": { "version": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n", - "signature": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n" + "signature": "-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n" }, "../global.d.ts": { "version": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", @@ -389,7 +389,7 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped ] }, "version": "FakeTSVersion", - "size": 2260 + "size": 2627 } @@ -428,7 +428,7 @@ exitCode:: ExitStatus.Success //// [/src/obj/index.d.ts] file written with same contents //// [/src/obj/lazyIndex.d.ts] file written with same contents //// [/src/obj/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyindex.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"5936740878-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(param: string): void {\r\n});","signature":"11191036521-declare const _default: (param: string) => void;\r\nexport default _default;\r\n"},"-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n",{"version":"-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}","affectsGlobalScope":true},"3017320451-export { default as bar } from './bar';\n\nimport { default as bar } from './bar';\nbar(\"hello\");","-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);"],"options":{"declaration":true,"outDir":"./","target":1},"fileIdsList":[[3,5],[2]],"referencedMap":[[6,1],[5,2]],"exportedModulesMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,6,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyindex.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"5936740878-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(param: string): void {\r\n});","signature":"11191036521-declare const _default: (param: string) => void;\r\nexport default _default;\r\n"},{"version":"-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n","signature":"-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n"},{"version":"-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}","affectsGlobalScope":true},{"version":"3017320451-export { default as bar } from './bar';\n\nimport { default as bar } from './bar';\nbar(\"hello\");","signature":"-6224542381-export { default as bar } from './bar';\r\n"},{"version":"-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"18468008756-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\r\n"}],"options":{"declaration":true,"outDir":"./","target":1},"fileIdsList":[[3,5],[2]],"referencedMap":[[6,1],[5,2]],"exportedModulesMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,6,5]},"version":"FakeTSVersion"} //// [/src/obj/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -462,7 +462,7 @@ exitCode:: ExitStatus.Success }, "../bundling.ts": { "version": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n", - "signature": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n" + "signature": "-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n" }, "../global.d.ts": { "version": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", @@ -471,11 +471,11 @@ exitCode:: ExitStatus.Success }, "../lazyindex.ts": { "version": "3017320451-export { default as bar } from './bar';\n\nimport { default as bar } from './bar';\nbar(\"hello\");", - "signature": "3017320451-export { default as bar } from './bar';\n\nimport { default as bar } from './bar';\nbar(\"hello\");" + "signature": "-6224542381-export { default as bar } from './bar';\r\n" }, "../index.ts": { "version": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", - "signature": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);" + "signature": "18468008756-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<(param: string) => void, typeof import(\"./lazyIndex\")>;\r\n" } }, "options": { @@ -511,7 +511,7 @@ exitCode:: ExitStatus.Success ] }, "version": "FakeTSVersion", - "size": 2113 + "size": 2747 } @@ -552,7 +552,7 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped //// [/src/obj/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyindex.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"747071916-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(): void {\r\n});","signature":"-9232740537-declare const _default: () => void;\r\nexport default _default;\r\n"},"-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n",{"version":"-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}","affectsGlobalScope":true},"3017320451-export { default as bar } from './bar';\n\nimport { default as bar } from './bar';\nbar(\"hello\");","-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);"],"options":{"declaration":true,"outDir":"./","target":1},"fileIdsList":[[3,5],[2]],"referencedMap":[[6,1],[5,2]],"exportedModulesMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,6,[5,[{"file":"../lazyindex.ts","start":85,"length":7,"messageText":"Expected 0 arguments, but got 1.","category":1,"code":2554}]]],"affectedFilesPendingEmit":[[2,1],[6,0],[5,0]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyindex.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"747071916-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(): void {\r\n});","signature":"-9232740537-declare const _default: () => void;\r\nexport default _default;\r\n"},{"version":"-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n","signature":"-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n"},{"version":"-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}","affectsGlobalScope":true},"3017320451-export { default as bar } from './bar';\n\nimport { default as bar } from './bar';\nbar(\"hello\");","-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);"],"options":{"declaration":true,"outDir":"./","target":1},"fileIdsList":[[3,5],[2]],"referencedMap":[[6,1],[5,2]],"exportedModulesMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,6,[5,[{"file":"../lazyindex.ts","start":85,"length":7,"messageText":"Expected 0 arguments, but got 1.","category":1,"code":2554}]]],"affectedFilesPendingEmit":[[2,1],[6,0],[5,0]]},"version":"FakeTSVersion"} //// [/src/obj/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -586,7 +586,7 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped }, "../bundling.ts": { "version": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n", - "signature": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n" + "signature": "-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n" }, "../global.d.ts": { "version": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", @@ -661,7 +661,7 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped ] }, "version": "FakeTSVersion", - "size": 2260 + "size": 2627 } @@ -719,7 +719,7 @@ var bar_2 = require("./bar"); //// [/src/obj/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyindex.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"747071916-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(): void {\r\n});","signature":"-9232740537-declare const _default: () => void;\r\nexport default _default;\r\n"},"-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n",{"version":"-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}","affectsGlobalScope":true},{"version":"-3721262293-export { default as bar } from './bar';\n\nimport { default as bar } from './bar';\nbar();","signature":"-6224542381-export { default as bar } from './bar';\r\n"},"-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);"],"options":{"declaration":true,"outDir":"./","target":1},"fileIdsList":[[3,5],[2]],"referencedMap":[[6,1],[5,2]],"exportedModulesMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,6,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../bar.ts","../bundling.ts","../global.d.ts","../lazyindex.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"747071916-interface RawAction {\r\n (...args: any[]): Promise | void;\r\n}\r\ninterface ActionFactory {\r\n (target: T): T;\r\n}\r\ndeclare function foo(): ActionFactory;\r\nexport default foo()(function foobar(): void {\r\n});","signature":"-9232740537-declare const _default: () => void;\r\nexport default _default;\r\n"},{"version":"-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n","signature":"-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n"},{"version":"-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}","affectsGlobalScope":true},{"version":"-3721262293-export { default as bar } from './bar';\n\nimport { default as bar } from './bar';\nbar();","signature":"-6224542381-export { default as bar } from './bar';\r\n"},{"version":"-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);","signature":"6256067474-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\r\n"}],"options":{"declaration":true,"outDir":"./","target":1},"fileIdsList":[[3,5],[2]],"referencedMap":[[6,1],[5,2]],"exportedModulesMap":[[6,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,6,5]},"version":"FakeTSVersion"} //// [/src/obj/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -753,7 +753,7 @@ var bar_2 = require("./bar"); }, "../bundling.ts": { "version": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n", - "signature": "-21659820217-export class LazyModule {\r\n constructor(private importCallback: () => Promise) {}\r\n}\r\n\r\nexport class LazyAction<\r\n TAction extends (...args: any[]) => any,\r\n TModule\r\n> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction) {\r\n }\r\n}\r\n" + "signature": "-40032907372-export declare class LazyModule {\r\n private importCallback;\r\n constructor(importCallback: () => Promise);\r\n}\r\nexport declare class LazyAction any, TModule> {\r\n constructor(_lazyModule: LazyModule, _getter: (module: TModule) => TAction);\r\n}\r\n" }, "../global.d.ts": { "version": "-9780226215-interface PromiseConstructor {\r\n new (): Promise;\r\n}\r\ndeclare var Promise: PromiseConstructor;\r\ninterface Promise {\r\n}", @@ -766,7 +766,7 @@ var bar_2 = require("./bar"); }, "../index.ts": { "version": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);", - "signature": "-11602502901-import { LazyAction, LazyModule } from './bundling';\r\nconst lazyModule = new LazyModule(() =>\r\n import('./lazyIndex')\r\n);\r\nexport const lazyBar = new LazyAction(lazyModule, m => m.bar);" + "signature": "6256067474-import { LazyAction } from './bundling';\r\nexport declare const lazyBar: LazyAction<() => void, typeof import(\"./lazyIndex\")>;\r\n" } }, "options": { @@ -802,6 +802,6 @@ var bar_2 = require("./bar"); ] }, "version": "FakeTSVersion", - "size": 2160 + "size": 2698 } diff --git a/tests/baselines/reference/tsbuild/javascriptProjectEmit/loads-js-based-projects-and-emits-them-correctly.js b/tests/baselines/reference/tsbuild/javascriptProjectEmit/loads-js-based-projects-and-emits-them-correctly.js index c91586ee3dd..e2b0c11bbcc 100644 --- a/tests/baselines/reference/tsbuild/javascriptProjectEmit/loads-js-based-projects-and-emits-them-correctly.js +++ b/tests/baselines/reference/tsbuild/javascriptProjectEmit/loads-js-based-projects-and-emits-them-correctly.js @@ -133,7 +133,7 @@ module.exports = {}; //// [/lib/common/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../lib.d.ts","../../src/common/nominal.js"],"fileInfos":[{"version":"-32082413277-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n","affectsGlobalScope":true},"-9003723607-/**\n * @template T, Name\n * @typedef {T & {[Symbol.species]: Name}} Nominal\n */\nmodule.exports = {};\n"],"options":{"composite":true,"declaration":true,"outDir":"..","rootDir":"../../src","skipLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../lib.d.ts","../../src/common/nominal.js"],"fileInfos":[{"version":"-32082413277-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n","affectsGlobalScope":true},{"version":"-9003723607-/**\n * @template T, Name\n * @typedef {T & {[Symbol.species]: Name}} Nominal\n */\nmodule.exports = {};\n","signature":"-15964609857-export type Nominal = T & {\r\n [Symbol.species]: Name;\r\n};\r\n"}],"options":{"composite":true,"declaration":true,"outDir":"..","rootDir":"../../src","skipLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} //// [/lib/common/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -150,7 +150,7 @@ module.exports = {}; }, "../../src/common/nominal.js": { "version": "-9003723607-/**\n * @template T, Name\n * @typedef {T & {[Symbol.species]: Name}} Nominal\n */\nmodule.exports = {};\n", - "signature": "-9003723607-/**\n * @template T, Name\n * @typedef {T & {[Symbol.species]: Name}} Nominal\n */\nmodule.exports = {};\n" + "signature": "-15964609857-export type Nominal = T & {\r\n [Symbol.species]: Name;\r\n};\r\n" } }, "options": { @@ -168,7 +168,7 @@ module.exports = {}; ] }, "version": "FakeTSVersion", - "size": 1104 + "size": 1221 } //// [/lib/sub-project/index.d.ts] @@ -185,7 +185,7 @@ exports.__esModule = true; //// [/lib/sub-project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../lib.d.ts","../common/nominal.d.ts","../../src/sub-project/index.js"],"fileInfos":[{"version":"-32082413277-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n","affectsGlobalScope":true},"-15964609857-export type Nominal = T & {\r\n [Symbol.species]: Name;\r\n};\r\n","-23375763082-import { Nominal } from '../common/nominal';\n\n/**\n * @typedef {Nominal} MyNominal\n */\n"],"options":{"composite":true,"declaration":true,"outDir":"..","rootDir":"../../src","skipLibCheck":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[2,1,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../lib.d.ts","../common/nominal.d.ts","../../src/sub-project/index.js"],"fileInfos":[{"version":"-32082413277-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n","affectsGlobalScope":true},"-15964609857-export type Nominal = T & {\r\n [Symbol.species]: Name;\r\n};\r\n",{"version":"-23375763082-import { Nominal } from '../common/nominal';\n\n/**\n * @typedef {Nominal} MyNominal\n */\n","signature":"-1163946571-export type MyNominal = Nominal;\r\nimport { Nominal } from \"../common/nominal\";\r\n"}],"options":{"composite":true,"declaration":true,"outDir":"..","rootDir":"../../src","skipLibCheck":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[2,1,3]},"version":"FakeTSVersion"} //// [/lib/sub-project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -212,7 +212,7 @@ exports.__esModule = true; }, "../../src/sub-project/index.js": { "version": "-23375763082-import { Nominal } from '../common/nominal';\n\n/**\n * @typedef {Nominal} MyNominal\n */\n", - "signature": "-23375763082-import { Nominal } from '../common/nominal';\n\n/**\n * @typedef {Nominal} MyNominal\n */\n" + "signature": "-1163946571-export type MyNominal = Nominal;\r\nimport { Nominal } from \"../common/nominal\";\r\n" } }, "options": { @@ -227,11 +227,7 @@ exports.__esModule = true; "../common/nominal.d.ts" ] }, - "exportedModulesMap": { - "../../src/sub-project/index.js": [ - "../common/nominal.d.ts" - ] - }, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../common/nominal.d.ts", "../lib.d.ts", @@ -239,7 +235,7 @@ exports.__esModule = true; ] }, "version": "FakeTSVersion", - "size": 1264 + "size": 1405 } //// [/lib/sub-project-2/index.d.ts] @@ -271,7 +267,7 @@ exports.getVar = getVar; //// [/lib/sub-project-2/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../lib.d.ts","../common/nominal.d.ts","../sub-project/index.d.ts","../../src/sub-project-2/index.js"],"fileInfos":[{"version":"-32082413277-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n","affectsGlobalScope":true},"-15964609857-export type Nominal = T & {\r\n [Symbol.species]: Name;\r\n};\r\n","-1163946571-export type MyNominal = Nominal;\r\nimport { Nominal } from \"../common/nominal\";\r\n","9520601400-import { MyNominal } from '../sub-project/index';\n\nconst variable = {\n key: /** @type {MyNominal} */('value'),\n};\n\n/**\n * @return {keyof typeof variable}\n */\nexport function getVar() {\n return 'key';\n}\n"],"options":{"composite":true,"declaration":true,"outDir":"..","rootDir":"../../src","skipLibCheck":true},"fileIdsList":[[2],[3]],"referencedMap":[[3,1],[4,2]],"exportedModulesMap":[[3,1],[4,2]],"semanticDiagnosticsPerFile":[2,1,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../lib.d.ts","../common/nominal.d.ts","../sub-project/index.d.ts","../../src/sub-project-2/index.js"],"fileInfos":[{"version":"-32082413277-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n","affectsGlobalScope":true},"-15964609857-export type Nominal = T & {\r\n [Symbol.species]: Name;\r\n};\r\n","-1163946571-export type MyNominal = Nominal;\r\nimport { Nominal } from \"../common/nominal\";\r\n",{"version":"9520601400-import { MyNominal } from '../sub-project/index';\n\nconst variable = {\n key: /** @type {MyNominal} */('value'),\n};\n\n/**\n * @return {keyof typeof variable}\n */\nexport function getVar() {\n return 'key';\n}\n","signature":"-8647857726-/**\r\n * @return {keyof typeof variable}\r\n */\r\nexport function getVar(): keyof typeof variable;\r\ndeclare namespace variable {\r\n const key: MyNominal;\r\n}\r\nimport { MyNominal } from \"../sub-project/index\";\r\nexport {};\r\n"}],"options":{"composite":true,"declaration":true,"outDir":"..","rootDir":"../../src","skipLibCheck":true},"fileIdsList":[[2],[3]],"referencedMap":[[3,1],[4,2]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[2,1,3,4]},"version":"FakeTSVersion"} //// [/lib/sub-project-2/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -306,7 +302,7 @@ exports.getVar = getVar; }, "../../src/sub-project-2/index.js": { "version": "9520601400-import { MyNominal } from '../sub-project/index';\n\nconst variable = {\n key: /** @type {MyNominal} */('value'),\n};\n\n/**\n * @return {keyof typeof variable}\n */\nexport function getVar() {\n return 'key';\n}\n", - "signature": "9520601400-import { MyNominal } from '../sub-project/index';\n\nconst variable = {\n key: /** @type {MyNominal} */('value'),\n};\n\n/**\n * @return {keyof typeof variable}\n */\nexport function getVar() {\n return 'key';\n}\n" + "signature": "-8647857726-/**\r\n * @return {keyof typeof variable}\r\n */\r\nexport function getVar(): keyof typeof variable;\r\ndeclare namespace variable {\r\n const key: MyNominal;\r\n}\r\nimport { MyNominal } from \"../sub-project/index\";\r\nexport {};\r\n" } }, "options": { @@ -327,9 +323,6 @@ exports.getVar = getVar; "exportedModulesMap": { "../sub-project/index.d.ts": [ "../common/nominal.d.ts" - ], - "../../src/sub-project-2/index.js": [ - "../sub-project/index.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -340,6 +333,6 @@ exports.getVar = getVar; ] }, "version": "FakeTSVersion", - "size": 1540 + "size": 1812 } diff --git a/tests/baselines/reference/tsbuild/javascriptProjectEmit/loads-js-based-projects-with-non-moved-json-files-and-emits-them-correctly.js b/tests/baselines/reference/tsbuild/javascriptProjectEmit/loads-js-based-projects-with-non-moved-json-files-and-emits-them-correctly.js index 3c400b67add..565c3f004e7 100644 --- a/tests/baselines/reference/tsbuild/javascriptProjectEmit/loads-js-based-projects-with-non-moved-json-files-and-emits-them-correctly.js +++ b/tests/baselines/reference/tsbuild/javascriptProjectEmit/loads-js-based-projects-with-non-moved-json-files-and-emits-them-correctly.js @@ -136,7 +136,7 @@ exports.m = common_1["default"]; //// [/out/sub-project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../../src/common/obj.json","../../src/common/index.d.ts","../../src/sub-project/index.js"],"fileInfos":[{"version":"-32082413277-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n","affectsGlobalScope":true},"2151907832-{\n \"val\": 42\n}","-4085459678-import x = require(\"./obj.json\");\r\nexport = x;\r\n","-14684157955-import mod from '../common';\n\nexport const m = mod;\n"],"options":{"composite":true,"declaration":true,"esModuleInterop":true,"outDir":"..","rootDir":"../../src","skipLibCheck":true},"fileIdsList":[[2],[3]],"referencedMap":[[3,1],[4,2]],"exportedModulesMap":[[3,1],[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../../src/common/obj.json","../../src/common/index.d.ts","../../src/sub-project/index.js"],"fileInfos":[{"version":"-32082413277-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n","affectsGlobalScope":true},"2151907832-{\n \"val\": 42\n}","-4085459678-import x = require(\"./obj.json\");\r\nexport = x;\r\n",{"version":"-14684157955-import mod from '../common';\n\nexport const m = mod;\n","signature":"-15768184370-export const m: {\r\n val: number;\r\n};\r\n"}],"options":{"composite":true,"declaration":true,"esModuleInterop":true,"outDir":"..","rootDir":"../../src","skipLibCheck":true},"fileIdsList":[[2],[3]],"referencedMap":[[3,1],[4,2]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/out/sub-project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -171,7 +171,7 @@ exports.m = common_1["default"]; }, "../../src/sub-project/index.js": { "version": "-14684157955-import mod from '../common';\n\nexport const m = mod;\n", - "signature": "-14684157955-import mod from '../common';\n\nexport const m = mod;\n" + "signature": "-15768184370-export const m: {\r\n val: number;\r\n};\r\n" } }, "options": { @@ -193,9 +193,6 @@ exports.m = common_1["default"]; "exportedModulesMap": { "../../src/common/index.d.ts": [ "../../src/common/obj.json" - ], - "../../src/sub-project/index.js": [ - "../../src/common/index.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -206,7 +203,7 @@ exports.m = common_1["default"]; ] }, "version": "FakeTSVersion", - "size": 1299 + "size": 1380 } //// [/out/sub-project-2/index.d.ts] @@ -232,7 +229,7 @@ exports.getVar = getVar; //// [/out/sub-project-2/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../sub-project/index.d.ts","../../src/sub-project-2/index.js"],"fileInfos":[{"version":"-32082413277-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n","affectsGlobalScope":true},"-15768184370-export const m: {\r\n val: number;\r\n};\r\n","13545386800-import { m } from '../sub-project/index';\n\nconst variable = {\n key: m,\n};\n\nexport function getVar() {\n return variable;\n}\n"],"options":{"composite":true,"declaration":true,"esModuleInterop":true,"outDir":"..","rootDir":"../../src","skipLibCheck":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../sub-project/index.d.ts","../../src/sub-project-2/index.js"],"fileInfos":[{"version":"-32082413277-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n","affectsGlobalScope":true},"-15768184370-export const m: {\r\n val: number;\r\n};\r\n",{"version":"13545386800-import { m } from '../sub-project/index';\n\nconst variable = {\n key: m,\n};\n\nexport function getVar() {\n return variable;\n}\n","signature":"-2686589794-export function getVar(): {\r\n key: {\r\n val: number;\r\n };\r\n};\r\n"}],"options":{"composite":true,"declaration":true,"esModuleInterop":true,"outDir":"..","rootDir":"../../src","skipLibCheck":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/out/sub-project-2/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -259,7 +256,7 @@ exports.getVar = getVar; }, "../../src/sub-project-2/index.js": { "version": "13545386800-import { m } from '../sub-project/index';\n\nconst variable = {\n key: m,\n};\n\nexport function getVar() {\n return variable;\n}\n", - "signature": "13545386800-import { m } from '../sub-project/index';\n\nconst variable = {\n key: m,\n};\n\nexport function getVar() {\n return variable;\n}\n" + "signature": "-2686589794-export function getVar(): {\r\n key: {\r\n val: number;\r\n };\r\n};\r\n" } }, "options": { @@ -275,11 +272,7 @@ exports.getVar = getVar; "../sub-project/index.d.ts" ] }, - "exportedModulesMap": { - "../../src/sub-project-2/index.js": [ - "../sub-project/index.d.ts" - ] - }, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../../lib/lib.d.ts", "../sub-project/index.d.ts", @@ -287,7 +280,7 @@ exports.getVar = getVar; ] }, "version": "FakeTSVersion", - "size": 1293 + "size": 1412 } //// [/src/common/index.d.ts] @@ -302,7 +295,7 @@ module.exports = x; //// [/src/common/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./obj.json","./index.ts"],"fileInfos":[{"version":"-32082413277-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n","affectsGlobalScope":true},"2151907832-{\n \"val\": 42\n}","-5032674136-import x = require(\"./obj.json\");\nexport = x;\n"],"options":{"composite":true,"declaration":true,"esModuleInterop":true,"outDir":"../..","rootDir":"..","skipLibCheck":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./obj.json","./index.ts"],"fileInfos":[{"version":"-32082413277-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n","affectsGlobalScope":true},"2151907832-{\n \"val\": 42\n}",{"version":"-5032674136-import x = require(\"./obj.json\");\nexport = x;\n","signature":"-4085459678-import x = require(\"./obj.json\");\r\nexport = x;\r\n"}],"options":{"composite":true,"declaration":true,"esModuleInterop":true,"outDir":"../..","rootDir":"..","skipLibCheck":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} //// [/src/common/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -329,7 +322,7 @@ module.exports = x; }, "./index.ts": { "version": "-5032674136-import x = require(\"./obj.json\");\nexport = x;\n", - "signature": "-5032674136-import x = require(\"./obj.json\");\nexport = x;\n" + "signature": "-4085459678-import x = require(\"./obj.json\");\r\nexport = x;\r\n" } }, "options": { @@ -357,6 +350,6 @@ module.exports = x; ] }, "version": "FakeTSVersion", - "size": 1137 + "size": 1230 } diff --git a/tests/baselines/reference/tsbuild/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-preserveSymlinks.js b/tests/baselines/reference/tsbuild/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-preserveSymlinks.js index 0ee13b9f545..c55b036326f 100644 --- a/tests/baselines/reference/tsbuild/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-preserveSymlinks.js +++ b/tests/baselines/reference/tsbuild/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-preserveSymlinks.js @@ -103,8 +103,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/packages/pkg2/const.ts (used version) -/user/username/projects/myproject/packages/pkg2/index.ts (used version) +/user/username/projects/myproject/packages/pkg2/const.ts (computed .d.ts during emit) +/user/username/projects/myproject/packages/pkg2/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/myproject/packages/pkg1/index.ts"] Program options: {"outDir":"/user/username/projects/myproject/packages/pkg1/build","preserveSymlinks":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/packages/pkg1/tsconfig.json"} @@ -154,7 +154,7 @@ export type { TheNum } from 'const'; //// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../../a/lib/lib.d.ts","../const.ts","../index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-11202312776-export type TheNum = 42;","-10837689162-export type { TheNum } from 'const';"],"options":{"composite":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../../a/lib/lib.d.ts","../const.ts","../index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-11202312776-export type TheNum = 42;","signature":"-9649133742-export declare type TheNum = 42;\n"},{"version":"-10837689162-export type { TheNum } from 'const';","signature":"-9751391360-export type { TheNum } from 'const';\n"}],"options":{"composite":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -177,11 +177,11 @@ export type { TheNum } from 'const'; }, "../const.ts": { "version": "-11202312776-export type TheNum = 42;", - "signature": "-11202312776-export type TheNum = 42;" + "signature": "-9649133742-export declare type TheNum = 42;\n" }, "../index.ts": { "version": "-10837689162-export type { TheNum } from 'const';", - "signature": "-10837689162-export type { TheNum } from 'const';" + "signature": "-9751391360-export type { TheNum } from 'const';\n" } }, "options": { @@ -205,7 +205,7 @@ export type { TheNum } from 'const'; ] }, "version": "FakeTSVersion", - "size": 777 + "size": 927 } //// [/user/username/projects/myproject/packages/pkg1/build/index.js] diff --git a/tests/baselines/reference/tsbuild/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly.js b/tests/baselines/reference/tsbuild/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly.js index 6f698d19a52..2f25668c14d 100644 --- a/tests/baselines/reference/tsbuild/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly.js +++ b/tests/baselines/reference/tsbuild/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly.js @@ -104,8 +104,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/packages/pkg2/const.ts (used version) -/user/username/projects/myproject/packages/pkg2/index.ts (used version) +/user/username/projects/myproject/packages/pkg2/const.ts (computed .d.ts during emit) +/user/username/projects/myproject/packages/pkg2/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/myproject/packages/pkg1/index.ts"] Program options: {"outDir":"/user/username/projects/myproject/packages/pkg1/build","traceResolution":true,"configFilePath":"/user/username/projects/myproject/packages/pkg1/tsconfig.json"} @@ -155,7 +155,7 @@ export type { TheNum } from 'const'; //// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../../a/lib/lib.d.ts","../const.ts","../index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-11202312776-export type TheNum = 42;","-10837689162-export type { TheNum } from 'const';"],"options":{"composite":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../../a/lib/lib.d.ts","../const.ts","../index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-11202312776-export type TheNum = 42;","signature":"-9649133742-export declare type TheNum = 42;\n"},{"version":"-10837689162-export type { TheNum } from 'const';","signature":"-9751391360-export type { TheNum } from 'const';\n"}],"options":{"composite":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -178,11 +178,11 @@ export type { TheNum } from 'const'; }, "../const.ts": { "version": "-11202312776-export type TheNum = 42;", - "signature": "-11202312776-export type TheNum = 42;" + "signature": "-9649133742-export declare type TheNum = 42;\n" }, "../index.ts": { "version": "-10837689162-export type { TheNum } from 'const';", - "signature": "-10837689162-export type { TheNum } from 'const';" + "signature": "-9751391360-export type { TheNum } from 'const';\n" } }, "options": { @@ -206,7 +206,7 @@ export type { TheNum } from 'const'; ] }, "version": "FakeTSVersion", - "size": 777 + "size": 927 } //// [/user/username/projects/myproject/packages/pkg1/build/index.js] diff --git a/tests/baselines/reference/tsbuild/moduleResolution/type-reference-resolution-uses-correct-options-for-different-resolution-options-referenced-project.js b/tests/baselines/reference/tsbuild/moduleResolution/type-reference-resolution-uses-correct-options-for-different-resolution-options-referenced-project.js index d45fadacea0..4e211734c5b 100644 --- a/tests/baselines/reference/tsbuild/moduleResolution/type-reference-resolution-uses-correct-options-for-different-resolution-options-referenced-project.js +++ b/tests/baselines/reference/tsbuild/moduleResolution/type-reference-resolution-uses-correct-options-for-different-resolution-options-referenced-project.js @@ -64,7 +64,7 @@ exitCode:: ExitStatus.Success //// [/src/packages/pkg1.tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./pkg1_index.ts","./typeroot1/sometype/index.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9601687719-export const theNum: TheNum = \"type1\";",{"version":"-4557394441-declare type TheNum = \"type1\";","affectsGlobalScope":true}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./pkg1_index.ts","./typeroot1/sometype/index.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9601687719-export const theNum: TheNum = \"type1\";","signature":"-5685633868-/// \r\nexport declare const theNum: TheNum;\r\n"},{"version":"-4557394441-declare type TheNum = \"type1\";","affectsGlobalScope":true}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/src/packages/pkg1.tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -82,7 +82,7 @@ exitCode:: ExitStatus.Success }, "./pkg1_index.ts": { "version": "-9601687719-export const theNum: TheNum = \"type1\";", - "signature": "-9601687719-export const theNum: TheNum = \"type1\";" + "signature": "-5685633868-/// \r\nexport declare const theNum: TheNum;\r\n" }, "./typeroot1/sometype/index.d.ts": { "version": "-4557394441-declare type TheNum = \"type1\";", @@ -102,7 +102,7 @@ exitCode:: ExitStatus.Success ] }, "version": "FakeTSVersion", - "size": 868 + "size": 987 } //// [/src/packages/pkg1_index.d.ts] @@ -118,7 +118,7 @@ exports.theNum = "type1"; //// [/src/packages/pkg2.tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./pkg2_index.ts","./typeroot2/sometype/index.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-12823281204-export const theNum: TheNum2 = \"type2\";",{"version":"-980425686-declare type TheNum2 = \"type2\";","affectsGlobalScope":true}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./pkg2_index.ts","./typeroot2/sometype/index.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-12823281204-export const theNum: TheNum2 = \"type2\";","signature":"-7237564442-/// \r\nexport declare const theNum: TheNum2;\r\n"},{"version":"-980425686-declare type TheNum2 = \"type2\";","affectsGlobalScope":true}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/src/packages/pkg2.tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -136,7 +136,7 @@ exports.theNum = "type1"; }, "./pkg2_index.ts": { "version": "-12823281204-export const theNum: TheNum2 = \"type2\";", - "signature": "-12823281204-export const theNum: TheNum2 = \"type2\";" + "signature": "-7237564442-/// \r\nexport declare const theNum: TheNum2;\r\n" }, "./typeroot2/sometype/index.d.ts": { "version": "-980425686-declare type TheNum2 = \"type2\";", @@ -156,7 +156,7 @@ exports.theNum = "type1"; ] }, "version": "FakeTSVersion", - "size": 870 + "size": 990 } //// [/src/packages/pkg2_index.d.ts] diff --git a/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-across-projects-resolve-correctly.js b/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-across-projects-resolve-correctly.js index 11a82833822..19798e4182d 100644 --- a/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-across-projects-resolve-correctly.js +++ b/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-across-projects-resolve-correctly.js @@ -191,7 +191,7 @@ LassieDog.getDogConfig = () => LASSIE_CONFIG; //// [/src/src-dogs/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.es2020.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":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true,"impliedFormat":1},{"version":"-2632060142-export interface DogConfig {\r\n name: string;\r\n}\r\n","impliedFormat":99},{"version":"-5608794531-export * from './dogconfig.js';\r\n","impliedFormat":99},{"version":"1966273863-import { DogConfig } from 'src-types';\n\nexport const DOG_CONFIG: DogConfig = {\n name: 'Default dog',\n};\n","impliedFormat":99},{"version":"6091345804-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}\n","impliedFormat":99},{"version":"4440579024-import { DogConfig } from 'src-types';\n\nexport const LASSIE_CONFIG: DogConfig = { name: 'Lassie' };\n","impliedFormat":99},{"version":"-32303727812-import { Dog } from '../dog.js';\nimport { LASSIE_CONFIG } from './lassieconfig.js';\n\nexport class LassieDog extends Dog {\n protected static getDogConfig = () => LASSIE_CONFIG;\n}\n","impliedFormat":99},{"version":"-15974991320-export * from 'src-types';\nexport * from './lassie/lassiedog.js';\n","impliedFormat":99}],"options":{"composite":true,"declaration":true,"module":100},"fileIdsList":[[3,4],[3],[3,7],[5,6],[2]],"referencedMap":[[5,1],[4,2],[8,3],[6,2],[7,4],[3,5]],"exportedModulesMap":[[5,1],[4,2],[8,3],[6,2],[7,4],[3,5]],"semanticDiagnosticsPerFile":[1,5,4,8,6,7,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.es2020.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":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true,"impliedFormat":1},{"version":"-2632060142-export interface DogConfig {\r\n name: string;\r\n}\r\n","impliedFormat":99},{"version":"-5608794531-export * from './dogconfig.js';\r\n","impliedFormat":99},{"version":"1966273863-import { DogConfig } from 'src-types';\n\nexport const DOG_CONFIG: DogConfig = {\n name: 'Default dog',\n};\n","signature":"17588480778-import { DogConfig } from 'src-types';\r\nexport declare const DOG_CONFIG: DogConfig;\r\n","impliedFormat":99},{"version":"6091345804-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}\n","signature":"22128633249-import { DogConfig } from 'src-types';\r\nexport declare abstract class Dog {\r\n static getCapabilities(): DogConfig;\r\n}\r\n","impliedFormat":99},{"version":"4440579024-import { DogConfig } from 'src-types';\n\nexport const LASSIE_CONFIG: DogConfig = { name: 'Lassie' };\n","signature":"8131483665-import { DogConfig } from 'src-types';\r\nexport declare const LASSIE_CONFIG: DogConfig;\r\n","impliedFormat":99},{"version":"-32303727812-import { Dog } from '../dog.js';\nimport { LASSIE_CONFIG } from './lassieconfig.js';\n\nexport class LassieDog extends Dog {\n protected static getDogConfig = () => LASSIE_CONFIG;\n}\n","signature":"-20244062422-import { Dog } from '../dog.js';\r\nexport declare class LassieDog extends Dog {\r\n protected static getDogConfig: () => import(\"../index.js\").DogConfig;\r\n}\r\n","impliedFormat":99},{"version":"-15974991320-export * from 'src-types';\nexport * from './lassie/lassiedog.js';\n","signature":"-16783836862-export * from 'src-types';\r\nexport * from './lassie/lassiedog.js';\r\n","impliedFormat":99}],"options":{"composite":true,"declaration":true,"module":100},"fileIdsList":[[3,4],[3],[3,7],[5,6],[2],[5,8]],"referencedMap":[[5,1],[4,2],[8,3],[6,2],[7,4],[3,5]],"exportedModulesMap":[[5,2],[4,2],[8,3],[6,2],[7,6],[3,5]],"semanticDiagnosticsPerFile":[1,5,4,8,6,7,2,3]},"version":"FakeTSVersion"} //// [/src/src-dogs/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -224,6 +224,10 @@ LassieDog.getDogConfig = () => LASSIE_CONFIG; ], [ "../src-types/dogconfig.d.ts" + ], + [ + "./dog.ts", + "./index.ts" ] ], "fileInfos": { @@ -245,27 +249,27 @@ LassieDog.getDogConfig = () => LASSIE_CONFIG; }, "./dogconfig.ts": { "version": "1966273863-import { DogConfig } from 'src-types';\n\nexport const DOG_CONFIG: DogConfig = {\n name: 'Default dog',\n};\n", - "signature": "1966273863-import { DogConfig } from 'src-types';\n\nexport const DOG_CONFIG: DogConfig = {\n name: 'Default dog',\n};\n", + "signature": "17588480778-import { DogConfig } from 'src-types';\r\nexport declare const DOG_CONFIG: DogConfig;\r\n", "impliedFormat": 99 }, "./dog.ts": { "version": "6091345804-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}\n", - "signature": "6091345804-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}\n", + "signature": "22128633249-import { DogConfig } from 'src-types';\r\nexport declare abstract class Dog {\r\n static getCapabilities(): DogConfig;\r\n}\r\n", "impliedFormat": 99 }, "./lassie/lassieconfig.ts": { "version": "4440579024-import { DogConfig } from 'src-types';\n\nexport const LASSIE_CONFIG: DogConfig = { name: 'Lassie' };\n", - "signature": "4440579024-import { DogConfig } from 'src-types';\n\nexport const LASSIE_CONFIG: DogConfig = { name: 'Lassie' };\n", + "signature": "8131483665-import { DogConfig } from 'src-types';\r\nexport declare const LASSIE_CONFIG: DogConfig;\r\n", "impliedFormat": 99 }, "./lassie/lassiedog.ts": { "version": "-32303727812-import { Dog } from '../dog.js';\nimport { LASSIE_CONFIG } from './lassieconfig.js';\n\nexport class LassieDog extends Dog {\n protected static getDogConfig = () => LASSIE_CONFIG;\n}\n", - "signature": "-32303727812-import { Dog } from '../dog.js';\nimport { LASSIE_CONFIG } from './lassieconfig.js';\n\nexport class LassieDog extends Dog {\n protected static getDogConfig = () => LASSIE_CONFIG;\n}\n", + "signature": "-20244062422-import { Dog } from '../dog.js';\r\nexport declare class LassieDog extends Dog {\r\n protected static getDogConfig: () => import(\"../index.js\").DogConfig;\r\n}\r\n", "impliedFormat": 99 }, "./index.ts": { "version": "-15974991320-export * from 'src-types';\nexport * from './lassie/lassiedog.js';\n", - "signature": "-15974991320-export * from 'src-types';\nexport * from './lassie/lassiedog.js';\n", + "signature": "-16783836862-export * from 'src-types';\r\nexport * from './lassie/lassiedog.js';\r\n", "impliedFormat": 99 } }, @@ -299,8 +303,7 @@ LassieDog.getDogConfig = () => LASSIE_CONFIG; }, "exportedModulesMap": { "./dog.ts": [ - "../src-types/index.d.ts", - "./dogconfig.ts" + "../src-types/index.d.ts" ], "./dogconfig.ts": [ "../src-types/index.d.ts" @@ -314,7 +317,7 @@ LassieDog.getDogConfig = () => LASSIE_CONFIG; ], "./lassie/lassiedog.ts": [ "./dog.ts", - "./lassie/lassieconfig.ts" + "./index.ts" ], "../src-types/index.d.ts": [ "../src-types/dogconfig.d.ts" @@ -332,7 +335,7 @@ LassieDog.getDogConfig = () => LASSIE_CONFIG; ] }, "version": "FakeTSVersion", - "size": 2019 + "size": 2712 } //// [/src/src-types/dogconfig.d.ts] @@ -354,7 +357,7 @@ export * from './dogconfig.js'; //// [/src/src-types/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.es2020.full.d.ts","./dogconfig.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true,"impliedFormat":1},{"version":"-5575793279-export interface DogConfig {\n name: string;\n}","impliedFormat":99},{"version":"-6189272282-export * from './dogconfig.js';","impliedFormat":99}],"options":{"composite":true,"declaration":true,"module":100},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.es2020.full.d.ts","./dogconfig.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true,"impliedFormat":1},{"version":"-5575793279-export interface DogConfig {\n name: string;\n}","signature":"-2632060142-export interface DogConfig {\r\n name: string;\r\n}\r\n","impliedFormat":99},{"version":"-6189272282-export * from './dogconfig.js';","signature":"-5608794531-export * from './dogconfig.js';\r\n","impliedFormat":99}],"options":{"composite":true,"declaration":true,"module":100},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/src/src-types/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -378,12 +381,12 @@ export * from './dogconfig.js'; }, "./dogconfig.ts": { "version": "-5575793279-export interface DogConfig {\n name: string;\n}", - "signature": "-5575793279-export interface DogConfig {\n name: string;\n}", + "signature": "-2632060142-export interface DogConfig {\r\n name: string;\r\n}\r\n", "impliedFormat": 99 }, "./index.ts": { "version": "-6189272282-export * from './dogconfig.js';", - "signature": "-6189272282-export * from './dogconfig.js';", + "signature": "-5608794531-export * from './dogconfig.js';\r\n", "impliedFormat": 99 } }, @@ -409,6 +412,6 @@ export * from './dogconfig.js'; ] }, "version": "FakeTSVersion", - "size": 891 + "size": 1038 } diff --git a/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-resolve-correctly.js b/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-resolve-correctly.js index 268854ffbb4..3ab0c95eb85 100644 --- a/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-resolve-correctly.js +++ b/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-resolve-correctly.js @@ -150,7 +150,7 @@ exports.__esModule = true; //// [/src/lib/solution/common/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../lib/lib.d.ts","../../../solution/common/nominal.ts"],"fileInfos":[{"version":"-32082413277-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n","affectsGlobalScope":true},"-24498031910-export declare type Nominal = T & {\n [Symbol.species]: Name;\n};\n"],"options":{"composite":true,"outDir":"../..","rootDir":"../../..","skipLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../lib/lib.d.ts","../../../solution/common/nominal.ts"],"fileInfos":[{"version":"-32082413277-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n","affectsGlobalScope":true},{"version":"-24498031910-export declare type Nominal = T & {\n [Symbol.species]: Name;\n};\n","signature":"-9513375615-export declare type Nominal = T & {\r\n [Symbol.species]: Name;\r\n};\r\n"}],"options":{"composite":true,"outDir":"../..","rootDir":"../../..","skipLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} //// [/src/lib/solution/common/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -167,7 +167,7 @@ exports.__esModule = true; }, "../../../solution/common/nominal.ts": { "version": "-24498031910-export declare type Nominal = T & {\n [Symbol.species]: Name;\n};\n", - "signature": "-24498031910-export declare type Nominal = T & {\n [Symbol.species]: Name;\n};\n" + "signature": "-9513375615-export declare type Nominal = T & {\r\n [Symbol.species]: Name;\r\n};\r\n" } }, "options": { @@ -184,7 +184,7 @@ exports.__esModule = true; ] }, "version": "FakeTSVersion", - "size": 1097 + "size": 1236 } //// [/src/lib/solution/sub-project/index.d.ts] @@ -198,7 +198,7 @@ exports.__esModule = true; //// [/src/lib/solution/sub-project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../lib/lib.d.ts","../common/nominal.d.ts","../../../solution/sub-project/index.ts"],"fileInfos":[{"version":"-32082413277-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n","affectsGlobalScope":true},"-9513375615-export declare type Nominal = T & {\r\n [Symbol.species]: Name;\r\n};\r\n","-22894055505-import { Nominal } from '../common/nominal';\n\nexport type MyNominal = Nominal;\n"],"options":{"composite":true,"outDir":"../..","rootDir":"../../..","skipLibCheck":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../lib/lib.d.ts","../common/nominal.d.ts","../../../solution/sub-project/index.ts"],"fileInfos":[{"version":"-32082413277-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n","affectsGlobalScope":true},"-9513375615-export declare type Nominal = T & {\r\n [Symbol.species]: Name;\r\n};\r\n",{"version":"-22894055505-import { Nominal } from '../common/nominal';\n\nexport type MyNominal = Nominal;\n","signature":"-21416888433-import { Nominal } from '../common/nominal';\r\nexport declare type MyNominal = Nominal;\r\n"}],"options":{"composite":true,"outDir":"../..","rootDir":"../../..","skipLibCheck":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/src/lib/solution/sub-project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -225,7 +225,7 @@ exports.__esModule = true; }, "../../../solution/sub-project/index.ts": { "version": "-22894055505-import { Nominal } from '../common/nominal';\n\nexport type MyNominal = Nominal;\n", - "signature": "-22894055505-import { Nominal } from '../common/nominal';\n\nexport type MyNominal = Nominal;\n" + "signature": "-21416888433-import { Nominal } from '../common/nominal';\r\nexport declare type MyNominal = Nominal;\r\n" } }, "options": { @@ -251,7 +251,7 @@ exports.__esModule = true; ] }, "version": "FakeTSVersion", - "size": 1281 + "size": 1434 } //// [/src/lib/solution/sub-project-2/index.d.ts] @@ -277,7 +277,7 @@ exports.getVar = getVar; //// [/src/lib/solution/sub-project-2/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../lib/lib.d.ts","../common/nominal.d.ts","../sub-project/index.d.ts","../../../solution/sub-project-2/index.ts"],"fileInfos":[{"version":"-32082413277-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n","affectsGlobalScope":true},"-9513375615-export declare type Nominal = T & {\r\n [Symbol.species]: Name;\r\n};\r\n","-21416888433-import { Nominal } from '../common/nominal';\r\nexport declare type MyNominal = Nominal;\r\n","-13939373533-import { MyNominal } from '../sub-project/index';\n\nconst variable = {\n key: 'value' as MyNominal,\n};\n\nexport function getVar(): keyof typeof variable {\n return 'key';\n}\n"],"options":{"composite":true,"outDir":"../..","rootDir":"../../..","skipLibCheck":true},"fileIdsList":[[2],[3]],"referencedMap":[[3,1],[4,2]],"exportedModulesMap":[[3,1],[4,2]],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../lib/lib.d.ts","../common/nominal.d.ts","../sub-project/index.d.ts","../../../solution/sub-project-2/index.ts"],"fileInfos":[{"version":"-32082413277-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };\ninterface SymbolConstructor {\n readonly species: symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\n","affectsGlobalScope":true},"-9513375615-export declare type Nominal = T & {\r\n [Symbol.species]: Name;\r\n};\r\n","-21416888433-import { Nominal } from '../common/nominal';\r\nexport declare type MyNominal = Nominal;\r\n",{"version":"-13939373533-import { MyNominal } from '../sub-project/index';\n\nconst variable = {\n key: 'value' as MyNominal,\n};\n\nexport function getVar(): keyof typeof variable {\n return 'key';\n}\n","signature":"881159974-import { MyNominal } from '../sub-project/index';\r\ndeclare const variable: {\r\n key: MyNominal;\r\n};\r\nexport declare function getVar(): keyof typeof variable;\r\nexport {};\r\n"}],"options":{"composite":true,"outDir":"../..","rootDir":"../../..","skipLibCheck":true},"fileIdsList":[[2],[3]],"referencedMap":[[3,1],[4,2]],"exportedModulesMap":[[3,1],[4,2]],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/lib/solution/sub-project-2/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -312,7 +312,7 @@ exports.getVar = getVar; }, "../../../solution/sub-project-2/index.ts": { "version": "-13939373533-import { MyNominal } from '../sub-project/index';\n\nconst variable = {\n key: 'value' as MyNominal,\n};\n\nexport function getVar(): keyof typeof variable {\n return 'key';\n}\n", - "signature": "-13939373533-import { MyNominal } from '../sub-project/index';\n\nconst variable = {\n key: 'value' as MyNominal,\n};\n\nexport function getVar(): keyof typeof variable {\n return 'key';\n}\n" + "signature": "881159974-import { MyNominal } from '../sub-project/index';\r\ndeclare const variable: {\r\n key: MyNominal;\r\n};\r\nexport declare function getVar(): keyof typeof variable;\r\nexport {};\r\n" } }, "options": { @@ -345,6 +345,6 @@ exports.getVar = getVar; ] }, "version": "FakeTSVersion", - "size": 1539 + "size": 1761 } diff --git a/tests/baselines/reference/tsbuild/outFile/non-module-projects-without-prepend.js b/tests/baselines/reference/tsbuild/outFile/non-module-projects-without-prepend.js index e4f98012bfa..e69fd17a377 100644 --- a/tests/baselines/reference/tsbuild/outFile/non-module-projects-without-prepend.js +++ b/tests/baselines/reference/tsbuild/outFile/non-module-projects-without-prepend.js @@ -202,7 +202,7 @@ function f() { {"version":3,"file":"first_part3.js","sourceRoot":"","sources":["first_part3.ts"],"names":[],"mappings":"AAAA,SAAS,CAAC;IACN,OAAO,gBAAgB,CAAC;AAC5B,CAAC"} //// [/src/first/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./first_part1.ts","./first_part2.ts","./first_part3.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-17207381411-interface TheFirst {\r\n none: any;\r\n}\r\n\r\nconst s = \"Hello, world\";\r\n\r\ninterface NoJsForHereEither {\r\n none: any;\r\n}\r\n\r\nconsole.log(s);\r\n","affectsGlobalScope":true},{"version":"4973778178-console.log(f());\r\n","affectsGlobalScope":true},{"version":"6202806249-function f() {\r\n return \"JS does hoists\";\r\n}","affectsGlobalScope":true}],"options":{"composite":true,"declarationMap":true,"module":0,"removeComments":true,"skipDefaultLibCheck":true,"sourceMap":true,"strict":false,"target":1},"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./first_part1.ts","./first_part2.ts","./first_part3.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-17207381411-interface TheFirst {\r\n none: any;\r\n}\r\n\r\nconst s = \"Hello, world\";\r\n\r\ninterface NoJsForHereEither {\r\n none: any;\r\n}\r\n\r\nconsole.log(s);\r\n","signature":"-12382020913-interface TheFirst {\r\n none: any;\r\n}\r\ndeclare const s = \"Hello, world\";\r\ninterface NoJsForHereEither {\r\n none: any;\r\n}\r\n","affectsGlobalScope":true},{"version":"4973778178-console.log(f());\r\n","signature":"5381-","affectsGlobalScope":true},{"version":"6202806249-function f() {\r\n return \"JS does hoists\";\r\n}","signature":"-5732730923-declare function f(): string;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declarationMap":true,"module":0,"removeComments":true,"skipDefaultLibCheck":true,"sourceMap":true,"strict":false,"target":1},"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/first/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -221,17 +221,17 @@ function f() { }, "./first_part1.ts": { "version": "-17207381411-interface TheFirst {\r\n none: any;\r\n}\r\n\r\nconst s = \"Hello, world\";\r\n\r\ninterface NoJsForHereEither {\r\n none: any;\r\n}\r\n\r\nconsole.log(s);\r\n", - "signature": "-17207381411-interface TheFirst {\r\n none: any;\r\n}\r\n\r\nconst s = \"Hello, world\";\r\n\r\ninterface NoJsForHereEither {\r\n none: any;\r\n}\r\n\r\nconsole.log(s);\r\n", + "signature": "-12382020913-interface TheFirst {\r\n none: any;\r\n}\r\ndeclare const s = \"Hello, world\";\r\ninterface NoJsForHereEither {\r\n none: any;\r\n}\r\n", "affectsGlobalScope": true }, "./first_part2.ts": { "version": "4973778178-console.log(f());\r\n", - "signature": "4973778178-console.log(f());\r\n", + "signature": "5381-", "affectsGlobalScope": true }, "./first_part3.ts": { "version": "6202806249-function f() {\r\n return \"JS does hoists\";\r\n}", - "signature": "6202806249-function f() {\r\n return \"JS does hoists\";\r\n}", + "signature": "-5732730923-declare function f(): string;\r\n", "affectsGlobalScope": true } }, @@ -253,7 +253,7 @@ function f() { ] }, "version": "FakeTSVersion", - "size": 1214 + "size": 1464 } //// [/src/second/second_part1.d.ts] @@ -303,7 +303,7 @@ var C = (function () { {"version":3,"file":"second_part2.js","sourceRoot":"","sources":["second_part2.ts"],"names":[],"mappings":"AAAA;IAAA;IAIA,CAAC;IAHG,uBAAW,GAAX;QACI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACtC,CAAC;IACL,QAAC;AAAD,CAAC,AAJD,IAIC"} //// [/src/second/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./second_part1.ts","./second_part2.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-21603042336-namespace N {\r\n // Comment text\r\n}\r\n\r\nnamespace N {\r\n function f() {\r\n console.log('testing');\r\n }\r\n\r\n f();\r\n}\r\n","affectsGlobalScope":true},{"version":"9339262372-class C {\r\n doSomething() {\r\n console.log(\"something got done\");\r\n }\r\n}\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"module":0,"removeComments":true,"skipDefaultLibCheck":true,"sourceMap":true,"strict":false,"target":1},"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./second_part1.ts","./second_part2.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-21603042336-namespace N {\r\n // Comment text\r\n}\r\n\r\nnamespace N {\r\n function f() {\r\n console.log('testing');\r\n }\r\n\r\n f();\r\n}\r\n","signature":"-4200194009-declare namespace N {\r\n}\r\ndeclare namespace N {\r\n}\r\n","affectsGlobalScope":true},{"version":"9339262372-class C {\r\n doSomething() {\r\n console.log(\"something got done\");\r\n }\r\n}\r\n","signature":"1950347108-declare class C {\r\n doSomething(): void;\r\n}\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"module":0,"removeComments":true,"skipDefaultLibCheck":true,"sourceMap":true,"strict":false,"target":1},"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/src/second/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -321,12 +321,12 @@ var C = (function () { }, "./second_part1.ts": { "version": "-21603042336-namespace N {\r\n // Comment text\r\n}\r\n\r\nnamespace N {\r\n function f() {\r\n console.log('testing');\r\n }\r\n\r\n f();\r\n}\r\n", - "signature": "-21603042336-namespace N {\r\n // Comment text\r\n}\r\n\r\nnamespace N {\r\n function f() {\r\n console.log('testing');\r\n }\r\n\r\n f();\r\n}\r\n", + "signature": "-4200194009-declare namespace N {\r\n}\r\ndeclare namespace N {\r\n}\r\n", "affectsGlobalScope": true }, "./second_part2.ts": { "version": "9339262372-class C {\r\n doSomething() {\r\n console.log(\"something got done\");\r\n }\r\n}\r\n", - "signature": "9339262372-class C {\r\n doSomething() {\r\n console.log(\"something got done\");\r\n }\r\n}\r\n", + "signature": "1950347108-declare class C {\r\n doSomething(): void;\r\n}\r\n", "affectsGlobalScope": true } }, @@ -348,7 +348,7 @@ var C = (function () { ] }, "version": "FakeTSVersion", - "size": 1174 + "size": 1341 } //// [/src/third/third_part1.d.ts] @@ -367,7 +367,7 @@ c.doSomething(); {"version":3,"file":"third_part1.js","sourceRoot":"","sources":["third_part1.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAChB,CAAC,CAAC,WAAW,EAAE,CAAC"} //// [/src/third/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../first/first_part1.d.ts","../first/first_part2.d.ts","../first/first_part3.d.ts","../second/second_part1.d.ts","../second/second_part2.d.ts","./third_part1.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-17939996161-interface TheFirst {\r\n none: any;\r\n}\r\ndeclare const s = \"Hello, world\";\r\ninterface NoJsForHereEither {\r\n none: any;\r\n}\r\n//# sourceMappingURL=first_PART1.d.ts.map","affectsGlobalScope":true},"-2054710634-//# sourceMappingURL=first_part2.d.ts.map",{"version":"-4577888121-declare function f(): string;\r\n//# sourceMappingURL=first_part3.d.ts.map","affectsGlobalScope":true},{"version":"-3134340341-declare namespace N {\r\n}\r\ndeclare namespace N {\r\n}\r\n//# sourceMappingURL=second_part1.d.ts.map","affectsGlobalScope":true},{"version":"6579734441-declare class C {\r\n doSomething(): void;\r\n}\r\n//# sourceMappingURL=second_part2.d.ts.map","affectsGlobalScope":true},{"version":"10470273651-var c = new C();\r\nc.doSomething();\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"module":0,"removeComments":true,"skipDefaultLibCheck":true,"sourceMap":true,"strict":false,"target":1},"semanticDiagnosticsPerFile":[1,2,3,4,5,6,7]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../first/first_part1.d.ts","../first/first_part2.d.ts","../first/first_part3.d.ts","../second/second_part1.d.ts","../second/second_part2.d.ts","./third_part1.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-17939996161-interface TheFirst {\r\n none: any;\r\n}\r\ndeclare const s = \"Hello, world\";\r\ninterface NoJsForHereEither {\r\n none: any;\r\n}\r\n//# sourceMappingURL=first_PART1.d.ts.map","affectsGlobalScope":true},"-2054710634-//# sourceMappingURL=first_part2.d.ts.map",{"version":"-4577888121-declare function f(): string;\r\n//# sourceMappingURL=first_part3.d.ts.map","affectsGlobalScope":true},{"version":"-3134340341-declare namespace N {\r\n}\r\ndeclare namespace N {\r\n}\r\n//# sourceMappingURL=second_part1.d.ts.map","affectsGlobalScope":true},{"version":"6579734441-declare class C {\r\n doSomething(): void;\r\n}\r\n//# sourceMappingURL=second_part2.d.ts.map","affectsGlobalScope":true},{"version":"10470273651-var c = new C();\r\nc.doSomething();\r\n","signature":"2394638288-declare var c: C;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"module":0,"removeComments":true,"skipDefaultLibCheck":true,"sourceMap":true,"strict":false,"target":1},"semanticDiagnosticsPerFile":[1,2,3,4,5,6,7]},"version":"FakeTSVersion"} //// [/src/third/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -413,7 +413,7 @@ c.doSomething(); }, "./third_part1.ts": { "version": "10470273651-var c = new C();\r\nc.doSomething();\r\n", - "signature": "10470273651-var c = new C();\r\nc.doSomething();\r\n", + "signature": "2394638288-declare var c: C;\r\n", "affectsGlobalScope": true } }, @@ -439,6 +439,6 @@ c.doSomething(); ] }, "version": "FakeTSVersion", - "size": 1764 + "size": 1811 } diff --git a/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-not-specified-and-is-composite.js b/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-not-specified-and-is-composite.js index 7be5dd8a11d..b0e6de5bb38 100644 --- a/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-not-specified-and-is-composite.js +++ b/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-not-specified-and-is-composite.js @@ -46,7 +46,7 @@ exports.x = 10; //// [/src/dist/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../src/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-10726455937-export const x = 10;"],"options":{"composite":true,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../src/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-10726455937-export const x = 10;","signature":"-6057683066-export declare const x = 10;\r\n"}],"options":{"composite":true,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} //// [/src/dist/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -63,7 +63,7 @@ exports.x = 10; }, "../src/index.ts": { "version": "-10726455937-export const x = 10;", - "signature": "-10726455937-export const x = 10;" + "signature": "-6057683066-export declare const x = 10;\r\n" } }, "options": { @@ -78,7 +78,7 @@ exports.x = 10; ] }, "version": "FakeTSVersion", - "size": 742 + "size": 813 } diff --git a/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js b/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js index 4042ac3ef0f..8587bd67a59 100644 --- a/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js +++ b/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js @@ -99,7 +99,7 @@ exports.x = 10; //// [/src/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../lib/lib.d.ts","./src/index.ts","./types/type.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-10726455937-export const x = 10;","-4885977236-export type t = string;"],"options":{"composite":true,"outDir":"./dist","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../lib/lib.d.ts","./src/index.ts","./types/type.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-10726455937-export const x = 10;","signature":"-6057683066-export declare const x = 10;\r\n"},{"version":"-4885977236-export type t = string;","signature":"-4409762125-export declare type t = string;\r\n"}],"options":{"composite":true,"outDir":"./dist","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[]},"version":"FakeTSVersion"} //// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -117,11 +117,11 @@ exports.x = 10; }, "./src/index.ts": { "version": "-10726455937-export const x = 10;", - "signature": "-10726455937-export const x = 10;" + "signature": "-6057683066-export declare const x = 10;\r\n" }, "./types/type.ts": { "version": "-4885977236-export type t = string;", - "signature": "-4885977236-export type t = string;" + "signature": "-4409762125-export declare type t = string;\r\n" } }, "options": { @@ -133,7 +133,7 @@ exports.x = 10; "exportedModulesMap": {} }, "version": "FakeTSVersion", - "size": 781 + "size": 926 } //// [/src/types/type.d.ts] diff --git a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/builds-correctly.js b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/builds-correctly.js index 951c80ec293..29d1169125a 100644 --- a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/builds-correctly.js +++ b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/builds-correctly.js @@ -83,7 +83,7 @@ exports.b = 0; //// [/src/dist/main/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../lib/lib.d.ts","../../src/main/b.ts","../../src/main/a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-11678562673-export const b = 0;\r\n","-17071184049-import { b } from './b';\r\nconst a = b;"],"options":{"composite":true,"declaration":true,"outDir":"..","rootDir":"../../src","skipDefaultLibCheck":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../lib/lib.d.ts","../../src/main/b.ts","../../src/main/a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-11678562673-export const b = 0;\r\n","signature":"-3829176033-export declare const b = 0;\r\n"},{"version":"-17071184049-import { b } from './b';\r\nconst a = b;","signature":"-4882119183-export {};\r\n"}],"options":{"composite":true,"declaration":true,"outDir":"..","rootDir":"../../src","skipDefaultLibCheck":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} //// [/src/dist/main/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -106,11 +106,11 @@ exports.b = 0; }, "../../src/main/b.ts": { "version": "-11678562673-export const b = 0;\r\n", - "signature": "-11678562673-export const b = 0;\r\n" + "signature": "-3829176033-export declare const b = 0;\r\n" }, "../../src/main/a.ts": { "version": "-17071184049-import { b } from './b';\r\nconst a = b;", - "signature": "-17071184049-import { b } from './b';\r\nconst a = b;" + "signature": "-4882119183-export {};\r\n" } }, "options": { @@ -125,11 +125,7 @@ exports.b = 0; "../../src/main/b.ts" ] }, - "exportedModulesMap": { - "../../src/main/a.ts": [ - "../../src/main/b.ts" - ] - }, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../../../lib/lib.d.ts", "../../src/main/a.ts", @@ -137,7 +133,7 @@ exports.b = 0; ] }, "version": "FakeTSVersion", - "size": 930 + "size": 1048 } //// [/src/dist/other/other.d.ts] @@ -152,7 +148,7 @@ exports.Other = 0; //// [/src/dist/other/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../lib/lib.d.ts","../../src/other/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2951227185-export const Other = 0;\r\n"],"options":{"composite":true,"declaration":true,"outDir":"..","rootDir":"../../src","skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../lib/lib.d.ts","../../src/other/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2951227185-export const Other = 0;\r\n","signature":"-7996259489-export declare const Other = 0;\r\n"}],"options":{"composite":true,"declaration":true,"outDir":"..","rootDir":"../../src","skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} //// [/src/dist/other/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -169,7 +165,7 @@ exports.Other = 0; }, "../../src/other/other.ts": { "version": "-2951227185-export const Other = 0;\r\n", - "signature": "-2951227185-export const Other = 0;\r\n" + "signature": "-7996259489-export declare const Other = 0;\r\n" } }, "options": { @@ -187,6 +183,6 @@ exports.Other = 0; ] }, "version": "FakeTSVersion", - "size": 828 + "size": 902 } diff --git a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file-because-no-rootDir-in-the-base.js b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file-because-no-rootDir-in-the-base.js index 829c3d8bd69..90ccbb786f8 100644 --- a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file-because-no-rootDir-in-the-base.js +++ b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file-because-no-rootDir-in-the-base.js @@ -92,7 +92,7 @@ exports.Other = 0; //// [/src/dist/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../src/other/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2951227185-export const Other = 0;\r\n"],"options":{"composite":true,"declaration":true,"outDir":"./","skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../src/other/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2951227185-export const Other = 0;\r\n","signature":"-7996259489-export declare const Other = 0;\r\n"}],"options":{"composite":true,"declaration":true,"outDir":"./","skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} //// [/src/dist/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -109,7 +109,7 @@ exports.Other = 0; }, "../src/other/other.ts": { "version": "-2951227185-export const Other = 0;\r\n", - "signature": "-2951227185-export const Other = 0;\r\n" + "signature": "-7996259489-export declare const Other = 0;\r\n" } }, "options": { @@ -126,6 +126,6 @@ exports.Other = 0; ] }, "version": "FakeTSVersion", - "size": 800 + "size": 874 } diff --git a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file.js b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file.js index 8fe044e9134..91f519359ed 100644 --- a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file.js +++ b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file.js @@ -74,7 +74,7 @@ exports.Other = 0; //// [/src/dist/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../src/other/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2951227185-export const Other = 0;\r\n"],"options":{"composite":true,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../src/other/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2951227185-export const Other = 0;\r\n","signature":"-7996259489-export declare const Other = 0;\r\n"}],"options":{"composite":true,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} //// [/src/dist/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -91,7 +91,7 @@ exports.Other = 0; }, "../src/other/other.ts": { "version": "-2951227185-export const Other = 0;\r\n", - "signature": "-2951227185-export const Other = 0;\r\n" + "signature": "-7996259489-export declare const Other = 0;\r\n" } }, "options": { @@ -106,6 +106,6 @@ exports.Other = 0; ] }, "version": "FakeTSVersion", - "size": 754 + "size": 828 } diff --git a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-no-error-when-tsbuildinfo-differ.js b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-no-error-when-tsbuildinfo-differ.js index 804e41039ba..34c24f66395 100644 --- a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-no-error-when-tsbuildinfo-differ.js +++ b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-no-error-when-tsbuildinfo-differ.js @@ -88,7 +88,7 @@ exports.Other = 0; //// [/src/dist/tsconfig.main.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../src/main/b.ts","../src/main/a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-11678562673-export const b = 0;\r\n","-17071184049-import { b } from './b';\r\nconst a = b;"],"options":{"composite":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../src/main/b.ts","../src/main/a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-11678562673-export const b = 0;\r\n","signature":"-3829176033-export declare const b = 0;\r\n"},{"version":"-17071184049-import { b } from './b';\r\nconst a = b;","signature":"-4882119183-export {};\r\n"}],"options":{"composite":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} //// [/src/dist/tsconfig.main.tsbuildinfo.readable.baseline.txt] { @@ -111,11 +111,11 @@ exports.Other = 0; }, "../src/main/b.ts": { "version": "-11678562673-export const b = 0;\r\n", - "signature": "-11678562673-export const b = 0;\r\n" + "signature": "-3829176033-export declare const b = 0;\r\n" }, "../src/main/a.ts": { "version": "-17071184049-import { b } from './b';\r\nconst a = b;", - "signature": "-17071184049-import { b } from './b';\r\nconst a = b;" + "signature": "-4882119183-export {};\r\n" } }, "options": { @@ -127,11 +127,7 @@ exports.Other = 0; "../src/main/b.ts" ] }, - "exportedModulesMap": { - "../src/main/a.ts": [ - "../src/main/b.ts" - ] - }, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../../lib/lib.d.ts", "../src/main/a.ts", @@ -139,11 +135,11 @@ exports.Other = 0; ] }, "version": "FakeTSVersion", - "size": 853 + "size": 971 } //// [/src/dist/tsconfig.other.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../src/other/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2951227185-export const Other = 0;\r\n"],"options":{"composite":true,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../src/other/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2951227185-export const Other = 0;\r\n","signature":"-7996259489-export declare const Other = 0;\r\n"}],"options":{"composite":true,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} //// [/src/dist/tsconfig.other.tsbuildinfo.readable.baseline.txt] { @@ -160,7 +156,7 @@ exports.Other = 0; }, "../src/other/other.ts": { "version": "-2951227185-export const Other = 0;\r\n", - "signature": "-2951227185-export const Other = 0;\r\n" + "signature": "-7996259489-export declare const Other = 0;\r\n" } }, "options": { @@ -175,6 +171,6 @@ exports.Other = 0; ] }, "version": "FakeTSVersion", - "size": 754 + "size": 828 } diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file.js b/tests/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file.js index 761d5e83e6c..f89ac987cc7 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file.js @@ -93,7 +93,7 @@ exports["default"] = hello_json_1["default"].hello; //// [/src/dist/tsconfig_withFiles.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../src/hello.json","../src/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"6651571919-{\n \"hello\": \"world\"\n}","-27703454282-import hello from \"./hello.json\"\n\nexport default hello.hello"],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":1,"outDir":"./","skipDefaultLibCheck":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../src/hello.json","../src/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"6651571919-{\n \"hello\": \"world\"\n}",{"version":"-27703454282-import hello from \"./hello.json\"\n\nexport default hello.hello","signature":"-1680156224-declare const _default: string;\r\nexport default _default;\r\n"}],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":1,"outDir":"./","skipDefaultLibCheck":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/src/dist/tsconfig_withFiles.tsbuildinfo.readable.baseline.txt] { @@ -120,7 +120,7 @@ exports["default"] = hello_json_1["default"].hello; }, "../src/index.ts": { "version": "-27703454282-import hello from \"./hello.json\"\n\nexport default hello.hello", - "signature": "-27703454282-import hello from \"./hello.json\"\n\nexport default hello.hello" + "signature": "-1680156224-declare const _default: string;\r\nexport default _default;\r\n" } }, "options": { @@ -136,11 +136,7 @@ exports["default"] = hello_json_1["default"].hello; "../src/hello.json" ] }, - "exportedModulesMap": { - "../src/index.ts": [ - "../src/hello.json" - ] - }, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../../lib/lib.d.ts", "../src/hello.json", @@ -148,6 +144,6 @@ exports["default"] = hello_json_1["default"].hello; ] }, "version": "FakeTSVersion", - "size": 977 + "size": 1074 } diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/importing-json-module-from-project-reference.js b/tests/baselines/reference/tsbuild/resolveJsonModule/importing-json-module-from-project-reference.js index 680726f03f7..61c24618621 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/importing-json-module-from-project-reference.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/importing-json-module-from-project-reference.js @@ -109,7 +109,7 @@ console.log(foo_json_1.foo); //// [/src/main/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../strings/foo.json","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"4395333385-{\n \"foo\": \"bar baz\"\n}","-4651661680-import { foo } from '../strings/foo.json';\n\nconsole.log(foo);"],"options":{"composite":true,"esModuleInterop":true,"module":1,"rootDir":"..","strict":true,"target":1},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../strings/foo.json","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"4395333385-{\n \"foo\": \"bar baz\"\n}",{"version":"-4651661680-import { foo } from '../strings/foo.json';\n\nconsole.log(foo);","signature":"-4882119183-export {};\r\n"}],"options":{"composite":true,"esModuleInterop":true,"module":1,"rootDir":"..","strict":true,"target":1},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} //// [/src/main/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -136,7 +136,7 @@ console.log(foo_json_1.foo); }, "./index.ts": { "version": "-4651661680-import { foo } from '../strings/foo.json';\n\nconsole.log(foo);", - "signature": "-4651661680-import { foo } from '../strings/foo.json';\n\nconsole.log(foo);" + "signature": "-4882119183-export {};\r\n" } }, "options": { @@ -152,11 +152,7 @@ console.log(foo_json_1.foo); "../strings/foo.json" ] }, - "exportedModulesMap": { - "./index.ts": [ - "../strings/foo.json" - ] - }, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../../lib/lib.d.ts", "./index.ts", @@ -164,7 +160,7 @@ console.log(foo_json_1.foo); ] }, "version": "FakeTSVersion", - "size": 937 + "size": 985 } //// [/src/strings/tsconfig.tsbuildinfo] diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/include-and-files.js b/tests/baselines/reference/tsbuild/resolveJsonModule/include-and-files.js index a39c9a4c2fc..5b0b0ab096b 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/include-and-files.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/include-and-files.js @@ -96,7 +96,7 @@ exports["default"] = hello_json_1["default"].hello; //// [/src/dist/tsconfig_withIncludeAndFiles.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../src/hello.json","../src/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"6651571919-{\n \"hello\": \"world\"\n}","-27703454282-import hello from \"./hello.json\"\n\nexport default hello.hello"],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":1,"outDir":"./","skipDefaultLibCheck":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../src/hello.json","../src/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"6651571919-{\n \"hello\": \"world\"\n}",{"version":"-27703454282-import hello from \"./hello.json\"\n\nexport default hello.hello","signature":"-1680156224-declare const _default: string;\r\nexport default _default;\r\n"}],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":1,"outDir":"./","skipDefaultLibCheck":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/src/dist/tsconfig_withIncludeAndFiles.tsbuildinfo.readable.baseline.txt] { @@ -123,7 +123,7 @@ exports["default"] = hello_json_1["default"].hello; }, "../src/index.ts": { "version": "-27703454282-import hello from \"./hello.json\"\n\nexport default hello.hello", - "signature": "-27703454282-import hello from \"./hello.json\"\n\nexport default hello.hello" + "signature": "-1680156224-declare const _default: string;\r\nexport default _default;\r\n" } }, "options": { @@ -139,11 +139,7 @@ exports["default"] = hello_json_1["default"].hello; "../src/hello.json" ] }, - "exportedModulesMap": { - "../src/index.ts": [ - "../src/hello.json" - ] - }, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../../lib/lib.d.ts", "../src/hello.json", @@ -151,6 +147,6 @@ exports["default"] = hello_json_1["default"].hello; ] }, "version": "FakeTSVersion", - "size": 977 + "size": 1074 } diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js b/tests/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js index a9f864eb9ce..b03df44134f 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js @@ -89,7 +89,7 @@ exports["default"] = index_json_1["default"].hello; //// [/src/dist/tsconfig_withIncludeOfJson.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../src/index.json","../src/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2379406821-{\"hello\":\"world\"}","-6335882310-import hello from \"./index.json\"\n\nexport default hello.hello"],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":1,"outDir":"./","skipDefaultLibCheck":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../src/index.json","../src/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2379406821-{\"hello\":\"world\"}",{"version":"-6335882310-import hello from \"./index.json\"\n\nexport default hello.hello","signature":"-1680156224-declare const _default: string;\r\nexport default _default;\r\n"}],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":1,"outDir":"./","skipDefaultLibCheck":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/src/dist/tsconfig_withIncludeOfJson.tsbuildinfo.readable.baseline.txt] { @@ -116,7 +116,7 @@ exports["default"] = index_json_1["default"].hello; }, "../src/index.ts": { "version": "-6335882310-import hello from \"./index.json\"\n\nexport default hello.hello", - "signature": "-6335882310-import hello from \"./index.json\"\n\nexport default hello.hello" + "signature": "-1680156224-declare const _default: string;\r\nexport default _default;\r\n" } }, "options": { @@ -132,11 +132,7 @@ exports["default"] = index_json_1["default"].hello; "../src/index.json" ] }, - "exportedModulesMap": { - "../src/index.ts": [ - "../src/index.json" - ] - }, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../../lib/lib.d.ts", "../src/index.json", @@ -144,6 +140,6 @@ exports["default"] = index_json_1["default"].hello; ] }, "version": "FakeTSVersion", - "size": 970 + "size": 1067 } diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include.js b/tests/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include.js index 13c1edfb022..bceeadf78b7 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include.js @@ -93,7 +93,7 @@ exports["default"] = hello_json_1["default"].hello; //// [/src/dist/tsconfig_withIncludeOfJson.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../src/hello.json","../src/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"6651571919-{\n \"hello\": \"world\"\n}","-27703454282-import hello from \"./hello.json\"\n\nexport default hello.hello"],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":1,"outDir":"./","skipDefaultLibCheck":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../src/hello.json","../src/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"6651571919-{\n \"hello\": \"world\"\n}",{"version":"-27703454282-import hello from \"./hello.json\"\n\nexport default hello.hello","signature":"-1680156224-declare const _default: string;\r\nexport default _default;\r\n"}],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":1,"outDir":"./","skipDefaultLibCheck":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/src/dist/tsconfig_withIncludeOfJson.tsbuildinfo.readable.baseline.txt] { @@ -120,7 +120,7 @@ exports["default"] = hello_json_1["default"].hello; }, "../src/index.ts": { "version": "-27703454282-import hello from \"./hello.json\"\n\nexport default hello.hello", - "signature": "-27703454282-import hello from \"./hello.json\"\n\nexport default hello.hello" + "signature": "-1680156224-declare const _default: string;\r\nexport default _default;\r\n" } }, "options": { @@ -136,11 +136,7 @@ exports["default"] = hello_json_1["default"].hello; "../src/hello.json" ] }, - "exportedModulesMap": { - "../src/index.ts": [ - "../src/hello.json" - ] - }, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../../lib/lib.d.ts", "../src/hello.json", @@ -148,6 +144,6 @@ exports["default"] = hello_json_1["default"].hello; ] }, "version": "FakeTSVersion", - "size": 977 + "size": 1074 } diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/sourcemap.js b/tests/baselines/reference/tsbuild/resolveJsonModule/sourcemap.js index 6c6c6d52e20..d88d2b98921 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/sourcemap.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/sourcemap.js @@ -96,7 +96,7 @@ exports["default"] = hello_json_1["default"].hello; {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;AAAA,4DAAgC;AAEhC,qBAAe,uBAAK,CAAC,KAAK,CAAA"} //// [/src/dist/tsconfig_withFiles.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../src/hello.json","../src/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"6651571919-{\n \"hello\": \"world\"\n}","-27703454282-import hello from \"./hello.json\"\n\nexport default hello.hello"],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":1,"outDir":"./","skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../src/hello.json","../src/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"6651571919-{\n \"hello\": \"world\"\n}",{"version":"-27703454282-import hello from \"./hello.json\"\n\nexport default hello.hello","signature":"-1680156224-declare const _default: string;\r\nexport default _default;\r\n"}],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":1,"outDir":"./","skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/src/dist/tsconfig_withFiles.tsbuildinfo.readable.baseline.txt] { @@ -123,7 +123,7 @@ exports["default"] = hello_json_1["default"].hello; }, "../src/index.ts": { "version": "-27703454282-import hello from \"./hello.json\"\n\nexport default hello.hello", - "signature": "-27703454282-import hello from \"./hello.json\"\n\nexport default hello.hello" + "signature": "-1680156224-declare const _default: string;\r\nexport default _default;\r\n" } }, "options": { @@ -140,11 +140,7 @@ exports["default"] = hello_json_1["default"].hello; "../src/hello.json" ] }, - "exportedModulesMap": { - "../src/index.ts": [ - "../src/hello.json" - ] - }, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../../lib/lib.d.ts", "../src/hello.json", @@ -152,7 +148,7 @@ exports["default"] = hello_json_1["default"].hello; ] }, "version": "FakeTSVersion", - "size": 994 + "size": 1091 } diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/without-outDir.js b/tests/baselines/reference/tsbuild/resolveJsonModule/without-outDir.js index f827ba3f874..af59c4bf9dd 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/without-outDir.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/without-outDir.js @@ -80,7 +80,7 @@ exports["default"] = hello_json_1["default"].hello; //// [/src/tsconfig_withFiles.tsbuildinfo] -{"program":{"fileNames":["../lib/lib.d.ts","./src/hello.json","./src/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"6651571919-{\n \"hello\": \"world\"\n}","-27703454282-import hello from \"./hello.json\"\n\nexport default hello.hello"],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":1,"skipDefaultLibCheck":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../lib/lib.d.ts","./src/hello.json","./src/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"6651571919-{\n \"hello\": \"world\"\n}",{"version":"-27703454282-import hello from \"./hello.json\"\n\nexport default hello.hello","signature":"-1680156224-declare const _default: string;\r\nexport default _default;\r\n"}],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":1,"skipDefaultLibCheck":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/src/tsconfig_withFiles.tsbuildinfo.readable.baseline.txt] { @@ -107,7 +107,7 @@ exports["default"] = hello_json_1["default"].hello; }, "./src/index.ts": { "version": "-27703454282-import hello from \"./hello.json\"\n\nexport default hello.hello", - "signature": "-27703454282-import hello from \"./hello.json\"\n\nexport default hello.hello" + "signature": "-1680156224-declare const _default: string;\r\nexport default _default;\r\n" } }, "options": { @@ -122,11 +122,7 @@ exports["default"] = hello_json_1["default"].hello; "./src/hello.json" ] }, - "exportedModulesMap": { - "./src/index.ts": [ - "./src/hello.json" - ] - }, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../lib/lib.d.ts", "./src/hello.json", @@ -134,7 +130,7 @@ exports["default"] = hello_json_1["default"].hello; ] }, "version": "FakeTSVersion", - "size": 958 + "size": 1055 } diff --git a/tests/baselines/reference/tsbuild/sample1/always-builds-under-with-force-option.js b/tests/baselines/reference/tsbuild/sample1/always-builds-under-with-force-option.js index fd630de3248..5cd3b7649f8 100644 --- a/tests/baselines/reference/tsbuild/sample1/always-builds-under-with-force-option.js +++ b/tests/baselines/reference/tsbuild/sample1/always-builds-under-with-force-option.js @@ -136,7 +136,7 @@ exports.multiply = multiply; //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -155,11 +155,11 @@ exports.multiply = multiply; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n" }, "./some_decl.d.ts": { "version": "-9253692965-declare const dts: any;\r\n", @@ -183,7 +183,7 @@ exports.multiply = multiply; ] }, "version": "FakeTSVersion", - "size": 1134 + "size": 1431 } //// [/src/logic/index.d.ts] @@ -209,7 +209,7 @@ exports.m = mod; {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} //// [/src/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/src/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -224,6 +224,9 @@ exports.m = mod; [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -242,7 +245,7 @@ exports.m = mod; }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -259,7 +262,6 @@ exports.m = mod; }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -271,7 +273,7 @@ exports.m = mod; ] }, "version": "FakeTSVersion", - "size": 1370 + "size": 1555 } //// [/src/tests/index.d.ts] @@ -292,7 +294,7 @@ exports.m = mod; //// [/src/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -334,7 +336,7 @@ exports.m = mod; }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -357,9 +359,7 @@ exports.m = mod; "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -371,7 +371,7 @@ exports.m = mod; ] }, "version": "FakeTSVersion", - "size": 1578 + "size": 1702 } diff --git a/tests/baselines/reference/tsbuild/sample1/building-using-buildReferencedProject.js b/tests/baselines/reference/tsbuild/sample1/building-using-buildReferencedProject.js index 70e9a3a8df6..8de42fea26f 100644 --- a/tests/baselines/reference/tsbuild/sample1/building-using-buildReferencedProject.js +++ b/tests/baselines/reference/tsbuild/sample1/building-using-buildReferencedProject.js @@ -140,7 +140,7 @@ exports.multiply = multiply; //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -159,11 +159,11 @@ exports.multiply = multiply; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n" }, "./some_decl.d.ts": { "version": "-9253692965-declare const dts: any;\r\n", @@ -187,7 +187,7 @@ exports.multiply = multiply; ] }, "version": "FakeTSVersion", - "size": 1134 + "size": 1431 } //// [/src/logic/index.d.ts] @@ -213,7 +213,7 @@ exports.m = mod; {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} //// [/src/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/src/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -228,6 +228,9 @@ exports.m = mod; [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -246,7 +249,7 @@ exports.m = mod; }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -263,7 +266,6 @@ exports.m = mod; }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -275,6 +277,6 @@ exports.m = mod; ] }, "version": "FakeTSVersion", - "size": 1370 + "size": 1555 } diff --git a/tests/baselines/reference/tsbuild/sample1/building-using-getNextInvalidatedProject.js b/tests/baselines/reference/tsbuild/sample1/building-using-getNextInvalidatedProject.js index 88764c1e9d2..b8f5f577195 100644 --- a/tests/baselines/reference/tsbuild/sample1/building-using-getNextInvalidatedProject.js +++ b/tests/baselines/reference/tsbuild/sample1/building-using-getNextInvalidatedProject.js @@ -127,7 +127,7 @@ export declare function multiply(a: number, b: number): number; //# sourceMappingURL=index.d.ts.map //// [/user/username/projects/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} Project Result:: {"project":"/user/username/projects/logic/tsconfig.json","result":0} @@ -156,7 +156,7 @@ export declare const m: typeof mod; //// [/user/username/projects/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} Project Result:: {"project":"/user/username/projects/tests/tsconfig.json","result":0} @@ -180,7 +180,7 @@ export declare const m: typeof mod; //// [/user/username/projects/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} Project Result:: {} diff --git a/tests/baselines/reference/tsbuild/sample1/builds-correctly-when-declarationDir-is-specified.js b/tests/baselines/reference/tsbuild/sample1/builds-correctly-when-declarationDir-is-specified.js index 6e4ef715f39..ce16960e1dc 100644 --- a/tests/baselines/reference/tsbuild/sample1/builds-correctly-when-declarationDir-is-specified.js +++ b/tests/baselines/reference/tsbuild/sample1/builds-correctly-when-declarationDir-is-specified.js @@ -124,7 +124,7 @@ exports.multiply = multiply; //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -143,11 +143,11 @@ exports.multiply = multiply; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n" }, "./some_decl.d.ts": { "version": "-9253692965-declare const dts: any;\r\n", @@ -171,7 +171,7 @@ exports.multiply = multiply; ] }, "version": "FakeTSVersion", - "size": 1134 + "size": 1431 } //// [/src/logic/index.js] @@ -197,7 +197,7 @@ export declare const m: typeof mod; //// [/src/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"declarationDir":"./out/decls","sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"declarationDir":"./out/decls","sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/src/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -212,6 +212,9 @@ export declare const m: typeof mod; [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -230,7 +233,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -247,7 +250,6 @@ export declare const m: typeof mod; }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -259,7 +261,7 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1374 + "size": 1559 } //// [/src/tests/index.d.ts] @@ -280,7 +282,7 @@ exports.m = mod; //// [/src/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/out/decls/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/out/decls/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -322,7 +324,7 @@ exports.m = mod; }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -345,9 +347,7 @@ exports.m = mod; "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/out/decls/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -359,6 +359,6 @@ exports.m = mod; ] }, "version": "FakeTSVersion", - "size": 1588 + "size": 1712 } diff --git a/tests/baselines/reference/tsbuild/sample1/builds-correctly-when-outDir-is-specified.js b/tests/baselines/reference/tsbuild/sample1/builds-correctly-when-outDir-is-specified.js index 087b2c5705a..7dab4ac6b19 100644 --- a/tests/baselines/reference/tsbuild/sample1/builds-correctly-when-outDir-is-specified.js +++ b/tests/baselines/reference/tsbuild/sample1/builds-correctly-when-outDir-is-specified.js @@ -124,7 +124,7 @@ exports.multiply = multiply; //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -143,11 +143,11 @@ exports.multiply = multiply; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n" }, "./some_decl.d.ts": { "version": "-9253692965-declare const dts: any;\r\n", @@ -171,7 +171,7 @@ exports.multiply = multiply; ] }, "version": "FakeTSVersion", - "size": 1134 + "size": 1431 } //// [/src/logic/outDir/index.d.ts] @@ -197,7 +197,7 @@ exports.m = mod; {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} //// [/src/logic/outDir/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../lib/lib.d.ts","../../core/index.d.ts","../../core/anothermodule.d.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"outDir":"./","sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../lib/lib.d.ts","../../core/index.d.ts","../../core/anothermodule.d.ts","../index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"outDir":"./","sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/src/logic/outDir/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -212,6 +212,9 @@ exports.m = mod; [ "../../core/index.d.ts", "../../core/anothermodule.d.ts" + ], + [ + "../../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -230,7 +233,7 @@ exports.m = mod; }, "../index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -247,7 +250,6 @@ exports.m = mod; }, "exportedModulesMap": { "../index.ts": [ - "../../core/index.d.ts", "../../core/anothermodule.d.ts" ] }, @@ -259,7 +261,7 @@ exports.m = mod; ] }, "version": "FakeTSVersion", - "size": 1367 + "size": 1552 } //// [/src/tests/index.d.ts] @@ -280,7 +282,7 @@ exports.m = mod; //// [/src/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/outdir/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/outdir/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -322,7 +324,7 @@ exports.m = mod; }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -345,9 +347,7 @@ exports.m = mod; "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/outdir/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -359,6 +359,6 @@ exports.m = mod; ] }, "version": "FakeTSVersion", - "size": 1585 + "size": 1709 } diff --git a/tests/baselines/reference/tsbuild/sample1/builds-till-project-specified.js b/tests/baselines/reference/tsbuild/sample1/builds-till-project-specified.js index 08803bc8204..5d97c7def04 100644 --- a/tests/baselines/reference/tsbuild/sample1/builds-till-project-specified.js +++ b/tests/baselines/reference/tsbuild/sample1/builds-till-project-specified.js @@ -128,7 +128,7 @@ exports.multiply = multiply; //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -147,11 +147,11 @@ exports.multiply = multiply; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n" }, "./some_decl.d.ts": { "version": "-9253692965-declare const dts: any;\r\n", @@ -175,7 +175,7 @@ exports.multiply = multiply; ] }, "version": "FakeTSVersion", - "size": 1134 + "size": 1431 } //// [/src/logic/index.d.ts] @@ -201,7 +201,7 @@ exports.m = mod; {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} //// [/src/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/src/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -216,6 +216,9 @@ exports.m = mod; [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -234,7 +237,7 @@ exports.m = mod; }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -251,7 +254,6 @@ exports.m = mod; }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -263,6 +265,6 @@ exports.m = mod; ] }, "version": "FakeTSVersion", - "size": 1370 + "size": 1555 } diff --git a/tests/baselines/reference/tsbuild/sample1/can-detect-when-and-what-to-rebuild.js b/tests/baselines/reference/tsbuild/sample1/can-detect-when-and-what-to-rebuild.js index aeb065309af..e99d614d712 100644 --- a/tests/baselines/reference/tsbuild/sample1/can-detect-when-and-what-to-rebuild.js +++ b/tests/baselines/reference/tsbuild/sample1/can-detect-when-and-what-to-rebuild.js @@ -60,7 +60,7 @@ declare const dts: any; } //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/logic/index.d.ts] @@ -90,7 +90,7 @@ declare const dts: any; //// [/src/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/src/tests/index.d.ts] import * as mod from '../core/anotherModule'; @@ -119,7 +119,7 @@ export declare const m: typeof mod; } //// [/src/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/src/ui/index.ts] @@ -270,7 +270,7 @@ exports.multiply = multiply; //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n",{"version":"-2157245566-export const someString: string = \"WELCOME PLANET\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-2157245566-export const someString: string = \"WELCOME PLANET\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -289,7 +289,7 @@ exports.multiply = multiply; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-2157245566-export const someString: string = \"WELCOME PLANET\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", @@ -317,7 +317,7 @@ exports.multiply = multiply; ] }, "version": "FakeTSVersion", - "size": 1351 + "size": 1433 } //// [/src/logic/tsconfig.tsbuildinfo] file changed its modified time diff --git a/tests/baselines/reference/tsbuild/sample1/does-not-build-downstream-projects-if-upstream-projects-have-errors.js b/tests/baselines/reference/tsbuild/sample1/does-not-build-downstream-projects-if-upstream-projects-have-errors.js index 8193d319ff0..d9cf8f1a96c 100644 --- a/tests/baselines/reference/tsbuild/sample1/does-not-build-downstream-projects-if-upstream-projects-have-errors.js +++ b/tests/baselines/reference/tsbuild/sample1/does-not-build-downstream-projects-if-upstream-projects-have-errors.js @@ -153,7 +153,7 @@ exports.multiply = multiply; //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -172,11 +172,11 @@ exports.multiply = multiply; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n" }, "./some_decl.d.ts": { "version": "-9253692965-declare const dts: any;\r\n", @@ -200,7 +200,7 @@ exports.multiply = multiply; ] }, "version": "FakeTSVersion", - "size": 1134 + "size": 1431 } //// [/src/logic/tsconfig.tsbuildinfo] diff --git a/tests/baselines/reference/tsbuild/sample1/explainFiles.js b/tests/baselines/reference/tsbuild/sample1/explainFiles.js index 2c4dec3fd7a..1c64af2e293 100644 --- a/tests/baselines/reference/tsbuild/sample1/explainFiles.js +++ b/tests/baselines/reference/tsbuild/sample1/explainFiles.js @@ -185,7 +185,7 @@ exports.multiply = multiply; //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -204,11 +204,11 @@ exports.multiply = multiply; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n" }, "./some_decl.d.ts": { "version": "-9253692965-declare const dts: any;\r\n", @@ -232,7 +232,7 @@ exports.multiply = multiply; ] }, "version": "FakeTSVersion", - "size": 1134 + "size": 1431 } //// [/src/logic/index.d.ts] @@ -258,7 +258,7 @@ exports.m = mod; {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} //// [/src/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/src/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -273,6 +273,9 @@ exports.m = mod; [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -291,7 +294,7 @@ exports.m = mod; }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -308,7 +311,6 @@ exports.m = mod; }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -320,7 +322,7 @@ exports.m = mod; ] }, "version": "FakeTSVersion", - "size": 1370 + "size": 1555 } //// [/src/tests/index.d.ts] @@ -341,7 +343,7 @@ exports.m = mod; //// [/src/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -383,7 +385,7 @@ exports.m = mod; }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -406,9 +408,7 @@ exports.m = mod; "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -420,7 +420,7 @@ exports.m = mod; ] }, "version": "FakeTSVersion", - "size": 1578 + "size": 1702 } @@ -522,7 +522,7 @@ exports.someClass = someClass; //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n",{"version":"-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }","signature":"-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }","signature":"-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -541,7 +541,7 @@ exports.someClass = someClass; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }", @@ -569,7 +569,7 @@ exports.someClass = someClass; ] }, "version": "FakeTSVersion", - "size": 1420 + "size": 1502 } //// [/src/logic/index.d.ts] file written with same contents @@ -797,7 +797,7 @@ var someClass2 = /** @class */ (function () { //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n",{"version":"-11293323834-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nclass someClass2 { }","signature":"-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-11293323834-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nclass someClass2 { }","signature":"-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -816,7 +816,7 @@ var someClass2 = /** @class */ (function () { }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-11293323834-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nclass someClass2 { }", @@ -844,7 +844,7 @@ var someClass2 = /** @class */ (function () { ] }, "version": "FakeTSVersion", - "size": 1442 + "size": 1524 } //// [/src/logic/tsconfig.tsbuildinfo] file changed its modified time diff --git a/tests/baselines/reference/tsbuild/sample1/indicates-that-it-would-skip-builds-during-a-dry-build.js b/tests/baselines/reference/tsbuild/sample1/indicates-that-it-would-skip-builds-during-a-dry-build.js index 84b2e0f83ac..938e441dcb0 100644 --- a/tests/baselines/reference/tsbuild/sample1/indicates-that-it-would-skip-builds-during-a-dry-build.js +++ b/tests/baselines/reference/tsbuild/sample1/indicates-that-it-would-skip-builds-during-a-dry-build.js @@ -40,7 +40,7 @@ Input:: } //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/logic/index.d.ts] @@ -70,7 +70,7 @@ Input:: //// [/src/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/src/tests/index.d.ts] @@ -97,7 +97,7 @@ Input:: } //// [/src/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/src/ui/index.ts] diff --git a/tests/baselines/reference/tsbuild/sample1/invalidates-projects-correctly.js b/tests/baselines/reference/tsbuild/sample1/invalidates-projects-correctly.js index a17ef3b4182..2801b7a71ce 100644 --- a/tests/baselines/reference/tsbuild/sample1/invalidates-projects-correctly.js +++ b/tests/baselines/reference/tsbuild/sample1/invalidates-projects-correctly.js @@ -123,7 +123,7 @@ export declare function multiply(a: number, b: number): number; //# sourceMappingURL=index.d.ts.map //// [/user/username/projects/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/logic/index.js.map] {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} @@ -148,7 +148,7 @@ export declare const m: typeof mod; //// [/user/username/projects/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/user/username/projects/tests/index.js] "use strict"; @@ -168,7 +168,7 @@ export declare const m: typeof mod; //// [/user/username/projects/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} Project should still be upto date: UpToDate diff --git a/tests/baselines/reference/tsbuild/sample1/listEmittedFiles.js b/tests/baselines/reference/tsbuild/sample1/listEmittedFiles.js index c3206a0f47b..50e5bc1c183 100644 --- a/tests/baselines/reference/tsbuild/sample1/listEmittedFiles.js +++ b/tests/baselines/reference/tsbuild/sample1/listEmittedFiles.js @@ -150,7 +150,7 @@ exports.multiply = multiply; //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -169,11 +169,11 @@ exports.multiply = multiply; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n" }, "./some_decl.d.ts": { "version": "-9253692965-declare const dts: any;\r\n", @@ -197,7 +197,7 @@ exports.multiply = multiply; ] }, "version": "FakeTSVersion", - "size": 1134 + "size": 1431 } //// [/src/logic/index.d.ts] @@ -223,7 +223,7 @@ exports.m = mod; {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} //// [/src/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/src/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -238,6 +238,9 @@ exports.m = mod; [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -256,7 +259,7 @@ exports.m = mod; }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -273,7 +276,6 @@ exports.m = mod; }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -285,7 +287,7 @@ exports.m = mod; ] }, "version": "FakeTSVersion", - "size": 1370 + "size": 1555 } //// [/src/tests/index.d.ts] @@ -306,7 +308,7 @@ exports.m = mod; //// [/src/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -348,7 +350,7 @@ exports.m = mod; }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -371,9 +373,7 @@ exports.m = mod; "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -385,7 +385,7 @@ exports.m = mod; ] }, "version": "FakeTSVersion", - "size": 1578 + "size": 1702 } @@ -447,7 +447,7 @@ exports.someClass = someClass; //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n",{"version":"-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }","signature":"-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }","signature":"-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -466,7 +466,7 @@ exports.someClass = someClass; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }", @@ -494,7 +494,7 @@ exports.someClass = someClass; ] }, "version": "FakeTSVersion", - "size": 1420 + "size": 1502 } //// [/src/logic/index.d.ts] file written with same contents @@ -699,7 +699,7 @@ var someClass2 = /** @class */ (function () { //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n",{"version":"-11293323834-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nclass someClass2 { }","signature":"-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-11293323834-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nclass someClass2 { }","signature":"-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -718,7 +718,7 @@ var someClass2 = /** @class */ (function () { }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-11293323834-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nclass someClass2 { }", @@ -746,7 +746,7 @@ var someClass2 = /** @class */ (function () { ] }, "version": "FakeTSVersion", - "size": 1442 + "size": 1524 } //// [/src/logic/tsconfig.tsbuildinfo] file changed its modified time diff --git a/tests/baselines/reference/tsbuild/sample1/listFiles.js b/tests/baselines/reference/tsbuild/sample1/listFiles.js index 9174e4e8e10..f2f91806251 100644 --- a/tests/baselines/reference/tsbuild/sample1/listFiles.js +++ b/tests/baselines/reference/tsbuild/sample1/listFiles.js @@ -149,7 +149,7 @@ exports.multiply = multiply; //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -168,11 +168,11 @@ exports.multiply = multiply; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n" }, "./some_decl.d.ts": { "version": "-9253692965-declare const dts: any;\r\n", @@ -196,7 +196,7 @@ exports.multiply = multiply; ] }, "version": "FakeTSVersion", - "size": 1134 + "size": 1431 } //// [/src/logic/index.d.ts] @@ -222,7 +222,7 @@ exports.m = mod; {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} //// [/src/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/src/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -237,6 +237,9 @@ exports.m = mod; [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -255,7 +258,7 @@ exports.m = mod; }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -272,7 +275,6 @@ exports.m = mod; }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -284,7 +286,7 @@ exports.m = mod; ] }, "version": "FakeTSVersion", - "size": 1370 + "size": 1555 } //// [/src/tests/index.d.ts] @@ -305,7 +307,7 @@ exports.m = mod; //// [/src/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -347,7 +349,7 @@ exports.m = mod; }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -370,9 +372,7 @@ exports.m = mod; "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -384,7 +384,7 @@ exports.m = mod; ] }, "version": "FakeTSVersion", - "size": 1578 + "size": 1702 } @@ -448,7 +448,7 @@ exports.someClass = someClass; //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n",{"version":"-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }","signature":"-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }","signature":"-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -467,7 +467,7 @@ exports.someClass = someClass; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }", @@ -495,7 +495,7 @@ exports.someClass = someClass; ] }, "version": "FakeTSVersion", - "size": 1420 + "size": 1502 } //// [/src/logic/index.d.ts] file written with same contents @@ -700,7 +700,7 @@ var someClass2 = /** @class */ (function () { //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n",{"version":"-11293323834-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nclass someClass2 { }","signature":"-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-11293323834-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nclass someClass2 { }","signature":"-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -719,7 +719,7 @@ var someClass2 = /** @class */ (function () { }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-11293323834-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nclass someClass2 { }", @@ -747,7 +747,7 @@ var someClass2 = /** @class */ (function () { ] }, "version": "FakeTSVersion", - "size": 1442 + "size": 1524 } //// [/src/logic/tsconfig.tsbuildinfo] file changed its modified time diff --git a/tests/baselines/reference/tsbuild/sample1/rebuilds-completely-when-version-in-tsbuildinfo-doesnt-match-ts-version.js b/tests/baselines/reference/tsbuild/sample1/rebuilds-completely-when-version-in-tsbuildinfo-doesnt-match-ts-version.js index 61c95ca69f0..55dd400eb6b 100644 --- a/tests/baselines/reference/tsbuild/sample1/rebuilds-completely-when-version-in-tsbuildinfo-doesnt-match-ts-version.js +++ b/tests/baselines/reference/tsbuild/sample1/rebuilds-completely-when-version-in-tsbuildinfo-doesnt-match-ts-version.js @@ -61,7 +61,7 @@ declare const dts: any; } //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/logic/index.d.ts] export declare function getSecondsInDay(): number; @@ -100,7 +100,7 @@ export const m = mod; //// [/src/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/src/tests/index.d.ts] import * as mod from '../core/anotherModule'; @@ -137,7 +137,7 @@ export const m = mod; } //// [/src/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/src/ui/index.ts] @@ -176,7 +176,7 @@ exitCode:: ExitStatus.Success //// [/src/core/index.d.ts.map] file written with same contents //// [/src/core/index.js] file written with same contents //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSCurrentVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSCurrentVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -195,11 +195,11 @@ exitCode:: ExitStatus.Success }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n" }, "./some_decl.d.ts": { "version": "-9253692965-declare const dts: any;\r\n", @@ -223,14 +223,14 @@ exitCode:: ExitStatus.Success ] }, "version": "FakeTSCurrentVersion", - "size": 1141 + "size": 1438 } //// [/src/logic/index.d.ts] file written with same contents //// [/src/logic/index.js] file written with same contents //// [/src/logic/index.js.map] file written with same contents //// [/src/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSCurrentVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSCurrentVersion"} //// [/src/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -245,6 +245,9 @@ exitCode:: ExitStatus.Success [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -263,7 +266,7 @@ exitCode:: ExitStatus.Success }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -280,7 +283,6 @@ exitCode:: ExitStatus.Success }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -292,13 +294,13 @@ exitCode:: ExitStatus.Success ] }, "version": "FakeTSCurrentVersion", - "size": 1377 + "size": 1562 } //// [/src/tests/index.d.ts] file written with same contents //// [/src/tests/index.js] file written with same contents //// [/src/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSCurrentVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSCurrentVersion"} //// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -340,7 +342,7 @@ exitCode:: ExitStatus.Success }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -363,9 +365,7 @@ exitCode:: ExitStatus.Success "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -377,6 +377,6 @@ exitCode:: ExitStatus.Success ] }, "version": "FakeTSCurrentVersion", - "size": 1585 + "size": 1709 } diff --git a/tests/baselines/reference/tsbuild/sample1/rebuilds-from-start-if-force-option-is-set.js b/tests/baselines/reference/tsbuild/sample1/rebuilds-from-start-if-force-option-is-set.js index da09fdfc308..b109bf20143 100644 --- a/tests/baselines/reference/tsbuild/sample1/rebuilds-from-start-if-force-option-is-set.js +++ b/tests/baselines/reference/tsbuild/sample1/rebuilds-from-start-if-force-option-is-set.js @@ -193,11 +193,11 @@ exitCode:: ExitStatus.Success }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n" }, "./some_decl.d.ts": { "version": "-9253692965-declare const dts: any;\r\n", @@ -221,7 +221,7 @@ exitCode:: ExitStatus.Success ] }, "version": "FakeTSVersion", - "size": 1134 + "size": 1431 } //// [/src/logic/index.d.ts] file written with same contents @@ -241,6 +241,9 @@ exitCode:: ExitStatus.Success [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -259,7 +262,7 @@ exitCode:: ExitStatus.Success }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -276,7 +279,6 @@ exitCode:: ExitStatus.Success }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -288,7 +290,7 @@ exitCode:: ExitStatus.Success ] }, "version": "FakeTSVersion", - "size": 1370 + "size": 1555 } //// [/src/tests/index.d.ts] file written with same contents @@ -334,7 +336,7 @@ exitCode:: ExitStatus.Success }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -357,9 +359,7 @@ exitCode:: ExitStatus.Success "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -371,6 +371,6 @@ exitCode:: ExitStatus.Success ] }, "version": "FakeTSVersion", - "size": 1578 + "size": 1702 } diff --git a/tests/baselines/reference/tsbuild/sample1/rebuilds-when-extended-config-file-changes.js b/tests/baselines/reference/tsbuild/sample1/rebuilds-when-extended-config-file-changes.js index ac6b8570cfe..00ee1f2746f 100644 --- a/tests/baselines/reference/tsbuild/sample1/rebuilds-when-extended-config-file-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/rebuilds-when-extended-config-file-changes.js @@ -156,7 +156,7 @@ exports.multiply = multiply; //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -175,11 +175,11 @@ exports.multiply = multiply; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n" }, "./some_decl.d.ts": { "version": "-9253692965-declare const dts: any;\r\n", @@ -203,7 +203,7 @@ exports.multiply = multiply; ] }, "version": "FakeTSVersion", - "size": 1134 + "size": 1431 } //// [/src/logic/index.d.ts] @@ -229,7 +229,7 @@ exports.m = mod; {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} //// [/src/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/src/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -244,6 +244,9 @@ exports.m = mod; [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -262,7 +265,7 @@ exports.m = mod; }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -279,7 +282,6 @@ exports.m = mod; }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -291,7 +293,7 @@ exports.m = mod; ] }, "version": "FakeTSVersion", - "size": 1370 + "size": 1555 } //// [/src/tests/index.d.ts] @@ -312,7 +314,7 @@ exports.m = mod; //// [/src/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"target":0},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"target":0},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -354,7 +356,7 @@ exports.m = mod; }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -378,9 +380,7 @@ exports.m = mod; "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -392,7 +392,7 @@ exports.m = mod; ] }, "version": "FakeTSVersion", - "size": 1589 + "size": 1713 } @@ -425,7 +425,7 @@ exitCode:: ExitStatus.Success //// [/src/tests/index.d.ts] file written with same contents //// [/src/tests/index.js] file written with same contents //// [/src/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -467,7 +467,7 @@ exitCode:: ExitStatus.Success }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -490,9 +490,7 @@ exitCode:: ExitStatus.Success "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -504,6 +502,6 @@ exitCode:: ExitStatus.Success ] }, "version": "FakeTSVersion", - "size": 1578 + "size": 1702 } diff --git a/tests/baselines/reference/tsbuild/sample1/sample.js b/tests/baselines/reference/tsbuild/sample1/sample.js index 70d60d5a021..0b5f5903359 100644 --- a/tests/baselines/reference/tsbuild/sample1/sample.js +++ b/tests/baselines/reference/tsbuild/sample1/sample.js @@ -318,7 +318,7 @@ exports.multiply = multiply; //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -337,11 +337,11 @@ exports.multiply = multiply; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n" }, "./some_decl.d.ts": { "version": "-9253692965-declare const dts: any;\r\n", @@ -365,7 +365,7 @@ exports.multiply = multiply; ] }, "version": "FakeTSVersion", - "size": 1134 + "size": 1431 } //// [/src/logic/index.d.ts] @@ -516,7 +516,7 @@ sourceFile:index.ts >>>//# sourceMappingURL=index.js.map //// [/src/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/src/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -531,6 +531,9 @@ sourceFile:index.ts [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -549,7 +552,7 @@ sourceFile:index.ts }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -566,7 +569,6 @@ sourceFile:index.ts }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -578,7 +580,7 @@ sourceFile:index.ts ] }, "version": "FakeTSVersion", - "size": 1370 + "size": 1555 } //// [/src/tests/index.d.ts] @@ -599,7 +601,7 @@ exports.m = mod; //// [/src/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -641,7 +643,7 @@ exports.m = mod; }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -664,9 +666,7 @@ exports.m = mod; "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -678,7 +678,7 @@ exports.m = mod; ] }, "version": "FakeTSVersion", - "size": 1578 + "size": 1702 } @@ -899,7 +899,7 @@ exports.someClass = someClass; //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n",{"version":"-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }","signature":"-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }","signature":"-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -918,7 +918,7 @@ exports.someClass = someClass; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }", @@ -946,7 +946,7 @@ exports.someClass = someClass; ] }, "version": "FakeTSVersion", - "size": 1420 + "size": 1502 } //// [/src/logic/index.d.ts] file written with same contents @@ -1180,7 +1180,7 @@ var someClass2 = /** @class */ (function () { //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n",{"version":"-11293323834-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nclass someClass2 { }","signature":"-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-11293323834-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nclass someClass2 { }","signature":"-14636110300-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\nexport declare class someClass {\r\n}\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1199,7 +1199,7 @@ var someClass2 = /** @class */ (function () { }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-11293323834-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nclass someClass2 { }", @@ -1227,7 +1227,7 @@ var someClass2 = /** @class */ (function () { ] }, "version": "FakeTSVersion", - "size": 1442 + "size": 1524 } //// [/src/logic/tsconfig.tsbuildinfo] file changed its modified time diff --git a/tests/baselines/reference/tsbuild/sample1/when-declaration-option-changes.js b/tests/baselines/reference/tsbuild/sample1/when-declaration-option-changes.js index fd1c36b24fc..2fd93809fb8 100644 --- a/tests/baselines/reference/tsbuild/sample1/when-declaration-option-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/when-declaration-option-changes.js @@ -173,7 +173,7 @@ export declare function multiply(a: number, b: number): number; //// [/src/core/index.js] file written with same contents //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"declaration":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -192,11 +192,11 @@ export declare function multiply(a: number, b: number): number; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n" }, "./some_decl.d.ts": { "version": "-9253692965-declare const dts: any;\r\n", @@ -218,6 +218,6 @@ export declare function multiply(a: number, b: number): number; ] }, "version": "FakeTSVersion", - "size": 1095 + "size": 1392 } diff --git a/tests/baselines/reference/tsbuild/sample1/when-esModuleInterop-option-changes.js b/tests/baselines/reference/tsbuild/sample1/when-esModuleInterop-option-changes.js index 1db9a0891c2..ee22c842dce 100644 --- a/tests/baselines/reference/tsbuild/sample1/when-esModuleInterop-option-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/when-esModuleInterop-option-changes.js @@ -154,7 +154,7 @@ exports.multiply = multiply; //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -173,11 +173,11 @@ exports.multiply = multiply; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n" }, "./some_decl.d.ts": { "version": "-9253692965-declare const dts: any;\r\n", @@ -201,7 +201,7 @@ exports.multiply = multiply; ] }, "version": "FakeTSVersion", - "size": 1134 + "size": 1431 } //// [/src/logic/index.d.ts] @@ -227,7 +227,7 @@ exports.m = mod; {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} //// [/src/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/src/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -242,6 +242,9 @@ exports.m = mod; [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -260,7 +263,7 @@ exports.m = mod; }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -277,7 +280,6 @@ exports.m = mod; }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -289,7 +291,7 @@ exports.m = mod; ] }, "version": "FakeTSVersion", - "size": 1370 + "size": 1555 } //// [/src/tests/index.d.ts] @@ -310,7 +312,7 @@ exports.m = mod; //// [/src/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"esModuleInterop":false,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"esModuleInterop":false,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -352,7 +354,7 @@ exports.m = mod; }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -376,9 +378,7 @@ exports.m = mod; "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -390,7 +390,7 @@ exports.m = mod; ] }, "version": "FakeTSVersion", - "size": 1602 + "size": 1726 } @@ -470,7 +470,7 @@ exports.m = mod; //// [/src/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"esModuleInterop":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"esModuleInterop":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -512,7 +512,7 @@ exports.m = mod; }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -536,9 +536,7 @@ exports.m = mod; "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -550,6 +548,6 @@ exports.m = mod; ] }, "version": "FakeTSVersion", - "size": 1601 + "size": 1725 } diff --git a/tests/baselines/reference/tsbuild/sample1/when-logic-specifies-tsBuildInfoFile.js b/tests/baselines/reference/tsbuild/sample1/when-logic-specifies-tsBuildInfoFile.js index 74cbc2bcd35..4e1302fdbbb 100644 --- a/tests/baselines/reference/tsbuild/sample1/when-logic-specifies-tsBuildInfoFile.js +++ b/tests/baselines/reference/tsbuild/sample1/when-logic-specifies-tsBuildInfoFile.js @@ -319,7 +319,7 @@ exports.multiply = multiply; //// [/src/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -338,11 +338,11 @@ exports.multiply = multiply; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-8396256275-export declare const World = \"hello\";\r\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n" }, "./some_decl.d.ts": { "version": "-9253692965-declare const dts: any;\r\n", @@ -366,7 +366,7 @@ exports.multiply = multiply; ] }, "version": "FakeTSVersion", - "size": 1134 + "size": 1431 } //// [/src/logic/index.d.ts] @@ -517,7 +517,7 @@ sourceFile:index.ts >>>//# sourceMappingURL=index.js.map //// [/src/logic/ownFile.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true,"tsBuildInfoFile":"./ownFile.tsbuildinfo"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true,"tsBuildInfoFile":"./ownFile.tsbuildinfo"},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/src/logic/ownFile.tsbuildinfo.readable.baseline.txt] { @@ -532,6 +532,9 @@ sourceFile:index.ts [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -550,7 +553,7 @@ sourceFile:index.ts }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -568,7 +571,6 @@ sourceFile:index.ts }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -580,7 +582,7 @@ sourceFile:index.ts ] }, "version": "FakeTSVersion", - "size": 1412 + "size": 1597 } //// [/src/tests/index.d.ts] @@ -601,7 +603,7 @@ exports.m = mod; //// [/src/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -643,7 +645,7 @@ exports.m = mod; }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" } }, "options": { @@ -666,9 +668,7 @@ exports.m = mod; "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -680,6 +680,6 @@ exports.m = mod; ] }, "version": "FakeTSVersion", - "size": 1578 + "size": 1702 } diff --git a/tests/baselines/reference/tsbuild/transitiveReferences/builds-correctly-when-the-referenced-project-uses-different-module-resolution.js b/tests/baselines/reference/tsbuild/transitiveReferences/builds-correctly-when-the-referenced-project-uses-different-module-resolution.js index 2251184ac9d..c26dfd38b38 100644 --- a/tests/baselines/reference/tsbuild/transitiveReferences/builds-correctly-when-the-referenced-project-uses-different-module-resolution.js +++ b/tests/baselines/reference/tsbuild/transitiveReferences/builds-correctly-when-the-referenced-project-uses-different-module-resolution.js @@ -110,7 +110,7 @@ a_1.X; //// [/src/tsconfig.a.tsbuildinfo] -{"program":{"fileNames":["../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-8566332115-export class A {}\r\n"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-8566332115-export class A {}\r\n","signature":"-9529994156-export declare class A {\r\n}\r\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} //// [/src/tsconfig.a.tsbuildinfo.readable.baseline.txt] { @@ -127,7 +127,7 @@ a_1.X; }, "./a.ts": { "version": "-8566332115-export class A {}\r\n", - "signature": "-8566332115-export class A {}\r\n" + "signature": "-9529994156-export declare class A {\r\n}\r\n" } }, "options": { @@ -141,11 +141,11 @@ a_1.X; ] }, "version": "FakeTSVersion", - "size": 716 + "size": 788 } //// [/src/tsconfig.b.tsbuildinfo] -{"program":{"fileNames":["../lib/lib.d.ts","./a.d.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9529994156-export declare class A {\r\n}\r\n","-17186364832-import {A} from 'a';\nexport const b = new A();"],"options":{"composite":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../lib/lib.d.ts","./a.d.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9529994156-export declare class A {\r\n}\r\n",{"version":"-17186364832-import {A} from 'a';\nexport const b = new A();","signature":"-9520743082-import { A } from 'a';\r\nexport declare const b: A;\r\n"}],"options":{"composite":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/src/tsconfig.b.tsbuildinfo.readable.baseline.txt] { @@ -172,7 +172,7 @@ a_1.X; }, "./b.ts": { "version": "-17186364832-import {A} from 'a';\nexport const b = new A();", - "signature": "-17186364832-import {A} from 'a';\nexport const b = new A();" + "signature": "-9520743082-import { A } from 'a';\r\nexport declare const b: A;\r\n" } }, "options": { @@ -195,6 +195,6 @@ a_1.X; ] }, "version": "FakeTSVersion", - "size": 834 + "size": 929 } diff --git a/tests/baselines/reference/tsbuild/transitiveReferences/builds-correctly.js b/tests/baselines/reference/tsbuild/transitiveReferences/builds-correctly.js index 39e43f277e7..f6c83225f3d 100644 --- a/tests/baselines/reference/tsbuild/transitiveReferences/builds-correctly.js +++ b/tests/baselines/reference/tsbuild/transitiveReferences/builds-correctly.js @@ -122,7 +122,7 @@ a_1.X; //// [/src/tsconfig.a.tsbuildinfo] -{"program":{"fileNames":["../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-8566332115-export class A {}\r\n"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-8566332115-export class A {}\r\n","signature":"-9529994156-export declare class A {\r\n}\r\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} //// [/src/tsconfig.a.tsbuildinfo.readable.baseline.txt] { @@ -139,7 +139,7 @@ a_1.X; }, "./a.ts": { "version": "-8566332115-export class A {}\r\n", - "signature": "-8566332115-export class A {}\r\n" + "signature": "-9529994156-export declare class A {\r\n}\r\n" } }, "options": { @@ -153,11 +153,11 @@ a_1.X; ] }, "version": "FakeTSVersion", - "size": 716 + "size": 788 } //// [/src/tsconfig.b.tsbuildinfo] -{"program":{"fileNames":["../lib/lib.d.ts","./a.d.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9529994156-export declare class A {\r\n}\r\n","-13104686224-import {A} from '@ref/a';\r\nexport const b = new A();\r\n"],"options":{"composite":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../lib/lib.d.ts","./a.d.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9529994156-export declare class A {\r\n}\r\n",{"version":"-13104686224-import {A} from '@ref/a';\r\nexport const b = new A();\r\n","signature":"-10067914302-import { A } from '@ref/a';\r\nexport declare const b: A;\r\n"}],"options":{"composite":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/src/tsconfig.b.tsbuildinfo.readable.baseline.txt] { @@ -184,7 +184,7 @@ a_1.X; }, "./b.ts": { "version": "-13104686224-import {A} from '@ref/a';\r\nexport const b = new A();\r\n", - "signature": "-13104686224-import {A} from '@ref/a';\r\nexport const b = new A();\r\n" + "signature": "-10067914302-import { A } from '@ref/a';\r\nexport declare const b: A;\r\n" } }, "options": { @@ -207,6 +207,6 @@ a_1.X; ] }, "version": "FakeTSVersion", - "size": 845 + "size": 946 } diff --git a/tests/baselines/reference/tsbuild/transitiveReferences/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js b/tests/baselines/reference/tsbuild/transitiveReferences/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js index a8eaca63553..58644187d90 100644 --- a/tests/baselines/reference/tsbuild/transitiveReferences/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js +++ b/tests/baselines/reference/tsbuild/transitiveReferences/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js @@ -85,7 +85,7 @@ exports.A = A; //// [/src/tsconfig.a.tsbuildinfo] -{"program":{"fileNames":["../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-8566332115-export class A {}\r\n"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-8566332115-export class A {}\r\n","signature":"-9529994156-export declare class A {\r\n}\r\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} //// [/src/tsconfig.a.tsbuildinfo.readable.baseline.txt] { @@ -102,7 +102,7 @@ exports.A = A; }, "./a.ts": { "version": "-8566332115-export class A {}\r\n", - "signature": "-8566332115-export class A {}\r\n" + "signature": "-9529994156-export declare class A {\r\n}\r\n" } }, "options": { @@ -116,7 +116,7 @@ exports.A = A; ] }, "version": "FakeTSVersion", - "size": 716 + "size": 788 } //// [/src/tsconfig.b.tsbuildinfo] diff --git a/tests/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js b/tests/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js index 62e75a21495..2b7648cb5a4 100644 --- a/tests/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js +++ b/tests/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js @@ -248,7 +248,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/demo/core/utilities.ts (used version) +/user/username/projects/demo/core/utilities.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/demo/animals/animal.ts","/user/username/projects/demo/animals/dog.ts","/user/username/projects/demo/animals/index.ts"] Program options: {"declaration":true,"target":1,"module":1,"strict":true,"noUnusedLocals":true,"noUnusedParameters":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"composite":true,"outDir":"/user/username/projects/demo/lib/animals","rootDir":"/user/username/projects/demo/animals","watch":true,"configFilePath":"/user/username/projects/demo/animals/tsconfig.json"} @@ -269,10 +269,10 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/demo/animals/animal.ts (used version) -/user/username/projects/demo/animals/index.ts (used version) +/user/username/projects/demo/animals/animal.ts (computed .d.ts during emit) +/user/username/projects/demo/animals/index.ts (computed .d.ts during emit) /user/username/projects/demo/lib/core/utilities.d.ts (used version) -/user/username/projects/demo/animals/dog.ts (used version) +/user/username/projects/demo/animals/dog.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/demo/zoo/zoo.ts"] Program options: {"declaration":true,"target":1,"module":1,"strict":true,"noUnusedLocals":true,"noUnusedParameters":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"composite":true,"outDir":"/user/username/projects/demo/lib/zoo","rootDir":"/user/username/projects/demo/zoo","watch":true,"configFilePath":"/user/username/projects/demo/zoo/tsconfig.json"} @@ -296,7 +296,7 @@ Shape signatures in builder refreshed for:: /user/username/projects/demo/lib/animals/animal.d.ts (used version) /user/username/projects/demo/lib/animals/dog.d.ts (used version) /user/username/projects/demo/lib/animals/index.d.ts (used version) -/user/username/projects/demo/zoo/zoo.ts (used version) +/user/username/projects/demo/zoo/zoo.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/demo/animals/tsconfig.json: @@ -354,7 +354,7 @@ export declare function lastElementOf(arr: T[]): T | undefined; //// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../core/utilities.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"25274411612-\r\nexport function makeRandomName() {\r\n return \"Bob!?! \";\r\n}\r\n\r\nexport function lastElementOf(arr: T[]): T | undefined {\r\n if (arr.length === 0) return undefined;\r\n return arr[arr.length - 1];\r\n}\r\n\r\n"],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../core","strict":true,"target":1},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../core/utilities.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"25274411612-\r\nexport function makeRandomName() {\r\n return \"Bob!?! \";\r\n}\r\n\r\nexport function lastElementOf(arr: T[]): T | undefined {\r\n if (arr.length === 0) return undefined;\r\n return arr[arr.length - 1];\r\n}\r\n\r\n","signature":"-11345568166-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n"}],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../core","strict":true,"target":1},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} //// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -371,7 +371,7 @@ export declare function lastElementOf(arr: T[]): T | undefined; }, "../../core/utilities.ts": { "version": "25274411612-\r\nexport function makeRandomName() {\r\n return \"Bob!?! \";\r\n}\r\n\r\nexport function lastElementOf(arr: T[]): T | undefined {\r\n if (arr.length === 0) return undefined;\r\n return arr[arr.length - 1];\r\n}\r\n\r\n", - "signature": "25274411612-\r\nexport function makeRandomName() {\r\n return \"Bob!?! \";\r\n}\r\n\r\nexport function lastElementOf(arr: T[]): T | undefined {\r\n if (arr.length === 0) return undefined;\r\n return arr[arr.length - 1];\r\n}\r\n\r\n" + "signature": "-11345568166-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n" } }, "options": { @@ -395,7 +395,7 @@ export declare function lastElementOf(arr: T[]): T | undefined; ] }, "version": "FakeTSVersion", - "size": 1160 + "size": 1319 } //// [/user/username/projects/demo/lib/animals/animal.js] @@ -452,7 +452,7 @@ export declare function createDog(): Dog; //// [/user/username/projects/demo/lib/animals/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../animals/animal.ts","../../animals/index.ts","../core/utilities.d.ts","../../animals/dog.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-14984181202-export type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n","-5382672599-import Animal from './animal';\r\n\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n","-11345568166-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n","-10991948013-import Animal from '.';\r\nimport { makeRandomName } from '../core/utilities';\r\n\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\n\r\nexport function createDog(): Dog {\r\n return ({\r\n size: \"medium\",\r\n woof: function(this: Dog) {\r\n console.log(`${this.name} says \"Woof\"!`);\r\n },\r\n name: makeRandomName()\r\n });\r\n}\r\n\r\n"],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../animals","strict":true,"target":1},"fileIdsList":[[3,4],[2,5]],"referencedMap":[[5,1],[3,2]],"exportedModulesMap":[[5,1],[3,2]],"semanticDiagnosticsPerFile":[1,2,5,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../animals/animal.ts","../../animals/index.ts","../core/utilities.d.ts","../../animals/dog.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-14984181202-export type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n","signature":"-10510161654-export declare type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n"},{"version":"-5382672599-import Animal from './animal';\r\n\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n","signature":"1096904574-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n"},"-11345568166-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n",{"version":"-10991948013-import Animal from '.';\r\nimport { makeRandomName } from '../core/utilities';\r\n\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\n\r\nexport function createDog(): Dog {\r\n return ({\r\n size: \"medium\",\r\n woof: function(this: Dog) {\r\n console.log(`${this.name} says \"Woof\"!`);\r\n },\r\n name: makeRandomName()\r\n });\r\n}\r\n\r\n","signature":"6032048049-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n"}],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../animals","strict":true,"target":1},"fileIdsList":[[3,4],[2,5],[3]],"referencedMap":[[5,1],[3,2]],"exportedModulesMap":[[5,3],[3,2]],"semanticDiagnosticsPerFile":[1,2,5,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/demo/lib/animals/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -472,6 +472,9 @@ export declare function createDog(): Dog; [ "../../animals/animal.ts", "../../animals/dog.ts" + ], + [ + "../../animals/index.ts" ] ], "fileInfos": { @@ -482,11 +485,11 @@ export declare function createDog(): Dog; }, "../../animals/animal.ts": { "version": "-14984181202-export type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n", - "signature": "-14984181202-export type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n" + "signature": "-10510161654-export declare type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n" }, "../../animals/index.ts": { "version": "-5382672599-import Animal from './animal';\r\n\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n", - "signature": "-5382672599-import Animal from './animal';\r\n\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n" + "signature": "1096904574-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n" }, "../core/utilities.d.ts": { "version": "-11345568166-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n", @@ -494,7 +497,7 @@ export declare function createDog(): Dog; }, "../../animals/dog.ts": { "version": "-10991948013-import Animal from '.';\r\nimport { makeRandomName } from '../core/utilities';\r\n\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\n\r\nexport function createDog(): Dog {\r\n return ({\r\n size: \"medium\",\r\n woof: function(this: Dog) {\r\n console.log(`${this.name} says \"Woof\"!`);\r\n },\r\n name: makeRandomName()\r\n });\r\n}\r\n\r\n", - "signature": "-10991948013-import Animal from '.';\r\nimport { makeRandomName } from '../core/utilities';\r\n\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\n\r\nexport function createDog(): Dog {\r\n return ({\r\n size: \"medium\",\r\n woof: function(this: Dog) {\r\n console.log(`${this.name} says \"Woof\"!`);\r\n },\r\n name: makeRandomName()\r\n });\r\n}\r\n\r\n" + "signature": "6032048049-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n" } }, "options": { @@ -522,8 +525,7 @@ export declare function createDog(): Dog; }, "exportedModulesMap": { "../../animals/dog.ts": [ - "../../animals/index.ts", - "../core/utilities.d.ts" + "../../animals/index.ts" ], "../../animals/index.ts": [ "../../animals/animal.ts", @@ -539,7 +541,7 @@ export declare function createDog(): Dog; ] }, "version": "FakeTSVersion", - "size": 1911 + "size": 2423 } //// [/user/username/projects/demo/lib/zoo/zoo.js] @@ -561,7 +563,7 @@ export declare function createZoo(): Array; //// [/user/username/projects/demo/lib/zoo/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../animals/animal.d.ts","../animals/dog.d.ts","../animals/index.d.ts","../../zoo/zoo.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-10510161654-export declare type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n","6032048049-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n","1096904574-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n","8797123924-import { Dog, createDog } from '../animals/index';\r\n\r\nexport function createZoo(): Array {\r\n return [\r\n createDog()\r\n ];\r\n}\r\n\r\n"],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../zoo","strict":true,"target":1},"fileIdsList":[[4],[2,3]],"referencedMap":[[3,1],[4,2],[5,1]],"exportedModulesMap":[[3,1],[4,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,3,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../animals/animal.d.ts","../animals/dog.d.ts","../animals/index.d.ts","../../zoo/zoo.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-10510161654-export declare type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n","6032048049-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n","1096904574-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n",{"version":"8797123924-import { Dog, createDog } from '../animals/index';\r\n\r\nexport function createZoo(): Array {\r\n return [\r\n createDog()\r\n ];\r\n}\r\n\r\n","signature":"10305066551-import { Dog } from '../animals/index';\nexport declare function createZoo(): Array;\n"}],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../zoo","strict":true,"target":1},"fileIdsList":[[4],[2,3]],"referencedMap":[[3,1],[4,2],[5,1]],"exportedModulesMap":[[3,1],[4,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,3,4,5]},"version":"FakeTSVersion"} //// [/user/username/projects/demo/lib/zoo/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -602,7 +604,7 @@ export declare function createZoo(): Array; }, "../../zoo/zoo.ts": { "version": "8797123924-import { Dog, createDog } from '../animals/index';\r\n\r\nexport function createZoo(): Array {\r\n return [\r\n createDog()\r\n ];\r\n}\r\n\r\n", - "signature": "8797123924-import { Dog, createDog } from '../animals/index';\r\n\r\nexport function createZoo(): Array {\r\n return [\r\n createDog()\r\n ];\r\n}\r\n\r\n" + "signature": "10305066551-import { Dog } from '../animals/index';\nexport declare function createZoo(): Array;\n" } }, "options": { @@ -651,6 +653,6 @@ export declare function createZoo(): Array; ] }, "version": "FakeTSVersion", - "size": 1653 + "size": 1783 } diff --git a/tests/baselines/reference/tsbuildWatch/moduleResolution/build-mode-watches-for-changes-to-package-json-main-fields.js b/tests/baselines/reference/tsbuildWatch/moduleResolution/build-mode-watches-for-changes-to-package-json-main-fields.js index ceff417c49b..3396771bc58 100644 --- a/tests/baselines/reference/tsbuildWatch/moduleResolution/build-mode-watches-for-changes-to-package-json-main-fields.js +++ b/tests/baselines/reference/tsbuildWatch/moduleResolution/build-mode-watches-for-changes-to-package-json-main-fields.js @@ -123,9 +123,9 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/packages/pkg2/const.ts (used version) -/user/username/projects/myproject/packages/pkg2/index.ts (used version) -/user/username/projects/myproject/packages/pkg2/other.ts (used version) +/user/username/projects/myproject/packages/pkg2/const.ts (computed .d.ts during emit) +/user/username/projects/myproject/packages/pkg2/index.ts (computed .d.ts during emit) +/user/username/projects/myproject/packages/pkg2/other.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/myproject/packages/pkg1/index.ts"] Program options: {"outDir":"/user/username/projects/myproject/packages/pkg1/build","watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/packages/pkg1/tsconfig.json"} @@ -202,7 +202,7 @@ export declare type TheStr = string; //// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../../a/lib/lib.d.ts","../const.ts","../index.ts","../other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-11202312776-export type TheNum = 42;","-11225381282-export type { TheNum } from './const.js';","-4609154030-export type TheStr = string;"],"options":{"composite":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../../a/lib/lib.d.ts","../const.ts","../index.ts","../other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-11202312776-export type TheNum = 42;","signature":"-9649133742-export declare type TheNum = 42;\n"},{"version":"-11225381282-export type { TheNum } from './const.js';","signature":"-9660329432-export type { TheNum } from './const.js';\n"},{"version":"-4609154030-export type TheStr = string;","signature":"-10420741908-export declare type TheStr = string;\n"}],"options":{"composite":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -226,15 +226,15 @@ export declare type TheStr = string; }, "../const.ts": { "version": "-11202312776-export type TheNum = 42;", - "signature": "-11202312776-export type TheNum = 42;" + "signature": "-9649133742-export declare type TheNum = 42;\n" }, "../index.ts": { "version": "-11225381282-export type { TheNum } from './const.js';", - "signature": "-11225381282-export type { TheNum } from './const.js';" + "signature": "-9660329432-export type { TheNum } from './const.js';\n" }, "../other.ts": { "version": "-4609154030-export type TheStr = string;", - "signature": "-4609154030-export type TheStr = string;" + "signature": "-10420741908-export declare type TheStr = string;\n" } }, "options": { @@ -259,7 +259,7 @@ export declare type TheStr = string; ] }, "version": "FakeTSVersion", - "size": 841 + "size": 1074 } //// [/user/username/projects/myproject/packages/pkg1/build/index.js] diff --git a/tests/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js b/tests/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js index 465f08c8b2d..07de3842a6f 100644 --- a/tests/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js +++ b/tests/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js @@ -118,8 +118,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.es2020.full.d.ts (used version) -/user/username/projects/myproject/packages/pkg2/const.cts (used version) -/user/username/projects/myproject/packages/pkg2/index.ts (used version) +/user/username/projects/myproject/packages/pkg2/const.cts (computed .d.ts during emit) +/user/username/projects/myproject/packages/pkg2/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/myproject/packages/pkg1/index.ts"] Program options: {"outDir":"/user/username/projects/myproject/packages/pkg1/build","module":100,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/packages/pkg1/tsconfig.json"} @@ -198,7 +198,7 @@ export type { TheNum } from './const.cjs'; //// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../../a/lib/lib.es2020.full.d.ts","../const.cts","../index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true,"impliedFormat":1},{"version":"-11202312776-export type TheNum = 42;","impliedFormat":1},{"version":"-9668872159-export type { TheNum } from './const.cjs';","impliedFormat":99}],"options":{"composite":true,"module":100,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../../a/lib/lib.es2020.full.d.ts","../const.cts","../index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true,"impliedFormat":1},{"version":"-11202312776-export type TheNum = 42;","signature":"-9649133742-export declare type TheNum = 42;\n","impliedFormat":1},{"version":"-9668872159-export type { TheNum } from './const.cjs';","signature":"-9835135925-export type { TheNum } from './const.cjs';\n","impliedFormat":99}],"options":{"composite":true,"module":100,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -222,12 +222,12 @@ export type { TheNum } from './const.cjs'; }, "../const.cts": { "version": "-11202312776-export type TheNum = 42;", - "signature": "-11202312776-export type TheNum = 42;", + "signature": "-9649133742-export declare type TheNum = 42;\n", "impliedFormat": 1 }, "../index.ts": { "version": "-9668872159-export type { TheNum } from './const.cjs';", - "signature": "-9668872159-export type { TheNum } from './const.cjs';", + "signature": "-9835135925-export type { TheNum } from './const.cjs';\n", "impliedFormat": 99 } }, @@ -253,7 +253,7 @@ export type { TheNum } from './const.cjs'; ] }, "version": "FakeTSVersion", - "size": 887 + "size": 1019 } //// [/user/username/projects/myproject/packages/pkg1/build/index.js] @@ -701,7 +701,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/packages/pkg2/build/const.cjs] file changed its modified time //// [/user/username/projects/myproject/packages/pkg2/build/const.d.cts] file changed its modified time //// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../../a/lib/lib.es2020.full.d.ts","../const.cts","../index.cts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true,"impliedFormat":1},{"version":"-11202312776-export type TheNum = 42;","impliedFormat":1},{"version":"-9668872159-export type { TheNum } from './const.cjs';","signature":"-9835135925-export type { TheNum } from './const.cjs';\n","impliedFormat":1}],"options":{"composite":true,"module":100,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../../a/lib/lib.es2020.full.d.ts","../const.cts","../index.cts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true,"impliedFormat":1},{"version":"-11202312776-export type TheNum = 42;","signature":"-9649133742-export declare type TheNum = 42;\n","impliedFormat":1},{"version":"-9668872159-export type { TheNum } from './const.cjs';","signature":"-9835135925-export type { TheNum } from './const.cjs';\n","impliedFormat":1}],"options":{"composite":true,"module":100,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -725,7 +725,7 @@ exitCode:: ExitStatus.undefined }, "../const.cts": { "version": "-11202312776-export type TheNum = 42;", - "signature": "-11202312776-export type TheNum = 42;", + "signature": "-9649133742-export declare type TheNum = 42;\n", "impliedFormat": 1 }, "../index.cts": { @@ -756,7 +756,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 958 + "size": 1019 } //// [/user/username/projects/myproject/packages/pkg2/build/index.cjs] diff --git a/tests/baselines/reference/tsbuildWatch/moduleResolutionCache/handles-the-cache-correctly-when-two-projects-use-different-module-resolution-settings.js b/tests/baselines/reference/tsbuildWatch/moduleResolutionCache/handles-the-cache-correctly-when-two-projects-use-different-module-resolution-settings.js index fca44bf5be1..9c07d419818 100644 --- a/tests/baselines/reference/tsbuildWatch/moduleResolutionCache/handles-the-cache-correctly-when-two-projects-use-different-module-resolution-settings.js +++ b/tests/baselines/reference/tsbuildWatch/moduleResolutionCache/handles-the-cache-correctly-when-two-projects-use-different-module-resolution-settings.js @@ -82,7 +82,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/myproject/project1/node_modules/file/index.d.ts (used version) -/user/username/projects/myproject/project1/index.ts (used version) +/user/username/projects/myproject/project1/index.ts (computed .d.ts during emit) /user/username/projects/myproject/node_modules/@types/foo/index.d.ts (used version) /user/username/projects/myproject/node_modules/@types/bar/index.d.ts (used version) @@ -104,7 +104,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/myproject/project2/file.d.ts (used version) -/user/username/projects/myproject/project2/index.ts (used version) +/user/username/projects/myproject/project2/index.ts (computed .d.ts during emit) /user/username/projects/myproject/node_modules/@types/foo/index.d.ts (used version) WatchedFiles:: @@ -144,7 +144,7 @@ export {}; //// [/user/username/projects/myproject/project1/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./node_modules/file/index.d.ts","./index.ts","../node_modules/@types/foo/index.d.ts","../node_modules/@types/bar/index.d.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-12737086933-export const foo = 10;","-4708082513-import { foo } from \"file\";","-12737086933-export const foo = 10;","-12042713060-export const bar = 10;"],"options":{"composite":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,5,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./node_modules/file/index.d.ts","./index.ts","../node_modules/@types/foo/index.d.ts","../node_modules/@types/bar/index.d.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-12737086933-export const foo = 10;",{"version":"-4708082513-import { foo } from \"file\";","signature":"-3531856636-export {};\n"},"-12737086933-export const foo = 10;","-12042713060-export const bar = 10;"],"options":{"composite":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,5,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/project1/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -173,7 +173,7 @@ export {}; }, "./index.ts": { "version": "-4708082513-import { foo } from \"file\";", - "signature": "-4708082513-import { foo } from \"file\";" + "signature": "-3531856636-export {};\n" }, "../node_modules/@types/foo/index.d.ts": { "version": "-12737086933-export const foo = 10;", @@ -192,11 +192,7 @@ export {}; "./node_modules/file/index.d.ts" ] }, - "exportedModulesMap": { - "./index.ts": [ - "./node_modules/file/index.d.ts" - ] - }, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../../../../../a/lib/lib.d.ts", "../node_modules/@types/bar/index.d.ts", @@ -206,7 +202,7 @@ export {}; ] }, "version": "FakeTSVersion", - "size": 925 + "size": 971 } //// [/user/username/projects/myproject/project2/index.js] @@ -219,7 +215,7 @@ export {}; //// [/user/username/projects/myproject/project2/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./file.d.ts","./index.ts","../node_modules/@types/foo/index.d.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-12737086933-export const foo = 10;","-4708082513-import { foo } from \"file\";","-12737086933-export const foo = 10;"],"options":{"composite":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,4,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./file.d.ts","./index.ts","../node_modules/@types/foo/index.d.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-12737086933-export const foo = 10;",{"version":"-4708082513-import { foo } from \"file\";","signature":"-3531856636-export {};\n"},"-12737086933-export const foo = 10;"],"options":{"composite":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,4,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/project2/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -247,7 +243,7 @@ export {}; }, "./index.ts": { "version": "-4708082513-import { foo } from \"file\";", - "signature": "-4708082513-import { foo } from \"file\";" + "signature": "-3531856636-export {};\n" }, "../node_modules/@types/foo/index.d.ts": { "version": "-12737086933-export const foo = 10;", @@ -262,11 +258,7 @@ export {}; "./file.d.ts" ] }, - "exportedModulesMap": { - "./index.ts": [ - "./file.d.ts" - ] - }, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../../../../../a/lib/lib.d.ts", "../node_modules/@types/foo/index.d.ts", @@ -275,7 +267,7 @@ export {}; ] }, "version": "FakeTSVersion", - "size": 826 + "size": 872 } diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/creates-solution-in-watch-mode.js b/tests/baselines/reference/tsbuildWatch/programUpdates/creates-solution-in-watch-mode.js index 68b8c770706..cdd4fcec999 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/creates-solution-in-watch-mode.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/creates-solution-in-watch-mode.js @@ -126,8 +126,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/sample1/core/anothermodule.ts (used version) -/user/username/projects/sample1/core/index.ts (used version) +/user/username/projects/sample1/core/anothermodule.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/sample1/logic/index.ts"] Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} @@ -148,7 +148,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/sample1/core/index.d.ts (used version) /user/username/projects/sample1/core/anothermodule.d.ts (used version) -/user/username/projects/sample1/logic/index.ts (used version) +/user/username/projects/sample1/logic/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/sample1/tests/index.ts"] Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} @@ -172,7 +172,7 @@ Shape signatures in builder refreshed for:: /user/username/projects/sample1/core/index.d.ts (used version) /user/username/projects/sample1/core/anothermodule.d.ts (used version) /user/username/projects/sample1/logic/index.d.ts (used version) -/user/username/projects/sample1/tests/index.ts (used version) +/user/username/projects/sample1/tests/index.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -235,7 +235,7 @@ export declare function multiply(a: number, b: number): number; //# sourceMappingURL=index.d.ts.map //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n"],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -253,11 +253,11 @@ export declare function multiply(a: number, b: number): number; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" } }, "options": { @@ -275,7 +275,7 @@ export declare function multiply(a: number, b: number): number; ] }, "version": "FakeTSVersion", - "size": 964 + "size": 1254 } //// [/user/username/projects/sample1/logic/index.js.map] @@ -301,7 +301,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -316,6 +316,9 @@ export declare const m: typeof mod; [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -334,7 +337,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" } }, "options": { @@ -351,7 +354,6 @@ export declare const m: typeof mod; }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -363,7 +365,7 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1293 + "size": 1472 } //// [/user/username/projects/sample1/tests/index.js] @@ -384,7 +386,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -426,7 +428,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" } }, "options": { @@ -449,9 +451,7 @@ export declare const m: typeof mod; "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -463,6 +463,6 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1495 + "size": 1617 } diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/incremental-updates-in-verbose-mode.js b/tests/baselines/reference/tsbuildWatch/programUpdates/incremental-updates-in-verbose-mode.js index 86b26975fc3..643d73446c3 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/incremental-updates-in-verbose-mode.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/incremental-updates-in-verbose-mode.js @@ -143,8 +143,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/sample1/core/anothermodule.ts (used version) -/user/username/projects/sample1/core/index.ts (used version) +/user/username/projects/sample1/core/anothermodule.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/sample1/logic/index.ts"] Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} @@ -165,7 +165,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/sample1/core/index.d.ts (used version) /user/username/projects/sample1/core/anothermodule.d.ts (used version) -/user/username/projects/sample1/logic/index.ts (used version) +/user/username/projects/sample1/logic/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/sample1/tests/index.ts"] Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} @@ -189,7 +189,7 @@ Shape signatures in builder refreshed for:: /user/username/projects/sample1/core/index.d.ts (used version) /user/username/projects/sample1/core/anothermodule.d.ts (used version) /user/username/projects/sample1/logic/index.d.ts (used version) -/user/username/projects/sample1/tests/index.ts (used version) +/user/username/projects/sample1/tests/index.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -252,7 +252,7 @@ export declare function multiply(a: number, b: number): number; //# sourceMappingURL=index.d.ts.map //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n"],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -270,11 +270,11 @@ export declare function multiply(a: number, b: number): number; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" } }, "options": { @@ -292,7 +292,7 @@ export declare function multiply(a: number, b: number): number; ] }, "version": "FakeTSVersion", - "size": 964 + "size": 1254 } //// [/user/username/projects/sample1/logic/index.js.map] @@ -318,7 +318,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -333,6 +333,9 @@ export declare const m: typeof mod; [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -351,7 +354,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" } }, "options": { @@ -368,7 +371,6 @@ export declare const m: typeof mod; }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -380,7 +382,7 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1293 + "size": 1472 } //// [/user/username/projects/sample1/tests/index.js] @@ -401,7 +403,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -443,7 +445,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" } }, "options": { @@ -466,9 +468,7 @@ export declare const m: typeof mod; "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -480,7 +480,7 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1495 + "size": 1617 } diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-file-with-no-error-changes.js b/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-file-with-no-error-changes.js index f70fee5d459..8c730f537d2 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-file-with-no-error-changes.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-file-with-no-error-changes.js @@ -49,8 +49,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/solution/app/filewitherror.ts (used version) -/user/username/projects/solution/app/filewithouterror.ts (used version) +/user/username/projects/solution/app/filewitherror.ts (computed .d.ts during emit) +/user/username/projects/solution/app/filewithouterror.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/solution/app/tsconfig.json: @@ -106,7 +106,7 @@ export declare class myClass { //// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./filewitherror.ts","./filewithouterror.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-8106435186-export var myClassWithError = class {\n tags() { }\n \n };","-11785903855-export class myClass { }"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./filewitherror.ts","./filewithouterror.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-8106435186-export var myClassWithError = class {\n tags() { }\n \n };","signature":"6892461904-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n"},{"version":"-11785903855-export class myClass { }","signature":"-7432826827-export declare class myClass {\n}\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/solution/app/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -124,11 +124,11 @@ export declare class myClass { }, "./filewitherror.ts": { "version": "-8106435186-export var myClassWithError = class {\n tags() { }\n \n };", - "signature": "-8106435186-export var myClassWithError = class {\n tags() { }\n \n };" + "signature": "6892461904-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n" }, "./filewithouterror.ts": { "version": "-11785903855-export class myClass { }", - "signature": "-11785903855-export class myClass { }" + "signature": "-7432826827-export declare class myClass {\n}\n" } }, "options": { @@ -143,7 +143,7 @@ export declare class myClass { ] }, "version": "FakeTSVersion", - "size": 782 + "size": 984 } diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-fixing-errors-only-changed-file-is-emitted.js b/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-fixing-errors-only-changed-file-is-emitted.js index b12349bed94..5995d27a3dd 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-fixing-errors-only-changed-file-is-emitted.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/declarationEmitErrors/introduceError/when-fixing-errors-only-changed-file-is-emitted.js @@ -49,8 +49,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/solution/app/filewitherror.ts (used version) -/user/username/projects/solution/app/filewithouterror.ts (used version) +/user/username/projects/solution/app/filewitherror.ts (computed .d.ts during emit) +/user/username/projects/solution/app/filewithouterror.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/solution/app/tsconfig.json: @@ -106,7 +106,7 @@ export declare class myClass { //// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./filewitherror.ts","./filewithouterror.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-8106435186-export var myClassWithError = class {\n tags() { }\n \n };","-11785903855-export class myClass { }"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./filewitherror.ts","./filewithouterror.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-8106435186-export var myClassWithError = class {\n tags() { }\n \n };","signature":"6892461904-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n"},{"version":"-11785903855-export class myClass { }","signature":"-7432826827-export declare class myClass {\n}\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/solution/app/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -124,11 +124,11 @@ export declare class myClass { }, "./filewitherror.ts": { "version": "-8106435186-export var myClassWithError = class {\n tags() { }\n \n };", - "signature": "-8106435186-export var myClassWithError = class {\n tags() { }\n \n };" + "signature": "6892461904-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n" }, "./filewithouterror.ts": { "version": "-11785903855-export class myClass { }", - "signature": "-11785903855-export class myClass { }" + "signature": "-7432826827-export declare class myClass {\n}\n" } }, "options": { @@ -143,7 +143,7 @@ export declare class myClass { ] }, "version": "FakeTSVersion", - "size": 782 + "size": 984 } @@ -253,44 +253,5 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/solution/app/fileWithError.d.ts] file written with same contents //// [/user/username/projects/solution/app/fileWithoutError.js] file changed its modified time //// [/user/username/projects/solution/app/fileWithoutError.d.ts] file changed its modified time -//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./filewitherror.ts","./filewithouterror.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-8106435186-export var myClassWithError = class {\n tags() { }\n \n };","signature":"6892461904-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n"},"-11785903855-export class myClass { }"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} - -//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "program": { - "fileNames": [ - "../../../../../a/lib/lib.d.ts", - "./filewitherror.ts", - "./filewithouterror.ts" - ], - "fileInfos": { - "../../../../../a/lib/lib.d.ts": { - "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "affectsGlobalScope": true - }, - "./filewitherror.ts": { - "version": "-8106435186-export var myClassWithError = class {\n tags() { }\n \n };", - "signature": "6892461904-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n" - }, - "./filewithouterror.ts": { - "version": "-11785903855-export class myClass { }", - "signature": "-11785903855-export class myClass { }" - } - }, - "options": { - "composite": true - }, - "referencedMap": {}, - "exportedModulesMap": {}, - "semanticDiagnosticsPerFile": [ - "../../../../../a/lib/lib.d.ts", - "./filewitherror.ts", - "./filewithouterror.ts" - ] - }, - "version": "FakeTSVersion", - "size": 910 -} - +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] file written with same contents +//// [/user/username/projects/solution/app/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/declarationEmitErrors/when-file-with-no-error-changes.js b/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/declarationEmitErrors/when-file-with-no-error-changes.js index fc29f8536a4..4015ea58164 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/declarationEmitErrors/when-file-with-no-error-changes.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/declarationEmitErrors/when-file-with-no-error-changes.js @@ -55,7 +55,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/solution/app/filewitherror.ts (used version) -/user/username/projects/solution/app/filewithouterror.ts (used version) +/user/username/projects/solution/app/filewithouterror.ts (computed .d.ts) WatchedFiles:: /user/username/projects/solution/app/tsconfig.json: diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/declarationEmitErrors/when-fixing-error-files-all-files-are-emitted.js b/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/declarationEmitErrors/when-fixing-error-files-all-files-are-emitted.js index 420053ce275..c019a99ee91 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/declarationEmitErrors/when-fixing-error-files-all-files-are-emitted.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/declarationEmitErrors/when-fixing-error-files-all-files-are-emitted.js @@ -55,7 +55,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/solution/app/filewitherror.ts (used version) -/user/username/projects/solution/app/filewithouterror.ts (used version) +/user/username/projects/solution/app/filewithouterror.ts (computed .d.ts) WatchedFiles:: /user/username/projects/solution/app/tsconfig.json: @@ -160,7 +160,7 @@ export declare class myClass { //// [/user/username/projects/solution/app/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./filewitherror.ts","./filewithouterror.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-8106435186-export var myClassWithError = class {\n tags() { }\n \n };","signature":"6892461904-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n"},"-11785903855-export class myClass { }"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./filewitherror.ts","./filewithouterror.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-8106435186-export var myClassWithError = class {\n tags() { }\n \n };","signature":"6892461904-export declare var myClassWithError: {\n new (): {\n tags(): void;\n };\n};\n"},{"version":"-11785903855-export class myClass { }","signature":"-7432826827-export declare class myClass {\n}\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/solution/app/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -182,7 +182,7 @@ export declare class myClass { }, "./filewithouterror.ts": { "version": "-11785903855-export class myClass { }", - "signature": "-11785903855-export class myClass { }" + "signature": "-7432826827-export declare class myClass {\n}\n" } }, "options": { @@ -197,6 +197,6 @@ export declare class myClass { ] }, "version": "FakeTSVersion", - "size": 910 + "size": 984 } diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-preserveWatchOutput-is-not-used.js b/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-preserveWatchOutput-is-not-used.js index 90e048179dd..a8153212b39 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-preserveWatchOutput-is-not-used.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-preserveWatchOutput-is-not-used.js @@ -126,8 +126,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/sample1/core/anothermodule.ts (used version) -/user/username/projects/sample1/core/index.ts (used version) +/user/username/projects/sample1/core/anothermodule.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/sample1/logic/index.ts"] Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} @@ -148,7 +148,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/sample1/core/index.d.ts (used version) /user/username/projects/sample1/core/anothermodule.d.ts (used version) -/user/username/projects/sample1/logic/index.ts (used version) +/user/username/projects/sample1/logic/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/sample1/tests/index.ts"] Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} @@ -172,7 +172,7 @@ Shape signatures in builder refreshed for:: /user/username/projects/sample1/core/index.d.ts (used version) /user/username/projects/sample1/core/anothermodule.d.ts (used version) /user/username/projects/sample1/logic/index.d.ts (used version) -/user/username/projects/sample1/tests/index.ts (used version) +/user/username/projects/sample1/tests/index.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -235,7 +235,7 @@ export declare function multiply(a: number, b: number): number; //# sourceMappingURL=index.d.ts.map //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n"],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -253,11 +253,11 @@ export declare function multiply(a: number, b: number): number; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" } }, "options": { @@ -275,7 +275,7 @@ export declare function multiply(a: number, b: number): number; ] }, "version": "FakeTSVersion", - "size": 964 + "size": 1254 } //// [/user/username/projects/sample1/logic/index.js.map] @@ -301,7 +301,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -316,6 +316,9 @@ export declare const m: typeof mod; [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -334,7 +337,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" } }, "options": { @@ -351,7 +354,6 @@ export declare const m: typeof mod; }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -363,7 +365,7 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1293 + "size": 1472 } //// [/user/username/projects/sample1/tests/index.js] @@ -384,7 +386,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -426,7 +428,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" } }, "options": { @@ -449,9 +451,7 @@ export declare const m: typeof mod; "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -463,7 +463,7 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1495 + "size": 1617 } @@ -692,7 +692,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n",{"version":"-17094159457-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nlet x: string = 10;","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,[3,[{"file":"./index.ts","start":186,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]]],"affectedFilesPendingEmit":[[3,1]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-17094159457-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nlet x: string = 10;","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,[3,[{"file":"./index.ts","start":186,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]]],"affectedFilesPendingEmit":[[3,1]]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -710,7 +710,7 @@ exitCode:: ExitStatus.undefined }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-17094159457-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nlet x: string = 10;", @@ -750,6 +750,6 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1370 + "size": 1450 } diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-preserveWatchOutput-is-passed-on-command-line.js b/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-preserveWatchOutput-is-passed-on-command-line.js index 8dafd22d581..eb6b300a47b 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-preserveWatchOutput-is-passed-on-command-line.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/reportErrors/when-preserveWatchOutput-is-passed-on-command-line.js @@ -125,8 +125,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/sample1/core/anothermodule.ts (used version) -/user/username/projects/sample1/core/index.ts (used version) +/user/username/projects/sample1/core/anothermodule.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/sample1/logic/index.ts"] Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"preserveWatchOutput":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} @@ -147,7 +147,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/sample1/core/index.d.ts (used version) /user/username/projects/sample1/core/anothermodule.d.ts (used version) -/user/username/projects/sample1/logic/index.ts (used version) +/user/username/projects/sample1/logic/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/sample1/tests/index.ts"] Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"preserveWatchOutput":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} @@ -171,7 +171,7 @@ Shape signatures in builder refreshed for:: /user/username/projects/sample1/core/index.d.ts (used version) /user/username/projects/sample1/core/anothermodule.d.ts (used version) /user/username/projects/sample1/logic/index.d.ts (used version) -/user/username/projects/sample1/tests/index.ts (used version) +/user/username/projects/sample1/tests/index.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -234,7 +234,7 @@ export declare function multiply(a: number, b: number): number; //# sourceMappingURL=index.d.ts.map //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n"],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -252,11 +252,11 @@ export declare function multiply(a: number, b: number): number; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" } }, "options": { @@ -274,7 +274,7 @@ export declare function multiply(a: number, b: number): number; ] }, "version": "FakeTSVersion", - "size": 964 + "size": 1254 } //// [/user/username/projects/sample1/logic/index.js.map] @@ -300,7 +300,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -315,6 +315,9 @@ export declare const m: typeof mod; [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -333,7 +336,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" } }, "options": { @@ -350,7 +353,6 @@ export declare const m: typeof mod; }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -362,7 +364,7 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1293 + "size": 1472 } //// [/user/username/projects/sample1/tests/index.js] @@ -383,7 +385,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -425,7 +427,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" } }, "options": { @@ -448,9 +450,7 @@ export declare const m: typeof mod; "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -462,7 +462,7 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1495 + "size": 1617 } @@ -689,7 +689,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n",{"version":"-17094159457-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nlet x: string = 10;","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,[3,[{"file":"./index.ts","start":186,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]]],"affectedFilesPendingEmit":[[3,1]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-17094159457-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nlet x: string = 10;","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,[3,[{"file":"./index.ts","start":186,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]]],"affectedFilesPendingEmit":[[3,1]]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -707,7 +707,7 @@ exitCode:: ExitStatus.undefined }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-17094159457-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nlet x: string = 10;", @@ -747,6 +747,6 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1370 + "size": 1450 } diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit-with-outDir-specified.js b/tests/baselines/reference/tsbuildWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit-with-outDir-specified.js index d2637c2a767..7a9b4eeb19a 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit-with-outDir-specified.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit-with-outDir-specified.js @@ -57,8 +57,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/sample1/core/anothermodule.ts (used version) -/user/username/projects/sample1/core/index.ts (used version) +/user/username/projects/sample1/core/anothermodule.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/index.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -105,7 +105,7 @@ export declare function multiply(a: number, b: number): number; //// [/user/username/projects/sample1/core/outDir/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../anothermodule.ts","../index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n"],"options":{"composite":true,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../anothermodule.ts","../index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/outDir/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -123,11 +123,11 @@ export declare function multiply(a: number, b: number): number; }, "../anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "../index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" } }, "options": { @@ -143,7 +143,7 @@ export declare function multiply(a: number, b: number): number; ] }, "version": "FakeTSVersion", - "size": 915 + "size": 1205 } @@ -229,7 +229,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/sample1/core/outDir/index.js] file changed its modified time //// [/user/username/projects/sample1/core/outDir/index.d.ts] file changed its modified time //// [/user/username/projects/sample1/core/outDir/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../anothermodule.ts","../file3.ts","../index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n",{"version":"-13729955264-export const y = 10;","signature":"-7152472870-export declare const y = 10;\n"},"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n"],"options":{"composite":true,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../anothermodule.ts","../file3.ts","../index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-13729955264-export const y = 10;","signature":"-7152472870-export declare const y = 10;\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/outDir/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -248,7 +248,7 @@ exitCode:: ExitStatus.undefined }, "../anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "../file3.ts": { "version": "-13729955264-export const y = 10;", @@ -256,7 +256,7 @@ exitCode:: ExitStatus.undefined }, "../index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" } }, "options": { @@ -273,7 +273,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1036 + "size": 1326 } //// [/user/username/projects/sample1/core/outDir/file3.js] diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit.js b/tests/baselines/reference/tsbuildWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit.js index 2d0701aa9eb..c81779a1252 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit.js @@ -64,8 +64,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/sample1/core/anothermodule.ts (used version) -/user/username/projects/sample1/core/index.ts (used version) +/user/username/projects/sample1/core/anothermodule.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/index.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -118,7 +118,7 @@ export declare function multiply(a: number, b: number): number; //# sourceMappingURL=index.d.ts.map //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n"],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -136,11 +136,11 @@ export declare function multiply(a: number, b: number): number; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" } }, "options": { @@ -158,7 +158,7 @@ export declare function multiply(a: number, b: number): number; ] }, "version": "FakeTSVersion", - "size": 964 + "size": 1254 } @@ -246,7 +246,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/sample1/core/index.d.ts.map] file changed its modified time //// [/user/username/projects/sample1/core/index.d.ts] file changed its modified time //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./file3.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n",{"version":"-13729955264-export const y = 10;","signature":"-7152472870-export declare const y = 10;\n"},"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n"],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./file3.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-13729955264-export const y = 10;","signature":"-7152472870-export declare const y = 10;\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -265,7 +265,7 @@ exitCode:: ExitStatus.undefined }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./file3.ts": { "version": "-13729955264-export const y = 10;", @@ -273,7 +273,7 @@ exitCode:: ExitStatus.undefined }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" } }, "options": { @@ -292,7 +292,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1084 + "size": 1374 } //// [/user/username/projects/sample1/core/file3.js] diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/verify-building-references-watches-only-those-projects.js b/tests/baselines/reference/tsbuildWatch/programUpdates/verify-building-references-watches-only-those-projects.js index 2400cdfd5cd..caef5fcf161 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/verify-building-references-watches-only-those-projects.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/verify-building-references-watches-only-those-projects.js @@ -126,8 +126,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/sample1/core/anothermodule.ts (used version) -/user/username/projects/sample1/core/index.ts (used version) +/user/username/projects/sample1/core/anothermodule.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/sample1/logic/index.ts"] Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} @@ -148,7 +148,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/sample1/core/index.d.ts (used version) /user/username/projects/sample1/core/anothermodule.d.ts (used version) -/user/username/projects/sample1/logic/index.ts (used version) +/user/username/projects/sample1/logic/index.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -207,7 +207,7 @@ export declare function multiply(a: number, b: number): number; //# sourceMappingURL=index.d.ts.map //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n"],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -225,11 +225,11 @@ export declare function multiply(a: number, b: number): number; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" } }, "options": { @@ -247,7 +247,7 @@ export declare function multiply(a: number, b: number): number; ] }, "version": "FakeTSVersion", - "size": 964 + "size": 1254 } //// [/user/username/projects/sample1/logic/index.js.map] @@ -273,7 +273,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -288,6 +288,9 @@ export declare const m: typeof mod; [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -306,7 +309,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" } }, "options": { @@ -323,7 +326,6 @@ export declare const m: typeof mod; }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -335,6 +337,6 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1293 + "size": 1472 } diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/watches-config-files-that-are-not-present.js b/tests/baselines/reference/tsbuildWatch/programUpdates/watches-config-files-that-are-not-present.js index c4f0f7c44da..a9713a13209 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/watches-config-files-that-are-not-present.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/watches-config-files-that-are-not-present.js @@ -94,8 +94,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/sample1/core/anothermodule.ts (used version) -/user/username/projects/sample1/core/index.ts (used version) +/user/username/projects/sample1/core/anothermodule.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/index.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -154,7 +154,7 @@ export declare function multiply(a: number, b: number): number; //# sourceMappingURL=index.d.ts.map //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n"],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -172,11 +172,11 @@ export declare function multiply(a: number, b: number): number; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" } }, "options": { @@ -194,7 +194,7 @@ export declare function multiply(a: number, b: number): number; ] }, "version": "FakeTSVersion", - "size": 964 + "size": 1254 } @@ -242,7 +242,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/sample1/core/index.d.ts (used version) /user/username/projects/sample1/core/anothermodule.d.ts (used version) -/user/username/projects/sample1/logic/index.ts (used version) +/user/username/projects/sample1/logic/index.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -293,7 +293,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -308,6 +308,9 @@ export declare const m: typeof mod; [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -326,7 +329,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" } }, "options": { @@ -343,7 +346,6 @@ export declare const m: typeof mod; }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -355,7 +357,7 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1293 + "size": 1472 } @@ -390,7 +392,7 @@ Shape signatures in builder refreshed for:: /user/username/projects/sample1/core/index.d.ts (used version) /user/username/projects/sample1/core/anothermodule.d.ts (used version) /user/username/projects/sample1/logic/index.d.ts (used version) -/user/username/projects/sample1/tests/index.ts (used version) +/user/username/projects/sample1/tests/index.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -436,7 +438,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -478,7 +480,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" } }, "options": { @@ -501,9 +503,7 @@ export declare const m: typeof mod; "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -515,6 +515,6 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1495 + "size": 1617 } diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js b/tests/baselines/reference/tsbuildWatch/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js index 3f01c3bbc16..bc3d7d649a1 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js @@ -59,7 +59,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/sample1/library/library.ts (used version) +/user/username/projects/sample1/library/library.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/sample1/App/app.ts"] Program options: {"watch":true,"configFilePath":"/user/username/projects/sample1/App/tsconfig.json"} @@ -120,7 +120,7 @@ export {}; //// [/user/username/projects/sample1/Library/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./library.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"5256469508-\ninterface SomeObject\n{\n message: string;\n}\n\nexport function createSomeObject(): SomeObject\n{\n return {\n message: \"new Object\"\n };\n}"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./library.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"5256469508-\ninterface SomeObject\n{\n message: string;\n}\n\nexport function createSomeObject(): SomeObject\n{\n return {\n message: \"new Object\"\n };\n}","signature":"-18933614215-interface SomeObject {\n message: string;\n}\nexport declare function createSomeObject(): SomeObject;\nexport {};\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/Library/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -137,7 +137,7 @@ export {}; }, "./library.ts": { "version": "5256469508-\ninterface SomeObject\n{\n message: string;\n}\n\nexport function createSomeObject(): SomeObject\n{\n return {\n message: \"new Object\"\n };\n}", - "signature": "5256469508-\ninterface SomeObject\n{\n message: string;\n}\n\nexport function createSomeObject(): SomeObject\n{\n return {\n message: \"new Object\"\n };\n}" + "signature": "-18933614215-interface SomeObject {\n message: string;\n}\nexport declare function createSomeObject(): SomeObject;\nexport {};\n" } }, "options": { @@ -151,7 +151,7 @@ export {}; ] }, "version": "FakeTSVersion", - "size": 795 + "size": 953 } //// [/user/username/projects/sample1/App/app.js] diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/with-circular-project-reference/builds-when-new-file-is-added,-and-its-subsequent-updates.js b/tests/baselines/reference/tsbuildWatch/programUpdates/with-circular-project-reference/builds-when-new-file-is-added,-and-its-subsequent-updates.js index 30fe91bdc9b..47c6be2b396 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/with-circular-project-reference/builds-when-new-file-is-added,-and-its-subsequent-updates.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/with-circular-project-reference/builds-when-new-file-is-added,-and-its-subsequent-updates.js @@ -100,8 +100,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/sample1/core/anothermodule.ts (used version) -/user/username/projects/sample1/core/index.ts (used version) +/user/username/projects/sample1/core/anothermodule.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/sample1/logic/index.ts"] Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} @@ -122,7 +122,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/sample1/core/index.d.ts (used version) /user/username/projects/sample1/core/anothermodule.d.ts (used version) -/user/username/projects/sample1/logic/index.ts (used version) +/user/username/projects/sample1/logic/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/sample1/tests/index.ts"] Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} @@ -146,7 +146,7 @@ Shape signatures in builder refreshed for:: /user/username/projects/sample1/core/index.d.ts (used version) /user/username/projects/sample1/core/anothermodule.d.ts (used version) /user/username/projects/sample1/logic/index.d.ts (used version) -/user/username/projects/sample1/tests/index.ts (used version) +/user/username/projects/sample1/tests/index.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -203,7 +203,7 @@ export declare function multiply(a: number, b: number): number; //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n"],"options":{"composite":true,"declaration":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -221,11 +221,11 @@ export declare function multiply(a: number, b: number): number; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" } }, "options": { @@ -241,7 +241,7 @@ export declare function multiply(a: number, b: number): number; ] }, "version": "FakeTSVersion", - "size": 915 + "size": 1205 } //// [/user/username/projects/sample1/logic/index.js.map] @@ -267,7 +267,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -282,6 +282,9 @@ export declare const m: typeof mod; [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -300,7 +303,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" } }, "options": { @@ -317,7 +320,6 @@ export declare const m: typeof mod; }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -329,7 +331,7 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1215 + "size": 1394 } //// [/user/username/projects/sample1/tests/index.js] @@ -350,7 +352,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -392,7 +394,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" } }, "options": { @@ -415,9 +417,7 @@ export declare const m: typeof mod; "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -429,7 +429,7 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1417 + "size": 1539 } @@ -494,7 +494,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/sample1/core/index.js] file changed its modified time //// [/user/username/projects/sample1/core/index.d.ts] file changed its modified time //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./newfile.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-16320201030-export const newFileConst = 30;","signature":"-22941483372-export declare const newFileConst = 30;\n"}],"options":{"composite":true,"declaration":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./newfile.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-16320201030-export const newFileConst = 30;","signature":"-22941483372-export declare const newFileConst = 30;\n"}],"options":{"composite":true,"declaration":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -513,11 +513,11 @@ exitCode:: ExitStatus.undefined }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" }, "./newfile.ts": { "version": "-16320201030-export const newFileConst = 30;", @@ -538,7 +538,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1060 + "size": 1350 } //// [/user/username/projects/sample1/core/newfile.js] @@ -722,7 +722,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/sample1/core/index.js] file changed its modified time //// [/user/username/projects/sample1/core/index.d.ts] file changed its modified time //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./newfile.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-9703836816-export const newFileConst = 30;\nexport class someClass2 { }","signature":"-12384508924-export declare const newFileConst = 30;\nexport declare class someClass2 {\n}\n"}],"options":{"composite":true,"declaration":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./newfile.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-9703836816-export const newFileConst = 30;\nexport class someClass2 { }","signature":"-12384508924-export declare const newFileConst = 30;\nexport declare class someClass2 {\n}\n"}],"options":{"composite":true,"declaration":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -741,11 +741,11 @@ exitCode:: ExitStatus.undefined }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" }, "./newfile.ts": { "version": "-9703836816-export const newFileConst = 30;\nexport class someClass2 { }", @@ -766,7 +766,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1126 + "size": 1416 } //// [/user/username/projects/sample1/core/newfile.js] diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/with-circular-project-reference/change-builds-changes-and-reports-found-errors-message.js b/tests/baselines/reference/tsbuildWatch/programUpdates/with-circular-project-reference/change-builds-changes-and-reports-found-errors-message.js index 572630b21e7..c75488ba556 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/with-circular-project-reference/change-builds-changes-and-reports-found-errors-message.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/with-circular-project-reference/change-builds-changes-and-reports-found-errors-message.js @@ -100,8 +100,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/sample1/core/anothermodule.ts (used version) -/user/username/projects/sample1/core/index.ts (used version) +/user/username/projects/sample1/core/anothermodule.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/sample1/logic/index.ts"] Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} @@ -122,7 +122,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/sample1/core/index.d.ts (used version) /user/username/projects/sample1/core/anothermodule.d.ts (used version) -/user/username/projects/sample1/logic/index.ts (used version) +/user/username/projects/sample1/logic/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/sample1/tests/index.ts"] Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} @@ -146,7 +146,7 @@ Shape signatures in builder refreshed for:: /user/username/projects/sample1/core/index.d.ts (used version) /user/username/projects/sample1/core/anothermodule.d.ts (used version) /user/username/projects/sample1/logic/index.d.ts (used version) -/user/username/projects/sample1/tests/index.ts (used version) +/user/username/projects/sample1/tests/index.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -203,7 +203,7 @@ export declare function multiply(a: number, b: number): number; //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n"],"options":{"composite":true,"declaration":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -221,11 +221,11 @@ export declare function multiply(a: number, b: number): number; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" } }, "options": { @@ -241,7 +241,7 @@ export declare function multiply(a: number, b: number): number; ] }, "version": "FakeTSVersion", - "size": 915 + "size": 1205 } //// [/user/username/projects/sample1/logic/index.js.map] @@ -267,7 +267,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -282,6 +282,9 @@ export declare const m: typeof mod; [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -300,7 +303,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" } }, "options": { @@ -317,7 +320,6 @@ export declare const m: typeof mod; }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -329,7 +331,7 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1215 + "size": 1394 } //// [/user/username/projects/sample1/tests/index.js] @@ -350,7 +352,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -392,7 +394,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" } }, "options": { @@ -415,9 +417,7 @@ export declare const m: typeof mod; "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -429,7 +429,7 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1417 + "size": 1539 } @@ -518,7 +518,7 @@ export declare class someClass { //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n",{"version":"-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }","signature":"-2489663677-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n"}],"options":{"composite":true,"declaration":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }","signature":"-2489663677-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n"}],"options":{"composite":true,"declaration":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -536,7 +536,7 @@ export declare class someClass { }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }", @@ -556,7 +556,7 @@ export declare class someClass { ] }, "version": "FakeTSVersion", - "size": 1190 + "size": 1270 } @@ -894,7 +894,7 @@ export declare function multiply(a: number, b: number): number; //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n",{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -912,7 +912,7 @@ export declare function multiply(a: number, b: number): number; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", @@ -932,7 +932,7 @@ export declare function multiply(a: number, b: number): number; ] }, "version": "FakeTSVersion", - "size": 1125 + "size": 1205 } @@ -1288,7 +1288,7 @@ export declare class someClass2 { //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n",{"version":"-8266060440-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nexport class someClass2 { }","signature":"-1938481101-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\nexport declare class someClass2 {\n}\n"}],"options":{"composite":true,"declaration":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-8266060440-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nexport class someClass2 { }","signature":"-1938481101-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\nexport declare class someClass2 {\n}\n"}],"options":{"composite":true,"declaration":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1306,7 +1306,7 @@ export declare class someClass2 { }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-8266060440-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nexport class someClass2 { }", @@ -1326,7 +1326,7 @@ export declare class someClass2 { ] }, "version": "FakeTSVersion", - "size": 1256 + "size": 1336 } diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/with-circular-project-reference/non-local-change-does-not-start-build-of-referencing-projects.js b/tests/baselines/reference/tsbuildWatch/programUpdates/with-circular-project-reference/non-local-change-does-not-start-build-of-referencing-projects.js index faf36160c57..3d6e66045df 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/with-circular-project-reference/non-local-change-does-not-start-build-of-referencing-projects.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/with-circular-project-reference/non-local-change-does-not-start-build-of-referencing-projects.js @@ -100,8 +100,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/sample1/core/anothermodule.ts (used version) -/user/username/projects/sample1/core/index.ts (used version) +/user/username/projects/sample1/core/anothermodule.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/sample1/logic/index.ts"] Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} @@ -122,7 +122,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/sample1/core/index.d.ts (used version) /user/username/projects/sample1/core/anothermodule.d.ts (used version) -/user/username/projects/sample1/logic/index.ts (used version) +/user/username/projects/sample1/logic/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/sample1/tests/index.ts"] Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} @@ -146,7 +146,7 @@ Shape signatures in builder refreshed for:: /user/username/projects/sample1/core/index.d.ts (used version) /user/username/projects/sample1/core/anothermodule.d.ts (used version) /user/username/projects/sample1/logic/index.d.ts (used version) -/user/username/projects/sample1/tests/index.ts (used version) +/user/username/projects/sample1/tests/index.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -203,7 +203,7 @@ export declare function multiply(a: number, b: number): number; //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n"],"options":{"composite":true,"declaration":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -221,11 +221,11 @@ export declare function multiply(a: number, b: number): number; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" } }, "options": { @@ -241,7 +241,7 @@ export declare function multiply(a: number, b: number): number; ] }, "version": "FakeTSVersion", - "size": 915 + "size": 1205 } //// [/user/username/projects/sample1/logic/index.js.map] @@ -267,7 +267,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -282,6 +282,9 @@ export declare const m: typeof mod; [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -300,7 +303,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" } }, "options": { @@ -317,7 +320,6 @@ export declare const m: typeof mod; }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -329,7 +331,7 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1215 + "size": 1394 } //// [/user/username/projects/sample1/tests/index.js] @@ -350,7 +352,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","-9234818176-export declare const World = \"hello\";\n","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -392,7 +394,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" } }, "options": { @@ -415,9 +417,7 @@ export declare const m: typeof mod; "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -429,7 +429,7 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1417 + "size": 1539 } @@ -506,7 +506,7 @@ function foo() { } //// [/user/username/projects/sample1/core/index.d.ts] file written with same contents //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n",{"version":"-21447768693-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nfunction foo() { }","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-21447768693-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nfunction foo() { }","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -524,7 +524,7 @@ function foo() { } }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-21447768693-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nfunction foo() { }", @@ -544,7 +544,7 @@ function foo() { } ] }, "version": "FakeTSVersion", - "size": 1145 + "size": 1225 } diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/with-simple-project-reference-graph/builds-when-new-file-is-added,-and-its-subsequent-updates.js b/tests/baselines/reference/tsbuildWatch/programUpdates/with-simple-project-reference-graph/builds-when-new-file-is-added,-and-its-subsequent-updates.js index 98a5dd023b7..6aafabd4097 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/with-simple-project-reference-graph/builds-when-new-file-is-added,-and-its-subsequent-updates.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/with-simple-project-reference-graph/builds-when-new-file-is-added,-and-its-subsequent-updates.js @@ -126,8 +126,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/sample1/core/anothermodule.ts (used version) -/user/username/projects/sample1/core/index.ts (used version) +/user/username/projects/sample1/core/anothermodule.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/sample1/logic/index.ts"] Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} @@ -148,7 +148,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/sample1/core/index.d.ts (used version) /user/username/projects/sample1/core/anothermodule.d.ts (used version) -/user/username/projects/sample1/logic/index.ts (used version) +/user/username/projects/sample1/logic/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/sample1/tests/index.ts"] Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} @@ -172,7 +172,7 @@ Shape signatures in builder refreshed for:: /user/username/projects/sample1/core/index.d.ts (used version) /user/username/projects/sample1/core/anothermodule.d.ts (used version) /user/username/projects/sample1/logic/index.d.ts (used version) -/user/username/projects/sample1/tests/index.ts (used version) +/user/username/projects/sample1/tests/index.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -235,7 +235,7 @@ export declare function multiply(a: number, b: number): number; //# sourceMappingURL=index.d.ts.map //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n"],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -253,11 +253,11 @@ export declare function multiply(a: number, b: number): number; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" } }, "options": { @@ -275,7 +275,7 @@ export declare function multiply(a: number, b: number): number; ] }, "version": "FakeTSVersion", - "size": 964 + "size": 1254 } //// [/user/username/projects/sample1/logic/index.js.map] @@ -301,7 +301,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -316,6 +316,9 @@ export declare const m: typeof mod; [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -334,7 +337,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" } }, "options": { @@ -351,7 +354,6 @@ export declare const m: typeof mod; }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -363,7 +365,7 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1293 + "size": 1472 } //// [/user/username/projects/sample1/tests/index.js] @@ -384,7 +386,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -426,7 +428,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" } }, "options": { @@ -449,9 +451,7 @@ export declare const m: typeof mod; "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -463,7 +463,7 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1495 + "size": 1617 } @@ -530,7 +530,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/sample1/core/index.d.ts.map] file changed its modified time //// [/user/username/projects/sample1/core/index.d.ts] file changed its modified time //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./newfile.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-16320201030-export const newFileConst = 30;","signature":"-22941483372-export declare const newFileConst = 30;\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./newfile.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-16320201030-export const newFileConst = 30;","signature":"-22941483372-export declare const newFileConst = 30;\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -549,11 +549,11 @@ exitCode:: ExitStatus.undefined }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" }, "./newfile.ts": { "version": "-16320201030-export const newFileConst = 30;", @@ -576,7 +576,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1109 + "size": 1399 } //// [/user/username/projects/sample1/core/newfile.js] @@ -765,7 +765,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/sample1/core/index.d.ts.map] file changed its modified time //// [/user/username/projects/sample1/core/index.d.ts] file changed its modified time //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./newfile.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-9703836816-export const newFileConst = 30;\nexport class someClass2 { }","signature":"-12384508924-export declare const newFileConst = 30;\nexport declare class someClass2 {\n}\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./newfile.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-9703836816-export const newFileConst = 30;\nexport class someClass2 { }","signature":"-12384508924-export declare const newFileConst = 30;\nexport declare class someClass2 {\n}\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -784,11 +784,11 @@ exitCode:: ExitStatus.undefined }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" }, "./newfile.ts": { "version": "-9703836816-export const newFileConst = 30;\nexport class someClass2 { }", @@ -811,7 +811,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1175 + "size": 1465 } //// [/user/username/projects/sample1/core/newfile.js] diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/with-simple-project-reference-graph/change-builds-changes-and-reports-found-errors-message.js b/tests/baselines/reference/tsbuildWatch/programUpdates/with-simple-project-reference-graph/change-builds-changes-and-reports-found-errors-message.js index fc63f6a9185..d8fc2592bbe 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/with-simple-project-reference-graph/change-builds-changes-and-reports-found-errors-message.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/with-simple-project-reference-graph/change-builds-changes-and-reports-found-errors-message.js @@ -126,8 +126,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/sample1/core/anothermodule.ts (used version) -/user/username/projects/sample1/core/index.ts (used version) +/user/username/projects/sample1/core/anothermodule.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/sample1/logic/index.ts"] Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} @@ -148,7 +148,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/sample1/core/index.d.ts (used version) /user/username/projects/sample1/core/anothermodule.d.ts (used version) -/user/username/projects/sample1/logic/index.ts (used version) +/user/username/projects/sample1/logic/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/sample1/tests/index.ts"] Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} @@ -172,7 +172,7 @@ Shape signatures in builder refreshed for:: /user/username/projects/sample1/core/index.d.ts (used version) /user/username/projects/sample1/core/anothermodule.d.ts (used version) /user/username/projects/sample1/logic/index.d.ts (used version) -/user/username/projects/sample1/tests/index.ts (used version) +/user/username/projects/sample1/tests/index.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -235,7 +235,7 @@ export declare function multiply(a: number, b: number): number; //# sourceMappingURL=index.d.ts.map //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n"],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -253,11 +253,11 @@ export declare function multiply(a: number, b: number): number; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" } }, "options": { @@ -275,7 +275,7 @@ export declare function multiply(a: number, b: number): number; ] }, "version": "FakeTSVersion", - "size": 964 + "size": 1254 } //// [/user/username/projects/sample1/logic/index.js.map] @@ -301,7 +301,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -316,6 +316,9 @@ export declare const m: typeof mod; [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -334,7 +337,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" } }, "options": { @@ -351,7 +354,6 @@ export declare const m: typeof mod; }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -363,7 +365,7 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1293 + "size": 1472 } //// [/user/username/projects/sample1/tests/index.js] @@ -384,7 +386,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -426,7 +428,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" } }, "options": { @@ -449,9 +451,7 @@ export declare const m: typeof mod; "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -463,7 +463,7 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1495 + "size": 1617 } @@ -556,7 +556,7 @@ export declare class someClass { //# sourceMappingURL=index.d.ts.map //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n",{"version":"-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }","signature":"-2489663677-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }","signature":"-2489663677-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -574,7 +574,7 @@ export declare class someClass { }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-13387000654-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }", @@ -596,7 +596,7 @@ export declare class someClass { ] }, "version": "FakeTSVersion", - "size": 1239 + "size": 1319 } @@ -938,7 +938,7 @@ export declare function multiply(a: number, b: number): number; //# sourceMappingURL=index.d.ts.map //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n",{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -956,7 +956,7 @@ export declare function multiply(a: number, b: number): number; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", @@ -978,7 +978,7 @@ export declare function multiply(a: number, b: number): number; ] }, "version": "FakeTSVersion", - "size": 1174 + "size": 1254 } @@ -1338,7 +1338,7 @@ export declare class someClass2 { //# sourceMappingURL=index.d.ts.map //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n",{"version":"-8266060440-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nexport class someClass2 { }","signature":"-1938481101-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\nexport declare class someClass2 {\n}\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-8266060440-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nexport class someClass2 { }","signature":"-1938481101-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\nexport declare class someClass {\n}\nexport declare class someClass2 {\n}\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1356,7 +1356,7 @@ export declare class someClass2 { }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-8266060440-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nexport class someClass { }\nexport class someClass2 { }", @@ -1378,7 +1378,7 @@ export declare class someClass2 { ] }, "version": "FakeTSVersion", - "size": 1305 + "size": 1385 } diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/with-simple-project-reference-graph/non-local-change-does-not-start-build-of-referencing-projects.js b/tests/baselines/reference/tsbuildWatch/programUpdates/with-simple-project-reference-graph/non-local-change-does-not-start-build-of-referencing-projects.js index 8b21e84add5..bfe1294d290 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/with-simple-project-reference-graph/non-local-change-does-not-start-build-of-referencing-projects.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/with-simple-project-reference-graph/non-local-change-does-not-start-build-of-referencing-projects.js @@ -126,8 +126,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/sample1/core/anothermodule.ts (used version) -/user/username/projects/sample1/core/index.ts (used version) +/user/username/projects/sample1/core/anothermodule.ts (computed .d.ts during emit) +/user/username/projects/sample1/core/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/sample1/logic/index.ts"] Program options: {"composite":true,"declaration":true,"sourceMap":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/logic/tsconfig.json"} @@ -148,7 +148,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/sample1/core/index.d.ts (used version) /user/username/projects/sample1/core/anothermodule.d.ts (used version) -/user/username/projects/sample1/logic/index.ts (used version) +/user/username/projects/sample1/logic/index.ts (computed .d.ts during emit) Program root files: ["/user/username/projects/sample1/tests/index.ts"] Program options: {"composite":true,"declaration":true,"forceConsistentCasingInFileNames":true,"skipDefaultLibCheck":true,"watch":true,"configFilePath":"/user/username/projects/sample1/tests/tsconfig.json"} @@ -172,7 +172,7 @@ Shape signatures in builder refreshed for:: /user/username/projects/sample1/core/index.d.ts (used version) /user/username/projects/sample1/core/anothermodule.d.ts (used version) /user/username/projects/sample1/logic/index.d.ts (used version) -/user/username/projects/sample1/tests/index.ts (used version) +/user/username/projects/sample1/tests/index.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/sample1/core/tsconfig.json: @@ -235,7 +235,7 @@ export declare function multiply(a: number, b: number): number; //# sourceMappingURL=index.d.ts.map //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n"],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -253,11 +253,11 @@ export declare function multiply(a: number, b: number): number; }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", - "signature": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n" + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" } }, "options": { @@ -275,7 +275,7 @@ export declare function multiply(a: number, b: number): number; ] }, "version": "FakeTSVersion", - "size": 964 + "size": 1254 } //// [/user/username/projects/sample1/logic/index.js.map] @@ -301,7 +301,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -316,6 +316,9 @@ export declare const m: typeof mod; [ "../core/index.d.ts", "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" ] ], "fileInfos": { @@ -334,7 +337,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" } }, "options": { @@ -351,7 +354,6 @@ export declare const m: typeof mod; }, "exportedModulesMap": { "./index.ts": [ - "../core/index.d.ts", "../core/anothermodule.d.ts" ] }, @@ -363,7 +365,7 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1293 + "size": 1472 } //// [/user/username/projects/sample1/tests/index.js] @@ -384,7 +386,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -426,7 +428,7 @@ export declare const m: typeof mod; }, "./index.ts": { "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", - "signature": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n" + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" } }, "options": { @@ -449,9 +451,7 @@ export declare const m: typeof mod; "../core/anothermodule.d.ts" ], "./index.ts": [ - "../core/index.d.ts", - "../core/anothermodule.d.ts", - "../logic/index.d.ts" + "../core/anothermodule.d.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -463,7 +463,7 @@ export declare const m: typeof mod; ] }, "version": "FakeTSVersion", - "size": 1495 + "size": 1617 } @@ -542,7 +542,7 @@ function foo() { } //// [/user/username/projects/sample1/core/index.d.ts.map] file written with same contents //// [/user/username/projects/sample1/core/index.d.ts] file written with same contents //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n",{"version":"-21447768693-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nfunction foo() { }","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-21447768693-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nfunction foo() { }","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -560,7 +560,7 @@ function foo() { } }, "./anothermodule.ts": { "version": "-2676574883-export const World = \"hello\";\r\n", - "signature": "-2676574883-export const World = \"hello\";\r\n" + "signature": "-9234818176-export declare const World = \"hello\";\n" }, "./index.ts": { "version": "-21447768693-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n\nfunction foo() { }", @@ -582,7 +582,7 @@ function foo() { } ] }, "version": "FakeTSVersion", - "size": 1194 + "size": 1274 } diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/works-correctly-when-project-with-extended-config-is-removed.js b/tests/baselines/reference/tsbuildWatch/programUpdates/works-correctly-when-project-with-extended-config-is-removed.js index b389fa1e55e..02d8ce95925 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/works-correctly-when-project-with-extended-config-is-removed.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/works-correctly-when-project-with-extended-config-is-removed.js @@ -74,8 +74,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/a/b/commonfile1.ts (used version) -/a/b/commonfile2.ts (used version) +/a/b/commonfile1.ts (computed .d.ts during emit) +/a/b/commonfile2.ts (computed .d.ts during emit) Program root files: ["/a/b/other.ts"] Program options: {"strict":true,"composite":true,"watch":true,"configFilePath":"/a/b/project2.tsconfig.json"} @@ -90,7 +90,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/a/b/other.ts (used version) +/a/b/other.ts (computed .d.ts during emit) WatchedFiles:: /a/b/project1.tsconfig.json: @@ -135,7 +135,7 @@ declare let y: number; //// [/a/b/project1.tsconfig.tsbuildinfo] -{"program":{"fileNames":["../lib/lib.d.ts","./commonfile1.ts","./commonfile2.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"2167136208-let x = 1","affectsGlobalScope":true},{"version":"2168322129-let y = 1","affectsGlobalScope":true}],"options":{"composite":true,"strict":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[2,3,1]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../lib/lib.d.ts","./commonfile1.ts","./commonfile2.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"2167136208-let x = 1","signature":"2842409786-declare let x: number;\n","affectsGlobalScope":true},{"version":"2168322129-let y = 1","signature":"784887931-declare let y: number;\n","affectsGlobalScope":true}],"options":{"composite":true,"strict":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[2,3,1]},"version":"FakeTSVersion"} //// [/a/b/project1.tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -153,12 +153,12 @@ declare let y: number; }, "./commonfile1.ts": { "version": "2167136208-let x = 1", - "signature": "2167136208-let x = 1", + "signature": "2842409786-declare let x: number;\n", "affectsGlobalScope": true }, "./commonfile2.ts": { "version": "2168322129-let y = 1", - "signature": "2168322129-let y = 1", + "signature": "784887931-declare let y: number;\n", "affectsGlobalScope": true } }, @@ -175,7 +175,7 @@ declare let y: number; ] }, "version": "FakeTSVersion", - "size": 767 + "size": 866 } //// [/a/b/other.js] @@ -188,7 +188,7 @@ declare let z: number; //// [/a/b/project2.tsconfig.tsbuildinfo] -{"program":{"fileNames":["../lib/lib.d.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"2874288940-let z = 0;","affectsGlobalScope":true}],"options":{"composite":true,"strict":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[2,1]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../lib/lib.d.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"2874288940-let z = 0;","signature":"-1272633924-declare let z: number;\n","affectsGlobalScope":true}],"options":{"composite":true,"strict":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[2,1]},"version":"FakeTSVersion"} //// [/a/b/project2.tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -205,7 +205,7 @@ declare let z: number; }, "./other.ts": { "version": "2874288940-let z = 0;", - "signature": "2874288940-let z = 0;", + "signature": "-1272633924-declare let z: number;\n", "affectsGlobalScope": true } }, @@ -221,7 +221,7 @@ declare let z: number; ] }, "version": "FakeTSVersion", - "size": 680 + "size": 731 } diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js b/tests/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js index f6635b289db..abb8acaffde 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js @@ -70,8 +70,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/a/b/commonfile1.ts (used version) -/a/b/commonfile2.ts (used version) +/a/b/commonfile1.ts (computed .d.ts during emit) +/a/b/commonfile2.ts (computed .d.ts during emit) Program root files: ["/a/b/other.ts"] Program options: {"composite":true,"watch":true,"configFilePath":"/a/b/project2.tsconfig.json"} @@ -86,7 +86,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/a/b/other.ts (used version) +/a/b/other.ts (computed .d.ts during emit) WatchedFiles:: /a/b/project1.tsconfig.json: @@ -127,7 +127,7 @@ declare let y: number; //// [/a/b/project1.tsconfig.tsbuildinfo] -{"program":{"fileNames":["../lib/lib.d.ts","./commonfile1.ts","./commonfile2.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"2167136208-let x = 1","affectsGlobalScope":true},{"version":"2168322129-let y = 1","affectsGlobalScope":true}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[2,3,1]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../lib/lib.d.ts","./commonfile1.ts","./commonfile2.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"2167136208-let x = 1","signature":"2842409786-declare let x: number;\n","affectsGlobalScope":true},{"version":"2168322129-let y = 1","signature":"784887931-declare let y: number;\n","affectsGlobalScope":true}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[2,3,1]},"version":"FakeTSVersion"} //// [/a/b/project1.tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -145,12 +145,12 @@ declare let y: number; }, "./commonfile1.ts": { "version": "2167136208-let x = 1", - "signature": "2167136208-let x = 1", + "signature": "2842409786-declare let x: number;\n", "affectsGlobalScope": true }, "./commonfile2.ts": { "version": "2168322129-let y = 1", - "signature": "2168322129-let y = 1", + "signature": "784887931-declare let y: number;\n", "affectsGlobalScope": true } }, @@ -166,7 +166,7 @@ declare let y: number; ] }, "version": "FakeTSVersion", - "size": 753 + "size": 852 } //// [/a/b/other.js] @@ -178,7 +178,7 @@ declare let z: number; //// [/a/b/project2.tsconfig.tsbuildinfo] -{"program":{"fileNames":["../lib/lib.d.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"2874288940-let z = 0;","affectsGlobalScope":true}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[2,1]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../lib/lib.d.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"2874288940-let z = 0;","signature":"-1272633924-declare let z: number;\n","affectsGlobalScope":true}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[2,1]},"version":"FakeTSVersion"} //// [/a/b/project2.tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -195,7 +195,7 @@ declare let z: number; }, "./other.ts": { "version": "2874288940-let z = 0;", - "signature": "2874288940-let z = 0;", + "signature": "-1272633924-declare let z: number;\n", "affectsGlobalScope": true } }, @@ -210,7 +210,7 @@ declare let z: number; ] }, "version": "FakeTSVersion", - "size": 666 + "size": 717 } diff --git a/tests/baselines/reference/tsbuildWatch/reexport/Reports-errors-correctly.js b/tests/baselines/reference/tsbuildWatch/reexport/Reports-errors-correctly.js index 09cf4605ade..0128d3c6f49 100644 --- a/tests/baselines/reference/tsbuildWatch/reexport/Reports-errors-correctly.js +++ b/tests/baselines/reference/tsbuildWatch/reexport/Reports-errors-correctly.js @@ -101,7 +101,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/reexport/src/pure/session.ts (used version) +/user/username/projects/reexport/src/pure/session.ts (computed .d.ts during emit) /user/username/projects/reexport/src/pure/index.ts (used version) Program root files: ["/user/username/projects/reexport/src/main/index.ts"] @@ -187,7 +187,7 @@ export * from "./session"; //// [/user/username/projects/reexport/out/pure/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../src/pure/session.ts","../../src/pure/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"5375279855-export interface Session {\n foo: number;\n // bar: number;\n}\n","-5356193041-export * from \"./session\";\n"],"options":{"composite":true,"outDir":"..","rootDir":"../../src"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../src/pure/session.ts","../../src/pure/index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"5375279855-export interface Session {\n foo: number;\n // bar: number;\n}\n","signature":"-1218067212-export interface Session {\n foo: number;\n}\n"},"-5356193041-export * from \"./session\";\n"],"options":{"composite":true,"outDir":"..","rootDir":"../../src"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/reexport/out/pure/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -210,7 +210,7 @@ export * from "./session"; }, "../../src/pure/session.ts": { "version": "5375279855-export interface Session {\n foo: number;\n // bar: number;\n}\n", - "signature": "5375279855-export interface Session {\n foo: number;\n // bar: number;\n}\n" + "signature": "-1218067212-export interface Session {\n foo: number;\n}\n" }, "../../src/pure/index.ts": { "version": "-5356193041-export * from \"./session\";\n", @@ -239,7 +239,7 @@ export * from "./session"; ] }, "version": "FakeTSVersion", - "size": 935 + "size": 1023 } //// [/user/username/projects/reexport/out/main/index.js] diff --git a/tests/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file-through-indirect-import.js b/tests/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file-through-indirect-import.js index 13414c757da..4a35b33af3c 100644 --- a/tests/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file-through-indirect-import.js +++ b/tests/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file-through-indirect-import.js @@ -81,7 +81,7 @@ __createBinding(exports, constants_1, "default", "ConstantNumber"); //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./class1.ts","./constants.ts","./reexport.ts","./types.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"4085502068-const a: MagicNumber = 1;\nconsole.log(a);","affectsGlobalScope":true},"-2659799048-export default 1;","-1476032387-export { default as ConstantNumber } from \"./constants\"",{"version":"2093085814-type MagicNumber = typeof import('./reexport').ConstantNumber","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./class1.ts","./constants.ts","./reexport.ts","./types.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"4085502068-const a: MagicNumber = 1;\nconsole.log(a);","signature":"-4973073251-declare const a = 1;\r\n","affectsGlobalScope":true},{"version":"-2659799048-export default 1;","signature":"-5298367302-declare const _default: 1;\r\nexport default _default;\r\n"},{"version":"-1476032387-export { default as ConstantNumber } from \"./constants\"","signature":"-1329721329-export { default as ConstantNumber } from \"./constants\";\r\n"},{"version":"2093085814-type MagicNumber = typeof import('./reexport').ConstantNumber","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,5]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -109,16 +109,16 @@ __createBinding(exports, constants_1, "default", "ConstantNumber"); }, "./class1.ts": { "version": "4085502068-const a: MagicNumber = 1;\nconsole.log(a);", - "signature": "4085502068-const a: MagicNumber = 1;\nconsole.log(a);", + "signature": "-4973073251-declare const a = 1;\r\n", "affectsGlobalScope": true }, "./constants.ts": { "version": "-2659799048-export default 1;", - "signature": "-2659799048-export default 1;" + "signature": "-5298367302-declare const _default: 1;\r\nexport default _default;\r\n" }, "./reexport.ts": { "version": "-1476032387-export { default as ConstantNumber } from \"./constants\"", - "signature": "-1476032387-export { default as ConstantNumber } from \"./constants\"" + "signature": "-1329721329-export { default as ConstantNumber } from \"./constants\";\r\n" }, "./types.d.ts": { "version": "2093085814-type MagicNumber = typeof import('./reexport').ConstantNumber", @@ -154,7 +154,7 @@ __createBinding(exports, constants_1, "default", "ConstantNumber"); ] }, "version": "FakeTSVersion", - "size": 1099 + "size": 1348 } @@ -197,7 +197,7 @@ exports["default"] = 2; //// [/src/project/reexport.d.ts] file written with same contents //// [/src/project/reexport.js] file written with same contents //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./class1.ts","./constants.ts","./reexport.ts","./types.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"4085502068-const a: MagicNumber = 1;\nconsole.log(a);","affectsGlobalScope":true},{"version":"-2659799015-export default 2;","signature":"1573564507-declare const _default: 2;\r\nexport default _default;\r\n"},{"version":"-1476032387-export { default as ConstantNumber } from \"./constants\"","signature":"-1329721329-export { default as ConstantNumber } from \"./constants\";\r\n"},{"version":"2093085814-type MagicNumber = typeof import('./reexport').ConstantNumber","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,[2,[{"file":"./class1.ts","start":6,"length":1,"code":2322,"category":1,"messageText":"Type '1' is not assignable to type '2'."}]],3,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./class1.ts","./constants.ts","./reexport.ts","./types.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"4085502068-const a: MagicNumber = 1;\nconsole.log(a);","signature":"-4973037314-declare const a = 2;\r\n","affectsGlobalScope":true},{"version":"-2659799015-export default 2;","signature":"1573564507-declare const _default: 2;\r\nexport default _default;\r\n"},{"version":"-1476032387-export { default as ConstantNumber } from \"./constants\"","signature":"-1329721329-export { default as ConstantNumber } from \"./constants\";\r\n"},{"version":"2093085814-type MagicNumber = typeof import('./reexport').ConstantNumber","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,[2,[{"file":"./class1.ts","start":6,"length":1,"code":2322,"category":1,"messageText":"Type '1' is not assignable to type '2'."}]],3,4,5]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -225,7 +225,7 @@ exports["default"] = 2; }, "./class1.ts": { "version": "4085502068-const a: MagicNumber = 1;\nconsole.log(a);", - "signature": "4085502068-const a: MagicNumber = 1;\nconsole.log(a);", + "signature": "-4973037314-declare const a = 2;\r\n", "affectsGlobalScope": true }, "./constants.ts": { @@ -282,6 +282,6 @@ exports["default"] = 2; ] }, "version": "FakeTSVersion", - "size": 1425 + "size": 1476 } diff --git a/tests/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file.js b/tests/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file.js index a64e6e273ad..7a1310b88a4 100644 --- a/tests/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file.js +++ b/tests/baselines/reference/tsc/incremental/change-to-type-that-gets-used-as-global-through-export-in-another-file.js @@ -55,7 +55,7 @@ exports["default"] = 1; //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./class1.ts","./constants.ts","./types.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"4085502068-const a: MagicNumber = 1;\nconsole.log(a);","affectsGlobalScope":true},"-2659799048-export default 1;",{"version":"-2080821236-type MagicNumber = typeof import('./constants').default","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./class1.ts","./constants.ts","./types.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"4085502068-const a: MagicNumber = 1;\nconsole.log(a);","signature":"-4973073251-declare const a = 1;\r\n","affectsGlobalScope":true},{"version":"-2659799048-export default 1;","signature":"-5298367302-declare const _default: 1;\r\nexport default _default;\r\n"},{"version":"-2080821236-type MagicNumber = typeof import('./constants').default","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -79,12 +79,12 @@ exports["default"] = 1; }, "./class1.ts": { "version": "4085502068-const a: MagicNumber = 1;\nconsole.log(a);", - "signature": "4085502068-const a: MagicNumber = 1;\nconsole.log(a);", + "signature": "-4973073251-declare const a = 1;\r\n", "affectsGlobalScope": true }, "./constants.ts": { "version": "-2659799048-export default 1;", - "signature": "-2659799048-export default 1;" + "signature": "-5298367302-declare const _default: 1;\r\nexport default _default;\r\n" }, "./types.d.ts": { "version": "-2080821236-type MagicNumber = typeof import('./constants').default", @@ -113,7 +113,7 @@ exports["default"] = 1; ] }, "version": "FakeTSVersion", - "size": 988 + "size": 1136 } @@ -154,7 +154,7 @@ exports["default"] = 2; //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./class1.ts","./constants.ts","./types.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"4085502068-const a: MagicNumber = 1;\nconsole.log(a);","affectsGlobalScope":true},{"version":"-2659799015-export default 2;","signature":"1573564507-declare const _default: 2;\r\nexport default _default;\r\n"},{"version":"-2080821236-type MagicNumber = typeof import('./constants').default","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,[2,[{"file":"./class1.ts","start":6,"length":1,"code":2322,"category":1,"messageText":"Type '1' is not assignable to type '2'."}]],3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./class1.ts","./constants.ts","./types.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"4085502068-const a: MagicNumber = 1;\nconsole.log(a);","signature":"-4973037314-declare const a = 2;\r\n","affectsGlobalScope":true},{"version":"-2659799015-export default 2;","signature":"1573564507-declare const _default: 2;\r\nexport default _default;\r\n"},{"version":"-2080821236-type MagicNumber = typeof import('./constants').default","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,[2,[{"file":"./class1.ts","start":6,"length":1,"code":2322,"category":1,"messageText":"Type '1' is not assignable to type '2'."}]],3,4]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -178,7 +178,7 @@ exports["default"] = 2; }, "./class1.ts": { "version": "4085502068-const a: MagicNumber = 1;\nconsole.log(a);", - "signature": "4085502068-const a: MagicNumber = 1;\nconsole.log(a);", + "signature": "-4973037314-declare const a = 2;\r\n", "affectsGlobalScope": true }, "./constants.ts": { @@ -224,6 +224,6 @@ exports["default"] = 2; ] }, "version": "FakeTSVersion", - "size": 1213 + "size": 1264 } diff --git a/tests/baselines/reference/tsc/incremental/noEmit-changes-composite.js b/tests/baselines/reference/tsc/incremental/noEmit-changes-composite.js index 6e44cb64d29..3409cacd28b 100644 --- a/tests/baselines/reference/tsc/incremental/noEmit-changes-composite.js +++ b/tests/baselines/reference/tsc/incremental/noEmit-changes-composite.js @@ -148,7 +148,7 @@ function someFunc(arguments) { //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8117292349-export declare function writeLog(s: string): void;\r\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -178,27 +178,27 @@ function someFunc(arguments) { }, "./src/class.ts": { "version": "545032748-export class classC {\n prop = 1;\n}", - "signature": "545032748-export class classC {\n prop = 1;\n}" + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n" }, "./src/indirectclass.ts": { "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", - "signature": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n" }, "./src/directuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/indirectuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/nochangefile.ts": { "version": "6714567633-export function writeLog(s: string) {\n}", - "signature": "6714567633-export function writeLog(s: string) {\n}" + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n" }, "./src/nochangefilewithemitspecificerror.ts": { "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", - "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", "affectsGlobalScope": true } }, @@ -217,14 +217,8 @@ function someFunc(arguments) { ] }, "exportedModulesMap": { - "./src/directuse.ts": [ - "./src/indirectclass.ts" - ], "./src/indirectclass.ts": [ "./src/class.ts" - ], - "./src/indirectuse.ts": [ - "./src/indirectclass.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -251,7 +245,7 @@ function someFunc(arguments) { ] }, "version": "FakeTSVersion", - "size": 1651 + "size": 2178 } @@ -319,7 +313,7 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-3790894605-export declare class classC {\r\n prop1: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},"6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,2,[4,[{"file":"./src/directuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],3,[5,[{"file":"./src/indirectuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,1],[4,1],[3,1],[5,1]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-3790894605-export declare class classC {\r\n prop1: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8117292349-export declare function writeLog(s: string): void;\r\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,[4,[{"file":"./src/directuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],3,[5,[{"file":"./src/indirectuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,1],[4,0],[3,1],[5,0]]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -357,19 +351,19 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated }, "./src/directuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-4882119183-export {};\r\n" + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" }, "./src/indirectuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-4882119183-export {};\r\n" + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" }, "./src/nochangefile.ts": { "version": "6714567633-export function writeLog(s: string) {\n}", - "signature": "6714567633-export function writeLog(s: string) {\n}" + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n" }, "./src/nochangefilewithemitspecificerror.ts": { "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", - "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", "affectsGlobalScope": true } }, @@ -388,8 +382,14 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated ] }, "exportedModulesMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], "./src/indirectclass.ts": [ "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -465,7 +465,7 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated ], [ "./src/directuse.ts", - "Full" + "DtsOnly" ], [ "./src/indirectclass.ts", @@ -473,12 +473,12 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated ], [ "./src/indirectuse.ts", - "Full" + "DtsOnly" ] ] }, "version": "FakeTSVersion", - "size": 2657 + "size": 2754 } @@ -508,13 +508,11 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated //// [/src/project/src/class.d.ts] file written with same contents //// [/src/project/src/class.js] file written with same contents //// [/src/project/src/directUse.d.ts] file written with same contents -//// [/src/project/src/directUse.js] file written with same contents //// [/src/project/src/indirectClass.d.ts] file written with same contents //// [/src/project/src/indirectClass.js] file written with same contents //// [/src/project/src/indirectUse.d.ts] file written with same contents -//// [/src/project/src/indirectUse.js] file written with same contents //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8117292349-export declare function writeLog(s: string): void;\r\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -552,19 +550,19 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated }, "./src/directuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/indirectuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/nochangefile.ts": { "version": "6714567633-export function writeLog(s: string) {\n}", - "signature": "6714567633-export function writeLog(s: string) {\n}" + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n" }, "./src/nochangefilewithemitspecificerror.ts": { "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", - "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", "affectsGlobalScope": true } }, @@ -583,14 +581,8 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated ] }, "exportedModulesMap": { - "./src/directuse.ts": [ - "./src/indirectclass.ts" - ], "./src/indirectclass.ts": [ "./src/class.ts" - ], - "./src/indirectuse.ts": [ - "./src/indirectclass.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -617,7 +609,7 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated ] }, "version": "FakeTSVersion", - "size": 1893 + "size": 2178 } @@ -752,7 +744,7 @@ exports.classC = classC; //// [/src/project/src/indirectClass.js] file written with same contents //// [/src/project/src/indirectUse.d.ts] file written with same contents //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-3790894605-export declare class classC {\r\n prop1: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,[4,[{"file":"./src/directuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],3,[5,[{"file":"./src/indirectuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-3790894605-export declare class classC {\r\n prop1: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8117292349-export declare function writeLog(s: string): void;\r\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,2,[4,[{"file":"./src/directuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],3,[5,[{"file":"./src/indirectuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -790,19 +782,19 @@ exports.classC = classC; }, "./src/directuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/indirectuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/nochangefile.ts": { "version": "6714567633-export function writeLog(s: string) {\n}", - "signature": "6714567633-export function writeLog(s: string) {\n}" + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n" }, "./src/nochangefilewithemitspecificerror.ts": { "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", - "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", "affectsGlobalScope": true } }, @@ -821,14 +813,8 @@ exports.classC = classC; ] }, "exportedModulesMap": { - "./src/directuse.ts": [ - "./src/indirectclass.ts" - ], "./src/indirectclass.ts": [ "./src/class.ts" - ], - "./src/indirectuse.ts": [ - "./src/indirectclass.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -899,7 +885,7 @@ exports.classC = classC; ] }, "version": "FakeTSVersion", - "size": 2510 + "size": 2795 } @@ -1079,7 +1065,7 @@ exitCode:: ExitStatus.Success //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,1],[4,0],[3,1],[5,0]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8117292349-export declare function writeLog(s: string): void;\r\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,1],[4,0],[3,1],[5,0]]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1125,11 +1111,11 @@ exitCode:: ExitStatus.Success }, "./src/nochangefile.ts": { "version": "6714567633-export function writeLog(s: string) {\n}", - "signature": "6714567633-export function writeLog(s: string) {\n}" + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n" }, "./src/nochangefilewithemitspecificerror.ts": { "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", - "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", "affectsGlobalScope": true } }, @@ -1200,7 +1186,7 @@ exitCode:: ExitStatus.Success ] }, "version": "FakeTSVersion", - "size": 1946 + "size": 2137 } @@ -1246,7 +1232,7 @@ exports.classC = classC; //// [/src/project/src/indirectClass.js] file written with same contents //// [/src/project/src/indirectUse.d.ts] file written with same contents //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8117292349-export declare function writeLog(s: string): void;\r\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1284,19 +1270,19 @@ exports.classC = classC; }, "./src/directuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/indirectuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/nochangefile.ts": { "version": "6714567633-export function writeLog(s: string) {\n}", - "signature": "6714567633-export function writeLog(s: string) {\n}" + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n" }, "./src/nochangefilewithemitspecificerror.ts": { "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", - "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", "affectsGlobalScope": true } }, @@ -1315,14 +1301,8 @@ exports.classC = classC; ] }, "exportedModulesMap": { - "./src/directuse.ts": [ - "./src/indirectclass.ts" - ], "./src/indirectclass.ts": [ "./src/class.ts" - ], - "./src/indirectuse.ts": [ - "./src/indirectclass.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -1349,7 +1329,7 @@ exports.classC = classC; ] }, "version": "FakeTSVersion", - "size": 1893 + "size": 2178 } diff --git a/tests/baselines/reference/tsc/incremental/noEmit-changes-incremental-declaration.js b/tests/baselines/reference/tsc/incremental/noEmit-changes-incremental-declaration.js index 2e2f7e9a2dc..cf58b47ce13 100644 --- a/tests/baselines/reference/tsc/incremental/noEmit-changes-incremental-declaration.js +++ b/tests/baselines/reference/tsc/incremental/noEmit-changes-incremental-declaration.js @@ -148,7 +148,7 @@ function someFunc(arguments) { //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8117292349-export declare function writeLog(s: string): void;\r\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n","affectsGlobalScope":true}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -178,27 +178,27 @@ function someFunc(arguments) { }, "./src/class.ts": { "version": "545032748-export class classC {\n prop = 1;\n}", - "signature": "545032748-export class classC {\n prop = 1;\n}" + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n" }, "./src/indirectclass.ts": { "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", - "signature": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n" }, "./src/directuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/indirectuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/nochangefile.ts": { "version": "6714567633-export function writeLog(s: string) {\n}", - "signature": "6714567633-export function writeLog(s: string) {\n}" + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n" }, "./src/nochangefilewithemitspecificerror.ts": { "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", - "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", "affectsGlobalScope": true } }, @@ -217,14 +217,8 @@ function someFunc(arguments) { ] }, "exportedModulesMap": { - "./src/directuse.ts": [ - "./src/indirectclass.ts" - ], "./src/indirectclass.ts": [ "./src/class.ts" - ], - "./src/indirectuse.ts": [ - "./src/indirectclass.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -251,7 +245,7 @@ function someFunc(arguments) { ] }, "version": "FakeTSVersion", - "size": 1653 + "size": 2180 } @@ -319,7 +313,7 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-3790894605-export declare class classC {\r\n prop1: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},"6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,2,[4,[{"file":"./src/directuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],3,[5,[{"file":"./src/indirectuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,1],[4,1],[3,1],[5,1]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-3790894605-export declare class classC {\r\n prop1: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8117292349-export declare function writeLog(s: string): void;\r\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n","affectsGlobalScope":true}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,[4,[{"file":"./src/directuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],3,[5,[{"file":"./src/indirectuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,1],[4,0],[3,1],[5,0]]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -357,19 +351,19 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated }, "./src/directuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-4882119183-export {};\r\n" + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" }, "./src/indirectuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-4882119183-export {};\r\n" + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" }, "./src/nochangefile.ts": { "version": "6714567633-export function writeLog(s: string) {\n}", - "signature": "6714567633-export function writeLog(s: string) {\n}" + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n" }, "./src/nochangefilewithemitspecificerror.ts": { "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", - "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", "affectsGlobalScope": true } }, @@ -388,8 +382,14 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated ] }, "exportedModulesMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], "./src/indirectclass.ts": [ "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -465,7 +465,7 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated ], [ "./src/directuse.ts", - "Full" + "DtsOnly" ], [ "./src/indirectclass.ts", @@ -473,12 +473,12 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated ], [ "./src/indirectuse.ts", - "Full" + "DtsOnly" ] ] }, "version": "FakeTSVersion", - "size": 2659 + "size": 2756 } @@ -508,13 +508,11 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated //// [/src/project/src/class.d.ts] file written with same contents //// [/src/project/src/class.js] file written with same contents //// [/src/project/src/directUse.d.ts] file written with same contents -//// [/src/project/src/directUse.js] file written with same contents //// [/src/project/src/indirectClass.d.ts] file written with same contents //// [/src/project/src/indirectClass.js] file written with same contents //// [/src/project/src/indirectUse.d.ts] file written with same contents -//// [/src/project/src/indirectUse.js] file written with same contents //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8117292349-export declare function writeLog(s: string): void;\r\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n","affectsGlobalScope":true}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -552,19 +550,19 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated }, "./src/directuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/indirectuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/nochangefile.ts": { "version": "6714567633-export function writeLog(s: string) {\n}", - "signature": "6714567633-export function writeLog(s: string) {\n}" + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n" }, "./src/nochangefilewithemitspecificerror.ts": { "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", - "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", "affectsGlobalScope": true } }, @@ -583,14 +581,8 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated ] }, "exportedModulesMap": { - "./src/directuse.ts": [ - "./src/indirectclass.ts" - ], "./src/indirectclass.ts": [ "./src/class.ts" - ], - "./src/indirectuse.ts": [ - "./src/indirectclass.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -617,7 +609,7 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated ] }, "version": "FakeTSVersion", - "size": 1895 + "size": 2180 } @@ -752,7 +744,7 @@ exports.classC = classC; //// [/src/project/src/indirectClass.js] file written with same contents //// [/src/project/src/indirectUse.d.ts] file written with same contents //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-3790894605-export declare class classC {\r\n prop1: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,[4,[{"file":"./src/directuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],3,[5,[{"file":"./src/indirectuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-3790894605-export declare class classC {\r\n prop1: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8117292349-export declare function writeLog(s: string): void;\r\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n","affectsGlobalScope":true}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,2,[4,[{"file":"./src/directuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],3,[5,[{"file":"./src/indirectuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -790,19 +782,19 @@ exports.classC = classC; }, "./src/directuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/indirectuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/nochangefile.ts": { "version": "6714567633-export function writeLog(s: string) {\n}", - "signature": "6714567633-export function writeLog(s: string) {\n}" + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n" }, "./src/nochangefilewithemitspecificerror.ts": { "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", - "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", "affectsGlobalScope": true } }, @@ -821,14 +813,8 @@ exports.classC = classC; ] }, "exportedModulesMap": { - "./src/directuse.ts": [ - "./src/indirectclass.ts" - ], "./src/indirectclass.ts": [ "./src/class.ts" - ], - "./src/indirectuse.ts": [ - "./src/indirectclass.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -899,7 +885,7 @@ exports.classC = classC; ] }, "version": "FakeTSVersion", - "size": 2512 + "size": 2797 } @@ -1079,7 +1065,7 @@ exitCode:: ExitStatus.Success //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,1],[4,0],[3,1],[5,0]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8117292349-export declare function writeLog(s: string): void;\r\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n","affectsGlobalScope":true}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,1],[4,0],[3,1],[5,0]]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1125,11 +1111,11 @@ exitCode:: ExitStatus.Success }, "./src/nochangefile.ts": { "version": "6714567633-export function writeLog(s: string) {\n}", - "signature": "6714567633-export function writeLog(s: string) {\n}" + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n" }, "./src/nochangefilewithemitspecificerror.ts": { "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", - "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", "affectsGlobalScope": true } }, @@ -1200,7 +1186,7 @@ exitCode:: ExitStatus.Success ] }, "version": "FakeTSVersion", - "size": 1948 + "size": 2139 } @@ -1246,7 +1232,7 @@ exports.classC = classC; //// [/src/project/src/indirectClass.js] file written with same contents //// [/src/project/src/indirectUse.d.ts] file written with same contents //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8117292349-export declare function writeLog(s: string): void;\r\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n","affectsGlobalScope":true}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1284,19 +1270,19 @@ exports.classC = classC; }, "./src/directuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/indirectuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/nochangefile.ts": { "version": "6714567633-export function writeLog(s: string) {\n}", - "signature": "6714567633-export function writeLog(s: string) {\n}" + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n" }, "./src/nochangefilewithemitspecificerror.ts": { "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", - "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", "affectsGlobalScope": true } }, @@ -1315,14 +1301,8 @@ exports.classC = classC; ] }, "exportedModulesMap": { - "./src/directuse.ts": [ - "./src/indirectclass.ts" - ], "./src/indirectclass.ts": [ "./src/class.ts" - ], - "./src/indirectuse.ts": [ - "./src/indirectclass.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -1349,7 +1329,7 @@ exports.classC = classC; ] }, "version": "FakeTSVersion", - "size": 1895 + "size": 2180 } diff --git a/tests/baselines/reference/tsc/incremental/noEmit-changes-with-initial-noEmit-composite.js b/tests/baselines/reference/tsc/incremental/noEmit-changes-with-initial-noEmit-composite.js index ff0eb3c71d8..328b68562b3 100644 --- a/tests/baselines/reference/tsc/incremental/noEmit-changes-with-initial-noEmit-composite.js +++ b/tests/baselines/reference/tsc/incremental/noEmit-changes-with-initial-noEmit-composite.js @@ -292,7 +292,7 @@ function someFunc(arguments) { //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8117292349-export declare function writeLog(s: string): void;\r\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -322,27 +322,27 @@ function someFunc(arguments) { }, "./src/class.ts": { "version": "545032748-export class classC {\n prop = 1;\n}", - "signature": "545032748-export class classC {\n prop = 1;\n}" + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n" }, "./src/indirectclass.ts": { "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", - "signature": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n" }, "./src/directuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/indirectuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/nochangefile.ts": { "version": "6714567633-export function writeLog(s: string) {\n}", - "signature": "6714567633-export function writeLog(s: string) {\n}" + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n" }, "./src/nochangefilewithemitspecificerror.ts": { "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", - "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", "affectsGlobalScope": true } }, @@ -361,14 +361,8 @@ function someFunc(arguments) { ] }, "exportedModulesMap": { - "./src/directuse.ts": [ - "./src/indirectclass.ts" - ], "./src/indirectclass.ts": [ "./src/class.ts" - ], - "./src/indirectuse.ts": [ - "./src/indirectclass.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -395,7 +389,7 @@ function someFunc(arguments) { ] }, "version": "FakeTSVersion", - "size": 1651 + "size": 2178 } @@ -466,13 +460,11 @@ exports.classC = classC; //// [/src/project/src/directUse.d.ts] file written with same contents -//// [/src/project/src/directUse.js] file written with same contents //// [/src/project/src/indirectClass.d.ts] file written with same contents //// [/src/project/src/indirectClass.js] file written with same contents //// [/src/project/src/indirectUse.d.ts] file written with same contents -//// [/src/project/src/indirectUse.js] file written with same contents //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-3790894605-export declare class classC {\r\n prop1: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},"6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,2,[4,[{"file":"./src/directuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],3,[5,[{"file":"./src/indirectuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-3790894605-export declare class classC {\r\n prop1: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8117292349-export declare function writeLog(s: string): void;\r\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,2,[4,[{"file":"./src/directuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],3,[5,[{"file":"./src/indirectuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -518,11 +510,11 @@ exports.classC = classC; }, "./src/nochangefile.ts": { "version": "6714567633-export function writeLog(s: string) {\n}", - "signature": "6714567633-export function writeLog(s: string) {\n}" + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n" }, "./src/nochangefilewithemitspecificerror.ts": { "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", - "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", "affectsGlobalScope": true } }, @@ -613,7 +605,7 @@ exports.classC = classC; ] }, "version": "FakeTSVersion", - "size": 2604 + "size": 2795 } @@ -633,7 +625,7 @@ exitCode:: ExitStatus.Success //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,1],[4,0],[3,1],[5,0]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8117292349-export declare function writeLog(s: string): void;\r\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,1],[4,0],[3,1],[5,0]]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -679,11 +671,11 @@ exitCode:: ExitStatus.Success }, "./src/nochangefile.ts": { "version": "6714567633-export function writeLog(s: string) {\n}", - "signature": "6714567633-export function writeLog(s: string) {\n}" + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n" }, "./src/nochangefilewithemitspecificerror.ts": { "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", - "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", "affectsGlobalScope": true } }, @@ -754,7 +746,7 @@ exitCode:: ExitStatus.Success ] }, "version": "FakeTSVersion", - "size": 1946 + "size": 2137 } @@ -800,7 +792,7 @@ exports.classC = classC; //// [/src/project/src/indirectClass.js] file written with same contents //// [/src/project/src/indirectUse.d.ts] file written with same contents //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8117292349-export declare function writeLog(s: string): void;\r\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -838,19 +830,19 @@ exports.classC = classC; }, "./src/directuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/indirectuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/nochangefile.ts": { "version": "6714567633-export function writeLog(s: string) {\n}", - "signature": "6714567633-export function writeLog(s: string) {\n}" + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n" }, "./src/nochangefilewithemitspecificerror.ts": { "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", - "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", "affectsGlobalScope": true } }, @@ -869,14 +861,8 @@ exports.classC = classC; ] }, "exportedModulesMap": { - "./src/directuse.ts": [ - "./src/indirectclass.ts" - ], "./src/indirectclass.ts": [ "./src/class.ts" - ], - "./src/indirectuse.ts": [ - "./src/indirectclass.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -903,6 +889,6 @@ exports.classC = classC; ] }, "version": "FakeTSVersion", - "size": 1893 + "size": 2178 } diff --git a/tests/baselines/reference/tsc/incremental/noEmit-changes-with-initial-noEmit-incremental-declaration.js b/tests/baselines/reference/tsc/incremental/noEmit-changes-with-initial-noEmit-incremental-declaration.js index 4fc2bd2751e..969989ad632 100644 --- a/tests/baselines/reference/tsc/incremental/noEmit-changes-with-initial-noEmit-incremental-declaration.js +++ b/tests/baselines/reference/tsc/incremental/noEmit-changes-with-initial-noEmit-incremental-declaration.js @@ -292,7 +292,7 @@ function someFunc(arguments) { //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8117292349-export declare function writeLog(s: string): void;\r\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n","affectsGlobalScope":true}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -322,27 +322,27 @@ function someFunc(arguments) { }, "./src/class.ts": { "version": "545032748-export class classC {\n prop = 1;\n}", - "signature": "545032748-export class classC {\n prop = 1;\n}" + "signature": "-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n" }, "./src/indirectclass.ts": { "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", - "signature": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + "signature": "-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n" }, "./src/directuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/indirectuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/nochangefile.ts": { "version": "6714567633-export function writeLog(s: string) {\n}", - "signature": "6714567633-export function writeLog(s: string) {\n}" + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n" }, "./src/nochangefilewithemitspecificerror.ts": { "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", - "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", "affectsGlobalScope": true } }, @@ -361,14 +361,8 @@ function someFunc(arguments) { ] }, "exportedModulesMap": { - "./src/directuse.ts": [ - "./src/indirectclass.ts" - ], "./src/indirectclass.ts": [ "./src/class.ts" - ], - "./src/indirectuse.ts": [ - "./src/indirectclass.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -395,7 +389,7 @@ function someFunc(arguments) { ] }, "version": "FakeTSVersion", - "size": 1653 + "size": 2180 } @@ -466,13 +460,11 @@ exports.classC = classC; //// [/src/project/src/directUse.d.ts] file written with same contents -//// [/src/project/src/directUse.js] file written with same contents //// [/src/project/src/indirectClass.d.ts] file written with same contents //// [/src/project/src/indirectClass.js] file written with same contents //// [/src/project/src/indirectUse.d.ts] file written with same contents -//// [/src/project/src/indirectUse.js] file written with same contents //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-3790894605-export declare class classC {\r\n prop1: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},"6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,2,[4,[{"file":"./src/directuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],3,[5,[{"file":"./src/indirectuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-3790894605-export declare class classC {\r\n prop1: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8117292349-export declare function writeLog(s: string): void;\r\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n","affectsGlobalScope":true}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,2,[4,[{"file":"./src/directuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],3,[5,[{"file":"./src/indirectuse.ts","start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -518,11 +510,11 @@ exports.classC = classC; }, "./src/nochangefile.ts": { "version": "6714567633-export function writeLog(s: string) {\n}", - "signature": "6714567633-export function writeLog(s: string) {\n}" + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n" }, "./src/nochangefilewithemitspecificerror.ts": { "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", - "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", "affectsGlobalScope": true } }, @@ -613,7 +605,7 @@ exports.classC = classC; ] }, "version": "FakeTSVersion", - "size": 2606 + "size": 2797 } @@ -633,7 +625,7 @@ exitCode:: ExitStatus.Success //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,1],[4,0],[3,1],[5,0]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8117292349-export declare function writeLog(s: string): void;\r\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n","affectsGlobalScope":true}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,1],[4,0],[3,1],[5,0]]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -679,11 +671,11 @@ exitCode:: ExitStatus.Success }, "./src/nochangefile.ts": { "version": "6714567633-export function writeLog(s: string) {\n}", - "signature": "6714567633-export function writeLog(s: string) {\n}" + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n" }, "./src/nochangefilewithemitspecificerror.ts": { "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", - "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", "affectsGlobalScope": true } }, @@ -754,7 +746,7 @@ exitCode:: ExitStatus.Success ] }, "version": "FakeTSVersion", - "size": 1948 + "size": 2139 } @@ -800,7 +792,7 @@ exports.classC = classC; //// [/src/project/src/indirectClass.js] file written with same contents //// [/src/project/src/indirectUse.d.ts] file written with same contents //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-6712382238-export declare class classC {\r\n prop: number;\r\n}\r\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"-9860349972-import { classC } from './class';\r\nexport declare class indirectClass {\r\n classC: classC;\r\n}\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-4882119183-export {};\r\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8117292349-export declare function writeLog(s: string): void;\r\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n","affectsGlobalScope":true}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2],[5,1]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,2,4,3,5,6,[7,[{"file":"./src/nochangefilewithemitspecificerror.ts","start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -838,19 +830,19 @@ exports.classC = classC; }, "./src/directuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/indirectuse.ts": { "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", - "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + "signature": "-4882119183-export {};\r\n" }, "./src/nochangefile.ts": { "version": "6714567633-export function writeLog(s: string) {\n}", - "signature": "6714567633-export function writeLog(s: string) {\n}" + "signature": "8117292349-export declare function writeLog(s: string): void;\r\n" }, "./src/nochangefilewithemitspecificerror.ts": { "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", - "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-4920141752-declare function someFunc(arguments: boolean, ...rest: any[]): void;\r\n", "affectsGlobalScope": true } }, @@ -869,14 +861,8 @@ exports.classC = classC; ] }, "exportedModulesMap": { - "./src/directuse.ts": [ - "./src/indirectclass.ts" - ], "./src/indirectclass.ts": [ "./src/class.ts" - ], - "./src/indirectuse.ts": [ - "./src/indirectclass.ts" ] }, "semanticDiagnosticsPerFile": [ @@ -903,6 +889,6 @@ exports.classC = classC; ] }, "version": "FakeTSVersion", - "size": 1895 + "size": 2180 } diff --git a/tests/baselines/reference/tsc/incremental/when-global-file-is-added,-the-signatures-are-updated.js b/tests/baselines/reference/tsc/incremental/when-global-file-is-added,-the-signatures-are-updated.js index 996ed74a210..45d6bab61cc 100644 --- a/tests/baselines/reference/tsc/incremental/when-global-file-is-added,-the-signatures-are-updated.js +++ b/tests/baselines/reference/tsc/incremental/when-global-file-is-added,-the-signatures-are-updated.js @@ -70,9 +70,9 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /lib/lib.d.ts (used version) -/src/project/src/filepresent.ts (used version) -/src/project/src/anotherfilewithsamereferenes.ts (used version) -/src/project/src/main.ts (used version) +/src/project/src/filepresent.ts (computed .d.ts during emit) +/src/project/src/anotherfilewithsamereferenes.ts (computed .d.ts during emit) +/src/project/src/main.ts (computed .d.ts during emit) //// [/src/project/src/anotherFileWithSameReferenes.d.ts] @@ -106,7 +106,7 @@ function main() { } //// [/src/project/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.d.ts","./src/filepresent.ts","./src/anotherfilewithsamereferenes.ts","./src/main.ts","./src/filenotfound.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-12346563362-function something() { return 10; }","affectsGlobalScope":true},{"version":"-28237004260-/// \n/// \nfunction anotherFileWithSameReferenes() { }\n","affectsGlobalScope":true},{"version":"-21256825585-/// \n/// \nfunction main() { }\n","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[2,5]],"referencedMap":[[3,1],[4,1]],"exportedModulesMap":[[3,1],[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../lib/lib.d.ts","./src/filepresent.ts","./src/anotherfilewithsamereferenes.ts","./src/main.ts","./src/filenotfound.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-12346563362-function something() { return 10; }","signature":"-2893492081-declare function something(): number;\r\n","affectsGlobalScope":true},{"version":"-28237004260-/// \n/// \nfunction anotherFileWithSameReferenes() { }\n","signature":"5108835150-/// \r\ndeclare function anotherFileWithSameReferenes(): void;\r\n","affectsGlobalScope":true},{"version":"-21256825585-/// \n/// \nfunction main() { }\n","signature":"-7575087679-/// \r\ndeclare function main(): void;\r\n","affectsGlobalScope":true}],"options":{"composite":true},"fileIdsList":[[2,5]],"referencedMap":[[3,1],[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -132,17 +132,17 @@ function main() { } }, "./src/filepresent.ts": { "version": "-12346563362-function something() { return 10; }", - "signature": "-12346563362-function something() { return 10; }", + "signature": "-2893492081-declare function something(): number;\r\n", "affectsGlobalScope": true }, "./src/anotherfilewithsamereferenes.ts": { "version": "-28237004260-/// \n/// \nfunction anotherFileWithSameReferenes() { }\n", - "signature": "-28237004260-/// \n/// \nfunction anotherFileWithSameReferenes() { }\n", + "signature": "5108835150-/// \r\ndeclare function anotherFileWithSameReferenes(): void;\r\n", "affectsGlobalScope": true }, "./src/main.ts": { "version": "-21256825585-/// \n/// \nfunction main() { }\n", - "signature": "-21256825585-/// \n/// \nfunction main() { }\n", + "signature": "-7575087679-/// \r\ndeclare function main(): void;\r\n", "affectsGlobalScope": true } }, @@ -159,16 +159,7 @@ function main() { } "./src/filenotfound.ts" ] }, - "exportedModulesMap": { - "./src/anotherfilewithsamereferenes.ts": [ - "./src/filepresent.ts", - "./src/filenotfound.ts" - ], - "./src/main.ts": [ - "./src/filepresent.ts", - "./src/filenotfound.ts" - ] - }, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../../lib/lib.d.ts", "./src/anotherfilewithsamereferenes.ts", @@ -177,7 +168,7 @@ function main() { } ] }, "version": "FakeTSVersion", - "size": 1266 + "size": 1562 } @@ -260,21 +251,12 @@ Program files:: /src/project/src/main.ts Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/src/project/src/filePresent.ts -/src/project/src/anotherFileWithSameReferenes.ts /src/project/src/main.ts Shape signatures in builder refreshed for:: /src/project/src/main.ts (computed .d.ts) -/src/project/src/filepresent.ts (computed .d.ts) -/src/project/src/anotherfilewithsamereferenes.ts (computed .d.ts) -//// [/src/project/src/anotherFileWithSameReferenes.d.ts] file written with same contents -//// [/src/project/src/anotherFileWithSameReferenes.js] file written with same contents -//// [/src/project/src/filePresent.d.ts] file written with same contents -//// [/src/project/src/filePresent.js] file written with same contents //// [/src/project/src/main.d.ts] file written with same contents //// [/src/project/src/main.js] /// diff --git a/tests/baselines/reference/tsc/incremental/when-new-file-is-added-to-the-referenced-project.js b/tests/baselines/reference/tsc/incremental/when-new-file-is-added-to-the-referenced-project.js index e7ca71b47b9..a2f07bbd5ce 100644 --- a/tests/baselines/reference/tsc/incremental/when-new-file-is-added-to-the-referenced-project.js +++ b/tests/baselines/reference/tsc/incremental/when-new-file-is-added-to-the-referenced-project.js @@ -50,7 +50,7 @@ var class2 = /** @class */ (function () { //// [/src/projects/project2/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../lib/lib.d.ts","../project1/class1.d.ts","./class2.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-3469237238-declare class class1 {}","affectsGlobalScope":true},{"version":"777969115-class class2 {}","affectsGlobalScope":true}],"options":{"composite":true,"module":0},"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../lib/lib.d.ts","../project1/class1.d.ts","./class2.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-3469237238-declare class class1 {}","affectsGlobalScope":true},{"version":"777969115-class class2 {}","signature":"-2390931783-declare class class2 {\r\n}\r\n","affectsGlobalScope":true}],"options":{"composite":true,"module":0},"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/src/projects/project2/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -73,7 +73,7 @@ var class2 = /** @class */ (function () { }, "./class2.ts": { "version": "777969115-class class2 {}", - "signature": "777969115-class class2 {}", + "signature": "-2390931783-declare class class2 {\r\n}\r\n", "affectsGlobalScope": true } }, @@ -88,7 +88,7 @@ var class2 = /** @class */ (function () { ] }, "version": "FakeTSVersion", - "size": 829 + "size": 887 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/errors-for-.d.ts-change.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/errors-for-.d.ts-change.js index bead8dc0ba8..3bfc8798173 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/errors-for-.d.ts-change.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/errors-for-.d.ts-change.js @@ -63,7 +63,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/myproject/c.d.ts (used version) /user/username/projects/myproject/b.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/errors-for-.ts-change.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/errors-for-.ts-change.js index 67484435710..1b5b6508729 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/errors-for-.ts-change.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/errors-for-.ts-change.js @@ -61,9 +61,9 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/c.ts (used version) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -154,12 +154,7 @@ Output:: >> Screen clear [12:00:42 AM] File change detected. Starting incremental compilation... -a.ts:4:17 - error TS2339: Property 'd' does not exist on type 'C'. - -4 console.log(b.c.d); -   ~ - -[12:01:01 AM] Found 1 error. Watching for file changes. +[12:00:55 AM] Found 0 errors. Watching for file changes. @@ -175,12 +170,10 @@ Program files:: Semantic diagnostics in builder refreshed for:: /user/username/projects/myproject/c.ts /user/username/projects/myproject/b.ts -/user/username/projects/myproject/a.ts Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.ts (computed .d.ts) /user/username/projects/myproject/b.ts (computed .d.ts) -/user/username/projects/myproject/a.ts (computed .d.ts) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -225,8 +218,6 @@ export declare class C { //// [/user/username/projects/myproject/b.js] file written with same contents //// [/user/username/projects/myproject/b.d.ts] file written with same contents -//// [/user/username/projects/myproject/a.js] file written with same contents -//// [/user/username/projects/myproject/a.d.ts] file written with same contents Change:: Rename property d2 to d of class C to revert back to original text @@ -240,14 +231,9 @@ export class C Output:: >> Screen clear -[12:01:05 AM] File change detected. Starting incremental compilation... +[12:00:59 AM] File change detected. Starting incremental compilation... -a.ts:4:17 - error TS2339: Property 'd' does not exist on type 'C'. - -4 console.log(b.c.d); -   ~ - -[12:01:18 AM] Found 1 error. Watching for file changes. +[12:01:12 AM] Found 0 errors. Watching for file changes. @@ -324,14 +310,9 @@ export class C Output:: >> Screen clear -[12:01:22 AM] File change detected. Starting incremental compilation... +[12:01:16 AM] File change detected. Starting incremental compilation... -a.ts:4:17 - error TS2339: Property 'd' does not exist on type 'C'. - -4 console.log(b.c.d); -   ~ - -[12:01:35 AM] Found 1 error. Watching for file changes. +[12:01:29 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js index 38ef212cd10..261571ca33d 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -96,11 +96,11 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/c.ts (used version) -/user/username/projects/myproject/d.ts (used version) -/user/username/projects/myproject/e.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/d.ts (computed .d.ts during emit) +/user/username/projects/myproject/e.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -217,7 +217,23 @@ Output:: >> Screen clear [12:00:54 AM] File change detected. Starting incremental compilation... -[12:01:25 AM] Found 0 errors. Watching for file changes. +c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. + Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. + +6 x: 1, +   ~~~~ + + a.ts:3:5 + 3 c: Coords; +    ~ + The expected type comes from property 'c' which is declared here on type 'PointWrapper' + +d.ts:2:14 - error TS2339: Property 'x' does not exist on type 'Coords'. + +2 getPoint().c.x; +   ~ + +[12:01:07 AM] Found 2 errors. Watching for file changes. @@ -235,16 +251,10 @@ Program files:: Semantic diagnostics in builder refreshed for:: /user/username/projects/myproject/a.ts /user/username/projects/myproject/b.ts -/user/username/projects/myproject/c.ts -/user/username/projects/myproject/d.ts -/user/username/projects/myproject/e.ts Shape signatures in builder refreshed for:: /user/username/projects/myproject/a.ts (computed .d.ts) /user/username/projects/myproject/b.ts (computed .d.ts) -/user/username/projects/myproject/c.ts (computed .d.ts) -/user/username/projects/myproject/d.ts (computed .d.ts) -/user/username/projects/myproject/e.ts (computed .d.ts) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -286,12 +296,6 @@ export interface Coords { //// [/user/username/projects/myproject/b.js] file written with same contents //// [/user/username/projects/myproject/b.d.ts] file written with same contents -//// [/user/username/projects/myproject/c.js] file written with same contents -//// [/user/username/projects/myproject/c.d.ts] file written with same contents -//// [/user/username/projects/myproject/d.js] file written with same contents -//// [/user/username/projects/myproject/d.d.ts] file written with same contents -//// [/user/username/projects/myproject/e.js] file written with same contents -//// [/user/username/projects/myproject/e.d.ts] file written with same contents Change:: Rename property x to x2 of interface Coords to revert back to original text @@ -309,9 +313,25 @@ export interface Coords { Output:: >> Screen clear -[12:01:29 AM] File change detected. Starting incremental compilation... +[12:01:11 AM] File change detected. Starting incremental compilation... -[12:01:42 AM] Found 0 errors. Watching for file changes. +c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. + Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. + +6 x: 1, +   ~~~~ + + a.ts:3:5 + 3 c: Coords; +    ~ + The expected type comes from property 'c' which is declared here on type 'PointWrapper' + +d.ts:2:14 - error TS2339: Property 'x' does not exist on type 'Coords'. + +2 getPoint().c.x; +   ~ + +[12:01:24 AM] Found 2 errors. Watching for file changes. @@ -391,9 +411,25 @@ export interface Coords { Output:: >> Screen clear -[12:01:46 AM] File change detected. Starting incremental compilation... +[12:01:28 AM] File change detected. Starting incremental compilation... -[12:01:59 AM] Found 0 errors. Watching for file changes. +c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. + Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. + +6 x: 1, +   ~~~~ + + a.ts:3:5 + 3 c: Coords; +    ~ + The expected type comes from property 'c' which is declared here on type 'PointWrapper' + +d.ts:2:14 - error TS2339: Property 'x' does not exist on type 'Coords'. + +2 getPoint().c.x; +   ~ + +[12:01:41 AM] Found 2 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/transitive-exports/no-circular-import/export.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/transitive-exports/no-circular-import/export.js index 28f3a658982..3606da89088 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/transitive-exports/no-circular-import/export.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/transitive-exports/no-circular-import/export.js @@ -81,12 +81,12 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/lib1/tools/tools.interface.ts (used version) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -256,13 +256,7 @@ Output:: >> Screen clear [12:01:06 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? - -5 title: "title" -   ~~~~~~~~~~~~~~ - -[12:01:43 AM] Found 1 error. Watching for file changes. +[12:01:19 AM] Found 0 errors. Watching for file changes. @@ -281,18 +275,10 @@ Program files:: Semantic diagnostics in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts /user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) /user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts) -/user/username/projects/myproject/lib1/public.ts (computed .d.ts) -/user/username/projects/myproject/lib2/data.ts (computed .d.ts) -/user/username/projects/myproject/lib2/public.ts (computed .d.ts) -/user/username/projects/myproject/app.ts (computed .d.ts) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -329,14 +315,6 @@ export interface ITest { //// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents //// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib1/public.js] file written with same contents -//// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data.js] file written with same contents -//// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/public.js] file written with same contents -//// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/app.js] file written with same contents -//// [/user/username/projects/myproject/app.d.ts] file written with same contents Change:: Rename property title2 to title of interface ITest to revert back to original text @@ -349,15 +327,9 @@ export interface ITest { Output:: >> Screen clear -[12:01:47 AM] File change detected. Starting incremental compilation... +[12:01:23 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? - -5 title: "title" -   ~~~~~~~~~~~~~~ - -[12:02:00 AM] Found 1 error. Watching for file changes. +[12:01:36 AM] Found 0 errors. Watching for file changes. @@ -428,15 +400,9 @@ export interface ITest { Output:: >> Screen clear -[12:02:04 AM] File change detected. Starting incremental compilation... +[12:01:40 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? - -5 title: "title" -   ~~~~~~~~~~~~~~ - -[12:02:17 AM] Found 1 error. Watching for file changes. +[12:01:53 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/transitive-exports/yes-circular-import/exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/transitive-exports/yes-circular-import/exports.js index 78a60956f6c..1b1c6a5f0fa 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/transitive-exports/yes-circular-import/exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/transitive-exports/yes-circular-import/exports.js @@ -89,13 +89,13 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/lib1/tools/tools.interface.ts (used version) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data2.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data2.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -288,13 +288,7 @@ Output:: >> Screen clear [12:01:12 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? - -5 title: "title" -   ~~~~~~~~~~~~~~ - -[12:01:55 AM] Found 1 error. Watching for file changes. +[12:01:25 AM] Found 0 errors. Watching for file changes. @@ -314,20 +308,10 @@ Program files:: Semantic diagnostics in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts /user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) /user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts) -/user/username/projects/myproject/lib1/public.ts (computed .d.ts) -/user/username/projects/myproject/lib2/data.ts (computed .d.ts) -/user/username/projects/myproject/lib2/public.ts (computed .d.ts) -/user/username/projects/myproject/app.ts (computed .d.ts) -/user/username/projects/myproject/lib2/data2.ts (computed .d.ts) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -366,16 +350,6 @@ export interface ITest { //// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents //// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib1/public.js] file written with same contents -//// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data2.js] file written with same contents -//// [/user/username/projects/myproject/lib2/data2.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data.js] file written with same contents -//// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/public.js] file written with same contents -//// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/app.js] file written with same contents -//// [/user/username/projects/myproject/app.d.ts] file written with same contents Change:: Rename property title2 to title of interface ITest to revert back to original text @@ -388,15 +362,9 @@ export interface ITest { Output:: >> Screen clear -[12:01:59 AM] File change detected. Starting incremental compilation... +[12:01:29 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? - -5 title: "title" -   ~~~~~~~~~~~~~~ - -[12:02:12 AM] Found 1 error. Watching for file changes. +[12:01:42 AM] Found 0 errors. Watching for file changes. @@ -470,15 +438,9 @@ export interface ITest { Output:: >> Screen clear -[12:02:16 AM] File change detected. Starting incremental compilation... +[12:01:46 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? - -5 title: "title" -   ~~~~~~~~~~~~~~ - -[12:02:29 AM] Found 1 error. Watching for file changes. +[12:01:59 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js index 2390754cc15..ba89be276ea 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js @@ -278,7 +278,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -302,7 +302,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", @@ -310,7 +310,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -333,7 +333,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1115 + "size": 1249 } //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] @@ -429,7 +429,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,[3,[{"file":"../src/main.ts","start":46,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]],4],"affectedFilesPendingEmit":[[3,1]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,[3,[{"file":"../src/main.ts","start":46,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]],4],"affectedFilesPendingEmit":[[3,1]]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -453,7 +453,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;", @@ -461,7 +461,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -502,7 +502,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1278 + "size": 1412 } @@ -614,7 +614,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -638,7 +638,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", @@ -646,7 +646,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -669,7 +669,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1106 + "size": 1240 } //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/errors-for-.d.ts-change.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/errors-for-.d.ts-change.js index c8f5d8e9879..881bb3fb807 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/errors-for-.d.ts-change.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/errors-for-.d.ts-change.js @@ -63,7 +63,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/myproject/c.d.ts (used version) /user/username/projects/myproject/b.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -142,7 +142,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.d.ts (used version) /user/username/projects/myproject/b.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -205,7 +205,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.d.ts (used version) /user/username/projects/myproject/b.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -273,7 +273,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.d.ts (used version) /user/username/projects/myproject/b.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/errors-for-.ts-change.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/errors-for-.ts-change.js index d37fad35d5b..461b77f5037 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/errors-for-.ts-change.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/deepImportChanges/errors-for-.ts-change.js @@ -61,9 +61,9 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/c.ts (used version) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -159,7 +159,7 @@ Output:: 4 console.log(b.c.d);    ~ -[12:01:01 AM] Found 1 error. Watching for file changes. +[12:00:58 AM] Found 1 error. Watching for file changes. @@ -180,7 +180,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.ts (computed .d.ts) /user/username/projects/myproject/b.ts (computed .d.ts) -/user/username/projects/myproject/a.ts (computed .d.ts) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -225,7 +225,6 @@ export declare class C { //// [/user/username/projects/myproject/b.js] file written with same contents //// [/user/username/projects/myproject/b.d.ts] file written with same contents -//// [/user/username/projects/myproject/a.js] file written with same contents //// [/user/username/projects/myproject/a.d.ts] file written with same contents Change:: Rename property d2 to d of class C to revert back to original text @@ -240,9 +239,9 @@ export class C Output:: >> Screen clear -[12:01:05 AM] File change detected. Starting incremental compilation... +[12:01:02 AM] File change detected. Starting incremental compilation... -[12:01:21 AM] Found 0 errors. Watching for file changes. +[12:01:18 AM] Found 0 errors. Watching for file changes. @@ -263,7 +262,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.ts (computed .d.ts) /user/username/projects/myproject/b.ts (computed .d.ts) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -322,14 +321,14 @@ export class C Output:: >> Screen clear -[12:01:25 AM] File change detected. Starting incremental compilation... +[12:01:22 AM] File change detected. Starting incremental compilation... a.ts:4:17 - error TS2339: Property 'd' does not exist on type 'C'. 4 console.log(b.c.d);    ~ -[12:01:41 AM] Found 1 error. Watching for file changes. +[12:01:38 AM] Found 1 error. Watching for file changes. @@ -350,7 +349,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.ts (computed .d.ts) /user/username/projects/myproject/b.ts (computed .d.ts) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js index c64eaa430fb..80810ab0ec4 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -96,11 +96,11 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/c.ts (used version) -/user/username/projects/myproject/d.ts (used version) -/user/username/projects/myproject/e.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/d.ts (computed .d.ts during emit) +/user/username/projects/myproject/e.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -217,7 +217,7 @@ Output:: >> Screen clear [12:00:54 AM] File change detected. Starting incremental compilation... -[12:01:25 AM] Found 0 errors. Watching for file changes. +[12:01:13 AM] Found 0 errors. Watching for file changes. @@ -237,14 +237,12 @@ Semantic diagnostics in builder refreshed for:: /user/username/projects/myproject/b.ts /user/username/projects/myproject/c.ts /user/username/projects/myproject/d.ts -/user/username/projects/myproject/e.ts Shape signatures in builder refreshed for:: /user/username/projects/myproject/a.ts (computed .d.ts) /user/username/projects/myproject/b.ts (computed .d.ts) -/user/username/projects/myproject/c.ts (computed .d.ts) -/user/username/projects/myproject/d.ts (computed .d.ts) -/user/username/projects/myproject/e.ts (computed .d.ts) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/d.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -286,12 +284,8 @@ export interface Coords { //// [/user/username/projects/myproject/b.js] file written with same contents //// [/user/username/projects/myproject/b.d.ts] file written with same contents -//// [/user/username/projects/myproject/c.js] file written with same contents //// [/user/username/projects/myproject/c.d.ts] file written with same contents -//// [/user/username/projects/myproject/d.js] file written with same contents //// [/user/username/projects/myproject/d.d.ts] file written with same contents -//// [/user/username/projects/myproject/e.js] file written with same contents -//// [/user/username/projects/myproject/e.d.ts] file written with same contents Change:: Rename property x to x2 of interface Coords to revert back to original text @@ -309,7 +303,7 @@ export interface Coords { Output:: >> Screen clear -[12:01:29 AM] File change detected. Starting incremental compilation... +[12:01:17 AM] File change detected. Starting incremental compilation... c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. @@ -327,7 +321,7 @@ Output:: 2 getPoint().c.x;    ~ -[12:01:48 AM] Found 2 errors. Watching for file changes. +[12:01:36 AM] Found 2 errors. Watching for file changes. @@ -351,8 +345,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/a.ts (computed .d.ts) /user/username/projects/myproject/b.ts (computed .d.ts) -/user/username/projects/myproject/c.ts (used version) -/user/username/projects/myproject/d.ts (used version) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/d.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -413,9 +407,9 @@ export interface Coords { Output:: >> Screen clear -[12:01:52 AM] File change detected. Starting incremental compilation... +[12:01:40 AM] File change detected. Starting incremental compilation... -[12:02:14 AM] Found 0 errors. Watching for file changes. +[12:01:59 AM] Found 0 errors. Watching for file changes. @@ -435,14 +429,12 @@ Semantic diagnostics in builder refreshed for:: /user/username/projects/myproject/b.ts /user/username/projects/myproject/c.ts /user/username/projects/myproject/d.ts -/user/username/projects/myproject/e.ts Shape signatures in builder refreshed for:: /user/username/projects/myproject/a.ts (computed .d.ts) /user/username/projects/myproject/b.ts (computed .d.ts) -/user/username/projects/myproject/c.ts (used version) -/user/username/projects/myproject/d.ts (used version) -/user/username/projects/myproject/e.ts (used version) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/d.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -486,4 +478,3 @@ export interface Coords { //// [/user/username/projects/myproject/b.d.ts] file written with same contents //// [/user/username/projects/myproject/c.d.ts] file written with same contents //// [/user/username/projects/myproject/d.d.ts] file written with same contents -//// [/user/username/projects/myproject/e.d.ts] file written with same contents diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/no-circular-import/export.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/no-circular-import/export.js index 8d05ca1c19f..3daa1e66f2f 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/no-circular-import/export.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/no-circular-import/export.js @@ -81,12 +81,12 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/lib1/tools/tools.interface.ts (used version) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -262,7 +262,7 @@ Output:: 5 title: "title"    ~~~~~~~~~~~~~~ -[12:01:43 AM] Found 1 error. Watching for file changes. +[12:01:31 AM] Found 1 error. Watching for file changes. @@ -289,10 +289,10 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) /user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts) -/user/username/projects/myproject/lib1/public.ts (computed .d.ts) -/user/username/projects/myproject/lib2/data.ts (computed .d.ts) -/user/username/projects/myproject/lib2/public.ts (computed .d.ts) -/user/username/projects/myproject/app.ts (computed .d.ts) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -329,13 +329,9 @@ export interface ITest { //// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents //// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib1/public.js] file written with same contents //// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data.js] file written with same contents //// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/public.js] file written with same contents //// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/app.js] file written with same contents //// [/user/username/projects/myproject/app.d.ts] file written with same contents Change:: Rename property title2 to title of interface ITest to revert back to original text @@ -349,9 +345,9 @@ export interface ITest { Output:: >> Screen clear -[12:01:47 AM] File change detected. Starting incremental compilation... +[12:01:35 AM] File change detected. Starting incremental compilation... -[12:02:12 AM] Found 0 errors. Watching for file changes. +[12:02:00 AM] Found 0 errors. Watching for file changes. @@ -378,10 +374,10 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) /user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -434,7 +430,7 @@ export interface ITest { Output:: >> Screen clear -[12:02:16 AM] File change detected. Starting incremental compilation... +[12:02:04 AM] File change detected. Starting incremental compilation... lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? @@ -442,7 +438,7 @@ Output:: 5 title: "title"    ~~~~~~~~~~~~~~ -[12:02:41 AM] Found 1 error. Watching for file changes. +[12:02:29 AM] Found 1 error. Watching for file changes. @@ -469,10 +465,10 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) /user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/yes-circular-import/exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/yes-circular-import/exports.js index d50dd2518dd..d90b5e2271c 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/yes-circular-import/exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/transitive-exports/yes-circular-import/exports.js @@ -89,13 +89,13 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/lib1/tools/tools.interface.ts (used version) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data2.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data2.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -294,7 +294,7 @@ Output:: 5 title: "title"    ~~~~~~~~~~~~~~ -[12:01:55 AM] Found 1 error. Watching for file changes. +[12:01:40 AM] Found 1 error. Watching for file changes. @@ -323,11 +323,11 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) /user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts) -/user/username/projects/myproject/lib1/public.ts (computed .d.ts) -/user/username/projects/myproject/lib2/data.ts (computed .d.ts) -/user/username/projects/myproject/lib2/public.ts (computed .d.ts) -/user/username/projects/myproject/app.ts (computed .d.ts) -/user/username/projects/myproject/lib2/data2.ts (computed .d.ts) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data2.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -366,15 +366,10 @@ export interface ITest { //// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents //// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib1/public.js] file written with same contents //// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data2.js] file written with same contents //// [/user/username/projects/myproject/lib2/data2.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data.js] file written with same contents //// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/public.js] file written with same contents //// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/app.js] file written with same contents //// [/user/username/projects/myproject/app.d.ts] file written with same contents Change:: Rename property title2 to title of interface ITest to revert back to original text @@ -388,9 +383,9 @@ export interface ITest { Output:: >> Screen clear -[12:01:59 AM] File change detected. Starting incremental compilation... +[12:01:44 AM] File change detected. Starting incremental compilation... -[12:02:27 AM] Found 0 errors. Watching for file changes. +[12:02:12 AM] Found 0 errors. Watching for file changes. @@ -419,11 +414,11 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) /user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/data2.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data2.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -479,7 +474,7 @@ export interface ITest { Output:: >> Screen clear -[12:02:31 AM] File change detected. Starting incremental compilation... +[12:02:16 AM] File change detected. Starting incremental compilation... lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? @@ -487,7 +482,7 @@ Output:: 5 title: "title"    ~~~~~~~~~~~~~~ -[12:02:59 AM] Found 1 error. Watching for file changes. +[12:02:44 AM] Found 1 error. Watching for file changes. @@ -516,11 +511,11 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) /user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/data2.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data2.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js index 3e5507d61da..a7e1626c8dc 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js @@ -277,7 +277,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -301,7 +301,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", @@ -309,7 +309,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -331,7 +331,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1066 + "size": 1200 } //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] @@ -427,7 +427,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,[3,[{"file":"../src/main.ts","start":46,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]],4],"affectedFilesPendingEmit":[[3,1]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,[3,[{"file":"../src/main.ts","start":46,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]],4],"affectedFilesPendingEmit":[[3,1]]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -451,7 +451,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;", @@ -459,7 +459,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -499,7 +499,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1229 + "size": 1363 } @@ -611,7 +611,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -635,7 +635,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", @@ -643,7 +643,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -665,7 +665,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1057 + "size": 1191 } //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/errors-for-.d.ts-change.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/errors-for-.d.ts-change.js index 95aaa391d12..59e9152a272 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/errors-for-.d.ts-change.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/errors-for-.d.ts-change.js @@ -63,7 +63,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/myproject/c.d.ts (used version) /user/username/projects/myproject/b.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -102,7 +102,7 @@ export {}; //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-18774426152-export class C\n{\n d: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}","4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);"],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-18774426152-export class C\n{\n d: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}",{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -137,7 +137,7 @@ export {}; }, "./a.ts": { "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -153,9 +153,6 @@ export {}; ] }, "exportedModulesMap": { - "./a.ts": [ - "./b.d.ts" - ], "./b.d.ts": [ "./c.d.ts" ] @@ -168,7 +165,7 @@ export {}; ] }, "version": "FakeTSVersion", - "size": 958 + "size": 1003 } @@ -232,7 +229,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-21444928214-export class C\n{\n d2: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}","4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);"],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-21444928214-export class C\n{\n d2: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}",{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -267,7 +264,7 @@ exitCode:: ExitStatus.undefined }, "./a.ts": { "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -283,9 +280,6 @@ exitCode:: ExitStatus.undefined ] }, "exportedModulesMap": { - "./a.ts": [ - "./b.d.ts" - ], "./b.d.ts": [ "./c.d.ts" ] @@ -298,7 +292,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 959 + "size": 1004 } @@ -362,7 +356,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-18774426152-export class C\n{\n d: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}","4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);"],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-18774426152-export class C\n{\n d: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}",{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -397,7 +391,7 @@ exitCode:: ExitStatus.undefined }, "./a.ts": { "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -413,9 +407,6 @@ exitCode:: ExitStatus.undefined ] }, "exportedModulesMap": { - "./a.ts": [ - "./b.d.ts" - ], "./b.d.ts": [ "./c.d.ts" ] @@ -428,7 +419,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 958 + "size": 1003 } @@ -492,7 +483,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-21444928214-export class C\n{\n d2: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}","4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);"],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-21444928214-export class C\n{\n d2: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}",{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -527,7 +518,7 @@ exitCode:: ExitStatus.undefined }, "./a.ts": { "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -543,9 +534,6 @@ exitCode:: ExitStatus.undefined ] }, "exportedModulesMap": { - "./a.ts": [ - "./b.d.ts" - ], "./b.d.ts": [ "./c.d.ts" ] @@ -558,6 +546,6 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 959 + "size": 1004 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/errors-for-.ts-change.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/errors-for-.ts-change.js index 25e1c526708..34d7a6f01d1 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/errors-for-.ts-change.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/deepImportChanges/errors-for-.ts-change.js @@ -61,9 +61,9 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/c.ts (used version) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -140,7 +140,7 @@ export {}; //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-22447130237-export class C\n{\n d = 1;\n}","-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}","4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);"],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-22447130237-export class C\n{\n d = 1;\n}","signature":"-6977846840-export declare class C {\n d: number;\n}\n"},{"version":"-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}","signature":"-165097315-import { C } from './c';\nexport declare class B {\n c: C;\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -167,15 +167,15 @@ export {}; }, "./c.ts": { "version": "-22447130237-export class C\n{\n d = 1;\n}", - "signature": "-22447130237-export class C\n{\n d = 1;\n}" + "signature": "-6977846840-export declare class C {\n d: number;\n}\n" }, "./b.ts": { "version": "-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}", - "signature": "-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}" + "signature": "-165097315-import { C } from './c';\nexport declare class B {\n c: C;\n}\n" }, "./a.ts": { "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -191,9 +191,6 @@ export {}; ] }, "exportedModulesMap": { - "./a.ts": [ - "./b.ts" - ], "./b.ts": [ "./c.ts" ] @@ -206,7 +203,7 @@ export {}; ] }, "version": "FakeTSVersion", - "size": 957 + "size": 1190 } @@ -224,12 +221,7 @@ Output:: >> Screen clear [12:00:46 AM] File change detected. Starting incremental compilation... -a.ts:4:17 - error TS2339: Property 'd' does not exist on type 'C'. - -4 console.log(b.c.d); -   ~ - -[12:01:08 AM] Found 1 error. Watching for file changes. +[12:01:02 AM] Found 0 errors. Watching for file changes. @@ -245,12 +237,10 @@ Program files:: Semantic diagnostics in builder refreshed for:: /user/username/projects/myproject/c.ts /user/username/projects/myproject/b.ts -/user/username/projects/myproject/a.ts Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.ts (computed .d.ts) /user/username/projects/myproject/b.ts (computed .d.ts) -/user/username/projects/myproject/a.ts (computed .d.ts) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -295,10 +285,8 @@ export declare class C { //// [/user/username/projects/myproject/b.js] file written with same contents //// [/user/username/projects/myproject/b.d.ts] file written with same contents -//// [/user/username/projects/myproject/a.js] file written with same contents -//// [/user/username/projects/myproject/a.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-22846341163-export class C\n{\n d2 = 1;\n}","signature":"-4637923302-export declare class C {\n d2: number;\n}\n"},{"version":"-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}","signature":"-165097315-import { C } from './c';\nexport declare class B {\n c: C;\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,[4,[{"file":"./a.ts","start":82,"length":1,"code":2339,"category":1,"messageText":"Property 'd' does not exist on type 'C'."}]],3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-22846341163-export class C\n{\n d2 = 1;\n}","signature":"-4637923302-export declare class C {\n d2: number;\n}\n"},{"version":"-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}","signature":"-165097315-import { C } from './c';\nexport declare class B {\n c: C;\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -355,25 +343,13 @@ export declare class C { }, "semanticDiagnosticsPerFile": [ "../../../../a/lib/lib.d.ts", - [ - "./a.ts", - [ - { - "file": "./a.ts", - "start": 82, - "length": 1, - "code": 2339, - "category": 1, - "messageText": "Property 'd' does not exist on type 'C'." - } - ] - ], + "./a.ts", "./b.ts", "./c.ts" ] }, "version": "FakeTSVersion", - "size": 1318 + "size": 1192 } @@ -389,14 +365,9 @@ export class C Output:: >> Screen clear -[12:01:15 AM] File change detected. Starting incremental compilation... +[12:01:09 AM] File change detected. Starting incremental compilation... -a.ts:4:17 - error TS2339: Property 'd' does not exist on type 'C'. - -4 console.log(b.c.d); -   ~ - -[12:01:31 AM] Found 1 error. Watching for file changes. +[12:01:25 AM] Found 0 errors. Watching for file changes. @@ -461,7 +432,7 @@ export declare class C { //// [/user/username/projects/myproject/b.js] file written with same contents //// [/user/username/projects/myproject/b.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-22447130237-export class C\n{\n d = 1;\n}","signature":"-6977846840-export declare class C {\n d: number;\n}\n"},{"version":"-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}","signature":"-165097315-import { C } from './c';\nexport declare class B {\n c: C;\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,[4,[{"file":"./a.ts","start":82,"length":1,"code":2339,"category":1,"messageText":"Property 'd' does not exist on type 'C'."}]],3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-22447130237-export class C\n{\n d = 1;\n}","signature":"-6977846840-export declare class C {\n d: number;\n}\n"},{"version":"-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}","signature":"-165097315-import { C } from './c';\nexport declare class B {\n c: C;\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -518,25 +489,13 @@ export declare class C { }, "semanticDiagnosticsPerFile": [ "../../../../a/lib/lib.d.ts", - [ - "./a.ts", - [ - { - "file": "./a.ts", - "start": 82, - "length": 1, - "code": 2339, - "category": 1, - "messageText": "Property 'd' does not exist on type 'C'." - } - ] - ], + "./a.ts", "./b.ts", "./c.ts" ] }, "version": "FakeTSVersion", - "size": 1316 + "size": 1190 } @@ -552,14 +511,9 @@ export class C Output:: >> Screen clear -[12:01:38 AM] File change detected. Starting incremental compilation... +[12:01:32 AM] File change detected. Starting incremental compilation... -a.ts:4:17 - error TS2339: Property 'd' does not exist on type 'C'. - -4 console.log(b.c.d); -   ~ - -[12:01:54 AM] Found 1 error. Watching for file changes. +[12:01:48 AM] Found 0 errors. Watching for file changes. @@ -624,7 +578,7 @@ export declare class C { //// [/user/username/projects/myproject/b.js] file written with same contents //// [/user/username/projects/myproject/b.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-22846341163-export class C\n{\n d2 = 1;\n}","signature":"-4637923302-export declare class C {\n d2: number;\n}\n"},{"version":"-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}","signature":"-165097315-import { C } from './c';\nexport declare class B {\n c: C;\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,[4,[{"file":"./a.ts","start":82,"length":1,"code":2339,"category":1,"messageText":"Property 'd' does not exist on type 'C'."}]],3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-22846341163-export class C\n{\n d2 = 1;\n}","signature":"-4637923302-export declare class C {\n d2: number;\n}\n"},{"version":"-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}","signature":"-165097315-import { C } from './c';\nexport declare class B {\n c: C;\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -681,24 +635,12 @@ export declare class C { }, "semanticDiagnosticsPerFile": [ "../../../../a/lib/lib.d.ts", - [ - "./a.ts", - [ - { - "file": "./a.ts", - "start": 82, - "length": 1, - "code": 2339, - "category": 1, - "messageText": "Property 'd' does not exist on type 'C'." - } - ] - ], + "./a.ts", "./b.ts", "./c.ts" ] }, "version": "FakeTSVersion", - "size": 1318 + "size": 1192 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js index 8c4566702fc..684bae78c87 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -96,11 +96,11 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/c.ts (used version) -/user/username/projects/myproject/d.ts (used version) -/user/username/projects/myproject/e.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/d.ts (computed .d.ts during emit) +/user/username/projects/myproject/e.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -199,425 +199,7 @@ import "./d"; //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","-5185546240-import \"./d\";"],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[5,3],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":4,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} - -//// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "program": { - "fileNames": [ - "../../../../a/lib/lib.d.ts", - "./a.ts", - "./b.ts", - "./c.ts", - "./d.ts", - "./e.ts" - ], - "fileNamesList": [ - [ - "./a.ts" - ], - [ - "./b.ts" - ], - [ - "./c.ts" - ], - [ - "./d.ts" - ] - ], - "fileInfos": { - "../../../../a/lib/lib.d.ts": { - "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}", - "signature": "9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}" - }, - "./b.ts": { - "version": "-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}", - "signature": "-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}" - }, - "./c.ts": { - "version": "-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};", - "signature": "-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};" - }, - "./d.ts": { - "version": "-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;", - "signature": "-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;" - }, - "./e.ts": { - "version": "-5185546240-import \"./d\";", - "signature": "-5185546240-import \"./d\";" - } - }, - "options": { - "assumeChangesOnlyAffectDirectDependencies": true, - "declaration": true - }, - "referencedMap": { - "./b.ts": [ - "./a.ts" - ], - "./c.ts": [ - "./b.ts" - ], - "./d.ts": [ - "./c.ts" - ], - "./e.ts": [ - "./d.ts" - ] - }, - "exportedModulesMap": { - "./b.ts": [ - "./a.ts" - ], - "./c.ts": [ - "./b.ts" - ], - "./d.ts": [ - "./c.ts" - ], - "./e.ts": [ - "./d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../../../a/lib/lib.d.ts", - "./a.ts", - "./b.ts", - [ - "./c.ts", - [ - { - "file": "./c.ts", - "start": 139, - "length": 4, - "code": 2322, - "category": 1, - "messageText": { - "messageText": "Type '{ x: number; y: number; }' is not assignable to type 'Coords'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", - "category": 1, - "code": 2353 - } - ] - }, - "relatedInformation": [ - { - "file": "./a.ts", - "start": 47, - "length": 1, - "messageText": "The expected type comes from property 'c' which is declared here on type 'PointWrapper'", - "category": 3, - "code": 6500 - } - ] - } - ] - ], - [ - "./d.ts", - [ - { - "file": "./d.ts", - "start": 45, - "length": 1, - "code": 2339, - "category": 1, - "messageText": "Property 'x' does not exist on type 'Coords'." - } - ] - ], - "./e.ts" - ] - }, - "version": "FakeTSVersion", - "size": 1985 -} - - -Change:: Rename property x2 to x of interface Coords to initialize signatures - -Input:: -//// [/user/username/projects/myproject/a.ts] -export interface Point { - name: string; - c: Coords; -} -export interface Coords { - x: number; - y: number; -} - - -Output:: ->> Screen clear -[12:00:58 AM] File change detected. Starting incremental compilation... - -[12:01:32 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts","/user/username/projects/myproject/c.ts","/user/username/projects/myproject/d.ts","/user/username/projects/myproject/e.ts"] -Program options: {"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/a.ts -/user/username/projects/myproject/b.ts -/user/username/projects/myproject/c.ts -/user/username/projects/myproject/d.ts -/user/username/projects/myproject/e.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/myproject/a.ts -/user/username/projects/myproject/b.ts -/user/username/projects/myproject/c.ts -/user/username/projects/myproject/d.ts -/user/username/projects/myproject/e.ts - -Shape signatures in builder refreshed for:: -/user/username/projects/myproject/a.ts (computed .d.ts) -/user/username/projects/myproject/b.ts (computed .d.ts) -/user/username/projects/myproject/c.ts (computed .d.ts) -/user/username/projects/myproject/d.ts (computed .d.ts) -/user/username/projects/myproject/e.ts (computed .d.ts) - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/a.ts: - {"fileName":"/user/username/projects/myproject/a.ts","pollingInterval":250} -/user/username/projects/myproject/b.ts: - {"fileName":"/user/username/projects/myproject/b.ts","pollingInterval":250} -/user/username/projects/myproject/c.ts: - {"fileName":"/user/username/projects/myproject/c.ts","pollingInterval":250} -/user/username/projects/myproject/d.ts: - {"fileName":"/user/username/projects/myproject/d.ts","pollingInterval":250} -/user/username/projects/myproject/e.ts: - {"fileName":"/user/username/projects/myproject/e.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/myproject: - {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - -//// [/user/username/projects/myproject/a.js] file written with same contents -//// [/user/username/projects/myproject/a.d.ts] -export interface Point { - name: string; - c: Coords; -} -export interface Coords { - x: number; - y: number; -} - - -//// [/user/username/projects/myproject/b.js] file written with same contents -//// [/user/username/projects/myproject/b.d.ts] file written with same contents -//// [/user/username/projects/myproject/c.js] file written with same contents -//// [/user/username/projects/myproject/c.d.ts] file written with same contents -//// [/user/username/projects/myproject/d.js] file written with same contents -//// [/user/username/projects/myproject/d.d.ts] file written with same contents -//// [/user/username/projects/myproject/e.js] file written with same contents -//// [/user/username/projects/myproject/e.d.ts] file written with same contents -//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"2103509937-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}","signature":"696351195-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6]},"version":"FakeTSVersion"} - -//// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "program": { - "fileNames": [ - "../../../../a/lib/lib.d.ts", - "./a.ts", - "./b.ts", - "./c.ts", - "./d.ts", - "./e.ts" - ], - "fileNamesList": [ - [ - "./a.ts" - ], - [ - "./b.ts" - ], - [ - "./c.ts" - ], - [ - "./d.ts" - ] - ], - "fileInfos": { - "../../../../a/lib/lib.d.ts": { - "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "affectsGlobalScope": true - }, - "./a.ts": { - "version": "2103509937-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}", - "signature": "696351195-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}\n" - }, - "./b.ts": { - "version": "-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}", - "signature": "-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n" - }, - "./c.ts": { - "version": "-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};", - "signature": "-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n" - }, - "./d.ts": { - "version": "-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;", - "signature": "-3531856636-export {};\n" - }, - "./e.ts": { - "version": "-5185546240-import \"./d\";", - "signature": "-3619301366-import \"./d\";\n" - } - }, - "options": { - "assumeChangesOnlyAffectDirectDependencies": true, - "declaration": true - }, - "referencedMap": { - "./b.ts": [ - "./a.ts" - ], - "./c.ts": [ - "./b.ts" - ], - "./d.ts": [ - "./c.ts" - ], - "./e.ts": [ - "./d.ts" - ] - }, - "exportedModulesMap": { - "./b.ts": [ - "./a.ts" - ], - "./c.ts": [ - "./b.ts" - ], - "./e.ts": [ - "./d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../../../a/lib/lib.d.ts", - "./a.ts", - "./b.ts", - "./c.ts", - "./d.ts", - "./e.ts" - ] - }, - "version": "FakeTSVersion", - "size": 1836 -} - - -Change:: Rename property x to x2 of interface Coords to revert back to original text - -Input:: -//// [/user/username/projects/myproject/a.ts] -export interface Point { - name: string; - c: Coords; -} -export interface Coords { - x2: number; - y: number; -} - - -Output:: ->> Screen clear -[12:01:39 AM] File change detected. Starting incremental compilation... - -[12:01:55 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts","/user/username/projects/myproject/c.ts","/user/username/projects/myproject/d.ts","/user/username/projects/myproject/e.ts"] -Program options: {"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/a.ts -/user/username/projects/myproject/b.ts -/user/username/projects/myproject/c.ts -/user/username/projects/myproject/d.ts -/user/username/projects/myproject/e.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/myproject/a.ts -/user/username/projects/myproject/b.ts - -Shape signatures in builder refreshed for:: -/user/username/projects/myproject/a.ts (computed .d.ts) -/user/username/projects/myproject/b.ts (computed .d.ts) - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/a.ts: - {"fileName":"/user/username/projects/myproject/a.ts","pollingInterval":250} -/user/username/projects/myproject/b.ts: - {"fileName":"/user/username/projects/myproject/b.ts","pollingInterval":250} -/user/username/projects/myproject/c.ts: - {"fileName":"/user/username/projects/myproject/c.ts","pollingInterval":250} -/user/username/projects/myproject/d.ts: - {"fileName":"/user/username/projects/myproject/d.ts","pollingInterval":250} -/user/username/projects/myproject/e.ts: - {"fileName":"/user/username/projects/myproject/e.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} -/user/username/projects/myproject: - {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - -//// [/user/username/projects/myproject/a.js] file written with same contents -//// [/user/username/projects/myproject/a.d.ts] -export interface Point { - name: string; - c: Coords; -} -export interface Coords { - x2: number; - y: number; -} - - -//// [/user/username/projects/myproject/b.js] file written with same contents -//// [/user/username/projects/myproject/b.d.ts] file written with same contents -//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":4,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -704,17 +286,62 @@ export interface Coords { "../../../../a/lib/lib.d.ts", "./a.ts", "./b.ts", - "./c.ts", - "./d.ts", + [ + "./c.ts", + [ + { + "file": "./c.ts", + "start": 139, + "length": 4, + "code": 2322, + "category": 1, + "messageText": { + "messageText": "Type '{ x: number; y: number; }' is not assignable to type 'Coords'.", + "category": 1, + "code": 2322, + "next": [ + { + "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", + "category": 1, + "code": 2353 + } + ] + }, + "relatedInformation": [ + { + "file": "./a.ts", + "start": 47, + "length": 1, + "messageText": "The expected type comes from property 'c' which is declared here on type 'PointWrapper'", + "category": 3, + "code": 6500 + } + ] + } + ] + ], + [ + "./d.ts", + [ + { + "file": "./d.ts", + "start": 45, + "length": 1, + "code": 2339, + "category": 1, + "messageText": "Property 'x' does not exist on type 'Coords'." + } + ] + ], "./e.ts" ] }, "version": "FakeTSVersion", - "size": 1839 + "size": 2501 } -Change:: Rename property x2 to x of interface Coords +Change:: Rename property x2 to x of interface Coords to initialize signatures Input:: //// [/user/username/projects/myproject/a.ts] @@ -730,9 +357,25 @@ export interface Coords { Output:: >> Screen clear -[12:02:02 AM] File change detected. Starting incremental compilation... +[12:00:58 AM] File change detected. Starting incremental compilation... -[12:02:18 AM] Found 0 errors. Watching for file changes. +c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. + Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. + +6 x: 1, +   ~~~~ + + a.ts:3:5 + 3 c: Coords; +    ~ + The expected type comes from property 'c' which is declared here on type 'PointWrapper' + +d.ts:2:14 - error TS2339: Property 'x' does not exist on type 'Coords'. + +2 getPoint().c.x; +   ~ + +[12:01:14 AM] Found 2 errors. Watching for file changes. @@ -796,7 +439,7 @@ export interface Coords { //// [/user/username/projects/myproject/b.js] file written with same contents //// [/user/username/projects/myproject/b.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"2103509937-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}","signature":"696351195-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"2103509937-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}","signature":"696351195-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":4,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -883,12 +526,537 @@ export interface Coords { "../../../../a/lib/lib.d.ts", "./a.ts", "./b.ts", - "./c.ts", - "./d.ts", + [ + "./c.ts", + [ + { + "file": "./c.ts", + "start": 139, + "length": 4, + "code": 2322, + "category": 1, + "messageText": { + "messageText": "Type '{ x: number; y: number; }' is not assignable to type 'Coords'.", + "category": 1, + "code": 2322, + "next": [ + { + "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", + "category": 1, + "code": 2353 + } + ] + }, + "relatedInformation": [ + { + "file": "./a.ts", + "start": 47, + "length": 1, + "messageText": "The expected type comes from property 'c' which is declared here on type 'PointWrapper'", + "category": 3, + "code": 6500 + } + ] + } + ] + ], + [ + "./d.ts", + [ + { + "file": "./d.ts", + "start": 45, + "length": 1, + "code": 2339, + "category": 1, + "messageText": "Property 'x' does not exist on type 'Coords'." + } + ] + ], "./e.ts" ] }, "version": "FakeTSVersion", - "size": 1836 + "size": 2498 +} + + +Change:: Rename property x to x2 of interface Coords to revert back to original text + +Input:: +//// [/user/username/projects/myproject/a.ts] +export interface Point { + name: string; + c: Coords; +} +export interface Coords { + x2: number; + y: number; +} + + +Output:: +>> Screen clear +[12:01:21 AM] File change detected. Starting incremental compilation... + +c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. + Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. + +6 x: 1, +   ~~~~ + + a.ts:3:5 + 3 c: Coords; +    ~ + The expected type comes from property 'c' which is declared here on type 'PointWrapper' + +d.ts:2:14 - error TS2339: Property 'x' does not exist on type 'Coords'. + +2 getPoint().c.x; +   ~ + +[12:01:37 AM] Found 2 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts","/user/username/projects/myproject/c.ts","/user/username/projects/myproject/d.ts","/user/username/projects/myproject/e.ts"] +Program options: {"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts +/user/username/projects/myproject/c.ts +/user/username/projects/myproject/d.ts +/user/username/projects/myproject/e.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/myproject/a.ts (computed .d.ts) +/user/username/projects/myproject/b.ts (computed .d.ts) + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/a.ts: + {"fileName":"/user/username/projects/myproject/a.ts","pollingInterval":250} +/user/username/projects/myproject/b.ts: + {"fileName":"/user/username/projects/myproject/b.ts","pollingInterval":250} +/user/username/projects/myproject/c.ts: + {"fileName":"/user/username/projects/myproject/c.ts","pollingInterval":250} +/user/username/projects/myproject/d.ts: + {"fileName":"/user/username/projects/myproject/d.ts","pollingInterval":250} +/user/username/projects/myproject/e.ts: + {"fileName":"/user/username/projects/myproject/e.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/myproject: + {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents +//// [/user/username/projects/myproject/a.d.ts] +export interface Point { + name: string; + c: Coords; +} +export interface Coords { + x2: number; + y: number; +} + + +//// [/user/username/projects/myproject/b.js] file written with same contents +//// [/user/username/projects/myproject/b.d.ts] file written with same contents +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":4,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} + +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts", + "./e.ts" + ], + "fileNamesList": [ + [ + "./a.ts" + ], + [ + "./b.ts" + ], + [ + "./c.ts" + ], + [ + "./d.ts" + ] + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}", + "signature": "8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n" + }, + "./b.ts": { + "version": "-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}", + "signature": "-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n" + }, + "./c.ts": { + "version": "-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};", + "signature": "-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n" + }, + "./d.ts": { + "version": "-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;", + "signature": "-3531856636-export {};\n" + }, + "./e.ts": { + "version": "-5185546240-import \"./d\";", + "signature": "-3619301366-import \"./d\";\n" + } + }, + "options": { + "assumeChangesOnlyAffectDirectDependencies": true, + "declaration": true + }, + "referencedMap": { + "./b.ts": [ + "./a.ts" + ], + "./c.ts": [ + "./b.ts" + ], + "./d.ts": [ + "./c.ts" + ], + "./e.ts": [ + "./d.ts" + ] + }, + "exportedModulesMap": { + "./b.ts": [ + "./a.ts" + ], + "./c.ts": [ + "./b.ts" + ], + "./e.ts": [ + "./d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts", + [ + "./c.ts", + [ + { + "file": "./c.ts", + "start": 139, + "length": 4, + "code": 2322, + "category": 1, + "messageText": { + "messageText": "Type '{ x: number; y: number; }' is not assignable to type 'Coords'.", + "category": 1, + "code": 2322, + "next": [ + { + "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", + "category": 1, + "code": 2353 + } + ] + }, + "relatedInformation": [ + { + "file": "./a.ts", + "start": 47, + "length": 1, + "messageText": "The expected type comes from property 'c' which is declared here on type 'PointWrapper'", + "category": 3, + "code": 6500 + } + ] + } + ] + ], + [ + "./d.ts", + [ + { + "file": "./d.ts", + "start": 45, + "length": 1, + "code": 2339, + "category": 1, + "messageText": "Property 'x' does not exist on type 'Coords'." + } + ] + ], + "./e.ts" + ] + }, + "version": "FakeTSVersion", + "size": 2501 +} + + +Change:: Rename property x2 to x of interface Coords + +Input:: +//// [/user/username/projects/myproject/a.ts] +export interface Point { + name: string; + c: Coords; +} +export interface Coords { + x: number; + y: number; +} + + +Output:: +>> Screen clear +[12:01:44 AM] File change detected. Starting incremental compilation... + +c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. + Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. + +6 x: 1, +   ~~~~ + + a.ts:3:5 + 3 c: Coords; +    ~ + The expected type comes from property 'c' which is declared here on type 'PointWrapper' + +d.ts:2:14 - error TS2339: Property 'x' does not exist on type 'Coords'. + +2 getPoint().c.x; +   ~ + +[12:02:00 AM] Found 2 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/b.ts","/user/username/projects/myproject/c.ts","/user/username/projects/myproject/d.ts","/user/username/projects/myproject/e.ts"] +Program options: {"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts +/user/username/projects/myproject/c.ts +/user/username/projects/myproject/d.ts +/user/username/projects/myproject/e.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/b.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/myproject/a.ts (computed .d.ts) +/user/username/projects/myproject/b.ts (computed .d.ts) + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/a.ts: + {"fileName":"/user/username/projects/myproject/a.ts","pollingInterval":250} +/user/username/projects/myproject/b.ts: + {"fileName":"/user/username/projects/myproject/b.ts","pollingInterval":250} +/user/username/projects/myproject/c.ts: + {"fileName":"/user/username/projects/myproject/c.ts","pollingInterval":250} +/user/username/projects/myproject/d.ts: + {"fileName":"/user/username/projects/myproject/d.ts","pollingInterval":250} +/user/username/projects/myproject/e.ts: + {"fileName":"/user/username/projects/myproject/e.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} +/user/username/projects/myproject: + {"directoryName":"/user/username/projects/myproject","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents +//// [/user/username/projects/myproject/a.d.ts] +export interface Point { + name: string; + c: Coords; +} +export interface Coords { + x: number; + y: number; +} + + +//// [/user/username/projects/myproject/b.js] file written with same contents +//// [/user/username/projects/myproject/b.d.ts] file written with same contents +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"2103509937-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}","signature":"696351195-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":4,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} + +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts", + "./e.ts" + ], + "fileNamesList": [ + [ + "./a.ts" + ], + [ + "./b.ts" + ], + [ + "./c.ts" + ], + [ + "./d.ts" + ] + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "2103509937-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}", + "signature": "696351195-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}\n" + }, + "./b.ts": { + "version": "-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}", + "signature": "-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n" + }, + "./c.ts": { + "version": "-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};", + "signature": "-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n" + }, + "./d.ts": { + "version": "-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;", + "signature": "-3531856636-export {};\n" + }, + "./e.ts": { + "version": "-5185546240-import \"./d\";", + "signature": "-3619301366-import \"./d\";\n" + } + }, + "options": { + "assumeChangesOnlyAffectDirectDependencies": true, + "declaration": true + }, + "referencedMap": { + "./b.ts": [ + "./a.ts" + ], + "./c.ts": [ + "./b.ts" + ], + "./d.ts": [ + "./c.ts" + ], + "./e.ts": [ + "./d.ts" + ] + }, + "exportedModulesMap": { + "./b.ts": [ + "./a.ts" + ], + "./c.ts": [ + "./b.ts" + ], + "./e.ts": [ + "./d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts", + [ + "./c.ts", + [ + { + "file": "./c.ts", + "start": 139, + "length": 4, + "code": 2322, + "category": 1, + "messageText": { + "messageText": "Type '{ x: number; y: number; }' is not assignable to type 'Coords'.", + "category": 1, + "code": 2322, + "next": [ + { + "messageText": "Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.", + "category": 1, + "code": 2353 + } + ] + }, + "relatedInformation": [ + { + "file": "./a.ts", + "start": 47, + "length": 1, + "messageText": "The expected type comes from property 'c' which is declared here on type 'PointWrapper'", + "category": 3, + "code": 6500 + } + ] + } + ] + ], + [ + "./d.ts", + [ + { + "file": "./d.ts", + "start": 45, + "length": 1, + "code": 2339, + "category": 1, + "messageText": "Property 'x' does not exist on type 'Coords'." + } + ] + ], + "./e.ts" + ] + }, + "version": "FakeTSVersion", + "size": 2498 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/transitive-exports/no-circular-import/export.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/transitive-exports/no-circular-import/export.js index e9705bfdad7..21eff29fc59 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/transitive-exports/no-circular-import/export.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/transitive-exports/no-circular-import/export.js @@ -81,12 +81,12 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/lib1/tools/tools.interface.ts (used version) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -243,431 +243,7 @@ export declare class App { //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-4369626085-export interface ITest {\n title: string;\n}","-13301115055-export * from \"./tools.interface\";","-5078933600-export * from \"./tools/public\";","-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,5,6]},"version":"FakeTSVersion"} - -//// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "program": { - "fileNames": [ - "../../../../a/lib/lib.d.ts", - "./lib1/tools/tools.interface.ts", - "./lib1/tools/public.ts", - "./lib1/public.ts", - "./lib2/data.ts", - "./lib2/public.ts", - "./app.ts" - ], - "fileNamesList": [ - [ - "./lib2/public.ts" - ], - [ - "./lib1/tools/public.ts" - ], - [ - "./lib1/tools/tools.interface.ts" - ], - [ - "./lib1/public.ts" - ], - [ - "./lib2/data.ts" - ] - ], - "fileInfos": { - "../../../../a/lib/lib.d.ts": { - "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "affectsGlobalScope": true - }, - "./lib1/tools/tools.interface.ts": { - "version": "-4369626085-export interface ITest {\n title: string;\n}", - "signature": "-4369626085-export interface ITest {\n title: string;\n}" - }, - "./lib1/tools/public.ts": { - "version": "-13301115055-export * from \"./tools.interface\";", - "signature": "-13301115055-export * from \"./tools.interface\";" - }, - "./lib1/public.ts": { - "version": "-5078933600-export * from \"./tools/public\";", - "signature": "-5078933600-export * from \"./tools/public\";" - }, - "./lib2/data.ts": { - "version": "-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}", - "signature": "-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}" - }, - "./lib2/public.ts": { - "version": "-9530042629-export * from \"./data\";", - "signature": "-9530042629-export * from \"./data\";" - }, - "./app.ts": { - "version": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}", - "signature": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}" - } - }, - "options": { - "assumeChangesOnlyAffectDirectDependencies": true, - "declaration": true - }, - "referencedMap": { - "./app.ts": [ - "./lib2/public.ts" - ], - "./lib1/public.ts": [ - "./lib1/tools/public.ts" - ], - "./lib1/tools/public.ts": [ - "./lib1/tools/tools.interface.ts" - ], - "./lib2/data.ts": [ - "./lib1/public.ts" - ], - "./lib2/public.ts": [ - "./lib2/data.ts" - ] - }, - "exportedModulesMap": { - "./app.ts": [ - "./lib2/public.ts" - ], - "./lib1/public.ts": [ - "./lib1/tools/public.ts" - ], - "./lib1/tools/public.ts": [ - "./lib1/tools/tools.interface.ts" - ], - "./lib2/data.ts": [ - "./lib1/public.ts" - ], - "./lib2/public.ts": [ - "./lib2/data.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../../../a/lib/lib.d.ts", - "./app.ts", - "./lib1/public.ts", - "./lib1/tools/public.ts", - "./lib1/tools/tools.interface.ts", - "./lib2/data.ts", - "./lib2/public.ts" - ] - }, - "version": "FakeTSVersion", - "size": 1427 -} - - -Change:: Rename property title to title2 of interface ITest to initialize signatures - -Input:: -//// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] -export interface ITest { - title2: string; -} - - -Output:: ->> Screen clear -[12:01:10 AM] File change detected. Starting incremental compilation... - -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? - -5 title: "title" -   ~~~~~~~~~~~~~~ - -[12:01:50 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Shape signatures in builder refreshed for:: -/user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) -/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts) -/user/username/projects/myproject/lib1/public.ts (computed .d.ts) -/user/username/projects/myproject/lib2/data.ts (computed .d.ts) -/user/username/projects/myproject/lib2/public.ts (computed .d.ts) -/user/username/projects/myproject/app.ts (computed .d.ts) - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] -export interface ITest { - title2: string; -} - - -//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib1/public.js] file written with same contents -//// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data.js] file written with same contents -//// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/public.js] file written with same contents -//// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/app.js] file written with same contents -//// [/user/username/projects/myproject/app.d.ts] file written with same contents -//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":14,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],6]},"version":"FakeTSVersion"} - -//// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "program": { - "fileNames": [ - "../../../../a/lib/lib.d.ts", - "./lib1/tools/tools.interface.ts", - "./lib1/tools/public.ts", - "./lib1/public.ts", - "./lib2/data.ts", - "./lib2/public.ts", - "./app.ts" - ], - "fileNamesList": [ - [ - "./lib2/public.ts" - ], - [ - "./lib1/tools/public.ts" - ], - [ - "./lib1/tools/tools.interface.ts" - ], - [ - "./lib1/public.ts" - ], - [ - "./lib2/data.ts" - ] - ], - "fileInfos": { - "../../../../a/lib/lib.d.ts": { - "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "affectsGlobalScope": true - }, - "./lib1/tools/tools.interface.ts": { - "version": "-3501597171-export interface ITest {\n title2: string;\n}", - "signature": "-3883556937-export interface ITest {\n title2: string;\n}\n" - }, - "./lib1/tools/public.ts": { - "version": "-13301115055-export * from \"./tools.interface\";", - "signature": "-13735034501-export * from \"./tools.interface\";\n" - }, - "./lib1/public.ts": { - "version": "-5078933600-export * from \"./tools/public\";", - "signature": "-4396051542-export * from \"./tools/public\";\n" - }, - "./lib2/data.ts": { - "version": "-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}", - "signature": "-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n" - }, - "./lib2/public.ts": { - "version": "-9530042629-export * from \"./data\";", - "signature": "-9548728731-export * from \"./data\";\n" - }, - "./app.ts": { - "version": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}", - "signature": "-18990360330-export declare class App {\n constructor();\n}\n" - } - }, - "options": { - "assumeChangesOnlyAffectDirectDependencies": true, - "declaration": true - }, - "referencedMap": { - "./app.ts": [ - "./lib2/public.ts" - ], - "./lib1/public.ts": [ - "./lib1/tools/public.ts" - ], - "./lib1/tools/public.ts": [ - "./lib1/tools/tools.interface.ts" - ], - "./lib2/data.ts": [ - "./lib1/public.ts" - ], - "./lib2/public.ts": [ - "./lib2/data.ts" - ] - }, - "exportedModulesMap": { - "./lib1/public.ts": [ - "./lib1/tools/public.ts" - ], - "./lib1/tools/public.ts": [ - "./lib1/tools/tools.interface.ts" - ], - "./lib2/data.ts": [ - "./lib1/public.ts" - ], - "./lib2/public.ts": [ - "./lib2/data.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../../../a/lib/lib.d.ts", - "./app.ts", - "./lib1/public.ts", - "./lib1/tools/public.ts", - "./lib1/tools/tools.interface.ts", - [ - "./lib2/data.ts", - [ - { - "file": "./lib2/data.ts", - "start": 121, - "length": 14, - "code": 2322, - "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } - } - ] - ], - "./lib2/public.ts" - ] - }, - "version": "FakeTSVersion", - "size": 2327 -} - - -Change:: Rename property title2 to title of interface ITest to revert back to original text - -Input:: -//// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] -export interface ITest { - title: string; -} - - -Output:: ->> Screen clear -[12:01:57 AM] File change detected. Starting incremental compilation... - -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? - -5 title: "title" -   ~~~~~~~~~~~~~~ - -[12:02:13 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts - -Shape signatures in builder refreshed for:: -/user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) -/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts) - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] -export interface ITest { - title: string; -} - - -//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-4369626085-export interface ITest {\n title: string;\n}","signature":"-2463740027-export interface ITest {\n title: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":14,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-4369626085-export interface ITest {\n title: string;\n}","signature":"-2463740027-export interface ITest {\n title: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,5,6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -770,39 +346,16 @@ export interface ITest { "./lib1/public.ts", "./lib1/tools/public.ts", "./lib1/tools/tools.interface.ts", - [ - "./lib2/data.ts", - [ - { - "file": "./lib2/data.ts", - "start": 121, - "length": 14, - "code": 2322, - "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } - } - ] - ], + "./lib2/data.ts", "./lib2/public.ts" ] }, "version": "FakeTSVersion", - "size": 2325 + "size": 1950 } -Change:: Rename property title to title2 of interface ITest +Change:: Rename property title to title2 of interface ITest to initialize signatures Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] @@ -813,15 +366,9 @@ export interface ITest { Output:: >> Screen clear -[12:02:20 AM] File change detected. Starting incremental compilation... +[12:01:10 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? - -5 title: "title" -   ~~~~~~~~~~~~~~ - -[12:02:36 AM] Found 1 error. Watching for file changes. +[12:01:26 AM] Found 0 errors. Watching for file changes. @@ -881,7 +428,7 @@ export interface ITest { //// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents //// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":14,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,5,6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -984,34 +531,381 @@ export interface ITest { "./lib1/public.ts", "./lib1/tools/public.ts", "./lib1/tools/tools.interface.ts", - [ - "./lib2/data.ts", - [ - { - "file": "./lib2/data.ts", - "start": 121, - "length": 14, - "code": 2322, - "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } - } - ] - ], + "./lib2/data.ts", "./lib2/public.ts" ] }, "version": "FakeTSVersion", - "size": 2327 + "size": 1952 +} + + +Change:: Rename property title2 to title of interface ITest to revert back to original text + +Input:: +//// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] +export interface ITest { + title: string; +} + + +Output:: +>> Screen clear +[12:01:33 AM] File change detected. Starting incremental compilation... + +[12:01:49 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts) + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] +export interface ITest { + title: string; +} + + +//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-4369626085-export interface ITest {\n title: string;\n}","signature":"-2463740027-export interface ITest {\n title: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,5,6]},"version":"FakeTSVersion"} + +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./lib1/tools/tools.interface.ts", + "./lib1/tools/public.ts", + "./lib1/public.ts", + "./lib2/data.ts", + "./lib2/public.ts", + "./app.ts" + ], + "fileNamesList": [ + [ + "./lib2/public.ts" + ], + [ + "./lib1/tools/public.ts" + ], + [ + "./lib1/tools/tools.interface.ts" + ], + [ + "./lib1/public.ts" + ], + [ + "./lib2/data.ts" + ] + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./lib1/tools/tools.interface.ts": { + "version": "-4369626085-export interface ITest {\n title: string;\n}", + "signature": "-2463740027-export interface ITest {\n title: string;\n}\n" + }, + "./lib1/tools/public.ts": { + "version": "-13301115055-export * from \"./tools.interface\";", + "signature": "-13735034501-export * from \"./tools.interface\";\n" + }, + "./lib1/public.ts": { + "version": "-5078933600-export * from \"./tools/public\";", + "signature": "-4396051542-export * from \"./tools/public\";\n" + }, + "./lib2/data.ts": { + "version": "-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}", + "signature": "-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n" + }, + "./lib2/public.ts": { + "version": "-9530042629-export * from \"./data\";", + "signature": "-9548728731-export * from \"./data\";\n" + }, + "./app.ts": { + "version": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}", + "signature": "-18990360330-export declare class App {\n constructor();\n}\n" + } + }, + "options": { + "assumeChangesOnlyAffectDirectDependencies": true, + "declaration": true + }, + "referencedMap": { + "./app.ts": [ + "./lib2/public.ts" + ], + "./lib1/public.ts": [ + "./lib1/tools/public.ts" + ], + "./lib1/tools/public.ts": [ + "./lib1/tools/tools.interface.ts" + ], + "./lib2/data.ts": [ + "./lib1/public.ts" + ], + "./lib2/public.ts": [ + "./lib2/data.ts" + ] + }, + "exportedModulesMap": { + "./lib1/public.ts": [ + "./lib1/tools/public.ts" + ], + "./lib1/tools/public.ts": [ + "./lib1/tools/tools.interface.ts" + ], + "./lib2/data.ts": [ + "./lib1/public.ts" + ], + "./lib2/public.ts": [ + "./lib2/data.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "./app.ts", + "./lib1/public.ts", + "./lib1/tools/public.ts", + "./lib1/tools/tools.interface.ts", + "./lib2/data.ts", + "./lib2/public.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1950 +} + + +Change:: Rename property title to title2 of interface ITest + +Input:: +//// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] +export interface ITest { + title2: string; +} + + +Output:: +>> Screen clear +[12:01:56 AM] File change detected. Starting incremental compilation... + +[12:02:12 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts) + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] +export interface ITest { + title2: string; +} + + +//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,5,6]},"version":"FakeTSVersion"} + +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./lib1/tools/tools.interface.ts", + "./lib1/tools/public.ts", + "./lib1/public.ts", + "./lib2/data.ts", + "./lib2/public.ts", + "./app.ts" + ], + "fileNamesList": [ + [ + "./lib2/public.ts" + ], + [ + "./lib1/tools/public.ts" + ], + [ + "./lib1/tools/tools.interface.ts" + ], + [ + "./lib1/public.ts" + ], + [ + "./lib2/data.ts" + ] + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./lib1/tools/tools.interface.ts": { + "version": "-3501597171-export interface ITest {\n title2: string;\n}", + "signature": "-3883556937-export interface ITest {\n title2: string;\n}\n" + }, + "./lib1/tools/public.ts": { + "version": "-13301115055-export * from \"./tools.interface\";", + "signature": "-13735034501-export * from \"./tools.interface\";\n" + }, + "./lib1/public.ts": { + "version": "-5078933600-export * from \"./tools/public\";", + "signature": "-4396051542-export * from \"./tools/public\";\n" + }, + "./lib2/data.ts": { + "version": "-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}", + "signature": "-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n" + }, + "./lib2/public.ts": { + "version": "-9530042629-export * from \"./data\";", + "signature": "-9548728731-export * from \"./data\";\n" + }, + "./app.ts": { + "version": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}", + "signature": "-18990360330-export declare class App {\n constructor();\n}\n" + } + }, + "options": { + "assumeChangesOnlyAffectDirectDependencies": true, + "declaration": true + }, + "referencedMap": { + "./app.ts": [ + "./lib2/public.ts" + ], + "./lib1/public.ts": [ + "./lib1/tools/public.ts" + ], + "./lib1/tools/public.ts": [ + "./lib1/tools/tools.interface.ts" + ], + "./lib2/data.ts": [ + "./lib1/public.ts" + ], + "./lib2/public.ts": [ + "./lib2/data.ts" + ] + }, + "exportedModulesMap": { + "./lib1/public.ts": [ + "./lib1/tools/public.ts" + ], + "./lib1/tools/public.ts": [ + "./lib1/tools/tools.interface.ts" + ], + "./lib2/data.ts": [ + "./lib1/public.ts" + ], + "./lib2/public.ts": [ + "./lib2/data.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "./app.ts", + "./lib1/public.ts", + "./lib1/tools/public.ts", + "./lib1/tools/tools.interface.ts", + "./lib2/data.ts", + "./lib2/public.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1952 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/transitive-exports/yes-circular-import/exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/transitive-exports/yes-circular-import/exports.js index b3d83d79b0a..a0b4491f090 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/transitive-exports/yes-circular-import/exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/transitive-exports/yes-circular-import/exports.js @@ -89,13 +89,13 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/lib1/tools/tools.interface.ts (used version) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data2.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data2.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -275,471 +275,7 @@ export declare class App { //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-4369626085-export interface ITest {\n title: string;\n}","-13301115055-export * from \"./tools.interface\";","-5078933600-export * from \"./tools/public\";","-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,6,5,7]},"version":"FakeTSVersion"} - -//// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "program": { - "fileNames": [ - "../../../../a/lib/lib.d.ts", - "./lib1/tools/tools.interface.ts", - "./lib1/tools/public.ts", - "./lib1/public.ts", - "./lib2/data2.ts", - "./lib2/data.ts", - "./lib2/public.ts", - "./app.ts" - ], - "fileNamesList": [ - [ - "./lib2/public.ts" - ], - [ - "./lib1/tools/public.ts" - ], - [ - "./lib1/tools/tools.interface.ts" - ], - [ - "./lib1/public.ts", - "./lib2/data2.ts" - ], - [ - "./lib2/data.ts" - ] - ], - "fileInfos": { - "../../../../a/lib/lib.d.ts": { - "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "affectsGlobalScope": true - }, - "./lib1/tools/tools.interface.ts": { - "version": "-4369626085-export interface ITest {\n title: string;\n}", - "signature": "-4369626085-export interface ITest {\n title: string;\n}" - }, - "./lib1/tools/public.ts": { - "version": "-13301115055-export * from \"./tools.interface\";", - "signature": "-13301115055-export * from \"./tools.interface\";" - }, - "./lib1/public.ts": { - "version": "-5078933600-export * from \"./tools/public\";", - "signature": "-5078933600-export * from \"./tools/public\";" - }, - "./lib2/data2.ts": { - "version": "-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}", - "signature": "-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}" - }, - "./lib2/data.ts": { - "version": "-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}", - "signature": "-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}" - }, - "./lib2/public.ts": { - "version": "-9530042629-export * from \"./data\";", - "signature": "-9530042629-export * from \"./data\";" - }, - "./app.ts": { - "version": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}", - "signature": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}" - } - }, - "options": { - "assumeChangesOnlyAffectDirectDependencies": true, - "declaration": true - }, - "referencedMap": { - "./app.ts": [ - "./lib2/public.ts" - ], - "./lib1/public.ts": [ - "./lib1/tools/public.ts" - ], - "./lib1/tools/public.ts": [ - "./lib1/tools/tools.interface.ts" - ], - "./lib2/data.ts": [ - "./lib1/public.ts", - "./lib2/data2.ts" - ], - "./lib2/data2.ts": [ - "./lib2/data.ts" - ], - "./lib2/public.ts": [ - "./lib2/data.ts" - ] - }, - "exportedModulesMap": { - "./app.ts": [ - "./lib2/public.ts" - ], - "./lib1/public.ts": [ - "./lib1/tools/public.ts" - ], - "./lib1/tools/public.ts": [ - "./lib1/tools/tools.interface.ts" - ], - "./lib2/data.ts": [ - "./lib1/public.ts", - "./lib2/data2.ts" - ], - "./lib2/data2.ts": [ - "./lib2/data.ts" - ], - "./lib2/public.ts": [ - "./lib2/data.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../../../a/lib/lib.d.ts", - "./app.ts", - "./lib1/public.ts", - "./lib1/tools/public.ts", - "./lib1/tools/tools.interface.ts", - "./lib2/data.ts", - "./lib2/data2.ts", - "./lib2/public.ts" - ] - }, - "version": "FakeTSVersion", - "size": 1612 -} - - -Change:: Rename property title to title2 of interface ITest to initialize signatures - -Input:: -//// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] -export interface ITest { - title2: string; -} - - -Output:: ->> Screen clear -[12:01:16 AM] File change detected. Starting incremental compilation... - -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? - -5 title: "title" -   ~~~~~~~~~~~~~~ - -[12:02:02 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Shape signatures in builder refreshed for:: -/user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) -/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts) -/user/username/projects/myproject/lib1/public.ts (computed .d.ts) -/user/username/projects/myproject/lib2/data.ts (computed .d.ts) -/user/username/projects/myproject/lib2/public.ts (computed .d.ts) -/user/username/projects/myproject/app.ts (computed .d.ts) -/user/username/projects/myproject/lib2/data2.ts (computed .d.ts) - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data2.ts: - {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] -export interface ITest { - title2: string; -} - - -//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib1/public.js] file written with same contents -//// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data2.js] file written with same contents -//// [/user/username/projects/myproject/lib2/data2.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data.js] file written with same contents -//// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/public.js] file written with same contents -//// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/app.js] file written with same contents -//// [/user/username/projects/myproject/app.d.ts] file written with same contents -//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":14,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],5,7]},"version":"FakeTSVersion"} - -//// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "program": { - "fileNames": [ - "../../../../a/lib/lib.d.ts", - "./lib1/tools/tools.interface.ts", - "./lib1/tools/public.ts", - "./lib1/public.ts", - "./lib2/data2.ts", - "./lib2/data.ts", - "./lib2/public.ts", - "./app.ts" - ], - "fileNamesList": [ - [ - "./lib2/public.ts" - ], - [ - "./lib1/tools/public.ts" - ], - [ - "./lib1/tools/tools.interface.ts" - ], - [ - "./lib1/public.ts", - "./lib2/data2.ts" - ], - [ - "./lib2/data.ts" - ] - ], - "fileInfos": { - "../../../../a/lib/lib.d.ts": { - "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "affectsGlobalScope": true - }, - "./lib1/tools/tools.interface.ts": { - "version": "-3501597171-export interface ITest {\n title2: string;\n}", - "signature": "-3883556937-export interface ITest {\n title2: string;\n}\n" - }, - "./lib1/tools/public.ts": { - "version": "-13301115055-export * from \"./tools.interface\";", - "signature": "-13735034501-export * from \"./tools.interface\";\n" - }, - "./lib1/public.ts": { - "version": "-5078933600-export * from \"./tools/public\";", - "signature": "-4396051542-export * from \"./tools/public\";\n" - }, - "./lib2/data2.ts": { - "version": "-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}", - "signature": "-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n" - }, - "./lib2/data.ts": { - "version": "-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}", - "signature": "-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n" - }, - "./lib2/public.ts": { - "version": "-9530042629-export * from \"./data\";", - "signature": "-9548728731-export * from \"./data\";\n" - }, - "./app.ts": { - "version": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}", - "signature": "-18990360330-export declare class App {\n constructor();\n}\n" - } - }, - "options": { - "assumeChangesOnlyAffectDirectDependencies": true, - "declaration": true - }, - "referencedMap": { - "./app.ts": [ - "./lib2/public.ts" - ], - "./lib1/public.ts": [ - "./lib1/tools/public.ts" - ], - "./lib1/tools/public.ts": [ - "./lib1/tools/tools.interface.ts" - ], - "./lib2/data.ts": [ - "./lib1/public.ts", - "./lib2/data2.ts" - ], - "./lib2/data2.ts": [ - "./lib2/data.ts" - ], - "./lib2/public.ts": [ - "./lib2/data.ts" - ] - }, - "exportedModulesMap": { - "./lib1/public.ts": [ - "./lib1/tools/public.ts" - ], - "./lib1/tools/public.ts": [ - "./lib1/tools/tools.interface.ts" - ], - "./lib2/data.ts": [ - "./lib1/public.ts", - "./lib2/data2.ts" - ], - "./lib2/data2.ts": [ - "./lib2/data.ts" - ], - "./lib2/public.ts": [ - "./lib2/data.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../../../a/lib/lib.d.ts", - "./app.ts", - "./lib1/public.ts", - "./lib1/tools/public.ts", - "./lib1/tools/tools.interface.ts", - [ - "./lib2/data.ts", - [ - { - "file": "./lib2/data.ts", - "start": 174, - "length": 14, - "code": 2322, - "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } - } - ] - ], - "./lib2/data2.ts", - "./lib2/public.ts" - ] - }, - "version": "FakeTSVersion", - "size": 2690 -} - - -Change:: Rename property title2 to title of interface ITest to revert back to original text - -Input:: -//// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] -export interface ITest { - title: string; -} - - -Output:: ->> Screen clear -[12:02:09 AM] File change detected. Starting incremental compilation... - -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? - -5 title: "title" -   ~~~~~~~~~~~~~~ - -[12:02:25 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/app.ts"] -Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts -/user/username/projects/myproject/lib1/public.ts -/user/username/projects/myproject/lib2/data2.ts -/user/username/projects/myproject/lib2/data.ts -/user/username/projects/myproject/lib2/public.ts -/user/username/projects/myproject/app.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/myproject/lib1/tools/tools.interface.ts -/user/username/projects/myproject/lib1/tools/public.ts - -Shape signatures in builder refreshed for:: -/user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) -/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts) - -WatchedFiles:: -/user/username/projects/myproject/tsconfig.json: - {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} -/user/username/projects/myproject/app.ts: - {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/public.ts: - {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data.ts: - {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/public.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} -/user/username/projects/myproject/lib1/tools/tools.interface.ts: - {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} -/user/username/projects/myproject/lib2/data2.ts: - {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} -/a/lib/lib.d.ts: - {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} - -FsWatches:: - -FsWatchesRecursive:: -/user/username/projects/myproject/node_modules/@types: - {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} - -exitCode:: ExitStatus.undefined - -//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] -export interface ITest { - title: string; -} - - -//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents -//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-4369626085-export interface ITest {\n title: string;\n}","signature":"-2463740027-export interface ITest {\n title: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":14,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],5,7]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-4369626085-export interface ITest {\n title: string;\n}","signature":"-2463740027-export interface ITest {\n title: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,6,5,7]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -856,40 +392,17 @@ export interface ITest { "./lib1/public.ts", "./lib1/tools/public.ts", "./lib1/tools/tools.interface.ts", - [ - "./lib2/data.ts", - [ - { - "file": "./lib2/data.ts", - "start": 174, - "length": 14, - "code": 2322, - "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } - } - ] - ], + "./lib2/data.ts", "./lib2/data2.ts", "./lib2/public.ts" ] }, "version": "FakeTSVersion", - "size": 2688 + "size": 2313 } -Change:: Rename property title to title2 of interface ITest +Change:: Rename property title to title2 of interface ITest to initialize signatures Input:: //// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] @@ -900,15 +413,9 @@ export interface ITest { Output:: >> Screen clear -[12:02:32 AM] File change detected. Starting incremental compilation... +[12:01:16 AM] File change detected. Starting incremental compilation... -lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. - Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? - -5 title: "title" -   ~~~~~~~~~~~~~~ - -[12:02:48 AM] Found 1 error. Watching for file changes. +[12:01:32 AM] Found 0 errors. Watching for file changes. @@ -971,7 +478,7 @@ export interface ITest { //// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents //// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":14,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],5,7]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,6,5,7]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1088,35 +595,418 @@ export interface ITest { "./lib1/public.ts", "./lib1/tools/public.ts", "./lib1/tools/tools.interface.ts", - [ - "./lib2/data.ts", - [ - { - "file": "./lib2/data.ts", - "start": 174, - "length": 14, - "code": 2322, - "category": 1, - "messageText": { - "messageText": "Type '{ title: string; }' is not assignable to type 'ITest'.", - "category": 1, - "code": 2322, - "next": [ - { - "messageText": "Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?", - "category": 1, - "code": 2561 - } - ] - } - } - ] - ], + "./lib2/data.ts", "./lib2/data2.ts", "./lib2/public.ts" ] }, "version": "FakeTSVersion", - "size": 2690 + "size": 2315 +} + + +Change:: Rename property title2 to title of interface ITest to revert back to original text + +Input:: +//// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] +export interface ITest { + title: string; +} + + +Output:: +>> Screen clear +[12:01:39 AM] File change detected. Starting incremental compilation... + +[12:01:55 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts) + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data2.ts: + {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] +export interface ITest { + title: string; +} + + +//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-4369626085-export interface ITest {\n title: string;\n}","signature":"-2463740027-export interface ITest {\n title: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,6,5,7]},"version":"FakeTSVersion"} + +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./lib1/tools/tools.interface.ts", + "./lib1/tools/public.ts", + "./lib1/public.ts", + "./lib2/data2.ts", + "./lib2/data.ts", + "./lib2/public.ts", + "./app.ts" + ], + "fileNamesList": [ + [ + "./lib2/public.ts" + ], + [ + "./lib1/tools/public.ts" + ], + [ + "./lib1/tools/tools.interface.ts" + ], + [ + "./lib1/public.ts", + "./lib2/data2.ts" + ], + [ + "./lib2/data.ts" + ] + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./lib1/tools/tools.interface.ts": { + "version": "-4369626085-export interface ITest {\n title: string;\n}", + "signature": "-2463740027-export interface ITest {\n title: string;\n}\n" + }, + "./lib1/tools/public.ts": { + "version": "-13301115055-export * from \"./tools.interface\";", + "signature": "-13735034501-export * from \"./tools.interface\";\n" + }, + "./lib1/public.ts": { + "version": "-5078933600-export * from \"./tools/public\";", + "signature": "-4396051542-export * from \"./tools/public\";\n" + }, + "./lib2/data2.ts": { + "version": "-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}", + "signature": "-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n" + }, + "./lib2/data.ts": { + "version": "-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}", + "signature": "-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n" + }, + "./lib2/public.ts": { + "version": "-9530042629-export * from \"./data\";", + "signature": "-9548728731-export * from \"./data\";\n" + }, + "./app.ts": { + "version": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}", + "signature": "-18990360330-export declare class App {\n constructor();\n}\n" + } + }, + "options": { + "assumeChangesOnlyAffectDirectDependencies": true, + "declaration": true + }, + "referencedMap": { + "./app.ts": [ + "./lib2/public.ts" + ], + "./lib1/public.ts": [ + "./lib1/tools/public.ts" + ], + "./lib1/tools/public.ts": [ + "./lib1/tools/tools.interface.ts" + ], + "./lib2/data.ts": [ + "./lib1/public.ts", + "./lib2/data2.ts" + ], + "./lib2/data2.ts": [ + "./lib2/data.ts" + ], + "./lib2/public.ts": [ + "./lib2/data.ts" + ] + }, + "exportedModulesMap": { + "./lib1/public.ts": [ + "./lib1/tools/public.ts" + ], + "./lib1/tools/public.ts": [ + "./lib1/tools/tools.interface.ts" + ], + "./lib2/data.ts": [ + "./lib1/public.ts", + "./lib2/data2.ts" + ], + "./lib2/data2.ts": [ + "./lib2/data.ts" + ], + "./lib2/public.ts": [ + "./lib2/data.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "./app.ts", + "./lib1/public.ts", + "./lib1/tools/public.ts", + "./lib1/tools/tools.interface.ts", + "./lib2/data.ts", + "./lib2/data2.ts", + "./lib2/public.ts" + ] + }, + "version": "FakeTSVersion", + "size": 2313 +} + + +Change:: Rename property title to title2 of interface ITest + +Input:: +//// [/user/username/projects/myproject/lib1/tools/tools.interface.ts] +export interface ITest { + title2: string; +} + + +Output:: +>> Screen clear +[12:02:02 AM] File change detected. Starting incremental compilation... + +[12:02:18 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/app.ts"] +Program options: {"baseUrl":"/user/username/projects/myproject","assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts +/user/username/projects/myproject/lib1/public.ts +/user/username/projects/myproject/lib2/data2.ts +/user/username/projects/myproject/lib2/data.ts +/user/username/projects/myproject/lib2/public.ts +/user/username/projects/myproject/app.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/myproject/lib1/tools/tools.interface.ts +/user/username/projects/myproject/lib1/tools/public.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts) + +WatchedFiles:: +/user/username/projects/myproject/tsconfig.json: + {"fileName":"/user/username/projects/myproject/tsconfig.json","pollingInterval":250} +/user/username/projects/myproject/app.ts: + {"fileName":"/user/username/projects/myproject/app.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/public.ts: + {"fileName":"/user/username/projects/myproject/lib2/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data.ts: + {"fileName":"/user/username/projects/myproject/lib2/data.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/public.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/public.ts","pollingInterval":250} +/user/username/projects/myproject/lib1/tools/tools.interface.ts: + {"fileName":"/user/username/projects/myproject/lib1/tools/tools.interface.ts","pollingInterval":250} +/user/username/projects/myproject/lib2/data2.ts: + {"fileName":"/user/username/projects/myproject/lib2/data2.ts","pollingInterval":250} +/a/lib/lib.d.ts: + {"fileName":"/a/lib/lib.d.ts","pollingInterval":250} + +FsWatches:: + +FsWatchesRecursive:: +/user/username/projects/myproject/node_modules/@types: + {"directoryName":"/user/username/projects/myproject/node_modules/@types","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/lib1/tools/tools.interface.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/tools.interface.d.ts] +export interface ITest { + title2: string; +} + + +//// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents +//// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,6,5,7]},"version":"FakeTSVersion"} + +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./lib1/tools/tools.interface.ts", + "./lib1/tools/public.ts", + "./lib1/public.ts", + "./lib2/data2.ts", + "./lib2/data.ts", + "./lib2/public.ts", + "./app.ts" + ], + "fileNamesList": [ + [ + "./lib2/public.ts" + ], + [ + "./lib1/tools/public.ts" + ], + [ + "./lib1/tools/tools.interface.ts" + ], + [ + "./lib1/public.ts", + "./lib2/data2.ts" + ], + [ + "./lib2/data.ts" + ] + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./lib1/tools/tools.interface.ts": { + "version": "-3501597171-export interface ITest {\n title2: string;\n}", + "signature": "-3883556937-export interface ITest {\n title2: string;\n}\n" + }, + "./lib1/tools/public.ts": { + "version": "-13301115055-export * from \"./tools.interface\";", + "signature": "-13735034501-export * from \"./tools.interface\";\n" + }, + "./lib1/public.ts": { + "version": "-5078933600-export * from \"./tools/public\";", + "signature": "-4396051542-export * from \"./tools/public\";\n" + }, + "./lib2/data2.ts": { + "version": "-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}", + "signature": "-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n" + }, + "./lib2/data.ts": { + "version": "-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}", + "signature": "-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n" + }, + "./lib2/public.ts": { + "version": "-9530042629-export * from \"./data\";", + "signature": "-9548728731-export * from \"./data\";\n" + }, + "./app.ts": { + "version": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}", + "signature": "-18990360330-export declare class App {\n constructor();\n}\n" + } + }, + "options": { + "assumeChangesOnlyAffectDirectDependencies": true, + "declaration": true + }, + "referencedMap": { + "./app.ts": [ + "./lib2/public.ts" + ], + "./lib1/public.ts": [ + "./lib1/tools/public.ts" + ], + "./lib1/tools/public.ts": [ + "./lib1/tools/tools.interface.ts" + ], + "./lib2/data.ts": [ + "./lib1/public.ts", + "./lib2/data2.ts" + ], + "./lib2/data2.ts": [ + "./lib2/data.ts" + ], + "./lib2/public.ts": [ + "./lib2/data.ts" + ] + }, + "exportedModulesMap": { + "./lib1/public.ts": [ + "./lib1/tools/public.ts" + ], + "./lib1/tools/public.ts": [ + "./lib1/tools/tools.interface.ts" + ], + "./lib2/data.ts": [ + "./lib1/public.ts", + "./lib2/data2.ts" + ], + "./lib2/data2.ts": [ + "./lib2/data.ts" + ], + "./lib2/public.ts": [ + "./lib2/data.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "./app.ts", + "./lib1/public.ts", + "./lib1/tools/public.ts", + "./lib1/tools/tools.interface.ts", + "./lib2/data.ts", + "./lib2/data2.ts", + "./lib2/public.ts" + ] + }, + "version": "FakeTSVersion", + "size": 2315 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js index a4f88ae81e0..bfdf6d81126 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js @@ -278,7 +278,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -302,7 +302,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", @@ -310,7 +310,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -333,7 +333,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1115 + "size": 1249 } //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] @@ -429,7 +429,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,[3,[{"file":"../src/main.ts","start":46,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]],4],"affectedFilesPendingEmit":[[3,1]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,[3,[{"file":"../src/main.ts","start":46,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]],4],"affectedFilesPendingEmit":[[3,1]]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -453,7 +453,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;", @@ -461,7 +461,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -502,7 +502,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1278 + "size": 1412 } @@ -614,7 +614,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -638,7 +638,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", @@ -646,7 +646,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -669,7 +669,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1106 + "size": 1240 } //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError.js index 869ce1a85e6..3f2c70b67c6 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError.js @@ -278,7 +278,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -302,7 +302,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", @@ -310,7 +310,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -333,7 +333,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1115 + "size": 1249 } //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] @@ -429,7 +429,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,[3,[{"file":"../src/main.ts","start":46,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]],4],"affectedFilesPendingEmit":[[3,1]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,[3,[{"file":"../src/main.ts","start":46,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]],4],"affectedFilesPendingEmit":[[3,1]]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -453,7 +453,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;", @@ -461,7 +461,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -502,7 +502,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1278 + "size": 1412 } @@ -614,7 +614,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -638,7 +638,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", @@ -646,7 +646,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -669,7 +669,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1106 + "size": 1240 } //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/deepImportChanges/errors-for-.d.ts-change.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/deepImportChanges/errors-for-.d.ts-change.js index 8411f24f3fa..c440413b8f5 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/deepImportChanges/errors-for-.d.ts-change.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/deepImportChanges/errors-for-.d.ts-change.js @@ -63,7 +63,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/myproject/c.d.ts (used version) /user/username/projects/myproject/b.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -102,7 +102,7 @@ export {}; //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-18774426152-export class C\n{\n d: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}","4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);"],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-18774426152-export class C\n{\n d: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}",{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -137,7 +137,7 @@ export {}; }, "./a.ts": { "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -152,9 +152,6 @@ export {}; ] }, "exportedModulesMap": { - "./a.ts": [ - "./b.d.ts" - ], "./b.d.ts": [ "./c.d.ts" ] @@ -167,7 +164,7 @@ export {}; ] }, "version": "FakeTSVersion", - "size": 909 + "size": 954 } @@ -211,7 +208,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.d.ts (used version) /user/username/projects/myproject/b.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -239,7 +236,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/a.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-21444928214-export class C\n{\n d2: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}","4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);"],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,[4,[{"file":"./a.ts","start":82,"length":1,"code":2339,"category":1,"messageText":"Property 'd' does not exist on type 'C'."}]],3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-21444928214-export class C\n{\n d2: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}",{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,[4,[{"file":"./a.ts","start":82,"length":1,"code":2339,"category":1,"messageText":"Property 'd' does not exist on type 'C'."}]],3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -274,7 +271,7 @@ exitCode:: ExitStatus.undefined }, "./a.ts": { "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -289,9 +286,6 @@ exitCode:: ExitStatus.undefined ] }, "exportedModulesMap": { - "./a.ts": [ - "./b.d.ts" - ], "./b.d.ts": [ "./c.d.ts" ] @@ -316,7 +310,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1036 + "size": 1081 } @@ -355,7 +349,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.d.ts (used version) /user/username/projects/myproject/b.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -383,7 +377,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/a.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-18774426152-export class C\n{\n d: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}","4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);"],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-18774426152-export class C\n{\n d: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}",{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -418,7 +412,7 @@ exitCode:: ExitStatus.undefined }, "./a.ts": { "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -433,9 +427,6 @@ exitCode:: ExitStatus.undefined ] }, "exportedModulesMap": { - "./a.ts": [ - "./b.d.ts" - ], "./b.d.ts": [ "./c.d.ts" ] @@ -448,7 +439,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 909 + "size": 954 } @@ -492,7 +483,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.d.ts (used version) /user/username/projects/myproject/b.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -520,7 +511,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/a.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-21444928214-export class C\n{\n d2: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}","4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);"],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,[4,[{"file":"./a.ts","start":82,"length":1,"code":2339,"category":1,"messageText":"Property 'd' does not exist on type 'C'."}]],3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-21444928214-export class C\n{\n d2: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}",{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,[4,[{"file":"./a.ts","start":82,"length":1,"code":2339,"category":1,"messageText":"Property 'd' does not exist on type 'C'."}]],3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -555,7 +546,7 @@ exitCode:: ExitStatus.undefined }, "./a.ts": { "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -570,9 +561,6 @@ exitCode:: ExitStatus.undefined ] }, "exportedModulesMap": { - "./a.ts": [ - "./b.d.ts" - ], "./b.d.ts": [ "./c.d.ts" ] @@ -597,6 +585,6 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1036 + "size": 1081 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/deepImportChanges/errors-for-.ts-change.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/deepImportChanges/errors-for-.ts-change.js index 5d9c84706fc..e9cf2334387 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/deepImportChanges/errors-for-.ts-change.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/deepImportChanges/errors-for-.ts-change.js @@ -61,9 +61,9 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/c.ts (used version) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -140,7 +140,7 @@ export {}; //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-22447130237-export class C\n{\n d = 1;\n}","-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}","4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);"],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-22447130237-export class C\n{\n d = 1;\n}","signature":"-6977846840-export declare class C {\n d: number;\n}\n"},{"version":"-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}","signature":"-165097315-import { C } from './c';\nexport declare class B {\n c: C;\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -167,15 +167,15 @@ export {}; }, "./c.ts": { "version": "-22447130237-export class C\n{\n d = 1;\n}", - "signature": "-22447130237-export class C\n{\n d = 1;\n}" + "signature": "-6977846840-export declare class C {\n d: number;\n}\n" }, "./b.ts": { "version": "-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}", - "signature": "-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}" + "signature": "-165097315-import { C } from './c';\nexport declare class B {\n c: C;\n}\n" }, "./a.ts": { "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -190,9 +190,6 @@ export {}; ] }, "exportedModulesMap": { - "./a.ts": [ - "./b.ts" - ], "./b.ts": [ "./c.ts" ] @@ -205,7 +202,7 @@ export {}; ] }, "version": "FakeTSVersion", - "size": 908 + "size": 1141 } @@ -228,7 +225,7 @@ Output:: 4 console.log(b.c.d);    ~ -[12:01:08 AM] Found 1 error. Watching for file changes. +[12:01:05 AM] Found 1 error. Watching for file changes. @@ -249,7 +246,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.ts (computed .d.ts) /user/username/projects/myproject/b.ts (computed .d.ts) -/user/username/projects/myproject/a.ts (computed .d.ts) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -294,7 +291,6 @@ export declare class C { //// [/user/username/projects/myproject/b.js] file written with same contents //// [/user/username/projects/myproject/b.d.ts] file written with same contents -//// [/user/username/projects/myproject/a.js] file written with same contents //// [/user/username/projects/myproject/a.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-22846341163-export class C\n{\n d2 = 1;\n}","signature":"-4637923302-export declare class C {\n d2: number;\n}\n"},{"version":"-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}","signature":"-165097315-import { C } from './c';\nexport declare class B {\n c: C;\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,[4,[{"file":"./a.ts","start":82,"length":1,"code":2339,"category":1,"messageText":"Property 'd' does not exist on type 'C'."}]],3,2]},"version":"FakeTSVersion"} @@ -387,9 +383,9 @@ export class C Output:: >> Screen clear -[12:01:15 AM] File change detected. Starting incremental compilation... +[12:01:12 AM] File change detected. Starting incremental compilation... -[12:01:34 AM] Found 0 errors. Watching for file changes. +[12:01:31 AM] Found 0 errors. Watching for file changes. @@ -410,7 +406,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.ts (computed .d.ts) /user/username/projects/myproject/b.ts (computed .d.ts) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -457,7 +453,7 @@ export declare class C { //// [/user/username/projects/myproject/b.d.ts] file written with same contents //// [/user/username/projects/myproject/a.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-22447130237-export class C\n{\n d = 1;\n}","signature":"-6977846840-export declare class C {\n d: number;\n}\n"},{"version":"-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}","signature":"-165097315-import { C } from './c';\nexport declare class B {\n c: C;\n}\n"},"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);"],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-22447130237-export class C\n{\n d = 1;\n}","signature":"-6977846840-export declare class C {\n d: number;\n}\n"},{"version":"-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}","signature":"-165097315-import { C } from './c';\nexport declare class B {\n c: C;\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -492,7 +488,7 @@ export declare class C { }, "./a.ts": { "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -507,9 +503,6 @@ export declare class C { ] }, "exportedModulesMap": { - "./a.ts": [ - "./b.ts" - ], "./b.ts": [ "./c.ts" ] @@ -522,7 +515,7 @@ export declare class C { ] }, "version": "FakeTSVersion", - "size": 1096 + "size": 1141 } @@ -538,14 +531,14 @@ export class C Output:: >> Screen clear -[12:01:41 AM] File change detected. Starting incremental compilation... +[12:01:38 AM] File change detected. Starting incremental compilation... a.ts:4:17 - error TS2339: Property 'd' does not exist on type 'C'. 4 console.log(b.c.d);    ~ -[12:02:00 AM] Found 1 error. Watching for file changes. +[12:01:57 AM] Found 1 error. Watching for file changes. @@ -566,7 +559,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.ts (computed .d.ts) /user/username/projects/myproject/b.ts (computed .d.ts) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -613,7 +606,7 @@ export declare class C { //// [/user/username/projects/myproject/b.d.ts] file written with same contents //// [/user/username/projects/myproject/a.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-22846341163-export class C\n{\n d2 = 1;\n}","signature":"-4637923302-export declare class C {\n d2: number;\n}\n"},{"version":"-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}","signature":"-165097315-import { C } from './c';\nexport declare class B {\n c: C;\n}\n"},"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);"],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,[4,[{"file":"./a.ts","start":82,"length":1,"code":2339,"category":1,"messageText":"Property 'd' does not exist on type 'C'."}]],3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-22846341163-export class C\n{\n d2 = 1;\n}","signature":"-4637923302-export declare class C {\n d2: number;\n}\n"},{"version":"-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}","signature":"-165097315-import { C } from './c';\nexport declare class B {\n c: C;\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,[4,[{"file":"./a.ts","start":82,"length":1,"code":2339,"category":1,"messageText":"Property 'd' does not exist on type 'C'."}]],3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -648,7 +641,7 @@ export declare class C { }, "./a.ts": { "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -663,9 +656,6 @@ export declare class C { ] }, "exportedModulesMap": { - "./a.ts": [ - "./b.ts" - ], "./b.ts": [ "./c.ts" ] @@ -690,6 +680,6 @@ export declare class C { ] }, "version": "FakeTSVersion", - "size": 1224 + "size": 1269 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js index 2797064f88b..081531da6d4 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -96,11 +96,11 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/c.ts (used version) -/user/username/projects/myproject/d.ts (used version) -/user/username/projects/myproject/e.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/d.ts (computed .d.ts during emit) +/user/username/projects/myproject/e.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -199,7 +199,7 @@ import "./d"; //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","-5185546240-import \"./d\";"],"options":{"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[5,3],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":4,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"options":{"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":4,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -234,23 +234,23 @@ import "./d"; }, "./a.ts": { "version": "9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}", - "signature": "9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}" + "signature": "8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n" }, "./b.ts": { "version": "-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}", - "signature": "-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}" + "signature": "-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n" }, "./c.ts": { "version": "-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};", - "signature": "-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};" + "signature": "-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n" }, "./d.ts": { "version": "-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;", - "signature": "-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;" + "signature": "-3531856636-export {};\n" }, "./e.ts": { "version": "-5185546240-import \"./d\";", - "signature": "-5185546240-import \"./d\";" + "signature": "-3619301366-import \"./d\";\n" } }, "options": { @@ -277,9 +277,6 @@ import "./d"; "./c.ts": [ "./b.ts" ], - "./d.ts": [ - "./c.ts" - ], "./e.ts": [ "./d.ts" ] @@ -339,7 +336,7 @@ import "./d"; ] }, "version": "FakeTSVersion", - "size": 1936 + "size": 2452 } @@ -361,7 +358,7 @@ Output:: >> Screen clear [12:00:58 AM] File change detected. Starting incremental compilation... -[12:01:32 AM] Found 0 errors. Watching for file changes. +[12:01:20 AM] Found 0 errors. Watching for file changes. @@ -381,14 +378,12 @@ Semantic diagnostics in builder refreshed for:: /user/username/projects/myproject/b.ts /user/username/projects/myproject/c.ts /user/username/projects/myproject/d.ts -/user/username/projects/myproject/e.ts Shape signatures in builder refreshed for:: /user/username/projects/myproject/a.ts (computed .d.ts) /user/username/projects/myproject/b.ts (computed .d.ts) -/user/username/projects/myproject/c.ts (computed .d.ts) -/user/username/projects/myproject/d.ts (computed .d.ts) -/user/username/projects/myproject/e.ts (computed .d.ts) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/d.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -430,12 +425,8 @@ export interface Coords { //// [/user/username/projects/myproject/b.js] file written with same contents //// [/user/username/projects/myproject/b.d.ts] file written with same contents -//// [/user/username/projects/myproject/c.js] file written with same contents //// [/user/username/projects/myproject/c.d.ts] file written with same contents -//// [/user/username/projects/myproject/d.js] file written with same contents //// [/user/username/projects/myproject/d.d.ts] file written with same contents -//// [/user/username/projects/myproject/e.js] file written with same contents -//// [/user/username/projects/myproject/e.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"2103509937-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}","signature":"696351195-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"options":{"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6]},"version":"FakeTSVersion"} @@ -549,7 +540,7 @@ export interface Coords { Output:: >> Screen clear -[12:01:39 AM] File change detected. Starting incremental compilation... +[12:01:27 AM] File change detected. Starting incremental compilation... c.ts:6:13 - error TS2322: Type '{ x: number; y: number; }' is not assignable to type 'Coords'. Object literal may only specify known properties, and 'x' does not exist in type 'Coords'. @@ -567,7 +558,7 @@ Output:: 2 getPoint().c.x;    ~ -[12:02:01 AM] Found 2 errors. Watching for file changes. +[12:01:49 AM] Found 2 errors. Watching for file changes. @@ -591,8 +582,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/a.ts (computed .d.ts) /user/username/projects/myproject/b.ts (computed .d.ts) -/user/username/projects/myproject/c.ts (used version) -/user/username/projects/myproject/d.ts (used version) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/d.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -637,7 +628,7 @@ export interface Coords { //// [/user/username/projects/myproject/c.d.ts] file written with same contents //// [/user/username/projects/myproject/d.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;",{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"options":{"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[5,3],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":4,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"options":{"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":4,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -680,11 +671,11 @@ export interface Coords { }, "./c.ts": { "version": "-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};", - "signature": "-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};" + "signature": "-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n" }, "./d.ts": { "version": "-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;", - "signature": "-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;" + "signature": "-3531856636-export {};\n" }, "./e.ts": { "version": "-5185546240-import \"./d\";", @@ -715,9 +706,6 @@ export interface Coords { "./c.ts": [ "./b.ts" ], - "./d.ts": [ - "./c.ts" - ], "./e.ts": [ "./d.ts" ] @@ -777,7 +765,7 @@ export interface Coords { ] }, "version": "FakeTSVersion", - "size": 2278 + "size": 2452 } @@ -797,9 +785,9 @@ export interface Coords { Output:: >> Screen clear -[12:02:08 AM] File change detected. Starting incremental compilation... +[12:01:56 AM] File change detected. Starting incremental compilation... -[12:02:33 AM] Found 0 errors. Watching for file changes. +[12:02:18 AM] Found 0 errors. Watching for file changes. @@ -819,14 +807,12 @@ Semantic diagnostics in builder refreshed for:: /user/username/projects/myproject/b.ts /user/username/projects/myproject/c.ts /user/username/projects/myproject/d.ts -/user/username/projects/myproject/e.ts Shape signatures in builder refreshed for:: /user/username/projects/myproject/a.ts (computed .d.ts) /user/username/projects/myproject/b.ts (computed .d.ts) -/user/username/projects/myproject/c.ts (used version) -/user/username/projects/myproject/d.ts (used version) -/user/username/projects/myproject/e.ts (used version) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/d.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -870,9 +856,8 @@ export interface Coords { //// [/user/username/projects/myproject/b.d.ts] file written with same contents //// [/user/username/projects/myproject/c.d.ts] file written with same contents //// [/user/username/projects/myproject/d.d.ts] file written with same contents -//// [/user/username/projects/myproject/e.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"2103509937-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}","signature":"696351195-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","-5185546240-import \"./d\";"],"options":{"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[5,3],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"2103509937-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}","signature":"696351195-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"options":{"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -915,15 +900,15 @@ export interface Coords { }, "./c.ts": { "version": "-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};", - "signature": "-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};" + "signature": "-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n" }, "./d.ts": { "version": "-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;", - "signature": "-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;" + "signature": "-3531856636-export {};\n" }, "./e.ts": { "version": "-5185546240-import \"./d\";", - "signature": "-5185546240-import \"./d\";" + "signature": "-3619301366-import \"./d\";\n" } }, "options": { @@ -950,9 +935,6 @@ export interface Coords { "./c.ts": [ "./b.ts" ], - "./d.ts": [ - "./c.ts" - ], "./e.ts": [ "./d.ts" ] @@ -967,6 +949,6 @@ export interface Coords { ] }, "version": "FakeTSVersion", - "size": 1557 + "size": 1787 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/transitive-exports/no-circular-import/export.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/transitive-exports/no-circular-import/export.js index 8037a31e3aa..3553ec1da07 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/transitive-exports/no-circular-import/export.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/transitive-exports/no-circular-import/export.js @@ -81,12 +81,12 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/lib1/tools/tools.interface.ts (used version) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -243,7 +243,7 @@ export declare class App { //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-4369626085-export interface ITest {\n title: string;\n}","-13301115055-export * from \"./tools.interface\";","-5078933600-export * from \"./tools/public\";","-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"options":{"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,5,6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-4369626085-export interface ITest {\n title: string;\n}","signature":"-2463740027-export interface ITest {\n title: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,5,6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -282,27 +282,27 @@ export declare class App { }, "./lib1/tools/tools.interface.ts": { "version": "-4369626085-export interface ITest {\n title: string;\n}", - "signature": "-4369626085-export interface ITest {\n title: string;\n}" + "signature": "-2463740027-export interface ITest {\n title: string;\n}\n" }, "./lib1/tools/public.ts": { "version": "-13301115055-export * from \"./tools.interface\";", - "signature": "-13301115055-export * from \"./tools.interface\";" + "signature": "-13735034501-export * from \"./tools.interface\";\n" }, "./lib1/public.ts": { "version": "-5078933600-export * from \"./tools/public\";", - "signature": "-5078933600-export * from \"./tools/public\";" + "signature": "-4396051542-export * from \"./tools/public\";\n" }, "./lib2/data.ts": { "version": "-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}", - "signature": "-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}" + "signature": "-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n" }, "./lib2/public.ts": { "version": "-9530042629-export * from \"./data\";", - "signature": "-9530042629-export * from \"./data\";" + "signature": "-9548728731-export * from \"./data\";\n" }, "./app.ts": { "version": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}", - "signature": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}" + "signature": "-18990360330-export declare class App {\n constructor();\n}\n" } }, "options": { @@ -326,9 +326,6 @@ export declare class App { ] }, "exportedModulesMap": { - "./app.ts": [ - "./lib2/public.ts" - ], "./lib1/public.ts": [ "./lib1/tools/public.ts" ], @@ -353,7 +350,7 @@ export declare class App { ] }, "version": "FakeTSVersion", - "size": 1378 + "size": 1901 } @@ -376,7 +373,7 @@ Output:: 5 title: "title"    ~~~~~~~~~~~~~~ -[12:01:50 AM] Found 1 error. Watching for file changes. +[12:01:38 AM] Found 1 error. Watching for file changes. @@ -403,10 +400,10 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) /user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts) -/user/username/projects/myproject/lib1/public.ts (computed .d.ts) -/user/username/projects/myproject/lib2/data.ts (computed .d.ts) -/user/username/projects/myproject/lib2/public.ts (computed .d.ts) -/user/username/projects/myproject/app.ts (computed .d.ts) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -443,13 +440,9 @@ export interface ITest { //// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents //// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib1/public.js] file written with same contents //// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data.js] file written with same contents //// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/public.js] file written with same contents //// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/app.js] file written with same contents //// [/user/username/projects/myproject/app.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":14,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],6]},"version":"FakeTSVersion"} @@ -597,9 +590,9 @@ export interface ITest { Output:: >> Screen clear -[12:01:57 AM] File change detected. Starting incremental compilation... +[12:01:45 AM] File change detected. Starting incremental compilation... -[12:02:25 AM] Found 0 errors. Watching for file changes. +[12:02:13 AM] Found 0 errors. Watching for file changes. @@ -626,10 +619,10 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) /user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -671,7 +664,7 @@ export interface ITest { //// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents //// [/user/username/projects/myproject/app.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-4369626085-export interface ITest {\n title: string;\n}","signature":"-2463740027-export interface ITest {\n title: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},"-5078933600-export * from \"./tools/public\";","-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"options":{"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,5,6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-4369626085-export interface ITest {\n title: string;\n}","signature":"-2463740027-export interface ITest {\n title: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,5,6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -718,19 +711,19 @@ export interface ITest { }, "./lib1/public.ts": { "version": "-5078933600-export * from \"./tools/public\";", - "signature": "-5078933600-export * from \"./tools/public\";" + "signature": "-4396051542-export * from \"./tools/public\";\n" }, "./lib2/data.ts": { "version": "-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}", - "signature": "-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}" + "signature": "-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n" }, "./lib2/public.ts": { "version": "-9530042629-export * from \"./data\";", - "signature": "-9530042629-export * from \"./data\";" + "signature": "-9548728731-export * from \"./data\";\n" }, "./app.ts": { "version": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}", - "signature": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}" + "signature": "-18990360330-export declare class App {\n constructor();\n}\n" } }, "options": { @@ -754,9 +747,6 @@ export interface ITest { ] }, "exportedModulesMap": { - "./app.ts": [ - "./lib2/public.ts" - ], "./lib1/public.ts": [ "./lib1/tools/public.ts" ], @@ -781,7 +771,7 @@ export interface ITest { ] }, "version": "FakeTSVersion", - "size": 1544 + "size": 1901 } @@ -796,7 +786,7 @@ export interface ITest { Output:: >> Screen clear -[12:02:32 AM] File change detected. Starting incremental compilation... +[12:02:20 AM] File change detected. Starting incremental compilation... lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? @@ -804,7 +794,7 @@ Output:: 5 title: "title"    ~~~~~~~~~~~~~~ -[12:03:00 AM] Found 1 error. Watching for file changes. +[12:02:48 AM] Found 1 error. Watching for file changes. @@ -831,10 +821,10 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) /user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -876,7 +866,7 @@ export interface ITest { //// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents //// [/user/username/projects/myproject/app.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},"-5078933600-export * from \"./tools/public\";","-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"options":{"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":14,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":14,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -923,19 +913,19 @@ export interface ITest { }, "./lib1/public.ts": { "version": "-5078933600-export * from \"./tools/public\";", - "signature": "-5078933600-export * from \"./tools/public\";" + "signature": "-4396051542-export * from \"./tools/public\";\n" }, "./lib2/data.ts": { "version": "-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}", - "signature": "-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}" + "signature": "-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n" }, "./lib2/public.ts": { "version": "-9530042629-export * from \"./data\";", - "signature": "-9530042629-export * from \"./data\";" + "signature": "-9548728731-export * from \"./data\";\n" }, "./app.ts": { "version": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}", - "signature": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}" + "signature": "-18990360330-export declare class App {\n constructor();\n}\n" } }, "options": { @@ -959,9 +949,6 @@ export interface ITest { ] }, "exportedModulesMap": { - "./app.ts": [ - "./lib2/public.ts" - ], "./lib1/public.ts": [ "./lib1/tools/public.ts" ], @@ -1009,6 +996,6 @@ export interface ITest { ] }, "version": "FakeTSVersion", - "size": 1921 + "size": 2278 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/transitive-exports/yes-circular-import/exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/transitive-exports/yes-circular-import/exports.js index d858978aba4..8e8b28d62f7 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/transitive-exports/yes-circular-import/exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/transitive-exports/yes-circular-import/exports.js @@ -89,13 +89,13 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/lib1/tools/tools.interface.ts (used version) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data2.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data2.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -275,7 +275,7 @@ export declare class App { //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-4369626085-export interface ITest {\n title: string;\n}","-13301115055-export * from \"./tools.interface\";","-5078933600-export * from \"./tools/public\";","-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"options":{"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,6,5,7]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-4369626085-export interface ITest {\n title: string;\n}","signature":"-2463740027-export interface ITest {\n title: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,6,5,7]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -316,31 +316,31 @@ export declare class App { }, "./lib1/tools/tools.interface.ts": { "version": "-4369626085-export interface ITest {\n title: string;\n}", - "signature": "-4369626085-export interface ITest {\n title: string;\n}" + "signature": "-2463740027-export interface ITest {\n title: string;\n}\n" }, "./lib1/tools/public.ts": { "version": "-13301115055-export * from \"./tools.interface\";", - "signature": "-13301115055-export * from \"./tools.interface\";" + "signature": "-13735034501-export * from \"./tools.interface\";\n" }, "./lib1/public.ts": { "version": "-5078933600-export * from \"./tools/public\";", - "signature": "-5078933600-export * from \"./tools/public\";" + "signature": "-4396051542-export * from \"./tools/public\";\n" }, "./lib2/data2.ts": { "version": "-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}", - "signature": "-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}" + "signature": "-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n" }, "./lib2/data.ts": { "version": "-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}", - "signature": "-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}" + "signature": "-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n" }, "./lib2/public.ts": { "version": "-9530042629-export * from \"./data\";", - "signature": "-9530042629-export * from \"./data\";" + "signature": "-9548728731-export * from \"./data\";\n" }, "./app.ts": { "version": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}", - "signature": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}" + "signature": "-18990360330-export declare class App {\n constructor();\n}\n" } }, "options": { @@ -368,9 +368,6 @@ export declare class App { ] }, "exportedModulesMap": { - "./app.ts": [ - "./lib2/public.ts" - ], "./lib1/public.ts": [ "./lib1/tools/public.ts" ], @@ -400,7 +397,7 @@ export declare class App { ] }, "version": "FakeTSVersion", - "size": 1563 + "size": 2264 } @@ -423,7 +420,7 @@ Output:: 5 title: "title"    ~~~~~~~~~~~~~~ -[12:02:02 AM] Found 1 error. Watching for file changes. +[12:01:47 AM] Found 1 error. Watching for file changes. @@ -452,11 +449,11 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) /user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts) -/user/username/projects/myproject/lib1/public.ts (computed .d.ts) -/user/username/projects/myproject/lib2/data.ts (computed .d.ts) -/user/username/projects/myproject/lib2/public.ts (computed .d.ts) -/user/username/projects/myproject/app.ts (computed .d.ts) -/user/username/projects/myproject/lib2/data2.ts (computed .d.ts) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data2.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -495,15 +492,10 @@ export interface ITest { //// [/user/username/projects/myproject/lib1/tools/public.js] file written with same contents //// [/user/username/projects/myproject/lib1/tools/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib1/public.js] file written with same contents //// [/user/username/projects/myproject/lib1/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data2.js] file written with same contents //// [/user/username/projects/myproject/lib2/data2.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/data.js] file written with same contents //// [/user/username/projects/myproject/lib2/data.d.ts] file written with same contents -//// [/user/username/projects/myproject/lib2/public.js] file written with same contents //// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents -//// [/user/username/projects/myproject/app.js] file written with same contents //// [/user/username/projects/myproject/app.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":14,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],5,7]},"version":"FakeTSVersion"} @@ -666,9 +658,9 @@ export interface ITest { Output:: >> Screen clear -[12:02:09 AM] File change detected. Starting incremental compilation... +[12:01:54 AM] File change detected. Starting incremental compilation... -[12:02:40 AM] Found 0 errors. Watching for file changes. +[12:02:25 AM] Found 0 errors. Watching for file changes. @@ -697,11 +689,11 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) /user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/data2.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data2.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -746,7 +738,7 @@ export interface ITest { //// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents //// [/user/username/projects/myproject/app.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-4369626085-export interface ITest {\n title: string;\n}","signature":"-2463740027-export interface ITest {\n title: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},"-5078933600-export * from \"./tools/public\";","-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"options":{"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,6,5,7]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-4369626085-export interface ITest {\n title: string;\n}","signature":"-2463740027-export interface ITest {\n title: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,6,5,7]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -795,23 +787,23 @@ export interface ITest { }, "./lib1/public.ts": { "version": "-5078933600-export * from \"./tools/public\";", - "signature": "-5078933600-export * from \"./tools/public\";" + "signature": "-4396051542-export * from \"./tools/public\";\n" }, "./lib2/data2.ts": { "version": "-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}", - "signature": "-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}" + "signature": "-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n" }, "./lib2/data.ts": { "version": "-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}", - "signature": "-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}" + "signature": "-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n" }, "./lib2/public.ts": { "version": "-9530042629-export * from \"./data\";", - "signature": "-9530042629-export * from \"./data\";" + "signature": "-9548728731-export * from \"./data\";\n" }, "./app.ts": { "version": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}", - "signature": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}" + "signature": "-18990360330-export declare class App {\n constructor();\n}\n" } }, "options": { @@ -839,9 +831,6 @@ export interface ITest { ] }, "exportedModulesMap": { - "./app.ts": [ - "./lib2/public.ts" - ], "./lib1/public.ts": [ "./lib1/tools/public.ts" ], @@ -871,7 +860,7 @@ export interface ITest { ] }, "version": "FakeTSVersion", - "size": 1729 + "size": 2264 } @@ -886,7 +875,7 @@ export interface ITest { Output:: >> Screen clear -[12:02:47 AM] File change detected. Starting incremental compilation... +[12:02:32 AM] File change detected. Starting incremental compilation... lib2/data.ts:5:13 - error TS2322: Type '{ title: string; }' is not assignable to type 'ITest'. Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'? @@ -894,7 +883,7 @@ Output:: 5 title: "title"    ~~~~~~~~~~~~~~ -[12:03:18 AM] Found 1 error. Watching for file changes. +[12:03:03 AM] Found 1 error. Watching for file changes. @@ -923,11 +912,11 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) /user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/data2.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data2.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -972,7 +961,7 @@ export interface ITest { //// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents //// [/user/username/projects/myproject/app.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},"-5078933600-export * from \"./tools/public\";","-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"options":{"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":14,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],5,7]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":14,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],5,7]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1021,23 +1010,23 @@ export interface ITest { }, "./lib1/public.ts": { "version": "-5078933600-export * from \"./tools/public\";", - "signature": "-5078933600-export * from \"./tools/public\";" + "signature": "-4396051542-export * from \"./tools/public\";\n" }, "./lib2/data2.ts": { "version": "-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}", - "signature": "-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}" + "signature": "-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n" }, "./lib2/data.ts": { "version": "-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}", - "signature": "-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}" + "signature": "-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n" }, "./lib2/public.ts": { "version": "-9530042629-export * from \"./data\";", - "signature": "-9530042629-export * from \"./data\";" + "signature": "-9548728731-export * from \"./data\";\n" }, "./app.ts": { "version": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}", - "signature": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}" + "signature": "-18990360330-export declare class App {\n constructor();\n}\n" } }, "options": { @@ -1065,9 +1054,6 @@ export interface ITest { ] }, "exportedModulesMap": { - "./app.ts": [ - "./lib2/public.ts" - ], "./lib1/public.ts": [ "./lib1/tools/public.ts" ], @@ -1120,6 +1106,6 @@ export interface ITest { ] }, "version": "FakeTSVersion", - "size": 2106 + "size": 2641 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/with-noEmitOnError-with-incremental.js index a7fb75106e9..036a97dadd0 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/with-noEmitOnError-with-incremental.js @@ -277,7 +277,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -301,7 +301,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", @@ -309,7 +309,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -331,7 +331,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1066 + "size": 1200 } //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] @@ -427,7 +427,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,[3,[{"file":"../src/main.ts","start":46,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]],4],"affectedFilesPendingEmit":[[3,1]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,[3,[{"file":"../src/main.ts","start":46,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]],4],"affectedFilesPendingEmit":[[3,1]]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -451,7 +451,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;", @@ -459,7 +459,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -499,7 +499,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1229 + "size": 1363 } @@ -611,7 +611,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -635,7 +635,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", @@ -643,7 +643,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -665,7 +665,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1057 + "size": 1191 } //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/with-noEmitOnError.js index bc663a126af..35a4b1f8042 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/defaultAndD/with-noEmitOnError.js @@ -277,7 +277,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -301,7 +301,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", @@ -309,7 +309,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -331,7 +331,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1066 + "size": 1200 } //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] @@ -427,7 +427,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,[3,[{"file":"../src/main.ts","start":46,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]],4],"affectedFilesPendingEmit":[[3,1]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,[3,[{"file":"../src/main.ts","start":46,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]],4],"affectedFilesPendingEmit":[[3,1]]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -451,7 +451,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;", @@ -459,7 +459,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -499,7 +499,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1229 + "size": 1363 } @@ -611,7 +611,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -635,7 +635,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", @@ -643,7 +643,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -665,7 +665,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1057 + "size": 1191 } //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/deepImportChanges/errors-for-.d.ts-change.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/deepImportChanges/errors-for-.d.ts-change.js index 777695e9f0d..eac80ea7253 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/deepImportChanges/errors-for-.d.ts-change.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/deepImportChanges/errors-for-.d.ts-change.js @@ -63,7 +63,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/myproject/c.d.ts (used version) /user/username/projects/myproject/b.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -102,7 +102,7 @@ export {}; //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-18774426152-export class C\n{\n d: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}","4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);"],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-18774426152-export class C\n{\n d: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}",{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -137,7 +137,7 @@ export {}; }, "./a.ts": { "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -152,9 +152,6 @@ export {}; ] }, "exportedModulesMap": { - "./a.ts": [ - "./b.d.ts" - ], "./b.d.ts": [ "./c.d.ts" ] @@ -167,7 +164,7 @@ export {}; ] }, "version": "FakeTSVersion", - "size": 909 + "size": 954 } @@ -211,7 +208,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.d.ts (used version) /user/username/projects/myproject/b.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -239,7 +236,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/a.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-21444928214-export class C\n{\n d2: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}","4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);"],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,[4,[{"file":"./a.ts","start":82,"length":1,"code":2339,"category":1,"messageText":"Property 'd' does not exist on type 'C'."}]],3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-21444928214-export class C\n{\n d2: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}",{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,[4,[{"file":"./a.ts","start":82,"length":1,"code":2339,"category":1,"messageText":"Property 'd' does not exist on type 'C'."}]],3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -274,7 +271,7 @@ exitCode:: ExitStatus.undefined }, "./a.ts": { "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -289,9 +286,6 @@ exitCode:: ExitStatus.undefined ] }, "exportedModulesMap": { - "./a.ts": [ - "./b.d.ts" - ], "./b.d.ts": [ "./c.d.ts" ] @@ -316,7 +310,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1036 + "size": 1081 } @@ -355,7 +349,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.d.ts (used version) /user/username/projects/myproject/b.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -383,7 +377,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/a.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-18774426152-export class C\n{\n d: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}","4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);"],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-18774426152-export class C\n{\n d: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}",{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -418,7 +412,7 @@ exitCode:: ExitStatus.undefined }, "./a.ts": { "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -433,9 +427,6 @@ exitCode:: ExitStatus.undefined ] }, "exportedModulesMap": { - "./a.ts": [ - "./b.d.ts" - ], "./b.d.ts": [ "./c.d.ts" ] @@ -448,7 +439,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 909 + "size": 954 } @@ -492,7 +483,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.d.ts (used version) /user/username/projects/myproject/b.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -520,7 +511,7 @@ exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/a.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-21444928214-export class C\n{\n d2: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}","4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);"],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,[4,[{"file":"./a.ts","start":82,"length":1,"code":2339,"category":1,"messageText":"Property 'd' does not exist on type 'C'."}]],3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.d.ts","./b.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-21444928214-export class C\n{\n d2: number;\n}","-1688906387-import {C} from './c';\nexport class B\n{\n c: C;\n}",{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,[4,[{"file":"./a.ts","start":82,"length":1,"code":2339,"category":1,"messageText":"Property 'd' does not exist on type 'C'."}]],3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -555,7 +546,7 @@ exitCode:: ExitStatus.undefined }, "./a.ts": { "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -570,9 +561,6 @@ exitCode:: ExitStatus.undefined ] }, "exportedModulesMap": { - "./a.ts": [ - "./b.d.ts" - ], "./b.d.ts": [ "./c.d.ts" ] @@ -597,6 +585,6 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1036 + "size": 1081 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/deepImportChanges/errors-for-.ts-change.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/deepImportChanges/errors-for-.ts-change.js index 1790ea4fb89..e611a650ee1 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/deepImportChanges/errors-for-.ts-change.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/deepImportChanges/errors-for-.ts-change.js @@ -61,9 +61,9 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/c.ts (used version) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -140,7 +140,7 @@ export {}; //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-22447130237-export class C\n{\n d = 1;\n}","-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}","4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);"],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-22447130237-export class C\n{\n d = 1;\n}","signature":"-6977846840-export declare class C {\n d: number;\n}\n"},{"version":"-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}","signature":"-165097315-import { C } from './c';\nexport declare class B {\n c: C;\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -167,15 +167,15 @@ export {}; }, "./c.ts": { "version": "-22447130237-export class C\n{\n d = 1;\n}", - "signature": "-22447130237-export class C\n{\n d = 1;\n}" + "signature": "-6977846840-export declare class C {\n d: number;\n}\n" }, "./b.ts": { "version": "-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}", - "signature": "-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}" + "signature": "-165097315-import { C } from './c';\nexport declare class B {\n c: C;\n}\n" }, "./a.ts": { "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -190,9 +190,6 @@ export {}; ] }, "exportedModulesMap": { - "./a.ts": [ - "./b.ts" - ], "./b.ts": [ "./c.ts" ] @@ -205,7 +202,7 @@ export {}; ] }, "version": "FakeTSVersion", - "size": 908 + "size": 1141 } @@ -248,8 +245,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.ts (computed .d.ts) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -295,7 +292,7 @@ export declare class C { //// [/user/username/projects/myproject/b.d.ts] file written with same contents //// [/user/username/projects/myproject/a.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-22846341163-export class C\n{\n d2 = 1;\n}","signature":"-4637923302-export declare class C {\n d2: number;\n}\n"},"-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}","4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);"],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,[4,[{"file":"./a.ts","start":82,"length":1,"code":2339,"category":1,"messageText":"Property 'd' does not exist on type 'C'."}]],3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-22846341163-export class C\n{\n d2 = 1;\n}","signature":"-4637923302-export declare class C {\n d2: number;\n}\n"},{"version":"-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}","signature":"-165097315-import { C } from './c';\nexport declare class B {\n c: C;\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,[4,[{"file":"./a.ts","start":82,"length":1,"code":2339,"category":1,"messageText":"Property 'd' does not exist on type 'C'."}]],3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -326,11 +323,11 @@ export declare class C { }, "./b.ts": { "version": "-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}", - "signature": "-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}" + "signature": "-165097315-import { C } from './c';\nexport declare class B {\n c: C;\n}\n" }, "./a.ts": { "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -345,9 +342,6 @@ export declare class C { ] }, "exportedModulesMap": { - "./a.ts": [ - "./b.ts" - ], "./b.ts": [ "./c.ts" ] @@ -372,7 +366,7 @@ export declare class C { ] }, "version": "FakeTSVersion", - "size": 1120 + "size": 1269 } @@ -410,8 +404,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.ts (computed .d.ts) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -457,7 +451,7 @@ export declare class C { //// [/user/username/projects/myproject/b.d.ts] file written with same contents //// [/user/username/projects/myproject/a.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-22447130237-export class C\n{\n d = 1;\n}","signature":"-6977846840-export declare class C {\n d: number;\n}\n"},"-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}","4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);"],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-22447130237-export class C\n{\n d = 1;\n}","signature":"-6977846840-export declare class C {\n d: number;\n}\n"},{"version":"-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}","signature":"-165097315-import { C } from './c';\nexport declare class B {\n c: C;\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -488,11 +482,11 @@ export declare class C { }, "./b.ts": { "version": "-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}", - "signature": "-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}" + "signature": "-165097315-import { C } from './c';\nexport declare class B {\n c: C;\n}\n" }, "./a.ts": { "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -507,9 +501,6 @@ export declare class C { ] }, "exportedModulesMap": { - "./a.ts": [ - "./b.ts" - ], "./b.ts": [ "./c.ts" ] @@ -522,7 +513,7 @@ export declare class C { ] }, "version": "FakeTSVersion", - "size": 992 + "size": 1141 } @@ -565,8 +556,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.ts (computed .d.ts) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -612,7 +603,7 @@ export declare class C { //// [/user/username/projects/myproject/b.d.ts] file written with same contents //// [/user/username/projects/myproject/a.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-22846341163-export class C\n{\n d2 = 1;\n}","signature":"-4637923302-export declare class C {\n d2: number;\n}\n"},"-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}","4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);"],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[1,[4,[{"file":"./a.ts","start":82,"length":1,"code":2339,"category":1,"messageText":"Property 'd' does not exist on type 'C'."}]],3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-22846341163-export class C\n{\n d2 = 1;\n}","signature":"-4637923302-export declare class C {\n d2: number;\n}\n"},{"version":"-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}","signature":"-165097315-import { C } from './c';\nexport declare class B {\n c: C;\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"}],"options":{"declaration":true},"fileIdsList":[[3],[2]],"referencedMap":[[4,1],[3,2]],"exportedModulesMap":[[3,2]],"semanticDiagnosticsPerFile":[1,[4,[{"file":"./a.ts","start":82,"length":1,"code":2339,"category":1,"messageText":"Property 'd' does not exist on type 'C'."}]],3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -643,11 +634,11 @@ export declare class C { }, "./b.ts": { "version": "-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}", - "signature": "-6292386773-import {C} from './c';\nexport class B\n{\n c = new C();\n}" + "signature": "-165097315-import { C } from './c';\nexport declare class B {\n c: C;\n}\n" }, "./a.ts": { "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -662,9 +653,6 @@ export declare class C { ] }, "exportedModulesMap": { - "./a.ts": [ - "./b.ts" - ], "./b.ts": [ "./c.ts" ] @@ -689,6 +677,6 @@ export declare class C { ] }, "version": "FakeTSVersion", - "size": 1120 + "size": 1269 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js index caf1d30d235..ae50ce1ec81 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -96,11 +96,11 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/c.ts (used version) -/user/username/projects/myproject/d.ts (used version) -/user/username/projects/myproject/e.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/d.ts (computed .d.ts during emit) +/user/username/projects/myproject/e.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -199,7 +199,7 @@ import "./d"; //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","-5185546240-import \"./d\";"],"options":{"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[5,3],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":4,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"options":{"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":4,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -234,23 +234,23 @@ import "./d"; }, "./a.ts": { "version": "9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}", - "signature": "9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}" + "signature": "8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n" }, "./b.ts": { "version": "-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}", - "signature": "-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}" + "signature": "-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n" }, "./c.ts": { "version": "-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};", - "signature": "-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};" + "signature": "-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n" }, "./d.ts": { "version": "-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;", - "signature": "-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;" + "signature": "-3531856636-export {};\n" }, "./e.ts": { "version": "-5185546240-import \"./d\";", - "signature": "-5185546240-import \"./d\";" + "signature": "-3619301366-import \"./d\";\n" } }, "options": { @@ -277,9 +277,6 @@ import "./d"; "./c.ts": [ "./b.ts" ], - "./d.ts": [ - "./c.ts" - ], "./e.ts": [ "./d.ts" ] @@ -339,7 +336,7 @@ import "./d"; ] }, "version": "FakeTSVersion", - "size": 1936 + "size": 2452 } @@ -385,10 +382,10 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/a.ts (computed .d.ts) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/c.ts (used version) -/user/username/projects/myproject/d.ts (used version) -/user/username/projects/myproject/e.ts (used version) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/d.ts (computed .d.ts during emit) +/user/username/projects/myproject/e.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -433,7 +430,7 @@ export interface Coords { //// [/user/username/projects/myproject/d.d.ts] file written with same contents //// [/user/username/projects/myproject/e.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"2103509937-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}","signature":"696351195-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}\n"},"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","-5185546240-import \"./d\";"],"options":{"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[5,3],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"2103509937-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}","signature":"696351195-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"options":{"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -472,19 +469,19 @@ export interface Coords { }, "./b.ts": { "version": "-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}", - "signature": "-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}" + "signature": "-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n" }, "./c.ts": { "version": "-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};", - "signature": "-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};" + "signature": "-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n" }, "./d.ts": { "version": "-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;", - "signature": "-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;" + "signature": "-3531856636-export {};\n" }, "./e.ts": { "version": "-5185546240-import \"./d\";", - "signature": "-5185546240-import \"./d\";" + "signature": "-3619301366-import \"./d\";\n" } }, "options": { @@ -511,9 +508,6 @@ export interface Coords { "./c.ts": [ "./b.ts" ], - "./d.ts": [ - "./c.ts" - ], "./e.ts": [ "./d.ts" ] @@ -528,7 +522,7 @@ export interface Coords { ] }, "version": "FakeTSVersion", - "size": 1436 + "size": 1787 } @@ -590,10 +584,10 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/a.ts (computed .d.ts) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/c.ts (used version) -/user/username/projects/myproject/d.ts (used version) -/user/username/projects/myproject/e.ts (used version) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/d.ts (computed .d.ts during emit) +/user/username/projects/myproject/e.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -638,7 +632,7 @@ export interface Coords { //// [/user/username/projects/myproject/d.d.ts] file written with same contents //// [/user/username/projects/myproject/e.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","-5185546240-import \"./d\";"],"options":{"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[5,3],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":4,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"9889814467-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}","signature":"8536297517-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x2: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"options":{"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,[4,[{"file":"./c.ts","start":139,"length":4,"code":2322,"category":1,"messageText":{"messageText":"Type '{ x: number; y: number; }' is not assignable to type 'Coords'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, and 'x' does not exist in type 'Coords'.","category":1,"code":2353}]},"relatedInformation":[{"file":"./a.ts","start":47,"length":1,"messageText":"The expected type comes from property 'c' which is declared here on type 'PointWrapper'","category":3,"code":6500}]}]],[5,[{"file":"./d.ts","start":45,"length":1,"code":2339,"category":1,"messageText":"Property 'x' does not exist on type 'Coords'."}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -677,19 +671,19 @@ export interface Coords { }, "./b.ts": { "version": "-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}", - "signature": "-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}" + "signature": "-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n" }, "./c.ts": { "version": "-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};", - "signature": "-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};" + "signature": "-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n" }, "./d.ts": { "version": "-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;", - "signature": "-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;" + "signature": "-3531856636-export {};\n" }, "./e.ts": { "version": "-5185546240-import \"./d\";", - "signature": "-5185546240-import \"./d\";" + "signature": "-3619301366-import \"./d\";\n" } }, "options": { @@ -716,9 +710,6 @@ export interface Coords { "./c.ts": [ "./b.ts" ], - "./d.ts": [ - "./c.ts" - ], "./e.ts": [ "./d.ts" ] @@ -778,7 +769,7 @@ export interface Coords { ] }, "version": "FakeTSVersion", - "size": 2101 + "size": 2452 } @@ -824,10 +815,10 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/a.ts (computed .d.ts) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/c.ts (used version) -/user/username/projects/myproject/d.ts (used version) -/user/username/projects/myproject/e.ts (used version) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/d.ts (computed .d.ts during emit) +/user/username/projects/myproject/e.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -872,7 +863,7 @@ export interface Coords { //// [/user/username/projects/myproject/d.d.ts] file written with same contents //// [/user/username/projects/myproject/e.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"2103509937-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}","signature":"696351195-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}\n"},"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","-5185546240-import \"./d\";"],"options":{"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[5,3],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts","./e.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"2103509937-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}","signature":"696351195-export interface Point {\n name: string;\n c: Coords;\n}\nexport interface Coords {\n x: number;\n y: number;\n}\n"},{"version":"-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}","signature":"-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n"},{"version":"-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};","signature":"-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n"},{"version":"-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;","signature":"-3531856636-export {};\n"},{"version":"-5185546240-import \"./d\";","signature":"-3619301366-import \"./d\";\n"}],"options":{"declaration":true},"fileIdsList":[[2],[3],[4],[5]],"referencedMap":[[3,1],[4,2],[5,3],[6,4]],"exportedModulesMap":[[3,1],[4,2],[6,4]],"semanticDiagnosticsPerFile":[1,2,3,4,5,6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -911,19 +902,19 @@ export interface Coords { }, "./b.ts": { "version": "-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}", - "signature": "-8029610078-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}" + "signature": "-7279094804-import { Point } from \"./a\";\nexport interface PointWrapper extends Point {\n}\n" }, "./c.ts": { "version": "-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};", - "signature": "-37232372138-import { PointWrapper } from \"./b\";\nexport function getPoint(): PointWrapper {\n return {\n name: \"test\",\n c: {\n x: 1,\n y: 2\n }\n }\n};" + "signature": "-3387333988-import { PointWrapper } from \"./b\";\nexport declare function getPoint(): PointWrapper;\n" }, "./d.ts": { "version": "-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;", - "signature": "-17875457076-import { getPoint } from \"./c\";\ngetPoint().c.x;" + "signature": "-3531856636-export {};\n" }, "./e.ts": { "version": "-5185546240-import \"./d\";", - "signature": "-5185546240-import \"./d\";" + "signature": "-3619301366-import \"./d\";\n" } }, "options": { @@ -950,9 +941,6 @@ export interface Coords { "./c.ts": [ "./b.ts" ], - "./d.ts": [ - "./c.ts" - ], "./e.ts": [ "./d.ts" ] @@ -967,6 +955,6 @@ export interface Coords { ] }, "version": "FakeTSVersion", - "size": 1436 + "size": 1787 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/transitive-exports/no-circular-import/export.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/transitive-exports/no-circular-import/export.js index ffa7cb905e4..ab19e60075c 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/transitive-exports/no-circular-import/export.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/transitive-exports/no-circular-import/export.js @@ -81,12 +81,12 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/lib1/tools/tools.interface.ts (used version) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -243,7 +243,7 @@ export declare class App { //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-4369626085-export interface ITest {\n title: string;\n}","-13301115055-export * from \"./tools.interface\";","-5078933600-export * from \"./tools/public\";","-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"options":{"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,5,6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-4369626085-export interface ITest {\n title: string;\n}","signature":"-2463740027-export interface ITest {\n title: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,5,6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -282,27 +282,27 @@ export declare class App { }, "./lib1/tools/tools.interface.ts": { "version": "-4369626085-export interface ITest {\n title: string;\n}", - "signature": "-4369626085-export interface ITest {\n title: string;\n}" + "signature": "-2463740027-export interface ITest {\n title: string;\n}\n" }, "./lib1/tools/public.ts": { "version": "-13301115055-export * from \"./tools.interface\";", - "signature": "-13301115055-export * from \"./tools.interface\";" + "signature": "-13735034501-export * from \"./tools.interface\";\n" }, "./lib1/public.ts": { "version": "-5078933600-export * from \"./tools/public\";", - "signature": "-5078933600-export * from \"./tools/public\";" + "signature": "-4396051542-export * from \"./tools/public\";\n" }, "./lib2/data.ts": { "version": "-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}", - "signature": "-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}" + "signature": "-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n" }, "./lib2/public.ts": { "version": "-9530042629-export * from \"./data\";", - "signature": "-9530042629-export * from \"./data\";" + "signature": "-9548728731-export * from \"./data\";\n" }, "./app.ts": { "version": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}", - "signature": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}" + "signature": "-18990360330-export declare class App {\n constructor();\n}\n" } }, "options": { @@ -326,9 +326,6 @@ export declare class App { ] }, "exportedModulesMap": { - "./app.ts": [ - "./lib2/public.ts" - ], "./lib1/public.ts": [ "./lib1/tools/public.ts" ], @@ -353,7 +350,7 @@ export declare class App { ] }, "version": "FakeTSVersion", - "size": 1378 + "size": 1901 } @@ -402,11 +399,11 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -447,7 +444,7 @@ export interface ITest { //// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents //// [/user/username/projects/myproject/app.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},"-13301115055-export * from \"./tools.interface\";","-5078933600-export * from \"./tools/public\";","-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"options":{"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":14,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":14,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -490,23 +487,23 @@ export interface ITest { }, "./lib1/tools/public.ts": { "version": "-13301115055-export * from \"./tools.interface\";", - "signature": "-13301115055-export * from \"./tools.interface\";" + "signature": "-13735034501-export * from \"./tools.interface\";\n" }, "./lib1/public.ts": { "version": "-5078933600-export * from \"./tools/public\";", - "signature": "-5078933600-export * from \"./tools/public\";" + "signature": "-4396051542-export * from \"./tools/public\";\n" }, "./lib2/data.ts": { "version": "-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}", - "signature": "-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}" + "signature": "-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n" }, "./lib2/public.ts": { "version": "-9530042629-export * from \"./data\";", - "signature": "-9530042629-export * from \"./data\";" + "signature": "-9548728731-export * from \"./data\";\n" }, "./app.ts": { "version": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}", - "signature": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}" + "signature": "-18990360330-export declare class App {\n constructor();\n}\n" } }, "options": { @@ -530,9 +527,6 @@ export interface ITest { ] }, "exportedModulesMap": { - "./app.ts": [ - "./lib2/public.ts" - ], "./lib1/public.ts": [ "./lib1/tools/public.ts" ], @@ -580,7 +574,7 @@ export interface ITest { ] }, "version": "FakeTSVersion", - "size": 1843 + "size": 2278 } @@ -623,11 +617,11 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -668,7 +662,7 @@ export interface ITest { //// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents //// [/user/username/projects/myproject/app.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-4369626085-export interface ITest {\n title: string;\n}","signature":"-2463740027-export interface ITest {\n title: string;\n}\n"},"-13301115055-export * from \"./tools.interface\";","-5078933600-export * from \"./tools/public\";","-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"options":{"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,5,6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-4369626085-export interface ITest {\n title: string;\n}","signature":"-2463740027-export interface ITest {\n title: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,5,6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -711,23 +705,23 @@ export interface ITest { }, "./lib1/tools/public.ts": { "version": "-13301115055-export * from \"./tools.interface\";", - "signature": "-13301115055-export * from \"./tools.interface\";" + "signature": "-13735034501-export * from \"./tools.interface\";\n" }, "./lib1/public.ts": { "version": "-5078933600-export * from \"./tools/public\";", - "signature": "-5078933600-export * from \"./tools/public\";" + "signature": "-4396051542-export * from \"./tools/public\";\n" }, "./lib2/data.ts": { "version": "-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}", - "signature": "-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}" + "signature": "-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n" }, "./lib2/public.ts": { "version": "-9530042629-export * from \"./data\";", - "signature": "-9530042629-export * from \"./data\";" + "signature": "-9548728731-export * from \"./data\";\n" }, "./app.ts": { "version": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}", - "signature": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}" + "signature": "-18990360330-export declare class App {\n constructor();\n}\n" } }, "options": { @@ -751,9 +745,6 @@ export interface ITest { ] }, "exportedModulesMap": { - "./app.ts": [ - "./lib2/public.ts" - ], "./lib1/public.ts": [ "./lib1/tools/public.ts" ], @@ -778,7 +769,7 @@ export interface ITest { ] }, "version": "FakeTSVersion", - "size": 1466 + "size": 1901 } @@ -827,11 +818,11 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -872,7 +863,7 @@ export interface ITest { //// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents //// [/user/username/projects/myproject/app.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},"-13301115055-export * from \"./tools.interface\";","-5078933600-export * from \"./tools/public\";","-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"options":{"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":14,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],6]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"declaration":true},"fileIdsList":[[6],[3],[2],[4],[5]],"referencedMap":[[7,1],[4,2],[3,3],[5,4],[6,5]],"exportedModulesMap":[[4,2],[3,3],[5,4],[6,5]],"semanticDiagnosticsPerFile":[1,7,4,3,2,[5,[{"file":"./lib2/data.ts","start":121,"length":14,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],6]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -915,23 +906,23 @@ export interface ITest { }, "./lib1/tools/public.ts": { "version": "-13301115055-export * from \"./tools.interface\";", - "signature": "-13301115055-export * from \"./tools.interface\";" + "signature": "-13735034501-export * from \"./tools.interface\";\n" }, "./lib1/public.ts": { "version": "-5078933600-export * from \"./tools/public\";", - "signature": "-5078933600-export * from \"./tools/public\";" + "signature": "-4396051542-export * from \"./tools/public\";\n" }, "./lib2/data.ts": { "version": "-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}", - "signature": "-30573389178-import { ITest } from \"lib1/public\";\nexport class Data {\n public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}" + "signature": "-15758516261-import { ITest } from \"lib1/public\";\nexport declare class Data {\n test(): ITest;\n}\n" }, "./lib2/public.ts": { "version": "-9530042629-export * from \"./data\";", - "signature": "-9530042629-export * from \"./data\";" + "signature": "-9548728731-export * from \"./data\";\n" }, "./app.ts": { "version": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}", - "signature": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}" + "signature": "-18990360330-export declare class App {\n constructor();\n}\n" } }, "options": { @@ -955,9 +946,6 @@ export interface ITest { ] }, "exportedModulesMap": { - "./app.ts": [ - "./lib2/public.ts" - ], "./lib1/public.ts": [ "./lib1/tools/public.ts" ], @@ -1005,6 +993,6 @@ export interface ITest { ] }, "version": "FakeTSVersion", - "size": 1843 + "size": 2278 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/transitive-exports/yes-circular-import/exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/transitive-exports/yes-circular-import/exports.js index 66f43221dcb..65720509b7e 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/transitive-exports/yes-circular-import/exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/transitive-exports/yes-circular-import/exports.js @@ -89,13 +89,13 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/lib1/tools/tools.interface.ts (used version) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data2.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data2.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -275,7 +275,7 @@ export declare class App { //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-4369626085-export interface ITest {\n title: string;\n}","-13301115055-export * from \"./tools.interface\";","-5078933600-export * from \"./tools/public\";","-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"options":{"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,6,5,7]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-4369626085-export interface ITest {\n title: string;\n}","signature":"-2463740027-export interface ITest {\n title: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,6,5,7]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -316,31 +316,31 @@ export declare class App { }, "./lib1/tools/tools.interface.ts": { "version": "-4369626085-export interface ITest {\n title: string;\n}", - "signature": "-4369626085-export interface ITest {\n title: string;\n}" + "signature": "-2463740027-export interface ITest {\n title: string;\n}\n" }, "./lib1/tools/public.ts": { "version": "-13301115055-export * from \"./tools.interface\";", - "signature": "-13301115055-export * from \"./tools.interface\";" + "signature": "-13735034501-export * from \"./tools.interface\";\n" }, "./lib1/public.ts": { "version": "-5078933600-export * from \"./tools/public\";", - "signature": "-5078933600-export * from \"./tools/public\";" + "signature": "-4396051542-export * from \"./tools/public\";\n" }, "./lib2/data2.ts": { "version": "-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}", - "signature": "-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}" + "signature": "-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n" }, "./lib2/data.ts": { "version": "-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}", - "signature": "-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}" + "signature": "-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n" }, "./lib2/public.ts": { "version": "-9530042629-export * from \"./data\";", - "signature": "-9530042629-export * from \"./data\";" + "signature": "-9548728731-export * from \"./data\";\n" }, "./app.ts": { "version": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}", - "signature": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}" + "signature": "-18990360330-export declare class App {\n constructor();\n}\n" } }, "options": { @@ -368,9 +368,6 @@ export declare class App { ] }, "exportedModulesMap": { - "./app.ts": [ - "./lib2/public.ts" - ], "./lib1/public.ts": [ "./lib1/tools/public.ts" ], @@ -400,7 +397,7 @@ export declare class App { ] }, "version": "FakeTSVersion", - "size": 1563 + "size": 2264 } @@ -451,12 +448,12 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/data2.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data2.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -500,7 +497,7 @@ export interface ITest { //// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents //// [/user/username/projects/myproject/app.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},"-13301115055-export * from \"./tools.interface\";","-5078933600-export * from \"./tools/public\";","-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"options":{"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":14,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],5,7]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":14,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],5,7]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -545,27 +542,27 @@ export interface ITest { }, "./lib1/tools/public.ts": { "version": "-13301115055-export * from \"./tools.interface\";", - "signature": "-13301115055-export * from \"./tools.interface\";" + "signature": "-13735034501-export * from \"./tools.interface\";\n" }, "./lib1/public.ts": { "version": "-5078933600-export * from \"./tools/public\";", - "signature": "-5078933600-export * from \"./tools/public\";" + "signature": "-4396051542-export * from \"./tools/public\";\n" }, "./lib2/data2.ts": { "version": "-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}", - "signature": "-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}" + "signature": "-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n" }, "./lib2/data.ts": { "version": "-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}", - "signature": "-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}" + "signature": "-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n" }, "./lib2/public.ts": { "version": "-9530042629-export * from \"./data\";", - "signature": "-9530042629-export * from \"./data\";" + "signature": "-9548728731-export * from \"./data\";\n" }, "./app.ts": { "version": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}", - "signature": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}" + "signature": "-18990360330-export declare class App {\n constructor();\n}\n" } }, "options": { @@ -593,9 +590,6 @@ export interface ITest { ] }, "exportedModulesMap": { - "./app.ts": [ - "./lib2/public.ts" - ], "./lib1/public.ts": [ "./lib1/tools/public.ts" ], @@ -648,7 +642,7 @@ export interface ITest { ] }, "version": "FakeTSVersion", - "size": 2028 + "size": 2641 } @@ -693,12 +687,12 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/data2.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data2.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -742,7 +736,7 @@ export interface ITest { //// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents //// [/user/username/projects/myproject/app.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-4369626085-export interface ITest {\n title: string;\n}","signature":"-2463740027-export interface ITest {\n title: string;\n}\n"},"-13301115055-export * from \"./tools.interface\";","-5078933600-export * from \"./tools/public\";","-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"options":{"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,6,5,7]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-4369626085-export interface ITest {\n title: string;\n}","signature":"-2463740027-export interface ITest {\n title: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,6,5,7]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -787,27 +781,27 @@ export interface ITest { }, "./lib1/tools/public.ts": { "version": "-13301115055-export * from \"./tools.interface\";", - "signature": "-13301115055-export * from \"./tools.interface\";" + "signature": "-13735034501-export * from \"./tools.interface\";\n" }, "./lib1/public.ts": { "version": "-5078933600-export * from \"./tools/public\";", - "signature": "-5078933600-export * from \"./tools/public\";" + "signature": "-4396051542-export * from \"./tools/public\";\n" }, "./lib2/data2.ts": { "version": "-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}", - "signature": "-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}" + "signature": "-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n" }, "./lib2/data.ts": { "version": "-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}", - "signature": "-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}" + "signature": "-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n" }, "./lib2/public.ts": { "version": "-9530042629-export * from \"./data\";", - "signature": "-9530042629-export * from \"./data\";" + "signature": "-9548728731-export * from \"./data\";\n" }, "./app.ts": { "version": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}", - "signature": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}" + "signature": "-18990360330-export declare class App {\n constructor();\n}\n" } }, "options": { @@ -835,9 +829,6 @@ export interface ITest { ] }, "exportedModulesMap": { - "./app.ts": [ - "./lib2/public.ts" - ], "./lib1/public.ts": [ "./lib1/tools/public.ts" ], @@ -867,7 +858,7 @@ export interface ITest { ] }, "version": "FakeTSVersion", - "size": 1651 + "size": 2264 } @@ -918,12 +909,12 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/data2.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data2.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -967,7 +958,7 @@ export interface ITest { //// [/user/username/projects/myproject/lib2/public.d.ts] file written with same contents //// [/user/username/projects/myproject/app.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},"-13301115055-export * from \"./tools.interface\";","-5078933600-export * from \"./tools/public\";","-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","-9530042629-export * from \"./data\";","-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}"],"options":{"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":14,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],5,7]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./lib1/tools/tools.interface.ts","./lib1/tools/public.ts","./lib1/public.ts","./lib2/data2.ts","./lib2/data.ts","./lib2/public.ts","./app.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3501597171-export interface ITest {\n title2: string;\n}","signature":"-3883556937-export interface ITest {\n title2: string;\n}\n"},{"version":"-13301115055-export * from \"./tools.interface\";","signature":"-13735034501-export * from \"./tools.interface\";\n"},{"version":"-5078933600-export * from \"./tools/public\";","signature":"-4396051542-export * from \"./tools/public\";\n"},{"version":"-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}","signature":"-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n"},{"version":"-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}","signature":"-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n"},{"version":"-9530042629-export * from \"./data\";","signature":"-9548728731-export * from \"./data\";\n"},{"version":"-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}","signature":"-18990360330-export declare class App {\n constructor();\n}\n"}],"options":{"declaration":true},"fileIdsList":[[7],[3],[2],[4,5],[6]],"referencedMap":[[8,1],[4,2],[3,3],[6,4],[5,5],[7,5]],"exportedModulesMap":[[4,2],[3,3],[6,4],[5,5],[7,5]],"semanticDiagnosticsPerFile":[1,8,4,3,2,[6,[{"file":"./lib2/data.ts","start":174,"length":14,"code":2322,"category":1,"messageText":{"messageText":"Type '{ title: string; }' is not assignable to type 'ITest'.","category":1,"code":2322,"next":[{"messageText":"Object literal may only specify known properties, but 'title' does not exist in type 'ITest'. Did you mean to write 'title2'?","category":1,"code":2561}]}}]],5,7]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1012,27 +1003,27 @@ export interface ITest { }, "./lib1/tools/public.ts": { "version": "-13301115055-export * from \"./tools.interface\";", - "signature": "-13301115055-export * from \"./tools.interface\";" + "signature": "-13735034501-export * from \"./tools.interface\";\n" }, "./lib1/public.ts": { "version": "-5078933600-export * from \"./tools/public\";", - "signature": "-5078933600-export * from \"./tools/public\";" + "signature": "-4396051542-export * from \"./tools/public\";\n" }, "./lib2/data2.ts": { "version": "-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}", - "signature": "-11055285700-import { Data } from \"./data\";\nexport class Data2 {\n public dat?: Data;\n}" + "signature": "-17387821545-import { Data } from \"./data\";\nexport declare class Data2 {\n dat?: Data;\n}\n" }, "./lib2/data.ts": { "version": "-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}", - "signature": "-2056074887-import { ITest } from \"lib1/public\"; import { Data2 } from \"./data2\";\nexport class Data {\n public dat?: Data2; public test() {\n const result: ITest = {\n title: \"title\"\n }\n return result;\n }\n}" + "signature": "-14170088573-import { ITest } from \"lib1/public\";\nimport { Data2 } from \"./data2\";\nexport declare class Data {\n dat?: Data2;\n test(): ITest;\n}\n" }, "./lib2/public.ts": { "version": "-9530042629-export * from \"./data\";", - "signature": "-9530042629-export * from \"./data\";" + "signature": "-9548728731-export * from \"./data\";\n" }, "./app.ts": { "version": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}", - "signature": "-14937286564-import { Data } from \"lib2/public\";\nexport class App {\n public constructor() {\n new Data().test();\n }\n}" + "signature": "-18990360330-export declare class App {\n constructor();\n}\n" } }, "options": { @@ -1060,9 +1051,6 @@ export interface ITest { ] }, "exportedModulesMap": { - "./app.ts": [ - "./lib2/public.ts" - ], "./lib1/public.ts": [ "./lib1/tools/public.ts" ], @@ -1115,6 +1103,6 @@ export interface ITest { ] }, "version": "FakeTSVersion", - "size": 2028 + "size": 2641 } diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/with-noEmitOnError-with-incremental.js index 7b7d97027af..b320338ade2 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/with-noEmitOnError-with-incremental.js @@ -277,7 +277,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -301,7 +301,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", @@ -309,7 +309,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -331,7 +331,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1066 + "size": 1200 } //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] @@ -427,7 +427,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,[3,[{"file":"../src/main.ts","start":46,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]],4],"affectedFilesPendingEmit":[[3,1]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,[3,[{"file":"../src/main.ts","start":46,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]],4],"affectedFilesPendingEmit":[[3,1]]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -451,7 +451,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;", @@ -459,7 +459,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -499,7 +499,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1229 + "size": 1363 } @@ -611,7 +611,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -635,7 +635,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", @@ -643,7 +643,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -665,7 +665,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1057 + "size": 1191 } //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/with-noEmitOnError.js index 0944f16a316..e4a2935993f 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/incremental/isolatedModulesAndD/with-noEmitOnError.js @@ -277,7 +277,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -301,7 +301,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", @@ -309,7 +309,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -331,7 +331,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1066 + "size": 1200 } //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] @@ -427,7 +427,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,[3,[{"file":"../src/main.ts","start":46,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]],4],"affectedFilesPendingEmit":[[3,1]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,[3,[{"file":"../src/main.ts","start":46,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]],4],"affectedFilesPendingEmit":[[3,1]]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -451,7 +451,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;", @@ -459,7 +459,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -499,7 +499,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1229 + "size": 1363 } @@ -611,7 +611,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -635,7 +635,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", @@ -643,7 +643,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -665,7 +665,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1057 + "size": 1191 } //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/errors-for-.d.ts-change.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/errors-for-.d.ts-change.js index d840a16490c..07ddff950d9 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/errors-for-.d.ts-change.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/errors-for-.d.ts-change.js @@ -63,7 +63,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/myproject/c.d.ts (used version) /user/username/projects/myproject/b.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -142,7 +142,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.d.ts (used version) /user/username/projects/myproject/b.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -205,7 +205,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.d.ts (used version) /user/username/projects/myproject/b.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -273,7 +273,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.d.ts (used version) /user/username/projects/myproject/b.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/errors-for-.ts-change.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/errors-for-.ts-change.js index 13a8032b7e8..68a41566c5e 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/errors-for-.ts-change.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/deepImportChanges/errors-for-.ts-change.js @@ -61,9 +61,9 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/c.ts (used version) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -179,8 +179,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.ts (computed .d.ts) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -260,8 +260,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.ts (computed .d.ts) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -346,8 +346,8 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/c.ts (computed .d.ts) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js index d10479ad0f6..54fdd1b5eba 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/file-not-exporting-a-deep-multilevel-import-that-changes.js @@ -96,11 +96,11 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/a.ts (used version) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/c.ts (used version) -/user/username/projects/myproject/d.ts (used version) -/user/username/projects/myproject/e.ts (used version) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/d.ts (computed .d.ts during emit) +/user/username/projects/myproject/e.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -241,10 +241,10 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/a.ts (computed .d.ts) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/c.ts (used version) -/user/username/projects/myproject/d.ts (used version) -/user/username/projects/myproject/e.ts (used version) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/d.ts (computed .d.ts during emit) +/user/username/projects/myproject/e.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -347,10 +347,10 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/a.ts (computed .d.ts) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/c.ts (used version) -/user/username/projects/myproject/d.ts (used version) -/user/username/projects/myproject/e.ts (used version) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/d.ts (computed .d.ts during emit) +/user/username/projects/myproject/e.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -437,10 +437,10 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/a.ts (computed .d.ts) -/user/username/projects/myproject/b.ts (used version) -/user/username/projects/myproject/c.ts (used version) -/user/username/projects/myproject/d.ts (used version) -/user/username/projects/myproject/e.ts (used version) +/user/username/projects/myproject/b.ts (computed .d.ts during emit) +/user/username/projects/myproject/c.ts (computed .d.ts during emit) +/user/username/projects/myproject/d.ts (computed .d.ts during emit) +/user/username/projects/myproject/e.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/no-circular-import/export.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/no-circular-import/export.js index 41fd01aac5d..91452c7142d 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/no-circular-import/export.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/no-circular-import/export.js @@ -81,12 +81,12 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/lib1/tools/tools.interface.ts (used version) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -288,11 +288,11 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -372,11 +372,11 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -462,11 +462,11 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/yes-circular-import/exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/yes-circular-import/exports.js index 2ceed7c682f..058f6fe2036 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/yes-circular-import/exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/transitive-exports/yes-circular-import/exports.js @@ -89,13 +89,13 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/myproject/lib1/tools/tools.interface.ts (used version) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data2.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data2.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -322,12 +322,12 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/data2.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data2.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -412,12 +412,12 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/data2.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data2.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: @@ -508,12 +508,12 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /user/username/projects/myproject/lib1/tools/tools.interface.ts (computed .d.ts) -/user/username/projects/myproject/lib1/tools/public.ts (used version) -/user/username/projects/myproject/lib1/public.ts (used version) -/user/username/projects/myproject/lib2/data.ts (used version) -/user/username/projects/myproject/lib2/data2.ts (used version) -/user/username/projects/myproject/lib2/public.ts (used version) -/user/username/projects/myproject/app.ts (used version) +/user/username/projects/myproject/lib1/tools/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib1/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/public.ts (computed .d.ts during emit) +/user/username/projects/myproject/app.ts (computed .d.ts during emit) +/user/username/projects/myproject/lib2/data2.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js index b1af51bc769..83a5707d251 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js @@ -277,7 +277,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -301,7 +301,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-2574605496-import { A } from \"../shared/types/db\";\nconst a = {\n lastName: 'sdsd'\n};", @@ -309,7 +309,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -331,7 +331,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1066 + "size": 1200 } //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] @@ -427,7 +427,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,[3,[{"file":"../src/main.ts","start":46,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]],4],"affectedFilesPendingEmit":[[3,1]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,[3,[{"file":"../src/main.ts","start":46,"length":1,"code":2322,"category":1,"messageText":"Type 'number' is not assignable to type 'string'."}]],4],"affectedFilesPendingEmit":[[3,1]]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -451,7 +451,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-11111345725-import { A } from \"../shared/types/db\";\nconst a: string = 10;", @@ -459,7 +459,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -499,7 +499,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1229 + "size": 1363 } @@ -611,7 +611,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9621097780-export interface A {\r\n name: string;\r\n}",{"version":"-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";","signature":"-3531856636-export {};\n"},"11373096570-console.log(\"hi\");\r\nexport { }"],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9621097780-export interface A {\r\n name: string;\r\n}","signature":"-5014788164-export interface A {\n name: string;\n}\n"},{"version":"-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";","signature":"-3531856636-export {};\n"},{"version":"11373096570-console.log(\"hi\");\r\nexport { }","signature":"-3531856636-export {};\n"}],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -635,7 +635,7 @@ exitCode:: ExitStatus.undefined }, "../shared/types/db.ts": { "version": "-9621097780-export interface A {\r\n name: string;\r\n}", - "signature": "-9621097780-export interface A {\r\n name: string;\r\n}" + "signature": "-5014788164-export interface A {\n name: string;\n}\n" }, "../src/main.ts": { "version": "-8373351622-import { A } from \"../shared/types/db\";\nconst a: string = \"hello\";", @@ -643,7 +643,7 @@ exitCode:: ExitStatus.undefined }, "../src/other.ts": { "version": "11373096570-console.log(\"hi\");\r\nexport { }", - "signature": "11373096570-console.log(\"hi\");\r\nexport { }" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -665,7 +665,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 1057 + "size": 1191 } //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/declarationDir-is-specified.js b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/declarationDir-is-specified.js index 841002b4400..6eea8b4b620 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/declarationDir-is-specified.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/declarationDir-is-specified.js @@ -173,8 +173,8 @@ Program files:: No cached semantic diagnostics in the builder:: Shape signatures in builder refreshed for:: -/user/username/projects/myproject/file1.ts (used version) -/user/username/projects/myproject/src/file2.ts (used version) +/user/username/projects/myproject/file1.ts (computed .d.ts during emit) +/user/username/projects/myproject/src/file2.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-and-declarationDir-is-specified.js b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-and-declarationDir-is-specified.js index 7e2380200d7..aaa8113e67d 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-and-declarationDir-is-specified.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/when-outDir-and-declarationDir-is-specified.js @@ -173,8 +173,8 @@ Program files:: No cached semantic diagnostics in the builder:: Shape signatures in builder refreshed for:: -/user/username/projects/myproject/file1.ts (used version) -/user/username/projects/myproject/src/file2.ts (used version) +/user/username/projects/myproject/file1.ts (computed .d.ts during emit) +/user/username/projects/myproject/src/file2.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: diff --git a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/without-outDir-or-outFile-is-specified-with-declaration-enabled.js b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/without-outDir-or-outFile-is-specified-with-declaration-enabled.js index d17968fa60d..e7e009453d8 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/without-outDir-or-outFile-is-specified-with-declaration-enabled.js +++ b/tests/baselines/reference/tscWatch/programUpdates/should-not-trigger-recompilation-because-of-program-emit/without-outDir-or-outFile-is-specified-with-declaration-enabled.js @@ -173,8 +173,8 @@ Program files:: No cached semantic diagnostics in the builder:: Shape signatures in builder refreshed for:: -/user/username/projects/myproject/file1.ts (used version) -/user/username/projects/myproject/src/file2.ts (used version) +/user/username/projects/myproject/file1.ts (computed .d.ts during emit) +/user/username/projects/myproject/src/file2.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: diff --git a/tests/baselines/reference/tscWatch/programUpdates/when-new-file-is-added-to-the-referenced-project.js b/tests/baselines/reference/tscWatch/programUpdates/when-new-file-is-added-to-the-referenced-project.js index e24e1ba0986..c1884b9430b 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/when-new-file-is-added-to-the-referenced-project.js +++ b/tests/baselines/reference/tscWatch/programUpdates/when-new-file-is-added-to-the-referenced-project.js @@ -74,7 +74,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/myproject/projects/project1/class1.d.ts (used version) -/user/username/projects/myproject/projects/project2/class2.ts (used version) +/user/username/projects/myproject/projects/project2/class2.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/projects/project2/tsconfig.json: @@ -118,7 +118,7 @@ declare class class2 { //// [/user/username/projects/myproject/projects/project2/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../project1/class1.d.ts","./class2.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3469237238-declare class class1 {}","affectsGlobalScope":true},{"version":"777969115-class class2 {}","affectsGlobalScope":true}],"options":{"composite":true,"module":0},"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../project1/class1.d.ts","./class2.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3469237238-declare class class1 {}","affectsGlobalScope":true},{"version":"777969115-class class2 {}","signature":"-2684084705-declare class class2 {\n}\n","affectsGlobalScope":true}],"options":{"composite":true,"module":0},"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/projects/project2/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -141,7 +141,7 @@ declare class class2 { }, "./class2.ts": { "version": "777969115-class class2 {}", - "signature": "777969115-class class2 {}", + "signature": "-2684084705-declare class class2 {\n}\n", "affectsGlobalScope": true } }, @@ -156,7 +156,7 @@ declare class class2 { ] }, "version": "FakeTSVersion", - "size": 760 + "size": 814 } diff --git a/tests/baselines/reference/tscWatch/projectsWithReferences/on-sample-project.js b/tests/baselines/reference/tscWatch/projectsWithReferences/on-sample-project.js index 9d72767e1d5..7061d5941e4 100644 --- a/tests/baselines/reference/tscWatch/projectsWithReferences/on-sample-project.js +++ b/tests/baselines/reference/tscWatch/projectsWithReferences/on-sample-project.js @@ -121,7 +121,7 @@ export declare function multiply(a: number, b: number): number; //# sourceMappingURL=index.d.ts.map //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-2676574883-export const World = \"hello\";\r\n","-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n",{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/logic/index.js.map] {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} @@ -146,7 +146,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} //// [/user/username/projects/sample1/tests/index.js] "use strict"; @@ -166,7 +166,7 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n","12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n"],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} /a/lib/tsc.js -w -p tests diff --git a/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-in-different-folders-with-no-files-clause.js b/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-in-different-folders-with-no-files-clause.js index 487031a8879..9c3980fa208 100644 --- a/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-in-different-folders-with-no-files-clause.js +++ b/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-in-different-folders-with-no-files-clause.js @@ -57,7 +57,7 @@ export declare class A { //// [/user/username/projects/transitiveReferences/a/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-7264743946-export class A {}"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-7264743946-export class A {}","signature":"-8728835846-export declare class A {\n}\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} //// [/user/username/projects/transitiveReferences/b/index.js] "use strict"; @@ -73,7 +73,7 @@ export declare const b: A; //// [/user/username/projects/transitiveReferences/b/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../a/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-8728835846-export declare class A {\n}\n","-2591036212-import {A} from '@ref/a';\nexport const b = new A();"],"options":{"composite":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../a/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-8728835846-export declare class A {\n}\n",{"version":"-2591036212-import {A} from '@ref/a';\nexport const b = new A();","signature":"-9732944696-import { A } from '@ref/a';\nexport declare const b: A;\n"}],"options":{"composite":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/transitiveReferences/c/index.js] "use strict"; diff --git a/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-in-different-folders.js b/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-in-different-folders.js index 2ed2f16e11f..f84905a3c35 100644 --- a/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-in-different-folders.js +++ b/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-in-different-folders.js @@ -57,7 +57,7 @@ export declare class A { //// [/user/username/projects/transitiveReferences/a/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-7264743946-export class A {}"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-7264743946-export class A {}","signature":"-8728835846-export declare class A {\n}\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} //// [/user/username/projects/transitiveReferences/b/index.js] "use strict"; @@ -73,7 +73,7 @@ export declare const b: A; //// [/user/username/projects/transitiveReferences/b/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../a/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-8728835846-export declare class A {\n}\n","-2591036212-import {A} from '@ref/a';\nexport const b = new A();"],"options":{"composite":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../a/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-8728835846-export declare class A {\n}\n",{"version":"-2591036212-import {A} from '@ref/a';\nexport const b = new A();","signature":"-9732944696-import { A } from '@ref/a';\nexport declare const b: A;\n"}],"options":{"composite":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/transitiveReferences/c/index.js] "use strict"; diff --git a/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references.js b/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references.js index 054505de5ec..61c04af60d0 100644 --- a/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references.js +++ b/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references.js @@ -81,7 +81,7 @@ export declare class A { //// [/user/username/projects/transitiveReferences/tsconfig.a.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-8566332115-export class A {}\r\n"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-8566332115-export class A {}\r\n","signature":"-8728835846-export declare class A {\n}\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} //// [/user/username/projects/transitiveReferences/b.js] "use strict"; @@ -97,7 +97,7 @@ export declare const b: A; //// [/user/username/projects/transitiveReferences/tsconfig.b.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.d.ts","./b.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-8728835846-export declare class A {\n}\n","-13104686224-import {A} from '@ref/a';\r\nexport const b = new A();\r\n"],"options":{"composite":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.d.ts","./b.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-8728835846-export declare class A {\n}\n",{"version":"-13104686224-import {A} from '@ref/a';\r\nexport const b = new A();\r\n","signature":"-9732944696-import { A } from '@ref/a';\nexport declare const b: A;\n"}],"options":{"composite":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/transitiveReferences/c.js] "use strict"; diff --git a/tests/baselines/reference/tscWatch/projectsWithReferences/when-referenced-project-uses-different-module-resolution.js b/tests/baselines/reference/tscWatch/projectsWithReferences/when-referenced-project-uses-different-module-resolution.js index cbba73be6b5..c51c0f5a49c 100644 --- a/tests/baselines/reference/tscWatch/projectsWithReferences/when-referenced-project-uses-different-module-resolution.js +++ b/tests/baselines/reference/tscWatch/projectsWithReferences/when-referenced-project-uses-different-module-resolution.js @@ -68,7 +68,7 @@ export declare class A { //// [/user/username/projects/transitiveReferences/tsconfig.a.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-8566332115-export class A {}\r\n"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-8566332115-export class A {}\r\n","signature":"-8728835846-export declare class A {\n}\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} //// [/user/username/projects/transitiveReferences/b.js] "use strict"; @@ -84,7 +84,7 @@ export declare const b: A; //// [/user/username/projects/transitiveReferences/tsconfig.b.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.d.ts","./b.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-8728835846-export declare class A {\n}\n","-19869990292-import {A} from \"a\";export const b = new A();"],"options":{"composite":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.d.ts","./b.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-8728835846-export declare class A {\n}\n",{"version":"-19869990292-import {A} from \"a\";export const b = new A();","signature":"1870369234-import { A } from \"a\";\nexport declare const b: A;\n"}],"options":{"composite":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/transitiveReferences/c.js] "use strict"; diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-when-solution-is-already-built.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-when-solution-is-already-built.js index 665b7cbac06..07f44428af7 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-when-solution-is-already-built.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-when-solution-is-already-built.js @@ -60,7 +60,7 @@ export declare function foo(): void; //// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/bar.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"1045484683-export function bar() { }","4646078106-export function foo() { }"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/bar.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"1045484683-export function bar() { }","signature":"-2904461644-export declare function bar(): void;\n"},{"version":"4646078106-export function foo() { }","signature":"-5677608893-export declare function foo(): void;\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/packages/A/lib/index.js] "use strict"; @@ -76,7 +76,7 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/lib/index.d.ts","../b/lib/bar.d.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n","3563314629-import { foo } from 'b';\nimport { bar } from 'b/lib/bar';\nfoo();\nbar();\n"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/lib/index.d.ts","../b/lib/bar.d.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n",{"version":"3563314629-import { foo } from 'b';\nimport { bar } from 'b/lib/bar';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} /a/lib/tsc.js --w --p /user/username/projects/myproject/packages/A/tsconfig.json diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-preserveSymlinks-when-solution-is-already-built.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-preserveSymlinks-when-solution-is-already-built.js index 5ad338edf8d..1e1039ec1e9 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-preserveSymlinks-when-solution-is-already-built.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-preserveSymlinks-when-solution-is-already-built.js @@ -60,7 +60,7 @@ export declare function foo(): void; //// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/bar.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"1045484683-export function bar() { }","4646078106-export function foo() { }"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/bar.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"1045484683-export function bar() { }","signature":"-2904461644-export declare function bar(): void;\n"},{"version":"4646078106-export function foo() { }","signature":"-5677608893-export declare function foo(): void;\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/packages/A/lib/index.js] "use strict"; @@ -76,7 +76,7 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../node_modules/b/lib/index.d.ts","../../node_modules/b/lib/bar.d.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n","3563314629-import { foo } from 'b';\nimport { bar } from 'b/lib/bar';\nfoo();\nbar();\n"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../node_modules/b/lib/index.d.ts","../../node_modules/b/lib/bar.d.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n",{"version":"3563314629-import { foo } from 'b';\nimport { bar } from 'b/lib/bar';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} /a/lib/tsc.js --w --p /user/username/projects/myproject/packages/A/tsconfig.json diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-preserveSymlinks.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-preserveSymlinks.js index 203755bc3fd..e33dc889abe 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-preserveSymlinks.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-preserveSymlinks.js @@ -64,7 +64,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/myproject/packages/b/src/index.ts (used version) /user/username/projects/myproject/packages/b/src/bar.ts (used version) -/user/username/projects/myproject/packages/a/src/index.ts (used version) +/user/username/projects/myproject/packages/a/src/index.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/packages/a/tsconfig.json: @@ -121,7 +121,7 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/src/index.ts","../b/src/bar.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"4646078106-export function foo() { }","1045484683-export function bar() { }","3563314629-import { foo } from 'b';\nimport { bar } from 'b/lib/bar';\nfoo();\nbar();\n"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/src/index.ts","../b/src/bar.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"4646078106-export function foo() { }","1045484683-export function bar() { }",{"version":"3563314629-import { foo } from 'b';\nimport { bar } from 'b/lib/bar';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -154,7 +154,7 @@ export {}; }, "./src/index.ts": { "version": "3563314629-import { foo } from 'b';\nimport { bar } from 'b/lib/bar';\nfoo();\nbar();\n", - "signature": "3563314629-import { foo } from 'b';\nimport { bar } from 'b/lib/bar';\nfoo();\nbar();\n" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -168,12 +168,7 @@ export {}; "../b/src/bar.ts" ] }, - "exportedModulesMap": { - "./src/index.ts": [ - "../b/src/index.ts", - "../b/src/bar.ts" - ] - }, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../../../../../../a/lib/lib.d.ts", "./src/index.ts", @@ -182,6 +177,6 @@ export {}; ] }, "version": "FakeTSVersion", - "size": 902 + "size": 948 } diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package-when-solution-is-already-built.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package-when-solution-is-already-built.js index 403b35aa392..866ea8b1099 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package-when-solution-is-already-built.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package-when-solution-is-already-built.js @@ -60,7 +60,7 @@ export declare function foo(): void; //// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/bar.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"1045484683-export function bar() { }","4646078106-export function foo() { }"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/bar.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"1045484683-export function bar() { }","signature":"-2904461644-export declare function bar(): void;\n"},{"version":"4646078106-export function foo() { }","signature":"-5677608893-export declare function foo(): void;\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/packages/A/lib/index.js] "use strict"; @@ -76,7 +76,7 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/lib/index.d.ts","../b/lib/bar.d.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n","8545527381-import { foo } from '@issue/b';\nimport { bar } from '@issue/b/lib/bar';\nfoo();\nbar();\n"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/lib/index.d.ts","../b/lib/bar.d.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n",{"version":"8545527381-import { foo } from '@issue/b';\nimport { bar } from '@issue/b/lib/bar';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} /a/lib/tsc.js --w --p /user/username/projects/myproject/packages/A/tsconfig.json diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package-with-preserveSymlinks-when-solution-is-already-built.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package-with-preserveSymlinks-when-solution-is-already-built.js index 2aeceebba0e..78fc581a50d 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package-with-preserveSymlinks-when-solution-is-already-built.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package-with-preserveSymlinks-when-solution-is-already-built.js @@ -60,7 +60,7 @@ export declare function foo(): void; //// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/bar.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"1045484683-export function bar() { }","4646078106-export function foo() { }"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/bar.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"1045484683-export function bar() { }","signature":"-2904461644-export declare function bar(): void;\n"},{"version":"4646078106-export function foo() { }","signature":"-5677608893-export declare function foo(): void;\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/packages/A/lib/index.js] "use strict"; @@ -76,7 +76,7 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../node_modules/@issue/b/lib/index.d.ts","../../node_modules/@issue/b/lib/bar.d.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n","8545527381-import { foo } from '@issue/b';\nimport { bar } from '@issue/b/lib/bar';\nfoo();\nbar();\n"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../node_modules/@issue/b/lib/index.d.ts","../../node_modules/@issue/b/lib/bar.d.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n",{"version":"8545527381-import { foo } from '@issue/b';\nimport { bar } from '@issue/b/lib/bar';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} /a/lib/tsc.js --w --p /user/username/projects/myproject/packages/A/tsconfig.json diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package-with-preserveSymlinks.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package-with-preserveSymlinks.js index 3e4cd0265c0..ca06367e52e 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package-with-preserveSymlinks.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package-with-preserveSymlinks.js @@ -64,7 +64,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/myproject/packages/b/src/index.ts (used version) /user/username/projects/myproject/packages/b/src/bar.ts (used version) -/user/username/projects/myproject/packages/a/src/index.ts (used version) +/user/username/projects/myproject/packages/a/src/index.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/packages/a/tsconfig.json: @@ -121,7 +121,7 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/src/index.ts","../b/src/bar.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"4646078106-export function foo() { }","1045484683-export function bar() { }","8545527381-import { foo } from '@issue/b';\nimport { bar } from '@issue/b/lib/bar';\nfoo();\nbar();\n"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/src/index.ts","../b/src/bar.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"4646078106-export function foo() { }","1045484683-export function bar() { }",{"version":"8545527381-import { foo } from '@issue/b';\nimport { bar } from '@issue/b/lib/bar';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -154,7 +154,7 @@ export {}; }, "./src/index.ts": { "version": "8545527381-import { foo } from '@issue/b';\nimport { bar } from '@issue/b/lib/bar';\nfoo();\nbar();\n", - "signature": "8545527381-import { foo } from '@issue/b';\nimport { bar } from '@issue/b/lib/bar';\nfoo();\nbar();\n" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -168,12 +168,7 @@ export {}; "../b/src/bar.ts" ] }, - "exportedModulesMap": { - "./src/index.ts": [ - "../b/src/index.ts", - "../b/src/bar.ts" - ] - }, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../../../../../../a/lib/lib.d.ts", "./src/index.ts", @@ -182,6 +177,6 @@ export {}; ] }, "version": "FakeTSVersion", - "size": 916 + "size": 962 } diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package.js index 4676094b37d..b4fc0c61f64 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package.js @@ -64,7 +64,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/myproject/packages/b/src/index.ts (used version) /user/username/projects/myproject/packages/b/src/bar.ts (used version) -/user/username/projects/myproject/packages/a/src/index.ts (used version) +/user/username/projects/myproject/packages/a/src/index.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/packages/a/tsconfig.json: @@ -121,7 +121,7 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/src/index.ts","../b/src/bar.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"4646078106-export function foo() { }","1045484683-export function bar() { }","8545527381-import { foo } from '@issue/b';\nimport { bar } from '@issue/b/lib/bar';\nfoo();\nbar();\n"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/src/index.ts","../b/src/bar.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"4646078106-export function foo() { }","1045484683-export function bar() { }",{"version":"8545527381-import { foo } from '@issue/b';\nimport { bar } from '@issue/b/lib/bar';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -154,7 +154,7 @@ export {}; }, "./src/index.ts": { "version": "8545527381-import { foo } from '@issue/b';\nimport { bar } from '@issue/b/lib/bar';\nfoo();\nbar();\n", - "signature": "8545527381-import { foo } from '@issue/b';\nimport { bar } from '@issue/b/lib/bar';\nfoo();\nbar();\n" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -168,12 +168,7 @@ export {}; "../b/src/bar.ts" ] }, - "exportedModulesMap": { - "./src/index.ts": [ - "../b/src/index.ts", - "../b/src/bar.ts" - ] - }, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../../../../../../a/lib/lib.d.ts", "./src/index.ts", @@ -182,6 +177,6 @@ export {}; ] }, "version": "FakeTSVersion", - "size": 916 + "size": 962 } diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field.js index 35c1e9ff979..17f7653b71c 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field.js @@ -64,7 +64,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/myproject/packages/b/src/index.ts (used version) /user/username/projects/myproject/packages/b/src/bar.ts (used version) -/user/username/projects/myproject/packages/a/src/index.ts (used version) +/user/username/projects/myproject/packages/a/src/index.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/packages/a/tsconfig.json: @@ -121,7 +121,7 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/src/index.ts","../b/src/bar.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"4646078106-export function foo() { }","1045484683-export function bar() { }","3563314629-import { foo } from 'b';\nimport { bar } from 'b/lib/bar';\nfoo();\nbar();\n"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/src/index.ts","../b/src/bar.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"4646078106-export function foo() { }","1045484683-export function bar() { }",{"version":"3563314629-import { foo } from 'b';\nimport { bar } from 'b/lib/bar';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -154,7 +154,7 @@ export {}; }, "./src/index.ts": { "version": "3563314629-import { foo } from 'b';\nimport { bar } from 'b/lib/bar';\nfoo();\nbar();\n", - "signature": "3563314629-import { foo } from 'b';\nimport { bar } from 'b/lib/bar';\nfoo();\nbar();\n" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -168,12 +168,7 @@ export {}; "../b/src/bar.ts" ] }, - "exportedModulesMap": { - "./src/index.ts": [ - "../b/src/index.ts", - "../b/src/bar.ts" - ] - }, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../../../../../../a/lib/lib.d.ts", "./src/index.ts", @@ -182,6 +177,6 @@ export {}; ] }, "version": "FakeTSVersion", - "size": 902 + "size": 948 } diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-when-solution-is-already-built.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-when-solution-is-already-built.js index 765128a7cfd..bca4f167cf5 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-when-solution-is-already-built.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-when-solution-is-already-built.js @@ -60,7 +60,7 @@ export declare function bar(): void; //// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/foo.ts","./src/bar/foo.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"4646078106-export function foo() { }","1045484683-export function bar() { }"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/foo.ts","./src/bar/foo.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"4646078106-export function foo() { }","signature":"-5677608893-export declare function foo(): void;\n"},{"version":"1045484683-export function bar() { }","signature":"-2904461644-export declare function bar(): void;\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/packages/A/lib/test.js] "use strict"; @@ -76,7 +76,7 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/lib/foo.d.ts","../b/lib/bar/foo.d.ts","./src/test.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n","14700910833-import { foo } from 'b/lib/foo';\nimport { bar } from 'b/lib/bar/foo';\nfoo();\nbar();\n"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/lib/foo.d.ts","../b/lib/bar/foo.d.ts","./src/test.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n",{"version":"14700910833-import { foo } from 'b/lib/foo';\nimport { bar } from 'b/lib/bar/foo';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} /a/lib/tsc.js --w --p /user/username/projects/myproject/packages/A/tsconfig.json diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-preserveSymlinks-when-solution-is-already-built.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-preserveSymlinks-when-solution-is-already-built.js index e7b0a69e369..ad429535332 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-preserveSymlinks-when-solution-is-already-built.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-preserveSymlinks-when-solution-is-already-built.js @@ -60,7 +60,7 @@ export declare function bar(): void; //// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/foo.ts","./src/bar/foo.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"4646078106-export function foo() { }","1045484683-export function bar() { }"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/foo.ts","./src/bar/foo.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"4646078106-export function foo() { }","signature":"-5677608893-export declare function foo(): void;\n"},{"version":"1045484683-export function bar() { }","signature":"-2904461644-export declare function bar(): void;\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/packages/A/lib/test.js] "use strict"; @@ -76,7 +76,7 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../node_modules/b/lib/foo.d.ts","../../node_modules/b/lib/bar/foo.d.ts","./src/test.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n","14700910833-import { foo } from 'b/lib/foo';\nimport { bar } from 'b/lib/bar/foo';\nfoo();\nbar();\n"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../node_modules/b/lib/foo.d.ts","../../node_modules/b/lib/bar/foo.d.ts","./src/test.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n",{"version":"14700910833-import { foo } from 'b/lib/foo';\nimport { bar } from 'b/lib/bar/foo';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} /a/lib/tsc.js --w --p /user/username/projects/myproject/packages/A/tsconfig.json diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-preserveSymlinks.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-preserveSymlinks.js index a6aa5ac0f66..444de1c145a 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-preserveSymlinks.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-preserveSymlinks.js @@ -64,7 +64,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/myproject/packages/b/src/foo.ts (used version) /user/username/projects/myproject/packages/b/src/bar/foo.ts (used version) -/user/username/projects/myproject/packages/a/src/test.ts (used version) +/user/username/projects/myproject/packages/a/src/test.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/packages/a/tsconfig.json: @@ -123,7 +123,7 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/src/foo.ts","../b/src/bar/foo.ts","./src/test.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"4646078106-export function foo() { }","1045484683-export function bar() { }","14700910833-import { foo } from 'b/lib/foo';\nimport { bar } from 'b/lib/bar/foo';\nfoo();\nbar();\n"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/src/foo.ts","../b/src/bar/foo.ts","./src/test.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"4646078106-export function foo() { }","1045484683-export function bar() { }",{"version":"14700910833-import { foo } from 'b/lib/foo';\nimport { bar } from 'b/lib/bar/foo';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -156,7 +156,7 @@ export {}; }, "./src/test.ts": { "version": "14700910833-import { foo } from 'b/lib/foo';\nimport { bar } from 'b/lib/bar/foo';\nfoo();\nbar();\n", - "signature": "14700910833-import { foo } from 'b/lib/foo';\nimport { bar } from 'b/lib/bar/foo';\nfoo();\nbar();\n" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -170,12 +170,7 @@ export {}; "../b/src/bar/foo.ts" ] }, - "exportedModulesMap": { - "./src/test.ts": [ - "../b/src/foo.ts", - "../b/src/bar/foo.ts" - ] - }, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../../../../../../a/lib/lib.d.ts", "./src/test.ts", @@ -184,6 +179,6 @@ export {}; ] }, "version": "FakeTSVersion", - "size": 916 + "size": 962 } diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package-when-solution-is-already-built.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package-when-solution-is-already-built.js index 0a4cef0edff..1df80eb08e8 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package-when-solution-is-already-built.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package-when-solution-is-already-built.js @@ -60,7 +60,7 @@ export declare function bar(): void; //// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/foo.ts","./src/bar/foo.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"4646078106-export function foo() { }","1045484683-export function bar() { }"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/foo.ts","./src/bar/foo.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"4646078106-export function foo() { }","signature":"-5677608893-export declare function foo(): void;\n"},{"version":"1045484683-export function bar() { }","signature":"-2904461644-export declare function bar(): void;\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/packages/A/lib/test.js] "use strict"; @@ -76,7 +76,7 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/lib/foo.d.ts","../b/lib/bar/foo.d.ts","./src/test.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n","-20350237855-import { foo } from '@issue/b/lib/foo';\nimport { bar } from '@issue/b/lib/bar/foo';\nfoo();\nbar();\n"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/lib/foo.d.ts","../b/lib/bar/foo.d.ts","./src/test.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n",{"version":"-20350237855-import { foo } from '@issue/b/lib/foo';\nimport { bar } from '@issue/b/lib/bar/foo';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} /a/lib/tsc.js --w --p /user/username/projects/myproject/packages/A/tsconfig.json diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package-with-preserveSymlinks-when-solution-is-already-built.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package-with-preserveSymlinks-when-solution-is-already-built.js index 0b94e4fdea4..23726619543 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package-with-preserveSymlinks-when-solution-is-already-built.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package-with-preserveSymlinks-when-solution-is-already-built.js @@ -60,7 +60,7 @@ export declare function bar(): void; //// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/foo.ts","./src/bar/foo.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"4646078106-export function foo() { }","1045484683-export function bar() { }"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/foo.ts","./src/bar/foo.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"4646078106-export function foo() { }","signature":"-5677608893-export declare function foo(): void;\n"},{"version":"1045484683-export function bar() { }","signature":"-2904461644-export declare function bar(): void;\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/packages/A/lib/test.js] "use strict"; @@ -76,7 +76,7 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../node_modules/@issue/b/lib/foo.d.ts","../../node_modules/@issue/b/lib/bar/foo.d.ts","./src/test.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n","-20350237855-import { foo } from '@issue/b/lib/foo';\nimport { bar } from '@issue/b/lib/bar/foo';\nfoo();\nbar();\n"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../node_modules/@issue/b/lib/foo.d.ts","../../node_modules/@issue/b/lib/bar/foo.d.ts","./src/test.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n",{"version":"-20350237855-import { foo } from '@issue/b/lib/foo';\nimport { bar } from '@issue/b/lib/bar/foo';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} /a/lib/tsc.js --w --p /user/username/projects/myproject/packages/A/tsconfig.json diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package-with-preserveSymlinks.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package-with-preserveSymlinks.js index fee6d4d90e6..99a07c3d2a3 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package-with-preserveSymlinks.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package-with-preserveSymlinks.js @@ -64,7 +64,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/myproject/packages/b/src/foo.ts (used version) /user/username/projects/myproject/packages/b/src/bar/foo.ts (used version) -/user/username/projects/myproject/packages/a/src/test.ts (used version) +/user/username/projects/myproject/packages/a/src/test.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/packages/a/tsconfig.json: @@ -123,7 +123,7 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/src/foo.ts","../b/src/bar/foo.ts","./src/test.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"4646078106-export function foo() { }","1045484683-export function bar() { }","-20350237855-import { foo } from '@issue/b/lib/foo';\nimport { bar } from '@issue/b/lib/bar/foo';\nfoo();\nbar();\n"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/src/foo.ts","../b/src/bar/foo.ts","./src/test.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"4646078106-export function foo() { }","1045484683-export function bar() { }",{"version":"-20350237855-import { foo } from '@issue/b/lib/foo';\nimport { bar } from '@issue/b/lib/bar/foo';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -156,7 +156,7 @@ export {}; }, "./src/test.ts": { "version": "-20350237855-import { foo } from '@issue/b/lib/foo';\nimport { bar } from '@issue/b/lib/bar/foo';\nfoo();\nbar();\n", - "signature": "-20350237855-import { foo } from '@issue/b/lib/foo';\nimport { bar } from '@issue/b/lib/bar/foo';\nfoo();\nbar();\n" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -170,12 +170,7 @@ export {}; "../b/src/bar/foo.ts" ] }, - "exportedModulesMap": { - "./src/test.ts": [ - "../b/src/foo.ts", - "../b/src/bar/foo.ts" - ] - }, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../../../../../../a/lib/lib.d.ts", "./src/test.ts", @@ -184,6 +179,6 @@ export {}; ] }, "version": "FakeTSVersion", - "size": 931 + "size": 977 } diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package.js index f4a1b0eb7a0..903e03e6061 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package.js @@ -64,7 +64,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/myproject/packages/b/src/foo.ts (used version) /user/username/projects/myproject/packages/b/src/bar/foo.ts (used version) -/user/username/projects/myproject/packages/a/src/test.ts (used version) +/user/username/projects/myproject/packages/a/src/test.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/packages/a/tsconfig.json: @@ -123,7 +123,7 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/src/foo.ts","../b/src/bar/foo.ts","./src/test.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"4646078106-export function foo() { }","1045484683-export function bar() { }","-20350237855-import { foo } from '@issue/b/lib/foo';\nimport { bar } from '@issue/b/lib/bar/foo';\nfoo();\nbar();\n"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/src/foo.ts","../b/src/bar/foo.ts","./src/test.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"4646078106-export function foo() { }","1045484683-export function bar() { }",{"version":"-20350237855-import { foo } from '@issue/b/lib/foo';\nimport { bar } from '@issue/b/lib/bar/foo';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -156,7 +156,7 @@ export {}; }, "./src/test.ts": { "version": "-20350237855-import { foo } from '@issue/b/lib/foo';\nimport { bar } from '@issue/b/lib/bar/foo';\nfoo();\nbar();\n", - "signature": "-20350237855-import { foo } from '@issue/b/lib/foo';\nimport { bar } from '@issue/b/lib/bar/foo';\nfoo();\nbar();\n" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -170,12 +170,7 @@ export {}; "../b/src/bar/foo.ts" ] }, - "exportedModulesMap": { - "./src/test.ts": [ - "../b/src/foo.ts", - "../b/src/bar/foo.ts" - ] - }, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../../../../../../a/lib/lib.d.ts", "./src/test.ts", @@ -184,6 +179,6 @@ export {}; ] }, "version": "FakeTSVersion", - "size": 931 + "size": 977 } diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder.js index 8f46cda300e..5497b506179 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder.js @@ -64,7 +64,7 @@ Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/myproject/packages/b/src/foo.ts (used version) /user/username/projects/myproject/packages/b/src/bar/foo.ts (used version) -/user/username/projects/myproject/packages/a/src/test.ts (used version) +/user/username/projects/myproject/packages/a/src/test.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/packages/a/tsconfig.json: @@ -123,7 +123,7 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/src/foo.ts","../b/src/bar/foo.ts","./src/test.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"4646078106-export function foo() { }","1045484683-export function bar() { }","14700910833-import { foo } from 'b/lib/foo';\nimport { bar } from 'b/lib/bar/foo';\nfoo();\nbar();\n"],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,1]],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/src/foo.ts","../b/src/bar/foo.ts","./src/test.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"4646078106-export function foo() { }","1045484683-export function bar() { }",{"version":"14700910833-import { foo } from 'b/lib/foo';\nimport { bar } from 'b/lib/bar/foo';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -156,7 +156,7 @@ export {}; }, "./src/test.ts": { "version": "14700910833-import { foo } from 'b/lib/foo';\nimport { bar } from 'b/lib/bar/foo';\nfoo();\nbar();\n", - "signature": "14700910833-import { foo } from 'b/lib/foo';\nimport { bar } from 'b/lib/bar/foo';\nfoo();\nbar();\n" + "signature": "-3531856636-export {};\n" } }, "options": { @@ -170,12 +170,7 @@ export {}; "../b/src/bar/foo.ts" ] }, - "exportedModulesMap": { - "./src/test.ts": [ - "../b/src/foo.ts", - "../b/src/bar/foo.ts" - ] - }, + "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../../../../../../a/lib/lib.d.ts", "./src/test.ts", @@ -184,6 +179,6 @@ export {}; ] }, "version": "FakeTSVersion", - "size": 916 + "size": 962 } diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/with-simple-project-when-solution-is-already-built.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/with-simple-project-when-solution-is-already-built.js index 9b343b81501..6d1205808e6 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/with-simple-project-when-solution-is-already-built.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/with-simple-project-when-solution-is-already-built.js @@ -122,7 +122,7 @@ export declare function lastElementOf(arr: T[]): T | undefined; //// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../core/utilities.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"25274411612-\r\nexport function makeRandomName() {\r\n return \"Bob!?! \";\r\n}\r\n\r\nexport function lastElementOf(arr: T[]): T | undefined {\r\n if (arr.length === 0) return undefined;\r\n return arr[arr.length - 1];\r\n}\r\n\r\n"],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../core","strict":true,"target":1},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../core/utilities.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"25274411612-\r\nexport function makeRandomName() {\r\n return \"Bob!?! \";\r\n}\r\n\r\nexport function lastElementOf(arr: T[]): T | undefined {\r\n if (arr.length === 0) return undefined;\r\n return arr[arr.length - 1];\r\n}\r\n\r\n","signature":"-11345568166-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n"}],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../core","strict":true,"target":1},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} //// [/user/username/projects/demo/lib/animals/animal.js] "use strict"; @@ -178,7 +178,7 @@ export declare function createDog(): Dog; //// [/user/username/projects/demo/lib/animals/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../animals/animal.ts","../../animals/index.ts","../core/utilities.d.ts","../../animals/dog.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-14984181202-export type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n","-5382672599-import Animal from './animal';\r\n\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n","-11345568166-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n","-10991948013-import Animal from '.';\r\nimport { makeRandomName } from '../core/utilities';\r\n\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\n\r\nexport function createDog(): Dog {\r\n return ({\r\n size: \"medium\",\r\n woof: function(this: Dog) {\r\n console.log(`${this.name} says \"Woof\"!`);\r\n },\r\n name: makeRandomName()\r\n });\r\n}\r\n\r\n"],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../animals","strict":true,"target":1},"fileIdsList":[[3,4],[2,5]],"referencedMap":[[5,1],[3,2]],"exportedModulesMap":[[5,1],[3,2]],"semanticDiagnosticsPerFile":[1,2,5,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../animals/animal.ts","../../animals/index.ts","../core/utilities.d.ts","../../animals/dog.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-14984181202-export type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n","signature":"-10510161654-export declare type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n"},{"version":"-5382672599-import Animal from './animal';\r\n\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n","signature":"1096904574-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n"},"-11345568166-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n",{"version":"-10991948013-import Animal from '.';\r\nimport { makeRandomName } from '../core/utilities';\r\n\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\n\r\nexport function createDog(): Dog {\r\n return ({\r\n size: \"medium\",\r\n woof: function(this: Dog) {\r\n console.log(`${this.name} says \"Woof\"!`);\r\n },\r\n name: makeRandomName()\r\n });\r\n}\r\n\r\n","signature":"6032048049-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n"}],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../animals","strict":true,"target":1},"fileIdsList":[[3,4],[2,5],[3]],"referencedMap":[[5,1],[3,2]],"exportedModulesMap":[[5,3],[3,2]],"semanticDiagnosticsPerFile":[1,2,5,3,4]},"version":"FakeTSVersion"} /a/lib/tsc.js --w --p /user/username/projects/demo/animals/tsconfig.json @@ -186,7 +186,7 @@ Output:: >> Screen clear [12:01:03 AM] Starting compilation in watch mode... -[12:01:19 AM] Found 0 errors. Watching for file changes. +[12:01:13 AM] Found 0 errors. Watching for file changes. @@ -201,14 +201,12 @@ Program files:: /user/username/projects/demo/animals/dog.ts Semantic diagnostics in builder refreshed for:: -/user/username/projects/demo/animals/index.ts /user/username/projects/demo/core/utilities.ts /user/username/projects/demo/animals/dog.ts Shape signatures in builder refreshed for:: /user/username/projects/demo/core/utilities.ts (computed .d.ts) /user/username/projects/demo/animals/dog.ts (computed .d.ts) -/user/username/projects/demo/animals/index.ts (computed .d.ts) WatchedFiles:: /user/username/projects/demo/animals/tsconfig.json: @@ -246,12 +244,10 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -//// [/user/username/projects/demo/lib/animals/index.js] file written with same contents -//// [/user/username/projects/demo/lib/animals/index.d.ts] file written with same contents //// [/user/username/projects/demo/lib/animals/dog.js] file written with same contents //// [/user/username/projects/demo/lib/animals/dog.d.ts] file written with same contents //// [/user/username/projects/demo/lib/animals/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../animals/animal.ts","../../animals/index.ts","../../core/utilities.ts","../../animals/dog.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-14984181202-export type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n",{"version":"-5382672599-import Animal from './animal';\r\n\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n","signature":"1096904574-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n"},{"version":"25274411612-\r\nexport function makeRandomName() {\r\n return \"Bob!?! \";\r\n}\r\n\r\nexport function lastElementOf(arr: T[]): T | undefined {\r\n if (arr.length === 0) return undefined;\r\n return arr[arr.length - 1];\r\n}\r\n\r\n","signature":"-11345568166-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n"},{"version":"-10991948013-import Animal from '.';\r\nimport { makeRandomName } from '../core/utilities';\r\n\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\n\r\nexport function createDog(): Dog {\r\n return ({\r\n size: \"medium\",\r\n woof: function(this: Dog) {\r\n console.log(`${this.name} says \"Woof\"!`);\r\n },\r\n name: makeRandomName()\r\n });\r\n}\r\n\r\n","signature":"6032048049-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n"}],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../animals","strict":true,"target":1},"fileIdsList":[[3,4],[2,5],[3]],"referencedMap":[[5,1],[3,2]],"exportedModulesMap":[[5,3],[3,2]],"semanticDiagnosticsPerFile":[1,2,5,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../animals/animal.ts","../../animals/index.ts","../../core/utilities.ts","../../animals/dog.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-14984181202-export type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n","signature":"-10510161654-export declare type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n"},{"version":"-5382672599-import Animal from './animal';\r\n\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n","signature":"1096904574-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n"},{"version":"25274411612-\r\nexport function makeRandomName() {\r\n return \"Bob!?! \";\r\n}\r\n\r\nexport function lastElementOf(arr: T[]): T | undefined {\r\n if (arr.length === 0) return undefined;\r\n return arr[arr.length - 1];\r\n}\r\n\r\n","signature":"-11345568166-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n"},{"version":"-10991948013-import Animal from '.';\r\nimport { makeRandomName } from '../core/utilities';\r\n\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\n\r\nexport function createDog(): Dog {\r\n return ({\r\n size: \"medium\",\r\n woof: function(this: Dog) {\r\n console.log(`${this.name} says \"Woof\"!`);\r\n },\r\n name: makeRandomName()\r\n });\r\n}\r\n\r\n","signature":"6032048049-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n"}],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../animals","strict":true,"target":1},"fileIdsList":[[3,4],[2,5],[3]],"referencedMap":[[5,1],[3,2]],"exportedModulesMap":[[5,3],[3,2]],"semanticDiagnosticsPerFile":[1,2,5,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/demo/lib/animals/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -284,7 +280,7 @@ exitCode:: ExitStatus.undefined }, "../../animals/animal.ts": { "version": "-14984181202-export type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n", - "signature": "-14984181202-export type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n" + "signature": "-10510161654-export declare type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n" }, "../../animals/index.ts": { "version": "-5382672599-import Animal from './animal';\r\n\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n", @@ -340,6 +336,6 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 2536 + "size": 2695 } diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/with-simple-project.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/with-simple-project.js index 26455e87f76..f4c8657f89a 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/with-simple-project.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/with-simple-project.js @@ -129,10 +129,10 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) -/user/username/projects/demo/animals/animal.ts (used version) -/user/username/projects/demo/animals/index.ts (used version) +/user/username/projects/demo/animals/animal.ts (computed .d.ts during emit) +/user/username/projects/demo/animals/index.ts (computed .d.ts during emit) /user/username/projects/demo/core/utilities.ts (used version) -/user/username/projects/demo/animals/dog.ts (used version) +/user/username/projects/demo/animals/dog.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/demo/animals/tsconfig.json: @@ -224,7 +224,7 @@ export declare function createDog(): Dog; //// [/user/username/projects/demo/lib/animals/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../animals/animal.ts","../../animals/index.ts","../../core/utilities.ts","../../animals/dog.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-14984181202-export type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n","-5382672599-import Animal from './animal';\r\n\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n","25274411612-\r\nexport function makeRandomName() {\r\n return \"Bob!?! \";\r\n}\r\n\r\nexport function lastElementOf(arr: T[]): T | undefined {\r\n if (arr.length === 0) return undefined;\r\n return arr[arr.length - 1];\r\n}\r\n\r\n","-10991948013-import Animal from '.';\r\nimport { makeRandomName } from '../core/utilities';\r\n\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\n\r\nexport function createDog(): Dog {\r\n return ({\r\n size: \"medium\",\r\n woof: function(this: Dog) {\r\n console.log(`${this.name} says \"Woof\"!`);\r\n },\r\n name: makeRandomName()\r\n });\r\n}\r\n\r\n"],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../animals","strict":true,"target":1},"fileIdsList":[[3,4],[2,5]],"referencedMap":[[5,1],[3,2]],"exportedModulesMap":[[5,1],[3,2]],"semanticDiagnosticsPerFile":[1,2,5,3,4]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../animals/animal.ts","../../animals/index.ts","../../core/utilities.ts","../../animals/dog.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-14984181202-export type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n","signature":"-10510161654-export declare type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n"},{"version":"-5382672599-import Animal from './animal';\r\n\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n","signature":"1096904574-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n"},"25274411612-\r\nexport function makeRandomName() {\r\n return \"Bob!?! \";\r\n}\r\n\r\nexport function lastElementOf(arr: T[]): T | undefined {\r\n if (arr.length === 0) return undefined;\r\n return arr[arr.length - 1];\r\n}\r\n\r\n",{"version":"-10991948013-import Animal from '.';\r\nimport { makeRandomName } from '../core/utilities';\r\n\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\n\r\nexport function createDog(): Dog {\r\n return ({\r\n size: \"medium\",\r\n woof: function(this: Dog) {\r\n console.log(`${this.name} says \"Woof\"!`);\r\n },\r\n name: makeRandomName()\r\n });\r\n}\r\n\r\n","signature":"6032048049-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n"}],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../animals","strict":true,"target":1},"fileIdsList":[[3,4],[2,5],[3]],"referencedMap":[[5,1],[3,2]],"exportedModulesMap":[[5,3],[3,2]],"semanticDiagnosticsPerFile":[1,2,5,3,4]},"version":"FakeTSVersion"} //// [/user/username/projects/demo/lib/animals/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -244,6 +244,9 @@ export declare function createDog(): Dog; [ "../../animals/animal.ts", "../../animals/dog.ts" + ], + [ + "../../animals/index.ts" ] ], "fileInfos": { @@ -254,11 +257,11 @@ export declare function createDog(): Dog; }, "../../animals/animal.ts": { "version": "-14984181202-export type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n", - "signature": "-14984181202-export type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n" + "signature": "-10510161654-export declare type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n" }, "../../animals/index.ts": { "version": "-5382672599-import Animal from './animal';\r\n\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n", - "signature": "-5382672599-import Animal from './animal';\r\n\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n" + "signature": "1096904574-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n" }, "../../core/utilities.ts": { "version": "25274411612-\r\nexport function makeRandomName() {\r\n return \"Bob!?! \";\r\n}\r\n\r\nexport function lastElementOf(arr: T[]): T | undefined {\r\n if (arr.length === 0) return undefined;\r\n return arr[arr.length - 1];\r\n}\r\n\r\n", @@ -266,7 +269,7 @@ export declare function createDog(): Dog; }, "../../animals/dog.ts": { "version": "-10991948013-import Animal from '.';\r\nimport { makeRandomName } from '../core/utilities';\r\n\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\n\r\nexport function createDog(): Dog {\r\n return ({\r\n size: \"medium\",\r\n woof: function(this: Dog) {\r\n console.log(`${this.name} says \"Woof\"!`);\r\n },\r\n name: makeRandomName()\r\n });\r\n}\r\n\r\n", - "signature": "-10991948013-import Animal from '.';\r\nimport { makeRandomName } from '../core/utilities';\r\n\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\n\r\nexport function createDog(): Dog {\r\n return ({\r\n size: \"medium\",\r\n woof: function(this: Dog) {\r\n console.log(`${this.name} says \"Woof\"!`);\r\n },\r\n name: makeRandomName()\r\n });\r\n}\r\n\r\n" + "signature": "6032048049-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n" } }, "options": { @@ -294,8 +297,7 @@ export declare function createDog(): Dog; }, "exportedModulesMap": { "../../animals/dog.ts": [ - "../../animals/index.ts", - "../../core/utilities.ts" + "../../animals/index.ts" ], "../../animals/index.ts": [ "../../animals/animal.ts", @@ -311,6 +313,6 @@ export declare function createDog(): Dog; ] }, "version": "FakeTSVersion", - "size": 2024 + "size": 2536 } diff --git a/tests/baselines/reference/tscWatch/watchApi/noEmit-with-composite-with-emit-builder.js b/tests/baselines/reference/tscWatch/watchApi/noEmit-with-composite-with-emit-builder.js index fc6493f8707..9c424cba570 100644 --- a/tests/baselines/reference/tscWatch/watchApi/noEmit-with-composite-with-emit-builder.js +++ b/tests/baselines/reference/tscWatch/watchApi/noEmit-with-composite-with-emit-builder.js @@ -163,7 +163,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-10726455937-export const x = 10;","-13729955264-export const y = 10;"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-10726455937-export const x = 10;","signature":"-6821242887-export declare const x = 10;\n"},{"version":"-13729955264-export const y = 10;","signature":"-7152472870-export declare const y = 10;\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -181,11 +181,11 @@ exitCode:: ExitStatus.undefined }, "./main.ts": { "version": "-10726455937-export const x = 10;", - "signature": "-10726455937-export const x = 10;" + "signature": "-6821242887-export declare const x = 10;\n" }, "./other.ts": { "version": "-13729955264-export const y = 10;", - "signature": "-13729955264-export const y = 10;" + "signature": "-7152472870-export declare const y = 10;\n" } }, "options": { @@ -200,7 +200,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 701 + "size": 839 } //// [/user/username/projects/myproject/main.js] @@ -278,7 +278,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-14918944530-export const x = 10;\n// SomeComment","signature":"-6821242887-export declare const x = 10;\n"},"-13729955264-export const y = 10;"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3],"affectedFilesPendingEmit":[[2,1]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-14918944530-export const x = 10;\n// SomeComment","signature":"-6821242887-export declare const x = 10;\n"},{"version":"-13729955264-export const y = 10;","signature":"-7152472870-export declare const y = 10;\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3],"affectedFilesPendingEmit":[[2,1]]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -300,7 +300,7 @@ exitCode:: ExitStatus.undefined }, "./other.ts": { "version": "-13729955264-export const y = 10;", - "signature": "-13729955264-export const y = 10;" + "signature": "-7152472870-export declare const y = 10;\n" } }, "options": { @@ -321,7 +321,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 821 + "size": 890 } @@ -367,7 +367,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-14918944530-export const x = 10;\n// SomeComment","signature":"-6821242887-export declare const x = 10;\n"},"-13729955264-export const y = 10;"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-14918944530-export const x = 10;\n// SomeComment","signature":"-6821242887-export declare const x = 10;\n"},{"version":"-13729955264-export const y = 10;","signature":"-7152472870-export declare const y = 10;\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -389,7 +389,7 @@ exitCode:: ExitStatus.undefined }, "./other.ts": { "version": "-13729955264-export const y = 10;", - "signature": "-13729955264-export const y = 10;" + "signature": "-7152472870-export declare const y = 10;\n" } }, "options": { @@ -404,7 +404,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 786 + "size": 855 } //// [/user/username/projects/myproject/main.js] @@ -470,7 +470,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-16105752451-export const x = 10;\n// SomeComment\n// SomeComment","signature":"-6821242887-export declare const x = 10;\n"},"-13729955264-export const y = 10;"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-16105752451-export const x = 10;\n// SomeComment\n// SomeComment","signature":"-6821242887-export declare const x = 10;\n"},{"version":"-13729955264-export const y = 10;","signature":"-7152472870-export declare const y = 10;\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -492,7 +492,7 @@ exitCode:: ExitStatus.undefined }, "./other.ts": { "version": "-13729955264-export const y = 10;", - "signature": "-13729955264-export const y = 10;" + "signature": "-7152472870-export declare const y = 10;\n" } }, "options": { @@ -507,7 +507,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 802 + "size": 871 } //// [/user/username/projects/myproject/main.js] diff --git a/tests/baselines/reference/tscWatch/watchApi/noEmit-with-composite-with-semantic-builder.js b/tests/baselines/reference/tscWatch/watchApi/noEmit-with-composite-with-semantic-builder.js index e3d303320d6..0b673432958 100644 --- a/tests/baselines/reference/tscWatch/watchApi/noEmit-with-composite-with-semantic-builder.js +++ b/tests/baselines/reference/tscWatch/watchApi/noEmit-with-composite-with-semantic-builder.js @@ -170,7 +170,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-10726455937-export const x = 10;","-13729955264-export const y = 10;"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-10726455937-export const x = 10;","signature":"-6821242887-export declare const x = 10;\n"},{"version":"-13729955264-export const y = 10;","signature":"-7152472870-export declare const y = 10;\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -188,11 +188,11 @@ exitCode:: ExitStatus.undefined }, "./main.ts": { "version": "-10726455937-export const x = 10;", - "signature": "-10726455937-export const x = 10;" + "signature": "-6821242887-export declare const x = 10;\n" }, "./other.ts": { "version": "-13729955264-export const y = 10;", - "signature": "-13729955264-export const y = 10;" + "signature": "-7152472870-export declare const y = 10;\n" } }, "options": { @@ -207,7 +207,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 701 + "size": 839 } //// [/user/username/projects/myproject/main.js] @@ -292,7 +292,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-14918944530-export const x = 10;\n// SomeComment","signature":"-6821242887-export declare const x = 10;\n"},"-13729955264-export const y = 10;"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3],"affectedFilesPendingEmit":[[2,1]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-14918944530-export const x = 10;\n// SomeComment","signature":"-6821242887-export declare const x = 10;\n"},{"version":"-13729955264-export const y = 10;","signature":"-7152472870-export declare const y = 10;\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3],"affectedFilesPendingEmit":[[2,1]]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -314,7 +314,7 @@ exitCode:: ExitStatus.undefined }, "./other.ts": { "version": "-13729955264-export const y = 10;", - "signature": "-13729955264-export const y = 10;" + "signature": "-7152472870-export declare const y = 10;\n" } }, "options": { @@ -335,7 +335,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 821 + "size": 890 } @@ -388,7 +388,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-14918944530-export const x = 10;\n// SomeComment","signature":"-6821242887-export declare const x = 10;\n"},"-13729955264-export const y = 10;"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-14918944530-export const x = 10;\n// SomeComment","signature":"-6821242887-export declare const x = 10;\n"},{"version":"-13729955264-export const y = 10;","signature":"-7152472870-export declare const y = 10;\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -410,7 +410,7 @@ exitCode:: ExitStatus.undefined }, "./other.ts": { "version": "-13729955264-export const y = 10;", - "signature": "-13729955264-export const y = 10;" + "signature": "-7152472870-export declare const y = 10;\n" } }, "options": { @@ -425,7 +425,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 786 + "size": 855 } //// [/user/username/projects/myproject/main.js] @@ -498,7 +498,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-16105752451-export const x = 10;\n// SomeComment\n// SomeComment","signature":"-6821242887-export declare const x = 10;\n"},"-13729955264-export const y = 10;"],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-16105752451-export const x = 10;\n// SomeComment\n// SomeComment","signature":"-6821242887-export declare const x = 10;\n"},{"version":"-13729955264-export const y = 10;","signature":"-7152472870-export declare const y = 10;\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -520,7 +520,7 @@ exitCode:: ExitStatus.undefined }, "./other.ts": { "version": "-13729955264-export const y = 10;", - "signature": "-13729955264-export const y = 10;" + "signature": "-7152472870-export declare const y = 10;\n" } }, "options": { @@ -535,7 +535,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 802 + "size": 871 } //// [/user/username/projects/myproject/main.js] diff --git a/tests/baselines/reference/tscWatch/watchApi/noEmitOnError-with-composite-with-emit-builder.js b/tests/baselines/reference/tscWatch/watchApi/noEmitOnError-with-composite-with-emit-builder.js index 746f207f20c..4ca9f5dcdf6 100644 --- a/tests/baselines/reference/tscWatch/watchApi/noEmitOnError-with-composite-with-emit-builder.js +++ b/tests/baselines/reference/tscWatch/watchApi/noEmitOnError-with-composite-with-emit-builder.js @@ -311,7 +311,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-10726455937-export const x = 10;","signature":"-6821242887-export declare const x = 10;\n"},"-13729955264-export const y = 10;"],"options":{"composite":true,"noEmitOnError":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-10726455937-export const x = 10;","signature":"-6821242887-export declare const x = 10;\n"},{"version":"-13729955264-export const y = 10;","signature":"-7152472870-export declare const y = 10;\n"}],"options":{"composite":true,"noEmitOnError":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -333,7 +333,7 @@ exitCode:: ExitStatus.undefined }, "./other.ts": { "version": "-13729955264-export const y = 10;", - "signature": "-13729955264-export const y = 10;" + "signature": "-7152472870-export declare const y = 10;\n" } }, "options": { @@ -349,7 +349,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 791 + "size": 860 } //// [/user/username/projects/myproject/main.js] diff --git a/tests/baselines/reference/tscWatch/watchApi/noEmitOnError-with-composite-with-semantic-builder.js b/tests/baselines/reference/tscWatch/watchApi/noEmitOnError-with-composite-with-semantic-builder.js index 4ac14799857..d5fd4d074b4 100644 --- a/tests/baselines/reference/tscWatch/watchApi/noEmitOnError-with-composite-with-semantic-builder.js +++ b/tests/baselines/reference/tscWatch/watchApi/noEmitOnError-with-composite-with-semantic-builder.js @@ -325,7 +325,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-10726455937-export const x = 10;","signature":"-6821242887-export declare const x = 10;\n"},"-13729955264-export const y = 10;"],"options":{"composite":true,"noEmitOnError":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-10726455937-export const x = 10;","signature":"-6821242887-export declare const x = 10;\n"},{"version":"-13729955264-export const y = 10;","signature":"-7152472870-export declare const y = 10;\n"}],"options":{"composite":true,"noEmitOnError":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -347,7 +347,7 @@ exitCode:: ExitStatus.undefined }, "./other.ts": { "version": "-13729955264-export const y = 10;", - "signature": "-13729955264-export const y = 10;" + "signature": "-7152472870-export declare const y = 10;\n" } }, "options": { @@ -363,7 +363,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 791 + "size": 860 } //// [/user/username/projects/myproject/main.js] diff --git a/tests/baselines/reference/tscWatch/watchApi/semantic-builder-emitOnlyDts.js b/tests/baselines/reference/tscWatch/watchApi/semantic-builder-emitOnlyDts.js index d00e3ef9749..2124226bf44 100644 --- a/tests/baselines/reference/tscWatch/watchApi/semantic-builder-emitOnlyDts.js +++ b/tests/baselines/reference/tscWatch/watchApi/semantic-builder-emitOnlyDts.js @@ -189,7 +189,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-10726455937-export const x = 10;","signature":"-6821242887-export declare const x = 10;\n"},"-13729955264-export const y = 10;"],"options":{"composite":true,"noEmitOnError":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3],"affectedFilesPendingEmit":[[2,1],[3,1]]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-10726455937-export const x = 10;","signature":"-6821242887-export declare const x = 10;\n"},{"version":"-13729955264-export const y = 10;","signature":"-7152472870-export declare const y = 10;\n"}],"options":{"composite":true,"noEmitOnError":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3],"affectedFilesPendingEmit":[[2,1],[3,1]]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -211,7 +211,7 @@ exitCode:: ExitStatus.undefined }, "./other.ts": { "version": "-13729955264-export const y = 10;", - "signature": "-13729955264-export const y = 10;" + "signature": "-7152472870-export declare const y = 10;\n" } }, "options": { @@ -237,7 +237,7 @@ exitCode:: ExitStatus.undefined ] }, "version": "FakeTSVersion", - "size": 832 + "size": 901 } //// [/user/username/projects/myproject/main.d.ts] diff --git a/tests/baselines/reference/tscWatch/watchApi/when-new-file-is-added-to-the-referenced-project-with-host-implementing-getParsedCommandLine-without-implementing-useSourceOfProjectReferenceRedirect.js b/tests/baselines/reference/tscWatch/watchApi/when-new-file-is-added-to-the-referenced-project-with-host-implementing-getParsedCommandLine-without-implementing-useSourceOfProjectReferenceRedirect.js index 9ec37ab2c39..4118a2f21c3 100644 --- a/tests/baselines/reference/tscWatch/watchApi/when-new-file-is-added-to-the-referenced-project-with-host-implementing-getParsedCommandLine-without-implementing-useSourceOfProjectReferenceRedirect.js +++ b/tests/baselines/reference/tscWatch/watchApi/when-new-file-is-added-to-the-referenced-project-with-host-implementing-getParsedCommandLine-without-implementing-useSourceOfProjectReferenceRedirect.js @@ -74,7 +74,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/myproject/projects/project1/class1.d.ts (used version) -/user/username/projects/myproject/projects/project2/class2.ts (used version) +/user/username/projects/myproject/projects/project2/class2.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/projects/project2/tsconfig.json: @@ -118,7 +118,7 @@ declare class class2 { //// [/user/username/projects/myproject/projects/project2/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../project1/class1.d.ts","./class2.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3469237238-declare class class1 {}","affectsGlobalScope":true},{"version":"777969115-class class2 {}","affectsGlobalScope":true}],"options":{"composite":true,"module":0},"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../project1/class1.d.ts","./class2.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-3469237238-declare class class1 {}","affectsGlobalScope":true},{"version":"777969115-class class2 {}","signature":"-2684084705-declare class class2 {\n}\n","affectsGlobalScope":true}],"options":{"composite":true,"module":0},"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/projects/project2/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -141,7 +141,7 @@ declare class class2 { }, "./class2.ts": { "version": "777969115-class class2 {}", - "signature": "777969115-class class2 {}", + "signature": "-2684084705-declare class class2 {\n}\n", "affectsGlobalScope": true } }, @@ -156,7 +156,7 @@ declare class class2 { ] }, "version": "FakeTSVersion", - "size": 760 + "size": 814 } diff --git a/tests/baselines/reference/tscWatch/watchApi/when-new-file-is-added-to-the-referenced-project-with-host-implementing-getParsedCommandLine.js b/tests/baselines/reference/tscWatch/watchApi/when-new-file-is-added-to-the-referenced-project-with-host-implementing-getParsedCommandLine.js index 6593e9d8cf2..d75dca26348 100644 --- a/tests/baselines/reference/tscWatch/watchApi/when-new-file-is-added-to-the-referenced-project-with-host-implementing-getParsedCommandLine.js +++ b/tests/baselines/reference/tscWatch/watchApi/when-new-file-is-added-to-the-referenced-project-with-host-implementing-getParsedCommandLine.js @@ -74,7 +74,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/myproject/projects/project1/class1.ts (used version) -/user/username/projects/myproject/projects/project2/class2.ts (used version) +/user/username/projects/myproject/projects/project2/class2.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/projects/project2/tsconfig.json: @@ -118,7 +118,7 @@ declare class class2 { //// [/user/username/projects/myproject/projects/project2/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../project1/class1.ts","./class2.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"777933178-class class1 {}","affectsGlobalScope":true},{"version":"777969115-class class2 {}","affectsGlobalScope":true}],"options":{"composite":true,"module":0},"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +{"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../project1/class1.ts","./class2.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"777933178-class class1 {}","affectsGlobalScope":true},{"version":"777969115-class class2 {}","signature":"-2684084705-declare class class2 {\n}\n","affectsGlobalScope":true}],"options":{"composite":true,"module":0},"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} //// [/user/username/projects/myproject/projects/project2/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -141,7 +141,7 @@ declare class class2 { }, "./class2.ts": { "version": "777969115-class class2 {}", - "signature": "777969115-class class2 {}", + "signature": "-2684084705-declare class class2 {\n}\n", "affectsGlobalScope": true } }, @@ -156,7 +156,7 @@ declare class class2 { ] }, "version": "FakeTSVersion", - "size": 748 + "size": 802 } diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-with-outDir-and-declaration-enabled.js b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-with-outDir-and-declaration-enabled.js index 9abf4fa0ace..37fd4927ba2 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-with-outDir-and-declaration-enabled.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/watchDirectories/with-non-synchronous-watch-directory-with-outDir-and-declaration-enabled.js @@ -47,7 +47,7 @@ Semantic diagnostics in builder refreshed for:: Shape signatures in builder refreshed for:: /a/lib/lib.d.ts (used version) /user/username/projects/myproject/node_modules/file2/index.d.ts (used version) -/user/username/projects/myproject/src/file1.ts (used version) +/user/username/projects/myproject/src/file1.ts (computed .d.ts during emit) WatchedFiles:: /user/username/projects/myproject/tsconfig.json: From ab2523bbe0352d4486f67b73473d2143ad64d03d Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 21 Apr 2022 11:50:28 -0700 Subject: [PATCH 10/63] Handles time on vfs and write non empty shadowed files in baseline even if they were not read (#48703) * Use fixed time for vfs so baselining is consistent * Baseline buildinfos * Write new file text in baseline even if the file wasnt read on the shadow * Remove unnecessary debugger statement --- src/harness/vfsUtil.ts | 24 +- src/harness/virtualFileSystemWithWatch.ts | 2 +- src/testRunner/unittests/tsbuild/helpers.ts | 63 +- src/testRunner/unittests/tsbuild/outFile.ts | 15 +- src/testRunner/unittests/tsbuild/publicApi.ts | 6 +- src/testRunner/unittests/tsbuild/sample.ts | 3 +- src/testRunner/unittests/tsc/helpers.ts | 2 +- .../modules-and-globals-mixed-in-amd.js | 22 +- .../multiple-emitHelpers-in-all-projects.js | 34 +- .../multiple-prologues-in-all-projects.js | 34 +- .../shebang-in-all-projects.js | 22 +- .../amdModulesWithOut/stripInternal.js | 32 +- .../triple-slash-refs-in-all-projects.js | 22 +- ...e-resolution-finds-original-source-file.js | 10 +- .../file-name-and-output-name-clashing.js | 14 +- .../when-tsconfig-extends-the-missing-file.js | 14 +- ...nce-and-both-extend-config-with-include.js | 12 +- ...th-projects-extends-config-with-include.js | 10 +- ...ter-initial-build-doesnt-build-anything.js | 22 +- ...ugh-triple-slash-but-uses-no-references.js | 14 +- ...file-is-referenced-through-triple-slash.js | 14 +- ...d-inferred-type-from-referenced-project.js | 10 +- ...s-not-in-rootDir-at-the-import-location.js | 22 +- ...ts-the-error-about-it-by-stopping-build.js | 61 +- ...ng-setup-correctly-and-reports-no-error.js | 14 +- ...-emitDeclarationOnly-and-declarationMap.js | 12 +- ...import-project-with-emitDeclarationOnly.js | 12 +- ...mports-project-with-emitDeclarationOnly.js | 20 +- ...es-is-empty-and-references-are-provided.js | 10 + ...is-empty-and-no-references-are-provided.js | 35 +- .../exitCodeOnBogusFile/test-exit-code.js | 14 +- ...-transitive-module-with-isolatedModules.js | 22 +- .../inferred-type-from-transitive-module.js | 22 +- ...hange-in-signature-with-isolatedModules.js | 34 +- ...s-merged-and-contains-late-bound-member.js | 22 +- ...t-resolution-options-referenced-project.js | 10 +- ...fiers-across-projects-resolve-correctly.js | 24 +- ...zed-module-specifiers-resolve-correctly.js | 14 +- .../outFile/builds-till-project-specified.js | 18 +- .../tsbuild/outFile/clean-projects.js | 429 ++++++++++++- .../outFile/cleans-till-project-specified.js | 429 ++++++++++++- .../non-module-projects-without-prepend.js | 14 +- ...al-flag-changes-between-non-dts-changes.js | 38 +- ...-in-tsbuildinfo-doesnt-match-ts-version.js | 582 ++++++++++++------ ...erated-when-incremental-is-set-to-false.js | 14 +- ...-buildInfo-absence-results-in-new-build.js | 339 ++++++---- .../baseline-sectioned-sourcemaps.js | 40 +- .../declarationMap-and-sourceMap-disabled.js | 14 +- .../emitHelpers-in-all-projects.js | 54 +- ...tHelpers-in-only-one-dependency-project.js | 42 +- .../tsbuild/outfile-concat/explainFiles.js | 40 +- .../multiple-emitHelpers-in-all-projects.js | 42 +- ...tiple-emitHelpers-in-different-projects.js | 42 +- .../multiple-prologues-in-all-projects.js | 54 +- ...ultiple-prologues-in-different-projects.js | 42 +- .../outfile-concat/shebang-in-all-projects.js | 40 +- .../shebang-in-only-one-dependency-project.js | 28 +- .../outfile-concat/strict-in-all-projects.js | 54 +- .../strict-in-one-dependency.js | 42 +- ...hen-internal-is-inside-another-internal.js | 14 +- ...en-one-two-three-are-prepended-in-order.js | 50 +- .../stripInternal-jsdoc-style-comment.js | 42 +- ...en-one-two-three-are-prepended-in-order.js | 32 +- ...-jsdoc-style-with-comments-emit-enabled.js | 28 +- ...l-when-few-members-of-enum-are-internal.js | 14 +- ...en-one-two-three-are-prepended-in-order.js | 64 +- ...nal-when-prepend-is-completely-internal.js | 46 +- ...en-one-two-three-are-prepended-in-order.js | 50 +- ...tripInternal-with-comments-emit-enabled.js | 42 +- .../tsbuild/outfile-concat/stripInternal.js | 54 +- .../triple-slash-refs-in-all-projects.js | 40 +- .../triple-slash-refs-in-one-project.js | 28 +- ...roject-is-not-composite-but-incremental.js | 14 +- ...t-composite-but-uses-project-references.js | 26 +- ...final-project-specifies-tsBuildInfoFile.js | 14 +- ...-source-files-are-empty-in-the-own-file.js | 28 +- ...otDir-is-not-specified-and-is-composite.js | 10 +- .../when-rootDir-is-not-specified.js | 10 +- ...iles-belong-to-rootDir-and-is-composite.js | 12 +- ...ied-but-not-all-files-belong-to-rootDir.js | 12 +- .../outputPaths/when-rootDir-is-specified.js | 10 +- ...nfo-file-because-no-rootDir-in-the-base.js | 10 +- ...reports-error-for-same-tsbuildinfo-file.js | 23 +- ...eports-no-error-when-tsbuildinfo-differ.js | 23 +- .../build-with-custom-transformers.js | 10 +- .../files-containing-json-file.js | 57 +- ...ting-json-module-from-project-reference.js | 16 +- .../resolveJsonModule/include-and-files.js | 54 +- ...r-include-and-file-name-matches-ts-file.js | 57 +- ...nclude-of-json-along-with-other-include.js | 57 +- .../tsbuild/resolveJsonModule/include-only.js | 57 +- .../tsbuild/resolveJsonModule/sourcemap.js | 61 +- .../resolveJsonModule/without-outDir.js | 61 +- .../always-builds-under-with-force-option.js | 13 + ...t-in-not-build-order-doesnt-throw-error.js | 46 +- .../building-using-buildReferencedProject.js | 31 +- ...rectly-when-declarationDir-is-specified.js | 13 + ...ilds-correctly-when-outDir-is-specified.js | 13 + ...composite-or-doesnt-have-any-references.js | 59 +- .../sample1/builds-till-project-specified.js | 21 + .../can-detect-when-and-what-to-rebuild.js | 307 ++++++++- ...t-in-not-build-order-doesnt-throw-error.js | 324 +++++++++- .../sample1/cleans-till-project-specified.js | 324 +++++++++- ...ojects-if-upstream-projects-have-errors.js | 35 +- ...vent-if-version-doesnt-match-ts-version.js | 106 +++- ...does-not-write-any-files-in-a-dry-build.js | 52 +- .../reference/tsbuild/sample1/explainFiles.js | 59 +- ...it-would-skip-builds-during-a-dry-build.js | 295 ++++++++- .../tsbuild/sample1/listEmittedFiles.js | 13 + .../reference/tsbuild/sample1/listFiles.js | 13 + ...-in-tsbuildinfo-doesnt-match-ts-version.js | 257 +++++++- ...uilds-from-start-if-force-option-is-set.js | 293 +++++---- ...uilds-when-extended-config-file-changes.js | 37 +- .../sample1/removes-all-files-it-built.js | 289 ++++++++- .../reference/tsbuild/sample1/sample.js | 79 ++- .../when-declaration-option-changes.js | 65 +- .../when-esModuleInterop-option-changes.js | 37 +- .../when-logic-specifies-tsBuildInfoFile.js | 27 +- .../sample1/when-module-option-changes.js | 65 +- .../sample1/when-target-option-changes.js | 65 +- ...de-resolution-with-external-module-name.js | 7 +- ...ault-lib-that-augments-the-global-scope.js | 14 +- ...file-is-added-to-the-referenced-project.js | 2 +- .../tsc/listFilesOnly/combined-with-watch.js | 16 +- ...eferences-composite-project-with-noEmit.js | 2 +- ...ypes-found-doesn't-crash-under---strict.js | 2 +- ...th-no-backing-types-found-doesn't-crash.js | 2 +- ...does-not-add-color-when-NO_COLOR-is-set.js | 14 +- ...-when-host-can't-provide-terminal-width.js | 14 +- ...tatus.DiagnosticsPresent_OutputsSkipped.js | 14 +- 130 files changed, 5601 insertions(+), 1696 deletions(-) diff --git a/src/harness/vfsUtil.ts b/src/harness/vfsUtil.ts index b32bb785683..63a3d6963d5 100644 --- a/src/harness/vfsUtil.ts +++ b/src/harness/vfsUtil.ts @@ -55,12 +55,12 @@ namespace vfs { } = {}; private _cwd: string; // current working directory - private _time: number | Date | (() => number | Date); + private _time: number; private _shadowRoot: FileSystem | undefined; private _dirStack: string[] | undefined; constructor(ignoreCase: boolean, options: FileSystemOptions = {}) { - const { time = -1, files, meta } = options; + const { time = ts.TestFSWithWatch.timeIncrements, files, meta } = options; this.ignoreCase = ignoreCase; this.stringComparer = this.ignoreCase ? vpath.compareCaseInsensitive : vpath.compareCaseSensitive; this._time = time; @@ -167,16 +167,15 @@ namespace vfs { * * @link http://pubs.opengroup.org/onlinepubs/9699919799/functions/time.html */ - public time(value?: number | Date | (() => number | Date)): number { - if (value !== undefined && this.isReadonly) throw createIOError("EPERM"); - let result = this._time; - if (typeof result === "function") result = result(); - if (typeof result === "object") result = result.getTime(); - if (result === -1) result = Date.now(); + public time(value?: number): number { if (value !== undefined) { + if (this.isReadonly) throw createIOError("EPERM"); this._time = value; } - return result; + else if (!this.isReadonly) { + this._time += ts.TestFSWithWatch.timeIncrements; + } + return this._time; } /** @@ -843,7 +842,7 @@ namespace vfs { container[basename] = new Symlink(node.symlink); } else { - container[basename] = new File(node.buffer || ""); + container[basename] = new File(changed._getBuffer(node)); } return true; } @@ -1172,9 +1171,8 @@ namespace vfs { } export interface FileSystemOptions { - // Sets the initial timestamp for new files and directories, or the function used - // to calculate timestamps. - time?: number | Date | (() => number | Date); + // Sets the initial timestamp for new files and directories + time?: number; // A set of file system entries to initially add to the file system. files?: FileSet; diff --git a/src/harness/virtualFileSystemWithWatch.ts b/src/harness/virtualFileSystemWithWatch.ts index a7229fd2783..829d6e8fa41 100644 --- a/src/harness/virtualFileSystemWithWatch.ts +++ b/src/harness/virtualFileSystemWithWatch.ts @@ -360,7 +360,7 @@ interface Array { length: number; [n: number]: T; }` DynamicPolling = "RecursiveDirectoryUsingDynamicPriorityPolling" } - const timeIncrements = 1000; + export const timeIncrements = 1000; export interface TestServerHostOptions { useCaseSensitiveFileNames: boolean; executingFilePath: string; diff --git a/src/testRunner/unittests/tsbuild/helpers.ts b/src/testRunner/unittests/tsbuild/helpers.ts index fdc3b3e0648..44830d3a886 100644 --- a/src/testRunner/unittests/tsbuild/helpers.ts +++ b/src/testRunner/unittests/tsbuild/helpers.ts @@ -78,26 +78,6 @@ namespace ts { }; } - export function getTime() { - let currentTime = 100; - return { tick, time, touch }; - - function tick() { - currentTime += 60_000; - } - - function time() { - return currentTime; - } - - function touch(fs: vfs.FileSystem, path: string) { - if (!fs.statSync(path).isFile()) { - throw new Error(`File ${path} does not exist`); - } - fs.utimesSync(path, new Date(time()), new Date(time())); - } - } - export const libContent = `${TestFSWithWatch.libFile.content} interface ReadonlyArray {} declare const console: { log(msg: any): void; };`; @@ -154,26 +134,6 @@ interface Symbol { fs.makeReadonly(); } - /** - * Gets the FS mountuing existing fs's /src and /lib folder - */ - export function getFsWithTime(baseFs: vfs.FileSystem) { - const { time, tick } = getTime(); - const host = new fakes.System(baseFs) as any as vfs.FileSystemResolverHost; - host.getWorkspaceRoot = notImplemented; - const resolver = vfs.createResolver(host); - const fs = new vfs.FileSystem(/*ignoreCase*/ true, { - files: { - ["/src"]: new vfs.Mount("/src", resolver), - ["/lib"]: new vfs.Mount("/lib", resolver) - }, - cwd: "/", - meta: { defaultLibLocation: "/lib" }, - time - }); - return { fs, time, tick }; - } - export function verifyOutputsPresent(fs: vfs.FileSystem, outputs: readonly string[]) { for (const output of outputs) { assert(fs.existsSync(output), `Expect file ${output} to exist`); @@ -336,7 +296,6 @@ interface Symbol { commandLineArgs: TestTscCompile["commandLineArgs"]; modifyFs: TestTscCompile["modifyFs"]; editFs: TestTscEdit["modifyFs"]; - tick: () => void; baseFs: vfs.FileSystem; newSys: TscCompileSystem; cleanBuildDiscrepancies: TestTscEdit["cleanBuildDiscrepancies"]; @@ -347,7 +306,7 @@ interface Symbol { const { scenario, commandLineArgs, cleanBuildDiscrepancies, modifyFs, editFs, - tick, baseFs, newSys + baseFs, newSys } = input(); const sys = testTscCompile({ scenario, @@ -355,7 +314,6 @@ interface Symbol { fs: () => baseFs.makeReadonly(), commandLineArgs, modifyFs: fs => { - tick(); if (modifyFs) modifyFs(fs); editFs(fs); }, @@ -532,22 +490,18 @@ interface Symbol { edits }: VerifyTscWithEditsWorkerInput) { describe(`tsc ${commandLineArgs.join(" ")} ${scenario}:: ${subScenario} serializedEdits`, () => { - let tick: () => void; let sys: TscCompileSystem; let baseFs: vfs.FileSystem; let editsSys: TscCompileSystem[]; before(() => { Debug.assert(!!edits.length, `${scenario}/${subScenario}:: No incremental scenarios, you probably want to use verifyTsc instead.`); - ({ fs: baseFs, tick } = getFsWithTime(fs())); + baseFs = fs().makeReadonly(); sys = testTscCompile({ scenario, subScenario, - fs: () => baseFs.makeReadonly(), + fs: () => baseFs, commandLineArgs, - modifyFs: fs => { - if (modifyFs) modifyFs(fs); - tick(); - }, + modifyFs, baselineSourceMap, baselineReadFileCalls, baselinePrograms @@ -556,18 +510,13 @@ interface Symbol { { modifyFs, subScenario: editScenario, commandLineArgs: editCommandLineArgs }, index ) => { - tick(); (editsSys || (editsSys = [])).push(testTscCompile({ scenario, subScenario: editScenario || subScenario, diffWithInitial: true, fs: () => index === 0 ? sys.vfs : editsSys[index - 1].vfs, commandLineArgs: editCommandLineArgs || commandLineArgs, - modifyFs: fs => { - tick(); - modifyFs(fs); - tick(); - }, + modifyFs, baselineSourceMap, baselineReadFileCalls, baselinePrograms @@ -577,7 +526,6 @@ interface Symbol { after(() => { baseFs = undefined!; sys = undefined!; - tick = undefined!; editsSys = undefined!; }); describe("tsc invocation after edit", () => { @@ -608,7 +556,6 @@ interface Symbol { } }, modifyFs, - tick }), index, subScenario)); }); }); diff --git a/src/testRunner/unittests/tsbuild/outFile.ts b/src/testRunner/unittests/tsbuild/outFile.ts index eb58823fd45..109ab200c69 100644 --- a/src/testRunner/unittests/tsbuild/outFile.ts +++ b/src/testRunner/unittests/tsbuild/outFile.ts @@ -10,10 +10,6 @@ namespace ts { outFileWithBuildFs = undefined!; }); - function createSolutionBuilder(host: fakes.SolutionBuilderHost, baseOptions?: BuildOptions) { - return ts.createSolutionBuilder(host, ["/src/third"], { dry: false, force: false, verbose: true, ...(baseOptions || {}) }); - } - interface VerifyOutFileScenarioInput { subScenario: string; modifyFs?: (fs: vfs.FileSystem) => void; @@ -108,8 +104,9 @@ namespace ts { function getOutFileFsAfterBuild() { if (outFileWithBuildFs) return outFileWithBuildFs; const fs = outFileFs.shadow(); - const host = fakes.SolutionBuilderHost.create(fs); - const builder = createSolutionBuilder(host); + const sys = new fakes.System(fs, { executingFilePath: "/lib/tsc" }); + const host = createSolutionBuilderHostForBaseline(sys as TscCompileSystem); + const builder = createSolutionBuilder(host, ["/src/third"], { dry: false, force: false, verbose: true }); builder.build(); fs.makeReadonly(); return outFileWithBuildFs = fs; @@ -147,7 +144,7 @@ namespace ts { compile: sys => { // Buildinfo will have version which does not match with current ts version const buildHost = createSolutionBuilderHostForBaseline(sys, "FakeTSCurrentVersion"); - const builder = ts.createSolutionBuilder(buildHost, ["/src/third"], { verbose: true }); + const builder = createSolutionBuilder(buildHost, ["/src/third"], { verbose: true }); sys.exit(builder.build()); } }); @@ -181,7 +178,7 @@ namespace ts { commandLineArgs: ["--build", "/src/second/tsconfig.json"], compile: sys => { const buildHost = createSolutionBuilderHostForBaseline(sys); - const builder = ts.createSolutionBuilder(buildHost, ["/src/third/tsconfig.json"], {}); + const builder = createSolutionBuilder(buildHost, ["/src/third/tsconfig.json"], {}); sys.exit(builder.build("/src/second/tsconfig.json")); } }); @@ -193,7 +190,7 @@ namespace ts { commandLineArgs: ["--build", "--clean", "/src/second/tsconfig.json"], compile: sys => { const buildHost = createSolutionBuilderHostForBaseline(sys); - const builder = ts.createSolutionBuilder(buildHost, ["/src/third/tsconfig.json"], { verbose: true }); + const builder = createSolutionBuilder(buildHost, ["/src/third/tsconfig.json"], { verbose: true }); sys.exit(builder.clean("/src/second/tsconfig.json")); } }); diff --git a/src/testRunner/unittests/tsbuild/publicApi.ts b/src/testRunner/unittests/tsbuild/publicApi.ts index b929e960221..304be7e0b2e 100644 --- a/src/testRunner/unittests/tsbuild/publicApi.ts +++ b/src/testRunner/unittests/tsbuild/publicApi.ts @@ -2,7 +2,7 @@ namespace ts { describe("unittests:: tsbuild:: Public API with custom transformers when passed to build", () => { let sys: TscCompileSystem; before(() => { - const initialFs = getFsWithTime(loadProjectFromFiles({ + const inputFs = loadProjectFromFiles({ "/src/tsconfig.json": JSON.stringify({ references: [ { path: "./shared/tsconfig.json" }, @@ -29,9 +29,7 @@ export class c2 { } export enum e2 { } // leading export function f22() { } // trailing`, - })).fs.makeReadonly(); - const inputFs = initialFs.shadow(); - inputFs.makeReadonly(); + }).makeReadonly(); const fs = inputFs.shadow(); // Create system diff --git a/src/testRunner/unittests/tsbuild/sample.ts b/src/testRunner/unittests/tsbuild/sample.ts index b3b51994b6d..c74fba5eb11 100644 --- a/src/testRunner/unittests/tsbuild/sample.ts +++ b/src/testRunner/unittests/tsbuild/sample.ts @@ -21,7 +21,8 @@ namespace ts { function getSampleFsAfterBuild() { if (projFsWithBuild) return projFsWithBuild; const fs = projFs.shadow(); - const host = fakes.SolutionBuilderHost.create(fs); + const sys = new fakes.System(fs, { executingFilePath: "/lib/tsc" }); + const host = createSolutionBuilderHostForBaseline(sys as TscCompileSystem); const builder = createSolutionBuilder(host, ["/src/tests"], {}); builder.build(); fs.makeReadonly(); diff --git a/src/testRunner/unittests/tsc/helpers.ts b/src/testRunner/unittests/tsc/helpers.ts index 58d8a83f706..bfcf7be3cf3 100644 --- a/src/testRunner/unittests/tsc/helpers.ts +++ b/src/testRunner/unittests/tsc/helpers.ts @@ -214,7 +214,7 @@ ${patch ? vfs.formatPatch(patch) : ""}` describe(input.subScenario, () => { verifyTscBaseline(() => verifier({ ...input, - fs: () => getFsWithTime(input.fs()).fs.makeReadonly() + fs: () => input.fs().makeReadonly() })); }); }); diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/modules-and-globals-mixed-in-amd.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/modules-and-globals-mixed-in-amd.js index f1975b6c48b..167a38161a5 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/modules-and-globals-mixed-in-amd.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/modules-and-globals-mixed-in-amd.js @@ -69,17 +69,17 @@ const globalConst = 10; Output:: /lib/tsc --b /src/app --verbose -[12:01:00 AM] Projects in this build: +[12:00:06 AM] Projects in this build: * src/lib/tsconfig.json * src/app/tsconfig.json -[12:01:00 AM] Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist +[12:00:07 AM] Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist -[12:01:00 AM] Building project '/src/lib/tsconfig.json'... +[12:00:08 AM] Building project '/src/lib/tsconfig.json'... -[12:01:00 AM] Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist +[12:00:16 AM] Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist -[12:01:00 AM] Building project '/src/app/tsconfig.json'... +[12:00:17 AM] Building project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success @@ -936,19 +936,19 @@ export const x = 10;console.log(x); Output:: /lib/tsc --b /src/app --verbose -[12:04:00 AM] Projects in this build: +[12:00:30 AM] Projects in this build: * src/lib/tsconfig.json * src/app/tsconfig.json -[12:04:00 AM] Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts' +[12:00:31 AM] Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts' -[12:04:00 AM] Building project '/src/lib/tsconfig.json'... +[12:00:32 AM] Building project '/src/lib/tsconfig.json'... -[12:04:00 AM] Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed +[12:00:40 AM] Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed -[12:04:00 AM] Updating output of project '/src/app/tsconfig.json'... +[12:00:41 AM] Updating output of project '/src/app/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... +[12:00:46 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/multiple-emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/multiple-emitHelpers-in-all-projects.js index 998937747e5..59c02c18307 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/multiple-emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/multiple-emitHelpers-in-all-projects.js @@ -81,17 +81,17 @@ const globalConst = 10; Output:: /lib/tsc --b /src/app --verbose -[12:01:00 AM] Projects in this build: +[12:00:12 AM] Projects in this build: * src/lib/tsconfig.json * src/app/tsconfig.json -[12:01:00 AM] Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist +[12:00:13 AM] Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist -[12:01:00 AM] Building project '/src/lib/tsconfig.json'... +[12:00:14 AM] Building project '/src/lib/tsconfig.json'... -[12:01:00 AM] Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist +[12:00:22 AM] Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist -[12:01:00 AM] Building project '/src/app/tsconfig.json'... +[12:00:23 AM] Building project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success @@ -2113,19 +2113,19 @@ const { b, ...rest } = { a: 10, b: 30, yy: 30 }; Output:: /lib/tsc --b /src/app --verbose -[12:04:00 AM] Projects in this build: +[12:00:36 AM] Projects in this build: * src/lib/tsconfig.json * src/app/tsconfig.json -[12:04:00 AM] Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts' +[12:00:37 AM] Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts' -[12:04:00 AM] Building project '/src/lib/tsconfig.json'... +[12:00:38 AM] Building project '/src/lib/tsconfig.json'... -[12:04:00 AM] Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed +[12:00:46 AM] Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed -[12:04:00 AM] Updating output of project '/src/app/tsconfig.json'... +[12:00:47 AM] Updating output of project '/src/app/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... +[12:00:52 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success @@ -3730,19 +3730,19 @@ export const x = 10;function forlibfile1Rest() { }console.log(x); Output:: /lib/tsc --b /src/app --verbose -[12:07:00 AM] Projects in this build: +[12:01:01 AM] Projects in this build: * src/lib/tsconfig.json * src/app/tsconfig.json -[12:07:00 AM] Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts' +[12:01:02 AM] Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts' -[12:07:00 AM] Building project '/src/lib/tsconfig.json'... +[12:01:03 AM] Building project '/src/lib/tsconfig.json'... -[12:07:00 AM] Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed +[12:01:11 AM] Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed -[12:07:00 AM] Updating output of project '/src/app/tsconfig.json'... +[12:01:12 AM] Updating output of project '/src/app/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... +[12:01:17 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/multiple-prologues-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/multiple-prologues-in-all-projects.js index bd0d249a912..517343f4ad7 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/multiple-prologues-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/multiple-prologues-in-all-projects.js @@ -74,17 +74,17 @@ const globalConst = 10; Output:: /lib/tsc --b /src/app --verbose -[12:01:00 AM] Projects in this build: +[12:00:13 AM] Projects in this build: * src/lib/tsconfig.json * src/app/tsconfig.json -[12:01:00 AM] Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist +[12:00:14 AM] Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist -[12:01:00 AM] Building project '/src/lib/tsconfig.json'... +[12:00:15 AM] Building project '/src/lib/tsconfig.json'... -[12:01:00 AM] Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist +[12:00:23 AM] Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist -[12:01:00 AM] Building project '/src/app/tsconfig.json'... +[12:00:24 AM] Building project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success @@ -1222,19 +1222,19 @@ export const x = 10;console.log(x); Output:: /lib/tsc --b /src/app --verbose -[12:04:00 AM] Projects in this build: +[12:00:37 AM] Projects in this build: * src/lib/tsconfig.json * src/app/tsconfig.json -[12:04:00 AM] Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts' +[12:00:38 AM] Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts' -[12:04:00 AM] Building project '/src/lib/tsconfig.json'... +[12:00:39 AM] Building project '/src/lib/tsconfig.json'... -[12:04:00 AM] Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed +[12:00:47 AM] Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed -[12:04:00 AM] Updating output of project '/src/app/tsconfig.json'... +[12:00:48 AM] Updating output of project '/src/app/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... +[12:00:53 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success @@ -2111,19 +2111,19 @@ export const x = 10;console.log(x); Output:: /lib/tsc --b /src/app --verbose -[12:07:00 AM] Projects in this build: +[12:01:02 AM] Projects in this build: * src/lib/tsconfig.json * src/app/tsconfig.json -[12:07:00 AM] Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts' +[12:01:03 AM] Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts' -[12:07:00 AM] Building project '/src/lib/tsconfig.json'... +[12:01:04 AM] Building project '/src/lib/tsconfig.json'... -[12:07:00 AM] Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed +[12:01:12 AM] Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed -[12:07:00 AM] Updating output of project '/src/app/tsconfig.json'... +[12:01:13 AM] Updating output of project '/src/app/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... +[12:01:19 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/shebang-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/shebang-in-all-projects.js index db0ff719b66..d6dc16faeba 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/shebang-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/shebang-in-all-projects.js @@ -72,17 +72,17 @@ const globalConst = 10; Output:: /lib/tsc --b /src/app --verbose -[12:01:00 AM] Projects in this build: +[12:00:09 AM] Projects in this build: * src/lib/tsconfig.json * src/app/tsconfig.json -[12:01:00 AM] Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist +[12:00:10 AM] Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist -[12:01:00 AM] Building project '/src/lib/tsconfig.json'... +[12:00:11 AM] Building project '/src/lib/tsconfig.json'... -[12:01:00 AM] Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist +[12:00:19 AM] Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist -[12:01:00 AM] Building project '/src/app/tsconfig.json'... +[12:00:20 AM] Building project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success @@ -958,19 +958,19 @@ export const x = 10;console.log(x); Output:: /lib/tsc --b /src/app --verbose -[12:04:00 AM] Projects in this build: +[12:00:33 AM] Projects in this build: * src/lib/tsconfig.json * src/app/tsconfig.json -[12:04:00 AM] Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts' +[12:00:34 AM] Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts' -[12:04:00 AM] Building project '/src/lib/tsconfig.json'... +[12:00:35 AM] Building project '/src/lib/tsconfig.json'... -[12:04:00 AM] Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed +[12:00:43 AM] Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed -[12:04:00 AM] Updating output of project '/src/app/tsconfig.json'... +[12:00:44 AM] Updating output of project '/src/app/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... +[12:00:49 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/stripInternal.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/stripInternal.js index 9497ab0218c..01d26503916 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/stripInternal.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/stripInternal.js @@ -95,17 +95,17 @@ const globalConst = 10; Output:: /lib/tsc --b /src/app --verbose -[12:01:00 AM] Projects in this build: +[12:00:09 AM] Projects in this build: * src/lib/tsconfig.json * src/app/tsconfig.json -[12:01:00 AM] Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist +[12:00:10 AM] Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist -[12:01:00 AM] Building project '/src/lib/tsconfig.json'... +[12:00:11 AM] Building project '/src/lib/tsconfig.json'... -[12:01:00 AM] Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist +[12:00:19 AM] Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist -[12:01:00 AM] Building project '/src/app/tsconfig.json'... +[12:00:20 AM] Building project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success @@ -4863,19 +4863,19 @@ export namespace normalN { Output:: /lib/tsc --b /src/app --verbose -[12:04:00 AM] Projects in this build: +[12:00:33 AM] Projects in this build: * src/lib/tsconfig.json * src/app/tsconfig.json -[12:04:00 AM] Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts' +[12:00:34 AM] Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts' -[12:04:00 AM] Building project '/src/lib/tsconfig.json'... +[12:00:35 AM] Building project '/src/lib/tsconfig.json'... -[12:04:00 AM] Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed +[12:00:43 AM] Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed -[12:04:00 AM] Updating output of project '/src/app/tsconfig.json'... +[12:00:44 AM] Updating output of project '/src/app/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... +[12:00:49 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success @@ -8671,17 +8671,17 @@ export namespace normalN { Output:: /lib/tsc --b /src/app --verbose -[12:07:00 AM] Projects in this build: +[12:00:58 AM] Projects in this build: * src/lib/tsconfig.json * src/app/tsconfig.json -[12:07:00 AM] Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts' +[12:00:59 AM] Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts' -[12:07:00 AM] Building project '/src/lib/tsconfig.json'... +[12:01:00 AM] Building project '/src/lib/tsconfig.json'... -[12:07:00 AM] Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed +[12:01:08 AM] Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed -[12:07:00 AM] Updating output of project '/src/app/tsconfig.json'... +[12:01:09 AM] Updating output of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/triple-slash-refs-in-all-projects.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/triple-slash-refs-in-all-projects.js index 3ad0c88e81d..03189af6066 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/triple-slash-refs-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/triple-slash-refs-in-all-projects.js @@ -79,17 +79,17 @@ declare class libfile0 { } Output:: /lib/tsc --b /src/app --verbose -[12:01:00 AM] Projects in this build: +[12:00:10 AM] Projects in this build: * src/lib/tsconfig.json * src/app/tsconfig.json -[12:01:00 AM] Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist +[12:00:11 AM] Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist -[12:01:00 AM] Building project '/src/lib/tsconfig.json'... +[12:00:12 AM] Building project '/src/lib/tsconfig.json'... -[12:01:00 AM] Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist +[12:00:20 AM] Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist -[12:01:00 AM] Building project '/src/app/tsconfig.json'... +[12:00:21 AM] Building project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success @@ -1171,19 +1171,19 @@ export const x = 10;console.log(x); Output:: /lib/tsc --b /src/app --verbose -[12:04:00 AM] Projects in this build: +[12:00:34 AM] Projects in this build: * src/lib/tsconfig.json * src/app/tsconfig.json -[12:04:00 AM] Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts' +[12:00:35 AM] Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts' -[12:04:00 AM] Building project '/src/lib/tsconfig.json'... +[12:00:36 AM] Building project '/src/lib/tsconfig.json'... -[12:04:00 AM] Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed +[12:00:44 AM] Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed -[12:04:00 AM] Updating output of project '/src/app/tsconfig.json'... +[12:00:45 AM] Updating output of project '/src/app/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... +[12:00:50 AM] Updating unchanged output timestamps of project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/when-the-module-resolution-finds-original-source-file.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/when-the-module-resolution-finds-original-source-file.js index babc7d70a35..d77d1678ae8 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/when-the-module-resolution-finds-original-source-file.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/when-the-module-resolution-finds-original-source-file.js @@ -69,17 +69,17 @@ const globalConst = 10; Output:: /lib/tsc -b /src/app --verbose -[12:00:00 AM] Projects in this build: +[12:00:08 AM] Projects in this build: * src/lib/tsconfig.json * src/app/tsconfig.json -[12:00:00 AM] Project 'src/lib/tsconfig.json' is out of date because output file 'src/module.js' does not exist +[12:00:09 AM] Project 'src/lib/tsconfig.json' is out of date because output file 'src/module.js' does not exist -[12:00:00 AM] Building project '/src/lib/tsconfig.json'... +[12:00:10 AM] Building project '/src/lib/tsconfig.json'... -[12:00:00 AM] Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist +[12:00:18 AM] Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist -[12:00:00 AM] Building project '/src/app/tsconfig.json'... +[12:00:19 AM] Building project '/src/app/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/clean/file-name-and-output-name-clashing.js b/tests/baselines/reference/tsbuild/clean/file-name-and-output-name-clashing.js index e8cecc75d8c..88b1765793d 100644 --- a/tests/baselines/reference/tsbuild/clean/file-name-and-output-name-clashing.js +++ b/tests/baselines/reference/tsbuild/clean/file-name-and-output-name-clashing.js @@ -1,6 +1,18 @@ Input:: //// [/lib/lib.d.ts] - +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; //// [/src/bar.ts] diff --git a/tests/baselines/reference/tsbuild/configFileErrors/when-tsconfig-extends-the-missing-file.js b/tests/baselines/reference/tsbuild/configFileErrors/when-tsconfig-extends-the-missing-file.js index b948e6af201..6671142bb0b 100644 --- a/tests/baselines/reference/tsbuild/configFileErrors/when-tsconfig-extends-the-missing-file.js +++ b/tests/baselines/reference/tsbuild/configFileErrors/when-tsconfig-extends-the-missing-file.js @@ -1,6 +1,18 @@ Input:: //// [/lib/lib.d.ts] - +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; //// [/src/tsconfig.first.json] { diff --git a/tests/baselines/reference/tsbuild/configFileExtends/when-building-project-uses-reference-and-both-extend-config-with-include.js b/tests/baselines/reference/tsbuild/configFileExtends/when-building-project-uses-reference-and-both-extend-config-with-include.js index 84c9301c3a8..59c5133c2de 100644 --- a/tests/baselines/reference/tsbuild/configFileExtends/when-building-project-uses-reference-and-both-extend-config-with-include.js +++ b/tests/baselines/reference/tsbuild/configFileExtends/when-building-project-uses-reference-and-both-extend-config-with-include.js @@ -27,7 +27,7 @@ export const a: Unrestricted = 1; type Unrestricted = any; //// [/src/tsconfig.json] - +{"references":[{"path":"./shared/tsconfig.json"},{"path":"./webpack/tsconfig.json"}],"files":[]} //// [/src/webpack/index.ts] export const b: Unrestricted = 1; @@ -39,20 +39,20 @@ export const b: Unrestricted = 1; Output:: /lib/tsc --b /src/webpack/tsconfig.json --v --listFiles -[12:00:00 AM] Projects in this build: +[12:00:16 AM] Projects in this build: * src/shared/tsconfig.json * src/webpack/tsconfig.json -[12:00:00 AM] Project 'src/shared/tsconfig.json' is out of date because output file 'src/target-tsc-build/shared/index.js' does not exist +[12:00:17 AM] Project 'src/shared/tsconfig.json' is out of date because output file 'src/target-tsc-build/shared/index.js' does not exist -[12:00:00 AM] Building project '/src/shared/tsconfig.json'... +[12:00:18 AM] Building project '/src/shared/tsconfig.json'... /lib/lib.d.ts /src/shared/index.ts /src/shared/typings-base/globals.d.ts -[12:00:00 AM] Project 'src/webpack/tsconfig.json' is out of date because output file 'src/target-tsc-build/webpack/index.js' does not exist +[12:00:25 AM] Project 'src/webpack/tsconfig.json' is out of date because output file 'src/target-tsc-build/webpack/index.js' does not exist -[12:00:00 AM] Building project '/src/webpack/tsconfig.json'... +[12:00:26 AM] Building project '/src/webpack/tsconfig.json'... /lib/lib.d.ts /src/webpack/index.ts diff --git a/tests/baselines/reference/tsbuild/configFileExtends/when-building-solution-with-projects-extends-config-with-include.js b/tests/baselines/reference/tsbuild/configFileExtends/when-building-solution-with-projects-extends-config-with-include.js index 832c2c4a1fb..80699604c08 100644 --- a/tests/baselines/reference/tsbuild/configFileExtends/when-building-solution-with-projects-extends-config-with-include.js +++ b/tests/baselines/reference/tsbuild/configFileExtends/when-building-solution-with-projects-extends-config-with-include.js @@ -39,21 +39,21 @@ export const b: Unrestricted = 1; Output:: /lib/tsc --b /src/tsconfig.json --v --listFiles -[12:00:00 AM] Projects in this build: +[12:00:16 AM] Projects in this build: * src/shared/tsconfig.json * src/webpack/tsconfig.json * src/tsconfig.json -[12:00:00 AM] Project 'src/shared/tsconfig.json' is out of date because output file 'src/target-tsc-build/shared/index.js' does not exist +[12:00:17 AM] Project 'src/shared/tsconfig.json' is out of date because output file 'src/target-tsc-build/shared/index.js' does not exist -[12:00:00 AM] Building project '/src/shared/tsconfig.json'... +[12:00:18 AM] Building project '/src/shared/tsconfig.json'... /lib/lib.d.ts /src/shared/index.ts /src/shared/typings-base/globals.d.ts -[12:00:00 AM] Project 'src/webpack/tsconfig.json' is out of date because output file 'src/target-tsc-build/webpack/index.js' does not exist +[12:00:25 AM] Project 'src/webpack/tsconfig.json' is out of date because output file 'src/target-tsc-build/webpack/index.js' does not exist -[12:00:00 AM] Building project '/src/webpack/tsconfig.json'... +[12:00:26 AM] Building project '/src/webpack/tsconfig.json'... /lib/lib.d.ts /src/webpack/index.ts diff --git a/tests/baselines/reference/tsbuild/containerOnlyReferenced/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js b/tests/baselines/reference/tsbuild/containerOnlyReferenced/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js index 02f844f3b56..2ce246e4af5 100644 --- a/tests/baselines/reference/tsbuild/containerOnlyReferenced/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js +++ b/tests/baselines/reference/tsbuild/containerOnlyReferenced/verify-that-subsequent-builds-after-initial-build-doesnt-build-anything.js @@ -78,24 +78,24 @@ export const x = 10; Output:: /lib/tsc --b /src --verbose -[12:01:00 AM] Projects in this build: +[12:00:06 AM] Projects in this build: * src/src/folder/tsconfig.json * src/src/folder2/tsconfig.json * src/src/tsconfig.json * src/tests/tsconfig.json * src/tsconfig.json -[12:01:00 AM] Project 'src/src/folder/tsconfig.json' is out of date because output file 'src/src/folder/index.js' does not exist +[12:00:07 AM] Project 'src/src/folder/tsconfig.json' is out of date because output file 'src/src/folder/index.js' does not exist -[12:01:00 AM] Building project '/src/src/folder/tsconfig.json'... +[12:00:08 AM] Building project '/src/src/folder/tsconfig.json'... -[12:01:00 AM] Project 'src/src/folder2/tsconfig.json' is out of date because output file 'src/src/folder2/index.js' does not exist +[12:00:13 AM] Project 'src/src/folder2/tsconfig.json' is out of date because output file 'src/src/folder2/index.js' does not exist -[12:01:00 AM] Building project '/src/src/folder2/tsconfig.json'... +[12:00:14 AM] Building project '/src/src/folder2/tsconfig.json'... -[12:01:00 AM] Project 'src/tests/tsconfig.json' is out of date because output file 'src/tests/index.js' does not exist +[12:00:19 AM] Project 'src/tests/tsconfig.json' is out of date because output file 'src/tests/index.js' does not exist -[12:01:00 AM] Building project '/src/tests/tsconfig.json'... +[12:00:20 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success @@ -246,18 +246,18 @@ Input:: Output:: /lib/tsc --b /src --verbose -[12:04:00 AM] Projects in this build: +[12:00:25 AM] Projects in this build: * src/src/folder/tsconfig.json * src/src/folder2/tsconfig.json * src/src/tsconfig.json * src/tests/tsconfig.json * src/tsconfig.json -[12:04:00 AM] Project 'src/src/folder/tsconfig.json' is up to date because newest input 'src/src/folder/index.ts' is older than oldest output 'src/src/folder/index.js' +[12:00:26 AM] Project 'src/src/folder/tsconfig.json' is up to date because newest input 'src/src/folder/index.ts' is older than oldest output 'src/src/folder/index.js' -[12:04:00 AM] Project 'src/src/folder2/tsconfig.json' is up to date because newest input 'src/src/folder2/index.ts' is older than oldest output 'src/src/folder2/index.js' +[12:00:27 AM] Project 'src/src/folder2/tsconfig.json' is up to date because newest input 'src/src/folder2/index.ts' is older than oldest output 'src/src/folder2/index.js' -[12:04:00 AM] Project 'src/tests/tsconfig.json' is up to date because newest input 'src/tests/index.ts' is older than oldest output 'src/tests/index.js' +[12:00:28 AM] Project 'src/tests/tsconfig.json' is up to date because newest input 'src/tests/index.ts' is older than oldest output 'src/tests/index.js' exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-is-referenced-through-triple-slash-but-uses-no-references.js b/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-is-referenced-through-triple-slash-but-uses-no-references.js index 525d80ed504..a0ea8ab754c 100644 --- a/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-is-referenced-through-triple-slash-but-uses-no-references.js +++ b/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-is-referenced-through-triple-slash-but-uses-no-references.js @@ -19,7 +19,7 @@ declare const console: { log(msg: any): void; }; export declare type Nominal = MyNominal; //// [/src/solution/src/common/tsconfig.json] - +{"extends":"../../tsconfig.base.json","compilerOptions":{"composite":true},"include":["./nominal.ts"]} //// [/src/solution/src/common/types.d.ts] declare type MyNominal = T & { @@ -31,7 +31,7 @@ import { Nominal } from '../common/nominal'; export type MyNominal = Nominal; //// [/src/solution/src/subProject/tsconfig.json] - +{"extends":"../../tsconfig.base.json","compilerOptions":{"composite":true},"references":[{"path":"../common"}],"include":["./index.ts"]} //// [/src/solution/src/subProject2/index.ts] import { MyNominal } from '../subProject/index'; @@ -43,10 +43,10 @@ export function getVar(): keyof typeof variable { } //// [/src/solution/src/subProject2/tsconfig.json] - +{"extends":"../../tsconfig.base.json","compilerOptions":{"composite":true},"references":[{"path":"../subProject"}],"include":["./index.ts"]} //// [/src/solution/src/tsconfig.json] - +{"compilerOptions":{"composite":true},"references":[{"path":"./subProject"},{"path":"./subProject2"}],"include":[]} //// [/src/solution/tsconfig.base.json] {"compilerOptions":{"rootDir":"./","outDir":"lib"}} @@ -58,12 +58,12 @@ export function getVar(): keyof typeof variable { Output:: /lib/tsc --b /src/solution/tsconfig.json --verbose -[12:00:00 AM] Projects in this build: +[12:00:21 AM] Projects in this build: * src/solution/tsconfig.json -[12:00:00 AM] Project 'src/solution/tsconfig.json' is out of date because output file 'src/solution/lib/src/common/nominal.js' does not exist +[12:00:22 AM] Project 'src/solution/tsconfig.json' is out of date because output file 'src/solution/lib/src/common/nominal.js' does not exist -[12:00:00 AM] Building project '/src/solution/tsconfig.json'... +[12:00:23 AM] Building project '/src/solution/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-is-referenced-through-triple-slash.js b/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-is-referenced-through-triple-slash.js index a6e33d6fe5e..3de7c42c595 100644 --- a/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-is-referenced-through-triple-slash.js +++ b/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-is-referenced-through-triple-slash.js @@ -58,24 +58,24 @@ export function getVar(): keyof typeof variable { Output:: /lib/tsc --b /src/solution/tsconfig.json --verbose -[12:00:00 AM] Projects in this build: +[12:00:21 AM] Projects in this build: * src/solution/src/common/tsconfig.json * src/solution/src/subProject/tsconfig.json * src/solution/src/subProject2/tsconfig.json * src/solution/src/tsconfig.json * src/solution/tsconfig.json -[12:00:00 AM] Project 'src/solution/src/common/tsconfig.json' is out of date because output file 'src/solution/lib/src/common/nominal.js' does not exist +[12:00:22 AM] Project 'src/solution/src/common/tsconfig.json' is out of date because output file 'src/solution/lib/src/common/nominal.js' does not exist -[12:00:00 AM] Building project '/src/solution/src/common/tsconfig.json'... +[12:00:23 AM] Building project '/src/solution/src/common/tsconfig.json'... -[12:00:00 AM] Project 'src/solution/src/subProject/tsconfig.json' is out of date because output file 'src/solution/lib/src/subProject/index.js' does not exist +[12:00:31 AM] Project 'src/solution/src/subProject/tsconfig.json' is out of date because output file 'src/solution/lib/src/subProject/index.js' does not exist -[12:00:00 AM] Building project '/src/solution/src/subProject/tsconfig.json'... +[12:00:32 AM] Building project '/src/solution/src/subProject/tsconfig.json'... -[12:00:00 AM] Project 'src/solution/src/subProject2/tsconfig.json' is out of date because output file 'src/solution/lib/src/subProject2/index.js' does not exist +[12:00:38 AM] Project 'src/solution/src/subProject2/tsconfig.json' is out of date because output file 'src/solution/lib/src/subProject2/index.js' does not exist -[12:00:00 AM] Building project '/src/solution/src/subProject2/tsconfig.json'... +[12:00:39 AM] Building project '/src/solution/src/subProject2/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-used-inferred-type-from-referenced-project.js b/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-used-inferred-type-from-referenced-project.js index 1ffc26e73ac..8e9bd8c3463 100644 --- a/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-used-inferred-type-from-referenced-project.js +++ b/tests/baselines/reference/tsbuild/declarationEmit/when-declaration-file-used-inferred-type-from-referenced-project.js @@ -42,17 +42,17 @@ export function fn4() { Output:: /lib/tsc --b /src/packages/pkg2/tsconfig.json --verbose -[12:00:00 AM] Projects in this build: +[12:00:16 AM] Projects in this build: * src/packages/pkg1/tsconfig.json * src/packages/pkg2/tsconfig.json -[12:00:00 AM] Project 'src/packages/pkg1/tsconfig.json' is out of date because output file 'src/packages/pkg1/lib/src/index.js' does not exist +[12:00:17 AM] Project 'src/packages/pkg1/tsconfig.json' is out of date because output file 'src/packages/pkg1/lib/src/index.js' does not exist -[12:00:00 AM] Building project '/src/packages/pkg1/tsconfig.json'... +[12:00:18 AM] Building project '/src/packages/pkg1/tsconfig.json'... -[12:00:00 AM] Project 'src/packages/pkg2/tsconfig.json' is out of date because output file 'src/packages/pkg2/lib/src/index.js' does not exist +[12:00:25 AM] Project 'src/packages/pkg2/tsconfig.json' is out of date because output file 'src/packages/pkg2/lib/src/index.js' does not exist -[12:00:00 AM] Building project '/src/packages/pkg2/tsconfig.json'... +[12:00:26 AM] Building project '/src/packages/pkg2/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/demo/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js b/tests/baselines/reference/tsbuild/demo/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js index 6b617709cce..eb2e9c90ce4 100644 --- a/tests/baselines/reference/tsbuild/demo/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js +++ b/tests/baselines/reference/tsbuild/demo/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js @@ -132,21 +132,29 @@ export function lastElementOf(arr: T[]): T | undefined { } //// [/src/zoo/zoo.ts] +import { Dog, createDog } from '../animals/index'; + +export function createZoo(): Array { + return [ + createDog() + ]; +} + Output:: /lib/tsc --b /src/tsconfig.json --verbose -[12:00:00 AM] Projects in this build: +[12:00:07 AM] Projects in this build: * src/core/tsconfig.json * src/animals/tsconfig.json * src/zoo/tsconfig.json * src/tsconfig.json -[12:00:00 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/lib/core/utilities.js' does not exist +[12:00:08 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/lib/core/utilities.js' does not exist -[12:00:00 AM] Building project '/src/core/tsconfig.json'... +[12:00:09 AM] Building project '/src/core/tsconfig.json'... src/animals/index.ts:1:20 - error TS6059: File '/src/animals/animal.ts' is not under 'rootDir' '/src/core'. 'rootDir' is expected to contain all source files. @@ -199,13 +207,13 @@ Output::    ~~~ File is included via import here. -[12:00:00 AM] Project 'src/animals/tsconfig.json' can't be built because its dependency 'src/core' has errors +[12:00:14 AM] Project 'src/animals/tsconfig.json' can't be built because its dependency 'src/core' has errors -[12:00:00 AM] Skipping build of project '/src/animals/tsconfig.json' because its dependency '/src/core' has errors +[12:00:15 AM] Skipping build of project '/src/animals/tsconfig.json' because its dependency '/src/core' has errors -[12:00:00 AM] Project 'src/zoo/tsconfig.json' can't be built because its dependency 'src/animals' was not built +[12:00:16 AM] Project 'src/zoo/tsconfig.json' can't be built because its dependency 'src/animals' was not built -[12:00:00 AM] Skipping build of project '/src/zoo/tsconfig.json' because its dependency '/src/animals' was not built +[12:00:17 AM] Skipping build of project '/src/zoo/tsconfig.json' because its dependency '/src/animals' was not built Found 7 errors. diff --git a/tests/baselines/reference/tsbuild/demo/in-circular-branch-reports-the-error-about-it-by-stopping-build.js b/tests/baselines/reference/tsbuild/demo/in-circular-branch-reports-the-error-about-it-by-stopping-build.js index f84d662938d..7a5ecdf0d2b 100644 --- a/tests/baselines/reference/tsbuild/demo/in-circular-branch-reports-the-error-about-it-by-stopping-build.js +++ b/tests/baselines/reference/tsbuild/demo/in-circular-branch-reports-the-error-about-it-by-stopping-build.js @@ -1,14 +1,53 @@ Input:: //// [/lib/lib.d.ts] - +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; //// [/src/animals/animal.ts] +export type Size = "small" | "medium" | "large"; +export default interface Animal { + size: Size; +} //// [/src/animals/dog.ts] +import Animal from '.'; +import { makeRandomName } from '../core/utilities'; + +export interface Dog extends Animal { + woof(): void; + name: string; +} + +export function createDog(): Dog { + return ({ + size: "medium", + woof: function(this: Dog) { + console.log(`${this.name} says "Woof"!`); + }, + name: makeRandomName() + }); +} + //// [/src/animals/index.ts] +import Animal from './animal'; + +export default Animal; +import { createDog, Dog } from './dog'; +export { createDog, Dog }; //// [/src/animals/tsconfig.json] @@ -40,6 +79,16 @@ Input:: //// [/src/core/utilities.ts] +export function makeRandomName() { + return "Bob!?! "; +} + +export function lastElementOf(arr: T[]): T | undefined { + if (arr.length === 0) return undefined; + return arr[arr.length - 1]; +} + + //// [/src/tsconfig-base.json] { @@ -87,13 +136,21 @@ Input:: } //// [/src/zoo/zoo.ts] +import { Dog, createDog } from '../animals/index'; + +export function createZoo(): Array { + return [ + createDog() + ]; +} + Output:: /lib/tsc --b /src/tsconfig.json --verbose -[12:00:00 AM] Projects in this build: +[12:00:07 AM] Projects in this build: * src/animals/tsconfig.json * src/zoo/tsconfig.json * src/core/tsconfig.json diff --git a/tests/baselines/reference/tsbuild/demo/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js b/tests/baselines/reference/tsbuild/demo/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js index 26009885a75..3d6db1f835f 100644 --- a/tests/baselines/reference/tsbuild/demo/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js +++ b/tests/baselines/reference/tsbuild/demo/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js @@ -145,23 +145,23 @@ export function createZoo(): Array { Output:: /lib/tsc --b /src/tsconfig.json --verbose -[12:00:00 AM] Projects in this build: +[12:00:06 AM] Projects in this build: * src/core/tsconfig.json * src/animals/tsconfig.json * src/zoo/tsconfig.json * src/tsconfig.json -[12:00:00 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/lib/core/utilities.js' does not exist +[12:00:07 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/lib/core/utilities.js' does not exist -[12:00:00 AM] Building project '/src/core/tsconfig.json'... +[12:00:08 AM] Building project '/src/core/tsconfig.json'... -[12:00:00 AM] Project 'src/animals/tsconfig.json' is out of date because output file 'src/lib/animals/animal.js' does not exist +[12:00:15 AM] Project 'src/animals/tsconfig.json' is out of date because output file 'src/lib/animals/animal.js' does not exist -[12:00:00 AM] Building project '/src/animals/tsconfig.json'... +[12:00:16 AM] Building project '/src/animals/tsconfig.json'... -[12:00:00 AM] Project 'src/zoo/tsconfig.json' is out of date because output file 'src/lib/zoo/zoo.js' does not exist +[12:00:26 AM] Project 'src/zoo/tsconfig.json' is out of date because output file 'src/lib/zoo/zoo.js' does not exist -[12:00:00 AM] Building project '/src/zoo/tsconfig.json'... +[12:00:27 AM] Building project '/src/zoo/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js index 8d4b84b50a9..2e34936ad43 100644 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js @@ -70,12 +70,12 @@ export { C } from "./c"; Output:: /lib/tsc --b /src --verbose -[12:01:00 AM] Projects in this build: +[12:00:06 AM] Projects in this build: * src/tsconfig.json -[12:01:00 AM] Project 'src/tsconfig.json' is out of date because output file 'src/lib/a.d.ts' does not exist +[12:00:07 AM] Project 'src/tsconfig.json' is out of date because output file 'src/lib/a.d.ts' does not exist -[12:01:00 AM] Building project '/src/tsconfig.json'... +[12:00:08 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success @@ -244,12 +244,12 @@ export interface A { Output:: /lib/tsc --b /src --verbose -[12:04:00 AM] Projects in this build: +[12:00:21 AM] Projects in this build: * src/tsconfig.json -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' +[12:00:22 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' -[12:04:00 AM] Building project '/src/tsconfig.json'... +[12:00:23 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js index 61f540077e3..d54ea707e2c 100644 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js @@ -70,12 +70,12 @@ export { C } from "./c"; Output:: /lib/tsc --b /src --verbose -[12:01:00 AM] Projects in this build: +[12:00:07 AM] Projects in this build: * src/tsconfig.json -[12:01:00 AM] Project 'src/tsconfig.json' is out of date because output file 'src/lib/a.d.ts' does not exist +[12:00:08 AM] Project 'src/tsconfig.json' is out of date because output file 'src/lib/a.d.ts' does not exist -[12:01:00 AM] Building project '/src/tsconfig.json'... +[12:00:09 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success @@ -231,12 +231,12 @@ export interface A { Output:: /lib/tsc --b /src --verbose -[12:04:00 AM] Projects in this build: +[12:00:18 AM] Projects in this build: * src/tsconfig.json -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' +[12:00:19 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' -[12:04:00 AM] Building project '/src/tsconfig.json'... +[12:00:20 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js b/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js index d76a4888c6d..9f067f0726e 100644 --- a/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js +++ b/tests/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js @@ -64,12 +64,12 @@ export interface C { Output:: /lib/tsc --b /src --verbose -[12:01:00 AM] Projects in this build: +[12:00:08 AM] Projects in this build: * src/tsconfig.json -[12:01:00 AM] Project 'src/tsconfig.json' is out of date because output file 'src/lib/a.d.ts' does not exist +[12:00:09 AM] Project 'src/tsconfig.json' is out of date because output file 'src/lib/a.d.ts' does not exist -[12:01:00 AM] Building project '/src/tsconfig.json'... +[12:00:10 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success @@ -202,14 +202,14 @@ export interface A { Output:: /lib/tsc --b /src --verbose -[12:04:00 AM] Projects in this build: +[12:00:21 AM] Projects in this build: * src/tsconfig.json -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' +[12:00:22 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' -[12:04:00 AM] Building project '/src/tsconfig.json'... +[12:00:23 AM] Building project '/src/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... +[12:00:28 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... exitCode:: ExitStatus.Success @@ -315,12 +315,12 @@ export interface A { Output:: /lib/tsc --b /src --verbose -[12:07:00 AM] Projects in this build: +[12:00:35 AM] Projects in this build: * src/tsconfig.json -[12:07:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' +[12:00:36 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/lib/a.d.ts' is older than newest input 'src/src/a.ts' -[12:07:00 AM] Building project '/src/tsconfig.json'... +[12:00:37 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/emptyFiles/does-not-have-empty-files-diagnostic-when-files-is-empty-and-references-are-provided.js b/tests/baselines/reference/tsbuild/emptyFiles/does-not-have-empty-files-diagnostic-when-files-is-empty-and-references-are-provided.js index b8abb5962b5..575b2013654 100644 --- a/tests/baselines/reference/tsbuild/emptyFiles/does-not-have-empty-files-diagnostic-when-files-is-empty-and-references-are-provided.js +++ b/tests/baselines/reference/tsbuild/emptyFiles/does-not-have-empty-files-diagnostic-when-files-is-empty-and-references-are-provided.js @@ -30,6 +30,16 @@ export function multiply(a: number, b: number) { return a * b; } //// [/src/no-references/tsconfig.json] +{ + "references": [], + "files": [], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} //// [/src/with-references/tsconfig.json] diff --git a/tests/baselines/reference/tsbuild/emptyFiles/has-empty-files-diagnostic-when-files-is-empty-and-no-references-are-provided.js b/tests/baselines/reference/tsbuild/emptyFiles/has-empty-files-diagnostic-when-files-is-empty-and-no-references-are-provided.js index 12eee2bc1e7..de16bd64938 100644 --- a/tests/baselines/reference/tsbuild/emptyFiles/has-empty-files-diagnostic-when-files-is-empty-and-no-references-are-provided.js +++ b/tests/baselines/reference/tsbuild/emptyFiles/has-empty-files-diagnostic-when-files-is-empty-and-no-references-are-provided.js @@ -1,11 +1,32 @@ Input:: //// [/lib/lib.d.ts] - +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; //// [/src/core/index.ts] +export function multiply(a: number, b: number) { return a * b; } //// [/src/core/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} //// [/src/no-references/tsconfig.json] @@ -22,6 +43,18 @@ Input:: //// [/src/with-references/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + ], + "files": [], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} diff --git a/tests/baselines/reference/tsbuild/exitCodeOnBogusFile/test-exit-code.js b/tests/baselines/reference/tsbuild/exitCodeOnBogusFile/test-exit-code.js index 2a7d6272ff3..e2cf8538618 100644 --- a/tests/baselines/reference/tsbuild/exitCodeOnBogusFile/test-exit-code.js +++ b/tests/baselines/reference/tsbuild/exitCodeOnBogusFile/test-exit-code.js @@ -1,6 +1,18 @@ Input:: //// [/lib/lib.d.ts] - +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module-with-isolatedModules.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module-with-isolatedModules.js index 3a590ffee97..eb3f872d7a9 100644 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module-with-isolatedModules.js +++ b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module-with-isolatedModules.js @@ -72,12 +72,12 @@ export { default as bar } from './bar'; Output:: /lib/tsc --b /src --verbose -[12:01:00 AM] Projects in this build: +[12:00:07 AM] Projects in this build: * src/tsconfig.json -[12:01:00 AM] Project 'src/tsconfig.json' is out of date because output file 'src/obj/bar.js' does not exist +[12:00:08 AM] Project 'src/tsconfig.json' is out of date because output file 'src/obj/bar.js' does not exist -[12:01:00 AM] Building project '/src/tsconfig.json'... +[12:00:09 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success @@ -257,14 +257,14 @@ export default foo()(function foobar(): void { Output:: /lib/tsc --b /src --verbose -[12:04:00 AM] Projects in this build: +[12:00:22 AM] Projects in this build: * src/tsconfig.json -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' +[12:00:23 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' -[12:04:00 AM] Building project '/src/tsconfig.json'... +[12:00:24 AM] Building project '/src/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... +[12:00:31 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... exitCode:: ExitStatus.Success @@ -393,14 +393,14 @@ export default foo()(function foobar(param: string): void { Output:: /lib/tsc --b /src --verbose -[12:07:00 AM] Projects in this build: +[12:00:38 AM] Projects in this build: * src/tsconfig.json -[12:07:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' +[12:00:39 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' -[12:07:00 AM] Building project '/src/tsconfig.json'... +[12:00:40 AM] Building project '/src/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... +[12:00:47 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module.js index 70ae187dfcd..b507ad314cd 100644 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module.js +++ b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module.js @@ -72,12 +72,12 @@ export { default as bar } from './bar'; Output:: /lib/tsc --b /src --verbose -[12:01:00 AM] Projects in this build: +[12:00:06 AM] Projects in this build: * src/tsconfig.json -[12:01:00 AM] Project 'src/tsconfig.json' is out of date because output file 'src/obj/bar.js' does not exist +[12:00:07 AM] Project 'src/tsconfig.json' is out of date because output file 'src/obj/bar.js' does not exist -[12:01:00 AM] Building project '/src/tsconfig.json'... +[12:00:08 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success @@ -257,14 +257,14 @@ export default foo()(function foobar(): void { Output:: /lib/tsc --b /src --verbose -[12:04:00 AM] Projects in this build: +[12:00:21 AM] Projects in this build: * src/tsconfig.json -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' +[12:00:22 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' -[12:04:00 AM] Building project '/src/tsconfig.json'... +[12:00:23 AM] Building project '/src/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... +[12:00:31 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... exitCode:: ExitStatus.Success @@ -394,14 +394,14 @@ export default foo()(function foobar(param: string): void { Output:: /lib/tsc --b /src --verbose -[12:07:00 AM] Projects in this build: +[12:00:37 AM] Projects in this build: * src/tsconfig.json -[12:07:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' +[12:00:38 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' -[12:07:00 AM] Building project '/src/tsconfig.json'... +[12:00:39 AM] Building project '/src/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... +[12:00:47 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js index 9d1918fea05..9ddb383e8d5 100644 --- a/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js +++ b/tests/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js @@ -74,12 +74,12 @@ bar("hello"); Output:: /lib/tsc --b /src --verbose -[12:01:00 AM] Projects in this build: +[12:00:08 AM] Projects in this build: * src/tsconfig.json -[12:01:00 AM] Project 'src/tsconfig.json' is out of date because output file 'src/obj/bar.js' does not exist +[12:00:09 AM] Project 'src/tsconfig.json' is out of date because output file 'src/obj/bar.js' does not exist -[12:01:00 AM] Building project '/src/tsconfig.json'... +[12:00:10 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success @@ -261,12 +261,12 @@ export default foo()(function foobar(): void { Output:: /lib/tsc --b /src --verbose -[12:04:00 AM] Projects in this build: +[12:00:23 AM] Projects in this build: * src/tsconfig.json -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' +[12:00:24 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' -[12:04:00 AM] Building project '/src/tsconfig.json'... +[12:00:25 AM] Building project '/src/tsconfig.json'... src/lazyIndex.ts:4:5 - error TS2554: Expected 0 arguments, but got 1. @@ -411,14 +411,14 @@ export default foo()(function foobar(param: string): void { Output:: /lib/tsc --b /src --verbose -[12:07:00 AM] Projects in this build: +[12:00:29 AM] Projects in this build: * src/tsconfig.json -[12:07:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' +[12:00:30 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' -[12:07:00 AM] Building project '/src/tsconfig.json'... +[12:00:31 AM] Building project '/src/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... +[12:00:38 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... exitCode:: ExitStatus.Success @@ -533,12 +533,12 @@ export default foo()(function foobar(): void { Output:: /lib/tsc --b /src --verbose -[12:10:00 AM] Projects in this build: +[12:00:45 AM] Projects in this build: * src/tsconfig.json -[12:10:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' +[12:00:46 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/bar.ts' -[12:10:00 AM] Building project '/src/tsconfig.json'... +[12:00:47 AM] Building project '/src/tsconfig.json'... src/lazyIndex.ts:4:5 - error TS2554: Expected 0 arguments, but got 1. @@ -678,14 +678,14 @@ bar(); Output:: /lib/tsc --b /src --verbose -[12:13:00 AM] Projects in this build: +[12:00:51 AM] Projects in this build: * src/tsconfig.json -[12:13:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/lazyIndex.ts' +[12:00:52 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/obj/bar.js' is older than newest input 'src/lazyIndex.ts' -[12:13:00 AM] Building project '/src/tsconfig.json'... +[12:00:53 AM] Building project '/src/tsconfig.json'... -[12:13:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... +[12:01:01 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/lateBoundSymbol/interface-is-merged-and-contains-late-bound-member.js b/tests/baselines/reference/tsbuild/lateBoundSymbol/interface-is-merged-and-contains-late-bound-member.js index b7b96271b4e..9345e1527b5 100644 --- a/tests/baselines/reference/tsbuild/lateBoundSymbol/interface-is-merged-and-contains-late-bound-member.js +++ b/tests/baselines/reference/tsbuild/lateBoundSymbol/interface-is-merged-and-contains-late-bound-member.js @@ -48,12 +48,12 @@ type A = HKT[typeof sym]; Output:: /lib/tsc --b /src/tsconfig.json --verbose -[12:01:00 AM] Projects in this build: +[12:00:06 AM] Projects in this build: * src/tsconfig.json -[12:01:00 AM] Project 'src/tsconfig.json' is out of date because output file 'src/src/hkt.js' does not exist +[12:00:07 AM] Project 'src/tsconfig.json' is out of date because output file 'src/src/hkt.js' does not exist -[12:01:00 AM] Building project '/src/tsconfig.json'... +[12:00:08 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success @@ -155,14 +155,14 @@ type A = HKT[typeof sym]; Output:: /lib/tsc --b /src/tsconfig.json --verbose -[12:04:00 AM] Projects in this build: +[12:00:14 AM] Projects in this build: * src/tsconfig.json -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/src/hkt.js' is older than newest input 'src/src/main.ts' +[12:00:15 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/src/hkt.js' is older than newest input 'src/src/main.ts' -[12:04:00 AM] Building project '/src/tsconfig.json'... +[12:00:16 AM] Building project '/src/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... +[12:00:20 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... exitCode:: ExitStatus.Success @@ -258,14 +258,14 @@ type A = HKT[typeof sym];const x = 10; Output:: /lib/tsc --b /src/tsconfig.json --verbose -[12:07:00 AM] Projects in this build: +[12:00:24 AM] Projects in this build: * src/tsconfig.json -[12:07:00 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/src/hkt.js' is older than newest input 'src/src/main.ts' +[12:00:25 AM] Project 'src/tsconfig.json' is out of date because oldest output 'src/src/hkt.js' is older than newest input 'src/src/main.ts' -[12:07:00 AM] Building project '/src/tsconfig.json'... +[12:00:26 AM] Building project '/src/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... +[12:00:30 AM] Updating unchanged output timestamps of project '/src/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/moduleResolution/type-reference-resolution-uses-correct-options-for-different-resolution-options-referenced-project.js b/tests/baselines/reference/tsbuild/moduleResolution/type-reference-resolution-uses-correct-options-for-different-resolution-options-referenced-project.js index 4e211734c5b..577f875cc7c 100644 --- a/tests/baselines/reference/tsbuild/moduleResolution/type-reference-resolution-uses-correct-options-for-different-resolution-options-referenced-project.js +++ b/tests/baselines/reference/tsbuild/moduleResolution/type-reference-resolution-uses-correct-options-for-different-resolution-options-referenced-project.js @@ -36,13 +36,13 @@ declare type TheNum2 = "type2"; Output:: /lib/tsc -b /src/packages/pkg1.tsconfig.json /src/packages/pkg2.tsconfig.json --verbose --traceResolution -[12:00:00 AM] Projects in this build: +[12:00:17 AM] Projects in this build: * src/packages/pkg1.tsconfig.json * src/packages/pkg2.tsconfig.json -[12:00:00 AM] Project 'src/packages/pkg1.tsconfig.json' is out of date because output file 'src/packages/pkg1_index.js' does not exist +[12:00:18 AM] Project 'src/packages/pkg1.tsconfig.json' is out of date because output file 'src/packages/pkg1_index.js' does not exist -[12:00:00 AM] Building project '/src/packages/pkg1.tsconfig.json'... +[12:00:19 AM] Building project '/src/packages/pkg1.tsconfig.json'... ======== Resolving type reference directive 'sometype', containing file '/src/packages/__inferred type names__.ts', root directory '/src/packages/typeroot1'. ======== Resolving with primary search path '/src/packages/typeroot1'. @@ -50,9 +50,9 @@ File '/src/packages/typeroot1/sometype/package.json' does not exist. File '/src/packages/typeroot1/sometype/index.d.ts' exist - use it as a name resolution result. Resolving real path for '/src/packages/typeroot1/sometype/index.d.ts', result '/src/packages/typeroot1/sometype/index.d.ts'. ======== Type reference directive 'sometype' was successfully resolved to '/src/packages/typeroot1/sometype/index.d.ts', primary: true. ======== -[12:00:00 AM] Project 'src/packages/pkg2.tsconfig.json' is out of date because output file 'src/packages/pkg2_index.js' does not exist +[12:00:24 AM] Project 'src/packages/pkg2.tsconfig.json' is out of date because output file 'src/packages/pkg2_index.js' does not exist -[12:00:00 AM] Building project '/src/packages/pkg2.tsconfig.json'... +[12:00:25 AM] Building project '/src/packages/pkg2.tsconfig.json'... ======== Resolving type reference directive 'sometype', containing file '/src/packages/__inferred type names__.ts', root directory '/src/packages/typeroot2'. ======== Resolving with primary search path '/src/packages/typeroot2'. diff --git a/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-across-projects-resolve-correctly.js b/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-across-projects-resolve-correctly.js index 19798e4182d..c8c48ac9ca7 100644 --- a/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-across-projects-resolve-correctly.js +++ b/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-across-projects-resolve-correctly.js @@ -1,6 +1,18 @@ Input:: //// [/lib/lib.d.ts] - +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; //// [/lib/lib.es2020.full.d.ts] /// @@ -114,17 +126,17 @@ export * from './dogconfig.js'; Output:: /lib/tsc -b src/src-types src/src-dogs --verbose -[12:00:00 AM] Projects in this build: +[12:00:24 AM] Projects in this build: * src/src-types/tsconfig.json * src/src-dogs/tsconfig.json -[12:00:00 AM] Project 'src/src-types/tsconfig.json' is out of date because output file 'src/src-types/dogconfig.js' does not exist +[12:00:25 AM] Project 'src/src-types/tsconfig.json' is out of date because output file 'src/src-types/dogconfig.js' does not exist -[12:00:00 AM] Building project '/src/src-types/tsconfig.json'... +[12:00:26 AM] Building project '/src/src-types/tsconfig.json'... -[12:00:00 AM] Project 'src/src-dogs/tsconfig.json' is out of date because output file 'src/src-dogs/dog.js' does not exist +[12:00:33 AM] Project 'src/src-dogs/tsconfig.json' is out of date because output file 'src/src-dogs/dog.js' does not exist -[12:00:00 AM] Building project '/src/src-dogs/tsconfig.json'... +[12:00:34 AM] Building project '/src/src-dogs/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-resolve-correctly.js b/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-resolve-correctly.js index 3ab0c95eb85..b1b2feb8dd3 100644 --- a/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-resolve-correctly.js +++ b/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-resolve-correctly.js @@ -116,24 +116,24 @@ export function getVar(): keyof typeof variable { Output:: /lib/tsc -b /src --verbose -[12:00:00 AM] Projects in this build: +[12:00:19 AM] Projects in this build: * src/solution/common/tsconfig.json * src/solution/sub-project/tsconfig.json * src/solution/sub-project-2/tsconfig.json * src/solution/tsconfig.json * src/tsconfig.json -[12:00:00 AM] Project 'src/solution/common/tsconfig.json' is out of date because output file 'src/lib/solution/common/nominal.js' does not exist +[12:00:20 AM] Project 'src/solution/common/tsconfig.json' is out of date because output file 'src/lib/solution/common/nominal.js' does not exist -[12:00:00 AM] Building project '/src/solution/common/tsconfig.json'... +[12:00:21 AM] Building project '/src/solution/common/tsconfig.json'... -[12:00:00 AM] Project 'src/solution/sub-project/tsconfig.json' is out of date because output file 'src/lib/solution/sub-project/index.js' does not exist +[12:00:29 AM] Project 'src/solution/sub-project/tsconfig.json' is out of date because output file 'src/lib/solution/sub-project/index.js' does not exist -[12:00:00 AM] Building project '/src/solution/sub-project/tsconfig.json'... +[12:00:30 AM] Building project '/src/solution/sub-project/tsconfig.json'... -[12:00:00 AM] Project 'src/solution/sub-project-2/tsconfig.json' is out of date because output file 'src/lib/solution/sub-project-2/index.js' does not exist +[12:00:36 AM] Project 'src/solution/sub-project-2/tsconfig.json' is out of date because output file 'src/lib/solution/sub-project-2/index.js' does not exist -[12:00:00 AM] Building project '/src/solution/sub-project-2/tsconfig.json'... +[12:00:37 AM] Building project '/src/solution/sub-project-2/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outFile/builds-till-project-specified.js b/tests/baselines/reference/tsbuild/outFile/builds-till-project-specified.js index d8f418deee4..2e60f138d17 100644 --- a/tests/baselines/reference/tsbuild/outFile/builds-till-project-specified.js +++ b/tests/baselines/reference/tsbuild/outFile/builds-till-project-specified.js @@ -15,13 +15,27 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; //// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); //// [/src/first/first_part2.ts] +console.log(f()); //// [/src/first/first_part3.ts] - +function f() { + return "JS does hoists"; +} //// [/src/first/tsconfig.json] { @@ -86,6 +100,8 @@ class C { //// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); //// [/src/third/tsconfig.json] diff --git a/tests/baselines/reference/tsbuild/outFile/clean-projects.js b/tests/baselines/reference/tsbuild/outFile/clean-projects.js index 8b3a08c3f9d..086dc3f5822 100644 --- a/tests/baselines/reference/tsbuild/outFile/clean-projects.js +++ b/tests/baselines/reference/tsbuild/outFile/clean-projects.js @@ -1,45 +1,234 @@ Input:: //// [/lib/lib.d.ts] - +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; //// [/src/2/second-output.d.ts] - +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} +//# sourceMappingURL=second-output.d.ts.map //// [/src/2/second-output.d.ts.map] - +{"version":3,"file":"second-output.d.ts","sourceRoot":"","sources":["../second/second_part1.ts","../second/second_part2.ts"],"names":[],"mappings":"AAAA,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACVD,cAAM,CAAC;IACH,WAAW;CAGd"} //// [/src/2/second-output.js] - +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); +//# sourceMappingURL=second-output.js.map //// [/src/2/second-output.js.map] - +{"version":3,"file":"second-output.js","sourceRoot":"","sources":["../second/second_part1.ts","../second/second_part2.ts"],"names":[],"mappings":"AAIA,IAAU,CAAC,CAMV;AAND,WAAU,CAAC;IACP,SAAS,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,CAAC,EAAE,CAAC;AACR,CAAC,EANS,CAAC,KAAD,CAAC,QAMV;ACVD;IAAA;IAIA,CAAC;IAHG,uBAAW,GAAX;QACI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACtC,CAAC;IACL,QAAC;AAAD,CAAC,AAJD,IAIC"} //// [/src/2/second-output.tsbuildinfo] +{"bundle":{"commonSourceDirectory":"../second","sourceFiles":["../second/second_part1.ts","../second/second_part2.ts"],"js":{"sections":[{"pos":0,"end":285,"kind":"text"}]},"dts":{"sections":[{"pos":0,"end":100,"kind":"text"}]}},"version":"FakeTSVersion"} +//// [/src/2/second-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/2/second-output.js +---------------------------------------------------------------------- +text: (0-285) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +====================================================================== +====================================================================== +File:: /src/2/second-output.d.ts +---------------------------------------------------------------------- +text: (0-100) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +====================================================================== + +//// [/src/2/second-output.tsbuildinfo.readable.baseline.txt] +{ + "bundle": { + "commonSourceDirectory": "../second", + "sourceFiles": [ + "../second/second_part1.ts", + "../second/second_part2.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 285, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 100, + "kind": "text" + } + ] + } + }, + "version": "FakeTSVersion", + "size": 255 +} //// [/src/first/bin/first-output.d.ts] - +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; +//# sourceMappingURL=first-output.d.ts.map //// [/src/first/bin/first-output.d.ts.map] - +{"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AERD,iBAAS,CAAC,WAET"} //// [/src/first/bin/first-output.js] - +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} +//# sourceMappingURL=first-output.js.map //// [/src/first/bin/first-output.js.map] - +{"version":3,"file":"first-output.js","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAIA,IAAM,CAAC,GAAG,cAAc,CAAC;AAMzB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;ACVf,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;ACAjB,SAAS,CAAC;IACN,OAAO,gBAAgB,CAAC;AAC5B,CAAC"} //// [/src/first/bin/first-output.tsbuildinfo] +{"bundle":{"commonSourceDirectory":"..","sourceFiles":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"js":{"sections":[{"pos":0,"end":110,"kind":"text"}]},"dts":{"sections":[{"pos":0,"end":157,"kind":"text"}]}},"version":"FakeTSVersion"} +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + +//// [/src/first/bin/first-output.tsbuildinfo.readable.baseline.txt] +{ + "bundle": { + "commonSourceDirectory": "..", + "sourceFiles": [ + "../first_PART1.ts", + "../first_part2.ts", + "../first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + }, + "version": "FakeTSVersion", + "size": 252 +} //// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); //// [/src/first/first_part2.ts] +console.log(f()); //// [/src/first/first_part3.ts] - +function f() { + return "JS does hoists"; +} //// [/src/first/tsconfig.json] { @@ -64,9 +253,25 @@ Input:: //// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} //// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} //// [/src/second/tsconfig.json] @@ -88,21 +293,217 @@ Input:: //// [/src/third/thirdjs/output/third-output.d.ts] - +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} +declare var c: C; +//# sourceMappingURL=third-output.d.ts.map //// [/src/third/thirdjs/output/third-output.d.ts.map] - +{"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACRD,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACVD,cAAM,CAAC;IACH,WAAW;CAGd;ACJD,QAAA,IAAI,CAAC,GAAU,CAAC"} //// [/src/third/thirdjs/output/third-output.js] - +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); +var c = new C(); +c.doSomething(); +//# sourceMappingURL=third-output.js.map //// [/src/third/thirdjs/output/third-output.js.map] - +{"version":3,"file":"third-output.js","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part2.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAIA,IAAM,CAAC,GAAG,cAAc,CAAC;AAMzB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;ACVf,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;ACAjB,SAAS,CAAC;IACN,OAAO,gBAAgB,CAAC;AAC5B,CAAC;ACED,IAAU,CAAC,CAMV;AAND,WAAU,CAAC;IACP,SAAS,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,CAAC,EAAE,CAAC;AACR,CAAC,EANS,CAAC,KAAD,CAAC,QAMV;ACVD;IAAA;IAIA,CAAC;IAHG,uBAAW,GAAX;QACI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACtC,CAAC;IACL,QAAC;AAAD,CAAC,AAJD,IAIC;ACJD,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAChB,CAAC,CAAC,WAAW,EAAE,CAAC"} //// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{"bundle":{"commonSourceDirectory":"../..","sourceFiles":["../../third_part1.ts"],"js":{"sections":[{"pos":0,"end":110,"kind":"prepend","data":"../../../first/bin/first-output.js","texts":[{"pos":0,"end":110,"kind":"text"}]},{"pos":110,"end":395,"kind":"prepend","data":"../../../2/second-output.js","texts":[{"pos":110,"end":395,"kind":"text"}]},{"pos":395,"end":431,"kind":"text"}]},"dts":{"sections":[{"pos":0,"end":157,"kind":"prepend","data":"../../../first/bin/first-output.d.ts","texts":[{"pos":0,"end":157,"kind":"text"}]},{"pos":157,"end":257,"kind":"prepend","data":"../../../2/second-output.d.ts","texts":[{"pos":157,"end":257,"kind":"text"}]},{"pos":257,"end":276,"kind":"text"}]}},"version":"FakeTSVersion"} +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-110):: ../../../first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (110-395):: ../../../2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (110-395) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (395-431) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: ../../../first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (157-257):: ../../../2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (157-257) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (257-276) +declare var c: C; + +====================================================================== + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.readable.baseline.txt] +{ + "bundle": { + "commonSourceDirectory": "../..", + "sourceFiles": [ + "../../third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "prepend", + "data": "../../../first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + { + "pos": 110, + "end": 395, + "kind": "prepend", + "data": "../../../2/second-output.js", + "texts": [ + { + "pos": 110, + "end": 395, + "kind": "text" + } + ] + }, + { + "pos": 395, + "end": 431, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "../../../first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 257, + "kind": "prepend", + "data": "../../../2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 257, + "kind": "text" + } + ] + }, + { + "pos": 257, + "end": 276, + "kind": "text" + } + ] + } + }, + "version": "FakeTSVersion", + "size": 720 +} //// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); //// [/src/third/tsconfig.json] diff --git a/tests/baselines/reference/tsbuild/outFile/cleans-till-project-specified.js b/tests/baselines/reference/tsbuild/outFile/cleans-till-project-specified.js index 250a854a535..408ca5609ad 100644 --- a/tests/baselines/reference/tsbuild/outFile/cleans-till-project-specified.js +++ b/tests/baselines/reference/tsbuild/outFile/cleans-till-project-specified.js @@ -1,45 +1,234 @@ Input:: //// [/lib/lib.d.ts] - +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; //// [/src/2/second-output.d.ts] - +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} +//# sourceMappingURL=second-output.d.ts.map //// [/src/2/second-output.d.ts.map] - +{"version":3,"file":"second-output.d.ts","sourceRoot":"","sources":["../second/second_part1.ts","../second/second_part2.ts"],"names":[],"mappings":"AAAA,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACVD,cAAM,CAAC;IACH,WAAW;CAGd"} //// [/src/2/second-output.js] - +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); +//# sourceMappingURL=second-output.js.map //// [/src/2/second-output.js.map] - +{"version":3,"file":"second-output.js","sourceRoot":"","sources":["../second/second_part1.ts","../second/second_part2.ts"],"names":[],"mappings":"AAIA,IAAU,CAAC,CAMV;AAND,WAAU,CAAC;IACP,SAAS,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,CAAC,EAAE,CAAC;AACR,CAAC,EANS,CAAC,KAAD,CAAC,QAMV;ACVD;IAAA;IAIA,CAAC;IAHG,uBAAW,GAAX;QACI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACtC,CAAC;IACL,QAAC;AAAD,CAAC,AAJD,IAIC"} //// [/src/2/second-output.tsbuildinfo] +{"bundle":{"commonSourceDirectory":"../second","sourceFiles":["../second/second_part1.ts","../second/second_part2.ts"],"js":{"sections":[{"pos":0,"end":285,"kind":"text"}]},"dts":{"sections":[{"pos":0,"end":100,"kind":"text"}]}},"version":"FakeTSVersion"} +//// [/src/2/second-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/2/second-output.js +---------------------------------------------------------------------- +text: (0-285) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +====================================================================== +====================================================================== +File:: /src/2/second-output.d.ts +---------------------------------------------------------------------- +text: (0-100) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +====================================================================== + +//// [/src/2/second-output.tsbuildinfo.readable.baseline.txt] +{ + "bundle": { + "commonSourceDirectory": "../second", + "sourceFiles": [ + "../second/second_part1.ts", + "../second/second_part2.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 285, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 100, + "kind": "text" + } + ] + } + }, + "version": "FakeTSVersion", + "size": 255 +} //// [/src/first/bin/first-output.d.ts] - +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; +//# sourceMappingURL=first-output.d.ts.map //// [/src/first/bin/first-output.d.ts.map] - +{"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AERD,iBAAS,CAAC,WAET"} //// [/src/first/bin/first-output.js] - +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} +//# sourceMappingURL=first-output.js.map //// [/src/first/bin/first-output.js.map] - +{"version":3,"file":"first-output.js","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAIA,IAAM,CAAC,GAAG,cAAc,CAAC;AAMzB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;ACVf,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;ACAjB,SAAS,CAAC;IACN,OAAO,gBAAgB,CAAC;AAC5B,CAAC"} //// [/src/first/bin/first-output.tsbuildinfo] +{"bundle":{"commonSourceDirectory":"..","sourceFiles":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"js":{"sections":[{"pos":0,"end":110,"kind":"text"}]},"dts":{"sections":[{"pos":0,"end":157,"kind":"text"}]}},"version":"FakeTSVersion"} +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + +//// [/src/first/bin/first-output.tsbuildinfo.readable.baseline.txt] +{ + "bundle": { + "commonSourceDirectory": "..", + "sourceFiles": [ + "../first_PART1.ts", + "../first_part2.ts", + "../first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + }, + "version": "FakeTSVersion", + "size": 252 +} //// [/src/first/first_PART1.ts] +interface TheFirst { + none: any; +} + +const s = "Hello, world"; + +interface NoJsForHereEither { + none: any; +} + +console.log(s); //// [/src/first/first_part2.ts] +console.log(f()); //// [/src/first/first_part3.ts] - +function f() { + return "JS does hoists"; +} //// [/src/first/tsconfig.json] { @@ -64,9 +253,25 @@ Input:: //// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} //// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} //// [/src/second/tsconfig.json] @@ -88,21 +293,217 @@ Input:: //// [/src/third/thirdjs/output/third-output.d.ts] - +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} +declare var c: C; +//# sourceMappingURL=third-output.d.ts.map //// [/src/third/thirdjs/output/third-output.d.ts.map] - +{"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACRD,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACVD,cAAM,CAAC;IACH,WAAW;CAGd;ACJD,QAAA,IAAI,CAAC,GAAU,CAAC"} //// [/src/third/thirdjs/output/third-output.js] - +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); +var c = new C(); +c.doSomething(); +//# sourceMappingURL=third-output.js.map //// [/src/third/thirdjs/output/third-output.js.map] - +{"version":3,"file":"third-output.js","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part2.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAIA,IAAM,CAAC,GAAG,cAAc,CAAC;AAMzB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;ACVf,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;ACAjB,SAAS,CAAC;IACN,OAAO,gBAAgB,CAAC;AAC5B,CAAC;ACED,IAAU,CAAC,CAMV;AAND,WAAU,CAAC;IACP,SAAS,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,CAAC,EAAE,CAAC;AACR,CAAC,EANS,CAAC,KAAD,CAAC,QAMV;ACVD;IAAA;IAIA,CAAC;IAHG,uBAAW,GAAX;QACI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACtC,CAAC;IACL,QAAC;AAAD,CAAC,AAJD,IAIC;ACJD,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAChB,CAAC,CAAC,WAAW,EAAE,CAAC"} //// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{"bundle":{"commonSourceDirectory":"../..","sourceFiles":["../../third_part1.ts"],"js":{"sections":[{"pos":0,"end":110,"kind":"prepend","data":"../../../first/bin/first-output.js","texts":[{"pos":0,"end":110,"kind":"text"}]},{"pos":110,"end":395,"kind":"prepend","data":"../../../2/second-output.js","texts":[{"pos":110,"end":395,"kind":"text"}]},{"pos":395,"end":431,"kind":"text"}]},"dts":{"sections":[{"pos":0,"end":157,"kind":"prepend","data":"../../../first/bin/first-output.d.ts","texts":[{"pos":0,"end":157,"kind":"text"}]},{"pos":157,"end":257,"kind":"prepend","data":"../../../2/second-output.d.ts","texts":[{"pos":157,"end":257,"kind":"text"}]},{"pos":257,"end":276,"kind":"text"}]}},"version":"FakeTSVersion"} +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/third/thirdjs/output/third-output.js +---------------------------------------------------------------------- +prepend: (0-110):: ../../../first/bin/first-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +---------------------------------------------------------------------- +prepend: (110-395):: ../../../2/second-output.js texts:: 1 +>>-------------------------------------------------------------------- +text: (110-395) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +---------------------------------------------------------------------- +text: (395-431) +var c = new C(); +c.doSomething(); + +====================================================================== +====================================================================== +File:: /src/third/thirdjs/output/third-output.d.ts +---------------------------------------------------------------------- +prepend: (0-157):: ../../../first/bin/first-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +---------------------------------------------------------------------- +prepend: (157-257):: ../../../2/second-output.d.ts texts:: 1 +>>-------------------------------------------------------------------- +text: (157-257) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +---------------------------------------------------------------------- +text: (257-276) +declare var c: C; + +====================================================================== + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.readable.baseline.txt] +{ + "bundle": { + "commonSourceDirectory": "../..", + "sourceFiles": [ + "../../third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "prepend", + "data": "../../../first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + { + "pos": 110, + "end": 395, + "kind": "prepend", + "data": "../../../2/second-output.js", + "texts": [ + { + "pos": 110, + "end": 395, + "kind": "text" + } + ] + }, + { + "pos": 395, + "end": 431, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "../../../first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 257, + "kind": "prepend", + "data": "../../../2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 257, + "kind": "text" + } + ] + }, + { + "pos": 257, + "end": 276, + "kind": "text" + } + ] + } + }, + "version": "FakeTSVersion", + "size": 720 +} //// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); //// [/src/third/tsconfig.json] diff --git a/tests/baselines/reference/tsbuild/outFile/non-module-projects-without-prepend.js b/tests/baselines/reference/tsbuild/outFile/non-module-projects-without-prepend.js index e69fd17a377..8903f45aeb4 100644 --- a/tests/baselines/reference/tsbuild/outFile/non-module-projects-without-prepend.js +++ b/tests/baselines/reference/tsbuild/outFile/non-module-projects-without-prepend.js @@ -131,22 +131,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:00:00 AM] Projects in this build: +[12:00:14 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:00:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/first_PART1.js' does not exist +[12:00:15 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/first_PART1.js' does not exist -[12:00:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:16 AM] Building project '/src/first/tsconfig.json'... -[12:00:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/second/second_part1.js' does not exist +[12:00:31 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/second/second_part1.js' does not exist -[12:00:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:32 AM] Building project '/src/second/tsconfig.json'... -[12:00:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/third_part1.js' does not exist +[12:00:43 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/third_part1.js' does not exist -[12:00:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:44 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outFile/rebuilds-completely-when-command-line-incremental-flag-changes-between-non-dts-changes.js b/tests/baselines/reference/tsbuild/outFile/rebuilds-completely-when-command-line-incremental-flag-changes-between-non-dts-changes.js index ffa2d94ede7..c7836fc59c6 100644 --- a/tests/baselines/reference/tsbuild/outFile/rebuilds-completely-when-command-line-incremental-flag-changes-between-non-dts-changes.js +++ b/tests/baselines/reference/tsbuild/outFile/rebuilds-completely-when-command-line-incremental-flag-changes-between-non-dts-changes.js @@ -131,22 +131,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --i --verbose -[12:01:00 AM] Projects in this build: +[12:00:07 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:08 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:09 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:18 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:19 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:28 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:29 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -575,20 +575,20 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:40 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:41 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:42 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:00:50 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:00:51 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:04:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:52 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -726,20 +726,20 @@ console.log(s);console.log(s); Output:: /lib/tsc --b /src/third --verbose --incremental -[12:07:00 AM] Projects in this build: +[12:00:58 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:07:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:59 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:07:00 AM] Building project '/src/first/tsconfig.json'... +[12:01:00 AM] Building project '/src/first/tsconfig.json'... -[12:07:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:08 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:07:00 AM] Project 'src/third/tsconfig.json' is out of date because oldest output 'src/third/thirdjs/output/third-output.tsbuildinfo' is older than newest input 'src/first' +[12:01:09 AM] Project 'src/third/tsconfig.json' is out of date because oldest output 'src/third/thirdjs/output/third-output.tsbuildinfo' is older than newest input 'src/first' -[12:07:00 AM] Building project '/src/third/tsconfig.json'... +[12:01:10 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outFile/rebuilds-completely-when-version-in-tsbuildinfo-doesnt-match-ts-version.js b/tests/baselines/reference/tsbuild/outFile/rebuilds-completely-when-version-in-tsbuildinfo-doesnt-match-ts-version.js index 4a0c1b3eba6..eba378c6595 100644 --- a/tests/baselines/reference/tsbuild/outFile/rebuilds-completely-when-version-in-tsbuildinfo-doesnt-match-ts-version.js +++ b/tests/baselines/reference/tsbuild/outFile/rebuilds-completely-when-version-in-tsbuildinfo-doesnt-match-ts-version.js @@ -25,17 +25,99 @@ declare class C { //# sourceMappingURL=second-output.d.ts.map //// [/src/2/second-output.d.ts.map] - +{"version":3,"file":"second-output.d.ts","sourceRoot":"","sources":["../second/second_part1.ts","../second/second_part2.ts"],"names":[],"mappings":"AAAA,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACVD,cAAM,CAAC;IACH,WAAW;CAGd"} //// [/src/2/second-output.js] - +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); +//# sourceMappingURL=second-output.js.map //// [/src/2/second-output.js.map] - +{"version":3,"file":"second-output.js","sourceRoot":"","sources":["../second/second_part1.ts","../second/second_part2.ts"],"names":[],"mappings":"AAIA,IAAU,CAAC,CAMV;AAND,WAAU,CAAC;IACP,SAAS,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,CAAC,EAAE,CAAC;AACR,CAAC,EANS,CAAC,KAAD,CAAC,QAMV;ACVD;IAAA;IAIA,CAAC;IAHG,uBAAW,GAAX;QACI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACtC,CAAC;IACL,QAAC;AAAD,CAAC,AAJD,IAIC"} //// [/src/2/second-output.tsbuildinfo] {"bundle":{"commonSourceDirectory":"../second","sourceFiles":["../second/second_part1.ts","../second/second_part2.ts"],"js":{"sections":[{"pos":0,"end":285,"kind":"text"}]},"dts":{"sections":[{"pos":0,"end":100,"kind":"text"}]}},"version":"FakeTSVersion"} +//// [/src/2/second-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/2/second-output.js +---------------------------------------------------------------------- +text: (0-285) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +====================================================================== +====================================================================== +File:: /src/2/second-output.d.ts +---------------------------------------------------------------------- +text: (0-100) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +====================================================================== + +//// [/src/2/second-output.tsbuildinfo.readable.baseline.txt] +{ + "bundle": { + "commonSourceDirectory": "../second", + "sourceFiles": [ + "../second/second_part1.ts", + "../second/second_part2.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 285, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 100, + "kind": "text" + } + ] + } + }, + "version": "FakeTSVersion", + "size": 255 +} + //// [/src/first/bin/first-output.d.ts] interface TheFirst { none: any; @@ -48,17 +130,83 @@ declare function f(): string; //# sourceMappingURL=first-output.d.ts.map //// [/src/first/bin/first-output.d.ts.map] - +{"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AERD,iBAAS,CAAC,WAET"} //// [/src/first/bin/first-output.js] - +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} +//# sourceMappingURL=first-output.js.map //// [/src/first/bin/first-output.js.map] - +{"version":3,"file":"first-output.js","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAIA,IAAM,CAAC,GAAG,cAAc,CAAC;AAMzB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;ACVf,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;ACAjB,SAAS,CAAC;IACN,OAAO,gBAAgB,CAAC;AAC5B,CAAC"} //// [/src/first/bin/first-output.tsbuildinfo] {"bundle":{"commonSourceDirectory":"..","sourceFiles":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"js":{"sections":[{"pos":0,"end":110,"kind":"text"}]},"dts":{"sections":[{"pos":0,"end":157,"kind":"text"}]}},"version":"FakeTSVersion"} +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + +//// [/src/first/bin/first-output.tsbuildinfo.readable.baseline.txt] +{ + "bundle": { + "commonSourceDirectory": "..", + "sourceFiles": [ + "../first_PART1.ts", + "../first_part2.ts", + "../first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + }, + "version": "FakeTSVersion", + "size": 252 +} + //// [/src/first/first_PART1.ts] interface TheFirst { none: any; @@ -164,81 +312,15 @@ declare var c: C; //# sourceMappingURL=third-output.d.ts.map //// [/src/third/thirdjs/output/third-output.d.ts.map] - +{"version":3,"file":"third-output.d.ts","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;ACRD,iBAAS,CAAC,WAET;ACFD,kBAAU,CAAC,CAAC;CAEX;AAED,kBAAU,CAAC,CAAC;CAMX;ACVD,cAAM,CAAC;IACH,WAAW;CAGd;ACJD,QAAA,IAAI,CAAC,GAAU,CAAC"} //// [/src/third/thirdjs/output/third-output.js] - - -//// [/src/third/thirdjs/output/third-output.js.map] - - -//// [/src/third/thirdjs/output/third-output.tsbuildinfo] -{"bundle":{"commonSourceDirectory":"../..","sourceFiles":["../../third_part1.ts"],"js":{"sections":[{"pos":0,"end":110,"kind":"prepend","data":"../../../first/bin/first-output.js","texts":[{"pos":0,"end":110,"kind":"text"}]},{"pos":110,"end":395,"kind":"prepend","data":"../../../2/second-output.js","texts":[{"pos":110,"end":395,"kind":"text"}]},{"pos":395,"end":431,"kind":"text"}]},"dts":{"sections":[{"pos":0,"end":157,"kind":"prepend","data":"../../../first/bin/first-output.d.ts","texts":[{"pos":0,"end":157,"kind":"text"}]},{"pos":157,"end":257,"kind":"prepend","data":"../../../2/second-output.d.ts","texts":[{"pos":157,"end":257,"kind":"text"}]},{"pos":257,"end":276,"kind":"text"}]}},"version":"FakeTSVersion"} - -//// [/src/third/third_part1.ts] -var c = new C(); -c.doSomething(); - - -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true, - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; } - - - - -Output:: -/lib/tsc --b /src/third --verbose -[12:00:00 AM] Projects in this build: - * src/first/tsconfig.json - * src/second/tsconfig.json - * src/third/tsconfig.json - -[12:00:00 AM] Project 'src/first/tsconfig.json' is out of date because output for it was generated with version 'FakeTSVersion' that differs with current version 'FakeTSCurrentVersion' - -[12:00:00 AM] Building project '/src/first/tsconfig.json'... - -[12:00:00 AM] Project 'src/second/tsconfig.json' is out of date because output for it was generated with version 'FakeTSVersion' that differs with current version 'FakeTSCurrentVersion' - -[12:00:00 AM] Building project '/src/second/tsconfig.json'... - -[12:00:00 AM] Project 'src/third/tsconfig.json' is out of date because output for it was generated with version 'FakeTSVersion' that differs with current version 'FakeTSCurrentVersion' - -[12:00:00 AM] Building project '/src/third/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/2/second-output.d.ts] file written with same contents -//// [/src/2/second-output.d.ts.map] file written with same contents -//// [/src/2/second-output.js] file written with same contents -//// [/src/2/second-output.js.map] file written with same contents -//// [/src/2/second-output.tsbuildinfo] -{"bundle":{"commonSourceDirectory":"../second","sourceFiles":["../second/second_part1.ts","../second/second_part2.ts"],"js":{"sections":[{"pos":0,"end":285,"kind":"text"}]},"dts":{"sections":[{"pos":0,"end":100,"kind":"text"}]}},"version":"FakeTSCurrentVersion"} - -//// [/src/2/second-output.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/2/second-output.js ----------------------------------------------------------------------- -text: (0-285) var N; (function (N) { function f() { @@ -254,126 +336,15 @@ var C = (function () { }; return C; }()); +var c = new C(); +c.doSomething(); +//# sourceMappingURL=third-output.js.map -====================================================================== -====================================================================== -File:: /src/2/second-output.d.ts ----------------------------------------------------------------------- -text: (0-100) -declare namespace N { -} -declare namespace N { -} -declare class C { - doSomething(): void; -} +//// [/src/third/thirdjs/output/third-output.js.map] +{"version":3,"file":"third-output.js","sourceRoot":"","sources":["../../../first/first_PART1.ts","../../../first/first_part2.ts","../../../first/first_part3.ts","../../../second/second_part1.ts","../../../second/second_part2.ts","../../third_part1.ts"],"names":[],"mappings":"AAIA,IAAM,CAAC,GAAG,cAAc,CAAC;AAMzB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;ACVf,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;ACAjB,SAAS,CAAC;IACN,OAAO,gBAAgB,CAAC;AAC5B,CAAC;ACED,IAAU,CAAC,CAMV;AAND,WAAU,CAAC;IACP,SAAS,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,CAAC,EAAE,CAAC;AACR,CAAC,EANS,CAAC,KAAD,CAAC,QAMV;ACVD;IAAA;IAIA,CAAC;IAHG,uBAAW,GAAX;QACI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IACtC,CAAC;IACL,QAAC;AAAD,CAAC,AAJD,IAIC;ACJD,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAChB,CAAC,CAAC,WAAW,EAAE,CAAC"} -====================================================================== - -//// [/src/2/second-output.tsbuildinfo.readable.baseline.txt] -{ - "bundle": { - "commonSourceDirectory": "../second", - "sourceFiles": [ - "../second/second_part1.ts", - "../second/second_part2.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 285, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 100, - "kind": "text" - } - ] - } - }, - "version": "FakeTSCurrentVersion", - "size": 262 -} - -//// [/src/first/bin/first-output.d.ts] file written with same contents -//// [/src/first/bin/first-output.d.ts.map] file written with same contents -//// [/src/first/bin/first-output.js] file written with same contents -//// [/src/first/bin/first-output.js.map] file written with same contents -//// [/src/first/bin/first-output.tsbuildinfo] -{"bundle":{"commonSourceDirectory":"..","sourceFiles":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"js":{"sections":[{"pos":0,"end":110,"kind":"text"}]},"dts":{"sections":[{"pos":0,"end":157,"kind":"text"}]}},"version":"FakeTSCurrentVersion"} - -//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - -//// [/src/first/bin/first-output.tsbuildinfo.readable.baseline.txt] -{ - "bundle": { - "commonSourceDirectory": "..", - "sourceFiles": [ - "../first_PART1.ts", - "../first_part2.ts", - "../first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - } - }, - "version": "FakeTSCurrentVersion", - "size": 259 -} - -//// [/src/third/thirdjs/output/third-output.d.ts] file written with same contents -//// [/src/third/thirdjs/output/third-output.d.ts.map] file written with same contents -//// [/src/third/thirdjs/output/third-output.js] file written with same contents -//// [/src/third/thirdjs/output/third-output.js.map] file written with same contents //// [/src/third/thirdjs/output/third-output.tsbuildinfo] -{"bundle":{"commonSourceDirectory":"../..","sourceFiles":["../../third_part1.ts"],"js":{"sections":[{"pos":0,"end":110,"kind":"prepend","data":"../../../first/bin/first-output.js","texts":[{"pos":0,"end":110,"kind":"text"}]},{"pos":110,"end":395,"kind":"prepend","data":"../../../2/second-output.js","texts":[{"pos":110,"end":395,"kind":"text"}]},{"pos":395,"end":431,"kind":"text"}]},"dts":{"sections":[{"pos":0,"end":157,"kind":"prepend","data":"../../../first/bin/first-output.d.ts","texts":[{"pos":0,"end":157,"kind":"text"}]},{"pos":157,"end":257,"kind":"prepend","data":"../../../2/second-output.d.ts","texts":[{"pos":157,"end":257,"kind":"text"}]},{"pos":257,"end":276,"kind":"text"}]}},"version":"FakeTSCurrentVersion"} +{"bundle":{"commonSourceDirectory":"../..","sourceFiles":["../../third_part1.ts"],"js":{"sections":[{"pos":0,"end":110,"kind":"prepend","data":"../../../first/bin/first-output.js","texts":[{"pos":0,"end":110,"kind":"text"}]},{"pos":110,"end":395,"kind":"prepend","data":"../../../2/second-output.js","texts":[{"pos":110,"end":395,"kind":"text"}]},{"pos":395,"end":431,"kind":"text"}]},"dts":{"sections":[{"pos":0,"end":157,"kind":"prepend","data":"../../../first/bin/first-output.d.ts","texts":[{"pos":0,"end":157,"kind":"text"}]},{"pos":157,"end":257,"kind":"prepend","data":"../../../2/second-output.d.ts","texts":[{"pos":157,"end":257,"kind":"text"}]},{"pos":257,"end":276,"kind":"text"}]}},"version":"FakeTSVersion"} //// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] ====================================================================== @@ -448,6 +419,227 @@ declare var c: C; ====================================================================== +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.readable.baseline.txt] +{ + "bundle": { + "commonSourceDirectory": "../..", + "sourceFiles": [ + "../../third_part1.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "prepend", + "data": "../../../first/bin/first-output.js", + "texts": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + { + "pos": 110, + "end": 395, + "kind": "prepend", + "data": "../../../2/second-output.js", + "texts": [ + { + "pos": 110, + "end": 395, + "kind": "text" + } + ] + }, + { + "pos": 395, + "end": 431, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "prepend", + "data": "../../../first/bin/first-output.d.ts", + "texts": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + }, + { + "pos": 157, + "end": 257, + "kind": "prepend", + "data": "../../../2/second-output.d.ts", + "texts": [ + { + "pos": 157, + "end": 257, + "kind": "text" + } + ] + }, + { + "pos": 257, + "end": 276, + "kind": "text" + } + ] + } + }, + "version": "FakeTSVersion", + "size": 720 +} + +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true, + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: +/lib/tsc --b /src/third --verbose +[12:00:38 AM] Projects in this build: + * src/first/tsconfig.json + * src/second/tsconfig.json + * src/third/tsconfig.json + +[12:00:39 AM] Project 'src/first/tsconfig.json' is out of date because output for it was generated with version 'FakeTSVersion' that differs with current version 'FakeTSCurrentVersion' + +[12:00:40 AM] Building project '/src/first/tsconfig.json'... + +[12:00:48 AM] Project 'src/second/tsconfig.json' is out of date because output for it was generated with version 'FakeTSVersion' that differs with current version 'FakeTSCurrentVersion' + +[12:00:49 AM] Building project '/src/second/tsconfig.json'... + +[12:00:57 AM] Project 'src/third/tsconfig.json' is out of date because output for it was generated with version 'FakeTSVersion' that differs with current version 'FakeTSCurrentVersion' + +[12:00:58 AM] Building project '/src/third/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/2/second-output.d.ts] file written with same contents +//// [/src/2/second-output.d.ts.map] file written with same contents +//// [/src/2/second-output.js] file written with same contents +//// [/src/2/second-output.js.map] file written with same contents +//// [/src/2/second-output.tsbuildinfo] +{"bundle":{"commonSourceDirectory":"../second","sourceFiles":["../second/second_part1.ts","../second/second_part2.ts"],"js":{"sections":[{"pos":0,"end":285,"kind":"text"}]},"dts":{"sections":[{"pos":0,"end":100,"kind":"text"}]}},"version":"FakeTSCurrentVersion"} + +//// [/src/2/second-output.tsbuildinfo.baseline.txt] file written with same contents +//// [/src/2/second-output.tsbuildinfo.readable.baseline.txt] +{ + "bundle": { + "commonSourceDirectory": "../second", + "sourceFiles": [ + "../second/second_part1.ts", + "../second/second_part2.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 285, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 100, + "kind": "text" + } + ] + } + }, + "version": "FakeTSCurrentVersion", + "size": 262 +} + +//// [/src/first/bin/first-output.d.ts] file written with same contents +//// [/src/first/bin/first-output.d.ts.map] file written with same contents +//// [/src/first/bin/first-output.js] file written with same contents +//// [/src/first/bin/first-output.js.map] file written with same contents +//// [/src/first/bin/first-output.tsbuildinfo] +{"bundle":{"commonSourceDirectory":"..","sourceFiles":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"js":{"sections":[{"pos":0,"end":110,"kind":"text"}]},"dts":{"sections":[{"pos":0,"end":157,"kind":"text"}]}},"version":"FakeTSCurrentVersion"} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] file written with same contents +//// [/src/first/bin/first-output.tsbuildinfo.readable.baseline.txt] +{ + "bundle": { + "commonSourceDirectory": "..", + "sourceFiles": [ + "../first_PART1.ts", + "../first_part2.ts", + "../first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + }, + "version": "FakeTSCurrentVersion", + "size": 259 +} + +//// [/src/third/thirdjs/output/third-output.d.ts] file written with same contents +//// [/src/third/thirdjs/output/third-output.d.ts.map] file written with same contents +//// [/src/third/thirdjs/output/third-output.js] file written with same contents +//// [/src/third/thirdjs/output/third-output.js.map] file written with same contents +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] +{"bundle":{"commonSourceDirectory":"../..","sourceFiles":["../../third_part1.ts"],"js":{"sections":[{"pos":0,"end":110,"kind":"prepend","data":"../../../first/bin/first-output.js","texts":[{"pos":0,"end":110,"kind":"text"}]},{"pos":110,"end":395,"kind":"prepend","data":"../../../2/second-output.js","texts":[{"pos":110,"end":395,"kind":"text"}]},{"pos":395,"end":431,"kind":"text"}]},"dts":{"sections":[{"pos":0,"end":157,"kind":"prepend","data":"../../../first/bin/first-output.d.ts","texts":[{"pos":0,"end":157,"kind":"text"}]},{"pos":157,"end":257,"kind":"prepend","data":"../../../2/second-output.d.ts","texts":[{"pos":157,"end":257,"kind":"text"}]},{"pos":257,"end":276,"kind":"text"}]}},"version":"FakeTSCurrentVersion"} + +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] file written with same contents //// [/src/third/thirdjs/output/third-output.tsbuildinfo.readable.baseline.txt] { "bundle": { diff --git a/tests/baselines/reference/tsbuild/outFile/tsbuildinfo-is-not-generated-when-incremental-is-set-to-false.js b/tests/baselines/reference/tsbuild/outFile/tsbuildinfo-is-not-generated-when-incremental-is-set-to-false.js index 61366ed7aaa..9eb72aa4711 100644 --- a/tests/baselines/reference/tsbuild/outFile/tsbuildinfo-is-not-generated-when-incremental-is-set-to-false.js +++ b/tests/baselines/reference/tsbuild/outFile/tsbuildinfo-is-not-generated-when-incremental-is-set-to-false.js @@ -131,22 +131,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:00:00 AM] Projects in this build: +[12:00:07 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:00:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:08 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:00:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:09 AM] Building project '/src/first/tsconfig.json'... -[12:00:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:18 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:00:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:19 AM] Building project '/src/second/tsconfig.json'... -[12:00:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:28 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:00:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:29 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outFile/verify-buildInfo-absence-results-in-new-build.js b/tests/baselines/reference/tsbuild/outFile/verify-buildInfo-absence-results-in-new-build.js index d2077269d9b..1b9d7357ac1 100644 --- a/tests/baselines/reference/tsbuild/outFile/verify-buildInfo-absence-results-in-new-build.js +++ b/tests/baselines/reference/tsbuild/outFile/verify-buildInfo-absence-results-in-new-build.js @@ -51,6 +51,73 @@ var C = (function () { //// [/src/2/second-output.tsbuildinfo] {"bundle":{"commonSourceDirectory":"../second","sourceFiles":["../second/second_part1.ts","../second/second_part2.ts"],"js":{"sections":[{"pos":0,"end":285,"kind":"text"}]},"dts":{"sections":[{"pos":0,"end":100,"kind":"text"}]}},"version":"FakeTSVersion"} +//// [/src/2/second-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/2/second-output.js +---------------------------------------------------------------------- +text: (0-285) +var N; +(function (N) { + function f() { + console.log('testing'); + } + f(); +})(N || (N = {})); +var C = (function () { + function C() { + } + C.prototype.doSomething = function () { + console.log("something got done"); + }; + return C; +}()); + +====================================================================== +====================================================================== +File:: /src/2/second-output.d.ts +---------------------------------------------------------------------- +text: (0-100) +declare namespace N { +} +declare namespace N { +} +declare class C { + doSomething(): void; +} + +====================================================================== + +//// [/src/2/second-output.tsbuildinfo.readable.baseline.txt] +{ + "bundle": { + "commonSourceDirectory": "../second", + "sourceFiles": [ + "../second/second_part1.ts", + "../second/second_part2.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 285, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 100, + "kind": "text" + } + ] + } + }, + "version": "FakeTSVersion", + "size": 255 +} + //// [/src/first/bin/first-output.d.ts] interface TheFirst { none: any; @@ -63,13 +130,79 @@ declare function f(): string; //# sourceMappingURL=first-output.d.ts.map //// [/src/first/bin/first-output.d.ts.map] - +{"version":3,"file":"first-output.d.ts","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAAA,UAAU,QAAQ;IACd,IAAI,EAAE,GAAG,CAAC;CACb;AAED,QAAA,MAAM,CAAC,iBAAiB,CAAC;AAEzB,UAAU,iBAAiB;IACvB,IAAI,EAAE,GAAG,CAAC;CACb;AERD,iBAAS,CAAC,WAET"} //// [/src/first/bin/first-output.js] - +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} +//# sourceMappingURL=first-output.js.map //// [/src/first/bin/first-output.js.map] +{"version":3,"file":"first-output.js","sourceRoot":"","sources":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"names":[],"mappings":"AAIA,IAAM,CAAC,GAAG,cAAc,CAAC;AAMzB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;ACVf,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;ACAjB,SAAS,CAAC;IACN,OAAO,gBAAgB,CAAC;AAC5B,CAAC"} +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] +====================================================================== +File:: /src/first/bin/first-output.js +---------------------------------------------------------------------- +text: (0-110) +var s = "Hello, world"; +console.log(s); +console.log(f()); +function f() { + return "JS does hoists"; +} + +====================================================================== +====================================================================== +File:: /src/first/bin/first-output.d.ts +---------------------------------------------------------------------- +text: (0-157) +interface TheFirst { + none: any; +} +declare const s = "Hello, world"; +interface NoJsForHereEither { + none: any; +} +declare function f(): string; + +====================================================================== + +//// [/src/first/bin/first-output.tsbuildinfo.readable.baseline.txt] +{ + "bundle": { + "commonSourceDirectory": "..", + "sourceFiles": [ + "../first_PART1.ts", + "../first_part2.ts", + "../first_part3.ts" + ], + "js": { + "sections": [ + { + "pos": 0, + "end": 110, + "kind": "text" + } + ] + }, + "dts": { + "sections": [ + { + "pos": 0, + "end": 157, + "kind": "text" + } + ] + } + }, + "version": "FakeTSVersion", + "size": 252 +} //// [/src/first/first_PART1.ts] interface TheFirst { @@ -117,9 +250,25 @@ function f() { //// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} //// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} //// [/src/second/tsconfig.json] @@ -194,124 +343,6 @@ c.doSomething(); //// [/src/third/thirdjs/output/third-output.tsbuildinfo] {"bundle":{"commonSourceDirectory":"../..","sourceFiles":["../../third_part1.ts"],"js":{"sections":[{"pos":0,"end":110,"kind":"prepend","data":"../../../first/bin/first-output.js","texts":[{"pos":0,"end":110,"kind":"text"}]},{"pos":110,"end":395,"kind":"prepend","data":"../../../2/second-output.js","texts":[{"pos":110,"end":395,"kind":"text"}]},{"pos":395,"end":431,"kind":"text"}]},"dts":{"sections":[{"pos":0,"end":157,"kind":"prepend","data":"../../../first/bin/first-output.d.ts","texts":[{"pos":0,"end":157,"kind":"text"}]},{"pos":157,"end":257,"kind":"prepend","data":"../../../2/second-output.d.ts","texts":[{"pos":157,"end":257,"kind":"text"}]},{"pos":257,"end":276,"kind":"text"}]}},"version":"FakeTSVersion"} -//// [/src/third/third_part1.ts] - - -//// [/src/third/tsconfig.json] -{ - "compilerOptions": { - "target": "es5", - "composite": true, - "removeComments": true, - "strict": false, - "sourceMap": true, - "declarationMap": true, - "declaration": true, - "outFile": "./thirdjs/output/third-output.js", - "skipDefaultLibCheck": true, - }, - "files": [ - "third_part1.ts" - ], - "references": [ - { "path": "../first", "prepend": true }, - { "path": "../second", "prepend": true }, - ] -} - - - - -Output:: -/lib/tsc --b /src/third --verbose -[12:00:00 AM] Projects in this build: - * src/first/tsconfig.json - * src/second/tsconfig.json - * src/third/tsconfig.json - -[12:00:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.tsbuildinfo' does not exist - -[12:00:00 AM] Building project '/src/first/tsconfig.json'... - -[12:00:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' - -[12:00:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed - -[12:00:00 AM] Updating output of project '/src/third/tsconfig.json'... - -[12:00:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/first/bin/first-output.d.ts] file written with same contents -//// [/src/first/bin/first-output.d.ts.map] file written with same contents -//// [/src/first/bin/first-output.js] file written with same contents -//// [/src/first/bin/first-output.js.map] file written with same contents -//// [/src/first/bin/first-output.tsbuildinfo] -{"bundle":{"commonSourceDirectory":"..","sourceFiles":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"js":{"sections":[{"pos":0,"end":110,"kind":"text"}]},"dts":{"sections":[{"pos":0,"end":157,"kind":"text"}]}},"version":"FakeTSVersion"} - -//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] -====================================================================== -File:: /src/first/bin/first-output.js ----------------------------------------------------------------------- -text: (0-110) -var s = "Hello, world"; -console.log(s); -console.log(f()); -function f() { - return "JS does hoists"; -} - -====================================================================== -====================================================================== -File:: /src/first/bin/first-output.d.ts ----------------------------------------------------------------------- -text: (0-157) -interface TheFirst { - none: any; -} -declare const s = "Hello, world"; -interface NoJsForHereEither { - none: any; -} -declare function f(): string; - -====================================================================== - -//// [/src/first/bin/first-output.tsbuildinfo.readable.baseline.txt] -{ - "bundle": { - "commonSourceDirectory": "..", - "sourceFiles": [ - "../first_PART1.ts", - "../first_part2.ts", - "../first_part3.ts" - ], - "js": { - "sections": [ - { - "pos": 0, - "end": 110, - "kind": "text" - } - ] - }, - "dts": { - "sections": [ - { - "pos": 0, - "end": 157, - "kind": "text" - } - ] - } - }, - "version": "FakeTSVersion", - "size": 252 -} - -//// [/src/third/thirdjs/output/third-output.tsbuildinfo] file written with same contents //// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] ====================================================================== File:: /src/third/thirdjs/output/third-output.js @@ -467,3 +498,71 @@ declare var c: C; "size": 720 } +//// [/src/third/third_part1.ts] +var c = new C(); +c.doSomething(); + + +//// [/src/third/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true, + }, + "files": [ + "third_part1.ts" + ], + "references": [ + { "path": "../first", "prepend": true }, + { "path": "../second", "prepend": true }, + ] +} + + + + +Output:: +/lib/tsc --b /src/third --verbose +[12:00:39 AM] Projects in this build: + * src/first/tsconfig.json + * src/second/tsconfig.json + * src/third/tsconfig.json + +[12:00:40 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.tsbuildinfo' does not exist + +[12:00:41 AM] Building project '/src/first/tsconfig.json'... + +[12:00:49 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' + +[12:00:50 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed + +[12:00:51 AM] Updating output of project '/src/third/tsconfig.json'... + +[12:00:54 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/first/bin/first-output.d.ts] file written with same contents +//// [/src/first/bin/first-output.d.ts.map] file written with same contents +//// [/src/first/bin/first-output.js] file written with same contents +//// [/src/first/bin/first-output.js.map] file written with same contents +//// [/src/first/bin/first-output.tsbuildinfo] +{"bundle":{"commonSourceDirectory":"..","sourceFiles":["../first_PART1.ts","../first_part2.ts","../first_part3.ts"],"js":{"sections":[{"pos":0,"end":110,"kind":"text"}]},"dts":{"sections":[{"pos":0,"end":157,"kind":"text"}]}},"version":"FakeTSVersion"} + +//// [/src/first/bin/first-output.tsbuildinfo.baseline.txt] file written with same contents +//// [/src/first/bin/first-output.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/src/third/thirdjs/output/third-output.d.ts] file changed its modified time +//// [/src/third/thirdjs/output/third-output.d.ts.map] file changed its modified time +//// [/src/third/thirdjs/output/third-output.js] file changed its modified time +//// [/src/third/thirdjs/output/third-output.js.map] file changed its modified time +//// [/src/third/thirdjs/output/third-output.tsbuildinfo] file written with same contents +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.baseline.txt] file written with same contents +//// [/src/third/thirdjs/output/third-output.tsbuildinfo.readable.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/outfile-concat/baseline-sectioned-sourcemaps.js b/tests/baselines/reference/tsbuild/outfile-concat/baseline-sectioned-sourcemaps.js index 8e52089769e..3c8553b67e9 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/baseline-sectioned-sourcemaps.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/baseline-sectioned-sourcemaps.js @@ -131,22 +131,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:01:00 AM] Projects in this build: +[12:00:06 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:07 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:08 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:17 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:18 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:27 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:28 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -1904,20 +1904,20 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:45 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:46 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:47 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:00:55 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because oldest output 'src/third/thirdjs/output/third-output.js' is older than newest input 'src/first' +[12:00:56 AM] Project 'src/third/tsconfig.json' is out of date because oldest output 'src/third/thirdjs/output/third-output.js.map' is older than newest input 'src/first' -[12:04:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:57 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -3219,22 +3219,22 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:07:00 AM] Projects in this build: +[12:01:10 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:07:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:01:11 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:07:00 AM] Building project '/src/first/tsconfig.json'... +[12:01:12 AM] Building project '/src/first/tsconfig.json'... -[12:07:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:20 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:07:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:21 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:07:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:22 AM] Updating output of project '/src/third/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:27 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/declarationMap-and-sourceMap-disabled.js b/tests/baselines/reference/tsbuild/outfile-concat/declarationMap-and-sourceMap-disabled.js index a6424f11e4d..1ac4d105768 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/declarationMap-and-sourceMap-disabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/declarationMap-and-sourceMap-disabled.js @@ -129,22 +129,22 @@ class C { Output:: /lib/tsc --b /src/third --verbose -[12:00:00 AM] Projects in this build: +[12:00:10 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:00:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:11 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:00:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:12 AM] Building project '/src/first/tsconfig.json'... -[12:00:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:21 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:00:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:22 AM] Building project '/src/second/tsconfig.json'... -[12:00:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:31 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:00:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:32 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outfile-concat/emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/emitHelpers-in-all-projects.js index 7873788adf6..e5e1dda5837 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/emitHelpers-in-all-projects.js @@ -137,22 +137,22 @@ const { b, ...rest } = { a: 10, b: 30, yy: 30 }; Output:: /lib/tsc --b /src/third --verbose -[12:01:00 AM] Projects in this build: +[12:00:09 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:10 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:11 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:20 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:21 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:30 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:31 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -2685,20 +2685,20 @@ const { b, ...rest } = { a: 10, b: 30, yy: 30 }; Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:48 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:49 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:50 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:00:58 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because oldest output 'src/third/thirdjs/output/third-output.js' is older than newest input 'src/first' +[12:00:59 AM] Project 'src/third/tsconfig.json' is out of date because oldest output 'src/third/thirdjs/output/third-output.js.map' is older than newest input 'src/first' -[12:04:00 AM] Building project '/src/third/tsconfig.json'... +[12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -4603,22 +4603,22 @@ const { b, ...rest } = { a: 10, b: 30, yy: 30 }; Output:: /lib/tsc --b /src/third --verbose -[12:07:00 AM] Projects in this build: +[12:01:13 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:07:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:01:14 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:07:00 AM] Building project '/src/first/tsconfig.json'... +[12:01:15 AM] Building project '/src/first/tsconfig.json'... -[12:07:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:23 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:07:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:24 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:07:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:25 AM] Updating output of project '/src/third/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:30 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -6102,22 +6102,22 @@ function forfirstfirst_PART1Rest() { }console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:10:00 AM] Projects in this build: +[12:01:39 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:10:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:01:40 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:10:00 AM] Building project '/src/first/tsconfig.json'... +[12:01:41 AM] Building project '/src/first/tsconfig.json'... -[12:10:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:49 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:10:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:50 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:10:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:51 AM] Updating output of project '/src/third/tsconfig.json'... -[12:10:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:57 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/emitHelpers-in-only-one-dependency-project.js b/tests/baselines/reference/tsbuild/outfile-concat/emitHelpers-in-only-one-dependency-project.js index c59ab5c275a..3bdb94abaa9 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/emitHelpers-in-only-one-dependency-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/emitHelpers-in-only-one-dependency-project.js @@ -133,22 +133,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:01:00 AM] Projects in this build: +[12:00:08 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:09 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:10 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:19 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:20 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:29 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:30 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -2303,22 +2303,22 @@ function forfirstfirst_PART1Rest() { }console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:47 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:48 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:49 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:00:57 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:00:58 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:04:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:00:59 AM] Updating output of project '/src/third/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:04 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -3449,22 +3449,22 @@ const { b, ...rest } = { a: 10, b: 30, yy: 30 }; Output:: /lib/tsc --b /src/third --verbose -[12:07:00 AM] Projects in this build: +[12:01:13 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:07:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:01:14 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:07:00 AM] Building project '/src/first/tsconfig.json'... +[12:01:15 AM] Building project '/src/first/tsconfig.json'... -[12:07:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:23 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:07:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:24 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:07:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:25 AM] Updating output of project '/src/third/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:31 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outfile-concat/explainFiles.js b/tests/baselines/reference/tsbuild/outfile-concat/explainFiles.js index 4898823e45e..1bcf4ccb3f0 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/explainFiles.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/explainFiles.js @@ -131,14 +131,14 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose --explainFiles -[12:01:00 AM] Projects in this build: +[12:00:06 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:07 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:08 AM] Building project '/src/first/tsconfig.json'... lib/lib.d.ts Default library for target 'es5' @@ -148,9 +148,9 @@ src/first/first_part2.ts Part of 'files' list in tsconfig.json src/first/first_part3.ts Part of 'files' list in tsconfig.json -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:17 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:18 AM] Building project '/src/second/tsconfig.json'... lib/lib.d.ts Default library for target 'es5' @@ -158,9 +158,9 @@ src/second/second_part1.ts Matched by include pattern '**/*' in 'src/second/tsconfig.json' src/second/second_part2.ts Matched by include pattern '**/*' in 'src/second/tsconfig.json' -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:27 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:28 AM] Building project '/src/third/tsconfig.json'... lib/lib.d.ts Default library for target 'es5' @@ -1906,14 +1906,14 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose --explainFiles -[12:04:00 AM] Projects in this build: +[12:00:45 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:46 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:47 AM] Building project '/src/first/tsconfig.json'... lib/lib.d.ts Default library for target 'es5' @@ -1923,11 +1923,11 @@ src/first/first_part2.ts Part of 'files' list in tsconfig.json src/first/first_part3.ts Part of 'files' list in tsconfig.json -[12:04:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:00:55 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because oldest output 'src/third/thirdjs/output/third-output.js' is older than newest input 'src/first' +[12:00:56 AM] Project 'src/third/tsconfig.json' is out of date because oldest output 'src/third/thirdjs/output/third-output.js.map' is older than newest input 'src/first' -[12:04:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:57 AM] Building project '/src/third/tsconfig.json'... lib/lib.d.ts Default library for target 'es5' @@ -3218,14 +3218,14 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose --explainFiles -[12:07:00 AM] Projects in this build: +[12:01:10 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:07:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:01:11 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:07:00 AM] Building project '/src/first/tsconfig.json'... +[12:01:12 AM] Building project '/src/first/tsconfig.json'... lib/lib.d.ts Default library for target 'es5' @@ -3235,13 +3235,13 @@ src/first/first_part2.ts Part of 'files' list in tsconfig.json src/first/first_part3.ts Part of 'files' list in tsconfig.json -[12:07:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:20 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:07:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:21 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:07:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:22 AM] Updating output of project '/src/third/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:27 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outfile-concat/multiple-emitHelpers-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/multiple-emitHelpers-in-all-projects.js index ede8ff76c5a..2c165b72e99 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/multiple-emitHelpers-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/multiple-emitHelpers-in-all-projects.js @@ -149,22 +149,22 @@ thirdthird_part1Spread(10, ...thirdthird_part1_ar); Output:: /lib/tsc --b /src/third --verbose -[12:01:00 AM] Projects in this build: +[12:00:15 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:16 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:17 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:26 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:27 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:36 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:37 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -3902,22 +3902,22 @@ const { b, ...rest } = { a: 10, b: 30, yy: 30 }; Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:54 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:55 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:56 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:04 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part2.ts' is older than oldest output 'src/2/second-output.js.map' -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:05 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:04:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:06 AM] Updating output of project '/src/third/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:11 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -6106,22 +6106,22 @@ function forfirstfirst_PART1Rest() { }console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:07:00 AM] Projects in this build: +[12:01:20 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:07:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:01:21 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:07:00 AM] Building project '/src/first/tsconfig.json'... +[12:01:22 AM] Building project '/src/first/tsconfig.json'... -[12:07:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:30 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part2.ts' is older than oldest output 'src/2/second-output.js.map' -[12:07:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:31 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:07:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:32 AM] Updating output of project '/src/third/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:38 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outfile-concat/multiple-emitHelpers-in-different-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/multiple-emitHelpers-in-different-projects.js index 2ca865271cb..38cd8cd46eb 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/multiple-emitHelpers-in-different-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/multiple-emitHelpers-in-different-projects.js @@ -139,22 +139,22 @@ const { b, ...rest } = { a: 10, b: 30, yy: 30 }; Output:: /lib/tsc --b /src/third --verbose -[12:01:00 AM] Projects in this build: +[12:00:10 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:11 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:12 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:21 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:22 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:31 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:32 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -2937,22 +2937,22 @@ const { b, ...rest } = { a: 10, b: 30, yy: 30 }; Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:49 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:50 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:51 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:00:59 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:04:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:01 AM] Updating output of project '/src/third/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:06 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -4533,22 +4533,22 @@ function forfirstfirst_PART1Rest() { }console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:07:00 AM] Projects in this build: +[12:01:15 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:07:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:01:16 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:07:00 AM] Building project '/src/first/tsconfig.json'... +[12:01:17 AM] Building project '/src/first/tsconfig.json'... -[12:07:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:25 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:07:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:26 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:07:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:27 AM] Updating output of project '/src/third/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:33 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outfile-concat/multiple-prologues-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/multiple-prologues-in-all-projects.js index 64c095e3704..b69c99cca3e 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/multiple-prologues-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/multiple-prologues-in-all-projects.js @@ -136,22 +136,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:01:00 AM] Projects in this build: +[12:00:14 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:15 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:16 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:25 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:26 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:35 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:36 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -2218,20 +2218,20 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:53 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:54 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:55 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:03 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part2.ts' is older than oldest output 'src/2/second-output.js.map' -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because oldest output 'src/third/thirdjs/output/third-output.js' is older than newest input 'src/first' +[12:01:04 AM] Project 'src/third/tsconfig.json' is out of date because oldest output 'src/third/thirdjs/output/third-output.js.map' is older than newest input 'src/first' -[12:04:00 AM] Building project '/src/third/tsconfig.json'... +[12:01:05 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -3733,22 +3733,22 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:07:00 AM] Projects in this build: +[12:01:18 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:07:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:01:19 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:07:00 AM] Building project '/src/first/tsconfig.json'... +[12:01:20 AM] Building project '/src/first/tsconfig.json'... -[12:07:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:28 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part2.ts' is older than oldest output 'src/2/second-output.js.map' -[12:07:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:29 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:07:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:30 AM] Updating output of project '/src/third/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:35 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -4905,22 +4905,22 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:10:00 AM] Projects in this build: +[12:01:44 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:10:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:01:45 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:10:00 AM] Building project '/src/first/tsconfig.json'... +[12:01:46 AM] Building project '/src/first/tsconfig.json'... -[12:10:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:54 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part2.ts' is older than oldest output 'src/2/second-output.js.map' -[12:10:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:55 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:10:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:56 AM] Updating output of project '/src/third/tsconfig.json'... -[12:10:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:02:02 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/multiple-prologues-in-different-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/multiple-prologues-in-different-projects.js index b13279d62ca..2f0f11c73f3 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/multiple-prologues-in-different-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/multiple-prologues-in-different-projects.js @@ -133,22 +133,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:01:00 AM] Projects in this build: +[12:00:10 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:11 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:12 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:21 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:22 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:31 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:32 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -2091,22 +2091,22 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:49 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:50 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:51 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:00:59 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part2.ts' is older than oldest output 'src/2/second-output.js.map' -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:04:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:01 AM] Updating output of project '/src/third/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:06 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -3161,22 +3161,22 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:07:00 AM] Projects in this build: +[12:01:15 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:07:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:01:16 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:07:00 AM] Building project '/src/first/tsconfig.json'... +[12:01:17 AM] Building project '/src/first/tsconfig.json'... -[12:07:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:25 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part2.ts' is older than oldest output 'src/2/second-output.js.map' -[12:07:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:26 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:07:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:27 AM] Updating output of project '/src/third/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:33 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outfile-concat/shebang-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/shebang-in-all-projects.js index d023836a57c..fcd1f1f69ef 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/shebang-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/shebang-in-all-projects.js @@ -135,22 +135,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:01:00 AM] Projects in this build: +[12:00:10 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:11 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:12 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:21 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:22 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:31 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:32 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -1933,20 +1933,20 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:49 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:50 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:51 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:00:59 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because oldest output 'src/third/thirdjs/output/third-output.js' is older than newest input 'src/first' +[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because oldest output 'src/third/thirdjs/output/third-output.js.map' is older than newest input 'src/first' -[12:04:00 AM] Building project '/src/third/tsconfig.json'... +[12:01:01 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -3267,22 +3267,22 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:07:00 AM] Projects in this build: +[12:01:14 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:07:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:01:15 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:07:00 AM] Building project '/src/first/tsconfig.json'... +[12:01:16 AM] Building project '/src/first/tsconfig.json'... -[12:07:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:24 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:07:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:25 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:07:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:26 AM] Updating output of project '/src/third/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:31 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/shebang-in-only-one-dependency-project.js b/tests/baselines/reference/tsbuild/outfile-concat/shebang-in-only-one-dependency-project.js index ab0d71861dd..1549d275310 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/shebang-in-only-one-dependency-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/shebang-in-only-one-dependency-project.js @@ -132,22 +132,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:01:00 AM] Projects in this build: +[12:00:07 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:08 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:09 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:18 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:19 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:28 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:29 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -1897,22 +1897,22 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:46 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:47 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:48 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:00:56 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:00:57 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:04:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:00:58 AM] Updating output of project '/src/third/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:03 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outfile-concat/strict-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/strict-in-all-projects.js index b1a5cd9a008..f1cae324651 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/strict-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/strict-in-all-projects.js @@ -131,22 +131,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:01:00 AM] Projects in this build: +[12:00:09 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:10 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:11 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:20 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:21 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:30 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:31 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -1994,20 +1994,20 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:48 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:49 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:50 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:00:58 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because oldest output 'src/third/thirdjs/output/third-output.js' is older than newest input 'src/first' +[12:00:59 AM] Project 'src/third/tsconfig.json' is out of date because oldest output 'src/third/thirdjs/output/third-output.js.map' is older than newest input 'src/first' -[12:04:00 AM] Building project '/src/third/tsconfig.json'... +[12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -3369,22 +3369,22 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:07:00 AM] Projects in this build: +[12:01:13 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:07:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:01:14 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:07:00 AM] Building project '/src/first/tsconfig.json'... +[12:01:15 AM] Building project '/src/first/tsconfig.json'... -[12:07:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:23 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:07:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:24 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:07:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:25 AM] Updating output of project '/src/third/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:30 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -4407,22 +4407,22 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:10:00 AM] Projects in this build: +[12:01:39 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:10:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:01:40 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:10:00 AM] Building project '/src/first/tsconfig.json'... +[12:01:41 AM] Building project '/src/first/tsconfig.json'... -[12:10:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:49 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:10:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:50 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:10:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:51 AM] Updating output of project '/src/third/tsconfig.json'... -[12:10:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:57 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/strict-in-one-dependency.js b/tests/baselines/reference/tsbuild/outfile-concat/strict-in-one-dependency.js index 3541cd64a50..398b8508f8f 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/strict-in-one-dependency.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/strict-in-one-dependency.js @@ -131,22 +131,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:01:00 AM] Projects in this build: +[12:00:07 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:08 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:09 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:18 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:19 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:28 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:29 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -1925,22 +1925,22 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:46 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:47 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:48 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:00:56 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:00:57 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:04:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:00:58 AM] Updating output of project '/src/third/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:03 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -2892,22 +2892,22 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:07:00 AM] Projects in this build: +[12:01:12 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:07:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:01:13 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:07:00 AM] Building project '/src/first/tsconfig.json'... +[12:01:14 AM] Building project '/src/first/tsconfig.json'... -[12:07:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:22 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:07:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:23 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:07:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:24 AM] Updating output of project '/src/third/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:30 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-baseline-when-internal-is-inside-another-internal.js b/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-baseline-when-internal-is-inside-another-internal.js index 68d3abfc31b..40c0dac4620 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-baseline-when-internal-is-inside-another-internal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-baseline-when-internal-is-inside-another-internal.js @@ -159,22 +159,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:00:00 AM] Projects in this build: +[12:00:08 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:00:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:09 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:00:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:10 AM] Building project '/src/first/tsconfig.json'... -[12:00:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:19 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:00:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:20 AM] Building project '/src/second/tsconfig.json'... -[12:00:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:29 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:00:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:30 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js index f46fc4ab64a..1e89edc1373 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-jsdoc-style-comment-when-one-two-three-are-prepended-in-order.js @@ -158,22 +158,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:01:00 AM] Projects in this build: +[12:00:11 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:12 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:13 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:22 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:23 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:32 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:33 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -5693,26 +5693,26 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:50 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:51 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:52 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:04:00 AM] Updating output of project '/src/second/tsconfig.json'... +[12:01:01 AM] Updating output of project '/src/second/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/second/tsconfig.json'... +[12:01:06 AM] Updating unchanged output timestamps of project '/src/second/tsconfig.json'... -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/second' has changed +[12:01:11 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/second' has changed -[12:04:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:12 AM] Updating output of project '/src/third/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:17 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -10023,26 +10023,26 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:07:00 AM] Projects in this build: +[12:01:27 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:07:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:01:28 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:07:00 AM] Building project '/src/first/tsconfig.json'... +[12:01:29 AM] Building project '/src/first/tsconfig.json'... -[12:07:00 AM] Project 'src/second/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:37 AM] Project 'src/second/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:07:00 AM] Updating output of project '/src/second/tsconfig.json'... +[12:01:38 AM] Updating output of project '/src/second/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/second/tsconfig.json'... +[12:01:42 AM] Updating unchanged output timestamps of project '/src/second/tsconfig.json'... -[12:07:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/second' has changed +[12:01:48 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/second' has changed -[12:07:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:49 AM] Updating output of project '/src/third/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:54 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-jsdoc-style-comment.js b/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-jsdoc-style-comment.js index ffa75e13c6d..b49f73cf28e 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-jsdoc-style-comment.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-jsdoc-style-comment.js @@ -157,22 +157,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:01:00 AM] Projects in this build: +[12:00:09 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:10 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:11 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:20 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:21 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:30 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:31 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -5402,22 +5402,22 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:48 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:49 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:50 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:00:58 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:00:59 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:04:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:00 AM] Updating output of project '/src/third/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:05 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -7731,22 +7731,22 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:07:00 AM] Projects in this build: +[12:01:14 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:07:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:01:15 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:07:00 AM] Building project '/src/first/tsconfig.json'... +[12:01:16 AM] Building project '/src/first/tsconfig.json'... -[12:07:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:24 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:07:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:25 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:07:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:26 AM] Updating output of project '/src/third/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:31 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js index 76d4e39c8c2..795e00d38ae 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-jsdoc-style-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js @@ -158,22 +158,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:01:00 AM] Projects in this build: +[12:00:14 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:15 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:16 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:25 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:26 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:35 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:36 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -6035,26 +6035,26 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:53 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:54 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:55 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:03 AM] Project 'src/second/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:04:00 AM] Updating output of project '/src/second/tsconfig.json'... +[12:01:04 AM] Updating output of project '/src/second/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/second/tsconfig.json'... +[12:01:09 AM] Updating unchanged output timestamps of project '/src/second/tsconfig.json'... -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/second' has changed +[12:01:14 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/second' has changed -[12:04:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:15 AM] Updating output of project '/src/third/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:20 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-jsdoc-style-with-comments-emit-enabled.js b/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-jsdoc-style-with-comments-emit-enabled.js index 10d0ef05d26..8ca8f6e8e81 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-jsdoc-style-with-comments-emit-enabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-jsdoc-style-with-comments-emit-enabled.js @@ -157,22 +157,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:01:00 AM] Projects in this build: +[12:00:12 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:13 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:14 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:23 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:24 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:33 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:34 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -5738,22 +5738,22 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:51 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:52 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:53 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:01 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:02 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:04:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:03 AM] Updating output of project '/src/third/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:08 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-when-few-members-of-enum-are-internal.js b/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-when-few-members-of-enum-are-internal.js index 8a101f713d0..f590ed1d3d0 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-when-few-members-of-enum-are-internal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-when-few-members-of-enum-are-internal.js @@ -154,22 +154,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:00:00 AM] Projects in this build: +[12:00:08 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:00:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:09 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:00:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:10 AM] Building project '/src/first/tsconfig.json'... -[12:00:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:19 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:00:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:20 AM] Building project '/src/second/tsconfig.json'... -[12:00:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:29 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:00:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:30 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-when-one-two-three-are-prepended-in-order.js index 9819ba0b5f4..b04f3b500d1 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-when-one-two-three-are-prepended-in-order.js @@ -158,22 +158,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:01:00 AM] Projects in this build: +[12:00:11 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:12 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:13 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:22 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:23 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:32 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:33 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -5713,22 +5713,22 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:50 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:51 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:52 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is out of date because oldest output 'src/2/second-output.js' is older than newest input 'src/first' +[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because oldest output 'src/2/second-output.js.map' is older than newest input 'src/first' -[12:04:00 AM] Building project '/src/second/tsconfig.json'... +[12:01:01 AM] Building project '/src/second/tsconfig.json'... -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because oldest output 'src/third/thirdjs/output/third-output.js' is older than newest input 'src/second' +[12:01:09 AM] Project 'src/third/tsconfig.json' is out of date because oldest output 'src/third/thirdjs/output/third-output.js.map' is older than newest input 'src/second' -[12:04:00 AM] Building project '/src/third/tsconfig.json'... +[12:01:10 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -11269,26 +11269,26 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:07:00 AM] Projects in this build: +[12:01:25 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:07:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:01:26 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:07:00 AM] Building project '/src/first/tsconfig.json'... +[12:01:27 AM] Building project '/src/first/tsconfig.json'... -[12:07:00 AM] Project 'src/second/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:35 AM] Project 'src/second/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:07:00 AM] Updating output of project '/src/second/tsconfig.json'... +[12:01:36 AM] Updating output of project '/src/second/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/second/tsconfig.json'... +[12:01:41 AM] Updating unchanged output timestamps of project '/src/second/tsconfig.json'... -[12:07:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/second' has changed +[12:01:46 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/second' has changed -[12:07:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:47 AM] Updating output of project '/src/third/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:52 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -15621,26 +15621,26 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:10:00 AM] Projects in this build: +[12:02:02 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:10:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:02:03 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:10:00 AM] Building project '/src/first/tsconfig.json'... +[12:02:04 AM] Building project '/src/first/tsconfig.json'... -[12:10:00 AM] Project 'src/second/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:02:12 AM] Project 'src/second/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:10:00 AM] Updating output of project '/src/second/tsconfig.json'... +[12:02:13 AM] Updating output of project '/src/second/tsconfig.json'... -[12:10:00 AM] Updating unchanged output timestamps of project '/src/second/tsconfig.json'... +[12:02:17 AM] Updating unchanged output timestamps of project '/src/second/tsconfig.json'... -[12:10:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/second' has changed +[12:02:23 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/second' has changed -[12:10:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:02:24 AM] Updating output of project '/src/third/tsconfig.json'... -[12:10:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:02:29 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-when-prepend-is-completely-internal.js b/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-when-prepend-is-completely-internal.js index d7a59e7566f..7ab0ff0f81b 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-when-prepend-is-completely-internal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-when-prepend-is-completely-internal.js @@ -18,21 +18,55 @@ declare const console: { log(msg: any): void; }; /* @internal */ const A = 1; //// [/src/first/first_part2.ts] +console.log(f()); //// [/src/first/first_part3.ts] - +function f() { + return "JS does hoists"; +} //// [/src/first/tsconfig.json] {"compilerOptions":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true,"sourceMap":true,"outFile":"./bin/first-output.js"},"files":["/src/first/first_PART1.ts"]} //// [/src/second/second_part1.ts] +namespace N { + // Comment text +} + +namespace N { + function f() { + console.log('testing'); + } + + f(); +} //// [/src/second/second_part2.ts] +class C { + doSomething() { + console.log("something got done"); + } +} //// [/src/second/tsconfig.json] +{ + "compilerOptions": { + "target": "es5", + "composite": true, + "removeComments": true, + "strict": false, + "sourceMap": true, + "declarationMap": true, + "declaration": true, + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true + }, + "references": [ + ] +} //// [/src/third/third_part1.ts] @@ -45,17 +79,17 @@ const B = 2; Output:: /lib/tsc --b /src/third --verbose -[12:00:00 AM] Projects in this build: +[12:00:10 AM] Projects in this build: * src/first/tsconfig.json * src/third/tsconfig.json -[12:00:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:11 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:00:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:12 AM] Building project '/src/first/tsconfig.json'... -[12:00:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:21 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:00:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:22 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js b/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js index eea9d3edb7d..ea02b542b4c 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-with-comments-emit-enabled-when-one-two-three-are-prepended-in-order.js @@ -158,22 +158,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:01:00 AM] Projects in this build: +[12:00:14 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:15 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:16 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:25 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:26 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:35 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:36 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -5893,26 +5893,26 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:53 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:54 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:55 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:03 AM] Project 'src/second/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:04:00 AM] Updating output of project '/src/second/tsconfig.json'... +[12:01:04 AM] Updating output of project '/src/second/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/second/tsconfig.json'... +[12:01:09 AM] Updating unchanged output timestamps of project '/src/second/tsconfig.json'... -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/second' has changed +[12:01:14 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/second' has changed -[12:04:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:15 AM] Updating output of project '/src/third/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:20 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -10423,26 +10423,26 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:07:00 AM] Projects in this build: +[12:01:30 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:07:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:01:31 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:07:00 AM] Building project '/src/first/tsconfig.json'... +[12:01:32 AM] Building project '/src/first/tsconfig.json'... -[12:07:00 AM] Project 'src/second/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:40 AM] Project 'src/second/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:07:00 AM] Updating output of project '/src/second/tsconfig.json'... +[12:01:41 AM] Updating output of project '/src/second/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/second/tsconfig.json'... +[12:01:45 AM] Updating unchanged output timestamps of project '/src/second/tsconfig.json'... -[12:07:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/second' has changed +[12:01:51 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/second' has changed -[12:07:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:52 AM] Updating output of project '/src/third/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:57 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-with-comments-emit-enabled.js b/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-with-comments-emit-enabled.js index 2a870290c8c..a76f9e78315 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-with-comments-emit-enabled.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/stripInternal-with-comments-emit-enabled.js @@ -157,22 +157,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:01:00 AM] Projects in this build: +[12:00:12 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:13 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:14 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:23 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:24 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:33 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:34 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -5602,22 +5602,22 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:51 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:52 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:53 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:01 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:02 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:04:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:03 AM] Updating output of project '/src/third/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:08 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -8031,22 +8031,22 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:07:00 AM] Projects in this build: +[12:01:17 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:07:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:01:18 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:07:00 AM] Building project '/src/first/tsconfig.json'... +[12:01:19 AM] Building project '/src/first/tsconfig.json'... -[12:07:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:27 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:07:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:28 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:07:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:29 AM] Updating output of project '/src/third/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:34 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outfile-concat/stripInternal.js b/tests/baselines/reference/tsbuild/outfile-concat/stripInternal.js index 2edf0a4ecba..7b8fd895f35 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/stripInternal.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/stripInternal.js @@ -157,22 +157,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:01:00 AM] Projects in this build: +[12:00:09 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:10 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:11 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:20 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:21 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:30 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:31 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -5422,20 +5422,20 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:48 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:49 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:50 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:00:58 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because oldest output 'src/third/thirdjs/output/third-output.js' is older than newest input 'src/first' +[12:00:59 AM] Project 'src/third/tsconfig.json' is out of date because oldest output 'src/third/thirdjs/output/third-output.js.map' is older than newest input 'src/first' -[12:04:00 AM] Building project '/src/third/tsconfig.json'... +[12:01:00 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -8133,22 +8133,22 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:07:00 AM] Projects in this build: +[12:01:13 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:07:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:01:14 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:07:00 AM] Building project '/src/first/tsconfig.json'... +[12:01:15 AM] Building project '/src/first/tsconfig.json'... -[12:07:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:23 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:07:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:24 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:07:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:25 AM] Updating output of project '/src/third/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:30 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -10484,22 +10484,22 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:10:00 AM] Projects in this build: +[12:01:39 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:10:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:01:40 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:10:00 AM] Building project '/src/first/tsconfig.json'... +[12:01:41 AM] Building project '/src/first/tsconfig.json'... -[12:10:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:49 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:10:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:50 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:10:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:51 AM] Updating output of project '/src/third/tsconfig.json'... -[12:10:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:56 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/triple-slash-refs-in-all-projects.js b/tests/baselines/reference/tsbuild/outfile-concat/triple-slash-refs-in-all-projects.js index b85568947a1..48cc80392a1 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/triple-slash-refs-in-all-projects.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/triple-slash-refs-in-all-projects.js @@ -146,22 +146,22 @@ declare class thirdthird_part1 { } Output:: /lib/tsc --b /src/third --verbose -[12:01:00 AM] Projects in this build: +[12:00:12 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:13 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:14 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:23 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:24 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:33 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:34 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -2254,20 +2254,20 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:51 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:52 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:53 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:01 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because oldest output 'src/third/thirdjs/output/third-output.js' is older than newest input 'src/first' +[12:01:02 AM] Project 'src/third/tsconfig.json' is out of date because oldest output 'src/third/thirdjs/output/third-output.js.map' is older than newest input 'src/first' -[12:04:00 AM] Building project '/src/third/tsconfig.json'... +[12:01:03 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -3839,22 +3839,22 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:07:00 AM] Projects in this build: +[12:01:16 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:07:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:01:17 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:07:00 AM] Building project '/src/first/tsconfig.json'... +[12:01:18 AM] Building project '/src/first/tsconfig.json'... -[12:07:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:01:26 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:07:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:01:27 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:07:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:01:28 AM] Updating output of project '/src/third/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:33 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { diff --git a/tests/baselines/reference/tsbuild/outfile-concat/triple-slash-refs-in-one-project.js b/tests/baselines/reference/tsbuild/outfile-concat/triple-slash-refs-in-one-project.js index 4b349e58efd..87d297bab50 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/triple-slash-refs-in-one-project.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/triple-slash-refs-in-one-project.js @@ -136,22 +136,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:01:00 AM] Projects in this build: +[12:00:08 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:09 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:10 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:19 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:20 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:29 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:30 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -2020,22 +2020,22 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:47 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:48 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:49 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:00:57 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:00:58 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:04:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:00:59 AM] Updating output of project '/src/third/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:04 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outfile-concat/when-final-project-is-not-composite-but-incremental.js b/tests/baselines/reference/tsbuild/outfile-concat/when-final-project-is-not-composite-but-incremental.js index 8ad8cbc0d21..b7e1a5e27ad 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/when-final-project-is-not-composite-but-incremental.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/when-final-project-is-not-composite-but-incremental.js @@ -131,22 +131,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:00:00 AM] Projects in this build: +[12:00:07 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:00:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:08 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:00:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:09 AM] Building project '/src/first/tsconfig.json'... -[12:00:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:18 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:00:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:19 AM] Building project '/src/second/tsconfig.json'... -[12:00:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:28 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:00:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:29 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outfile-concat/when-final-project-is-not-composite-but-uses-project-references.js b/tests/baselines/reference/tsbuild/outfile-concat/when-final-project-is-not-composite-but-uses-project-references.js index c249e307de6..ff11c35de4f 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/when-final-project-is-not-composite-but-uses-project-references.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/when-final-project-is-not-composite-but-uses-project-references.js @@ -131,22 +131,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:01:00 AM] Projects in this build: +[12:00:07 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:08 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:09 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:18 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:19 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:28 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:29 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -1726,20 +1726,20 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:43 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:44 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:45 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:00:53 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:00:54 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:04:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:55 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outfile-concat/when-final-project-specifies-tsBuildInfoFile.js b/tests/baselines/reference/tsbuild/outfile-concat/when-final-project-specifies-tsBuildInfoFile.js index 8a8540230e9..b45fdc438c1 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/when-final-project-specifies-tsBuildInfoFile.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/when-final-project-specifies-tsBuildInfoFile.js @@ -132,22 +132,22 @@ c.doSomething(); Output:: /lib/tsc --b /src/third --verbose -[12:00:00 AM] Projects in this build: +[12:00:07 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:00:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:08 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:00:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:09 AM] Building project '/src/first/tsconfig.json'... -[12:00:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:18 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:00:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:19 AM] Building project '/src/second/tsconfig.json'... -[12:00:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:28 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:00:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:29 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outfile-concat/when-source-files-are-empty-in-the-own-file.js b/tests/baselines/reference/tsbuild/outfile-concat/when-source-files-are-empty-in-the-own-file.js index f7272bccaf8..3050a9a42b3 100644 --- a/tests/baselines/reference/tsbuild/outfile-concat/when-source-files-are-empty-in-the-own-file.js +++ b/tests/baselines/reference/tsbuild/outfile-concat/when-source-files-are-empty-in-the-own-file.js @@ -129,22 +129,22 @@ class C { Output:: /lib/tsc --b /src/third --verbose -[12:01:00 AM] Projects in this build: +[12:00:07 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:01:00 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist +[12:00:08 AM] Project 'src/first/tsconfig.json' is out of date because output file 'src/first/bin/first-output.js' does not exist -[12:01:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:09 AM] Building project '/src/first/tsconfig.json'... -[12:01:00 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist +[12:00:18 AM] Project 'src/second/tsconfig.json' is out of date because output file 'src/2/second-output.js' does not exist -[12:01:00 AM] Building project '/src/second/tsconfig.json'... +[12:00:19 AM] Building project '/src/second/tsconfig.json'... -[12:01:00 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist +[12:00:28 AM] Project 'src/third/tsconfig.json' is out of date because output file 'src/third/thirdjs/output/third-output.js' does not exist -[12:01:00 AM] Building project '/src/third/tsconfig.json'... +[12:00:29 AM] Building project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success @@ -1782,22 +1782,22 @@ console.log(s); Output:: /lib/tsc --b /src/third --verbose -[12:04:00 AM] Projects in this build: +[12:00:46 AM] Projects in this build: * src/first/tsconfig.json * src/second/tsconfig.json * src/third/tsconfig.json -[12:04:00 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' +[12:00:47 AM] Project 'src/first/tsconfig.json' is out of date because oldest output 'src/first/bin/first-output.js' is older than newest input 'src/first/first_PART1.ts' -[12:04:00 AM] Building project '/src/first/tsconfig.json'... +[12:00:48 AM] Building project '/src/first/tsconfig.json'... -[12:04:00 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js' +[12:00:56 AM] Project 'src/second/tsconfig.json' is up to date because newest input 'src/second/second_part1.ts' is older than oldest output 'src/2/second-output.js.map' -[12:04:00 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed +[12:00:57 AM] Project 'src/third/tsconfig.json' is out of date because output of its dependency 'src/first' has changed -[12:04:00 AM] Updating output of project '/src/third/tsconfig.json'... +[12:00:58 AM] Updating output of project '/src/third/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... +[12:01:03 AM] Updating unchanged output timestamps of project '/src/third/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-not-specified-and-is-composite.js b/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-not-specified-and-is-composite.js index b0e6de5bb38..ea46431e9b3 100644 --- a/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-not-specified-and-is-composite.js +++ b/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-not-specified-and-is-composite.js @@ -24,12 +24,12 @@ export const x = 10; Output:: /lib/tsc --b /src/tsconfig.json -v -[12:01:00 AM] Projects in this build: +[12:00:09 AM] Projects in this build: * src/tsconfig.json -[12:01:00 AM] Project 'src/tsconfig.json' is out of date because output file 'src/dist/src/index.js' does not exist +[12:00:10 AM] Project 'src/tsconfig.json' is out of date because output file 'src/dist/src/index.js' does not exist -[12:01:00 AM] Building project '/src/tsconfig.json'... +[12:00:11 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success @@ -89,10 +89,10 @@ Input:: Output:: /lib/tsc --b /src/tsconfig.json -v -[12:04:00 AM] Projects in this build: +[12:00:18 AM] Projects in this build: * src/tsconfig.json -[12:04:00 AM] Project 'src/tsconfig.json' is up to date because newest input 'src/src/index.ts' is older than oldest output 'src/dist/src/index.js' +[12:00:19 AM] Project 'src/tsconfig.json' is up to date because newest input 'src/src/index.ts' is older than oldest output 'src/dist/src/index.js' exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-not-specified.js b/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-not-specified.js index 11648d4fe14..cc9359c6661 100644 --- a/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-not-specified.js +++ b/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-not-specified.js @@ -24,12 +24,12 @@ export const x = 10; Output:: /lib/tsc --b /src/tsconfig.json -v -[12:01:00 AM] Projects in this build: +[12:00:09 AM] Projects in this build: * src/tsconfig.json -[12:01:00 AM] Project 'src/tsconfig.json' is out of date because output file 'src/dist/index.js' does not exist +[12:00:10 AM] Project 'src/tsconfig.json' is out of date because output file 'src/dist/index.js' does not exist -[12:01:00 AM] Building project '/src/tsconfig.json'... +[12:00:11 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success @@ -49,10 +49,10 @@ Input:: Output:: /lib/tsc --b /src/tsconfig.json -v -[12:04:00 AM] Projects in this build: +[12:00:14 AM] Projects in this build: * src/tsconfig.json -[12:04:00 AM] Project 'src/tsconfig.json' is up to date because newest input 'src/src/index.ts' is older than oldest output 'src/dist/index.js' +[12:00:15 AM] Project 'src/tsconfig.json' is up to date because newest input 'src/src/index.ts' is older than oldest output 'src/dist/index.js' exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js b/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js index 8587bd67a59..b5088545626 100644 --- a/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js +++ b/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js @@ -27,12 +27,12 @@ export type t = string; Output:: /lib/tsc --b /src/tsconfig.json -v -[12:01:00 AM] Projects in this build: +[12:00:11 AM] Projects in this build: * src/tsconfig.json -[12:01:00 AM] Project 'src/tsconfig.json' is out of date because output file 'src/dist/index.js' does not exist +[12:00:12 AM] Project 'src/tsconfig.json' is out of date because output file 'src/dist/index.js' does not exist -[12:01:00 AM] Building project '/src/tsconfig.json'... +[12:00:13 AM] Building project '/src/tsconfig.json'... error TS6059: File '/src/types/type.ts' is not under 'rootDir' '/src/src'. 'rootDir' is expected to contain all source files. The file is in the program because: @@ -52,12 +52,12 @@ Input:: Output:: /lib/tsc --b /src/tsconfig.json -v -[12:04:00 AM] Projects in this build: +[12:00:14 AM] Projects in this build: * src/tsconfig.json -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because output file 'src/dist/index.js' does not exist +[12:00:15 AM] Project 'src/tsconfig.json' is out of date because output file 'src/dist/index.js' does not exist -[12:04:00 AM] Building project '/src/tsconfig.json'... +[12:00:16 AM] Building project '/src/tsconfig.json'... error TS6059: File '/src/types/type.ts' is not under 'rootDir' '/src/src'. 'rootDir' is expected to contain all source files. The file is in the program because: diff --git a/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir.js b/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir.js index b8a88cf7d28..bf218767e26 100644 --- a/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir.js +++ b/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir.js @@ -27,12 +27,12 @@ export type t = string; Output:: /lib/tsc --b /src/tsconfig.json -v -[12:01:00 AM] Projects in this build: +[12:00:11 AM] Projects in this build: * src/tsconfig.json -[12:01:00 AM] Project 'src/tsconfig.json' is out of date because output file 'src/dist/index.js' does not exist +[12:00:12 AM] Project 'src/tsconfig.json' is out of date because output file 'src/dist/index.js' does not exist -[12:01:00 AM] Building project '/src/tsconfig.json'... +[12:00:13 AM] Building project '/src/tsconfig.json'... error TS6059: File '/src/types/type.ts' is not under 'rootDir' '/src/src'. 'rootDir' is expected to contain all source files. The file is in the program because: @@ -52,12 +52,12 @@ Input:: Output:: /lib/tsc --b /src/tsconfig.json -v -[12:04:00 AM] Projects in this build: +[12:00:14 AM] Projects in this build: * src/tsconfig.json -[12:04:00 AM] Project 'src/tsconfig.json' is out of date because output file 'src/dist/index.js' does not exist +[12:00:15 AM] Project 'src/tsconfig.json' is out of date because output file 'src/dist/index.js' does not exist -[12:04:00 AM] Building project '/src/tsconfig.json'... +[12:00:16 AM] Building project '/src/tsconfig.json'... error TS6059: File '/src/types/type.ts' is not under 'rootDir' '/src/src'. 'rootDir' is expected to contain all source files. The file is in the program because: diff --git a/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified.js b/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified.js index d3b05377a5e..ed727c451f7 100644 --- a/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified.js +++ b/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified.js @@ -24,12 +24,12 @@ export const x = 10; Output:: /lib/tsc --b /src/tsconfig.json -v -[12:01:00 AM] Projects in this build: +[12:00:09 AM] Projects in this build: * src/tsconfig.json -[12:01:00 AM] Project 'src/tsconfig.json' is out of date because output file 'src/dist/index.js' does not exist +[12:00:10 AM] Project 'src/tsconfig.json' is out of date because output file 'src/dist/index.js' does not exist -[12:01:00 AM] Building project '/src/tsconfig.json'... +[12:00:11 AM] Building project '/src/tsconfig.json'... exitCode:: ExitStatus.Success @@ -49,10 +49,10 @@ Input:: Output:: /lib/tsc --b /src/tsconfig.json -v -[12:04:00 AM] Projects in this build: +[12:00:14 AM] Projects in this build: * src/tsconfig.json -[12:04:00 AM] Project 'src/tsconfig.json' is up to date because newest input 'src/src/index.ts' is older than oldest output 'src/dist/index.js' +[12:00:15 AM] Project 'src/tsconfig.json' is up to date because newest input 'src/src/index.ts' is older than oldest output 'src/dist/index.js' exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file-because-no-rootDir-in-the-base.js b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file-because-no-rootDir-in-the-base.js index 90ccbb786f8..12a5c45991f 100644 --- a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file-because-no-rootDir-in-the-base.js +++ b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file-because-no-rootDir-in-the-base.js @@ -57,17 +57,17 @@ export const Other = 0; Output:: /lib/tsc --b /src/src/main --verbose -[12:00:00 AM] Projects in this build: +[12:00:07 AM] Projects in this build: * src/src/other/tsconfig.json * src/src/main/tsconfig.json -[12:00:00 AM] Project 'src/src/other/tsconfig.json' is out of date because output file 'src/dist/other.js' does not exist +[12:00:08 AM] Project 'src/src/other/tsconfig.json' is out of date because output file 'src/dist/other.js' does not exist -[12:00:00 AM] Building project '/src/src/other/tsconfig.json'... +[12:00:09 AM] Building project '/src/src/other/tsconfig.json'... -[12:00:00 AM] Project 'src/src/main/tsconfig.json' is out of date because output file 'src/dist/a.js' does not exist +[12:00:15 AM] Project 'src/src/main/tsconfig.json' is out of date because output file 'src/dist/a.js' does not exist -[12:00:00 AM] Building project '/src/src/main/tsconfig.json'... +[12:00:16 AM] Building project '/src/src/main/tsconfig.json'... src/src/main/tsconfig.json:4:5 - error TS6377: Cannot write file '/src/dist/tsconfig.tsbuildinfo' because it will overwrite '.tsbuildinfo' file generated by referenced project '/src/src/other' diff --git a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file.js b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file.js index 91f519359ed..a92cfc67c9b 100644 --- a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file.js +++ b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file.js @@ -33,23 +33,34 @@ export const Other = 0; {"compilerOptions":{"composite":true,"outDir":"../../dist/"}} //// [/src/tsconfig.base.json] - +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "rootDir": "./src/", + "outDir": "./dist/", + "skipDefaultLibCheck": true + }, + "exclude": [ + "node_modules" + ] +} Output:: /lib/tsc --b /src/src/main --verbose -[12:00:00 AM] Projects in this build: +[12:00:08 AM] Projects in this build: * src/src/other/tsconfig.json * src/src/main/tsconfig.json -[12:00:00 AM] Project 'src/src/other/tsconfig.json' is out of date because output file 'src/dist/other.js' does not exist +[12:00:09 AM] Project 'src/src/other/tsconfig.json' is out of date because output file 'src/dist/other.js' does not exist -[12:00:00 AM] Building project '/src/src/other/tsconfig.json'... +[12:00:10 AM] Building project '/src/src/other/tsconfig.json'... -[12:00:00 AM] Project 'src/src/main/tsconfig.json' is out of date because output file 'src/dist/a.js' does not exist +[12:00:16 AM] Project 'src/src/main/tsconfig.json' is out of date because output file 'src/dist/a.js' does not exist -[12:00:00 AM] Building project '/src/src/main/tsconfig.json'... +[12:00:17 AM] Building project '/src/src/main/tsconfig.json'... src/src/main/tsconfig.json:1:76 - error TS6377: Cannot write file '/src/dist/tsconfig.tsbuildinfo' because it will overwrite '.tsbuildinfo' file generated by referenced project '/src/src/other' diff --git a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-no-error-when-tsbuildinfo-differ.js b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-no-error-when-tsbuildinfo-differ.js index 34c24f66395..93838c0fbfa 100644 --- a/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-no-error-when-tsbuildinfo-differ.js +++ b/tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-no-error-when-tsbuildinfo-differ.js @@ -33,23 +33,34 @@ export const Other = 0; {"compilerOptions":{"composite":true,"outDir":"../../dist/"}} //// [/src/tsconfig.base.json] - +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "rootDir": "./src/", + "outDir": "./dist/", + "skipDefaultLibCheck": true + }, + "exclude": [ + "node_modules" + ] +} Output:: /lib/tsc --b /src/src/main/tsconfig.main.json --verbose -[12:00:00 AM] Projects in this build: +[12:00:10 AM] Projects in this build: * src/src/other/tsconfig.other.json * src/src/main/tsconfig.main.json -[12:00:00 AM] Project 'src/src/other/tsconfig.other.json' is out of date because output file 'src/dist/other.js' does not exist +[12:00:11 AM] Project 'src/src/other/tsconfig.other.json' is out of date because output file 'src/dist/other.js' does not exist -[12:00:00 AM] Building project '/src/src/other/tsconfig.other.json'... +[12:00:12 AM] Building project '/src/src/other/tsconfig.other.json'... -[12:00:00 AM] Project 'src/src/main/tsconfig.main.json' is out of date because output file 'src/dist/a.js' does not exist +[12:00:18 AM] Project 'src/src/main/tsconfig.main.json' is out of date because output file 'src/dist/a.js' does not exist -[12:00:00 AM] Building project '/src/src/main/tsconfig.main.json'... +[12:00:19 AM] Building project '/src/src/main/tsconfig.main.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/publicAPI/build-with-custom-transformers.js b/tests/baselines/reference/tsbuild/publicAPI/build-with-custom-transformers.js index 801164a0b03..b218357820d 100644 --- a/tests/baselines/reference/tsbuild/publicAPI/build-with-custom-transformers.js +++ b/tests/baselines/reference/tsbuild/publicAPI/build-with-custom-transformers.js @@ -41,18 +41,18 @@ export function f22() { } // trailing Output:: /lib/tsc --b /src/tsconfig.json -[12:00:00 AM] Projects in this build: +[12:00:13 AM] Projects in this build: * src/shared/tsconfig.json * src/webpack/tsconfig.json * src/tsconfig.json -[12:00:00 AM] Project 'src/shared/tsconfig.json' is out of date because output file 'src/shared/index.js' does not exist +[12:00:14 AM] Project 'src/shared/tsconfig.json' is out of date because output file 'src/shared/index.js' does not exist -[12:00:00 AM] Building project '/src/shared/tsconfig.json'... +[12:00:15 AM] Building project '/src/shared/tsconfig.json'... -[12:00:00 AM] Project 'src/webpack/tsconfig.json' is out of date because output file 'src/webpack/index.js' does not exist +[12:00:20 AM] Project 'src/webpack/tsconfig.json' is out of date because output file 'src/webpack/index.js' does not exist -[12:00:00 AM] Building project '/src/webpack/tsconfig.json'... +[12:00:21 AM] Building project '/src/webpack/tsconfig.json'... exitCode:: ExitStatus.Success Program root files: ["/src/shared/index.ts"] diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file.js b/tests/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file.js index f89ac987cc7..f3901ed5a20 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file.js @@ -42,24 +42,69 @@ export default hello.hello } //// [/src/tsconfig_withInclude.json] - +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "include": [ + "src/**/*" + ] +} //// [/src/tsconfig_withIncludeAndFiles.json] - +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "files": [ + "src/hello.json" + ], + "include": [ + "src/**/*" + ] +} //// [/src/tsconfig_withIncludeOfJson.json] - +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "include": [ + "src/**/*", "src/**/*.json" + ] +} Output:: /lib/tsc --b /src/tsconfig_withFiles.json --v --explainFiles -[12:00:00 AM] Projects in this build: +[12:00:06 AM] Projects in this build: * src/tsconfig_withFiles.json -[12:00:00 AM] Project 'src/tsconfig_withFiles.json' is out of date because output file 'src/dist/src/index.js' does not exist +[12:00:07 AM] Project 'src/tsconfig_withFiles.json' is out of date because output file 'src/dist/src/index.js' does not exist -[12:00:00 AM] Building project '/src/tsconfig_withFiles.json'... +[12:00:08 AM] Building project '/src/tsconfig_withFiles.json'... lib/lib.d.ts Default library for target 'es3' diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/importing-json-module-from-project-reference.js b/tests/baselines/reference/tsbuild/resolveJsonModule/importing-json-module-from-project-reference.js index 61c24618621..f472d1de303 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/importing-json-module-from-project-reference.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/importing-json-module-from-project-reference.js @@ -71,22 +71,22 @@ console.log(foo); Output:: /lib/tsc --b src/tsconfig.json --verbose --explainFiles -[12:01:00 AM] Projects in this build: +[12:00:06 AM] Projects in this build: * src/strings/tsconfig.json * src/main/tsconfig.json * src/tsconfig.json -[12:01:00 AM] Project 'src/strings/tsconfig.json' is out of date because output file 'src/strings/tsconfig.tsbuildinfo' does not exist +[12:00:07 AM] Project 'src/strings/tsconfig.json' is out of date because output file 'src/strings/tsconfig.tsbuildinfo' does not exist -[12:01:00 AM] Building project '/src/strings/tsconfig.json'... +[12:00:08 AM] Building project '/src/strings/tsconfig.json'... lib/lib.d.ts Default library for target 'es5' src/strings/foo.json Matched by include pattern 'foo.json' in 'src/strings/tsconfig.json' -[12:01:00 AM] Project 'src/main/tsconfig.json' is out of date because output file 'src/main/index.js' does not exist +[12:00:11 AM] Project 'src/main/tsconfig.json' is out of date because output file 'src/main/index.js' does not exist -[12:01:00 AM] Building project '/src/main/tsconfig.json'... +[12:00:12 AM] Building project '/src/main/tsconfig.json'... lib/lib.d.ts Default library for target 'es5' @@ -211,14 +211,14 @@ Input:: Output:: /lib/tsc --b src/tsconfig.json --verbose --explainFiles -[12:04:00 AM] Projects in this build: +[12:00:17 AM] Projects in this build: * src/strings/tsconfig.json * src/main/tsconfig.json * src/tsconfig.json -[12:04:00 AM] Project 'src/strings/tsconfig.json' is up to date because newest input 'src/strings/foo.json' is older than oldest output 'src/strings/tsconfig.tsbuildinfo' +[12:00:18 AM] Project 'src/strings/tsconfig.json' is up to date because newest input 'src/strings/foo.json' is older than oldest output 'src/strings/tsconfig.tsbuildinfo' -[12:04:00 AM] Project 'src/main/tsconfig.json' is up to date because newest input 'src/main/index.ts' is older than oldest output 'src/main/index.js' +[12:00:19 AM] Project 'src/main/tsconfig.json' is up to date because newest input 'src/main/index.ts' is older than oldest output 'src/main/index.js' exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/include-and-files.js b/tests/baselines/reference/tsbuild/resolveJsonModule/include-and-files.js index 5b0b0ab096b..bebf482139e 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/include-and-files.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/include-and-files.js @@ -25,10 +25,38 @@ import hello from "./hello.json" export default hello.hello //// [/src/tsconfig_withFiles.json] - +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "files": [ + "src/index.ts", "src/hello.json" + ] +} //// [/src/tsconfig_withInclude.json] - +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "include": [ + "src/**/*" + ] +} //// [/src/tsconfig_withIncludeAndFiles.json] { @@ -51,18 +79,32 @@ export default hello.hello } //// [/src/tsconfig_withIncludeOfJson.json] - +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "include": [ + "src/**/*", "src/**/*.json" + ] +} Output:: /lib/tsc --b /src/tsconfig_withIncludeAndFiles.json --v --explainFiles -[12:00:00 AM] Projects in this build: +[12:00:06 AM] Projects in this build: * src/tsconfig_withIncludeAndFiles.json -[12:00:00 AM] Project 'src/tsconfig_withIncludeAndFiles.json' is out of date because output file 'src/dist/src/hello.json' does not exist +[12:00:07 AM] Project 'src/tsconfig_withIncludeAndFiles.json' is out of date because output file 'src/dist/src/hello.json' does not exist -[12:00:00 AM] Building project '/src/tsconfig_withIncludeAndFiles.json'... +[12:00:08 AM] Building project '/src/tsconfig_withIncludeAndFiles.json'... lib/lib.d.ts Default library for target 'es3' diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js b/tests/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js index b03df44134f..5347b4cacb6 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file.js @@ -23,13 +23,58 @@ import hello from "./index.json" export default hello.hello //// [/src/tsconfig_withFiles.json] - +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "files": [ + "src/index.ts", "src/hello.json" + ] +} //// [/src/tsconfig_withInclude.json] - +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "include": [ + "src/**/*" + ] +} //// [/src/tsconfig_withIncludeAndFiles.json] - +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "files": [ + "src/hello.json" + ], + "include": [ + "src/**/*" + ] +} //// [/src/tsconfig_withIncludeOfJson.json] { @@ -52,12 +97,12 @@ export default hello.hello Output:: /lib/tsc --b /src/tsconfig_withIncludeOfJson.json --v --explainFiles -[12:00:00 AM] Projects in this build: +[12:00:09 AM] Projects in this build: * src/tsconfig_withIncludeOfJson.json -[12:00:00 AM] Project 'src/tsconfig_withIncludeOfJson.json' is out of date because output file 'src/dist/src/index.js' does not exist +[12:00:10 AM] Project 'src/tsconfig_withIncludeOfJson.json' is out of date because output file 'src/dist/src/index.js' does not exist -[12:00:00 AM] Building project '/src/tsconfig_withIncludeOfJson.json'... +[12:00:11 AM] Building project '/src/tsconfig_withIncludeOfJson.json'... lib/lib.d.ts Default library for target 'es3' diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include.js b/tests/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include.js index bceeadf78b7..7696b5ed77d 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include.js @@ -25,13 +25,58 @@ import hello from "./hello.json" export default hello.hello //// [/src/tsconfig_withFiles.json] - +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "files": [ + "src/index.ts", "src/hello.json" + ] +} //// [/src/tsconfig_withInclude.json] - +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "include": [ + "src/**/*" + ] +} //// [/src/tsconfig_withIncludeAndFiles.json] - +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "files": [ + "src/hello.json" + ], + "include": [ + "src/**/*" + ] +} //// [/src/tsconfig_withIncludeOfJson.json] { @@ -54,12 +99,12 @@ export default hello.hello Output:: /lib/tsc --b /src/tsconfig_withIncludeOfJson.json --v --explainFiles -[12:00:00 AM] Projects in this build: +[12:00:06 AM] Projects in this build: * src/tsconfig_withIncludeOfJson.json -[12:00:00 AM] Project 'src/tsconfig_withIncludeOfJson.json' is out of date because output file 'src/dist/src/index.js' does not exist +[12:00:07 AM] Project 'src/tsconfig_withIncludeOfJson.json' is out of date because output file 'src/dist/src/index.js' does not exist -[12:00:00 AM] Building project '/src/tsconfig_withIncludeOfJson.json'... +[12:00:08 AM] Building project '/src/tsconfig_withIncludeOfJson.json'... lib/lib.d.ts Default library for target 'es3' diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/include-only.js b/tests/baselines/reference/tsbuild/resolveJsonModule/include-only.js index c865691cdf6..476128c015b 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/include-only.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/include-only.js @@ -25,7 +25,21 @@ import hello from "./hello.json" export default hello.hello //// [/src/tsconfig_withFiles.json] - +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "files": [ + "src/index.ts", "src/hello.json" + ] +} //// [/src/tsconfig_withInclude.json] { @@ -45,21 +59,52 @@ export default hello.hello } //// [/src/tsconfig_withIncludeAndFiles.json] - +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "files": [ + "src/hello.json" + ], + "include": [ + "src/**/*" + ] +} //// [/src/tsconfig_withIncludeOfJson.json] - +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "include": [ + "src/**/*", "src/**/*.json" + ] +} Output:: /lib/tsc --b /src/tsconfig_withInclude.json --v --explainFiles -[12:00:00 AM] Projects in this build: +[12:00:06 AM] Projects in this build: * src/tsconfig_withInclude.json -[12:00:00 AM] Project 'src/tsconfig_withInclude.json' is out of date because output file 'src/dist/src/index.js' does not exist +[12:00:07 AM] Project 'src/tsconfig_withInclude.json' is out of date because output file 'src/dist/src/index.js' does not exist -[12:00:00 AM] Building project '/src/tsconfig_withInclude.json'... +[12:00:08 AM] Building project '/src/tsconfig_withInclude.json'... src/src/index.ts:1:19 - error TS6307: File '/src/src/hello.json' is not listed within the file list of project '/src/tsconfig_withInclude.json'. Projects must list all files or use an 'include' pattern. diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/sourcemap.js b/tests/baselines/reference/tsbuild/resolveJsonModule/sourcemap.js index d88d2b98921..f4bd738681c 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/sourcemap.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/sourcemap.js @@ -42,24 +42,69 @@ export default hello.hello } //// [/src/tsconfig_withInclude.json] - +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "include": [ + "src/**/*" + ] +} //// [/src/tsconfig_withIncludeAndFiles.json] - +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "files": [ + "src/hello.json" + ], + "include": [ + "src/**/*" + ] +} //// [/src/tsconfig_withIncludeOfJson.json] - +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "include": [ + "src/**/*", "src/**/*.json" + ] +} Output:: /lib/tsc --b src/tsconfig_withFiles.json --verbose --explainFiles -[12:01:00 AM] Projects in this build: +[12:00:07 AM] Projects in this build: * src/tsconfig_withFiles.json -[12:01:00 AM] Project 'src/tsconfig_withFiles.json' is out of date because output file 'src/dist/src/index.js' does not exist +[12:00:08 AM] Project 'src/tsconfig_withFiles.json' is out of date because output file 'src/dist/src/index.js' does not exist -[12:01:00 AM] Building project '/src/tsconfig_withFiles.json'... +[12:00:09 AM] Building project '/src/tsconfig_withFiles.json'... lib/lib.d.ts Default library for target 'es3' @@ -159,10 +204,10 @@ Input:: Output:: /lib/tsc --b src/tsconfig_withFiles.json --verbose --explainFiles -[12:04:00 AM] Projects in this build: +[12:00:18 AM] Projects in this build: * src/tsconfig_withFiles.json -[12:04:00 AM] Project 'src/tsconfig_withFiles.json' is up to date because newest input 'src/src/index.ts' is older than oldest output 'src/dist/src/index.js' +[12:00:19 AM] Project 'src/tsconfig_withFiles.json' is up to date because newest input 'src/src/index.ts' is older than oldest output 'src/dist/src/hello.json' exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/resolveJsonModule/without-outDir.js b/tests/baselines/reference/tsbuild/resolveJsonModule/without-outDir.js index af59c4bf9dd..ef88243f69f 100644 --- a/tests/baselines/reference/tsbuild/resolveJsonModule/without-outDir.js +++ b/tests/baselines/reference/tsbuild/resolveJsonModule/without-outDir.js @@ -42,24 +42,69 @@ export default hello.hello } //// [/src/tsconfig_withInclude.json] - +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "include": [ + "src/**/*" + ] +} //// [/src/tsconfig_withIncludeAndFiles.json] - +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "files": [ + "src/hello.json" + ], + "include": [ + "src/**/*" + ] +} //// [/src/tsconfig_withIncludeOfJson.json] - +{ + "compilerOptions": { + "composite": true, + "moduleResolution": "node", + "module": "commonjs", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "outDir": "dist", + "skipDefaultLibCheck": true + }, + "include": [ + "src/**/*", "src/**/*.json" + ] +} Output:: /lib/tsc --b src/tsconfig_withFiles.json --verbose -[12:01:00 AM] Projects in this build: +[12:00:07 AM] Projects in this build: * src/tsconfig_withFiles.json -[12:01:00 AM] Project 'src/tsconfig_withFiles.json' is out of date because output file 'src/src/index.js' does not exist +[12:00:08 AM] Project 'src/tsconfig_withFiles.json' is out of date because output file 'src/src/index.js' does not exist -[12:01:00 AM] Building project '/src/tsconfig_withFiles.json'... +[12:00:09 AM] Building project '/src/tsconfig_withFiles.json'... exitCode:: ExitStatus.Success @@ -141,10 +186,10 @@ Input:: Output:: /lib/tsc --b src/tsconfig_withFiles.json --verbose -[12:04:00 AM] Projects in this build: +[12:00:14 AM] Projects in this build: * src/tsconfig_withFiles.json -[12:04:00 AM] Project 'src/tsconfig_withFiles.json' is up to date because newest input 'src/src/index.ts' is older than oldest output 'src/src/index.js' +[12:00:15 AM] Project 'src/tsconfig_withFiles.json' is up to date because newest input 'src/src/index.ts' is older than oldest output 'src/src/index.js' exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/sample1/always-builds-under-with-force-option.js b/tests/baselines/reference/tsbuild/sample1/always-builds-under-with-force-option.js index 5cd3b7649f8..1675145260d 100644 --- a/tests/baselines/reference/tsbuild/sample1/always-builds-under-with-force-option.js +++ b/tests/baselines/reference/tsbuild/sample1/always-builds-under-with-force-option.js @@ -89,9 +89,22 @@ export const m = mod; } //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} diff --git a/tests/baselines/reference/tsbuild/sample1/building-project-in-not-build-order-doesnt-throw-error.js b/tests/baselines/reference/tsbuild/sample1/building-project-in-not-build-order-doesnt-throw-error.js index f2f73d399f0..fdab2843fa1 100644 --- a/tests/baselines/reference/tsbuild/sample1/building-project-in-not-build-order-doesnt-throw-error.js +++ b/tests/baselines/reference/tsbuild/sample1/building-project-in-not-build-order-doesnt-throw-error.js @@ -1,14 +1,31 @@ Input:: //// [/lib/lib.d.ts] - +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; //// [/src/core/anotherModule.ts] +export const World = "hello"; //// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } //// [/src/core/some_decl.d.ts] +declare const dts: any; //// [/src/core/tsconfig.json] @@ -22,6 +39,12 @@ Input:: } //// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/logic/tsconfig.json] @@ -40,6 +63,14 @@ Input:: //// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/tests/tsconfig.json] @@ -58,9 +89,22 @@ Input:: } //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} diff --git a/tests/baselines/reference/tsbuild/sample1/building-using-buildReferencedProject.js b/tests/baselines/reference/tsbuild/sample1/building-using-buildReferencedProject.js index 8de42fea26f..92c7a931152 100644 --- a/tests/baselines/reference/tsbuild/sample1/building-using-buildReferencedProject.js +++ b/tests/baselines/reference/tsbuild/sample1/building-using-buildReferencedProject.js @@ -63,6 +63,14 @@ export const m = mod; //// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/tests/tsconfig.json] @@ -81,26 +89,39 @@ export const m = mod; } //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} Output:: /lib/tsc --build /src/logic2/tsconfig.json -[12:00:00 AM] Projects in this build: +[12:00:06 AM] Projects in this build: * src/core/tsconfig.json * src/logic/tsconfig.json -[12:00:00 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist +[12:00:07 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist -[12:00:00 AM] Building project '/src/core/tsconfig.json'... +[12:00:08 AM] Building project '/src/core/tsconfig.json'... -[12:00:00 AM] Project 'src/logic/tsconfig.json' is out of date because output file 'src/logic/index.js' does not exist +[12:00:17 AM] Project 'src/logic/tsconfig.json' is out of date because output file 'src/logic/index.js' does not exist -[12:00:00 AM] Building project '/src/logic/tsconfig.json'... +[12:00:18 AM] Building project '/src/logic/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/sample1/builds-correctly-when-declarationDir-is-specified.js b/tests/baselines/reference/tsbuild/sample1/builds-correctly-when-declarationDir-is-specified.js index ce16960e1dc..2666ba58507 100644 --- a/tests/baselines/reference/tsbuild/sample1/builds-correctly-when-declarationDir-is-specified.js +++ b/tests/baselines/reference/tsbuild/sample1/builds-correctly-when-declarationDir-is-specified.js @@ -77,9 +77,22 @@ export const m = mod; } //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} diff --git a/tests/baselines/reference/tsbuild/sample1/builds-correctly-when-outDir-is-specified.js b/tests/baselines/reference/tsbuild/sample1/builds-correctly-when-outDir-is-specified.js index 7dab4ac6b19..29b490c8712 100644 --- a/tests/baselines/reference/tsbuild/sample1/builds-correctly-when-outDir-is-specified.js +++ b/tests/baselines/reference/tsbuild/sample1/builds-correctly-when-outDir-is-specified.js @@ -77,9 +77,22 @@ export const m = mod; } //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} diff --git a/tests/baselines/reference/tsbuild/sample1/builds-correctly-when-project-is-not-composite-or-doesnt-have-any-references.js b/tests/baselines/reference/tsbuild/sample1/builds-correctly-when-project-is-not-composite-or-doesnt-have-any-references.js index bfb3843cfcc..1b3b0157672 100644 --- a/tests/baselines/reference/tsbuild/sample1/builds-correctly-when-project-is-not-composite-or-doesnt-have-any-references.js +++ b/tests/baselines/reference/tsbuild/sample1/builds-correctly-when-project-is-not-composite-or-doesnt-have-any-references.js @@ -39,33 +39,84 @@ declare const dts: any; } //// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} //// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/tests/tsconfig.json] - +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} Output:: /lib/tsc --b /src/core --verbose -[12:00:00 AM] Projects in this build: +[12:00:07 AM] Projects in this build: * src/core/tsconfig.json -[12:00:00 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist +[12:00:08 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist -[12:00:00 AM] Building project '/src/core/tsconfig.json'... +[12:00:09 AM] Building project '/src/core/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/sample1/builds-till-project-specified.js b/tests/baselines/reference/tsbuild/sample1/builds-till-project-specified.js index 5d97c7def04..4d661ecebce 100644 --- a/tests/baselines/reference/tsbuild/sample1/builds-till-project-specified.js +++ b/tests/baselines/reference/tsbuild/sample1/builds-till-project-specified.js @@ -63,6 +63,14 @@ export const m = mod; //// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/tests/tsconfig.json] @@ -81,9 +89,22 @@ export const m = mod; } //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} diff --git a/tests/baselines/reference/tsbuild/sample1/can-detect-when-and-what-to-rebuild.js b/tests/baselines/reference/tsbuild/sample1/can-detect-when-and-what-to-rebuild.js index e99d614d712..eeb8a8b0474 100644 --- a/tests/baselines/reference/tsbuild/sample1/can-detect-when-and-what-to-rebuild.js +++ b/tests/baselines/reference/tsbuild/sample1/can-detect-when-and-what-to-rebuild.js @@ -15,12 +15,17 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; //// [/src/core/anotherModule.d.ts] - +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map //// [/src/core/anotherModule.d.ts.map] - +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} //// [/src/core/anotherModule.js] +"use strict"; +exports.__esModule = true; +exports.World = void 0; +exports.World = "hello"; //// [/src/core/anotherModule.ts] @@ -34,9 +39,17 @@ export declare function multiply(a: number, b: number): number; //# sourceMappingURL=index.d.ts.map //// [/src/core/index.d.ts.map] - +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} //// [/src/core/index.js] +"use strict"; +exports.__esModule = true; +exports.multiply = exports.leftPad = exports.someString = void 0; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +exports.leftPad = leftPad; +function multiply(a, b) { return a * b; } +exports.multiply = multiply; //// [/src/core/index.ts] @@ -62,16 +75,83 @@ declare const dts: any; //// [/src/core/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +//// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-8396256275-export declare const World = \"hello\";\r\n" + }, + "./index.ts": { + "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n" + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1431 +} + //// [/src/logic/index.d.ts] +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; //// [/src/logic/index.js] - +"use strict"; +exports.__esModule = true; +exports.m = exports.getSecondsInDay = void 0; +var c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +exports.getSecondsInDay = getSecondsInDay; +var mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map //// [/src/logic/index.js.map] - +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} //// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/logic/tsconfig.json] @@ -92,15 +172,97 @@ declare const dts: any; //// [/src/logic/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +//// [/src/logic/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "./index.ts": { + "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1555 +} + //// [/src/tests/index.d.ts] import * as mod from '../core/anotherModule'; export declare const m: typeof mod; //// [/src/tests/index.js] +"use strict"; +exports.__esModule = true; +exports.m = void 0; +var c = require("../core/index"); +var logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +var mod = require("../core/anotherModule"); +exports.m = mod; //// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/tests/tsconfig.json] @@ -121,26 +283,117 @@ export declare const m: typeof mod; //// [/src/tests/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +//// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/anothermodule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "../logic/index.d.ts": { + "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1702 +} + //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} Output:: /lib/tsc --b /src/tests --verbose -[12:01:00 AM] Projects in this build: +[12:00:23 AM] Projects in this build: * src/core/tsconfig.json * src/logic/tsconfig.json * src/tests/tsconfig.json -[12:01:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js' +[12:00:24 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js' -[12:01:00 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js' +[12:00:25 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js.map' -[12:01:00 AM] Project 'src/tests/tsconfig.json' is up to date because newest input 'src/tests/index.ts' is older than oldest output 'src/tests/index.js' +[12:00:26 AM] Project 'src/tests/tsconfig.json' is up to date because newest input 'src/tests/index.ts' is older than oldest output 'src/tests/index.js' exitCode:: ExitStatus.Success @@ -156,18 +409,18 @@ const m = 10; Output:: /lib/tsc --b /src/tests --verbose -[12:04:00 AM] Projects in this build: +[12:00:28 AM] Projects in this build: * src/core/tsconfig.json * src/logic/tsconfig.json * src/tests/tsconfig.json -[12:04:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js' +[12:00:29 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js' -[12:04:00 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js' +[12:00:30 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js.map' -[12:04:00 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/tests/index.ts' +[12:00:31 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/tests/index.ts' -[12:04:00 AM] Building project '/src/tests/tsconfig.json'... +[12:00:32 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success @@ -232,24 +485,24 @@ export function multiply(a: number, b: number) { return a * b; } Output:: /lib/tsc --b /src/tests --verbose -[12:07:00 AM] Projects in this build: +[12:00:38 AM] Projects in this build: * src/core/tsconfig.json * src/logic/tsconfig.json * src/tests/tsconfig.json -[12:07:00 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/index.ts' +[12:00:39 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/index.ts' -[12:07:00 AM] Building project '/src/core/tsconfig.json'... +[12:00:40 AM] Building project '/src/core/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/core/tsconfig.json'... +[12:00:46 AM] Updating unchanged output timestamps of project '/src/core/tsconfig.json'... -[12:07:00 AM] Project 'src/logic/tsconfig.json' is up to date with .d.ts files from its dependencies +[12:00:51 AM] Project 'src/logic/tsconfig.json' is up to date with .d.ts files from its dependencies -[12:07:00 AM] Updating output timestamps of project '/src/logic/tsconfig.json'... +[12:00:53 AM] Updating output timestamps of project '/src/logic/tsconfig.json'... -[12:07:00 AM] Project 'src/tests/tsconfig.json' is up to date with .d.ts files from its dependencies +[12:00:58 AM] Project 'src/tests/tsconfig.json' is up to date with .d.ts files from its dependencies -[12:07:00 AM] Updating output timestamps of project '/src/tests/tsconfig.json'... +[12:01:00 AM] Updating output timestamps of project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success @@ -346,18 +599,18 @@ Input:: Output:: /lib/tsc --b /src/tests --verbose -[12:10:00 AM] Projects in this build: +[12:01:05 AM] Projects in this build: * src/core/tsconfig.json * src/logic/tsconfig.json * src/tests/tsconfig.json -[12:10:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/index.ts' is older than oldest output 'src/core/anotherModule.js' +[12:01:06 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/index.ts' is older than oldest output 'src/core/index.js' -[12:10:00 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js' +[12:01:07 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js' -[12:10:00 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/tests/tsconfig.json' +[12:01:08 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/tests/tsconfig.json' -[12:10:00 AM] Building project '/src/tests/tsconfig.json'... +[12:01:09 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/sample1/cleaning-project-in-not-build-order-doesnt-throw-error.js b/tests/baselines/reference/tsbuild/sample1/cleaning-project-in-not-build-order-doesnt-throw-error.js index b68bc0aba1c..fbce043a86c 100644 --- a/tests/baselines/reference/tsbuild/sample1/cleaning-project-in-not-build-order-doesnt-throw-error.js +++ b/tests/baselines/reference/tsbuild/sample1/cleaning-project-in-not-build-order-doesnt-throw-error.js @@ -1,77 +1,383 @@ Input:: //// [/lib/lib.d.ts] - +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; //// [/src/core/anotherModule.d.ts] - +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map //// [/src/core/anotherModule.d.ts.map] - +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} //// [/src/core/anotherModule.js] +"use strict"; +exports.__esModule = true; +exports.World = void 0; +exports.World = "hello"; //// [/src/core/anotherModule.ts] +export const World = "hello"; //// [/src/core/index.d.ts] - +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map //// [/src/core/index.d.ts.map] - +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} //// [/src/core/index.js] +"use strict"; +exports.__esModule = true; +exports.multiply = exports.leftPad = exports.someString = void 0; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +exports.leftPad = leftPad; +function multiply(a, b) { return a * b; } +exports.multiply = multiply; //// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } //// [/src/core/some_decl.d.ts] +declare const dts: any; //// [/src/core/tsconfig.json] - +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} //// [/src/core/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +//// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-8396256275-export declare const World = \"hello\";\r\n" + }, + "./index.ts": { + "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n" + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1431 +} //// [/src/logic/index.d.ts] +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; //// [/src/logic/index.js] - +"use strict"; +exports.__esModule = true; +exports.m = exports.getSecondsInDay = void 0; +var c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +exports.getSecondsInDay = getSecondsInDay; +var mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map //// [/src/logic/index.js.map] - +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} //// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} //// [/src/logic/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +//// [/src/logic/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "./index.ts": { + "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1555 +} //// [/src/tests/index.d.ts] +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; //// [/src/tests/index.js] +"use strict"; +exports.__esModule = true; +exports.m = void 0; +var c = require("../core/index"); +var logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +var mod = require("../core/anotherModule"); +exports.m = mod; //// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/tests/tsconfig.json] - +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} //// [/src/tests/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +//// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/anothermodule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "../logic/index.d.ts": { + "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1702 +} //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} diff --git a/tests/baselines/reference/tsbuild/sample1/cleans-till-project-specified.js b/tests/baselines/reference/tsbuild/sample1/cleans-till-project-specified.js index 45ca7a62468..7499c9141cd 100644 --- a/tests/baselines/reference/tsbuild/sample1/cleans-till-project-specified.js +++ b/tests/baselines/reference/tsbuild/sample1/cleans-till-project-specified.js @@ -1,77 +1,383 @@ Input:: //// [/lib/lib.d.ts] - +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; //// [/src/core/anotherModule.d.ts] - +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map //// [/src/core/anotherModule.d.ts.map] - +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} //// [/src/core/anotherModule.js] +"use strict"; +exports.__esModule = true; +exports.World = void 0; +exports.World = "hello"; //// [/src/core/anotherModule.ts] +export const World = "hello"; //// [/src/core/index.d.ts] - +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map //// [/src/core/index.d.ts.map] - +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} //// [/src/core/index.js] +"use strict"; +exports.__esModule = true; +exports.multiply = exports.leftPad = exports.someString = void 0; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +exports.leftPad = leftPad; +function multiply(a, b) { return a * b; } +exports.multiply = multiply; //// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } //// [/src/core/some_decl.d.ts] +declare const dts: any; //// [/src/core/tsconfig.json] - +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + } +} //// [/src/core/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +//// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-8396256275-export declare const World = \"hello\";\r\n" + }, + "./index.ts": { + "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n" + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1431 +} //// [/src/logic/index.d.ts] +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; //// [/src/logic/index.js] - +"use strict"; +exports.__esModule = true; +exports.m = exports.getSecondsInDay = void 0; +var c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +exports.getSecondsInDay = getSecondsInDay; +var mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map //// [/src/logic/index.js.map] - +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} //// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} //// [/src/logic/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +//// [/src/logic/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "./index.ts": { + "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1555 +} //// [/src/tests/index.d.ts] +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; //// [/src/tests/index.js] +"use strict"; +exports.__esModule = true; +exports.m = void 0; +var c = require("../core/index"); +var logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +var mod = require("../core/anotherModule"); +exports.m = mod; //// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/tests/tsconfig.json] - +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} //// [/src/tests/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +//// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/anothermodule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "../logic/index.d.ts": { + "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1702 +} //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} diff --git a/tests/baselines/reference/tsbuild/sample1/does-not-build-downstream-projects-if-upstream-projects-have-errors.js b/tests/baselines/reference/tsbuild/sample1/does-not-build-downstream-projects-if-upstream-projects-have-errors.js index d9cf8f1a96c..4e885be7d2d 100644 --- a/tests/baselines/reference/tsbuild/sample1/does-not-build-downstream-projects-if-upstream-projects-have-errors.js +++ b/tests/baselines/reference/tsbuild/sample1/does-not-build-downstream-projects-if-upstream-projects-have-errors.js @@ -63,6 +63,14 @@ export const m = mod; //// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/tests/tsconfig.json] @@ -81,36 +89,49 @@ export const m = mod; } //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} Output:: /lib/tsc --b /src/tests --verbose -[12:00:00 AM] Projects in this build: +[12:00:07 AM] Projects in this build: * src/core/tsconfig.json * src/logic/tsconfig.json * src/tests/tsconfig.json -[12:00:00 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist +[12:00:08 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist -[12:00:00 AM] Building project '/src/core/tsconfig.json'... +[12:00:09 AM] Building project '/src/core/tsconfig.json'... -[12:00:00 AM] Project 'src/logic/tsconfig.json' is out of date because output file 'src/logic/index.js' does not exist +[12:00:18 AM] Project 'src/logic/tsconfig.json' is out of date because output file 'src/logic/index.js' does not exist -[12:00:00 AM] Building project '/src/logic/tsconfig.json'... +[12:00:19 AM] Building project '/src/logic/tsconfig.json'... src/logic/index.ts:3:14 - error TS2339: Property 'muitply' does not exist on type 'typeof import("/src/core/index")'. 3 return c.muitply();    ~~~~~~~ -[12:00:00 AM] Project 'src/tests/tsconfig.json' can't be built because its dependency 'src/logic' has errors +[12:00:22 AM] Project 'src/tests/tsconfig.json' can't be built because its dependency 'src/logic' has errors -[12:00:00 AM] Skipping build of project '/src/tests/tsconfig.json' because its dependency '/src/logic' has errors +[12:00:23 AM] Skipping build of project '/src/tests/tsconfig.json' because its dependency '/src/logic' has errors Found 1 error. diff --git a/tests/baselines/reference/tsbuild/sample1/does-not-rebuild-if-there-is-no-program-and-bundle-in-the-ts-build-info-event-if-version-doesnt-match-ts-version.js b/tests/baselines/reference/tsbuild/sample1/does-not-rebuild-if-there-is-no-program-and-bundle-in-the-ts-build-info-event-if-version-doesnt-match-ts-version.js index 301ef4888dd..1294f8165a8 100644 --- a/tests/baselines/reference/tsbuild/sample1/does-not-rebuild-if-there-is-no-program-and-bundle-in-the-ts-build-info-event-if-version-doesnt-match-ts-version.js +++ b/tests/baselines/reference/tsbuild/sample1/does-not-rebuild-if-there-is-no-program-and-bundle-in-the-ts-build-info-event-if-version-doesnt-match-ts-version.js @@ -1,32 +1,65 @@ Input:: //// [/lib/lib.d.ts] - +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; //// [/src/core/anotherModule.d.ts] - +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map //// [/src/core/anotherModule.d.ts.map] - +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} //// [/src/core/anotherModule.js] +"use strict"; +exports.__esModule = true; +exports.World = void 0; +exports.World = "hello"; //// [/src/core/anotherModule.ts] +export const World = "hello"; //// [/src/core/index.d.ts] - +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map //// [/src/core/index.d.ts.map] - +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} //// [/src/core/index.js] +"use strict"; +exports.__esModule = true; +exports.multiply = exports.leftPad = exports.someString = void 0; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +exports.leftPad = leftPad; +function multiply(a, b) { return a * b; } +exports.multiply = multiply; //// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } //// [/src/core/some_decl.d.ts] +declare const dts: any; //// [/src/core/tsconfig.json] @@ -43,15 +76,34 @@ Input:: {"version":"FakeTSVersion"} //// [/src/logic/index.d.ts] +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; //// [/src/logic/index.js] - +"use strict"; +exports.__esModule = true; +exports.m = exports.getSecondsInDay = void 0; +var c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +exports.getSecondsInDay = getSecondsInDay; +var mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map //// [/src/logic/index.js.map] - +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} //// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/logic/tsconfig.json] @@ -73,12 +125,31 @@ Input:: {"version":"FakeTSVersion"} //// [/src/tests/index.d.ts] +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; //// [/src/tests/index.js] +"use strict"; +exports.__esModule = true; +exports.m = void 0; +var c = require("../core/index"); +var logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +var mod = require("../core/anotherModule"); +exports.m = mod; //// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/tests/tsconfig.json] @@ -100,25 +171,38 @@ Input:: {"version":"FakeTSVersion"} //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} Output:: /lib/tsc --b /src/tests --verbose -[12:00:00 AM] Projects in this build: +[12:00:20 AM] Projects in this build: * src/core/tsconfig.json * src/logic/tsconfig.json * src/tests/tsconfig.json -[12:00:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js' +[12:00:21 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js' -[12:00:00 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js' +[12:00:22 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js.map' -[12:00:00 AM] Project 'src/tests/tsconfig.json' is up to date because newest input 'src/tests/index.ts' is older than oldest output 'src/tests/index.js' +[12:00:23 AM] Project 'src/tests/tsconfig.json' is up to date because newest input 'src/tests/index.ts' is older than oldest output 'src/tests/index.js' exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/sample1/does-not-write-any-files-in-a-dry-build.js b/tests/baselines/reference/tsbuild/sample1/does-not-write-any-files-in-a-dry-build.js index b3d5781bcf8..9b45ce65331 100644 --- a/tests/baselines/reference/tsbuild/sample1/does-not-write-any-files-in-a-dry-build.js +++ b/tests/baselines/reference/tsbuild/sample1/does-not-write-any-files-in-a-dry-build.js @@ -1,14 +1,31 @@ Input:: //// [/lib/lib.d.ts] - +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; //// [/src/core/anotherModule.ts] +export const World = "hello"; //// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } //// [/src/core/some_decl.d.ts] +declare const dts: any; //// [/src/core/tsconfig.json] @@ -22,6 +39,12 @@ Input:: } //// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/logic/tsconfig.json] @@ -40,6 +63,14 @@ Input:: //// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/tests/tsconfig.json] @@ -58,20 +89,33 @@ Input:: } //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} Output:: /lib/tsc --b /src/tests --dry -[12:00:00 AM] A non-dry build would build project '/src/core/tsconfig.json' +[12:00:06 AM] A non-dry build would build project '/src/core/tsconfig.json' -[12:00:00 AM] A non-dry build would build project '/src/logic/tsconfig.json' +[12:00:07 AM] A non-dry build would build project '/src/logic/tsconfig.json' -[12:00:00 AM] A non-dry build would build project '/src/tests/tsconfig.json' +[12:00:08 AM] A non-dry build would build project '/src/tests/tsconfig.json' exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/sample1/explainFiles.js b/tests/baselines/reference/tsbuild/sample1/explainFiles.js index 1c64af2e293..d075688f2dd 100644 --- a/tests/baselines/reference/tsbuild/sample1/explainFiles.js +++ b/tests/baselines/reference/tsbuild/sample1/explainFiles.js @@ -89,23 +89,36 @@ export const m = mod; } //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} Output:: /lib/tsc --b /src/tests --explainFiles --v -[12:01:00 AM] Projects in this build: +[12:00:06 AM] Projects in this build: * src/core/tsconfig.json * src/logic/tsconfig.json * src/tests/tsconfig.json -[12:01:00 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist +[12:00:07 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist -[12:01:00 AM] Building project '/src/core/tsconfig.json'... +[12:00:08 AM] Building project '/src/core/tsconfig.json'... lib/lib.d.ts Default library for target 'es3' @@ -115,9 +128,9 @@ src/core/index.ts Matched by include pattern '**/*' in 'src/core/tsconfig.json' src/core/some_decl.d.ts Matched by include pattern '**/*' in 'src/core/tsconfig.json' -[12:01:00 AM] Project 'src/logic/tsconfig.json' is out of date because output file 'src/logic/index.js' does not exist +[12:00:17 AM] Project 'src/logic/tsconfig.json' is out of date because output file 'src/logic/index.js' does not exist -[12:01:00 AM] Building project '/src/logic/tsconfig.json'... +[12:00:18 AM] Building project '/src/logic/tsconfig.json'... lib/lib.d.ts Default library for target 'es3' @@ -129,9 +142,9 @@ src/core/anotherModule.d.ts File is output of project reference source 'src/core/anotherModule.ts' src/logic/index.ts Matched by include pattern '**/*' in 'src/logic/tsconfig.json' -[12:01:00 AM] Project 'src/tests/tsconfig.json' is out of date because output file 'src/tests/index.js' does not exist +[12:00:24 AM] Project 'src/tests/tsconfig.json' is out of date because output file 'src/tests/index.js' does not exist -[12:01:00 AM] Building project '/src/tests/tsconfig.json'... +[12:00:25 AM] Building project '/src/tests/tsconfig.json'... lib/lib.d.ts Default library for target 'es3' @@ -438,16 +451,16 @@ export class someClass { } Output:: /lib/tsc --b /src/tests --explainFiles --v -[12:04:00 AM] Projects in this build: +[12:00:31 AM] Projects in this build: * src/core/tsconfig.json * src/logic/tsconfig.json * src/tests/tsconfig.json -[12:04:00 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/index.ts' +[12:00:32 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/index.ts' -[12:04:00 AM] Building project '/src/core/tsconfig.json'... +[12:00:33 AM] Building project '/src/core/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/core/tsconfig.json'... +[12:00:39 AM] Updating unchanged output timestamps of project '/src/core/tsconfig.json'... lib/lib.d.ts Default library for target 'es3' @@ -457,9 +470,9 @@ src/core/index.ts Matched by include pattern '**/*' in 'src/core/tsconfig.json' src/core/some_decl.d.ts Matched by include pattern '**/*' in 'src/core/tsconfig.json' -[12:04:00 AM] Project 'src/logic/tsconfig.json' is out of date because oldest output 'src/logic/index.js' is older than newest input 'src/core' +[12:00:44 AM] Project 'src/logic/tsconfig.json' is out of date because oldest output 'src/logic/index.js.map' is older than newest input 'src/core' -[12:04:00 AM] Building project '/src/logic/tsconfig.json'... +[12:00:45 AM] Building project '/src/logic/tsconfig.json'... lib/lib.d.ts Default library for target 'es3' @@ -471,9 +484,9 @@ src/core/anotherModule.d.ts File is output of project reference source 'src/core/anotherModule.ts' src/logic/index.ts Matched by include pattern '**/*' in 'src/logic/tsconfig.json' -[12:04:00 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/core' +[12:00:51 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/core' -[12:04:00 AM] Building project '/src/tests/tsconfig.json'... +[12:00:52 AM] Building project '/src/tests/tsconfig.json'... lib/lib.d.ts Default library for target 'es3' @@ -742,16 +755,16 @@ class someClass2 { } Output:: /lib/tsc --b /src/tests --explainFiles --v -[12:07:00 AM] Projects in this build: +[12:00:58 AM] Projects in this build: * src/core/tsconfig.json * src/logic/tsconfig.json * src/tests/tsconfig.json -[12:07:00 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/index.ts' +[12:00:59 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/index.ts' -[12:07:00 AM] Building project '/src/core/tsconfig.json'... +[12:01:00 AM] Building project '/src/core/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/core/tsconfig.json'... +[12:01:06 AM] Updating unchanged output timestamps of project '/src/core/tsconfig.json'... lib/lib.d.ts Default library for target 'es3' @@ -761,13 +774,13 @@ src/core/index.ts Matched by include pattern '**/*' in 'src/core/tsconfig.json' src/core/some_decl.d.ts Matched by include pattern '**/*' in 'src/core/tsconfig.json' -[12:07:00 AM] Project 'src/logic/tsconfig.json' is up to date with .d.ts files from its dependencies +[12:01:11 AM] Project 'src/logic/tsconfig.json' is up to date with .d.ts files from its dependencies -[12:07:00 AM] Updating output timestamps of project '/src/logic/tsconfig.json'... +[12:01:13 AM] Updating output timestamps of project '/src/logic/tsconfig.json'... -[12:07:00 AM] Project 'src/tests/tsconfig.json' is up to date with .d.ts files from its dependencies +[12:01:18 AM] Project 'src/tests/tsconfig.json' is up to date with .d.ts files from its dependencies -[12:07:00 AM] Updating output timestamps of project '/src/tests/tsconfig.json'... +[12:01:20 AM] Updating output timestamps of project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/sample1/indicates-that-it-would-skip-builds-during-a-dry-build.js b/tests/baselines/reference/tsbuild/sample1/indicates-that-it-would-skip-builds-during-a-dry-build.js index 938e441dcb0..6d248452c79 100644 --- a/tests/baselines/reference/tsbuild/sample1/indicates-that-it-would-skip-builds-during-a-dry-build.js +++ b/tests/baselines/reference/tsbuild/sample1/indicates-that-it-would-skip-builds-during-a-dry-build.js @@ -1,32 +1,65 @@ Input:: //// [/lib/lib.d.ts] - +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; //// [/src/core/anotherModule.d.ts] - +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map //// [/src/core/anotherModule.d.ts.map] - +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} //// [/src/core/anotherModule.js] +"use strict"; +exports.__esModule = true; +exports.World = void 0; +exports.World = "hello"; //// [/src/core/anotherModule.ts] +export const World = "hello"; //// [/src/core/index.d.ts] - +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map //// [/src/core/index.d.ts.map] - +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} //// [/src/core/index.js] +"use strict"; +exports.__esModule = true; +exports.multiply = exports.leftPad = exports.someString = void 0; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +exports.leftPad = leftPad; +function multiply(a, b) { return a * b; } +exports.multiply = multiply; //// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } //// [/src/core/some_decl.d.ts] +declare const dts: any; //// [/src/core/tsconfig.json] @@ -42,16 +75,83 @@ Input:: //// [/src/core/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +//// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-8396256275-export declare const World = \"hello\";\r\n" + }, + "./index.ts": { + "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n" + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1431 +} + //// [/src/logic/index.d.ts] +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; //// [/src/logic/index.js] - +"use strict"; +exports.__esModule = true; +exports.m = exports.getSecondsInDay = void 0; +var c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +exports.getSecondsInDay = getSecondsInDay; +var mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map //// [/src/logic/index.js.map] - +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} //// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/logic/tsconfig.json] @@ -72,13 +172,97 @@ Input:: //// [/src/logic/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +//// [/src/logic/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "./index.ts": { + "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1555 +} + //// [/src/tests/index.d.ts] +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; //// [/src/tests/index.js] +"use strict"; +exports.__esModule = true; +exports.m = void 0; +var c = require("../core/index"); +var logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +var mod = require("../core/anotherModule"); +exports.m = mod; //// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/tests/tsconfig.json] @@ -99,21 +283,112 @@ Input:: //// [/src/tests/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +//// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/anothermodule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "../logic/index.d.ts": { + "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1702 +} + //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} Output:: /lib/tsc --b /src/tests --dry -[12:00:00 AM] Project '/src/core/tsconfig.json' is up to date +[12:00:23 AM] Project '/src/core/tsconfig.json' is up to date -[12:00:00 AM] Project '/src/logic/tsconfig.json' is up to date +[12:00:24 AM] Project '/src/logic/tsconfig.json' is up to date -[12:00:00 AM] Project '/src/tests/tsconfig.json' is up to date +[12:00:25 AM] Project '/src/tests/tsconfig.json' is up to date exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/sample1/listEmittedFiles.js b/tests/baselines/reference/tsbuild/sample1/listEmittedFiles.js index 50e5bc1c183..df09baa7642 100644 --- a/tests/baselines/reference/tsbuild/sample1/listEmittedFiles.js +++ b/tests/baselines/reference/tsbuild/sample1/listEmittedFiles.js @@ -89,9 +89,22 @@ export const m = mod; } //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} diff --git a/tests/baselines/reference/tsbuild/sample1/listFiles.js b/tests/baselines/reference/tsbuild/sample1/listFiles.js index f2f91806251..15474e1e566 100644 --- a/tests/baselines/reference/tsbuild/sample1/listFiles.js +++ b/tests/baselines/reference/tsbuild/sample1/listFiles.js @@ -89,9 +89,22 @@ export const m = mod; } //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} diff --git a/tests/baselines/reference/tsbuild/sample1/rebuilds-completely-when-version-in-tsbuildinfo-doesnt-match-ts-version.js b/tests/baselines/reference/tsbuild/sample1/rebuilds-completely-when-version-in-tsbuildinfo-doesnt-match-ts-version.js index 55dd400eb6b..9815aec4bd2 100644 --- a/tests/baselines/reference/tsbuild/sample1/rebuilds-completely-when-version-in-tsbuildinfo-doesnt-match-ts-version.js +++ b/tests/baselines/reference/tsbuild/sample1/rebuilds-completely-when-version-in-tsbuildinfo-doesnt-match-ts-version.js @@ -19,9 +19,13 @@ export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map //// [/src/core/anotherModule.d.ts.map] - +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} //// [/src/core/anotherModule.js] +"use strict"; +exports.__esModule = true; +exports.World = void 0; +exports.World = "hello"; //// [/src/core/anotherModule.ts] @@ -35,9 +39,17 @@ export declare function multiply(a: number, b: number): number; //# sourceMappingURL=index.d.ts.map //// [/src/core/index.d.ts.map] - +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} //// [/src/core/index.js] +"use strict"; +exports.__esModule = true; +exports.multiply = exports.leftPad = exports.someString = void 0; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +exports.leftPad = leftPad; +function multiply(a, b) { return a * b; } +exports.multiply = multiply; //// [/src/core/index.ts] @@ -63,6 +75,54 @@ declare const dts: any; //// [/src/core/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +//// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-8396256275-export declare const World = \"hello\";\r\n" + }, + "./index.ts": { + "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n" + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1431 +} + //// [/src/logic/index.d.ts] export declare function getSecondsInDay(): number; import * as mod from '../core/anotherModule'; @@ -70,10 +130,20 @@ export declare const m: typeof mod; //// [/src/logic/index.js] - +"use strict"; +exports.__esModule = true; +exports.m = exports.getSecondsInDay = void 0; +var c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +exports.getSecondsInDay = getSecondsInDay; +var mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map //// [/src/logic/index.js.map] - +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} //// [/src/logic/index.ts] import * as c from '../core/index'; @@ -102,12 +172,86 @@ export const m = mod; //// [/src/logic/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +//// [/src/logic/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "./index.ts": { + "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1555 +} + //// [/src/tests/index.d.ts] import * as mod from '../core/anotherModule'; export declare const m: typeof mod; //// [/src/tests/index.js] +"use strict"; +exports.__esModule = true; +exports.m = void 0; +var c = require("../core/index"); +var logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +var mod = require("../core/anotherModule"); +exports.m = mod; //// [/src/tests/index.ts] @@ -139,32 +283,123 @@ export const m = mod; //// [/src/tests/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +//// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/anothermodule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "../logic/index.d.ts": { + "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1702 +} + //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} Output:: /lib/tsc --b /src/tests --verbose -[12:00:00 AM] Projects in this build: +[12:00:23 AM] Projects in this build: * src/core/tsconfig.json * src/logic/tsconfig.json * src/tests/tsconfig.json -[12:00:00 AM] Project 'src/core/tsconfig.json' is out of date because output for it was generated with version 'FakeTSVersion' that differs with current version 'FakeTSCurrentVersion' +[12:00:24 AM] Project 'src/core/tsconfig.json' is out of date because output for it was generated with version 'FakeTSVersion' that differs with current version 'FakeTSCurrentVersion' -[12:00:00 AM] Building project '/src/core/tsconfig.json'... +[12:00:25 AM] Building project '/src/core/tsconfig.json'... -[12:00:00 AM] Project 'src/logic/tsconfig.json' is out of date because output for it was generated with version 'FakeTSVersion' that differs with current version 'FakeTSCurrentVersion' +[12:00:34 AM] Project 'src/logic/tsconfig.json' is out of date because output for it was generated with version 'FakeTSVersion' that differs with current version 'FakeTSCurrentVersion' -[12:00:00 AM] Building project '/src/logic/tsconfig.json'... +[12:00:35 AM] Building project '/src/logic/tsconfig.json'... -[12:00:00 AM] Project 'src/tests/tsconfig.json' is out of date because output for it was generated with version 'FakeTSVersion' that differs with current version 'FakeTSCurrentVersion' +[12:00:41 AM] Project 'src/tests/tsconfig.json' is out of date because output for it was generated with version 'FakeTSVersion' that differs with current version 'FakeTSCurrentVersion' -[12:00:00 AM] Building project '/src/tests/tsconfig.json'... +[12:00:42 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/sample1/rebuilds-from-start-if-force-option-is-set.js b/tests/baselines/reference/tsbuild/sample1/rebuilds-from-start-if-force-option-is-set.js index b109bf20143..3f96dc28c2d 100644 --- a/tests/baselines/reference/tsbuild/sample1/rebuilds-from-start-if-force-option-is-set.js +++ b/tests/baselines/reference/tsbuild/sample1/rebuilds-from-start-if-force-option-is-set.js @@ -19,9 +19,13 @@ export declare const World = "hello"; //# sourceMappingURL=anotherModule.d.ts.map //// [/src/core/anotherModule.d.ts.map] - +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} //// [/src/core/anotherModule.js] +"use strict"; +exports.__esModule = true; +exports.World = void 0; +exports.World = "hello"; //// [/src/core/anotherModule.ts] @@ -35,9 +39,17 @@ export declare function multiply(a: number, b: number): number; //# sourceMappingURL=index.d.ts.map //// [/src/core/index.d.ts.map] - +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} //// [/src/core/index.js] +"use strict"; +exports.__esModule = true; +exports.multiply = exports.leftPad = exports.someString = void 0; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +exports.leftPad = leftPad; +function multiply(a, b) { return a * b; } +exports.multiply = multiply; //// [/src/core/index.ts] @@ -61,121 +73,8 @@ declare const dts: any; } //// [/src/core/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} - -//// [/src/logic/index.d.ts] -export declare function getSecondsInDay(): number; -import * as mod from '../core/anotherModule'; -export declare const m: typeof mod; - - -//// [/src/logic/index.js] - - -//// [/src/logic/index.js.map] - - -//// [/src/logic/index.ts] -import * as c from '../core/index'; -export function getSecondsInDay() { - return c.multiply(10, 15); -} -import * as mod from '../core/anotherModule'; -export const m = mod; - - -//// [/src/logic/tsconfig.json] -{ - "compilerOptions": { - "composite": true, - "declaration": true, - "sourceMap": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true - }, - "references": [ - { "path": "../core" } - ] -} - - -//// [/src/logic/tsconfig.tsbuildinfo] - - -//// [/src/tests/index.d.ts] -import * as mod from '../core/anotherModule'; -export declare const m: typeof mod; - - -//// [/src/tests/index.js] - - -//// [/src/tests/index.ts] -import * as c from '../core/index'; -import * as logic from '../logic/index'; - -c.leftPad("", 10); -logic.getSecondsInDay(); - -import * as mod from '../core/anotherModule'; -export const m = mod; - - -//// [/src/tests/tsconfig.json] -{ - "references": [ - { "path": "../core" }, - { "path": "../logic" } - ], - "files": ["index.ts"], - "compilerOptions": { - "composite": true, - "declaration": true, - "forceConsistentCasingInFileNames": true, - "skipDefaultLibCheck": true - } -} - -//// [/src/tests/tsconfig.tsbuildinfo] - - -//// [/src/ui/index.ts] - - -//// [/src/ui/tsconfig.json] - - - - -Output:: -/lib/tsc --b /src/tests --verbose --force -[12:00:00 AM] Projects in this build: - * src/core/tsconfig.json - * src/logic/tsconfig.json - * src/tests/tsconfig.json - -[12:00:00 AM] Project 'src/core/tsconfig.json' is being forcibly rebuilt - -[12:00:00 AM] Building project '/src/core/tsconfig.json'... - -[12:00:00 AM] Project 'src/logic/tsconfig.json' is being forcibly rebuilt - -[12:00:00 AM] Building project '/src/logic/tsconfig.json'... - -[12:00:00 AM] Project 'src/tests/tsconfig.json' is being forcibly rebuilt - -[12:00:00 AM] Building project '/src/tests/tsconfig.json'... - -exitCode:: ExitStatus.Success - - -//// [/src/core/anotherModule.d.ts] file written with same contents -//// [/src/core/anotherModule.d.ts.map] file written with same contents -//// [/src/core/anotherModule.js] file written with same contents -//// [/src/core/index.d.ts] file written with same contents -//// [/src/core/index.d.ts.map] file written with same contents -//// [/src/core/index.js] file written with same contents -//// [/src/core/tsconfig.tsbuildinfo] file written with same contents //// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] { "program": { @@ -224,10 +123,55 @@ exitCode:: ExitStatus.Success "size": 1431 } -//// [/src/logic/index.d.ts] file written with same contents -//// [/src/logic/index.js] file written with same contents -//// [/src/logic/index.js.map] file written with same contents -//// [/src/logic/tsconfig.tsbuildinfo] file written with same contents +//// [/src/logic/index.d.ts] +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + + +//// [/src/logic/index.js] +"use strict"; +exports.__esModule = true; +exports.m = exports.getSecondsInDay = void 0; +var c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +exports.getSecondsInDay = getSecondsInDay; +var mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map + +//// [/src/logic/index.js.map] +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} + +//// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} + + +//// [/src/logic/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} + //// [/src/logic/tsconfig.tsbuildinfo.readable.baseline.txt] { "program": { @@ -293,9 +237,52 @@ exitCode:: ExitStatus.Success "size": 1555 } -//// [/src/tests/index.d.ts] file written with same contents -//// [/src/tests/index.js] file written with same contents -//// [/src/tests/tsconfig.tsbuildinfo] file written with same contents +//// [/src/tests/index.d.ts] +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; + + +//// [/src/tests/index.js] +"use strict"; +exports.__esModule = true; +exports.m = void 0; +var c = require("../core/index"); +var logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +var mod = require("../core/anotherModule"); +exports.m = mod; + + +//// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; + + +//// [/src/tests/tsconfig.json] +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} + +//// [/src/tests/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} + //// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt] { "program": { @@ -374,3 +361,63 @@ exitCode:: ExitStatus.Success "size": 1702 } +//// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} + + +//// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} + + + + +Output:: +/lib/tsc --b /src/tests --verbose --force +[12:00:23 AM] Projects in this build: + * src/core/tsconfig.json + * src/logic/tsconfig.json + * src/tests/tsconfig.json + +[12:00:24 AM] Project 'src/core/tsconfig.json' is being forcibly rebuilt + +[12:00:25 AM] Building project '/src/core/tsconfig.json'... + +[12:00:34 AM] Project 'src/logic/tsconfig.json' is being forcibly rebuilt + +[12:00:35 AM] Building project '/src/logic/tsconfig.json'... + +[12:00:41 AM] Project 'src/tests/tsconfig.json' is being forcibly rebuilt + +[12:00:42 AM] Building project '/src/tests/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/core/anotherModule.d.ts] file written with same contents +//// [/src/core/anotherModule.d.ts.map] file written with same contents +//// [/src/core/anotherModule.js] file written with same contents +//// [/src/core/index.d.ts] file written with same contents +//// [/src/core/index.d.ts.map] file written with same contents +//// [/src/core/index.js] file written with same contents +//// [/src/core/tsconfig.tsbuildinfo] file written with same contents +//// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/src/logic/index.d.ts] file written with same contents +//// [/src/logic/index.js] file written with same contents +//// [/src/logic/index.js.map] file written with same contents +//// [/src/logic/tsconfig.tsbuildinfo] file written with same contents +//// [/src/logic/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/src/tests/index.d.ts] file written with same contents +//// [/src/tests/index.js] file written with same contents +//// [/src/tests/tsconfig.tsbuildinfo] file written with same contents +//// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/sample1/rebuilds-when-extended-config-file-changes.js b/tests/baselines/reference/tsbuild/sample1/rebuilds-when-extended-config-file-changes.js index 00ee1f2746f..7f358a2228e 100644 --- a/tests/baselines/reference/tsbuild/sample1/rebuilds-when-extended-config-file-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/rebuilds-when-extended-config-file-changes.js @@ -92,31 +92,44 @@ export const m = mod; } //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} Output:: /lib/tsc --b /src/tests --verbose -[12:01:00 AM] Projects in this build: +[12:00:08 AM] Projects in this build: * src/core/tsconfig.json * src/logic/tsconfig.json * src/tests/tsconfig.json -[12:01:00 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist +[12:00:09 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist -[12:01:00 AM] Building project '/src/core/tsconfig.json'... +[12:00:10 AM] Building project '/src/core/tsconfig.json'... -[12:01:00 AM] Project 'src/logic/tsconfig.json' is out of date because output file 'src/logic/index.js' does not exist +[12:00:19 AM] Project 'src/logic/tsconfig.json' is out of date because output file 'src/logic/index.js' does not exist -[12:01:00 AM] Building project '/src/logic/tsconfig.json'... +[12:00:20 AM] Building project '/src/logic/tsconfig.json'... -[12:01:00 AM] Project 'src/tests/tsconfig.json' is out of date because output file 'src/tests/index.js' does not exist +[12:00:26 AM] Project 'src/tests/tsconfig.json' is out of date because output file 'src/tests/index.js' does not exist -[12:01:00 AM] Building project '/src/tests/tsconfig.json'... +[12:00:27 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success @@ -406,18 +419,18 @@ Input:: Output:: /lib/tsc --b /src/tests --verbose -[12:04:00 AM] Projects in this build: +[12:00:33 AM] Projects in this build: * src/core/tsconfig.json * src/logic/tsconfig.json * src/tests/tsconfig.json -[12:04:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js' +[12:00:34 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js' -[12:04:00 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js' +[12:00:35 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js.map' -[12:04:00 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/tests/tsconfig.base.json' +[12:00:36 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/tests/tsconfig.base.json' -[12:04:00 AM] Building project '/src/tests/tsconfig.json'... +[12:00:37 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/sample1/removes-all-files-it-built.js b/tests/baselines/reference/tsbuild/sample1/removes-all-files-it-built.js index 4c29fd36810..e1550c07946 100644 --- a/tests/baselines/reference/tsbuild/sample1/removes-all-files-it-built.js +++ b/tests/baselines/reference/tsbuild/sample1/removes-all-files-it-built.js @@ -1,32 +1,65 @@ Input:: //// [/lib/lib.d.ts] - +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; //// [/src/core/anotherModule.d.ts] - +export declare const World = "hello"; +//# sourceMappingURL=anotherModule.d.ts.map //// [/src/core/anotherModule.d.ts.map] - +{"version":3,"file":"anotherModule.d.ts","sourceRoot":"","sources":["anotherModule.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"} //// [/src/core/anotherModule.js] +"use strict"; +exports.__esModule = true; +exports.World = void 0; +exports.World = "hello"; //// [/src/core/anotherModule.ts] +export const World = "hello"; //// [/src/core/index.d.ts] - +export declare const someString: string; +export declare function leftPad(s: string, n: number): string; +export declare function multiply(a: number, b: number): number; +//# sourceMappingURL=index.d.ts.map //// [/src/core/index.d.ts.map] - +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAsB,CAAC;AAChD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB;AAC/D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAAmB"} //// [/src/core/index.js] +"use strict"; +exports.__esModule = true; +exports.multiply = exports.leftPad = exports.someString = void 0; +exports.someString = "HELLO WORLD"; +function leftPad(s, n) { return s + n; } +exports.leftPad = leftPad; +function multiply(a, b) { return a * b; } +exports.multiply = multiply; //// [/src/core/index.ts] +export const someString: string = "HELLO WORLD"; +export function leftPad(s: string, n: number) { return s + n; } +export function multiply(a: number, b: number) { return a * b; } //// [/src/core/some_decl.d.ts] +declare const dts: any; //// [/src/core/tsconfig.json] @@ -40,18 +73,85 @@ Input:: } //// [/src/core/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-8396256275-export declare const World = \"hello\";\r\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +//// [/src/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-8396256275-export declare const World = \"hello\";\r\n" + }, + "./index.ts": { + "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", + "signature": "1874987148-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n" + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1431 +} //// [/src/logic/index.d.ts] +export declare function getSecondsInDay(): number; +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; //// [/src/logic/index.js] - +"use strict"; +exports.__esModule = true; +exports.m = exports.getSecondsInDay = void 0; +var c = require("../core/index"); +function getSecondsInDay() { + return c.multiply(10, 15); +} +exports.getSecondsInDay = getSecondsInDay; +var mod = require("../core/anotherModule"); +exports.m = mod; +//# sourceMappingURL=index.js.map //// [/src/logic/index.js.map] - +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} //// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/logic/tsconfig.json] @@ -70,15 +170,99 @@ Input:: //// [/src/logic/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +//// [/src/logic/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "./index.ts": { + "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1555 +} //// [/src/tests/index.d.ts] +import * as mod from '../core/anotherModule'; +export declare const m: typeof mod; //// [/src/tests/index.js] +"use strict"; +exports.__esModule = true; +exports.m = void 0; +var c = require("../core/index"); +var logic = require("../logic/index"); +c.leftPad("", 10); +logic.getSecondsInDay(); +var mod = require("../core/anotherModule"); +exports.m = mod; //// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/tests/tsconfig.json] @@ -97,12 +281,103 @@ Input:: } //// [/src/tests/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map","7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map","-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +//// [/src/tests/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/anothermodule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map", + "signature": "-13851440507-export declare const someString: string;\r\nexport declare function leftPad(s: string, n: number): string;\r\nexport declare function multiply(a: number, b: number): number;\r\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "7652028357-export declare const World = \"hello\";\r\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "../logic/index.d.ts": { + "version": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n", + "signature": "-6548680073-export declare function getSecondsInDay(): number;\r\nimport * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-9209611-import * as mod from '../core/anotherModule';\r\nexport declare const m: typeof mod;\r\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1702 +} //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} diff --git a/tests/baselines/reference/tsbuild/sample1/sample.js b/tests/baselines/reference/tsbuild/sample1/sample.js index 0b5f5903359..056af692914 100644 --- a/tests/baselines/reference/tsbuild/sample1/sample.js +++ b/tests/baselines/reference/tsbuild/sample1/sample.js @@ -89,31 +89,44 @@ export const m = mod; } //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} Output:: /lib/tsc --b /src/tests --verbose -[12:01:00 AM] Projects in this build: +[12:00:06 AM] Projects in this build: * src/core/tsconfig.json * src/logic/tsconfig.json * src/tests/tsconfig.json -[12:01:00 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist +[12:00:07 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist -[12:01:00 AM] Building project '/src/core/tsconfig.json'... +[12:00:08 AM] Building project '/src/core/tsconfig.json'... -[12:01:00 AM] Project 'src/logic/tsconfig.json' is out of date because output file 'src/logic/index.js' does not exist +[12:00:17 AM] Project 'src/logic/tsconfig.json' is out of date because output file 'src/logic/index.js' does not exist -[12:01:00 AM] Building project '/src/logic/tsconfig.json'... +[12:00:18 AM] Building project '/src/logic/tsconfig.json'... -[12:01:00 AM] Project 'src/tests/tsconfig.json' is out of date because output file 'src/tests/index.js' does not exist +[12:00:24 AM] Project 'src/tests/tsconfig.json' is out of date because output file 'src/tests/index.js' does not exist -[12:01:00 AM] Building project '/src/tests/tsconfig.json'... +[12:00:25 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -696,24 +709,24 @@ export class someClass { } Output:: /lib/tsc --b /src/tests --verbose -[12:04:00 AM] Projects in this build: +[12:00:34 AM] Projects in this build: * src/core/tsconfig.json * src/logic/tsconfig.json * src/tests/tsconfig.json -[12:04:00 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/index.ts' +[12:00:35 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/index.ts' -[12:04:00 AM] Building project '/src/core/tsconfig.json'... +[12:00:36 AM] Building project '/src/core/tsconfig.json'... -[12:04:00 AM] Updating unchanged output timestamps of project '/src/core/tsconfig.json'... +[12:00:42 AM] Updating unchanged output timestamps of project '/src/core/tsconfig.json'... -[12:04:00 AM] Project 'src/logic/tsconfig.json' is out of date because oldest output 'src/logic/index.js' is older than newest input 'src/core' +[12:00:47 AM] Project 'src/logic/tsconfig.json' is out of date because oldest output 'src/logic/index.js.map' is older than newest input 'src/core' -[12:04:00 AM] Building project '/src/logic/tsconfig.json'... +[12:00:48 AM] Building project '/src/logic/tsconfig.json'... -[12:04:00 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/core' +[12:00:54 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/core' -[12:04:00 AM] Building project '/src/tests/tsconfig.json'... +[12:00:55 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -1120,24 +1133,24 @@ class someClass2 { } Output:: /lib/tsc --b /src/tests --verbose -[12:07:00 AM] Projects in this build: +[12:01:03 AM] Projects in this build: * src/core/tsconfig.json * src/logic/tsconfig.json * src/tests/tsconfig.json -[12:07:00 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/index.ts' +[12:01:04 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/index.ts' -[12:07:00 AM] Building project '/src/core/tsconfig.json'... +[12:01:05 AM] Building project '/src/core/tsconfig.json'... -[12:07:00 AM] Updating unchanged output timestamps of project '/src/core/tsconfig.json'... +[12:01:11 AM] Updating unchanged output timestamps of project '/src/core/tsconfig.json'... -[12:07:00 AM] Project 'src/logic/tsconfig.json' is up to date with .d.ts files from its dependencies +[12:01:16 AM] Project 'src/logic/tsconfig.json' is up to date with .d.ts files from its dependencies -[12:07:00 AM] Updating output timestamps of project '/src/logic/tsconfig.json'... +[12:01:18 AM] Updating output timestamps of project '/src/logic/tsconfig.json'... -[12:07:00 AM] Project 'src/tests/tsconfig.json' is up to date with .d.ts files from its dependencies +[12:01:23 AM] Project 'src/tests/tsconfig.json' is up to date with .d.ts files from its dependencies -[12:07:00 AM] Updating output timestamps of project '/src/tests/tsconfig.json'... +[12:01:25 AM] Updating output timestamps of project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -1257,20 +1270,20 @@ Input:: Output:: /lib/tsc --b /src/tests --verbose -[12:10:00 AM] Projects in this build: +[12:01:31 AM] Projects in this build: * src/core/tsconfig.json * src/logic/tsconfig.json * src/tests/tsconfig.json -[12:10:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/index.ts' is older than oldest output 'src/core/anotherModule.js' +[12:01:32 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/index.ts' is older than oldest output 'src/core/index.js' -[12:10:00 AM] Project 'src/logic/tsconfig.json' is out of date because output file 'src/logic/decls/index.d.ts' does not exist +[12:01:33 AM] Project 'src/logic/tsconfig.json' is out of date because output file 'src/logic/decls/index.d.ts' does not exist -[12:10:00 AM] Building project '/src/logic/tsconfig.json'... +[12:01:34 AM] Building project '/src/logic/tsconfig.json'... -[12:10:00 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/logic' +[12:01:41 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/logic' -[12:10:00 AM] Building project '/src/tests/tsconfig.json'... +[12:01:42 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { @@ -1457,16 +1470,16 @@ Input:: Output:: /lib/tsc --b /src/tests --verbose -[12:13:00 AM] Projects in this build: +[12:01:48 AM] Projects in this build: * src/core/tsconfig.json * src/logic/tsconfig.json * src/tests/tsconfig.json -[12:13:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/index.ts' is older than oldest output 'src/core/anotherModule.js' +[12:01:49 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/index.ts' is older than oldest output 'src/core/index.js' -[12:13:00 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js' +[12:01:50 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js.map' -[12:13:00 AM] Project 'src/tests/tsconfig.json' is up to date because newest input 'src/tests/index.ts' is older than oldest output 'src/tests/index.js' +[12:01:51 AM] Project 'src/tests/tsconfig.json' is up to date because newest input 'src/tests/index.ts' is older than oldest output 'src/tests/index.js' exitCode:: ExitStatus.Success readFiles:: { diff --git a/tests/baselines/reference/tsbuild/sample1/when-declaration-option-changes.js b/tests/baselines/reference/tsbuild/sample1/when-declaration-option-changes.js index 2fd93809fb8..8cbc1cb6170 100644 --- a/tests/baselines/reference/tsbuild/sample1/when-declaration-option-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/when-declaration-option-changes.js @@ -37,33 +37,84 @@ declare const dts: any; } //// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} //// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/tests/tsconfig.json] - +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} Output:: /lib/tsc --b /src/core --verbose -[12:01:00 AM] Projects in this build: +[12:00:07 AM] Projects in this build: * src/core/tsconfig.json -[12:01:00 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist +[12:00:08 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist -[12:01:00 AM] Building project '/src/core/tsconfig.json'... +[12:00:09 AM] Building project '/src/core/tsconfig.json'... exitCode:: ExitStatus.Success @@ -150,12 +201,12 @@ Input:: Output:: /lib/tsc --b /src/core --verbose -[12:04:00 AM] Projects in this build: +[12:00:15 AM] Projects in this build: * src/core/tsconfig.json -[12:04:00 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.d.ts' does not exist +[12:00:16 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.d.ts' does not exist -[12:04:00 AM] Building project '/src/core/tsconfig.json'... +[12:00:17 AM] Building project '/src/core/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/sample1/when-esModuleInterop-option-changes.js b/tests/baselines/reference/tsbuild/sample1/when-esModuleInterop-option-changes.js index ee22c842dce..8d12675ce94 100644 --- a/tests/baselines/reference/tsbuild/sample1/when-esModuleInterop-option-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/when-esModuleInterop-option-changes.js @@ -90,31 +90,44 @@ export const m = mod; } //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} Output:: /lib/tsc --b /src/tests --verbose -[12:01:00 AM] Projects in this build: +[12:00:07 AM] Projects in this build: * src/core/tsconfig.json * src/logic/tsconfig.json * src/tests/tsconfig.json -[12:01:00 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist +[12:00:08 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist -[12:01:00 AM] Building project '/src/core/tsconfig.json'... +[12:00:09 AM] Building project '/src/core/tsconfig.json'... -[12:01:00 AM] Project 'src/logic/tsconfig.json' is out of date because output file 'src/logic/index.js' does not exist +[12:00:18 AM] Project 'src/logic/tsconfig.json' is out of date because output file 'src/logic/index.js' does not exist -[12:01:00 AM] Building project '/src/logic/tsconfig.json'... +[12:00:19 AM] Building project '/src/logic/tsconfig.json'... -[12:01:00 AM] Project 'src/tests/tsconfig.json' is out of date because output file 'src/tests/index.js' does not exist +[12:00:25 AM] Project 'src/tests/tsconfig.json' is out of date because output file 'src/tests/index.js' does not exist -[12:01:00 AM] Building project '/src/tests/tsconfig.json'... +[12:00:26 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success @@ -417,18 +430,18 @@ Input:: Output:: /lib/tsc --b /src/tests --verbose -[12:04:00 AM] Projects in this build: +[12:00:32 AM] Projects in this build: * src/core/tsconfig.json * src/logic/tsconfig.json * src/tests/tsconfig.json -[12:04:00 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js' +[12:00:33 AM] Project 'src/core/tsconfig.json' is up to date because newest input 'src/core/anotherModule.ts' is older than oldest output 'src/core/anotherModule.js' -[12:04:00 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js' +[12:00:34 AM] Project 'src/logic/tsconfig.json' is up to date because newest input 'src/logic/index.ts' is older than oldest output 'src/logic/index.js.map' -[12:04:00 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/tests/tsconfig.json' +[12:00:35 AM] Project 'src/tests/tsconfig.json' is out of date because oldest output 'src/tests/index.js' is older than newest input 'src/tests/tsconfig.json' -[12:04:00 AM] Building project '/src/tests/tsconfig.json'... +[12:00:36 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/sample1/when-logic-specifies-tsBuildInfoFile.js b/tests/baselines/reference/tsbuild/sample1/when-logic-specifies-tsBuildInfoFile.js index 4e1302fdbbb..ce034e806bb 100644 --- a/tests/baselines/reference/tsbuild/sample1/when-logic-specifies-tsBuildInfoFile.js +++ b/tests/baselines/reference/tsbuild/sample1/when-logic-specifies-tsBuildInfoFile.js @@ -90,31 +90,44 @@ export const m = mod; } //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} Output:: /lib/tsc --b /src/tests --verbose -[12:00:00 AM] Projects in this build: +[12:00:07 AM] Projects in this build: * src/core/tsconfig.json * src/logic/tsconfig.json * src/tests/tsconfig.json -[12:00:00 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist +[12:00:08 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist -[12:00:00 AM] Building project '/src/core/tsconfig.json'... +[12:00:09 AM] Building project '/src/core/tsconfig.json'... -[12:00:00 AM] Project 'src/logic/tsconfig.json' is out of date because output file 'src/logic/index.js' does not exist +[12:00:18 AM] Project 'src/logic/tsconfig.json' is out of date because output file 'src/logic/index.js' does not exist -[12:00:00 AM] Building project '/src/logic/tsconfig.json'... +[12:00:19 AM] Building project '/src/logic/tsconfig.json'... -[12:00:00 AM] Project 'src/tests/tsconfig.json' is out of date because output file 'src/tests/index.js' does not exist +[12:00:25 AM] Project 'src/tests/tsconfig.json' is out of date because output file 'src/tests/index.js' does not exist -[12:00:00 AM] Building project '/src/tests/tsconfig.json'... +[12:00:26 AM] Building project '/src/tests/tsconfig.json'... exitCode:: ExitStatus.Success readFiles:: { diff --git a/tests/baselines/reference/tsbuild/sample1/when-module-option-changes.js b/tests/baselines/reference/tsbuild/sample1/when-module-option-changes.js index 3c2e06d97f5..a7ff8600d95 100644 --- a/tests/baselines/reference/tsbuild/sample1/when-module-option-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/when-module-option-changes.js @@ -37,33 +37,84 @@ declare const dts: any; } //// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} //// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/tests/tsconfig.json] - +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} Output:: /lib/tsc --b /src/core --verbose -[12:01:00 AM] Projects in this build: +[12:00:07 AM] Projects in this build: * src/core/tsconfig.json -[12:01:00 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist +[12:00:08 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist -[12:01:00 AM] Building project '/src/core/tsconfig.json'... +[12:00:09 AM] Building project '/src/core/tsconfig.json'... exitCode:: ExitStatus.Success @@ -150,12 +201,12 @@ Input:: Output:: /lib/tsc --b /src/core --verbose -[12:04:00 AM] Projects in this build: +[12:00:15 AM] Projects in this build: * src/core/tsconfig.json -[12:04:00 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/tsconfig.json' +[12:00:16 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/tsconfig.json' -[12:04:00 AM] Building project '/src/core/tsconfig.json'... +[12:00:17 AM] Building project '/src/core/tsconfig.json'... exitCode:: ExitStatus.Success diff --git a/tests/baselines/reference/tsbuild/sample1/when-target-option-changes.js b/tests/baselines/reference/tsbuild/sample1/when-target-option-changes.js index 70b3f9fd2ab..fc6789357bc 100644 --- a/tests/baselines/reference/tsbuild/sample1/when-target-option-changes.js +++ b/tests/baselines/reference/tsbuild/sample1/when-target-option-changes.js @@ -47,33 +47,84 @@ declare const dts: any; } //// [/src/logic/index.ts] +import * as c from '../core/index'; +export function getSecondsInDay() { + return c.multiply(10, 15); +} +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/logic/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "sourceMap": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../core" } + ] +} //// [/src/tests/index.ts] +import * as c from '../core/index'; +import * as logic from '../logic/index'; + +c.leftPad("", 10); +logic.getSecondsInDay(); + +import * as mod from '../core/anotherModule'; +export const m = mod; //// [/src/tests/tsconfig.json] - +{ + "references": [ + { "path": "../core" }, + { "path": "../logic" } + ], + "files": ["index.ts"], + "compilerOptions": { + "composite": true, + "declaration": true, + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true + } +} //// [/src/ui/index.ts] +import * as logic from '../logic'; + +export function run() { + console.log(logic.getSecondsInDay()); +} //// [/src/ui/tsconfig.json] +{ + "compilerOptions": { + "skipDefaultLibCheck": true + }, + "references": [ + { "path": "../logic/index" } + ] +} Output:: /lib/tsc --b /src/core --verbose -[12:01:00 AM] Projects in this build: +[12:00:10 AM] Projects in this build: * src/core/tsconfig.json -[12:01:00 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist +[12:00:11 AM] Project 'src/core/tsconfig.json' is out of date because output file 'src/core/anotherModule.js' does not exist -[12:01:00 AM] Building project '/src/core/tsconfig.json'... +[12:00:12 AM] Building project '/src/core/tsconfig.json'... TSFILE: /src/core/anotherModule.js TSFILE: /src/core/index.js @@ -168,12 +219,12 @@ Input:: Output:: /lib/tsc --b /src/core --verbose -[12:04:00 AM] Projects in this build: +[12:00:18 AM] Projects in this build: * src/core/tsconfig.json -[12:04:00 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/tsconfig.json' +[12:00:19 AM] Project 'src/core/tsconfig.json' is out of date because oldest output 'src/core/anotherModule.js' is older than newest input 'src/core/tsconfig.json' -[12:04:00 AM] Building project '/src/core/tsconfig.json'... +[12:00:20 AM] Building project '/src/core/tsconfig.json'... TSFILE: /src/core/anotherModule.js TSFILE: /src/core/index.js diff --git a/tests/baselines/reference/tsbuild/transitiveReferences/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js b/tests/baselines/reference/tsbuild/transitiveReferences/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js index 58644187d90..5be12342377 100644 --- a/tests/baselines/reference/tsbuild/transitiveReferences/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js +++ b/tests/baselines/reference/tsbuild/transitiveReferences/reports-error-about-module-not-found-with-node-resolution-with-external-module-name.js @@ -23,9 +23,14 @@ import {A} from 'a'; export const b = new A(); //// [/src/c.ts] - +import {b} from './b'; +import {X} from "@ref/a"; +b; +X; //// [/src/refs/a.d.ts] +export class X {} +export class A {} //// [/src/tsconfig.a.json] diff --git a/tests/baselines/reference/tsc/incremental/ts-file-with-no-default-lib-that-augments-the-global-scope.js b/tests/baselines/reference/tsc/incremental/ts-file-with-no-default-lib-that-augments-the-global-scope.js index 0ae751e9f56..373c93ef276 100644 --- a/tests/baselines/reference/tsc/incremental/ts-file-with-no-default-lib-that-augments-the-global-scope.js +++ b/tests/baselines/reference/tsc/incremental/ts-file-with-no-default-lib-that-augments-the-global-scope.js @@ -1,6 +1,18 @@ Input:: //// [/lib/lib.d.ts] - +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; //// [/lib/lib.esnext.d.ts] /// diff --git a/tests/baselines/reference/tsc/incremental/when-new-file-is-added-to-the-referenced-project.js b/tests/baselines/reference/tsc/incremental/when-new-file-is-added-to-the-referenced-project.js index a2f07bbd5ce..0c1569a5bb7 100644 --- a/tests/baselines/reference/tsc/incremental/when-new-file-is-added-to-the-referenced-project.js +++ b/tests/baselines/reference/tsc/incremental/when-new-file-is-added-to-the-referenced-project.js @@ -18,7 +18,7 @@ declare const console: { log(msg: any): void; }; declare class class1 {} //// [/src/projects/project1/class1.ts] - +class class1 {} //// [/src/projects/project1/tsconfig.json] {"compilerOptions":{"module":"none","composite":true},"exclude":["temp"]} diff --git a/tests/baselines/reference/tsc/listFilesOnly/combined-with-watch.js b/tests/baselines/reference/tsc/listFilesOnly/combined-with-watch.js index 682f7082326..7447094744f 100644 --- a/tests/baselines/reference/tsc/listFilesOnly/combined-with-watch.js +++ b/tests/baselines/reference/tsc/listFilesOnly/combined-with-watch.js @@ -1,9 +1,21 @@ Input:: //// [/lib/lib.d.ts] - +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; //// [/src/test.ts] - +export const x = 1; diff --git a/tests/baselines/reference/tsc/projectReferences/when-project-references-composite-project-with-noEmit.js b/tests/baselines/reference/tsc/projectReferences/when-project-references-composite-project-with-noEmit.js index 567d039c7df..76a9491ccae 100644 --- a/tests/baselines/reference/tsc/projectReferences/when-project-references-composite-project-with-noEmit.js +++ b/tests/baselines/reference/tsc/projectReferences/when-project-references-composite-project-with-noEmit.js @@ -21,7 +21,7 @@ import { x } from "../utils"; {"references":[{"path":"../utils"}]} //// [/src/utils/index.ts] - +export const x = 10; //// [/src/utils/tsconfig.json] {"compilerOptions":{"composite":true,"noEmit":true}} diff --git a/tests/baselines/reference/tsc/react-jsx-emit-mode/with-no-backing-types-found-doesn't-crash-under---strict.js b/tests/baselines/reference/tsc/react-jsx-emit-mode/with-no-backing-types-found-doesn't-crash-under---strict.js index 5c280d6f8f1..21bbb86b255 100644 --- a/tests/baselines/reference/tsc/react-jsx-emit-mode/with-no-backing-types-found-doesn't-crash-under---strict.js +++ b/tests/baselines/reference/tsc/react-jsx-emit-mode/with-no-backing-types-found-doesn't-crash-under---strict.js @@ -29,7 +29,7 @@ declare global { } //// [/src/project/node_modules/react/jsx-runtime.js] - +export {} //// [/src/project/src/index.tsx] export const App = () =>
; diff --git a/tests/baselines/reference/tsc/react-jsx-emit-mode/with-no-backing-types-found-doesn't-crash.js b/tests/baselines/reference/tsc/react-jsx-emit-mode/with-no-backing-types-found-doesn't-crash.js index d1d33bd22eb..6e1a2c87c4a 100644 --- a/tests/baselines/reference/tsc/react-jsx-emit-mode/with-no-backing-types-found-doesn't-crash.js +++ b/tests/baselines/reference/tsc/react-jsx-emit-mode/with-no-backing-types-found-doesn't-crash.js @@ -29,7 +29,7 @@ declare global { } //// [/src/project/node_modules/react/jsx-runtime.js] - +export {} //// [/src/project/src/index.tsx] export const App = () =>
; diff --git a/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js b/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js index 0787913fab7..e9634479566 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js @@ -1,6 +1,18 @@ Input:: //// [/lib/lib.d.ts] - +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; diff --git a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js index 1cedf139366..50b1c2f7ed7 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js @@ -1,6 +1,18 @@ Input:: //// [/lib/lib.d.ts] - +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; diff --git a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js index 1cedf139366..50b1c2f7ed7 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js @@ -1,6 +1,18 @@ Input:: //// [/lib/lib.d.ts] - +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; From 7abdb9e7efdf14ebbb94597bdd279b66a7968a99 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Thu, 21 Apr 2022 13:40:14 -0700 Subject: [PATCH 11/63] Format completion snippet text before escaping (#48793) * Format snippet text before escaping * Reset `escapes` before printing so printer can be reused --- src/services/completions.ts | 50 +++++++++++++++---- .../fourslash/completionsOverridingMethod2.ts | 23 ++++++++- 2 files changed, 63 insertions(+), 10 deletions(-) diff --git a/src/services/completions.ts b/src/services/completions.ts index 1f1007f2f61..42821f5dccc 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -1199,18 +1199,19 @@ namespace ts.Completions { function createSnippetPrinter( printerOptions: PrinterOptions, ) { + let escapes: TextChange[] | undefined; const baseWriter = textChanges.createWriter(getNewLineCharacter(printerOptions)); const printer = createPrinter(printerOptions, baseWriter); const writer: EmitTextWriter = { ...baseWriter, - write: s => baseWriter.write(escapeSnippetText(s)), + write: s => escapingWrite(s, () => baseWriter.write(s)), nonEscapingWrite: baseWriter.write, - writeLiteral: s => baseWriter.writeLiteral(escapeSnippetText(s)), - writeStringLiteral: s => baseWriter.writeStringLiteral(escapeSnippetText(s)), - writeSymbol: (s, symbol) => baseWriter.writeSymbol(escapeSnippetText(s), symbol), - writeParameter: s => baseWriter.writeParameter(escapeSnippetText(s)), - writeComment: s => baseWriter.writeComment(escapeSnippetText(s)), - writeProperty: s => baseWriter.writeProperty(escapeSnippetText(s)), + writeLiteral: s => escapingWrite(s, () => baseWriter.writeLiteral(s)), + writeStringLiteral: s => escapingWrite(s, () => baseWriter.writeStringLiteral(s)), + writeSymbol: (s, symbol) => escapingWrite(s, () => baseWriter.writeSymbol(s, symbol)), + writeParameter: s => escapingWrite(s, () => baseWriter.writeParameter(s)), + writeComment: s => escapingWrite(s, () => baseWriter.writeComment(s)), + writeProperty: s => escapingWrite(s, () => baseWriter.writeProperty(s)), }; return { @@ -1218,12 +1219,39 @@ namespace ts.Completions { printAndFormatSnippetList, }; + // The formatter/scanner will have issues with snippet-escaped text, + // so instead of writing the escaped text directly to the writer, + // generate a set of changes that can be applied to the unescaped text + // to escape it post-formatting. + function escapingWrite(s: string, write: () => void) { + const escaped = escapeSnippetText(s); + if (escaped !== s) { + const start = baseWriter.getTextPos(); + write(); + const end = baseWriter.getTextPos(); + escapes = append(escapes ||= [], { newText: escaped, span: { start, length: end - start } }); + } + else { + write(); + } + } + /* Snippet-escaping version of `printer.printList`. */ function printSnippetList( format: ListFormat, list: NodeArray, sourceFile: SourceFile | undefined, ): string { + const unescaped = printUnescapedSnippetList(format, list, sourceFile); + return escapes ? textChanges.applyChanges(unescaped, escapes) : unescaped; + } + + function printUnescapedSnippetList( + format: ListFormat, + list: NodeArray, + sourceFile: SourceFile | undefined, + ): string { + escapes = undefined; writer.clear(); printer.writeList(format, list, sourceFile, writer); return writer.getText(); @@ -1236,7 +1264,7 @@ namespace ts.Completions { formatContext: formatting.FormatContext, ): string { const syntheticFile = { - text: printSnippetList( + text: printUnescapedSnippetList( format, list, sourceFile), @@ -1256,7 +1284,11 @@ namespace ts.Completions { /* delta */ 0, { ...formatContext, options: formatOptions }); }); - return textChanges.applyChanges(syntheticFile.text, changes); + + const allChanges = escapes + ? stableSort(concatenate(changes, escapes), (a, b) => compareTextSpans(a.span, b.span)) + : changes; + return textChanges.applyChanges(syntheticFile.text, allChanges); } } diff --git a/tests/cases/fourslash/completionsOverridingMethod2.ts b/tests/cases/fourslash/completionsOverridingMethod2.ts index 4abdbfa2707..4fc36685405 100644 --- a/tests/cases/fourslash/completionsOverridingMethod2.ts +++ b/tests/cases/fourslash/completionsOverridingMethod2.ts @@ -5,6 +5,9 @@ // Case: Snippet text needs escaping ////interface DollarSign { //// "$usd"(a: number): number; +//// $cad(b: number): number; +//// cla$$y(c: number): number; +//// isDollarAmountString(s: string): s is `$${number}` ////} ////class USD implements DollarSign { //// /*a*/ @@ -25,6 +28,24 @@ verify.completions({ sortText: completion.SortText.ClassMemberSnippets, isSnippet: true, insertText: "\"\\$usd\"(a: number): number {\n $0\n}", - } + }, + { + name: "$cad", + sortText: completion.SortText.ClassMemberSnippets, + isSnippet: true, + insertText: "\\$cad(b: number): number {\n $0\n}", + }, + { + name: "cla$$y", + sortText: completion.SortText.ClassMemberSnippets, + isSnippet: true, + insertText: "cla\\$\\$y(c: number): number {\n $0\n}", + }, + { + name: "isDollarAmountString", + sortText: completion.SortText.ClassMemberSnippets, + isSnippet: true, + insertText: "isDollarAmountString(s: string): s is `\\$\\${number}` {\n $0\n}" + }, ], }); \ No newline at end of file From d71dd1d9121386a8a9062ba518962277c0892cd3 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Fri, 22 Apr 2022 02:31:16 +0300 Subject: [PATCH 12/63] fix(48556): throw an error on jsx spread attributes with an invalid type (#48570) --- src/compiler/checker.ts | 1 + ...correctlyMarkAliasAsReferences3.errors.txt | 18 +++++++++ .../jsxExcessPropsAndAssignability.errors.txt | 8 +++- .../jsxNamespacePrefixInName.errors.txt | 5 ++- .../jsxNamespacePrefixInNameReact.errors.txt | 5 ++- .../reference/tsxSpreadInvalidType.errors.txt | 24 ++++++++++++ .../reference/tsxSpreadInvalidType.js | 22 +++++++++++ .../reference/tsxSpreadInvalidType.symbols | 34 +++++++++++++++++ .../reference/tsxSpreadInvalidType.types | 37 +++++++++++++++++++ .../conformance/jsx/tsxSpreadInvalidType.tsx | 14 +++++++ 10 files changed, 165 insertions(+), 3 deletions(-) create mode 100644 tests/baselines/reference/correctlyMarkAliasAsReferences3.errors.txt create mode 100644 tests/baselines/reference/tsxSpreadInvalidType.errors.txt create mode 100644 tests/baselines/reference/tsxSpreadInvalidType.js create mode 100644 tests/baselines/reference/tsxSpreadInvalidType.symbols create mode 100644 tests/baselines/reference/tsxSpreadInvalidType.types create mode 100644 tests/cases/conformance/jsx/tsxSpreadInvalidType.tsx diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 2d3060682ff..5748f076305 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -27986,6 +27986,7 @@ namespace ts { } } else { + error(attributeDecl.expression, Diagnostics.Spread_types_may_only_be_created_from_object_types); typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType; } } diff --git a/tests/baselines/reference/correctlyMarkAliasAsReferences3.errors.txt b/tests/baselines/reference/correctlyMarkAliasAsReferences3.errors.txt new file mode 100644 index 00000000000..080d37c28cb --- /dev/null +++ b/tests/baselines/reference/correctlyMarkAliasAsReferences3.errors.txt @@ -0,0 +1,18 @@ +tests/cases/conformance/jsx/0.tsx(6,21): error TS2698: Spread types may only be created from object types. + + +==== tests/cases/conformance/jsx/0.tsx (1 errors) ==== + /// + import * as cx from 'classnames'; + import * as React from "react"; + + let buttonProps; + let k = ; + +==== tests/cases/conformance/jsx/declaration.d.ts (0 errors) ==== + declare module "classnames"; + \ No newline at end of file diff --git a/tests/baselines/reference/jsxExcessPropsAndAssignability.errors.txt b/tests/baselines/reference/jsxExcessPropsAndAssignability.errors.txt index d2acf848242..3e15a705edf 100644 --- a/tests/baselines/reference/jsxExcessPropsAndAssignability.errors.txt +++ b/tests/baselines/reference/jsxExcessPropsAndAssignability.errors.txt @@ -1,8 +1,10 @@ +tests/cases/compiler/jsxExcessPropsAndAssignability.tsx(14,27): error TS2698: Spread types may only be created from object types. tests/cases/compiler/jsxExcessPropsAndAssignability.tsx(16,6): error TS2322: Type 'ComposedComponentProps & { myProp: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes> & Readonly<{ children?: ReactNode; }> & Readonly'. Type 'ComposedComponentProps & { myProp: number; }' is not assignable to type 'Readonly'. +tests/cases/compiler/jsxExcessPropsAndAssignability.tsx(16,27): error TS2698: Spread types may only be created from object types. -==== tests/cases/compiler/jsxExcessPropsAndAssignability.tsx (1 errors) ==== +==== tests/cases/compiler/jsxExcessPropsAndAssignability.tsx (3 errors) ==== /// import * as React from 'react'; @@ -17,10 +19,14 @@ tests/cases/compiler/jsxExcessPropsAndAssignability.tsx(16,6): error TS2322: Typ // Expected no error, got none - good ; + ~~~~~ +!!! error TS2698: Spread types may only be created from object types. // Expected error, but got none - bad! ; ~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'ComposedComponentProps & { myProp: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes> & Readonly<{ children?: ReactNode; }> & Readonly'. !!! error TS2322: Type 'ComposedComponentProps & { myProp: number; }' is not assignable to type 'Readonly'. + ~~~~~ +!!! error TS2698: Spread types may only be created from object types. }; \ No newline at end of file diff --git a/tests/baselines/reference/jsxNamespacePrefixInName.errors.txt b/tests/baselines/reference/jsxNamespacePrefixInName.errors.txt index 2eb3df02ad1..a983e8736b0 100644 --- a/tests/baselines/reference/jsxNamespacePrefixInName.errors.txt +++ b/tests/baselines/reference/jsxNamespacePrefixInName.errors.txt @@ -19,6 +19,7 @@ tests/cases/compiler/jsxNamespacePrefixInName.tsx(21,21): error TS1003: Identifi tests/cases/compiler/jsxNamespacePrefixInName.tsx(22,26): error TS1003: Identifier expected. tests/cases/compiler/jsxNamespacePrefixInName.tsx(22,27): error TS1003: Identifier expected. tests/cases/compiler/jsxNamespacePrefixInName.tsx(22,29): error TS1005: '...' expected. +tests/cases/compiler/jsxNamespacePrefixInName.tsx(22,29): error TS2698: Spread types may only be created from object types. tests/cases/compiler/jsxNamespacePrefixInName.tsx(24,21): error TS1109: Expression expected. tests/cases/compiler/jsxNamespacePrefixInName.tsx(24,22): error TS1109: Expression expected. tests/cases/compiler/jsxNamespacePrefixInName.tsx(24,25): error TS1005: ',' expected. @@ -29,7 +30,7 @@ tests/cases/compiler/jsxNamespacePrefixInName.tsx(24,42): error TS1109: Expressi tests/cases/compiler/jsxNamespacePrefixInName.tsx(25,24): error TS1003: Identifier expected. -==== tests/cases/compiler/jsxNamespacePrefixInName.tsx (29 errors) ==== +==== tests/cases/compiler/jsxNamespacePrefixInName.tsx (30 errors) ==== var justElement1 = ; var justElement2 = ; var justElement3 = ; @@ -94,6 +95,8 @@ tests/cases/compiler/jsxNamespacePrefixInName.tsx(25,24): error TS1003: Identifi !!! error TS1003: Identifier expected. ~~~~~~~ !!! error TS1005: '...' expected. + ~~~~~~~ +!!! error TS2698: Spread types may only be created from object types. var beginOfIdent1 = <:a attr={"value"} />; ~ diff --git a/tests/baselines/reference/jsxNamespacePrefixInNameReact.errors.txt b/tests/baselines/reference/jsxNamespacePrefixInNameReact.errors.txt index 890fc67fc26..bae65da057a 100644 --- a/tests/baselines/reference/jsxNamespacePrefixInNameReact.errors.txt +++ b/tests/baselines/reference/jsxNamespacePrefixInNameReact.errors.txt @@ -19,6 +19,7 @@ tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(23,21): error TS1003: Ide tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(24,26): error TS1003: Identifier expected. tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(24,27): error TS1003: Identifier expected. tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(24,29): error TS1005: '...' expected. +tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(24,29): error TS2698: Spread types may only be created from object types. tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(26,21): error TS1109: Expression expected. tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(26,22): error TS1109: Expression expected. tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(26,25): error TS1005: ',' expected. @@ -29,7 +30,7 @@ tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(26,42): error TS1109: Exp tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(27,24): error TS1003: Identifier expected. -==== tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx (29 errors) ==== +==== tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx (30 errors) ==== declare var React: any; var justElement1 = ; @@ -96,6 +97,8 @@ tests/cases/compiler/jsxNamespacePrefixInNameReact.tsx(27,24): error TS1003: Ide !!! error TS1003: Identifier expected. ~~~~~~~ !!! error TS1005: '...' expected. + ~~~~~~~ +!!! error TS2698: Spread types may only be created from object types. var beginOfIdent1 = <:a attr={"value"} />; ~ diff --git a/tests/baselines/reference/tsxSpreadInvalidType.errors.txt b/tests/baselines/reference/tsxSpreadInvalidType.errors.txt new file mode 100644 index 00000000000..4a0023deb1c --- /dev/null +++ b/tests/baselines/reference/tsxSpreadInvalidType.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/jsx/a.tsx(9,21): error TS2698: Spread types may only be created from object types. +tests/cases/conformance/jsx/a.tsx(10,21): error TS2698: Spread types may only be created from object types. +tests/cases/conformance/jsx/a.tsx(11,21): error TS2698: Spread types may only be created from object types. + + +==== tests/cases/conformance/jsx/a.tsx (3 errors) ==== + namespace JSX { + export interface IntrinsicElements { [key: string]: any } + } + + const a = {} as never; + const b = null; + const c = undefined; + + const d =
+ ~ +!!! error TS2698: Spread types may only be created from object types. + const e =
+ ~ +!!! error TS2698: Spread types may only be created from object types. + const f =
+ ~ +!!! error TS2698: Spread types may only be created from object types. + \ No newline at end of file diff --git a/tests/baselines/reference/tsxSpreadInvalidType.js b/tests/baselines/reference/tsxSpreadInvalidType.js new file mode 100644 index 00000000000..5db598cd45f --- /dev/null +++ b/tests/baselines/reference/tsxSpreadInvalidType.js @@ -0,0 +1,22 @@ +//// [a.tsx] +namespace JSX { + export interface IntrinsicElements { [key: string]: any } +} + +const a = {} as never; +const b = null; +const c = undefined; + +const d =
+const e =
+const f =
+ + +//// [a.jsx] +"use strict"; +var a = {}; +var b = null; +var c = undefined; +var d =
; +var e =
; +var f =
; diff --git a/tests/baselines/reference/tsxSpreadInvalidType.symbols b/tests/baselines/reference/tsxSpreadInvalidType.symbols new file mode 100644 index 00000000000..efb8d3cd58b --- /dev/null +++ b/tests/baselines/reference/tsxSpreadInvalidType.symbols @@ -0,0 +1,34 @@ +=== tests/cases/conformance/jsx/a.tsx === +namespace JSX { +>JSX : Symbol(JSX, Decl(a.tsx, 0, 0)) + + export interface IntrinsicElements { [key: string]: any } +>IntrinsicElements : Symbol(IntrinsicElements, Decl(a.tsx, 0, 15)) +>key : Symbol(key, Decl(a.tsx, 1, 42)) +} + +const a = {} as never; +>a : Symbol(a, Decl(a.tsx, 4, 5)) + +const b = null; +>b : Symbol(b, Decl(a.tsx, 5, 5)) + +const c = undefined; +>c : Symbol(c, Decl(a.tsx, 6, 5)) +>undefined : Symbol(undefined) + +const d =
+>d : Symbol(d, Decl(a.tsx, 8, 5)) +>div : Symbol(JSX.IntrinsicElements, Decl(a.tsx, 0, 15)) +>a : Symbol(a, Decl(a.tsx, 4, 5)) + +const e =
+>e : Symbol(e, Decl(a.tsx, 9, 5)) +>div : Symbol(JSX.IntrinsicElements, Decl(a.tsx, 0, 15)) +>b : Symbol(b, Decl(a.tsx, 5, 5)) + +const f =
+>f : Symbol(f, Decl(a.tsx, 10, 5)) +>div : Symbol(JSX.IntrinsicElements, Decl(a.tsx, 0, 15)) +>c : Symbol(c, Decl(a.tsx, 6, 5)) + diff --git a/tests/baselines/reference/tsxSpreadInvalidType.types b/tests/baselines/reference/tsxSpreadInvalidType.types new file mode 100644 index 00000000000..e834f2f3f4b --- /dev/null +++ b/tests/baselines/reference/tsxSpreadInvalidType.types @@ -0,0 +1,37 @@ +=== tests/cases/conformance/jsx/a.tsx === +namespace JSX { + export interface IntrinsicElements { [key: string]: any } +>key : string +} + +const a = {} as never; +>a : never +>{} as never : never +>{} : {} + +const b = null; +>b : null +>null : null + +const c = undefined; +>c : undefined +>undefined : undefined + +const d =
+>d : any +>
: any +>div : any +>a : never + +const e =
+>e : any +>
: any +>div : any +>b : null + +const f =
+>f : any +>
: any +>div : any +>c : undefined + diff --git a/tests/cases/conformance/jsx/tsxSpreadInvalidType.tsx b/tests/cases/conformance/jsx/tsxSpreadInvalidType.tsx new file mode 100644 index 00000000000..c06430dd7de --- /dev/null +++ b/tests/cases/conformance/jsx/tsxSpreadInvalidType.tsx @@ -0,0 +1,14 @@ +// @jsx: preserve +// @strict: true +// @filename: a.tsx +namespace JSX { + export interface IntrinsicElements { [key: string]: any } +} + +const a = {} as never; +const b = null; +const c = undefined; + +const d =
+const e =
+const f =
From 71f94c5bdb806b1dd835cf5a14bc56413bd62cbf Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Fri, 22 Apr 2022 06:06:24 +0000 Subject: [PATCH 13/63] Update package-lock.json --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2570922a51e..f4e280626f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -626,9 +626,9 @@ } }, "@types/mocha": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.0.tgz", - "integrity": "sha512-QCWHkbMv4Y5U9oW10Uxbr45qMMSzl4OzijsozynUAgx3kEHUdXB00udx2dWDQ7f2TU2a2uuiFaRZjCe3unPpeg==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", + "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", "dev": true }, "@types/ms": { From af30c790931152336484fa225d4e291f7a42d65f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Fri, 22 Apr 2022 17:36:14 +0200 Subject: [PATCH 14/63] Fixed string literal completions for partially-typed strings when overload could get matched (#48811) --- src/compiler/checker.ts | 3 ++- .../completionsLiteralMatchingGenericSignature.ts | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 tests/cases/fourslash/completionsLiteralMatchingGenericSignature.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5748f076305..477851cc4e2 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -30501,6 +30501,7 @@ namespace ts { // decorators are applied to a declaration by the emitter, and not to an expression. const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters; let argCheckMode = !isDecorator && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? CheckMode.SkipContextSensitive : CheckMode.Normal; + argCheckMode |= checkMode & CheckMode.IsForStringLiteralArgumentCompletions; // The following variables are captured and modified by calls to chooseOverload. // If overload resolution or type argument inference fails, we want to report the @@ -30726,7 +30727,7 @@ namespace ts { // If one or more context sensitive arguments were excluded, we start including // them now (and keeping do so for any subsequent candidates) and perform a second // round of type inference and applicability checking for this particular candidate. - argCheckMode = CheckMode.Normal; + argCheckMode = checkMode & CheckMode.IsForStringLiteralArgumentCompletions; if (inferenceContext) { const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext); checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext && inferenceContext.inferredTypeParameters); diff --git a/tests/cases/fourslash/completionsLiteralMatchingGenericSignature.ts b/tests/cases/fourslash/completionsLiteralMatchingGenericSignature.ts new file mode 100644 index 00000000000..85e44adf14a --- /dev/null +++ b/tests/cases/fourslash/completionsLiteralMatchingGenericSignature.ts @@ -0,0 +1,9 @@ +/// + +// @Filename: /a.tsx +//// declare function bar1

(p: P): void; +//// +//// bar1("/*ts*/") +//// + +verify.completions({ marker: ["ts"], exact: ["", "bar", "baz"] }); From 94cb657b1cb98581bf88b6181dca762cd44cf8f8 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 22 Apr 2022 09:30:58 -0700 Subject: [PATCH 15/63] Fix: verification of incremental correctness that was not working because of using wrote writeFile (#48751) * Use fixed time for vfs so baselining is consistent * Baseline buildinfos * Write new file text in baseline even if the file wasnt read on the shadow * Remove unnecessary debugger statement * Make sure that incremental correctness is checked with correct writeFile so we know buildInfo was written Also baseline these so its easy to verify the changes * More baselines for the tsbuildinfo * Renames and test fixes after dts Signature change merge * COmment --- src/testRunner/unittests/tsbuild/helpers.ts | 376 ++++++++-------- .../unittests/tsbuild/noEmitOnError.ts | 103 +++-- src/testRunner/unittests/tsbuild/publicApi.ts | 2 +- src/testRunner/unittests/tsbuild/sample.ts | 4 +- src/testRunner/unittests/tsc/helpers.ts | 35 +- src/testRunner/unittests/tsc/incremental.ts | 30 +- src/testRunner/unittests/tscWatch/helpers.ts | 23 +- .../sourceOfProjectReferenceRedirect.ts | 6 +- .../unittests/tsserver/projectReferences.ts | 3 +- ...c-errors-with-incremental-discrepancies.js | 10 + ...x-errors-with-incremental-discrepancies.js | 20 + ...uilding-using-getNextInvalidatedProject.js | 191 +++++++++ .../sample1/invalidates-projects-correctly.js | 399 +++++++++++++++++ .../noEmit-changes-composite-discrepancies.js | 40 ++ ...s-incremental-declaration-discrepancies.js | 40 ++ ...oEmit-changes-incremental-discrepancies.js | 340 +++++++++++++++ ...-initial-noEmit-composite-discrepancies.js | 20 + ...t-incremental-declaration-discrepancies.js | 20 + ...nitial-noEmit-incremental-discrepancies.js | 60 +++ ...to-the-referenced-project-discrepancies.js | 112 +++++ ...itOnError-semantic-errors-discrepancies.js | 10 + ...EmitOnError-syntax-errors-discrepancies.js | 10 + .../on-sample-project.js | 401 +++++++++++++++++- ...-different-folders-with-no-files-clause.js | 174 +++++++- ...nsitive-references-in-different-folders.js | 174 +++++++- .../on-transitive-references.js | 174 +++++++- ...roject-uses-different-module-resolution.js | 87 +++- ...es-field-when-solution-is-already-built.js | 101 ++++- ...Symlinks-when-solution-is-already-built.js | 101 ++++- ...-package-when-solution-is-already-built.js | 101 ++++- ...Symlinks-when-solution-is-already-built.js | 101 ++++- ...ubFolder-when-solution-is-already-built.js | 101 ++++- ...Symlinks-when-solution-is-already-built.js | 101 ++++- ...-package-when-solution-is-already-built.js | 101 ++++- ...Symlinks-when-solution-is-already-built.js | 101 ++++- ...-project-when-solution-is-already-built.js | 136 +++++- 36 files changed, 3477 insertions(+), 331 deletions(-) create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/semantic-errors-with-incremental-discrepancies.js create mode 100644 tests/baselines/reference/tsbuild/noEmitOnError/syntax-errors-with-incremental-discrepancies.js create mode 100644 tests/baselines/reference/tsc/incremental/noEmit-changes-composite-discrepancies.js create mode 100644 tests/baselines/reference/tsc/incremental/noEmit-changes-incremental-declaration-discrepancies.js create mode 100644 tests/baselines/reference/tsc/incremental/noEmit-changes-incremental-discrepancies.js create mode 100644 tests/baselines/reference/tsc/incremental/noEmit-changes-with-initial-noEmit-composite-discrepancies.js create mode 100644 tests/baselines/reference/tsc/incremental/noEmit-changes-with-initial-noEmit-incremental-declaration-discrepancies.js create mode 100644 tests/baselines/reference/tsc/incremental/noEmit-changes-with-initial-noEmit-incremental-discrepancies.js create mode 100644 tests/baselines/reference/tsc/incremental/when-new-file-is-added-to-the-referenced-project-discrepancies.js create mode 100644 tests/baselines/reference/tsc/incremental/with-noEmitOnError-semantic-errors-discrepancies.js create mode 100644 tests/baselines/reference/tsc/incremental/with-noEmitOnError-syntax-errors-discrepancies.js diff --git a/src/testRunner/unittests/tsbuild/helpers.ts b/src/testRunner/unittests/tsbuild/helpers.ts index 44830d3a886..803a37e014f 100644 --- a/src/testRunner/unittests/tsbuild/helpers.ts +++ b/src/testRunner/unittests/tsbuild/helpers.ts @@ -209,7 +209,7 @@ interface Symbol { affectedFilesPendingEmit?: readonly ReadableProgramBuilderInfoFilePendingEmit[]; } type ReadableBuildInfo = Omit & { program: ReadableProgramBuildInfo | undefined; size: number; }; - function generateBuildInfoProgramBaseline(sys: System, originalWriteFile: System["writeFile"], buildInfoPath: string, buildInfo: BuildInfo) { + function generateBuildInfoProgramBaseline(sys: System, buildInfoPath: string, buildInfo: BuildInfo) { const fileInfos: ReadableProgramBuildInfo["fileInfos"] = {}; buildInfo.program?.fileInfos.forEach((fileInfo, index) => fileInfos[toFileName(index + 1 as ProgramBuildInfoFileId)] = toBuilderStateFileInfo(fileInfo)); const fileNamesList = buildInfo.program?.fileIdsList?.map(fileIdsListId => fileIdsListId.map(toFileName)); @@ -240,7 +240,7 @@ interface Symbol { size: getBuildInfoText({ ...buildInfo, version }).length, }; // For now its just JSON.stringify - originalWriteFile.call(sys, `${buildInfoPath}.readable.baseline.txt`, JSON.stringify(result, /*replacer*/ undefined, 2)); + sys.writeFile(`${buildInfoPath}.readable.baseline.txt`, JSON.stringify(result, /*replacer*/ undefined, 2)); function toFileName(fileId: ProgramBuildInfoFileId) { return buildInfo.program!.fileNames[fileId - 1]; @@ -266,16 +266,15 @@ interface Symbol { export function baselineBuildInfo( options: CompilerOptions, - sys: System & { writtenFiles: ReadonlyCollection; }, + sys: TscCompileSystem | tscWatch.WatchedSystem, originalReadCall?: System["readFile"], - originalWriteFile?: System["writeFile"], ) { const buildInfoPath = getTsBuildInfoEmitOutputFilePath(options); - if (!buildInfoPath || !sys.writtenFiles.has(toPathWithSystem(sys, buildInfoPath))) return; + if (!buildInfoPath || !sys.writtenFiles!.has(toPathWithSystem(sys, buildInfoPath))) return; if (!sys.fileExists(buildInfoPath)) return; const buildInfo = getBuildInfo((originalReadCall || sys.readFile).call(sys, buildInfoPath, "utf8")!); - generateBuildInfoProgramBaseline(sys, originalWriteFile || sys.writeFile, buildInfoPath, buildInfo); + generateBuildInfoProgramBaseline(sys, buildInfoPath, buildInfo); if (!outFile(options)) return; const { jsFilePath, declarationFilePath } = getOutputPathsForBundle(options, /*forceDts*/ false); @@ -288,134 +287,173 @@ interface Symbol { generateBundleFileSectionInfo(sys, originalReadCall || sys.readFile, baselineRecorder, bundle.dts, declarationFilePath); baselineRecorder.Close(); const text = baselineRecorder.lines.join("\r\n"); - (originalWriteFile || sys.writeFile).call(sys, `${buildInfoPath}.baseline.txt`, text); + sys.writeFile(`${buildInfoPath}.baseline.txt`, text); } - - interface VerifyTscEditCorrectnessInput { + interface VerifyTscEditDiscrepanciesInput { + index: number; scenario: TestTscCompile["scenario"]; + subScenario: TestTscCompile["subScenario"]; + baselines: string[] | undefined; commandLineArgs: TestTscCompile["commandLineArgs"]; modifyFs: TestTscCompile["modifyFs"]; editFs: TestTscEdit["modifyFs"]; baseFs: vfs.FileSystem; newSys: TscCompileSystem; - cleanBuildDiscrepancies: TestTscEdit["cleanBuildDiscrepancies"]; + discrepancyExplanation: TestTscEdit["discrepancyExplanation"]; } - /** Verify that emit is same as clean build vs building after edit */ - function verifyTscEditCorrectness(input: () => VerifyTscEditCorrectnessInput, index: number, subScenario: TestTscCompile["subScenario"]) { - it(`Verify emit output file text is same when built clean for incremental edit scenario at:: ${index} ${subScenario}`, () => { - const { - scenario, commandLineArgs, cleanBuildDiscrepancies, - modifyFs, editFs, - baseFs, newSys - } = input(); - const sys = testTscCompile({ - scenario, - subScenario, - fs: () => baseFs.makeReadonly(), - commandLineArgs, - modifyFs: fs => { - if (modifyFs) modifyFs(fs); - editFs(fs); - }, - disableUseFileVersionAsSignature: true, - }); - const discrepancies = cleanBuildDiscrepancies?.(); - for (const outputFile of arrayFrom(sys.writtenFiles.keys())) { - const cleanBuildText = sys.readFile(outputFile); - const incrementalBuildText = newSys.readFile(outputFile); - const descrepancyInClean = discrepancies?.get(outputFile); - if (isBuildInfoFile(outputFile)) { - // Check only presence and absence and not text as we will do that for readable baseline - assert.isTrue(sys.fileExists(`${outputFile}.readable.baseline.txt`), `Readable baseline should be present in clean build:: File:: ${outputFile}`); - assert.isTrue(newSys.fileExists(`${outputFile}.readable.baseline.txt`), `Readable baseline should be present in incremental build:: File:: ${outputFile}`); - if (descrepancyInClean === undefined) { - verifyPresenceAbsence(incrementalBuildText, cleanBuildText, `Incremental and clean tsbuildinfo file presence should match:: File:: ${outputFile}`); - } - else { - verifyTextEqual(incrementalBuildText, cleanBuildText, descrepancyInClean, `File: ${outputFile}`); - } - } - else if (!fileExtensionIs(outputFile, ".tsbuildinfo.readable.baseline.txt")) { - verifyTextEqual(incrementalBuildText, cleanBuildText, descrepancyInClean, `File: ${outputFile}`); - } - else if (incrementalBuildText !== cleanBuildText) { - // Verify build info without affectedFilesPendingEmit - const { buildInfo: incrementalBuildInfo, readableBuildInfo: incrementalReadableBuildInfo } = getBuildInfoForIncrementalCorrectnessCheck(incrementalBuildText); - const { buildInfo: cleanBuildInfo, readableBuildInfo: cleanReadableBuildInfo } = getBuildInfoForIncrementalCorrectnessCheck(cleanBuildText); - verifyTextEqual(incrementalBuildInfo, cleanBuildInfo, descrepancyInClean, `TsBuild info text without affectedFilesPendingEmit ${subScenario}:: ${outputFile}::\nIncremental buildInfoText:: ${incrementalBuildText}\nClean buildInfoText:: ${cleanBuildText}`); - if (descrepancyInClean === undefined) { - // Verify file info sigantures - verifyMapLike( - incrementalReadableBuildInfo?.program?.fileInfos, - cleanReadableBuildInfo?.program?.fileInfos, - (key, incrementalFileInfo, cleanFileInfo) => { - if (incrementalFileInfo.signature !== cleanFileInfo.signature && incrementalFileInfo.signature !== incrementalFileInfo.version) { - assert.fail(`Incremental signature should either be dts signature or file version for File:: ${key}:: Incremental:: ${JSON.stringify(incrementalFileInfo)}, Clean:: ${JSON.stringify(cleanFileInfo)}}`); - } - }, - `FileInfos:: File:: ${outputFile}` - ); - // Verify exportedModulesMap - verifyMapLike( - incrementalReadableBuildInfo?.program?.exportedModulesMap, - cleanReadableBuildInfo?.program?.exportedModulesMap, - (key, incrementalReferenceSet, cleanReferenceSet) => { - if (!arrayIsEqualTo(incrementalReferenceSet, cleanReferenceSet) && !arrayIsEqualTo(incrementalReferenceSet, incrementalReadableBuildInfo!.program!.referencedMap![key])) { - assert.fail(`Incremental Reference set should either be from dts or files reference map for File:: ${key}:: Incremental:: ${JSON.stringify(incrementalReferenceSet)}, Clean:: ${JSON.stringify(cleanReferenceSet)}, referenceMap:: ${JSON.stringify(incrementalReadableBuildInfo!.program!.referencedMap![key])}}`); - } - }, - `exportedModulesMap:: File:: ${outputFile}` - ); - // Verify that incrementally pending affected file emit are in clean build since clean build can contain more files compared to incremental depending of noEmitOnError option - if (incrementalReadableBuildInfo?.program?.affectedFilesPendingEmit) { - assert.isDefined(cleanReadableBuildInfo?.program?.affectedFilesPendingEmit, `Incremental build contains affectedFilesPendingEmit, clean build should also have it: ${outputFile}::\nIncremental buildInfoText:: ${incrementalBuildText}\nClean buildInfoText:: ${cleanBuildText}`); - let expectedIndex = 0; - incrementalReadableBuildInfo.program.affectedFilesPendingEmit.forEach(([actualFile]) => { - expectedIndex = findIndex(cleanReadableBuildInfo!.program!.affectedFilesPendingEmit!, ([expectedFile]) => actualFile === expectedFile, expectedIndex); - assert.notEqual(expectedIndex, -1, `Incremental build contains ${actualFile} file as pending emit, clean build should also have it: ${outputFile}::\nIncremental buildInfoText:: ${incrementalBuildText}\nClean buildInfoText:: ${cleanBuildText}`); - expectedIndex++; - }); - } - } - } - } - - function verifyTextEqual(incrementalText: string | undefined, cleanText: string | undefined, descrepancyInClean: CleanBuildDescrepancy | undefined, message: string) { - if (descrepancyInClean === undefined) { - assert.equal(incrementalText, cleanText, message); - return; - } - switch (descrepancyInClean) { - case CleanBuildDescrepancy.CleanFileTextDifferent: - assert.isDefined(incrementalText, `Incremental file should be present:: ${message}`); - assert.isDefined(cleanText, `Clean file should be present present:: ${message}`); - assert.notEqual(incrementalText, cleanText, message); - return; - case CleanBuildDescrepancy.CleanFilePresent: - assert.isUndefined(incrementalText, `Incremental file should be absent:: ${message}`); - assert.isDefined(cleanText, `Clean file should be present:: ${message}`); - return; - default: - Debug.assertNever(descrepancyInClean); - } - } - - function verifyMapLike(incremental: MapLike | undefined, clean: MapLike | undefined, verifyValue: (key: string, incrementalValue: T, cleanValue: T) => void, message: string) { - verifyPresenceAbsence(incremental, clean, `Incremental and clean presence should match:: ${message}`); - if (!incremental) return; - const incrementalMap = new Map(getEntries(incremental)); - const cleanMap = new Map(getEntries(clean!)); - assert.equal(incrementalMap.size, cleanMap.size, `Incremental and clean size of map should match:: ${message}, Incremental keys: ${arrayFrom(incrementalMap.keys())} Clean: ${arrayFrom(cleanMap.keys())}${TestFSWithWatch.getDiffInKeys(incrementalMap, arrayFrom(cleanMap.keys()))}`); - cleanMap.forEach((cleanValue, key) => { - assert.isTrue(incrementalMap.has(key), `Expected to contain ${key} in incremental map:: ${message}, Incremental keys: ${arrayFrom(incrementalMap.keys())}`); - verifyValue(key, incrementalMap.get(key)!, cleanValue); - }); - } + function verifyTscEditDiscrepancies({ + index, scenario, subScenario, commandLineArgs, + discrepancyExplanation, baselines, + modifyFs, editFs, baseFs, newSys + }: VerifyTscEditDiscrepanciesInput): string[] | undefined { + const sys = testTscCompile({ + scenario, + subScenario, + fs: () => baseFs.makeReadonly(), + commandLineArgs, + modifyFs: fs => { + if (modifyFs) modifyFs(fs); + editFs(fs); + }, + disableUseFileVersionAsSignature: true, }); - } + let headerAdded = false; + for (const outputFile of arrayFrom(sys.writtenFiles.keys())) { + const cleanBuildText = sys.readFile(outputFile); + const incrementalBuildText = newSys.readFile(outputFile); + if (isBuildInfoFile(outputFile)) { + // Check only presence and absence and not text as we will do that for readable baseline + if (!sys.fileExists(`${outputFile}.readable.baseline.txt`)) addBaseline(`Readable baseline not present in clean build:: File:: ${outputFile}`); + if (!newSys.fileExists(`${outputFile}.readable.baseline.txt`)) addBaseline(`Readable baseline not present in incremental build:: File:: ${outputFile}`); + verifyPresenceAbsence(incrementalBuildText, cleanBuildText, `Incremental and clean tsbuildinfo file presence differs:: File:: ${outputFile}`); + } + else if (!fileExtensionIs(outputFile, ".tsbuildinfo.readable.baseline.txt")) { + verifyTextEqual(incrementalBuildText, cleanBuildText, `File: ${outputFile}`); + } + else if (incrementalBuildText !== cleanBuildText) { + // Verify build info without affectedFilesPendingEmit + const { buildInfo: incrementalBuildInfo, readableBuildInfo: incrementalReadableBuildInfo } = getBuildInfoForIncrementalCorrectnessCheck(incrementalBuildText); + const { buildInfo: cleanBuildInfo, readableBuildInfo: cleanReadableBuildInfo } = getBuildInfoForIncrementalCorrectnessCheck(cleanBuildText); + verifyTextEqual(incrementalBuildInfo, cleanBuildInfo, `TsBuild info text without affectedFilesPendingEmit:: ${outputFile}::`); + // Verify file info sigantures + verifyMapLike( + incrementalReadableBuildInfo?.program?.fileInfos, + cleanReadableBuildInfo?.program?.fileInfos, + (key, incrementalFileInfo, cleanFileInfo) => { + if (incrementalFileInfo.signature !== cleanFileInfo.signature && incrementalFileInfo.signature !== incrementalFileInfo.version) { + return [ + `Incremental signature is neither dts signature nor file version for File:: ${key}`, + `Incremental:: ${JSON.stringify(incrementalFileInfo, /*replacer*/ undefined, 2)}`, + `Clean:: ${JSON.stringify(cleanFileInfo, /*replacer*/ undefined, 2)}` + ]; + } + }, + `FileInfos:: File:: ${outputFile}` + ); + // Verify exportedModulesMap + verifyMapLike( + incrementalReadableBuildInfo?.program?.exportedModulesMap, + cleanReadableBuildInfo?.program?.exportedModulesMap, + (key, incrementalReferenceSet, cleanReferenceSet) => { + if (!arrayIsEqualTo(incrementalReferenceSet, cleanReferenceSet) && !arrayIsEqualTo(incrementalReferenceSet, incrementalReadableBuildInfo!.program!.referencedMap![key])) { + return [ + `Incremental Reference set is neither from dts nor files reference map for File:: ${key}::`, + `Incremental:: ${JSON.stringify(incrementalReferenceSet, /*replacer*/ undefined, 2)}`, + `Clean:: ${JSON.stringify(cleanReferenceSet, /*replacer*/ undefined, 2)}`, + `IncrementalReferenceMap:: ${JSON.stringify(incrementalReadableBuildInfo!.program!.referencedMap![key], /*replacer*/ undefined, 2)}`, + `CleanReferenceMap:: ${JSON.stringify(cleanReadableBuildInfo!.program!.referencedMap![key], /*replacer*/ undefined, 2)}`, + ]; + } + }, + `exportedModulesMap:: File:: ${outputFile}` + ); + // Verify that incrementally pending affected file emit are in clean build since clean build can contain more files compared to incremental depending of noEmitOnError option + if (incrementalReadableBuildInfo?.program?.affectedFilesPendingEmit) { + if (cleanReadableBuildInfo?.program?.affectedFilesPendingEmit === undefined) { + addBaseline( + `Incremental build contains affectedFilesPendingEmit, clean build does not have it: ${outputFile}::`, + `Incremental buildInfoText:: ${incrementalBuildText}`, + `Clean buildInfoText:: ${cleanBuildText}` + ); + } + let expectedIndex = 0; + incrementalReadableBuildInfo.program.affectedFilesPendingEmit.forEach(([actualFile]) => { + expectedIndex = findIndex(cleanReadableBuildInfo!.program!.affectedFilesPendingEmit!, ([expectedFile]) => actualFile === expectedFile, expectedIndex); + if (expectedIndex === -1) { + addBaseline( + `Incremental build contains ${actualFile} file as pending emit, clean build does not have it: ${outputFile}::`, + `Incremental buildInfoText:: ${incrementalBuildText}`, + `Clean buildInfoText:: ${cleanBuildText}` + ); + } + expectedIndex++; + }); + } + } + } + if (!headerAdded && discrepancyExplanation) addBaseline("*** Supplied discrepancy explanation but didnt file any difference"); + return baselines; - function verifyPresenceAbsence(actual: T | undefined, expected: T | undefined, message: string) { - (expected !== undefined ? assert.isDefined : assert.isUndefined)(actual, message); + function verifyTextEqual(incrementalText: string | undefined, cleanText: string | undefined, message: string) { + if (incrementalText !== cleanText) writeNotEqual(incrementalText, cleanText, message); + } + + function verifyMapLike(incremental: MapLike | undefined, clean: MapLike | undefined, verifyValue: (key: string, incrementalValue: T, cleanValue: T) => string[] | undefined, message: string) { + verifyPresenceAbsence(incremental, clean, `Incremental and clean do not match:: ${message}`); + if (!incremental || !clean) return; + const incrementalMap = new Map(getEntries(incremental)); + const cleanMap = new Map(getEntries(clean)); + if (incrementalMap.size !== cleanMap.size) { + addBaseline( + `Incremental and clean size of maps do not match:: ${message}`, + `Incremental: ${JSON.stringify(incremental, /*replacer*/ undefined, 2)}`, + `Clean: ${JSON.stringify(clean, /*replacer*/ undefined, 2)}`, + ); + return; + } + cleanMap.forEach((cleanValue, key) => { + const incrementalValue = incrementalMap.get(key); + if (!incrementalValue) { + addBaseline( + `Incremental does not contain ${key} which is present in clean:: ${message}`, + `Incremental: ${JSON.stringify(incremental, /*replacer*/ undefined, 2)}`, + `Clean: ${JSON.stringify(clean, /*replacer*/ undefined, 2)}`, + ); + } + else { + const result = verifyValue(key, incrementalMap.get(key)!, cleanValue); + if (result) addBaseline(...result); + } + }); + } + + function verifyPresenceAbsence(actual: T | undefined, expected: T | undefined, message: string) { + if (expected === undefined) { + if (actual === undefined) return; + } + else { + if (actual !== undefined) return; + } + writeNotEqual(actual, expected, message); + } + + function writeNotEqual(actual: T | undefined, expected: T | undefined, message: string) { + addBaseline( + message, + "CleanBuild:", + isString(expected) ? expected : JSON.stringify(expected), + "IncrementalBuild:", + isString(actual) ? actual : JSON.stringify(actual), + ); + } + + function addBaseline(...text: string[]) { + if (!baselines || !headerAdded) { + (baselines ||= []).push(`${index}:: ${subScenario}`, ...(discrepancyExplanation?.()|| ["*** Needs explanation"])); + headerAdded = true; + } + baselines.push(...text); + } } function getBuildInfoForIncrementalCorrectnessCheck(text: string | undefined): { @@ -425,7 +463,7 @@ interface Symbol { if (!text) return { buildInfo: text }; const readableBuildInfo = JSON.parse(text) as ReadableBuildInfo; let sanitizedFileInfos: MapLike | undefined; - if (readableBuildInfo.program) { + if (readableBuildInfo.program?.fileInfos) { sanitizedFileInfos = {}; for (const id in readableBuildInfo.program.fileInfos) { if (hasProperty(readableBuildInfo.program.fileInfos, id)) { @@ -461,34 +499,22 @@ interface Symbol { modifyFs: (fs: vfs.FileSystem) => void; subScenario: string; commandLineArgs?: readonly string[]; - cleanBuildDiscrepancies?: () => ESMap; + /** An array of lines to be printed in order when a discrepancy is detected */ + discrepancyExplanation?: () => readonly string[]; } - export interface VerifyTscWithEditsInput extends VerifyTscWithEditsWorkerInput { - baselineIncremental?: boolean; - } - export interface VerifyTscWithEditsWorkerInput extends TestTscCompile { + export interface VerifyTscWithEditsInput extends TestTscCompile { edits: TestTscEdit[]; } /** * Verify non watch tsc invokcation after each edit */ - export function verifyTscWithEdits(input: VerifyTscWithEditsInput) { - verifyTscWithEditsWorker(input); - if (input.baselineIncremental) { - verifyTscWithEditsWorker({ - ...input, - subScenario: `${input.subScenario} with incremental`, - commandLineArgs: [...input.commandLineArgs, "--incremental"], - }); - } - } - function verifyTscWithEditsWorker({ + export function verifyTscWithEdits({ subScenario, fs, scenario, commandLineArgs, baselineSourceMap, modifyFs, baselineReadFileCalls, baselinePrograms, edits - }: VerifyTscWithEditsWorkerInput) { + }: VerifyTscWithEditsInput) { describe(`tsc ${commandLineArgs.join(" ")} ${scenario}:: ${subScenario} serializedEdits`, () => { let sys: TscCompileSystem; let baseFs: vfs.FileSystem; @@ -528,35 +554,43 @@ interface Symbol { sys = undefined!; editsSys = undefined!; }); - describe("tsc invocation after edit", () => { - verifyTscBaseline(() => ({ - baseLine: () => { - const { file, text } = sys.baseLine(); - const texts: string[] = [text]; - editsSys.forEach((sys, index) => { - const incrementalScenario = edits[index]; - texts.push(""); - texts.push(`Change:: ${incrementalScenario.subScenario}`); - texts.push(sys.baseLine().text); - }); - return { file, text: texts.join("\r\n") }; - } - })); - }); - describe("tsc invocation after edit and clean build correctness", () => { - edits.forEach(({ commandLineArgs: editCommandLineArgs, subScenario, cleanBuildDiscrepancies }, index) => verifyTscEditCorrectness(() => ({ - scenario, - baseFs, - newSys: editsSys[index], - commandLineArgs: editCommandLineArgs || commandLineArgs, - cleanBuildDiscrepancies, - editFs: fs => { - for (let i = 0; i <= index; i++) { - edits[i].modifyFs(fs); - } - }, - modifyFs, - }), index, subScenario)); + verifyTscBaseline(() => ({ + baseLine: () => { + const { file, text } = sys.baseLine(); + const texts: string[] = [text]; + editsSys.forEach((sys, index) => { + const incrementalScenario = edits[index]; + texts.push(""); + texts.push(`Change:: ${incrementalScenario.subScenario}`); + texts.push(sys.baseLine().text); + }); + return { file, text: texts.join("\r\n") }; + } + })); + it("tsc invocation after edit and clean build correctness", () => { + let baselines: string[] | undefined; + for (let index = 0; index < edits.length; index++) { + baselines = verifyTscEditDiscrepancies({ + index, + scenario, + subScenario: edits[index].subScenario, + baselines, + baseFs, + newSys: editsSys[index], + commandLineArgs: edits[index].commandLineArgs || commandLineArgs, + discrepancyExplanation: edits[index].discrepancyExplanation, + editFs: fs => { + for (let i = 0; i <= index; i++) { + edits[i].modifyFs(fs); + } + }, + modifyFs + }); + } + Harness.Baseline.runBaseline( + `${isBuild(commandLineArgs) ? "tsbuild" : "tsc"}/${scenario}/${subScenario.split(" ").join("-")}-discrepancies.js`, + baselines ? baselines.join("\r\n") : null // eslint-disable-line no-null/no-null + ); }); }); } diff --git a/src/testRunner/unittests/tsbuild/noEmitOnError.ts b/src/testRunner/unittests/tsbuild/noEmitOnError.ts index 93586fa5410..f1aa1ac17c0 100644 --- a/src/testRunner/unittests/tsbuild/noEmitOnError.ts +++ b/src/testRunner/unittests/tsbuild/noEmitOnError.ts @@ -8,40 +8,81 @@ namespace ts { projFs = undefined!; }); - function verifyNoEmitOnError(subScenario: string, fixModifyFs: TestTscEdit["modifyFs"], modifyFs?: TestTscEdit["modifyFs"]) { - verifyTscWithEdits({ - scenario: "noEmitOnError", - subScenario, - fs: () => projFs, - modifyFs, - commandLineArgs: ["--b", "/src/tsconfig.json"], - edits: [ - noChangeRun, - { - subScenario: "Fix error", - modifyFs: fixModifyFs, - }, - noChangeRun, - ], - baselinePrograms: true, - baselineIncremental: true - }); - } - - verifyNoEmitOnError( - "syntax errors", - fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; + verifyTscWithEdits({ + scenario: "noEmitOnError", + subScenario: "syntax errors", + fs: () => projFs, + commandLineArgs: ["--b", "/src/tsconfig.json"], + edits: [ + noChangeRun, + { + subScenario: "Fix error", + modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; const a = { lastName: 'sdsd' -};`, "utf-8") - ); +};`, "utf-8"), + }, + noChangeRun, + ], + baselinePrograms: true, + }); - verifyNoEmitOnError( - "semantic errors", - fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; + verifyTscWithEdits({ + scenario: "noEmitOnError", + subScenario: "syntax errors with incremental", + fs: () => projFs, + commandLineArgs: ["--b", "/src/tsconfig.json", "--incremental"], + edits: [ + noChangeRun, + { + subScenario: "Fix error", + modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; +const a = { + lastName: 'sdsd' +};`, "utf-8"), + discrepancyExplanation: noChangeWithExportsDiscrepancyRun.discrepancyExplanation, + }, + noChangeWithExportsDiscrepancyRun, + ], + baselinePrograms: true, + }); + + verifyTscWithEdits({ + scenario: "noEmitOnError", + subScenario: "semantic errors", + fs: () => projFs, + modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; +const a: string = 10;`, "utf-8"), + commandLineArgs: ["--b", "/src/tsconfig.json"], + edits: [ + noChangeRun, + { + subScenario: "Fix error", + modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; const a: string = "hello";`, "utf-8"), - fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; -const a: string = 10;`, "utf-8") - ); + }, + noChangeRun, + ], + baselinePrograms: true, + }); + + verifyTscWithEdits({ + scenario: "noEmitOnError", + subScenario: "semantic errors with incremental", + fs: () => projFs, + modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; +const a: string = 10;`, "utf-8"), + commandLineArgs: ["--b", "/src/tsconfig.json", "--incremental"], + edits: [ + noChangeWithExportsDiscrepancyRun, + { + subScenario: "Fix error", + modifyFs: fs => fs.writeFileSync("/src/src/main.ts", `import { A } from "../shared/types/db"; +const a: string = "hello";`, "utf-8"), + }, + noChangeRun, + ], + baselinePrograms: true, + }); }); } diff --git a/src/testRunner/unittests/tsbuild/publicApi.ts b/src/testRunner/unittests/tsbuild/publicApi.ts index 304be7e0b2e..cb2d35ca967 100644 --- a/src/testRunner/unittests/tsbuild/publicApi.ts +++ b/src/testRunner/unittests/tsbuild/publicApi.ts @@ -46,7 +46,7 @@ export function f22() { } // trailing`, writtenFiles.add(path); return originalWriteFile.call(sys, fileName, content, writeByteOrderMark); }; - const { cb, getPrograms } = commandLineCallbacks(sys, /*originalReadCall*/ undefined, originalWriteFile); + const { cb, getPrograms } = commandLineCallbacks(sys, /*originalReadCall*/ undefined); const buildHost = createSolutionBuilderHost( sys, /*createProgram*/ undefined, diff --git a/src/testRunner/unittests/tsbuild/sample.ts b/src/testRunner/unittests/tsbuild/sample.ts index c74fba5eb11..2178c422ab9 100644 --- a/src/testRunner/unittests/tsbuild/sample.ts +++ b/src/testRunner/unittests/tsbuild/sample.ts @@ -246,7 +246,7 @@ namespace ts { ) ); - const host = createSolutionBuilderHost(system); + const host = createSolutionBuilderHostForBaseline(system); const builder = createSolutionBuilder(host, [testsConfig.path], {}); baseline.push("Input::"); baselineState(); @@ -317,7 +317,7 @@ namespace ts { ) ); - const host = createSolutionBuilderHost(system); + const host = createSolutionBuilderHostForBaseline(system); const builder = createSolutionBuilder(host, [testsConfig.path], { dry: false, force: false, verbose: false }); builder.build(); baselineState("Build of project"); diff --git a/src/testRunner/unittests/tsc/helpers.ts b/src/testRunner/unittests/tsc/helpers.ts index bfcf7be3cf3..81d22823e0b 100644 --- a/src/testRunner/unittests/tsc/helpers.ts +++ b/src/testRunner/unittests/tsc/helpers.ts @@ -10,7 +10,15 @@ namespace ts { subScenario: "no-change-run", modifyFs: noop }; + export const noChangeWithExportsDiscrepancyRun: TestTscEdit = { + ...noChangeRun, + discrepancyExplanation: () => [ + "Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files", + "Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed" + ] + }; export const noChangeOnlyRuns = [noChangeRun]; + export const noChangeWithExportsDiscrepancyOnlyRuns = [noChangeWithExportsDiscrepancyRun]; export interface TestTscCompile extends TestTscCompileLikeBase { baselineSourceMap?: boolean; @@ -29,23 +37,22 @@ namespace ts { return !!(program as Program | BuilderProgram).getCompilerOptions; } export function commandLineCallbacks( - sys: System & { writtenFiles: ReadonlyCollection; }, + sys: TscCompileSystem | tscWatch.WatchedSystem, originalReadCall?: System["readFile"], - originalWriteFile?: System["writeFile"], ): CommandLineCallbacks { let programs: CommandLineProgram[] | undefined; return { cb: program => { if (isAnyProgram(program)) { - baselineBuildInfo(program.getCompilerOptions(), sys, originalReadCall, originalWriteFile); + baselineBuildInfo(program.getCompilerOptions(), sys, originalReadCall); (programs || (programs = [])).push(isBuilderProgram(program) ? [program.getProgram(), program] : [program] ); } else { - baselineBuildInfo(program.options, sys, originalReadCall, originalWriteFile); + baselineBuildInfo(program.options, sys, originalReadCall); } }, getPrograms: () => { @@ -122,16 +129,22 @@ ${patch ? vfs.formatPatch(patch) : ""}` const originalWriteFile = sys.writeFile; sys.writeFile = (fileName, content, writeByteOrderMark) => { const path = toPathWithSystem(sys, fileName); - assert.isFalse(writtenFiles.has(path)); + // When buildinfo is same for two projects, + // it gives error and doesnt write buildinfo but because buildInfo is written for one project, + // readable baseline will be written two times for those two projects with same contents and is ok + Debug.assert(!writtenFiles.has(path) || endsWith(path, "baseline.txt")); writtenFiles.add(path); return originalWriteFile.call(sys, fileName, content, writeByteOrderMark); }; - return originalWriteFile; } - export function createSolutionBuilderHostForBaseline(sys: TscCompileSystem, versionToWrite?: string) { - makeSystemReadyForBaseline(sys, versionToWrite); - const { cb } = commandLineCallbacks(sys); + export function createSolutionBuilderHostForBaseline( + sys: TscCompileSystem | tscWatch.WatchedSystem, + versionToWrite?: string, + originalRead?: (TscCompileSystem | tscWatch.WatchedSystem)["readFile"] + ) { + if (sys instanceof fakes.System) makeSystemReadyForBaseline(sys, versionToWrite); + const { cb } = commandLineCallbacks(sys, originalRead); const host = createSolutionBuilderHost(sys, /*createProgram*/ undefined, createDiagnosticReporter(sys, /*pretty*/ true), @@ -155,7 +168,7 @@ ${patch ? vfs.formatPatch(patch) : ""}` }); function commandLineCompile(sys: TscCompileSystem) { - const originalWriteFile = makeSystemReadyForBaseline(sys); + makeSystemReadyForBaseline(sys); actualReadFileMap = {}; const originalReadFile = sys.readFile; sys.readFile = path => { @@ -166,7 +179,7 @@ ${patch ? vfs.formatPatch(patch) : ""}` return originalReadFile.call(sys, path); }; - const result = commandLineCallbacks(sys, originalReadFile, originalWriteFile); + const result = commandLineCallbacks(sys, originalReadFile); executeCommandLine( sys, result.cb, diff --git a/src/testRunner/unittests/tsc/incremental.ts b/src/testRunner/unittests/tsc/incremental.ts index a27b1b90253..b3bd30d91ae 100644 --- a/src/testRunner/unittests/tsc/incremental.ts +++ b/src/testRunner/unittests/tsc/incremental.ts @@ -90,7 +90,7 @@ namespace ts { commandLineArgs: ["--incremental", "-p", "src"], modifyFs, edits: [ - noChangeRun, + noChangeWithExportsDiscrepancyRun, { subScenario: "incremental-declaration-doesnt-change", modifyFs: fixModifyFs @@ -123,15 +123,20 @@ const a: string = 10;`, "utf-8"), verifyNoEmitChanges({ composite: true }); function verifyNoEmitChanges(compilerOptions: CompilerOptions) { + const discrepancyIfNoDtsEmit = getEmitDeclarations(compilerOptions) ? + undefined : + noChangeWithExportsDiscrepancyRun.discrepancyExplanation; const noChangeRunWithNoEmit: TestTscEdit = { ...noChangeRun, subScenario: "No Change run with noEmit", commandLineArgs: ["--p", "src/project", "--noEmit"], + discrepancyExplanation: discrepancyIfNoDtsEmit, }; const noChangeRunWithEmit: TestTscEdit = { ...noChangeRun, subScenario: "No Change run with emit", commandLineArgs: ["--p", "src/project"], + discrepancyExplanation: discrepancyIfNoDtsEmit, }; let optionsString = ""; for (const key in compilerOptions) { @@ -152,10 +157,12 @@ const a: string = 10;`, "utf-8"), subScenario: "Introduce error but still noEmit", commandLineArgs: ["--p", "src/project", "--noEmit"], modifyFs: fs => replaceText(fs, "/src/project/src/class.ts", "prop", "prop1"), + discrepancyExplanation: getEmitDeclarations(compilerOptions) ? noChangeWithExportsDiscrepancyRun.discrepancyExplanation : undefined, }, { subScenario: "Fix error and emit", modifyFs: fs => replaceText(fs, "/src/project/src/class.ts", "prop1", "prop"), + discrepancyExplanation: discrepancyIfNoDtsEmit }, noChangeRunWithEmit, noChangeRunWithNoEmit, @@ -164,6 +171,7 @@ const a: string = 10;`, "utf-8"), { subScenario: "Introduce error and emit", modifyFs: fs => replaceText(fs, "/src/project/src/class.ts", "prop", "prop1"), + discrepancyExplanation: discrepancyIfNoDtsEmit }, noChangeRunWithEmit, noChangeRunWithNoEmit, @@ -173,6 +181,7 @@ const a: string = 10;`, "utf-8"), subScenario: "Fix error and no emit", commandLineArgs: ["--p", "src/project", "--noEmit"], modifyFs: fs => replaceText(fs, "/src/project/src/class.ts", "prop1", "prop"), + discrepancyExplanation: noChangeWithExportsDiscrepancyRun.discrepancyExplanation, }, noChangeRunWithEmit, noChangeRunWithNoEmit, @@ -196,6 +205,7 @@ const a: string = 10;`, "utf-8"), { subScenario: "Fix error and no emit", modifyFs: fs => replaceText(fs, "/src/project/src/class.ts", "prop1", "prop"), + discrepancyExplanation: noChangeWithExportsDiscrepancyRun.discrepancyExplanation }, noChangeRunWithEmit, ], @@ -352,11 +362,10 @@ declare global { { subScenario: "Add class3 to project1 and build it", modifyFs: fs => fs.writeFileSync("/src/projects/project1/class3.ts", `class class3 {}`, "utf-8"), - cleanBuildDiscrepancies: () => new Map([ - // Ts buildinfo will not be updated in incremental build so it will have semantic diagnostics cached from previous build - // But in clean build because of global diagnostics, semantic diagnostics are not queried so not cached in tsbuildinfo - ["/src/projects/project2/tsconfig.tsbuildinfo", CleanBuildDescrepancy.CleanFileTextDifferent] - ]), + discrepancyExplanation: () => [ + "Ts buildinfo will not be updated in incremental build so it will have semantic diagnostics cached from previous build", + "But in clean build because of global diagnostics, semantic diagnostics are not queried so not cached in tsbuildinfo", + ], }, { subScenario: "Add output of class3", @@ -372,11 +381,10 @@ declare global { { subScenario: "Delete output for class3", modifyFs: fs => fs.unlinkSync("/src/projects/project1/class3.d.ts"), - cleanBuildDiscrepancies: () => new Map([ - // Ts buildinfo willbe updated but will retain lib file errors from previous build and not others because they are emitted because of change which results in clearing their semantic diagnostics cache - // But in clean build because of global diagnostics, semantic diagnostics are not queried so not cached in tsbuildinfo - ["/src/projects/project2/tsconfig.tsbuildinfo", CleanBuildDescrepancy.CleanFileTextDifferent] - ]), + discrepancyExplanation: () => [ + "Ts buildinfo will be updated but will retain lib file errors from previous build and not others because they are emitted because of change which results in clearing their semantic diagnostics cache", + "But in clean build because of global diagnostics, semantic diagnostics are not queried so not cached in tsbuildinfo", + ], }, { subScenario: "Create output for class3", diff --git a/src/testRunner/unittests/tscWatch/helpers.ts b/src/testRunner/unittests/tscWatch/helpers.ts index 20bdefa5a5b..501264b40ff 100644 --- a/src/testRunner/unittests/tscWatch/helpers.ts +++ b/src/testRunner/unittests/tscWatch/helpers.ts @@ -171,9 +171,10 @@ namespace ts.tscWatch { export interface Baseline extends BaselineBase, CommandLineCallbacks { } - export function createBaseline(system: WatchedSystem, modifySystem?: (sys: WatchedSystem) => void): Baseline { + export function createBaseline(system: WatchedSystem, modifySystem?: (sys: WatchedSystem, originalRead: WatchedSystem["readFile"]) => void): Baseline { + const originalRead = system.readFile; const initialSys = fakes.patchHostForBuildInfoReadWrite(system); - modifySystem?.(initialSys); + modifySystem?.(initialSys, originalRead); const sys = TestFSWithWatch.changeToHostTrackingWrittenFiles(initialSys); const baseline: string[] = []; baseline.push("Input::"); @@ -410,30 +411,32 @@ namespace ts.tscWatch { sys.writeFile(file, content.replace(searchValue, replaceValue)); } - export function createSolutionBuilder(system: WatchedSystem, rootNames: readonly string[], defaultOptions?: BuildOptions) { - const host = createSolutionBuilderHost(system); - return ts.createSolutionBuilder(host, rootNames, defaultOptions || {}); + export function createSolutionBuilder(system: WatchedSystem, rootNames: readonly string[], originalRead?: WatchedSystem["readFile"]) { + const host = createSolutionBuilderHostForBaseline(system, /*versionToWrite*/ undefined, originalRead); + return ts.createSolutionBuilder(host, rootNames, {}); } export function ensureErrorFreeBuild(host: WatchedSystem, rootNames: readonly string[]) { // ts build should succeed - const solutionBuilder = createSolutionBuilder(host, rootNames, {}); - solutionBuilder.build(); + solutionBuildWithBaseline(host, rootNames); assert.equal(host.getOutput().length, 0, JSON.stringify(host.getOutput(), /*replacer*/ undefined, " ")); } - export function createSystemWithSolutionBuild(solutionRoots: readonly string[], files: readonly TestFSWithWatch.FileOrFolderOrSymLink[], params?: TestFSWithWatch.TestServerHostCreationParameters) { - const sys = createWatchedSystem(files, params); + export function solutionBuildWithBaseline(sys: WatchedSystem, solutionRoots: readonly string[], originalRead?: WatchedSystem["readFile"]) { const originalReadFile = sys.readFile; const originalWrite = sys.write; const originalWriteFile = sys.writeFile; const solutionBuilder = createSolutionBuilder(TestFSWithWatch.changeToHostTrackingWrittenFiles( fakes.patchHostForBuildInfoReadWrite(sys) - ), solutionRoots, {}); + ), solutionRoots, originalRead); solutionBuilder.build(); sys.readFile = originalReadFile; sys.write = originalWrite; sys.writeFile = originalWriteFile; return sys; } + + export function createSystemWithSolutionBuild(solutionRoots: readonly string[], files: readonly TestFSWithWatch.FileOrFolderOrSymLink[], params?: TestFSWithWatch.TestServerHostCreationParameters) { + return solutionBuildWithBaseline(createWatchedSystem(files, params), solutionRoots); + } } diff --git a/src/testRunner/unittests/tscWatch/sourceOfProjectReferenceRedirect.ts b/src/testRunner/unittests/tscWatch/sourceOfProjectReferenceRedirect.ts index 7152c0db97d..4110dbfe333 100644 --- a/src/testRunner/unittests/tscWatch/sourceOfProjectReferenceRedirect.ts +++ b/src/testRunner/unittests/tscWatch/sourceOfProjectReferenceRedirect.ts @@ -10,10 +10,8 @@ namespace ts.tscWatch { function verifyWatch({ files, config, subScenario }: VerifyWatchInput, alreadyBuilt: boolean) { const { sys, baseline, oldSnap, cb, getPrograms } = createBaseline( createWatchedSystem(files), - alreadyBuilt ? sys => { - const solutionBuilder = createSolutionBuilder(sys, [config], {}); - solutionBuilder.build(); - solutionBuilder.close(); + alreadyBuilt ? (sys, originalRead) => { + solutionBuildWithBaseline(sys, [config], originalRead); sys.clearOutput(); } : undefined ); diff --git a/src/testRunner/unittests/tsserver/projectReferences.ts b/src/testRunner/unittests/tsserver/projectReferences.ts index bae075912be..ba4604be5aa 100644 --- a/src/testRunner/unittests/tsserver/projectReferences.ts +++ b/src/testRunner/unittests/tsserver/projectReferences.ts @@ -1278,8 +1278,7 @@ bar;` const files = [solnConfig, sharedConfig, sharedIndex, sharedPackage, appConfig, appBar, appIndex, sharedSymlink, libFile]; const host = createServerHost(files); if (built) { - const solutionBuilder = tscWatch.createSolutionBuilder(host, [solnConfig.path], {}); - solutionBuilder.build(); + tscWatch.solutionBuildWithBaseline(host, [solnConfig.path]); host.clearOutput(); } const session = createSession(host, { logger: createLoggerWithInMemoryLogs() }); diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/semantic-errors-with-incremental-discrepancies.js b/tests/baselines/reference/tsbuild/noEmitOnError/semantic-errors-with-incremental-discrepancies.js new file mode 100644 index 00000000000..86eb6bdb396 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/semantic-errors-with-incremental-discrepancies.js @@ -0,0 +1,10 @@ +0:: no-change-run +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "../src/main.ts": [ + "../shared/types/db.ts" + ] +} +Clean: {} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/syntax-errors-with-incremental-discrepancies.js b/tests/baselines/reference/tsbuild/noEmitOnError/syntax-errors-with-incremental-discrepancies.js new file mode 100644 index 00000000000..cab34fb1d08 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/syntax-errors-with-incremental-discrepancies.js @@ -0,0 +1,20 @@ +1:: Fix error +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "../src/main.ts": [ + "../shared/types/db.ts" + ] +} +Clean: {} +2:: no-change-run +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "../src/main.ts": [ + "../shared/types/db.ts" + ] +} +Clean: {} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/sample1/building-using-getNextInvalidatedProject.js b/tests/baselines/reference/tsbuild/sample1/building-using-getNextInvalidatedProject.js index b8f5f577195..f7896cd8809 100644 --- a/tests/baselines/reference/tsbuild/sample1/building-using-getNextInvalidatedProject.js +++ b/tests/baselines/reference/tsbuild/sample1/building-using-getNextInvalidatedProject.js @@ -129,6 +129,54 @@ export declare function multiply(a: number, b: number): number; //// [/user/username/projects/core/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +//// [/user/username/projects/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1352 +} + Project Result:: {"project":"/user/username/projects/logic/tsconfig.json","result":0} Output:: @@ -158,6 +206,71 @@ export declare const m: typeof mod; //// [/user/username/projects/logic/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +//// [/user/username/projects/logic/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" + ] + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "./index.ts": { + "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1469 +} + Project Result:: {"project":"/user/username/projects/tests/tsconfig.json","result":0} Output:: @@ -182,6 +295,84 @@ export declare const m: typeof mod; //// [/user/username/projects/tests/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +//// [/user/username/projects/tests/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/anothermodule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "../logic/index.d.ts": { + "version": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1614 +} + Project Result:: {} Output:: diff --git a/tests/baselines/reference/tsbuild/sample1/invalidates-projects-correctly.js b/tests/baselines/reference/tsbuild/sample1/invalidates-projects-correctly.js index 2801b7a71ce..e67f096921f 100644 --- a/tests/baselines/reference/tsbuild/sample1/invalidates-projects-correctly.js +++ b/tests/baselines/reference/tsbuild/sample1/invalidates-projects-correctly.js @@ -125,6 +125,54 @@ export declare function multiply(a: number, b: number): number; //// [/user/username/projects/core/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +//// [/user/username/projects/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1352 +} + //// [/user/username/projects/logic/index.js.map] {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} @@ -150,6 +198,71 @@ export declare const m: typeof mod; //// [/user/username/projects/logic/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +//// [/user/username/projects/logic/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" + ] + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "./index.ts": { + "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1469 +} + //// [/user/username/projects/tests/index.js] "use strict"; exports.__esModule = true; @@ -170,6 +283,84 @@ export declare const m: typeof mod; //// [/user/username/projects/tests/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +//// [/user/username/projects/tests/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/anothermodule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "../logic/index.d.ts": { + "version": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1614 +} + Project should still be upto date: UpToDate non Dts change to logic:: After rebuilding logicConfig @@ -205,6 +396,71 @@ function foo() { } //// [/user/username/projects/logic/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-2207004071-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\nfunction foo() {}","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +//// [/user/username/projects/logic/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" + ] + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "./index.ts": { + "version": "-2207004071-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\nfunction foo() {}", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1486 +} + non Dts change to logic:: After building next project Output:: @@ -259,6 +515,71 @@ export declare class cNew { //// [/user/username/projects/logic/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5994214602-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\nfunction foo() {}export class cNew {}","signature":"-10890883855-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\nexport declare class cNew {\n}\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +//// [/user/username/projects/logic/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" + ] + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "./index.ts": { + "version": "-5994214602-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\nfunction foo() {}export class cNew {}", + "signature": "-10890883855-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\nexport declare class cNew {\n}\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1539 +} + Dts change to Logic:: After building next project Output:: @@ -268,3 +589,81 @@ Output:: //// [/user/username/projects/tests/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-10890883855-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\nexport declare class cNew {\n}\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +//// [/user/username/projects/tests/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/anothermodule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "../logic/index.d.ts": { + "version": "-10890883855-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\nexport declare class cNew {\n}\n", + "signature": "-10890883855-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\nexport declare class cNew {\n}\n" + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1647 +} + diff --git a/tests/baselines/reference/tsc/incremental/noEmit-changes-composite-discrepancies.js b/tests/baselines/reference/tsc/incremental/noEmit-changes-composite-discrepancies.js new file mode 100644 index 00000000000..570eccd361d --- /dev/null +++ b/tests/baselines/reference/tsc/incremental/noEmit-changes-composite-discrepancies.js @@ -0,0 +1,40 @@ +2:: Introduce error but still noEmit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} +13:: Fix error and no emit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/tsc/incremental/noEmit-changes-incremental-declaration-discrepancies.js b/tests/baselines/reference/tsc/incremental/noEmit-changes-incremental-declaration-discrepancies.js new file mode 100644 index 00000000000..570eccd361d --- /dev/null +++ b/tests/baselines/reference/tsc/incremental/noEmit-changes-incremental-declaration-discrepancies.js @@ -0,0 +1,40 @@ +2:: Introduce error but still noEmit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} +13:: Fix error and no emit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/tsc/incremental/noEmit-changes-incremental-discrepancies.js b/tests/baselines/reference/tsc/incremental/noEmit-changes-incremental-discrepancies.js new file mode 100644 index 00000000000..3bae3d8e6e8 --- /dev/null +++ b/tests/baselines/reference/tsc/incremental/noEmit-changes-incremental-discrepancies.js @@ -0,0 +1,340 @@ +0:: No Change run with noEmit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} +1:: No Change run with noEmit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} +3:: Fix error and emit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} +4:: No Change run with emit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} +5:: No Change run with noEmit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} +6:: No Change run with noEmit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} +7:: No Change run with emit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} +8:: Introduce error and emit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} +9:: No Change run with emit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} +10:: No Change run with noEmit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} +11:: No Change run with noEmit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} +12:: No Change run with emit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} +13:: Fix error and no emit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} +14:: No Change run with emit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} +15:: No Change run with noEmit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} +16:: No Change run with noEmit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} +17:: No Change run with emit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/tsc/incremental/noEmit-changes-with-initial-noEmit-composite-discrepancies.js b/tests/baselines/reference/tsc/incremental/noEmit-changes-with-initial-noEmit-composite-discrepancies.js new file mode 100644 index 00000000000..68e9e067596 --- /dev/null +++ b/tests/baselines/reference/tsc/incremental/noEmit-changes-with-initial-noEmit-composite-discrepancies.js @@ -0,0 +1,20 @@ +2:: Fix error and no emit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/tsc/incremental/noEmit-changes-with-initial-noEmit-incremental-declaration-discrepancies.js b/tests/baselines/reference/tsc/incremental/noEmit-changes-with-initial-noEmit-incremental-declaration-discrepancies.js new file mode 100644 index 00000000000..68e9e067596 --- /dev/null +++ b/tests/baselines/reference/tsc/incremental/noEmit-changes-with-initial-noEmit-incremental-declaration-discrepancies.js @@ -0,0 +1,20 @@ +2:: Fix error and no emit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/tsc/incremental/noEmit-changes-with-initial-noEmit-incremental-discrepancies.js b/tests/baselines/reference/tsc/incremental/noEmit-changes-with-initial-noEmit-incremental-discrepancies.js new file mode 100644 index 00000000000..54786c7dcc1 --- /dev/null +++ b/tests/baselines/reference/tsc/incremental/noEmit-changes-with-initial-noEmit-incremental-discrepancies.js @@ -0,0 +1,60 @@ +0:: No Change run with emit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} +2:: Fix error and no emit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} +3:: No Change run with emit +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] +} +Clean: { + "./src/indirectclass.ts": [ + "./src/class.ts" + ] +} \ No newline at end of file diff --git a/tests/baselines/reference/tsc/incremental/when-new-file-is-added-to-the-referenced-project-discrepancies.js b/tests/baselines/reference/tsc/incremental/when-new-file-is-added-to-the-referenced-project-discrepancies.js new file mode 100644 index 00000000000..aac6933253d --- /dev/null +++ b/tests/baselines/reference/tsc/incremental/when-new-file-is-added-to-the-referenced-project-discrepancies.js @@ -0,0 +1,112 @@ +0:: Add class3 to project1 and build it +Ts buildinfo will not be updated in incremental build so it will have semantic diagnostics cached from previous build +But in clean build because of global diagnostics, semantic diagnostics are not queried so not cached in tsbuildinfo +TsBuild info text without affectedFilesPendingEmit:: /src/projects/project2/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "program": { + "fileInfos": { + "../../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../project1/class1.d.ts": { + "version": "-3469237238-declare class class1 {}", + "affectsGlobalScope": true + }, + "./class2.ts": { + "version": "777969115-class class2 {}", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "module": 0 + } + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "program": { + "fileInfos": { + "../../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../project1/class1.d.ts": { + "version": "-3469237238-declare class class1 {}", + "affectsGlobalScope": true + }, + "./class2.ts": { + "version": "777969115-class class2 {}", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "module": 0 + }, + "semanticDiagnosticsPerFile": [ + "../../../lib/lib.d.ts", + "../project1/class1.d.ts", + "./class2.ts" + ] + }, + "version": "FakeTSVersion" +} +3:: Delete output for class3 +Ts buildinfo will be updated but will retain lib file errors from previous build and not others because they are emitted because of change which results in clearing their semantic diagnostics cache +But in clean build because of global diagnostics, semantic diagnostics are not queried so not cached in tsbuildinfo +TsBuild info text without affectedFilesPendingEmit:: /src/projects/project2/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "program": { + "fileInfos": { + "../../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../project1/class1.d.ts": { + "version": "-3469237238-declare class class1 {}", + "affectsGlobalScope": true + }, + "./class2.ts": { + "version": "777969115-class class2 {}", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "module": 0 + } + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "program": { + "fileInfos": { + "../../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../project1/class1.d.ts": { + "version": "-3469237238-declare class class1 {}", + "affectsGlobalScope": true + }, + "./class2.ts": { + "version": "777969115-class class2 {}", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "module": 0 + }, + "semanticDiagnosticsPerFile": [ + "../../../lib/lib.d.ts" + ] + }, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsc/incremental/with-noEmitOnError-semantic-errors-discrepancies.js b/tests/baselines/reference/tsc/incremental/with-noEmitOnError-semantic-errors-discrepancies.js new file mode 100644 index 00000000000..86eb6bdb396 --- /dev/null +++ b/tests/baselines/reference/tsc/incremental/with-noEmitOnError-semantic-errors-discrepancies.js @@ -0,0 +1,10 @@ +0:: no-change-run +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "../src/main.ts": [ + "../shared/types/db.ts" + ] +} +Clean: {} \ No newline at end of file diff --git a/tests/baselines/reference/tsc/incremental/with-noEmitOnError-syntax-errors-discrepancies.js b/tests/baselines/reference/tsc/incremental/with-noEmitOnError-syntax-errors-discrepancies.js new file mode 100644 index 00000000000..86eb6bdb396 --- /dev/null +++ b/tests/baselines/reference/tsc/incremental/with-noEmitOnError-syntax-errors-discrepancies.js @@ -0,0 +1,10 @@ +0:: no-change-run +Incremental build did not emit and has .ts as signature so exports has all imported modules/referenced files +Clean build always uses d.ts for signature for testing thus does not contain non exported modules/referenced files that arent needed +Incremental and clean size of maps do not match:: exportedModulesMap:: File:: /src/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt +Incremental: { + "../src/main.ts": [ + "../shared/types/db.ts" + ] +} +Clean: {} \ No newline at end of file diff --git a/tests/baselines/reference/tscWatch/projectsWithReferences/on-sample-project.js b/tests/baselines/reference/tscWatch/projectsWithReferences/on-sample-project.js index 7061d5941e4..61b51a6589a 100644 --- a/tests/baselines/reference/tscWatch/projectsWithReferences/on-sample-project.js +++ b/tests/baselines/reference/tscWatch/projectsWithReferences/on-sample-project.js @@ -123,6 +123,54 @@ export declare function multiply(a: number, b: number): number; //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./anothermodule.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-2676574883-export const World = \"hello\";\r\n","signature":"-9234818176-export declare const World = \"hello\";\n"},{"version":"-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n","signature":"-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n"},{"version":"-9253692965-declare const dts: any;\r\n","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"skipDefaultLibCheck":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3,4]},"version":"FakeTSVersion"} +//// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./anothermodule.ts": { + "version": "-2676574883-export const World = \"hello\";\r\n", + "signature": "-9234818176-export declare const World = \"hello\";\n" + }, + "./index.ts": { + "version": "-18749805970-export const someString: string = \"HELLO WORLD\";\r\nexport function leftPad(s: string, n: number) { return s + n; }\r\nexport function multiply(a: number, b: number) { return a * b; }\r\n", + "signature": "-7362568283-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n" + }, + "./some_decl.d.ts": { + "version": "-9253692965-declare const dts: any;\r\n", + "signature": "-9253692965-declare const dts: any;\r\n", + "affectsGlobalScope": true + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationMap": true, + "skipDefaultLibCheck": true + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "./anothermodule.ts", + "./index.ts", + "./some_decl.d.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1355 +} + //// [/user/username/projects/sample1/logic/index.js.map] {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,SAAgB,eAAe;IAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,0CAEC;AACD,2CAA6C;AAChC,QAAA,CAAC,GAAG,GAAG,CAAC"} @@ -148,6 +196,71 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "./index.ts": { + "version": "-5786964698-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1472 +} + //// [/user/username/projects/sample1/tests/index.js] "use strict"; exports.__esModule = true; @@ -168,13 +281,91 @@ export declare const m: typeof mod; //// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","../logic/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map","-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n",{"version":"12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n","signature":"2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true},"fileIdsList":[[3],[2,3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,1]],"semanticDiagnosticsPerFile":[1,3,2,4,5]},"version":"FakeTSVersion"} +//// [/user/username/projects/sample1/tests/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/anothermodule.d.ts" + ], + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "../logic/index.d.ts": { + "version": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + }, + "./index.ts": { + "version": "12336236525-import * as c from '../core/index';\r\nimport * as logic from '../logic/index';\r\n\r\nc.leftPad(\"\", 10);\r\nlogic.getSecondsInDay();\r\n\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\n", + "signature": "2702201019-import * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true + }, + "referencedMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "../logic/index.d.ts" + ] + }, + "exportedModulesMap": { + "../logic/index.d.ts": [ + "../core/anothermodule.d.ts" + ], + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "../logic/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1617 +} + /a/lib/tsc.js -w -p tests Output:: >> Screen clear -[12:01:07 AM] Starting compilation in watch mode... +[12:01:13 AM] Starting compilation in watch mode... -[12:01:08 AM] Found 0 errors. Watching for file changes. +[12:01:14 AM] Found 0 errors. Watching for file changes. @@ -278,12 +469,77 @@ function foo() { } //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-4111660551-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\nfunction foo() { }","signature":"-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "./index.ts": { + "version": "-4111660551-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\nfunction foo() { }", + "signature": "-9659407152-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1490 +} + Output:: >> Screen clear -[12:01:23 AM] File change detected. Starting incremental compilation... +[12:01:32 AM] File change detected. Starting incremental compilation... -[12:01:24 AM] Found 0 errors. Watching for file changes. +[12:01:33 AM] Found 0 errors. Watching for file changes. @@ -395,12 +651,77 @@ export declare function gfoo(): void; //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-380817803-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\nfunction foo() { }export function gfoo() { }","signature":"-11367551051-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\nexport declare function gfoo(): void;\n"}],"options":{"composite":true,"declaration":true,"skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "./index.ts": { + "version": "-380817803-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\nfunction foo() { }export function gfoo() { }", + "signature": "-11367551051-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\nexport declare function gfoo(): void;\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "skipDefaultLibCheck": true, + "sourceMap": true + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1555 +} + Output:: >> Screen clear -[12:01:39 AM] File change detected. Starting incremental compilation... +[12:01:51 AM] File change detected. Starting incremental compilation... -[12:01:49 AM] Found 0 errors. Watching for file changes. +[12:02:01 AM] Found 0 errors. Watching for file changes. @@ -583,6 +904,70 @@ exports.gfoo = gfoo; //// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../core/index.d.ts","../core/anothermodule.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map","-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map",{"version":"-380817803-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\nfunction foo() { }export function gfoo() { }","signature":"-11367551051-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\nexport declare function gfoo(): void;\n"}],"options":{"composite":true,"declaration":true,"declarationDir":"./decls"},"fileIdsList":[[2,3],[3]],"referencedMap":[[4,1]],"exportedModulesMap":[[4,2]],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +//// [/user/username/projects/sample1/logic/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../core/index.d.ts", + "../core/anothermodule.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ], + [ + "../core/anothermodule.d.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../core/index.d.ts": { + "version": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map", + "signature": "-9047123202-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n//# sourceMappingURL=index.d.ts.map" + }, + "../core/anothermodule.d.ts": { + "version": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map", + "signature": "-4454971016-export declare const World = \"hello\";\n//# sourceMappingURL=anotherModule.d.ts.map" + }, + "./index.ts": { + "version": "-380817803-import * as c from '../core/index';\r\nexport function getSecondsInDay() {\r\n return c.multiply(10, 15);\r\n}\r\nimport * as mod from '../core/anotherModule';\r\nexport const m = mod;\r\nfunction foo() { }export function gfoo() { }", + "signature": "-11367551051-export declare function getSecondsInDay(): number;\nimport * as mod from '../core/anotherModule';\nexport declare const m: typeof mod;\nexport declare function gfoo(): void;\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "declarationDir": "./decls" + }, + "referencedMap": { + "./index.ts": [ + "../core/index.d.ts", + "../core/anothermodule.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../core/anothermodule.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../core/anothermodule.d.ts", + "../core/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1538 +} + //// [/user/username/projects/sample1/logic/decls/index.d.ts] export declare function getSecondsInDay(): number; import * as mod from '../core/anotherModule'; @@ -593,9 +978,9 @@ export declare function gfoo(): void; Output:: >> Screen clear -[12:02:06 AM] File change detected. Starting incremental compilation... +[12:02:22 AM] File change detected. Starting incremental compilation... -[12:02:16 AM] Found 0 errors. Watching for file changes. +[12:02:32 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-in-different-folders-with-no-files-clause.js b/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-in-different-folders-with-no-files-clause.js index 9c3980fa208..6cd4f1cec3e 100644 --- a/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-in-different-folders-with-no-files-clause.js +++ b/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-in-different-folders-with-no-files-clause.js @@ -59,6 +59,38 @@ export declare class A { //// [/user/username/projects/transitiveReferences/a/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-7264743946-export class A {}","signature":"-8728835846-export declare class A {\n}\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +//// [/user/username/projects/transitiveReferences/a/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "./index.ts" + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./index.ts": { + "version": "-7264743946-export class A {}", + "signature": "-8728835846-export declare class A {\n}\n" + } + }, + "options": { + "composite": true + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 718 +} + //// [/user/username/projects/transitiveReferences/b/index.js] "use strict"; exports.__esModule = true; @@ -75,6 +107,57 @@ export declare const b: A; //// [/user/username/projects/transitiveReferences/b/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../a/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-8728835846-export declare class A {\n}\n",{"version":"-2591036212-import {A} from '@ref/a';\nexport const b = new A();","signature":"-9732944696-import { A } from '@ref/a';\nexport declare const b: A;\n"}],"options":{"composite":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +//// [/user/username/projects/transitiveReferences/b/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../a/index.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../a/index.d.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../a/index.d.ts": { + "version": "-8728835846-export declare class A {\n}\n", + "signature": "-8728835846-export declare class A {\n}\n" + }, + "./index.ts": { + "version": "-2591036212-import {A} from '@ref/a';\nexport const b = new A();", + "signature": "-9732944696-import { A } from '@ref/a';\nexport declare const b: A;\n" + } + }, + "options": { + "composite": true + }, + "referencedMap": { + "./index.ts": [ + "../a/index.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../a/index.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../a/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 875 +} + //// [/user/username/projects/transitiveReferences/c/index.js] "use strict"; exports.__esModule = true; @@ -88,9 +171,9 @@ a_1.X; /a/lib/tsc.js -w -p c Output:: >> Screen clear -[12:00:53 AM] Starting compilation in watch mode... +[12:00:57 AM] Starting compilation in watch mode... -[12:00:57 AM] Found 0 errors. Watching for file changes. +[12:01:01 AM] Found 0 errors. Watching for file changes. @@ -210,12 +293,63 @@ export declare function gfoo(): void; //// [/user/username/projects/transitiveReferences/b/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../a/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-8728835846-export declare class A {\n}\n",{"version":"1841609480-import {A} from '@ref/a';\nexport const b = new A();export function gfoo() { }","signature":"4376023469-import { A } from '@ref/a';\nexport declare const b: A;\nexport declare function gfoo(): void;\n"}],"options":{"composite":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +//// [/user/username/projects/transitiveReferences/b/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../a/index.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../a/index.d.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../a/index.d.ts": { + "version": "-8728835846-export declare class A {\n}\n", + "signature": "-8728835846-export declare class A {\n}\n" + }, + "./index.ts": { + "version": "1841609480-import {A} from '@ref/a';\nexport const b = new A();export function gfoo() { }", + "signature": "4376023469-import { A } from '@ref/a';\nexport declare const b: A;\nexport declare function gfoo(): void;\n" + } + }, + "options": { + "composite": true + }, + "referencedMap": { + "./index.ts": [ + "../a/index.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../a/index.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../a/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 938 +} + Output:: >> Screen clear -[12:01:09 AM] File change detected. Starting incremental compilation... +[12:01:16 AM] File change detected. Starting incremental compilation... -[12:01:13 AM] Found 0 errors. Watching for file changes. +[12:01:20 AM] Found 0 errors. Watching for file changes. @@ -313,9 +447,9 @@ export class A {} Output:: >> Screen clear -[12:01:21 AM] File change detected. Starting incremental compilation... +[12:01:28 AM] File change detected. Starting incremental compilation... -[12:01:25 AM] Found 0 errors. Watching for file changes. +[12:01:32 AM] Found 0 errors. Watching for file changes. @@ -412,9 +546,9 @@ Input:: Output:: >> Screen clear -[12:01:29 AM] File change detected. Starting incremental compilation... +[12:01:36 AM] File change detected. Starting incremental compilation... -[12:01:33 AM] Found 0 errors. Watching for file changes. +[12:01:40 AM] Found 0 errors. Watching for file changes. @@ -511,9 +645,9 @@ Input:: Output:: >> Screen clear -[12:01:37 AM] File change detected. Starting incremental compilation... +[12:01:44 AM] File change detected. Starting incremental compilation... -[12:01:38 AM] Found 0 errors. Watching for file changes. +[12:01:45 AM] Found 0 errors. Watching for file changes. @@ -606,9 +740,9 @@ Input:: Output:: >> Screen clear -[12:01:42 AM] File change detected. Starting incremental compilation... +[12:01:49 AM] File change detected. Starting incremental compilation... -[12:01:43 AM] Found 0 errors. Watching for file changes. +[12:01:50 AM] Found 0 errors. Watching for file changes. @@ -688,14 +822,14 @@ Input:: Output:: >> Screen clear -[12:01:45 AM] File change detected. Starting incremental compilation... +[12:01:52 AM] File change detected. Starting incremental compilation... c/tsconfig.json:1:84 - error TS6053: File '/user/username/projects/transitiveReferences/b' not found. 1 {"compilerOptions":{"baseUrl":"./","paths":{"@ref/*":["../refs/*"]}},"references":[{"path":"../b"}]}    ~~~~~~~~~~~~~~~ -[12:01:52 AM] Found 1 error. Watching for file changes. +[12:01:59 AM] Found 1 error. Watching for file changes. @@ -776,9 +910,9 @@ Input:: Output:: >> Screen clear -[12:01:55 AM] File change detected. Starting incremental compilation... +[12:02:02 AM] File change detected. Starting incremental compilation... -[12:01:59 AM] Found 0 errors. Watching for file changes. +[12:02:06 AM] Found 0 errors. Watching for file changes. @@ -873,14 +1007,14 @@ Input:: Output:: >> Screen clear -[12:02:01 AM] File change detected. Starting incremental compilation... +[12:02:08 AM] File change detected. Starting incremental compilation... b/tsconfig.json:1:96 - error TS6053: File '/user/username/projects/transitiveReferences/a' not found. 1 {"compilerOptions":{"composite":true,"baseUrl":"./","paths":{"@ref/*":["../*"]}},"references":[{"path":"../a"}]}    ~~~~~~~~~~~~~~~ -[12:02:05 AM] Found 1 error. Watching for file changes. +[12:02:12 AM] Found 1 error. Watching for file changes. @@ -972,9 +1106,9 @@ Input:: Output:: >> Screen clear -[12:02:08 AM] File change detected. Starting incremental compilation... +[12:02:15 AM] File change detected. Starting incremental compilation... -[12:02:09 AM] Found 0 errors. Watching for file changes. +[12:02:16 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-in-different-folders.js b/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-in-different-folders.js index f84905a3c35..317f977848d 100644 --- a/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-in-different-folders.js +++ b/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references-in-different-folders.js @@ -59,6 +59,38 @@ export declare class A { //// [/user/username/projects/transitiveReferences/a/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../a/lib/lib.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-7264743946-export class A {}","signature":"-8728835846-export declare class A {\n}\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +//// [/user/username/projects/transitiveReferences/a/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "./index.ts" + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./index.ts": { + "version": "-7264743946-export class A {}", + "signature": "-8728835846-export declare class A {\n}\n" + } + }, + "options": { + "composite": true + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 718 +} + //// [/user/username/projects/transitiveReferences/b/index.js] "use strict"; exports.__esModule = true; @@ -75,6 +107,57 @@ export declare const b: A; //// [/user/username/projects/transitiveReferences/b/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../a/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-8728835846-export declare class A {\n}\n",{"version":"-2591036212-import {A} from '@ref/a';\nexport const b = new A();","signature":"-9732944696-import { A } from '@ref/a';\nexport declare const b: A;\n"}],"options":{"composite":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +//// [/user/username/projects/transitiveReferences/b/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../a/index.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../a/index.d.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../a/index.d.ts": { + "version": "-8728835846-export declare class A {\n}\n", + "signature": "-8728835846-export declare class A {\n}\n" + }, + "./index.ts": { + "version": "-2591036212-import {A} from '@ref/a';\nexport const b = new A();", + "signature": "-9732944696-import { A } from '@ref/a';\nexport declare const b: A;\n" + } + }, + "options": { + "composite": true + }, + "referencedMap": { + "./index.ts": [ + "../a/index.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../a/index.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../a/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 875 +} + //// [/user/username/projects/transitiveReferences/c/index.js] "use strict"; exports.__esModule = true; @@ -88,9 +171,9 @@ a_1.X; /a/lib/tsc.js -w -p c Output:: >> Screen clear -[12:00:53 AM] Starting compilation in watch mode... +[12:00:57 AM] Starting compilation in watch mode... -[12:00:57 AM] Found 0 errors. Watching for file changes. +[12:01:01 AM] Found 0 errors. Watching for file changes. @@ -206,12 +289,63 @@ export declare function gfoo(): void; //// [/user/username/projects/transitiveReferences/b/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../a/lib/lib.d.ts","../a/index.d.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-8728835846-export declare class A {\n}\n",{"version":"1841609480-import {A} from '@ref/a';\nexport const b = new A();export function gfoo() { }","signature":"4376023469-import { A } from '@ref/a';\nexport declare const b: A;\nexport declare function gfoo(): void;\n"}],"options":{"composite":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +//// [/user/username/projects/transitiveReferences/b/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../a/index.d.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../a/index.d.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../a/index.d.ts": { + "version": "-8728835846-export declare class A {\n}\n", + "signature": "-8728835846-export declare class A {\n}\n" + }, + "./index.ts": { + "version": "1841609480-import {A} from '@ref/a';\nexport const b = new A();export function gfoo() { }", + "signature": "4376023469-import { A } from '@ref/a';\nexport declare const b: A;\nexport declare function gfoo(): void;\n" + } + }, + "options": { + "composite": true + }, + "referencedMap": { + "./index.ts": [ + "../a/index.d.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "../a/index.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../a/lib/lib.d.ts", + "../a/index.d.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 938 +} + Output:: >> Screen clear -[12:01:09 AM] File change detected. Starting incremental compilation... +[12:01:16 AM] File change detected. Starting incremental compilation... -[12:01:13 AM] Found 0 errors. Watching for file changes. +[12:01:20 AM] Found 0 errors. Watching for file changes. @@ -305,9 +439,9 @@ export class A {} Output:: >> Screen clear -[12:01:21 AM] File change detected. Starting incremental compilation... +[12:01:28 AM] File change detected. Starting incremental compilation... -[12:01:25 AM] Found 0 errors. Watching for file changes. +[12:01:32 AM] Found 0 errors. Watching for file changes. @@ -400,9 +534,9 @@ Input:: Output:: >> Screen clear -[12:01:29 AM] File change detected. Starting incremental compilation... +[12:01:36 AM] File change detected. Starting incremental compilation... -[12:01:33 AM] Found 0 errors. Watching for file changes. +[12:01:40 AM] Found 0 errors. Watching for file changes. @@ -495,9 +629,9 @@ Input:: Output:: >> Screen clear -[12:01:37 AM] File change detected. Starting incremental compilation... +[12:01:44 AM] File change detected. Starting incremental compilation... -[12:01:38 AM] Found 0 errors. Watching for file changes. +[12:01:45 AM] Found 0 errors. Watching for file changes. @@ -585,9 +719,9 @@ Input:: Output:: >> Screen clear -[12:01:42 AM] File change detected. Starting incremental compilation... +[12:01:49 AM] File change detected. Starting incremental compilation... -[12:01:43 AM] Found 0 errors. Watching for file changes. +[12:01:50 AM] Found 0 errors. Watching for file changes. @@ -662,14 +796,14 @@ Input:: Output:: >> Screen clear -[12:01:45 AM] File change detected. Starting incremental compilation... +[12:01:52 AM] File change detected. Starting incremental compilation... c/tsconfig.json:1:105 - error TS6053: File '/user/username/projects/transitiveReferences/b' not found. 1 {"compilerOptions":{"baseUrl":"./","paths":{"@ref/*":["../refs/*"]}},"files":["index.ts"],"references":[{"path":"../b"}]}    ~~~~~~~~~~~~~~~ -[12:01:52 AM] Found 1 error. Watching for file changes. +[12:01:59 AM] Found 1 error. Watching for file changes. @@ -748,9 +882,9 @@ Input:: Output:: >> Screen clear -[12:01:55 AM] File change detected. Starting incremental compilation... +[12:02:02 AM] File change detected. Starting incremental compilation... -[12:01:59 AM] Found 0 errors. Watching for file changes. +[12:02:06 AM] Found 0 errors. Watching for file changes. @@ -841,14 +975,14 @@ Input:: Output:: >> Screen clear -[12:02:01 AM] File change detected. Starting incremental compilation... +[12:02:08 AM] File change detected. Starting incremental compilation... b/tsconfig.json:1:117 - error TS6053: File '/user/username/projects/transitiveReferences/a' not found. 1 {"compilerOptions":{"composite":true,"baseUrl":"./","paths":{"@ref/*":["../*"]}},"files":["index.ts"],"references":[{"path":"../a"}]}    ~~~~~~~~~~~~~~~ -[12:02:05 AM] Found 1 error. Watching for file changes. +[12:02:12 AM] Found 1 error. Watching for file changes. @@ -937,9 +1071,9 @@ Input:: Output:: >> Screen clear -[12:02:08 AM] File change detected. Starting incremental compilation... +[12:02:15 AM] File change detected. Starting incremental compilation... -[12:02:09 AM] Found 0 errors. Watching for file changes. +[12:02:16 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references.js b/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references.js index 61c04af60d0..1ff6e1dd598 100644 --- a/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references.js +++ b/tests/baselines/reference/tscWatch/projectsWithReferences/on-transitive-references.js @@ -83,6 +83,38 @@ export declare class A { //// [/user/username/projects/transitiveReferences/tsconfig.a.tsbuildinfo] {"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-8566332115-export class A {}\r\n","signature":"-8728835846-export declare class A {\n}\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +//// [/user/username/projects/transitiveReferences/tsconfig.a.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-8566332115-export class A {}\r\n", + "signature": "-8728835846-export declare class A {\n}\n" + } + }, + "options": { + "composite": true + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ] + }, + "version": "FakeTSVersion", + "size": 715 +} + //// [/user/username/projects/transitiveReferences/b.js] "use strict"; exports.__esModule = true; @@ -99,6 +131,57 @@ export declare const b: A; //// [/user/username/projects/transitiveReferences/tsconfig.b.tsbuildinfo] {"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.d.ts","./b.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-8728835846-export declare class A {\n}\n",{"version":"-13104686224-import {A} from '@ref/a';\r\nexport const b = new A();\r\n","signature":"-9732944696-import { A } from '@ref/a';\nexport declare const b: A;\n"}],"options":{"composite":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +//// [/user/username/projects/transitiveReferences/tsconfig.b.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.d.ts", + "./b.ts" + ], + "fileNamesList": [ + [ + "./a.d.ts" + ] + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./a.d.ts": { + "version": "-8728835846-export declare class A {\n}\n", + "signature": "-8728835846-export declare class A {\n}\n" + }, + "./b.ts": { + "version": "-13104686224-import {A} from '@ref/a';\r\nexport const b = new A();\r\n", + "signature": "-9732944696-import { A } from '@ref/a';\nexport declare const b: A;\n" + } + }, + "options": { + "composite": true + }, + "referencedMap": { + "./b.ts": [ + "./a.d.ts" + ] + }, + "exportedModulesMap": { + "./b.ts": [ + "./a.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "./a.d.ts", + "./b.ts" + ] + }, + "version": "FakeTSVersion", + "size": 868 +} + //// [/user/username/projects/transitiveReferences/c.js] "use strict"; exports.__esModule = true; @@ -112,9 +195,9 @@ a_1.X; /a/lib/tsc.js -w -p tsconfig.c.json Output:: >> Screen clear -[12:00:47 AM] Starting compilation in watch mode... +[12:00:51 AM] Starting compilation in watch mode... -[12:00:51 AM] Found 0 errors. Watching for file changes. +[12:00:55 AM] Found 0 errors. Watching for file changes. @@ -219,12 +302,63 @@ export declare function gfoo(): void; //// [/user/username/projects/transitiveReferences/tsconfig.b.tsbuildinfo] {"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.d.ts","./b.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-8728835846-export declare class A {\n}\n",{"version":"-23418138964-import {A} from '@ref/a';\r\nexport const b = new A();\r\nexport function gfoo() { }","signature":"4376023469-import { A } from '@ref/a';\nexport declare const b: A;\nexport declare function gfoo(): void;\n"}],"options":{"composite":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +//// [/user/username/projects/transitiveReferences/tsconfig.b.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.d.ts", + "./b.ts" + ], + "fileNamesList": [ + [ + "./a.d.ts" + ] + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./a.d.ts": { + "version": "-8728835846-export declare class A {\n}\n", + "signature": "-8728835846-export declare class A {\n}\n" + }, + "./b.ts": { + "version": "-23418138964-import {A} from '@ref/a';\r\nexport const b = new A();\r\nexport function gfoo() { }", + "signature": "4376023469-import { A } from '@ref/a';\nexport declare const b: A;\nexport declare function gfoo(): void;\n" + } + }, + "options": { + "composite": true + }, + "referencedMap": { + "./b.ts": [ + "./a.d.ts" + ] + }, + "exportedModulesMap": { + "./b.ts": [ + "./a.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "./a.d.ts", + "./b.ts" + ] + }, + "version": "FakeTSVersion", + "size": 932 +} + Output:: >> Screen clear -[12:01:03 AM] File change detected. Starting incremental compilation... +[12:01:10 AM] File change detected. Starting incremental compilation... -[12:01:07 AM] Found 0 errors. Watching for file changes. +[12:01:14 AM] Found 0 errors. Watching for file changes. @@ -310,9 +444,9 @@ export class A {} Output:: >> Screen clear -[12:01:15 AM] File change detected. Starting incremental compilation... +[12:01:22 AM] File change detected. Starting incremental compilation... -[12:01:19 AM] Found 0 errors. Watching for file changes. +[12:01:26 AM] Found 0 errors. Watching for file changes. @@ -393,9 +527,9 @@ Input:: Output:: >> Screen clear -[12:01:23 AM] File change detected. Starting incremental compilation... +[12:01:30 AM] File change detected. Starting incremental compilation... -[12:01:27 AM] Found 0 errors. Watching for file changes. +[12:01:34 AM] Found 0 errors. Watching for file changes. @@ -476,9 +610,9 @@ Input:: Output:: >> Screen clear -[12:01:31 AM] File change detected. Starting incremental compilation... +[12:01:38 AM] File change detected. Starting incremental compilation... -[12:01:32 AM] Found 0 errors. Watching for file changes. +[12:01:39 AM] Found 0 errors. Watching for file changes. @@ -560,9 +694,9 @@ Input:: Output:: >> Screen clear -[12:01:36 AM] File change detected. Starting incremental compilation... +[12:01:43 AM] File change detected. Starting incremental compilation... -[12:01:37 AM] Found 0 errors. Watching for file changes. +[12:01:44 AM] Found 0 errors. Watching for file changes. @@ -631,14 +765,14 @@ Input:: Output:: >> Screen clear -[12:01:39 AM] File change detected. Starting incremental compilation... +[12:01:46 AM] File change detected. Starting incremental compilation... tsconfig.c.json:1:100 - error TS6053: File '/user/username/projects/transitiveReferences/tsconfig.b.json' not found. 1 {"files":["c.ts"],"compilerOptions":{"baseUrl":"./","paths":{"@ref/*":["./refs/*"]}},"references":[{"path":"tsconfig.b.json"}]}    ~~~~~~~~~~~~~~~~~~~~~~~~~~ -[12:01:46 AM] Found 1 error. Watching for file changes. +[12:01:53 AM] Found 1 error. Watching for file changes. @@ -722,9 +856,9 @@ Input:: Output:: >> Screen clear -[12:01:49 AM] File change detected. Starting incremental compilation... +[12:01:56 AM] File change detected. Starting incremental compilation... -[12:01:53 AM] Found 0 errors. Watching for file changes. +[12:02:00 AM] Found 0 errors. Watching for file changes. @@ -805,14 +939,14 @@ Input:: Output:: >> Screen clear -[12:01:55 AM] File change detected. Starting incremental compilation... +[12:02:02 AM] File change detected. Starting incremental compilation... tsconfig.b.json:10:21 - error TS6053: File '/user/username/projects/transitiveReferences/tsconfig.a.json' not found. 10 "references": [ { "path": "tsconfig.a.json" } ]    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -[12:01:59 AM] Found 1 error. Watching for file changes. +[12:02:06 AM] Found 1 error. Watching for file changes. @@ -894,9 +1028,9 @@ Input:: Output:: >> Screen clear -[12:02:02 AM] File change detected. Starting incremental compilation... +[12:02:09 AM] File change detected. Starting incremental compilation... -[12:02:03 AM] Found 0 errors. Watching for file changes. +[12:02:10 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/projectsWithReferences/when-referenced-project-uses-different-module-resolution.js b/tests/baselines/reference/tscWatch/projectsWithReferences/when-referenced-project-uses-different-module-resolution.js index c51c0f5a49c..4d3501b96fe 100644 --- a/tests/baselines/reference/tscWatch/projectsWithReferences/when-referenced-project-uses-different-module-resolution.js +++ b/tests/baselines/reference/tscWatch/projectsWithReferences/when-referenced-project-uses-different-module-resolution.js @@ -70,6 +70,38 @@ export declare class A { //// [/user/username/projects/transitiveReferences/tsconfig.a.tsbuildinfo] {"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-8566332115-export class A {}\r\n","signature":"-8728835846-export declare class A {\n}\n"}],"options":{"composite":true},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +//// [/user/username/projects/transitiveReferences/tsconfig.a.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-8566332115-export class A {}\r\n", + "signature": "-8728835846-export declare class A {\n}\n" + } + }, + "options": { + "composite": true + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ] + }, + "version": "FakeTSVersion", + "size": 715 +} + //// [/user/username/projects/transitiveReferences/b.js] "use strict"; exports.__esModule = true; @@ -86,6 +118,57 @@ export declare const b: A; //// [/user/username/projects/transitiveReferences/tsconfig.b.tsbuildinfo] {"program":{"fileNames":["../../../../a/lib/lib.d.ts","./a.d.ts","./b.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-8728835846-export declare class A {\n}\n",{"version":"-19869990292-import {A} from \"a\";export const b = new A();","signature":"1870369234-import { A } from \"a\";\nexport declare const b: A;\n"}],"options":{"composite":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +//// [/user/username/projects/transitiveReferences/tsconfig.b.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.d.ts", + "./b.ts" + ], + "fileNamesList": [ + [ + "./a.d.ts" + ] + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./a.d.ts": { + "version": "-8728835846-export declare class A {\n}\n", + "signature": "-8728835846-export declare class A {\n}\n" + }, + "./b.ts": { + "version": "-19869990292-import {A} from \"a\";export const b = new A();", + "signature": "1870369234-import { A } from \"a\";\nexport declare const b: A;\n" + } + }, + "options": { + "composite": true + }, + "referencedMap": { + "./b.ts": [ + "./a.d.ts" + ] + }, + "exportedModulesMap": { + "./b.ts": [ + "./a.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../a/lib/lib.d.ts", + "./a.d.ts", + "./b.ts" + ] + }, + "version": "FakeTSVersion", + "size": 853 +} + //// [/user/username/projects/transitiveReferences/c.js] "use strict"; exports.__esModule = true; @@ -99,9 +182,9 @@ a_1.X; /a/lib/tsc.js -w -p tsconfig.c.json Output:: >> Screen clear -[12:00:47 AM] Starting compilation in watch mode... +[12:00:51 AM] Starting compilation in watch mode... -[12:00:51 AM] Found 0 errors. Watching for file changes. +[12:00:55 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-when-solution-is-already-built.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-when-solution-is-already-built.js index 07f44428af7..dfcb553d113 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-when-solution-is-already-built.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-when-solution-is-already-built.js @@ -62,6 +62,46 @@ export declare function foo(): void; //// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/bar.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"1045484683-export function bar() { }","signature":"-2904461644-export declare function bar(): void;\n"},{"version":"4646078106-export function foo() { }","signature":"-5677608893-export declare function foo(): void;\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +//// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../../a/lib/lib.d.ts", + "./src/bar.ts", + "./src/index.ts" + ], + "fileInfos": { + "../../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./src/bar.ts": { + "version": "1045484683-export function bar() { }", + "signature": "-2904461644-export declare function bar(): void;\n" + }, + "./src/index.ts": { + "version": "4646078106-export function foo() { }", + "signature": "-5677608893-export declare function foo(): void;\n" + } + }, + "options": { + "composite": true, + "outDir": "./lib", + "rootDir": "./src" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../../a/lib/lib.d.ts", + "./src/bar.ts", + "./src/index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 909 +} + //// [/user/username/projects/myproject/packages/A/lib/index.js] "use strict"; exports.__esModule = true; @@ -78,13 +118,70 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/lib/index.d.ts","../b/lib/bar.d.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n",{"version":"3563314629-import { foo } from 'b';\nimport { bar } from 'b/lib/bar';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +//// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../../a/lib/lib.d.ts", + "../b/lib/index.d.ts", + "../b/lib/bar.d.ts", + "./src/index.ts" + ], + "fileNamesList": [ + [ + "../b/lib/index.d.ts", + "../b/lib/bar.d.ts" + ] + ], + "fileInfos": { + "../../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../b/lib/index.d.ts": { + "version": "-5677608893-export declare function foo(): void;\n", + "signature": "-5677608893-export declare function foo(): void;\n" + }, + "../b/lib/bar.d.ts": { + "version": "-2904461644-export declare function bar(): void;\n", + "signature": "-2904461644-export declare function bar(): void;\n" + }, + "./src/index.ts": { + "version": "3563314629-import { foo } from 'b';\nimport { bar } from 'b/lib/bar';\nfoo();\nbar();\n", + "signature": "-3531856636-export {};\n" + } + }, + "options": { + "composite": true, + "outDir": "./lib", + "rootDir": "./src" + }, + "referencedMap": { + "./src/index.ts": [ + "../b/lib/index.d.ts", + "../b/lib/bar.d.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../../a/lib/lib.d.ts", + "./src/index.ts", + "../b/lib/bar.d.ts", + "../b/lib/index.d.ts" + ] + }, + "version": "FakeTSVersion", + "size": 980 +} + /a/lib/tsc.js --w --p /user/username/projects/myproject/packages/A/tsconfig.json Output:: >> Screen clear -[12:01:05 AM] Starting compilation in watch mode... +[12:01:09 AM] Starting compilation in watch mode... -[12:01:15 AM] Found 0 errors. Watching for file changes. +[12:01:19 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-preserveSymlinks-when-solution-is-already-built.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-preserveSymlinks-when-solution-is-already-built.js index 1e1039ec1e9..8d9938e3c2f 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-preserveSymlinks-when-solution-is-already-built.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-preserveSymlinks-when-solution-is-already-built.js @@ -62,6 +62,46 @@ export declare function foo(): void; //// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/bar.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"1045484683-export function bar() { }","signature":"-2904461644-export declare function bar(): void;\n"},{"version":"4646078106-export function foo() { }","signature":"-5677608893-export declare function foo(): void;\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +//// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../../a/lib/lib.d.ts", + "./src/bar.ts", + "./src/index.ts" + ], + "fileInfos": { + "../../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./src/bar.ts": { + "version": "1045484683-export function bar() { }", + "signature": "-2904461644-export declare function bar(): void;\n" + }, + "./src/index.ts": { + "version": "4646078106-export function foo() { }", + "signature": "-5677608893-export declare function foo(): void;\n" + } + }, + "options": { + "composite": true, + "outDir": "./lib", + "rootDir": "./src" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../../a/lib/lib.d.ts", + "./src/bar.ts", + "./src/index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 909 +} + //// [/user/username/projects/myproject/packages/A/lib/index.js] "use strict"; exports.__esModule = true; @@ -78,13 +118,70 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../node_modules/b/lib/index.d.ts","../../node_modules/b/lib/bar.d.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n",{"version":"3563314629-import { foo } from 'b';\nimport { bar } from 'b/lib/bar';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +//// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../../a/lib/lib.d.ts", + "../../node_modules/b/lib/index.d.ts", + "../../node_modules/b/lib/bar.d.ts", + "./src/index.ts" + ], + "fileNamesList": [ + [ + "../../node_modules/b/lib/index.d.ts", + "../../node_modules/b/lib/bar.d.ts" + ] + ], + "fileInfos": { + "../../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../../node_modules/b/lib/index.d.ts": { + "version": "-5677608893-export declare function foo(): void;\n", + "signature": "-5677608893-export declare function foo(): void;\n" + }, + "../../node_modules/b/lib/bar.d.ts": { + "version": "-2904461644-export declare function bar(): void;\n", + "signature": "-2904461644-export declare function bar(): void;\n" + }, + "./src/index.ts": { + "version": "3563314629-import { foo } from 'b';\nimport { bar } from 'b/lib/bar';\nfoo();\nbar();\n", + "signature": "-3531856636-export {};\n" + } + }, + "options": { + "composite": true, + "outDir": "./lib", + "rootDir": "./src" + }, + "referencedMap": { + "./src/index.ts": [ + "../../node_modules/b/lib/index.d.ts", + "../../node_modules/b/lib/bar.d.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../../a/lib/lib.d.ts", + "../../node_modules/b/lib/bar.d.ts", + "../../node_modules/b/lib/index.d.ts", + "./src/index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1012 +} + /a/lib/tsc.js --w --p /user/username/projects/myproject/packages/A/tsconfig.json Output:: >> Screen clear -[12:01:05 AM] Starting compilation in watch mode... +[12:01:09 AM] Starting compilation in watch mode... -[12:01:15 AM] Found 0 errors. Watching for file changes. +[12:01:19 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package-when-solution-is-already-built.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package-when-solution-is-already-built.js index 866ea8b1099..1fa905db820 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package-when-solution-is-already-built.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package-when-solution-is-already-built.js @@ -62,6 +62,46 @@ export declare function foo(): void; //// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/bar.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"1045484683-export function bar() { }","signature":"-2904461644-export declare function bar(): void;\n"},{"version":"4646078106-export function foo() { }","signature":"-5677608893-export declare function foo(): void;\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +//// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../../a/lib/lib.d.ts", + "./src/bar.ts", + "./src/index.ts" + ], + "fileInfos": { + "../../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./src/bar.ts": { + "version": "1045484683-export function bar() { }", + "signature": "-2904461644-export declare function bar(): void;\n" + }, + "./src/index.ts": { + "version": "4646078106-export function foo() { }", + "signature": "-5677608893-export declare function foo(): void;\n" + } + }, + "options": { + "composite": true, + "outDir": "./lib", + "rootDir": "./src" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../../a/lib/lib.d.ts", + "./src/bar.ts", + "./src/index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 909 +} + //// [/user/username/projects/myproject/packages/A/lib/index.js] "use strict"; exports.__esModule = true; @@ -78,13 +118,70 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/lib/index.d.ts","../b/lib/bar.d.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n",{"version":"8545527381-import { foo } from '@issue/b';\nimport { bar } from '@issue/b/lib/bar';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +//// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../../a/lib/lib.d.ts", + "../b/lib/index.d.ts", + "../b/lib/bar.d.ts", + "./src/index.ts" + ], + "fileNamesList": [ + [ + "../b/lib/index.d.ts", + "../b/lib/bar.d.ts" + ] + ], + "fileInfos": { + "../../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../b/lib/index.d.ts": { + "version": "-5677608893-export declare function foo(): void;\n", + "signature": "-5677608893-export declare function foo(): void;\n" + }, + "../b/lib/bar.d.ts": { + "version": "-2904461644-export declare function bar(): void;\n", + "signature": "-2904461644-export declare function bar(): void;\n" + }, + "./src/index.ts": { + "version": "8545527381-import { foo } from '@issue/b';\nimport { bar } from '@issue/b/lib/bar';\nfoo();\nbar();\n", + "signature": "-3531856636-export {};\n" + } + }, + "options": { + "composite": true, + "outDir": "./lib", + "rootDir": "./src" + }, + "referencedMap": { + "./src/index.ts": [ + "../b/lib/index.d.ts", + "../b/lib/bar.d.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../../a/lib/lib.d.ts", + "./src/index.ts", + "../b/lib/bar.d.ts", + "../b/lib/index.d.ts" + ] + }, + "version": "FakeTSVersion", + "size": 994 +} + /a/lib/tsc.js --w --p /user/username/projects/myproject/packages/A/tsconfig.json Output:: >> Screen clear -[12:01:07 AM] Starting compilation in watch mode... +[12:01:11 AM] Starting compilation in watch mode... -[12:01:17 AM] Found 0 errors. Watching for file changes. +[12:01:21 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package-with-preserveSymlinks-when-solution-is-already-built.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package-with-preserveSymlinks-when-solution-is-already-built.js index 78fc581a50d..ea4d108d802 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package-with-preserveSymlinks-when-solution-is-already-built.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-packageJson-has-types-field-with-scoped-package-with-preserveSymlinks-when-solution-is-already-built.js @@ -62,6 +62,46 @@ export declare function foo(): void; //// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/bar.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"1045484683-export function bar() { }","signature":"-2904461644-export declare function bar(): void;\n"},{"version":"4646078106-export function foo() { }","signature":"-5677608893-export declare function foo(): void;\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} +//// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../../a/lib/lib.d.ts", + "./src/bar.ts", + "./src/index.ts" + ], + "fileInfos": { + "../../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./src/bar.ts": { + "version": "1045484683-export function bar() { }", + "signature": "-2904461644-export declare function bar(): void;\n" + }, + "./src/index.ts": { + "version": "4646078106-export function foo() { }", + "signature": "-5677608893-export declare function foo(): void;\n" + } + }, + "options": { + "composite": true, + "outDir": "./lib", + "rootDir": "./src" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../../a/lib/lib.d.ts", + "./src/bar.ts", + "./src/index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 909 +} + //// [/user/username/projects/myproject/packages/A/lib/index.js] "use strict"; exports.__esModule = true; @@ -78,13 +118,70 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../node_modules/@issue/b/lib/index.d.ts","../../node_modules/@issue/b/lib/bar.d.ts","./src/index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n",{"version":"8545527381-import { foo } from '@issue/b';\nimport { bar } from '@issue/b/lib/bar';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +//// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../../a/lib/lib.d.ts", + "../../node_modules/@issue/b/lib/index.d.ts", + "../../node_modules/@issue/b/lib/bar.d.ts", + "./src/index.ts" + ], + "fileNamesList": [ + [ + "../../node_modules/@issue/b/lib/index.d.ts", + "../../node_modules/@issue/b/lib/bar.d.ts" + ] + ], + "fileInfos": { + "../../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../../node_modules/@issue/b/lib/index.d.ts": { + "version": "-5677608893-export declare function foo(): void;\n", + "signature": "-5677608893-export declare function foo(): void;\n" + }, + "../../node_modules/@issue/b/lib/bar.d.ts": { + "version": "-2904461644-export declare function bar(): void;\n", + "signature": "-2904461644-export declare function bar(): void;\n" + }, + "./src/index.ts": { + "version": "8545527381-import { foo } from '@issue/b';\nimport { bar } from '@issue/b/lib/bar';\nfoo();\nbar();\n", + "signature": "-3531856636-export {};\n" + } + }, + "options": { + "composite": true, + "outDir": "./lib", + "rootDir": "./src" + }, + "referencedMap": { + "./src/index.ts": [ + "../../node_modules/@issue/b/lib/index.d.ts", + "../../node_modules/@issue/b/lib/bar.d.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../../a/lib/lib.d.ts", + "../../node_modules/@issue/b/lib/bar.d.ts", + "../../node_modules/@issue/b/lib/index.d.ts", + "./src/index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1040 +} + /a/lib/tsc.js --w --p /user/username/projects/myproject/packages/A/tsconfig.json Output:: >> Screen clear -[12:01:07 AM] Starting compilation in watch mode... +[12:01:11 AM] Starting compilation in watch mode... -[12:01:17 AM] Found 0 errors. Watching for file changes. +[12:01:21 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-when-solution-is-already-built.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-when-solution-is-already-built.js index bca4f167cf5..fe04599afb4 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-when-solution-is-already-built.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-when-solution-is-already-built.js @@ -62,6 +62,46 @@ export declare function bar(): void; //// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/foo.ts","./src/bar/foo.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"4646078106-export function foo() { }","signature":"-5677608893-export declare function foo(): void;\n"},{"version":"1045484683-export function bar() { }","signature":"-2904461644-export declare function bar(): void;\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} +//// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../../a/lib/lib.d.ts", + "./src/foo.ts", + "./src/bar/foo.ts" + ], + "fileInfos": { + "../../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./src/foo.ts": { + "version": "4646078106-export function foo() { }", + "signature": "-5677608893-export declare function foo(): void;\n" + }, + "./src/bar/foo.ts": { + "version": "1045484683-export function bar() { }", + "signature": "-2904461644-export declare function bar(): void;\n" + } + }, + "options": { + "composite": true, + "outDir": "./lib", + "rootDir": "./src" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../../a/lib/lib.d.ts", + "./src/bar/foo.ts", + "./src/foo.ts" + ] + }, + "version": "FakeTSVersion", + "size": 911 +} + //// [/user/username/projects/myproject/packages/A/lib/test.js] "use strict"; exports.__esModule = true; @@ -78,13 +118,70 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/lib/foo.d.ts","../b/lib/bar/foo.d.ts","./src/test.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n",{"version":"14700910833-import { foo } from 'b/lib/foo';\nimport { bar } from 'b/lib/bar/foo';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +//// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../../a/lib/lib.d.ts", + "../b/lib/foo.d.ts", + "../b/lib/bar/foo.d.ts", + "./src/test.ts" + ], + "fileNamesList": [ + [ + "../b/lib/foo.d.ts", + "../b/lib/bar/foo.d.ts" + ] + ], + "fileInfos": { + "../../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../b/lib/foo.d.ts": { + "version": "-5677608893-export declare function foo(): void;\n", + "signature": "-5677608893-export declare function foo(): void;\n" + }, + "../b/lib/bar/foo.d.ts": { + "version": "-2904461644-export declare function bar(): void;\n", + "signature": "-2904461644-export declare function bar(): void;\n" + }, + "./src/test.ts": { + "version": "14700910833-import { foo } from 'b/lib/foo';\nimport { bar } from 'b/lib/bar/foo';\nfoo();\nbar();\n", + "signature": "-3531856636-export {};\n" + } + }, + "options": { + "composite": true, + "outDir": "./lib", + "rootDir": "./src" + }, + "referencedMap": { + "./src/test.ts": [ + "../b/lib/foo.d.ts", + "../b/lib/bar/foo.d.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../../a/lib/lib.d.ts", + "./src/test.ts", + "../b/lib/bar/foo.d.ts", + "../b/lib/foo.d.ts" + ] + }, + "version": "FakeTSVersion", + "size": 994 +} + /a/lib/tsc.js --w --p /user/username/projects/myproject/packages/A/tsconfig.json Output:: >> Screen clear -[12:01:10 AM] Starting compilation in watch mode... +[12:01:14 AM] Starting compilation in watch mode... -[12:01:20 AM] Found 0 errors. Watching for file changes. +[12:01:24 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-preserveSymlinks-when-solution-is-already-built.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-preserveSymlinks-when-solution-is-already-built.js index ad429535332..7ac28369d88 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-preserveSymlinks-when-solution-is-already-built.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-preserveSymlinks-when-solution-is-already-built.js @@ -62,6 +62,46 @@ export declare function bar(): void; //// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/foo.ts","./src/bar/foo.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"4646078106-export function foo() { }","signature":"-5677608893-export declare function foo(): void;\n"},{"version":"1045484683-export function bar() { }","signature":"-2904461644-export declare function bar(): void;\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} +//// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../../a/lib/lib.d.ts", + "./src/foo.ts", + "./src/bar/foo.ts" + ], + "fileInfos": { + "../../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./src/foo.ts": { + "version": "4646078106-export function foo() { }", + "signature": "-5677608893-export declare function foo(): void;\n" + }, + "./src/bar/foo.ts": { + "version": "1045484683-export function bar() { }", + "signature": "-2904461644-export declare function bar(): void;\n" + } + }, + "options": { + "composite": true, + "outDir": "./lib", + "rootDir": "./src" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../../a/lib/lib.d.ts", + "./src/bar/foo.ts", + "./src/foo.ts" + ] + }, + "version": "FakeTSVersion", + "size": 911 +} + //// [/user/username/projects/myproject/packages/A/lib/test.js] "use strict"; exports.__esModule = true; @@ -78,13 +118,70 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../node_modules/b/lib/foo.d.ts","../../node_modules/b/lib/bar/foo.d.ts","./src/test.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n",{"version":"14700910833-import { foo } from 'b/lib/foo';\nimport { bar } from 'b/lib/bar/foo';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +//// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../../a/lib/lib.d.ts", + "../../node_modules/b/lib/foo.d.ts", + "../../node_modules/b/lib/bar/foo.d.ts", + "./src/test.ts" + ], + "fileNamesList": [ + [ + "../../node_modules/b/lib/foo.d.ts", + "../../node_modules/b/lib/bar/foo.d.ts" + ] + ], + "fileInfos": { + "../../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../../node_modules/b/lib/foo.d.ts": { + "version": "-5677608893-export declare function foo(): void;\n", + "signature": "-5677608893-export declare function foo(): void;\n" + }, + "../../node_modules/b/lib/bar/foo.d.ts": { + "version": "-2904461644-export declare function bar(): void;\n", + "signature": "-2904461644-export declare function bar(): void;\n" + }, + "./src/test.ts": { + "version": "14700910833-import { foo } from 'b/lib/foo';\nimport { bar } from 'b/lib/bar/foo';\nfoo();\nbar();\n", + "signature": "-3531856636-export {};\n" + } + }, + "options": { + "composite": true, + "outDir": "./lib", + "rootDir": "./src" + }, + "referencedMap": { + "./src/test.ts": [ + "../../node_modules/b/lib/foo.d.ts", + "../../node_modules/b/lib/bar/foo.d.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../../a/lib/lib.d.ts", + "../../node_modules/b/lib/bar/foo.d.ts", + "../../node_modules/b/lib/foo.d.ts", + "./src/test.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1026 +} + /a/lib/tsc.js --w --p /user/username/projects/myproject/packages/A/tsconfig.json Output:: >> Screen clear -[12:01:10 AM] Starting compilation in watch mode... +[12:01:14 AM] Starting compilation in watch mode... -[12:01:20 AM] Found 0 errors. Watching for file changes. +[12:01:24 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package-when-solution-is-already-built.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package-when-solution-is-already-built.js index 1df80eb08e8..b07af8c25e3 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package-when-solution-is-already-built.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package-when-solution-is-already-built.js @@ -62,6 +62,46 @@ export declare function bar(): void; //// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/foo.ts","./src/bar/foo.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"4646078106-export function foo() { }","signature":"-5677608893-export declare function foo(): void;\n"},{"version":"1045484683-export function bar() { }","signature":"-2904461644-export declare function bar(): void;\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} +//// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../../a/lib/lib.d.ts", + "./src/foo.ts", + "./src/bar/foo.ts" + ], + "fileInfos": { + "../../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./src/foo.ts": { + "version": "4646078106-export function foo() { }", + "signature": "-5677608893-export declare function foo(): void;\n" + }, + "./src/bar/foo.ts": { + "version": "1045484683-export function bar() { }", + "signature": "-2904461644-export declare function bar(): void;\n" + } + }, + "options": { + "composite": true, + "outDir": "./lib", + "rootDir": "./src" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../../a/lib/lib.d.ts", + "./src/bar/foo.ts", + "./src/foo.ts" + ] + }, + "version": "FakeTSVersion", + "size": 911 +} + //// [/user/username/projects/myproject/packages/A/lib/test.js] "use strict"; exports.__esModule = true; @@ -78,13 +118,70 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../b/lib/foo.d.ts","../b/lib/bar/foo.d.ts","./src/test.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n",{"version":"-20350237855-import { foo } from '@issue/b/lib/foo';\nimport { bar } from '@issue/b/lib/bar/foo';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,4,3,2]},"version":"FakeTSVersion"} +//// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../../a/lib/lib.d.ts", + "../b/lib/foo.d.ts", + "../b/lib/bar/foo.d.ts", + "./src/test.ts" + ], + "fileNamesList": [ + [ + "../b/lib/foo.d.ts", + "../b/lib/bar/foo.d.ts" + ] + ], + "fileInfos": { + "../../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../b/lib/foo.d.ts": { + "version": "-5677608893-export declare function foo(): void;\n", + "signature": "-5677608893-export declare function foo(): void;\n" + }, + "../b/lib/bar/foo.d.ts": { + "version": "-2904461644-export declare function bar(): void;\n", + "signature": "-2904461644-export declare function bar(): void;\n" + }, + "./src/test.ts": { + "version": "-20350237855-import { foo } from '@issue/b/lib/foo';\nimport { bar } from '@issue/b/lib/bar/foo';\nfoo();\nbar();\n", + "signature": "-3531856636-export {};\n" + } + }, + "options": { + "composite": true, + "outDir": "./lib", + "rootDir": "./src" + }, + "referencedMap": { + "./src/test.ts": [ + "../b/lib/foo.d.ts", + "../b/lib/bar/foo.d.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../../a/lib/lib.d.ts", + "./src/test.ts", + "../b/lib/bar/foo.d.ts", + "../b/lib/foo.d.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1009 +} + /a/lib/tsc.js --w --p /user/username/projects/myproject/packages/A/tsconfig.json Output:: >> Screen clear -[12:01:12 AM] Starting compilation in watch mode... +[12:01:16 AM] Starting compilation in watch mode... -[12:01:22 AM] Found 0 errors. Watching for file changes. +[12:01:26 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package-with-preserveSymlinks-when-solution-is-already-built.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package-with-preserveSymlinks-when-solution-is-already-built.js index 23726619543..ae9408fe983 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package-with-preserveSymlinks-when-solution-is-already-built.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/when-referencing-file-from-subFolder-with-scoped-package-with-preserveSymlinks-when-solution-is-already-built.js @@ -62,6 +62,46 @@ export declare function bar(): void; //// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","./src/foo.ts","./src/bar/foo.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"4646078106-export function foo() { }","signature":"-5677608893-export declare function foo(): void;\n"},{"version":"1045484683-export function bar() { }","signature":"-2904461644-export declare function bar(): void;\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2]},"version":"FakeTSVersion"} +//// [/user/username/projects/myproject/packages/B/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../../a/lib/lib.d.ts", + "./src/foo.ts", + "./src/bar/foo.ts" + ], + "fileInfos": { + "../../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "./src/foo.ts": { + "version": "4646078106-export function foo() { }", + "signature": "-5677608893-export declare function foo(): void;\n" + }, + "./src/bar/foo.ts": { + "version": "1045484683-export function bar() { }", + "signature": "-2904461644-export declare function bar(): void;\n" + } + }, + "options": { + "composite": true, + "outDir": "./lib", + "rootDir": "./src" + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../../a/lib/lib.d.ts", + "./src/bar/foo.ts", + "./src/foo.ts" + ] + }, + "version": "FakeTSVersion", + "size": 911 +} + //// [/user/username/projects/myproject/packages/A/lib/test.js] "use strict"; exports.__esModule = true; @@ -78,13 +118,70 @@ export {}; //// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../node_modules/@issue/b/lib/foo.d.ts","../../node_modules/@issue/b/lib/bar/foo.d.ts","./src/test.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-5677608893-export declare function foo(): void;\n","-2904461644-export declare function bar(): void;\n",{"version":"-20350237855-import { foo } from '@issue/b/lib/foo';\nimport { bar } from '@issue/b/lib/bar/foo';\nfoo();\nbar();\n","signature":"-3531856636-export {};\n"}],"options":{"composite":true,"outDir":"./lib","rootDir":"./src"},"fileIdsList":[[2,3]],"referencedMap":[[4,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,3,2,4]},"version":"FakeTSVersion"} +//// [/user/username/projects/myproject/packages/A/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../../a/lib/lib.d.ts", + "../../node_modules/@issue/b/lib/foo.d.ts", + "../../node_modules/@issue/b/lib/bar/foo.d.ts", + "./src/test.ts" + ], + "fileNamesList": [ + [ + "../../node_modules/@issue/b/lib/foo.d.ts", + "../../node_modules/@issue/b/lib/bar/foo.d.ts" + ] + ], + "fileInfos": { + "../../../../../../a/lib/lib.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true + }, + "../../node_modules/@issue/b/lib/foo.d.ts": { + "version": "-5677608893-export declare function foo(): void;\n", + "signature": "-5677608893-export declare function foo(): void;\n" + }, + "../../node_modules/@issue/b/lib/bar/foo.d.ts": { + "version": "-2904461644-export declare function bar(): void;\n", + "signature": "-2904461644-export declare function bar(): void;\n" + }, + "./src/test.ts": { + "version": "-20350237855-import { foo } from '@issue/b/lib/foo';\nimport { bar } from '@issue/b/lib/bar/foo';\nfoo();\nbar();\n", + "signature": "-3531856636-export {};\n" + } + }, + "options": { + "composite": true, + "outDir": "./lib", + "rootDir": "./src" + }, + "referencedMap": { + "./src/test.ts": [ + "../../node_modules/@issue/b/lib/foo.d.ts", + "../../node_modules/@issue/b/lib/bar/foo.d.ts" + ] + }, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../../a/lib/lib.d.ts", + "../../node_modules/@issue/b/lib/bar/foo.d.ts", + "../../node_modules/@issue/b/lib/foo.d.ts", + "./src/test.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1055 +} + /a/lib/tsc.js --w --p /user/username/projects/myproject/packages/A/tsconfig.json Output:: >> Screen clear -[12:01:12 AM] Starting compilation in watch mode... +[12:01:16 AM] Starting compilation in watch mode... -[12:01:22 AM] Found 0 errors. Watching for file changes. +[12:01:26 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/with-simple-project-when-solution-is-already-built.js b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/with-simple-project-when-solution-is-already-built.js index 6d1205808e6..1e4d9c66283 100644 --- a/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/with-simple-project-when-solution-is-already-built.js +++ b/tests/baselines/reference/tscWatch/sourceOfProjectReferenceRedirect/with-simple-project-when-solution-is-already-built.js @@ -124,6 +124,48 @@ export declare function lastElementOf(arr: T[]): T | undefined; //// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../core/utilities.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"25274411612-\r\nexport function makeRandomName() {\r\n return \"Bob!?! \";\r\n}\r\n\r\nexport function lastElementOf(arr: T[]): T | undefined {\r\n if (arr.length === 0) return undefined;\r\n return arr[arr.length - 1];\r\n}\r\n\r\n","signature":"-11345568166-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n"}],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../core","strict":true,"target":1},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2]},"version":"FakeTSVersion"} +//// [/user/username/projects/demo/lib/core/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../../a/lib/lib.d.ts", + "../../core/utilities.ts" + ], + "fileInfos": { + "../../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../../core/utilities.ts": { + "version": "25274411612-\r\nexport function makeRandomName() {\r\n return \"Bob!?! \";\r\n}\r\n\r\nexport function lastElementOf(arr: T[]): T | undefined {\r\n if (arr.length === 0) return undefined;\r\n return arr[arr.length - 1];\r\n}\r\n\r\n", + "signature": "-11345568166-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "module": 1, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "./", + "rootDir": "../../core", + "strict": true, + "target": 1 + }, + "referencedMap": {}, + "exportedModulesMap": {}, + "semanticDiagnosticsPerFile": [ + "../../../../../../a/lib/lib.d.ts", + "../../core/utilities.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1319 +} + //// [/user/username/projects/demo/lib/animals/animal.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -180,13 +222,103 @@ export declare function createDog(): Dog; //// [/user/username/projects/demo/lib/animals/tsconfig.tsbuildinfo] {"program":{"fileNames":["../../../../../../a/lib/lib.d.ts","../../animals/animal.ts","../../animals/index.ts","../core/utilities.d.ts","../../animals/dog.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-14984181202-export type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n","signature":"-10510161654-export declare type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n"},{"version":"-5382672599-import Animal from './animal';\r\n\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n","signature":"1096904574-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n"},"-11345568166-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n",{"version":"-10991948013-import Animal from '.';\r\nimport { makeRandomName } from '../core/utilities';\r\n\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\n\r\nexport function createDog(): Dog {\r\n return ({\r\n size: \"medium\",\r\n woof: function(this: Dog) {\r\n console.log(`${this.name} says \"Woof\"!`);\r\n },\r\n name: makeRandomName()\r\n });\r\n}\r\n\r\n","signature":"6032048049-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n"}],"options":{"composite":true,"declaration":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../../animals","strict":true,"target":1},"fileIdsList":[[3,4],[2,5],[3]],"referencedMap":[[5,1],[3,2]],"exportedModulesMap":[[5,3],[3,2]],"semanticDiagnosticsPerFile":[1,2,5,3,4]},"version":"FakeTSVersion"} +//// [/user/username/projects/demo/lib/animals/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../../a/lib/lib.d.ts", + "../../animals/animal.ts", + "../../animals/index.ts", + "../core/utilities.d.ts", + "../../animals/dog.ts" + ], + "fileNamesList": [ + [ + "../../animals/index.ts", + "../core/utilities.d.ts" + ], + [ + "../../animals/animal.ts", + "../../animals/dog.ts" + ], + [ + "../../animals/index.ts" + ] + ], + "fileInfos": { + "../../../../../../a/lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../../animals/animal.ts": { + "version": "-14984181202-export type Size = \"small\" | \"medium\" | \"large\";\r\nexport default interface Animal {\r\n size: Size;\r\n}\r\n", + "signature": "-10510161654-export declare type Size = \"small\" | \"medium\" | \"large\";\nexport default interface Animal {\n size: Size;\n}\n" + }, + "../../animals/index.ts": { + "version": "-5382672599-import Animal from './animal';\r\n\r\nexport default Animal;\r\nimport { createDog, Dog } from './dog';\r\nexport { createDog, Dog };\r\n", + "signature": "1096904574-import Animal from './animal';\nexport default Animal;\nimport { createDog, Dog } from './dog';\nexport { createDog, Dog };\n" + }, + "../core/utilities.d.ts": { + "version": "-11345568166-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n", + "signature": "-11345568166-export declare function makeRandomName(): string;\nexport declare function lastElementOf(arr: T[]): T | undefined;\n" + }, + "../../animals/dog.ts": { + "version": "-10991948013-import Animal from '.';\r\nimport { makeRandomName } from '../core/utilities';\r\n\r\nexport interface Dog extends Animal {\r\n woof(): void;\r\n name: string;\r\n}\r\n\r\nexport function createDog(): Dog {\r\n return ({\r\n size: \"medium\",\r\n woof: function(this: Dog) {\r\n console.log(`${this.name} says \"Woof\"!`);\r\n },\r\n name: makeRandomName()\r\n });\r\n}\r\n\r\n", + "signature": "6032048049-import Animal from '.';\nexport interface Dog extends Animal {\n woof(): void;\n name: string;\n}\nexport declare function createDog(): Dog;\n" + } + }, + "options": { + "composite": true, + "declaration": true, + "module": 1, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "./", + "rootDir": "../../animals", + "strict": true, + "target": 1 + }, + "referencedMap": { + "../../animals/dog.ts": [ + "../../animals/index.ts", + "../core/utilities.d.ts" + ], + "../../animals/index.ts": [ + "../../animals/animal.ts", + "../../animals/dog.ts" + ] + }, + "exportedModulesMap": { + "../../animals/dog.ts": [ + "../../animals/index.ts" + ], + "../../animals/index.ts": [ + "../../animals/animal.ts", + "../../animals/dog.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../../a/lib/lib.d.ts", + "../../animals/animal.ts", + "../../animals/dog.ts", + "../../animals/index.ts", + "../core/utilities.d.ts" + ] + }, + "version": "FakeTSVersion", + "size": 2423 +} + /a/lib/tsc.js --w --p /user/username/projects/demo/animals/tsconfig.json Output:: >> Screen clear -[12:01:03 AM] Starting compilation in watch mode... +[12:01:07 AM] Starting compilation in watch mode... -[12:01:13 AM] Found 0 errors. Watching for file changes. +[12:01:17 AM] Found 0 errors. Watching for file changes. From 07660c8307affd57c10735ddff252cc3521485a1 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Fri, 22 Apr 2022 11:18:53 -0700 Subject: [PATCH 16/63] Fix emit for undefined SourceFile (#48774) Co-authored-by: Ron Buckton --- src/compiler/emitter.ts | 113 +++++++++++++++++++------------------- src/compiler/utilities.ts | 4 +- 2 files changed, 60 insertions(+), 57 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 28f0d766f72..c83713750f2 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1172,7 +1172,7 @@ namespace ts { } function getCurrentLineMap() { - return currentLineMap || (currentLineMap = getLineStarts(currentSourceFile!)); + return currentLineMap || (currentLineMap = getLineStarts(Debug.checkDefined(currentSourceFile))); } function emit(node: Node, parenthesizerRule?: (node: Node) => Node): void; @@ -1817,7 +1817,7 @@ namespace ts { const numNodes = bundle ? bundle.sourceFiles.length + numPrepends : 1; for (let i = 0; i < numNodes; i++) { const currentNode = bundle ? i < numPrepends ? bundle.prepends[i] : bundle.sourceFiles[i - numPrepends] : node; - const sourceFile = isSourceFile(currentNode) ? currentNode : isUnparsedSource(currentNode) ? undefined : currentSourceFile!; + const sourceFile = isSourceFile(currentNode) ? currentNode : isUnparsedSource(currentNode) ? undefined : currentSourceFile; const shouldSkip = printerOptions.noEmitHelpers || (!!sourceFile && hasRecordedExternalHelpers(sourceFile)); const shouldBundle = (isSourceFile(currentNode) || isUnparsedSource(currentNode)) && !isOwnFileEmit; const helpers = isUnparsedSource(currentNode) ? currentNode.helpers : getSortedEmitHelpers(currentNode); @@ -2467,7 +2467,7 @@ namespace ts { } const preferNewLine = node.multiLine ? ListFormat.PreferNewLine : ListFormat.None; - const allowTrailingComma = currentSourceFile!.languageVersion >= ScriptTarget.ES5 && !isJsonSourceFile(currentSourceFile!) ? ListFormat.AllowTrailingComma : ListFormat.None; + const allowTrailingComma = currentSourceFile && currentSourceFile.languageVersion >= ScriptTarget.ES5 && !isJsonSourceFile(currentSourceFile) ? ListFormat.AllowTrailingComma : ListFormat.None; emitList(node, node.properties, ListFormat.ObjectLiteralExpressionProperties | allowTrailingComma | preferNewLine); if (indentedFlag) { @@ -2882,7 +2882,7 @@ namespace ts { emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfExpressionStatement); // Emit semicolon in non json files // or if json file that created synthesized expression(eg.define expression statement when --out and amd code generation) - if (!isJsonSourceFile(currentSourceFile!) || nodeIsSynthesized(node.expression)) { + if (!currentSourceFile || !isJsonSourceFile(currentSourceFile) || nodeIsSynthesized(node.expression)) { writeTrailingSemicolon(); } } @@ -3209,7 +3209,7 @@ namespace ts { return false; } - if (!nodeIsSynthesized(body) && !rangeIsOnSingleLine(body, currentSourceFile!)) { + if (!nodeIsSynthesized(body) && currentSourceFile && !rangeIsOnSingleLine(body, currentSourceFile)) { return false; } @@ -3240,12 +3240,7 @@ namespace ts { ? emitBlockFunctionBodyOnSingleLine : emitBlockFunctionBodyWorker; - if (emitBodyWithDetachedComments) { - emitBodyWithDetachedComments(body, body.statements, emitBlockFunctionBody); - } - else { - emitBlockFunctionBody(body); - } + emitBodyWithDetachedComments(body, body.statements, emitBlockFunctionBody); decreaseIndent(); writeToken(SyntaxKind.CloseBraceToken, body.statements.end, writePunctuation, body); @@ -3703,9 +3698,10 @@ namespace ts { statements.length === 1 && ( // treat synthesized nodes as located on the same line for emit purposes + !currentSourceFile || nodeIsSynthesized(parentNode) || nodeIsSynthesized(statements[0]) || - rangeStartPositionsAreOnSameLine(parentNode, statements[0], currentSourceFile!) + rangeStartPositionsAreOnSameLine(parentNode, statements[0], currentSourceFile) ); let format = ListFormat.CaseOrDefaultClauseStatements; @@ -3960,16 +3956,14 @@ namespace ts { function emitSourceFile(node: SourceFile) { writeLine(); const statements = node.statements; - if (emitBodyWithDetachedComments) { - // Emit detached comment if there are no prologue directives or if the first node is synthesized. - // The synthesized node will have no leading comment so some comments may be missed. - const shouldEmitDetachedComment = statements.length === 0 || - !isPrologueDirective(statements[0]) || - nodeIsSynthesized(statements[0]); - if (shouldEmitDetachedComment) { - emitBodyWithDetachedComments(node, statements, emitSourceFileWorker); - return; - } + // Emit detached comment if there are no prologue directives or if the first node is synthesized. + // The synthesized node will have no leading comment so some comments may be missed. + const shouldEmitDetachedComment = statements.length === 0 || + !isPrologueDirective(statements[0]) || + nodeIsSynthesized(statements[0]); + if (shouldEmitDetachedComment) { + emitBodyWithDetachedComments(node, statements, emitSourceFileWorker); + return; } emitSourceFileWorker(node); } @@ -4371,7 +4365,7 @@ namespace ts { if (isEmpty) { // Write a line terminator if the parent node was multi-line - if (format & ListFormat.MultiLine && !(preserveSourceNewlines && (!parentNode || rangeIsOnSingleLine(parentNode, currentSourceFile!)))) { + if (format & ListFormat.MultiLine && !(preserveSourceNewlines && (!parentNode || currentSourceFile && rangeIsOnSingleLine(parentNode, currentSourceFile)))) { writeLine(); } else if (format & ListFormat.SpaceBetweenBraces && !(format & ListFormat.NoSpaceIfEmpty)) { @@ -4675,7 +4669,7 @@ namespace ts { const firstChild = children[0]; if (firstChild === undefined) { - return !parentNode || rangeIsOnSingleLine(parentNode, currentSourceFile!) ? 0 : 1; + return !parentNode || currentSourceFile && rangeIsOnSingleLine(parentNode, currentSourceFile) ? 0 : 1; } if (firstChild.pos === nextListElementPos) { // If this child starts at the beginning of a list item in a parent list, its leading @@ -4699,7 +4693,7 @@ namespace ts { // JsxText will be written with its leading whitespace, so don't add more manually. return 0; } - if (parentNode && + if (currentSourceFile && parentNode && !positionIsSynthesized(parentNode.pos) && !nodeIsSynthesized(firstChild) && (!firstChild.parent || getOriginalNode(firstChild.parent) === getOriginalNode(parentNode)) @@ -4712,7 +4706,7 @@ namespace ts { currentSourceFile!, includeComments)); } - return rangeStartPositionsAreOnSameLine(parentNode, firstChild, currentSourceFile!) ? 0 : 1; + return rangeStartPositionsAreOnSameLine(parentNode, firstChild, currentSourceFile) ? 0 : 1; } if (synthesizedNodeStartsOnNewLine(firstChild, format)) { return 1; @@ -4730,7 +4724,7 @@ namespace ts { // JsxText will be written with its leading whitespace, so don't add more manually. return 0; } - else if (!nodeIsSynthesized(previousNode) && !nodeIsSynthesized(nextNode)) { + else if (currentSourceFile && !nodeIsSynthesized(previousNode) && !nodeIsSynthesized(nextNode)) { if (preserveSourceNewlines && siblingNodePositionsAreComparable(previousNode, nextNode)) { return getEffectiveLines( includeComments => getLinesBetweenRangeEndAndRangeStart( @@ -4745,7 +4739,7 @@ namespace ts { // expensive than checking with `preserveSourceNewlines` as above, but the goal is not to preserve the // effective source lines between two sibling nodes. else if (!preserveSourceNewlines && originalNodesHaveSameParent(previousNode, nextNode)) { - return rangeEndIsOnSameLineAsRangeStart(previousNode, nextNode, currentSourceFile!) ? 0 : 1; + return rangeEndIsOnSameLineAsRangeStart(previousNode, nextNode, currentSourceFile) ? 0 : 1; } // If the two nodes are not comparable, add a line terminator based on the format that can indicate // whether new lines are preferred or not. @@ -4769,9 +4763,9 @@ namespace ts { const lastChild = lastOrUndefined(children); if (lastChild === undefined) { - return !parentNode || rangeIsOnSingleLine(parentNode, currentSourceFile!) ? 0 : 1; + return !parentNode || currentSourceFile && rangeIsOnSingleLine(parentNode, currentSourceFile) ? 0 : 1; } - if (parentNode && !positionIsSynthesized(parentNode.pos) && !nodeIsSynthesized(lastChild) && (!lastChild.parent || lastChild.parent === parentNode)) { + if (currentSourceFile && parentNode && !positionIsSynthesized(parentNode.pos) && !nodeIsSynthesized(lastChild) && (!lastChild.parent || lastChild.parent === parentNode)) { if (preserveSourceNewlines) { const end = isNodeArray(children) && !positionIsSynthesized(children.end) ? children.end : lastChild.end; return getEffectiveLines( @@ -4781,7 +4775,7 @@ namespace ts { currentSourceFile!, includeComments)); } - return rangeEndPositionsAreOnSameLine(parentNode, lastChild, currentSourceFile!) ? 0 : 1; + return rangeEndPositionsAreOnSameLine(parentNode, lastChild, currentSourceFile) ? 0 : 1; } if (synthesizedNodeStartsOnNewLine(lastChild, format)) { return 1; @@ -4859,7 +4853,7 @@ namespace ts { return 1; } - if (!nodeIsSynthesized(parent) && !nodeIsSynthesized(node1) && !nodeIsSynthesized(node2)) { + if (currentSourceFile && !nodeIsSynthesized(parent) && !nodeIsSynthesized(node1) && !nodeIsSynthesized(node2)) { if (preserveSourceNewlines) { return getEffectiveLines( includeComments => getLinesBetweenRangeEndAndRangeStart( @@ -4868,7 +4862,7 @@ namespace ts { currentSourceFile!, includeComments)); } - return rangeEndIsOnSameLineAsRangeStart(node1, node2, currentSourceFile!) ? 0 : 1; + return rangeEndIsOnSameLineAsRangeStart(node1, node2, currentSourceFile) ? 0 : 1; } return 0; @@ -4876,7 +4870,7 @@ namespace ts { function isEmptyBlock(block: BlockLike) { return block.statements.length === 0 - && rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile!); + && (!currentSourceFile || rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile)); } function skipSynthesizedParentheses(node: Node) { @@ -4887,21 +4881,27 @@ namespace ts { return node; } - function getTextOfNode(node: Node, includeTrivia?: boolean): string { + function getTextOfNode(node: Identifier | PrivateIdentifier | LiteralExpression, includeTrivia?: boolean): string { if (isGeneratedIdentifier(node)) { return generateName(node); } - else if ((isIdentifier(node) || isPrivateIdentifier(node)) && (nodeIsSynthesized(node) || !node.parent || !currentSourceFile || (node.parent && currentSourceFile && getSourceFileOfNode(node) !== getOriginalNode(currentSourceFile)))) { - return idText(node); + if (isStringLiteral(node) && node.textSourceNode) { + return getTextOfNode(node.textSourceNode, includeTrivia); } - else if (node.kind === SyntaxKind.StringLiteral && (node as StringLiteral).textSourceNode) { - return getTextOfNode((node as StringLiteral).textSourceNode!, includeTrivia); + const sourceFile = currentSourceFile; // const needed for control flow + const canUseSourceFile = !!sourceFile && !!node.parent && !nodeIsSynthesized(node); + if (isMemberName(node)) { + if (!canUseSourceFile || getSourceFileOfNode(node) !== getOriginalNode(sourceFile)) { + return idText(node); + } } - else if (isLiteralExpression(node) && (nodeIsSynthesized(node) || !node.parent)) { - return node.text; + else { + Debug.assertNode(node, isLiteralExpression); // not strictly necessary + if (!canUseSourceFile) { + return node.text; + } } - - return getSourceTextOfNodeFromSourceFile(currentSourceFile!, node, includeTrivia); + return getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia); } function getLiteralTextOfNode(node: LiteralLikeNode, neverAsciiEscape: boolean | undefined, jsxAttributeEscape: boolean): string { @@ -4923,7 +4923,7 @@ namespace ts { | (printerOptions.terminateUnterminatedLiterals ? GetLiteralTextFlags.TerminateUnterminatedLiterals : 0) | (printerOptions.target && printerOptions.target === ScriptTarget.ESNext ? GetLiteralTextFlags.AllowNumericSeparator : 0); - return getLiteralText(node, currentSourceFile!, flags); + return getLiteralText(node, currentSourceFile, flags); } /** @@ -5246,7 +5246,7 @@ namespace ts { switch (node.kind) { case SyntaxKind.Identifier: return makeUniqueName( - getTextOfNode(node), + getTextOfNode(node as Identifier), isUniqueName, !!(flags! & GeneratedIdentifierFlags.Optimistic), !!(flags! & GeneratedIdentifierFlags.ReservedInNestedScopes) @@ -5548,7 +5548,7 @@ namespace ts { } function emitLeadingComment(commentPos: number, commentEnd: number, kind: SyntaxKind, hasTrailingNewLine: boolean, rangePos: number) { - if (!shouldWriteComment(currentSourceFile!.text, commentPos)) return; + if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) return; if (!hasWrittenComment) { emitNewLineBeforeLeadingCommentOfPosition(getCurrentLineMap(), writer, rangePos, commentPos); hasWrittenComment = true; @@ -5556,7 +5556,7 @@ namespace ts { // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space emitPos(commentPos); - writeCommentRange(currentSourceFile!.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); + writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); emitPos(commentEnd); if (hasTrailingNewLine) { @@ -5580,14 +5580,14 @@ namespace ts { } function emitTrailingComment(commentPos: number, commentEnd: number, _kind: SyntaxKind, hasTrailingNewLine: boolean) { - if (!shouldWriteComment(currentSourceFile!.text, commentPos)) return; + if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) return; // trailing comments are emitted at space/*trailing comment1 */space/*trailing comment2*/ if (!writer.isAtStartOfLine()) { writer.writeSpace(" "); } emitPos(commentPos); - writeCommentRange(currentSourceFile!.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); + writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); emitPos(commentEnd); if (hasTrailingNewLine) { @@ -5605,10 +5605,11 @@ namespace ts { } function emitTrailingCommentOfPositionNoNewline(commentPos: number, commentEnd: number, kind: SyntaxKind) { + if (!currentSourceFile) return; // trailing comments of a position are emitted at /*trailing comment1 */space/*trailing comment*/space emitPos(commentPos); - writeCommentRange(currentSourceFile!.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); + writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); emitPos(commentEnd); if (kind === SyntaxKind.SingleLineCommentTrivia) { @@ -5617,10 +5618,11 @@ namespace ts { } function emitTrailingCommentOfPosition(commentPos: number, commentEnd: number, _kind: SyntaxKind, hasTrailingNewLine: boolean) { + if(!currentSourceFile) return; // trailing comments of a position are emitted at /*trailing comment1 */space/*trailing comment*/space emitPos(commentPos); - writeCommentRange(currentSourceFile!.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); + writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); emitPos(commentEnd); if (hasTrailingNewLine) { @@ -5655,6 +5657,7 @@ namespace ts { } function forEachLeadingCommentWithoutDetachedComments(cb: (commentPos: number, commentEnd: number, kind: SyntaxKind, hasTrailingNewLine: boolean, rangePos: number) => void) { + if (!currentSourceFile) return; // get the leading comments from detachedPos const pos = last(detachedCommentsInfo!).detachedCommentEndPos; if (detachedCommentsInfo!.length - 1) { @@ -5664,11 +5667,11 @@ namespace ts { detachedCommentsInfo = undefined; } - forEachLeadingCommentRange(currentSourceFile!.text, pos, cb, /*state*/ pos); + forEachLeadingCommentRange(currentSourceFile.text, pos, cb, /*state*/ pos); } function emitDetachedCommentsAndUpdateCommentsInfo(range: TextRange) { - const currentDetachedCommentInfo = emitDetachedComments(currentSourceFile!.text, getCurrentLineMap(), writer, emitComment, range, newLine, commentsDisabled); + const currentDetachedCommentInfo = currentSourceFile && emitDetachedComments(currentSourceFile.text, getCurrentLineMap(), writer, emitComment, range, newLine, commentsDisabled); if (currentDetachedCommentInfo) { if (detachedCommentsInfo) { detachedCommentsInfo.push(currentDetachedCommentInfo); @@ -5680,7 +5683,7 @@ namespace ts { } function emitComment(text: string, lineMap: number[], writer: EmitTextWriter, commentPos: number, commentEnd: number, newLine: string) { - if (!shouldWriteComment(currentSourceFile!.text, commentPos)) return; + if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) return; emitPos(commentPos); writeCommentRange(text, lineMap, writer, commentPos, commentEnd, newLine); emitPos(commentEnd); @@ -5692,7 +5695,7 @@ namespace ts { * @return true if the comment is a triple-slash comment else false */ function isTripleSlashComment(commentPos: number, commentEnd: number) { - return isRecognizedTripleSlashComment(currentSourceFile!.text, commentPos, commentEnd); + return !!currentSourceFile && isRecognizedTripleSlashComment(currentSourceFile.text, commentPos, commentEnd); } // Source Maps diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 1093d9ae384..7d860fa7a61 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -656,10 +656,10 @@ namespace ts { AllowNumericSeparator = 1 << 3 } - export function getLiteralText(node: LiteralLikeNode, sourceFile: SourceFile, flags: GetLiteralTextFlags) { + export function getLiteralText(node: LiteralLikeNode, sourceFile: SourceFile | undefined, flags: GetLiteralTextFlags) { // If we don't need to downlevel and we can reach the original source text using // the node's parent reference, then simply get the text as it was originally written. - if (canUseOriginalText(node, flags)) { + if (sourceFile && canUseOriginalText(node, flags)) { return getSourceTextOfNodeFromSourceFile(sourceFile, node); } From c99380f87bbd72c107ea1998766ae3be07ce90ff Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Fri, 22 Apr 2022 15:32:52 -0700 Subject: [PATCH 17/63] Fix auto-import completions sometimes not updating existing imports (#48815) --- src/services/codefixes/importFixes.ts | 68 +++++++++++++------ src/services/completions.ts | 20 ++++-- ...ionsImport_preferUpdatingExistingImport.ts | 31 +++++++++ 3 files changed, 92 insertions(+), 27 deletions(-) create mode 100644 tests/cases/fourslash/completionsImport_preferUpdatingExistingImport.ts diff --git a/src/services/codefixes/importFixes.ts b/src/services/codefixes/importFixes.ts index f4e8b416f05..e277a7d4e89 100644 --- a/src/services/codefixes/importFixes.ts +++ b/src/services/codefixes/importFixes.ts @@ -83,7 +83,7 @@ namespace ts.codefix { const symbol = checker.getMergedSymbol(skipAlias(exportedSymbol, checker)); const exportInfo = getAllReExportingModules(sourceFile, symbol, moduleSymbol, symbolName, /*isJsxTagName*/ false, host, program, preferences, useAutoImportProvider); const useRequire = shouldUseRequire(sourceFile, program); - const fix = getImportFixForSymbol(sourceFile, exportInfo, moduleSymbol, symbolName, program, /*position*/ undefined, !!isValidTypeOnlyUseSite, useRequire, host, preferences); + const fix = getImportFixForSymbol(sourceFile, exportInfo, moduleSymbol, program, /*useNamespaceInfo*/ undefined, !!isValidTypeOnlyUseSite, useRequire, host, preferences); if (fix) { addImport({ fixes: [fix], symbolName, errorIdentifierText: undefined }); } @@ -310,7 +310,7 @@ namespace ts.codefix { : getAllReExportingModules(sourceFile, targetSymbol, moduleSymbol, symbolName, isJsxTagName, host, program, preferences, /*useAutoImportProvider*/ true); const useRequire = shouldUseRequire(sourceFile, program); const isValidTypeOnlyUseSite = isValidTypeOnlyAliasUseSite(getTokenAtPosition(sourceFile, position)); - const fix = Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, symbolName, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences)); + const fix = Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, { symbolName, position }, isValidTypeOnlyUseSite, useRequire, host, preferences)); return { moduleSpecifier: fix.moduleSpecifier, codeAction: codeFixActionToCodeAction(codeActionForFix( @@ -331,10 +331,10 @@ namespace ts.codefix { return fix && codeFixActionToCodeAction(codeActionForFix({ host, formatContext, preferences }, sourceFile, symbolName, fix, includeSymbolNameInDescription, QuotePreference.Double, compilerOptions)); } - function getImportFixForSymbol(sourceFile: SourceFile, exportInfos: readonly SymbolExportInfo[], moduleSymbol: Symbol, symbolName: string, program: Program, position: number | undefined, isValidTypeOnlyUseSite: boolean, useRequire: boolean, host: LanguageServiceHost, preferences: UserPreferences) { + function getImportFixForSymbol(sourceFile: SourceFile, exportInfos: readonly SymbolExportInfo[], moduleSymbol: Symbol, program: Program, useNamespaceInfo: { position: number, symbolName: string } | undefined, isValidTypeOnlyUseSite: boolean, useRequire: boolean, host: LanguageServiceHost, preferences: UserPreferences) { Debug.assert(exportInfos.some(info => info.moduleSymbol === moduleSymbol || info.symbol.parent === moduleSymbol), "Some exportInfo should match the specified moduleSymbol"); const packageJsonImportFilter = createPackageJsonImportFilter(sourceFile, preferences, host); - return getBestFix(getImportFixes(exportInfos, symbolName, position, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences), sourceFile, program, packageJsonImportFilter, host); + return getBestFix(getImportFixes(exportInfos, useNamespaceInfo, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes, sourceFile, program, packageJsonImportFilter, host); } function codeFixActionToCodeAction({ description, changes, commands }: CodeFixAction): CodeAction { @@ -396,6 +396,9 @@ namespace ts.codefix { export function getModuleSpecifierForBestExportInfo( exportInfo: readonly SymbolExportInfo[], + symbolName: string, + position: number, + isValidTypeOnlyUseSite: boolean, importingFile: SourceFile, program: Program, host: LanguageServiceHost, @@ -403,13 +406,13 @@ namespace ts.codefix { packageJsonImportFilter?: PackageJsonImportFilter, fromCacheOnly?: boolean, ): { exportInfo?: SymbolExportInfo, moduleSpecifier: string, computedWithoutCacheCount: number } | undefined { - const { fixes, computedWithoutCacheCount } = getNewImportFixes( + const { fixes, computedWithoutCacheCount } = getImportFixes( + exportInfo, + { symbolName, position }, + isValidTypeOnlyUseSite, + /*useRequire*/ false, program, importingFile, - /*position*/ undefined, - /*isValidTypeOnlyUseSite*/ false, - /*useRequire*/ false, - exportInfo, host, preferences, fromCacheOnly); @@ -419,23 +422,46 @@ namespace ts.codefix { function getImportFixes( exportInfos: readonly SymbolExportInfo[], - symbolName: string, + useNamespaceInfo: { + symbolName: string, + position: number, + } | undefined, /** undefined only for missing JSX namespace */ - position: number | undefined, isValidTypeOnlyUseSite: boolean, useRequire: boolean, program: Program, sourceFile: SourceFile, host: LanguageServiceHost, preferences: UserPreferences, - ): readonly ImportFixWithModuleSpecifier[] { + fromCacheOnly?: boolean, + ): { computedWithoutCacheCount: number, fixes: readonly ImportFixWithModuleSpecifier[] } { const checker = program.getTypeChecker(); const existingImports = flatMap(exportInfos, info => getExistingImportDeclarations(info, checker, sourceFile, program.getCompilerOptions())); - const useNamespace = position === undefined ? undefined : tryUseExistingNamespaceImport(existingImports, symbolName, position, checker); + const useNamespace = useNamespaceInfo && tryUseExistingNamespaceImport(existingImports, useNamespaceInfo.symbolName, useNamespaceInfo.position, checker); const addToExisting = tryAddToExistingImport(existingImports, isValidTypeOnlyUseSite, checker, program.getCompilerOptions()); - // Don't bother providing an action to add a new import if we can add to an existing one. - const addImport = addToExisting ? [addToExisting] : getFixesForAddImport(exportInfos, existingImports, program, sourceFile, position, isValidTypeOnlyUseSite, useRequire, host, preferences); - return [...(useNamespace ? [useNamespace] : emptyArray), ...addImport]; + if (addToExisting) { + // Don't bother providing an action to add a new import if we can add to an existing one. + return { + computedWithoutCacheCount: 0, + fixes: [...(useNamespace ? [useNamespace] : emptyArray), addToExisting], + }; + } + + const { fixes, computedWithoutCacheCount = 0 } = getFixesForAddImport( + exportInfos, + existingImports, + program, + sourceFile, + useNamespaceInfo?.position, + isValidTypeOnlyUseSite, + useRequire, + host, + preferences, + fromCacheOnly); + return { + computedWithoutCacheCount, + fixes: [...(useNamespace ? [useNamespace] : emptyArray), ...fixes], + }; } function tryUseExistingNamespaceImport(existingImports: readonly FixAddToExistingImportInfo[], symbolName: string, position: number, checker: TypeChecker): FixUseNamespaceImport | undefined { @@ -658,9 +684,10 @@ namespace ts.codefix { useRequire: boolean, host: LanguageServiceHost, preferences: UserPreferences, - ): readonly (FixAddNewImport | FixAddJsdocTypeImport)[] { + fromCacheOnly?: boolean, + ): { computedWithoutCacheCount?: number, fixes: readonly (FixAddNewImport | FixAddJsdocTypeImport)[] } { const existingDeclaration = firstDefined(existingImports, info => newImportInfoFromExistingSpecifier(info, isValidTypeOnlyUseSite, useRequire, program.getTypeChecker(), program.getCompilerOptions())); - return existingDeclaration ? [existingDeclaration] : getNewImportFixes(program, sourceFile, position, isValidTypeOnlyUseSite, useRequire, exportInfos, host, preferences).fixes; + return existingDeclaration ? { fixes: [existingDeclaration] } : getNewImportFixes(program, sourceFile, position, isValidTypeOnlyUseSite, useRequire, exportInfos, host, preferences, fromCacheOnly); } function newImportInfoFromExistingSpecifier( @@ -782,7 +809,8 @@ namespace ts.codefix { const symbolName = umdSymbol.name; const exportInfo: readonly SymbolExportInfo[] = [{ symbol: umdSymbol, moduleSymbol: symbol, moduleFileName: undefined, exportKind: ExportKind.UMD, targetFlags: symbol.flags, isFromPackageJson: false }]; const useRequire = shouldUseRequire(sourceFile, program); - const fixes = getImportFixes(exportInfo, symbolName, isIdentifier(token) ? token.getStart(sourceFile) : undefined, /*isValidTypeOnlyUseSite*/ false, useRequire, program, sourceFile, host, preferences); + const position = isIdentifier(token) ? token.getStart(sourceFile) : undefined; + const fixes = getImportFixes(exportInfo, position ? { position, symbolName } : undefined, /*isValidTypeOnlyUseSite*/ false, useRequire, program, sourceFile, host, preferences).fixes; return { fixes, symbolName, errorIdentifierText: tryCast(token, isIdentifier)?.text }; } function getUmdSymbol(token: Node, checker: TypeChecker): Symbol | undefined { @@ -855,7 +883,7 @@ namespace ts.codefix { const useRequire = shouldUseRequire(sourceFile, program); const exportInfo = getExportInfos(symbolName, isJSXTagName(symbolToken), getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, program, useAutoImportProvider, host, preferences); const fixes = arrayFrom(flatMapIterator(exportInfo.entries(), ([_, exportInfos]) => - getImportFixes(exportInfos, symbolName, symbolToken.getStart(sourceFile), isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences))); + getImportFixes(exportInfos, { symbolName, position: symbolToken.getStart(sourceFile) }, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes)); return { fixes, symbolName, errorIdentifierText: symbolToken.text }; } diff --git a/src/services/completions.ts b/src/services/completions.ts index 42821f5dccc..50bfad2d5e4 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -170,7 +170,7 @@ namespace ts.Completions { const enum GlobalsSearch { Continue, Success, Fail } interface ModuleSpecifierResolutioContext { - tryResolve: (exportInfo: readonly SymbolExportInfo[], isFromAmbientModule: boolean) => ModuleSpecifierResolutionResult | undefined; + tryResolve: (exportInfo: readonly SymbolExportInfo[], symbolName: string, isFromAmbientModule: boolean) => ModuleSpecifierResolutionResult | undefined; resolutionLimitExceeded: () => boolean; } @@ -184,8 +184,10 @@ namespace ts.Completions { host: LanguageServiceHost, program: Program, sourceFile: SourceFile, + position: number, preferences: UserPreferences, isForImportStatementCompletion: boolean, + isValidTypeOnlyUseSite: boolean, cb: (context: ModuleSpecifierResolutioContext) => TReturn, ): TReturn { const start = timestamp(); @@ -204,9 +206,9 @@ namespace ts.Completions { host.log?.(`${logPrefix}: ${timestamp() - start}`); return result; - function tryResolve(exportInfo: readonly SymbolExportInfo[], isFromAmbientModule: boolean): ModuleSpecifierResolutionResult | undefined { + function tryResolve(exportInfo: readonly SymbolExportInfo[], symbolName: string, isFromAmbientModule: boolean): ModuleSpecifierResolutionResult | undefined { if (isFromAmbientModule) { - const result = codefix.getModuleSpecifierForBestExportInfo(exportInfo, sourceFile, program, host, preferences); + const result = codefix.getModuleSpecifierForBestExportInfo(exportInfo, symbolName, position, isValidTypeOnlyUseSite, sourceFile, program, host, preferences); if (result) { ambientCount++; } @@ -215,7 +217,7 @@ namespace ts.Completions { const shouldResolveModuleSpecifier = isForImportStatementCompletion || preferences.allowIncompleteCompletions && resolvedCount < moduleSpecifierResolutionLimit; const shouldGetModuleSpecifierFromCache = !shouldResolveModuleSpecifier && preferences.allowIncompleteCompletions && cacheAttemptCount < moduleSpecifierResolutionCacheAttemptLimit; const result = (shouldResolveModuleSpecifier || shouldGetModuleSpecifierFromCache) - ? codefix.getModuleSpecifierForBestExportInfo(exportInfo, sourceFile, program, host, preferences, packageJsonImportFilter, shouldGetModuleSpecifierFromCache) + ? codefix.getModuleSpecifierForBestExportInfo(exportInfo, symbolName, position, isValidTypeOnlyUseSite, sourceFile, program, host, preferences, packageJsonImportFilter, shouldGetModuleSpecifierFromCache) : undefined; if (!shouldResolveModuleSpecifier && !shouldGetModuleSpecifierFromCache || shouldGetModuleSpecifierFromCache && !result) { @@ -358,8 +360,10 @@ namespace ts.Completions { host, program, file, + location.getStart(), preferences, /*isForImportStatementCompletion*/ false, + isValidTypeOnlyAliasUseSite(location), context => { const entries = mapDefined(previousResponse.entries, entry => { if (!entry.hasAction || !entry.source || !entry.data || completionEntryDataIsResolved(entry.data)) { @@ -374,7 +378,7 @@ namespace ts.Completions { const { origin } = Debug.checkDefined(getAutoImportSymbolFromCompletionEntryData(entry.name, entry.data, program, host)); const info = exportMap.get(file.path, entry.data.exportMapKey); - const result = info && context.tryResolve(info, !isExternalModuleNameRelative(stripQuotes(origin.moduleSymbol.name))); + const result = info && context.tryResolve(info, entry.name, !isExternalModuleNameRelative(stripQuotes(origin.moduleSymbol.name))); if (!result) return entry; const newOrigin: SymbolOriginInfoResolvedExport = { @@ -2428,7 +2432,7 @@ namespace ts.Completions { moduleSymbol, symbol: firstAccessibleSymbol, targetFlags: skipAlias(firstAccessibleSymbol, typeChecker).flags, - }], sourceFile, program, host, preferences) || {}; + }], firstAccessibleSymbol.name, position, isValidTypeOnlyAliasUseSite(location), sourceFile, program, host, preferences) || {}; if (moduleSpecifier) { const origin: SymbolOriginInfoResolvedExport = { @@ -2707,8 +2711,10 @@ namespace ts.Completions { host, program, sourceFile, + position, preferences, !!importCompletionNode, + isValidTypeOnlyAliasUseSite(location), context => { exportInfo.search( sourceFile.path, @@ -2737,7 +2743,7 @@ namespace ts.Completions { // If we don't need to resolve module specifiers, we can use any re-export that is importable at all // (We need to ensure that at least one is importable to show a completion.) - const { exportInfo = defaultExportInfo, moduleSpecifier } = context.tryResolve(info, isFromAmbientModule) || {}; + const { exportInfo = defaultExportInfo, moduleSpecifier } = context.tryResolve(info, symbolName, isFromAmbientModule) || {}; const isDefaultExport = exportInfo.exportKind === ExportKind.Default; const symbol = isDefaultExport && getLocalSymbolForExportDefault(exportInfo.symbol) || exportInfo.symbol; diff --git a/tests/cases/fourslash/completionsImport_preferUpdatingExistingImport.ts b/tests/cases/fourslash/completionsImport_preferUpdatingExistingImport.ts new file mode 100644 index 00000000000..14933e083a9 --- /dev/null +++ b/tests/cases/fourslash/completionsImport_preferUpdatingExistingImport.ts @@ -0,0 +1,31 @@ +/// + +// @module: commonjs + +// @Filename: /deep/module/why/you/want/this/path.ts +//// export const x = 0; +//// export const y = 1; + +// @Filename: /nice/reexport.ts +//// import { x, y } from "../deep/module/why/you/want/this/path"; +//// export { x, y }; + +// @Filename: /index.ts +//// import { x } from "./deep/module/why/you/want/this/path"; +//// +//// y/**/ + +verify.completions({ + marker: "", + exact: completion.globalsPlus(["x", { + name: "y", + source: "./deep/module/why/you/want/this/path", + sourceDisplay: "./deep/module/why/you/want/this/path", + sortText: completion.SortText.AutoImportSuggestions, + hasAction: true, + }]), + preferences: { + includeCompletionsForModuleExports: true, + allowIncompleteCompletions: true, + }, +}); From 06fb30725d4a70708b28f2a4613543ce8c4cd645 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Mon, 25 Apr 2022 06:06:45 +0000 Subject: [PATCH 18/63] Update package-lock.json --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index f4e280626f7..ccdceca9009 100644 --- a/package-lock.json +++ b/package-lock.json @@ -638,9 +638,9 @@ "dev": true }, "@types/node": { - "version": "17.0.25", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.25.tgz", - "integrity": "sha512-wANk6fBrUwdpY4isjWrKTufkrXdu1D2YHCot2fD/DfWxF5sMrVSA+KN7ydckvaTCh0HiqX9IVl0L5/ZoXg5M7w==", + "version": "17.0.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.26.tgz", + "integrity": "sha512-z/FG/6DUO7pnze3AE3TBGIjGGKkvCcGcWINe1C7cADY8hKLJPDYpzsNE37uExQ4md5RFtTCvg+M8Mu1Enyeg2A==", "dev": true }, "@types/node-fetch": { From 42fc05b087ff53012b570bb00105296ca054945e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Mon, 25 Apr 2022 20:37:54 +0200 Subject: [PATCH 19/63] Don't run scheduled GitHub actions on forks (#48693) Co-authored-by: TypeScript Bot --- .github/workflows/codeql.yml | 1 + .github/workflows/ensure-related-repos-run-crons.yml | 1 + .github/workflows/nightly.yaml | 1 + .github/workflows/twoslash-repros.yaml | 1 + .github/workflows/update-package-lock.yaml | 1 + 5 files changed, 5 insertions(+) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 8cb8045ef42..e9bc38cbcae 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -11,6 +11,7 @@ jobs: # CodeQL runs on ubuntu-latest and windows-latest runs-on: ubuntu-latest + if: github.repository == 'microsoft/TypeScript' steps: - name: Checkout repository diff --git a/.github/workflows/ensure-related-repos-run-crons.yml b/.github/workflows/ensure-related-repos-run-crons.yml index f6faff6b67f..a26fb5b7992 100644 --- a/.github/workflows/ensure-related-repos-run-crons.yml +++ b/.github/workflows/ensure-related-repos-run-crons.yml @@ -14,6 +14,7 @@ on: jobs: build: runs-on: ubuntu-latest + if: github.repository == 'microsoft/TypeScript' steps: - name: Configure git diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index c207c19ace2..d425bea605f 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -11,6 +11,7 @@ on: jobs: build: runs-on: ubuntu-latest + if: github.repository == 'microsoft/TypeScript' steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/twoslash-repros.yaml b/.github/workflows/twoslash-repros.yaml index 0a8ba026ac4..1e782f8cf98 100644 --- a/.github/workflows/twoslash-repros.yaml +++ b/.github/workflows/twoslash-repros.yaml @@ -22,6 +22,7 @@ jobs: run: if: ${{ !github.event.label && !github.event.inputs.bisect_issue }} runs-on: ubuntu-latest + if: github.repository == 'microsoft/TypeScript' steps: - name: Use node uses: actions/setup-node@v1 diff --git a/.github/workflows/update-package-lock.yaml b/.github/workflows/update-package-lock.yaml index 3880b5cae83..5c66d1078eb 100644 --- a/.github/workflows/update-package-lock.yaml +++ b/.github/workflows/update-package-lock.yaml @@ -10,6 +10,7 @@ on: jobs: build: runs-on: ubuntu-latest + if: github.repository == 'microsoft/TypeScript' steps: - uses: actions/checkout@v2 From 7920783876274d9aacd4697a185c351d2d476cb5 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Mon, 25 Apr 2022 13:03:02 -0700 Subject: [PATCH 20/63] Fix workflow syntax error (#48842) --- .github/workflows/twoslash-repros.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/twoslash-repros.yaml b/.github/workflows/twoslash-repros.yaml index 1e782f8cf98..9563d72136c 100644 --- a/.github/workflows/twoslash-repros.yaml +++ b/.github/workflows/twoslash-repros.yaml @@ -20,9 +20,8 @@ on: jobs: run: - if: ${{ !github.event.label && !github.event.inputs.bisect_issue }} + if: ${{ github.repository == 'microsoft/TypeScript' && !github.event.label && !github.event.inputs.bisect_issue }} runs-on: ubuntu-latest - if: github.repository == 'microsoft/TypeScript' steps: - name: Use node uses: actions/setup-node@v1 From 787bb9ddb60368f84b1ed1b0971aa2bf79fdec77 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 25 Apr 2022 15:36:06 -0700 Subject: [PATCH 21/63] Improve support for numeric string types (#48837) * Improve support for numeric string types * Update test * Add tests --- src/compiler/checker.ts | 45 +++++-- .../reference/numericStringLiteralTypes.js | 80 ++++++++++++ .../numericStringLiteralTypes.symbols | 122 ++++++++++++++++++ .../reference/numericStringLiteralTypes.types | 102 +++++++++++++++ .../templateLiteralTypes1.errors.txt | 3 +- .../reference/templateLiteralTypes1.js | 1 + .../reference/templateLiteralTypes1.symbols | 95 +++++++------- .../reference/templateLiteralTypes1.types | 1 + .../literal/numericStringLiteralTypes.ts | 40 ++++++ .../types/literal/templateLiteralTypes1.ts | 1 + 10 files changed, 430 insertions(+), 60 deletions(-) create mode 100644 tests/baselines/reference/numericStringLiteralTypes.js create mode 100644 tests/baselines/reference/numericStringLiteralTypes.symbols create mode 100644 tests/baselines/reference/numericStringLiteralTypes.types create mode 100644 tests/cases/conformance/types/literal/numericStringLiteralTypes.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 477851cc4e2..dba3c8584b1 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -833,6 +833,7 @@ namespace ts { const keyofConstraintType = keyofStringsOnly ? stringType : stringNumberSymbolType; const numberOrBigIntType = getUnionType([numberType, bigintType]); const templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]) as UnionType; + const numericStringType = getTemplateLiteralType(["", ""], [numberType]); // The `${number}` type const restrictiveMapper: TypeMapper = makeFunctionTypeMapper(t => t.flags & TypeFlags.TypeParameter ? getRestrictiveTypeParameter(t as TypeParameter) : t); const permissiveMapper: TypeMapper = makeFunctionTypeMapper(t => t.flags & TypeFlags.TypeParameter ? wildcardType : t); @@ -12273,7 +12274,7 @@ namespace ts { const typeVariable = getHomomorphicTypeVariable(type); if (typeVariable && !type.declaration.nameType) { const constraint = getConstraintOfTypeParameter(typeVariable); - if (constraint && (isArrayType(constraint) || isTupleType(constraint))) { + if (constraint && isArrayOrTupleType(constraint)) { return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper)); } } @@ -12654,10 +12655,10 @@ namespace ts { function isApplicableIndexType(source: Type, target: Type): boolean { // A 'string' index signature applies to types assignable to 'string' or 'number', and a 'number' index - // signature applies to types assignable to 'number' and numeric string literal types. + // signature applies to types assignable to 'number', `${number}` and numeric string literal types. return isTypeAssignableTo(source, target) || target === stringType && isTypeAssignableTo(source, numberType) || - target === numberType && !!(source.flags & TypeFlags.StringLiteral) && isNumericLiteralName((source as StringLiteralType).value); + target === numberType && (source === numericStringType || !!(source.flags & TypeFlags.StringLiteral) && isNumericLiteralName((source as StringLiteralType).value)); } function getIndexInfosOfStructuredType(type: Type): readonly IndexInfo[] { @@ -13778,6 +13779,20 @@ namespace ts { constraints = append(constraints, constraint); } } + // Given a homomorphic mapped type { [K in keyof T]: XXX }, where T is constrained to an array or tuple type, in the + // template type XXX, K has an added constraint of number | `${number}`. + else if (type.flags & TypeFlags.TypeParameter && parent.kind === SyntaxKind.MappedType && node === (parent as MappedTypeNode).type) { + const mappedType = getTypeFromTypeNode(parent as TypeNode) as MappedType; + if (getTypeParameterFromMappedType(mappedType) === getActualTypeVariable(type)) { + const typeParameter = getHomomorphicTypeVariable(mappedType); + if (typeParameter) { + const constraint = getConstraintOfTypeParameter(typeParameter); + if (constraint && everyType(constraint, isArrayOrTupleType)) { + constraints = append(constraints, getUnionType([numberType, numericStringType])); + } + } + } + } node = parent; } return constraints ? getSubstitutionType(type, getIntersectionType(append(constraints, type))) : type; @@ -14817,7 +14832,7 @@ namespace ts { i--; const t = types[i]; const remove = - t.flags & TypeFlags.String && includes & TypeFlags.StringLiteral || + t.flags & TypeFlags.String && includes & (TypeFlags.StringLiteral | TypeFlags.TemplateLiteral | TypeFlags.StringMapping) || t.flags & TypeFlags.Number && includes & TypeFlags.NumberLiteral || t.flags & TypeFlags.BigInt && includes & TypeFlags.BigIntLiteral || t.flags & TypeFlags.ESSymbol && includes & TypeFlags.UniqueESSymbol; @@ -14978,7 +14993,7 @@ namespace ts { if (!strictNullChecks && includes & TypeFlags.Nullable) { return includes & TypeFlags.Undefined ? undefinedType : nullType; } - if (includes & TypeFlags.String && includes & TypeFlags.StringLiteral || + if (includes & TypeFlags.String && includes & (TypeFlags.StringLiteral | TypeFlags.TemplateLiteral | TypeFlags.StringMapping) || includes & TypeFlags.Number && includes & TypeFlags.NumberLiteral || includes & TypeFlags.BigInt && includes & TypeFlags.BigIntLiteral || includes & TypeFlags.ESSymbol && includes & TypeFlags.UniqueESSymbol) { @@ -16996,7 +17011,7 @@ namespace ts { if (!type.declaration.nameType) { let constraint; if (isArrayType(t) || t.flags & TypeFlags.Any && findResolutionCycleStartIndex(typeVariable, TypeSystemPropertyName.ImmediateBaseConstraint) < 0 && - (constraint = getConstraintOfTypeParameter(typeVariable)) && everyType(constraint, or(isArrayType, isTupleType))) { + (constraint = getConstraintOfTypeParameter(typeVariable)) && everyType(constraint, isArrayOrTupleType)) { return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper)); } if (isGenericTupleType(t)) { @@ -18565,7 +18580,7 @@ namespace ts { } return false; } - return isTupleType(target) || isArrayType(target); + return isArrayOrTupleType(target); } if (isReadonlyArrayType(source) && isMutableArrayOrTuple(target)) { if (reportErrors) { @@ -18700,7 +18715,7 @@ namespace ts { // recursive intersections that are structurally similar but not exactly identical. See #37854. if (result && !inPropertyCheck && ( target.flags & TypeFlags.Intersection && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) || - isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & TypeFlags.Intersection && getApparentType(source).flags & TypeFlags.StructuredType && !some((source as IntersectionType).types, t => !!(getObjectFlags(t) & ObjectFlags.NonInferrableType)))) { + isNonGenericObjectType(target) && !isArrayOrTupleType(target) && source.flags & TypeFlags.Intersection && getApparentType(source).flags & TypeFlags.StructuredType && !some((source as IntersectionType).types, t => !!(getObjectFlags(t) & ObjectFlags.NonInferrableType)))) { inPropertyCheck = true; result &= recursiveTypeRelatedTo(source, target, reportErrors, IntersectionState.PropertyCheck, recursionFlags); inPropertyCheck = false; @@ -19708,7 +19723,7 @@ namespace ts { return varianceResult; } } - else if (isReadonlyArrayType(target) ? isArrayType(source) || isTupleType(source) : isArrayType(target) && isTupleType(source) && !source.target.readonly) { + else if (isReadonlyArrayType(target) ? isArrayOrTupleType(source) : isArrayType(target) && isTupleType(source) && !source.target.readonly) { if (relation !== identityRelation) { return isRelatedTo(getIndexTypeOfType(source, numberType) || anyType, getIndexTypeOfType(target, numberType) || anyType, RecursionFlags.Both, reportErrors); } @@ -20093,7 +20108,7 @@ namespace ts { } let result = Ternary.True; if (isTupleType(target)) { - if (isArrayType(source) || isTupleType(source)) { + if (isArrayOrTupleType(source)) { if (!target.target.readonly && (isReadonlyArrayType(source) || isTupleType(source) && source.target.readonly)) { return Ternary.False; } @@ -21098,6 +21113,10 @@ namespace ts { return !!(getObjectFlags(type) & ObjectFlags.Reference) && (type as TypeReference).target === globalReadonlyArrayType; } + function isArrayOrTupleType(type: Type): type is TypeReference { + return isArrayType(type) || isTupleType(type); + } + function isMutableArrayOrTuple(type: Type): boolean { return isArrayType(type) && !isReadonlyArrayType(type) || isTupleType(type) && !type.target.readonly; } @@ -21598,7 +21617,7 @@ namespace ts { else if (type.flags & TypeFlags.Intersection) { result = getIntersectionType(sameMap((type as IntersectionType).types, getWidenedType)); } - else if (isArrayType(type) || isTupleType(type)) { + else if (isArrayOrTupleType(type)) { result = createTypeReference(type.target, sameMap(getTypeArguments(type), getWidenedType)); } if (result && context === undefined) { @@ -21635,7 +21654,7 @@ namespace ts { } } } - if (isArrayType(type) || isTupleType(type)) { + if (isArrayOrTupleType(type)) { for (const t of getTypeArguments(type)) { if (reportWideningErrorsInType(t)) { errorReported = true; @@ -22714,7 +22733,7 @@ namespace ts { } // Infer from the members of source and target only if the two types are possibly related if (!typesDefinitelyUnrelated(source, target)) { - if (isArrayType(source) || isTupleType(source)) { + if (isArrayOrTupleType(source)) { if (isTupleType(target)) { const sourceArity = getTypeReferenceArity(source); const targetArity = getTypeReferenceArity(target); diff --git a/tests/baselines/reference/numericStringLiteralTypes.js b/tests/baselines/reference/numericStringLiteralTypes.js new file mode 100644 index 00000000000..975ca1d3179 --- /dev/null +++ b/tests/baselines/reference/numericStringLiteralTypes.js @@ -0,0 +1,80 @@ +//// [numericStringLiteralTypes.ts] +type T0 = string & `${string}`; // string +type T1 = string & `${number}`; // `${number} +type T2 = string & `${bigint}`; // `${bigint} +type T3 = string & `${T}`; // `${T} +type T4 = string & `${Capitalize<`${T}`>}`; // `${Capitalize}` + +function f1(a: boolean[], x: `${number}`) { + let s = a[x]; // boolean +} + +function f2(a: boolean[], x: number | `${number}`) { + let s = a[x]; // boolean +} + +type T10 = boolean[][`${number}`]; // boolean +type T11 = boolean[][number | `${number}`]; // boolean + +type T20 = T; +type T21 = { [K in keyof T]: T20 }; + +type Container = { + value: T +} + +type UnwrapContainers[]> = { [K in keyof T]: T[K]['value'] }; + +declare function createContainer(value: T): Container; + +declare function f[]>(containers: [...T], callback: (...values: UnwrapContainers) => void): void; + +const container1 = createContainer('hi') +const container2 = createContainer(2) + +f([container1, container2], (value1, value2) => { + value1; // string + value2; // number +}); + + +//// [numericStringLiteralTypes.js] +"use strict"; +function f1(a, x) { + var s = a[x]; // boolean +} +function f2(a, x) { + var s = a[x]; // boolean +} +var container1 = createContainer('hi'); +var container2 = createContainer(2); +f([container1, container2], function (value1, value2) { + value1; // string + value2; // number +}); + + +//// [numericStringLiteralTypes.d.ts] +declare type T0 = string & `${string}`; +declare type T1 = string & `${number}`; +declare type T2 = string & `${bigint}`; +declare type T3 = string & `${T}`; +declare type T4 = string & `${Capitalize<`${T}`>}`; +declare function f1(a: boolean[], x: `${number}`): void; +declare function f2(a: boolean[], x: number | `${number}`): void; +declare type T10 = boolean[][`${number}`]; +declare type T11 = boolean[][number | `${number}`]; +declare type T20 = T; +declare type T21 = { + [K in keyof T]: T20; +}; +declare type Container = { + value: T; +}; +declare type UnwrapContainers[]> = { + [K in keyof T]: T[K]['value']; +}; +declare function createContainer(value: T): Container; +declare function f[]>(containers: [...T], callback: (...values: UnwrapContainers) => void): void; +declare const container1: Container; +declare const container2: Container; diff --git a/tests/baselines/reference/numericStringLiteralTypes.symbols b/tests/baselines/reference/numericStringLiteralTypes.symbols new file mode 100644 index 00000000000..33d2a1633a6 --- /dev/null +++ b/tests/baselines/reference/numericStringLiteralTypes.symbols @@ -0,0 +1,122 @@ +=== tests/cases/conformance/types/literal/numericStringLiteralTypes.ts === +type T0 = string & `${string}`; // string +>T0 : Symbol(T0, Decl(numericStringLiteralTypes.ts, 0, 0)) + +type T1 = string & `${number}`; // `${number} +>T1 : Symbol(T1, Decl(numericStringLiteralTypes.ts, 0, 31)) + +type T2 = string & `${bigint}`; // `${bigint} +>T2 : Symbol(T2, Decl(numericStringLiteralTypes.ts, 1, 31)) + +type T3 = string & `${T}`; // `${T} +>T3 : Symbol(T3, Decl(numericStringLiteralTypes.ts, 2, 31)) +>T : Symbol(T, Decl(numericStringLiteralTypes.ts, 3, 8)) +>T : Symbol(T, Decl(numericStringLiteralTypes.ts, 3, 8)) + +type T4 = string & `${Capitalize<`${T}`>}`; // `${Capitalize}` +>T4 : Symbol(T4, Decl(numericStringLiteralTypes.ts, 3, 44)) +>T : Symbol(T, Decl(numericStringLiteralTypes.ts, 4, 8)) +>Capitalize : Symbol(Capitalize, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(numericStringLiteralTypes.ts, 4, 8)) + +function f1(a: boolean[], x: `${number}`) { +>f1 : Symbol(f1, Decl(numericStringLiteralTypes.ts, 4, 61)) +>a : Symbol(a, Decl(numericStringLiteralTypes.ts, 6, 12)) +>x : Symbol(x, Decl(numericStringLiteralTypes.ts, 6, 25)) + + let s = a[x]; // boolean +>s : Symbol(s, Decl(numericStringLiteralTypes.ts, 7, 7)) +>a : Symbol(a, Decl(numericStringLiteralTypes.ts, 6, 12)) +>x : Symbol(x, Decl(numericStringLiteralTypes.ts, 6, 25)) +} + +function f2(a: boolean[], x: number | `${number}`) { +>f2 : Symbol(f2, Decl(numericStringLiteralTypes.ts, 8, 1)) +>a : Symbol(a, Decl(numericStringLiteralTypes.ts, 10, 12)) +>x : Symbol(x, Decl(numericStringLiteralTypes.ts, 10, 25)) + + let s = a[x]; // boolean +>s : Symbol(s, Decl(numericStringLiteralTypes.ts, 11, 7)) +>a : Symbol(a, Decl(numericStringLiteralTypes.ts, 10, 12)) +>x : Symbol(x, Decl(numericStringLiteralTypes.ts, 10, 25)) +} + +type T10 = boolean[][`${number}`]; // boolean +>T10 : Symbol(T10, Decl(numericStringLiteralTypes.ts, 12, 1)) + +type T11 = boolean[][number | `${number}`]; // boolean +>T11 : Symbol(T11, Decl(numericStringLiteralTypes.ts, 14, 34)) + +type T20 = T; +>T20 : Symbol(T20, Decl(numericStringLiteralTypes.ts, 15, 43)) +>T : Symbol(T, Decl(numericStringLiteralTypes.ts, 17, 9)) +>T : Symbol(T, Decl(numericStringLiteralTypes.ts, 17, 9)) + +type T21 = { [K in keyof T]: T20 }; +>T21 : Symbol(T21, Decl(numericStringLiteralTypes.ts, 17, 45)) +>T : Symbol(T, Decl(numericStringLiteralTypes.ts, 18, 9)) +>K : Symbol(K, Decl(numericStringLiteralTypes.ts, 18, 35)) +>T : Symbol(T, Decl(numericStringLiteralTypes.ts, 18, 9)) +>T20 : Symbol(T20, Decl(numericStringLiteralTypes.ts, 15, 43)) +>K : Symbol(K, Decl(numericStringLiteralTypes.ts, 18, 35)) + +type Container = { +>Container : Symbol(Container, Decl(numericStringLiteralTypes.ts, 18, 59)) +>T : Symbol(T, Decl(numericStringLiteralTypes.ts, 20, 15)) + + value: T +>value : Symbol(value, Decl(numericStringLiteralTypes.ts, 20, 21)) +>T : Symbol(T, Decl(numericStringLiteralTypes.ts, 20, 15)) +} + +type UnwrapContainers[]> = { [K in keyof T]: T[K]['value'] }; +>UnwrapContainers : Symbol(UnwrapContainers, Decl(numericStringLiteralTypes.ts, 22, 1)) +>T : Symbol(T, Decl(numericStringLiteralTypes.ts, 24, 22)) +>Container : Symbol(Container, Decl(numericStringLiteralTypes.ts, 18, 59)) +>K : Symbol(K, Decl(numericStringLiteralTypes.ts, 24, 59)) +>T : Symbol(T, Decl(numericStringLiteralTypes.ts, 24, 22)) +>T : Symbol(T, Decl(numericStringLiteralTypes.ts, 24, 22)) +>K : Symbol(K, Decl(numericStringLiteralTypes.ts, 24, 59)) + +declare function createContainer(value: T): Container; +>createContainer : Symbol(createContainer, Decl(numericStringLiteralTypes.ts, 24, 90)) +>T : Symbol(T, Decl(numericStringLiteralTypes.ts, 26, 33)) +>value : Symbol(value, Decl(numericStringLiteralTypes.ts, 26, 52)) +>T : Symbol(T, Decl(numericStringLiteralTypes.ts, 26, 33)) +>Container : Symbol(Container, Decl(numericStringLiteralTypes.ts, 18, 59)) +>T : Symbol(T, Decl(numericStringLiteralTypes.ts, 26, 33)) + +declare function f[]>(containers: [...T], callback: (...values: UnwrapContainers) => void): void; +>f : Symbol(f, Decl(numericStringLiteralTypes.ts, 26, 76)) +>T : Symbol(T, Decl(numericStringLiteralTypes.ts, 28, 19)) +>Container : Symbol(Container, Decl(numericStringLiteralTypes.ts, 18, 59)) +>containers : Symbol(containers, Decl(numericStringLiteralTypes.ts, 28, 51)) +>T : Symbol(T, Decl(numericStringLiteralTypes.ts, 28, 19)) +>callback : Symbol(callback, Decl(numericStringLiteralTypes.ts, 28, 70)) +>values : Symbol(values, Decl(numericStringLiteralTypes.ts, 28, 82)) +>UnwrapContainers : Symbol(UnwrapContainers, Decl(numericStringLiteralTypes.ts, 22, 1)) +>T : Symbol(T, Decl(numericStringLiteralTypes.ts, 28, 19)) + +const container1 = createContainer('hi') +>container1 : Symbol(container1, Decl(numericStringLiteralTypes.ts, 30, 5)) +>createContainer : Symbol(createContainer, Decl(numericStringLiteralTypes.ts, 24, 90)) + +const container2 = createContainer(2) +>container2 : Symbol(container2, Decl(numericStringLiteralTypes.ts, 31, 5)) +>createContainer : Symbol(createContainer, Decl(numericStringLiteralTypes.ts, 24, 90)) + +f([container1, container2], (value1, value2) => { +>f : Symbol(f, Decl(numericStringLiteralTypes.ts, 26, 76)) +>container1 : Symbol(container1, Decl(numericStringLiteralTypes.ts, 30, 5)) +>container2 : Symbol(container2, Decl(numericStringLiteralTypes.ts, 31, 5)) +>value1 : Symbol(value1, Decl(numericStringLiteralTypes.ts, 33, 29)) +>value2 : Symbol(value2, Decl(numericStringLiteralTypes.ts, 33, 36)) + + value1; // string +>value1 : Symbol(value1, Decl(numericStringLiteralTypes.ts, 33, 29)) + + value2; // number +>value2 : Symbol(value2, Decl(numericStringLiteralTypes.ts, 33, 36)) + +}); + diff --git a/tests/baselines/reference/numericStringLiteralTypes.types b/tests/baselines/reference/numericStringLiteralTypes.types new file mode 100644 index 00000000000..245a3a674ba --- /dev/null +++ b/tests/baselines/reference/numericStringLiteralTypes.types @@ -0,0 +1,102 @@ +=== tests/cases/conformance/types/literal/numericStringLiteralTypes.ts === +type T0 = string & `${string}`; // string +>T0 : string + +type T1 = string & `${number}`; // `${number} +>T1 : `${number}` + +type T2 = string & `${bigint}`; // `${bigint} +>T2 : `${bigint}` + +type T3 = string & `${T}`; // `${T} +>T3 : `${T}` + +type T4 = string & `${Capitalize<`${T}`>}`; // `${Capitalize}` +>T4 : `${Capitalize<`${T}`>}` + +function f1(a: boolean[], x: `${number}`) { +>f1 : (a: boolean[], x: `${number}`) => void +>a : boolean[] +>x : `${number}` + + let s = a[x]; // boolean +>s : boolean +>a[x] : boolean +>a : boolean[] +>x : `${number}` +} + +function f2(a: boolean[], x: number | `${number}`) { +>f2 : (a: boolean[], x: number | `${number}`) => void +>a : boolean[] +>x : number | `${number}` + + let s = a[x]; // boolean +>s : boolean +>a[x] : boolean +>a : boolean[] +>x : number | `${number}` +} + +type T10 = boolean[][`${number}`]; // boolean +>T10 : boolean + +type T11 = boolean[][number | `${number}`]; // boolean +>T11 : boolean + +type T20 = T; +>T20 : T + +type T21 = { [K in keyof T]: T20 }; +>T21 : T21 + +type Container = { +>Container : Container + + value: T +>value : T +} + +type UnwrapContainers[]> = { [K in keyof T]: T[K]['value'] }; +>UnwrapContainers : UnwrapContainers + +declare function createContainer(value: T): Container; +>createContainer : (value: T) => Container +>value : T + +declare function f[]>(containers: [...T], callback: (...values: UnwrapContainers) => void): void; +>f : []>(containers: [...T], callback: (...values: UnwrapContainers) => void) => void +>containers : [...T] +>callback : (...values: UnwrapContainers) => void +>values : UnwrapContainers + +const container1 = createContainer('hi') +>container1 : Container +>createContainer('hi') : Container +>createContainer : (value: T) => Container +>'hi' : "hi" + +const container2 = createContainer(2) +>container2 : Container +>createContainer(2) : Container +>createContainer : (value: T) => Container +>2 : 2 + +f([container1, container2], (value1, value2) => { +>f([container1, container2], (value1, value2) => { value1; // string value2; // number}) : void +>f : []>(containers: [...T], callback: (...values: UnwrapContainers) => void) => void +>[container1, container2] : [Container, Container] +>container1 : Container +>container2 : Container +>(value1, value2) => { value1; // string value2; // number} : (value1: string, value2: number) => void +>value1 : string +>value2 : number + + value1; // string +>value1 : string + + value2; // number +>value2 : number + +}); + diff --git a/tests/baselines/reference/templateLiteralTypes1.errors.txt b/tests/baselines/reference/templateLiteralTypes1.errors.txt index e586a1678eb..384125f3380 100644 --- a/tests/baselines/reference/templateLiteralTypes1.errors.txt +++ b/tests/baselines/reference/templateLiteralTypes1.errors.txt @@ -6,7 +6,7 @@ tests/cases/conformance/types/literal/templateLiteralTypes1.ts(165,15): error TS tests/cases/conformance/types/literal/templateLiteralTypes1.ts(197,16): error TS2590: Expression produces a union type that is too complex to represent. tests/cases/conformance/types/literal/templateLiteralTypes1.ts(201,16): error TS2590: Expression produces a union type that is too complex to represent. tests/cases/conformance/types/literal/templateLiteralTypes1.ts(205,16): error TS2590: Expression produces a union type that is too complex to represent. -tests/cases/conformance/types/literal/templateLiteralTypes1.ts(251,7): error TS2590: Expression produces a union type that is too complex to represent. +tests/cases/conformance/types/literal/templateLiteralTypes1.ts(252,7): error TS2590: Expression produces a union type that is too complex to represent. ==== tests/cases/conformance/types/literal/templateLiteralTypes1.ts (7 errors) ==== @@ -242,6 +242,7 @@ tests/cases/conformance/types/literal/templateLiteralTypes1.ts(251,7): error TS2 // Repro from #40970 type PathKeys = + unknown extends T ? never : T extends readonly any[] ? Extract | SubKeys> : T extends object ? Extract | SubKeys> : never; diff --git a/tests/baselines/reference/templateLiteralTypes1.js b/tests/baselines/reference/templateLiteralTypes1.js index d212909fd7d..afa410f6dc9 100644 --- a/tests/baselines/reference/templateLiteralTypes1.js +++ b/tests/baselines/reference/templateLiteralTypes1.js @@ -217,6 +217,7 @@ type BB = AA<-2, -2>; // Repro from #40970 type PathKeys = + unknown extends T ? never : T extends readonly any[] ? Extract | SubKeys> : T extends object ? Extract | SubKeys> : never; diff --git a/tests/baselines/reference/templateLiteralTypes1.symbols b/tests/baselines/reference/templateLiteralTypes1.symbols index 8f539fe347e..fda962de761 100644 --- a/tests/baselines/reference/templateLiteralTypes1.symbols +++ b/tests/baselines/reference/templateLiteralTypes1.symbols @@ -878,11 +878,14 @@ type PathKeys = >PathKeys : Symbol(PathKeys, Decl(templateLiteralTypes1.ts, 213, 21)) >T : Symbol(T, Decl(templateLiteralTypes1.ts, 217, 14)) + unknown extends T ? never : +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 217, 14)) + T extends readonly any[] ? Extract | SubKeys> : >T : Symbol(T, Decl(templateLiteralTypes1.ts, 217, 14)) >Extract : Symbol(Extract, Decl(lib.es5.d.ts, --, --)) >T : Symbol(T, Decl(templateLiteralTypes1.ts, 217, 14)) ->SubKeys : Symbol(SubKeys, Decl(templateLiteralTypes1.ts, 220, 10)) +>SubKeys : Symbol(SubKeys, Decl(templateLiteralTypes1.ts, 221, 10)) >T : Symbol(T, Decl(templateLiteralTypes1.ts, 217, 14)) >Extract : Symbol(Extract, Decl(lib.es5.d.ts, --, --)) >T : Symbol(T, Decl(templateLiteralTypes1.ts, 217, 14)) @@ -891,7 +894,7 @@ type PathKeys = >T : Symbol(T, Decl(templateLiteralTypes1.ts, 217, 14)) >Extract : Symbol(Extract, Decl(lib.es5.d.ts, --, --)) >T : Symbol(T, Decl(templateLiteralTypes1.ts, 217, 14)) ->SubKeys : Symbol(SubKeys, Decl(templateLiteralTypes1.ts, 220, 10)) +>SubKeys : Symbol(SubKeys, Decl(templateLiteralTypes1.ts, 221, 10)) >T : Symbol(T, Decl(templateLiteralTypes1.ts, 217, 14)) >Extract : Symbol(Extract, Decl(lib.es5.d.ts, --, --)) >T : Symbol(T, Decl(templateLiteralTypes1.ts, 217, 14)) @@ -899,63 +902,63 @@ type PathKeys = never; type SubKeys = K extends keyof T ? `${K}.${PathKeys}` : never; ->SubKeys : Symbol(SubKeys, Decl(templateLiteralTypes1.ts, 220, 10)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 222, 13)) ->K : Symbol(K, Decl(templateLiteralTypes1.ts, 222, 15)) ->K : Symbol(K, Decl(templateLiteralTypes1.ts, 222, 15)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 222, 13)) ->K : Symbol(K, Decl(templateLiteralTypes1.ts, 222, 15)) +>SubKeys : Symbol(SubKeys, Decl(templateLiteralTypes1.ts, 221, 10)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 223, 13)) +>K : Symbol(K, Decl(templateLiteralTypes1.ts, 223, 15)) +>K : Symbol(K, Decl(templateLiteralTypes1.ts, 223, 15)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 223, 13)) +>K : Symbol(K, Decl(templateLiteralTypes1.ts, 223, 15)) >PathKeys : Symbol(PathKeys, Decl(templateLiteralTypes1.ts, 213, 21)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 222, 13)) ->K : Symbol(K, Decl(templateLiteralTypes1.ts, 222, 15)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 223, 13)) +>K : Symbol(K, Decl(templateLiteralTypes1.ts, 223, 15)) declare function getProp2>(obj: T, path: P): PropType; ->getProp2 : Symbol(getProp2, Decl(templateLiteralTypes1.ts, 222, 89)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 224, 26)) ->P : Symbol(P, Decl(templateLiteralTypes1.ts, 224, 28)) +>getProp2 : Symbol(getProp2, Decl(templateLiteralTypes1.ts, 223, 89)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 225, 26)) +>P : Symbol(P, Decl(templateLiteralTypes1.ts, 225, 28)) >PathKeys : Symbol(PathKeys, Decl(templateLiteralTypes1.ts, 213, 21)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 224, 26)) ->obj : Symbol(obj, Decl(templateLiteralTypes1.ts, 224, 52)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 224, 26)) ->path : Symbol(path, Decl(templateLiteralTypes1.ts, 224, 59)) ->P : Symbol(P, Decl(templateLiteralTypes1.ts, 224, 28)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 225, 26)) +>obj : Symbol(obj, Decl(templateLiteralTypes1.ts, 225, 52)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 225, 26)) +>path : Symbol(path, Decl(templateLiteralTypes1.ts, 225, 59)) +>P : Symbol(P, Decl(templateLiteralTypes1.ts, 225, 28)) >PropType : Symbol(PropType, Decl(templateLiteralTypes1.ts, 138, 69)) ->T : Symbol(T, Decl(templateLiteralTypes1.ts, 224, 26)) ->P : Symbol(P, Decl(templateLiteralTypes1.ts, 224, 28)) +>T : Symbol(T, Decl(templateLiteralTypes1.ts, 225, 26)) +>P : Symbol(P, Decl(templateLiteralTypes1.ts, 225, 28)) const obj2 = { ->obj2 : Symbol(obj2, Decl(templateLiteralTypes1.ts, 226, 5)) +>obj2 : Symbol(obj2, Decl(templateLiteralTypes1.ts, 227, 5)) name: 'John', ->name : Symbol(name, Decl(templateLiteralTypes1.ts, 226, 14)) +>name : Symbol(name, Decl(templateLiteralTypes1.ts, 227, 14)) age: 42, ->age : Symbol(age, Decl(templateLiteralTypes1.ts, 227, 17)) +>age : Symbol(age, Decl(templateLiteralTypes1.ts, 228, 17)) cars: [ ->cars : Symbol(cars, Decl(templateLiteralTypes1.ts, 228, 12)) +>cars : Symbol(cars, Decl(templateLiteralTypes1.ts, 229, 12)) { make: 'Ford', age: 10 }, ->make : Symbol(make, Decl(templateLiteralTypes1.ts, 230, 9)) ->age : Symbol(age, Decl(templateLiteralTypes1.ts, 230, 23)) +>make : Symbol(make, Decl(templateLiteralTypes1.ts, 231, 9)) +>age : Symbol(age, Decl(templateLiteralTypes1.ts, 231, 23)) { make: 'Trabant', age: 35 } ->make : Symbol(make, Decl(templateLiteralTypes1.ts, 231, 9)) ->age : Symbol(age, Decl(templateLiteralTypes1.ts, 231, 26)) +>make : Symbol(make, Decl(templateLiteralTypes1.ts, 232, 9)) +>age : Symbol(age, Decl(templateLiteralTypes1.ts, 232, 26)) ] } as const; >const : Symbol(const) let make = getProp2(obj2, 'cars.1.make'); // 'Trabant' ->make : Symbol(make, Decl(templateLiteralTypes1.ts, 235, 3)) ->getProp2 : Symbol(getProp2, Decl(templateLiteralTypes1.ts, 222, 89)) ->obj2 : Symbol(obj2, Decl(templateLiteralTypes1.ts, 226, 5)) +>make : Symbol(make, Decl(templateLiteralTypes1.ts, 236, 3)) +>getProp2 : Symbol(getProp2, Decl(templateLiteralTypes1.ts, 223, 89)) +>obj2 : Symbol(obj2, Decl(templateLiteralTypes1.ts, 227, 5)) // Repro from #46480 export type Spacing = ->Spacing : Symbol(Spacing, Decl(templateLiteralTypes1.ts, 235, 41)) +>Spacing : Symbol(Spacing, Decl(templateLiteralTypes1.ts, 236, 41)) | `0` | `${number}px` @@ -963,28 +966,28 @@ export type Spacing = | `s${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20}`; const spacing: Spacing = "s12" ->spacing : Symbol(spacing, Decl(templateLiteralTypes1.ts, 245, 5)) ->Spacing : Symbol(Spacing, Decl(templateLiteralTypes1.ts, 235, 41)) +>spacing : Symbol(spacing, Decl(templateLiteralTypes1.ts, 246, 5)) +>Spacing : Symbol(Spacing, Decl(templateLiteralTypes1.ts, 236, 41)) export type SpacingShorthand = ->SpacingShorthand : Symbol(SpacingShorthand, Decl(templateLiteralTypes1.ts, 245, 30)) +>SpacingShorthand : Symbol(SpacingShorthand, Decl(templateLiteralTypes1.ts, 246, 30)) | `${Spacing} ${Spacing}` ->Spacing : Symbol(Spacing, Decl(templateLiteralTypes1.ts, 235, 41)) ->Spacing : Symbol(Spacing, Decl(templateLiteralTypes1.ts, 235, 41)) +>Spacing : Symbol(Spacing, Decl(templateLiteralTypes1.ts, 236, 41)) +>Spacing : Symbol(Spacing, Decl(templateLiteralTypes1.ts, 236, 41)) | `${Spacing} ${Spacing} ${Spacing}` ->Spacing : Symbol(Spacing, Decl(templateLiteralTypes1.ts, 235, 41)) ->Spacing : Symbol(Spacing, Decl(templateLiteralTypes1.ts, 235, 41)) ->Spacing : Symbol(Spacing, Decl(templateLiteralTypes1.ts, 235, 41)) +>Spacing : Symbol(Spacing, Decl(templateLiteralTypes1.ts, 236, 41)) +>Spacing : Symbol(Spacing, Decl(templateLiteralTypes1.ts, 236, 41)) +>Spacing : Symbol(Spacing, Decl(templateLiteralTypes1.ts, 236, 41)) | `${Spacing} ${Spacing} ${Spacing} ${Spacing}`; ->Spacing : Symbol(Spacing, Decl(templateLiteralTypes1.ts, 235, 41)) ->Spacing : Symbol(Spacing, Decl(templateLiteralTypes1.ts, 235, 41)) ->Spacing : Symbol(Spacing, Decl(templateLiteralTypes1.ts, 235, 41)) ->Spacing : Symbol(Spacing, Decl(templateLiteralTypes1.ts, 235, 41)) +>Spacing : Symbol(Spacing, Decl(templateLiteralTypes1.ts, 236, 41)) +>Spacing : Symbol(Spacing, Decl(templateLiteralTypes1.ts, 236, 41)) +>Spacing : Symbol(Spacing, Decl(templateLiteralTypes1.ts, 236, 41)) +>Spacing : Symbol(Spacing, Decl(templateLiteralTypes1.ts, 236, 41)) const test1: SpacingShorthand = "0 0 0"; ->test1 : Symbol(test1, Decl(templateLiteralTypes1.ts, 252, 5)) ->SpacingShorthand : Symbol(SpacingShorthand, Decl(templateLiteralTypes1.ts, 245, 30)) +>test1 : Symbol(test1, Decl(templateLiteralTypes1.ts, 253, 5)) +>SpacingShorthand : Symbol(SpacingShorthand, Decl(templateLiteralTypes1.ts, 246, 30)) diff --git a/tests/baselines/reference/templateLiteralTypes1.types b/tests/baselines/reference/templateLiteralTypes1.types index fed8939ea76..42036b95f49 100644 --- a/tests/baselines/reference/templateLiteralTypes1.types +++ b/tests/baselines/reference/templateLiteralTypes1.types @@ -541,6 +541,7 @@ type BB = AA<-2, -2>; type PathKeys = >PathKeys : PathKeys + unknown extends T ? never : T extends readonly any[] ? Extract | SubKeys> : T extends object ? Extract | SubKeys> : never; diff --git a/tests/cases/conformance/types/literal/numericStringLiteralTypes.ts b/tests/cases/conformance/types/literal/numericStringLiteralTypes.ts new file mode 100644 index 00000000000..cb12bde1d45 --- /dev/null +++ b/tests/cases/conformance/types/literal/numericStringLiteralTypes.ts @@ -0,0 +1,40 @@ +// @strict: true +// @declaration: true + +type T0 = string & `${string}`; // string +type T1 = string & `${number}`; // `${number} +type T2 = string & `${bigint}`; // `${bigint} +type T3 = string & `${T}`; // `${T} +type T4 = string & `${Capitalize<`${T}`>}`; // `${Capitalize}` + +function f1(a: boolean[], x: `${number}`) { + let s = a[x]; // boolean +} + +function f2(a: boolean[], x: number | `${number}`) { + let s = a[x]; // boolean +} + +type T10 = boolean[][`${number}`]; // boolean +type T11 = boolean[][number | `${number}`]; // boolean + +type T20 = T; +type T21 = { [K in keyof T]: T20 }; + +type Container = { + value: T +} + +type UnwrapContainers[]> = { [K in keyof T]: T[K]['value'] }; + +declare function createContainer(value: T): Container; + +declare function f[]>(containers: [...T], callback: (...values: UnwrapContainers) => void): void; + +const container1 = createContainer('hi') +const container2 = createContainer(2) + +f([container1, container2], (value1, value2) => { + value1; // string + value2; // number +}); diff --git a/tests/cases/conformance/types/literal/templateLiteralTypes1.ts b/tests/cases/conformance/types/literal/templateLiteralTypes1.ts index daa3fbaeb78..0b11e9f5d61 100644 --- a/tests/cases/conformance/types/literal/templateLiteralTypes1.ts +++ b/tests/cases/conformance/types/literal/templateLiteralTypes1.ts @@ -219,6 +219,7 @@ type BB = AA<-2, -2>; // Repro from #40970 type PathKeys = + unknown extends T ? never : T extends readonly any[] ? Extract | SubKeys> : T extends object ? Extract | SubKeys> : never; From c5f493e8408d55f4fe0d53f4aa96379c69ca5b5c Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Tue, 26 Apr 2022 06:06:24 +0000 Subject: [PATCH 22/63] Update package-lock.json --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index ccdceca9009..48578c5677e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -638,9 +638,9 @@ "dev": true }, "@types/node": { - "version": "17.0.26", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.26.tgz", - "integrity": "sha512-z/FG/6DUO7pnze3AE3TBGIjGGKkvCcGcWINe1C7cADY8hKLJPDYpzsNE37uExQ4md5RFtTCvg+M8Mu1Enyeg2A==", + "version": "17.0.27", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.27.tgz", + "integrity": "sha512-4/Ke7bbWOasuT3kceBZFGakP1dYN2XFd8v2l9bqF2LNWrmeU07JLpp56aEeG6+Q3olqO5TvXpW0yaiYnZJ5CXg==", "dev": true }, "@types/node-fetch": { From 7b6b4dc25811321d893a1bcb35ec5e9881e4352e Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Tue, 26 Apr 2022 13:39:20 -0700 Subject: [PATCH 23/63] Fix `getExportSymbolOfValueSymbolIfExported` (#48769) --- src/compiler/checker.ts | 2 +- tests/baselines/reference/reExportJsFromTs.js | 21 +++++++++++++++++++ .../reference/reExportJsFromTs.symbols | 18 ++++++++++++++++ .../reference/reExportJsFromTs.types | 21 +++++++++++++++++++ .../conformance/salsa/reExportJsFromTs.ts | 11 ++++++++++ 5 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/reExportJsFromTs.js create mode 100644 tests/baselines/reference/reExportJsFromTs.symbols create mode 100644 tests/baselines/reference/reExportJsFromTs.types create mode 100644 tests/cases/conformance/salsa/reExportJsFromTs.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index dba3c8584b1..4fcb0d15a5f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4110,7 +4110,7 @@ namespace ts { function getExportSymbolOfValueSymbolIfExported(symbol: Symbol): Symbol; function getExportSymbolOfValueSymbolIfExported(symbol: Symbol | undefined): Symbol | undefined; function getExportSymbolOfValueSymbolIfExported(symbol: Symbol | undefined): Symbol | undefined { - return getMergedSymbol(symbol && (symbol.flags & SymbolFlags.ExportValue) !== 0 ? symbol.exportSymbol : symbol); + return getMergedSymbol(symbol && (symbol.flags & SymbolFlags.ExportValue) !== 0 && symbol.exportSymbol || symbol); } function symbolIsValue(symbol: Symbol): boolean { diff --git a/tests/baselines/reference/reExportJsFromTs.js b/tests/baselines/reference/reExportJsFromTs.js new file mode 100644 index 00000000000..6879d65e0b9 --- /dev/null +++ b/tests/baselines/reference/reExportJsFromTs.js @@ -0,0 +1,21 @@ +//// [tests/cases/conformance/salsa/reExportJsFromTs.ts] //// + +//// [constants.js] +module.exports = { + str: 'x', +}; + +//// [constants.ts] +import * as tsConstants from "../lib/constants"; +export { tsConstants }; + +//// [constants.js] +module.exports = { + str: 'x' +}; +//// [constants.js] +"use strict"; +exports.__esModule = true; +exports.tsConstants = void 0; +var tsConstants = require("../lib/constants"); +exports.tsConstants = tsConstants; diff --git a/tests/baselines/reference/reExportJsFromTs.symbols b/tests/baselines/reference/reExportJsFromTs.symbols new file mode 100644 index 00000000000..eddddb5aed5 --- /dev/null +++ b/tests/baselines/reference/reExportJsFromTs.symbols @@ -0,0 +1,18 @@ +=== /lib/constants.js === +module.exports = { +>module.exports : Symbol(module.exports, Decl(constants.js, 0, 0)) +>module : Symbol(export=, Decl(constants.js, 0, 0)) +>exports : Symbol(export=, Decl(constants.js, 0, 0)) + + str: 'x', +>str : Symbol(str, Decl(constants.js, 0, 18)) + +}; + +=== /src/constants.ts === +import * as tsConstants from "../lib/constants"; +>tsConstants : Symbol(tsConstants, Decl(constants.ts, 0, 6)) + +export { tsConstants }; +>tsConstants : Symbol(tsConstants, Decl(constants.ts, 1, 8)) + diff --git a/tests/baselines/reference/reExportJsFromTs.types b/tests/baselines/reference/reExportJsFromTs.types new file mode 100644 index 00000000000..130fc00f1ae --- /dev/null +++ b/tests/baselines/reference/reExportJsFromTs.types @@ -0,0 +1,21 @@ +=== /lib/constants.js === +module.exports = { +>module.exports = { str: 'x',} : { str: string; } +>module.exports : { str: string; } +>module : { exports: { str: string; }; } +>exports : { str: string; } +>{ str: 'x',} : { str: string; } + + str: 'x', +>str : string +>'x' : "x" + +}; + +=== /src/constants.ts === +import * as tsConstants from "../lib/constants"; +>tsConstants : { str: string; } + +export { tsConstants }; +>tsConstants : { str: string; } + diff --git a/tests/cases/conformance/salsa/reExportJsFromTs.ts b/tests/cases/conformance/salsa/reExportJsFromTs.ts new file mode 100644 index 00000000000..860692e393a --- /dev/null +++ b/tests/cases/conformance/salsa/reExportJsFromTs.ts @@ -0,0 +1,11 @@ +// @allowJs: true +// @outDir: out + +// @Filename: /lib/constants.js +module.exports = { + str: 'x', +}; + +// @Filename: /src/constants.ts +import * as tsConstants from "../lib/constants"; +export { tsConstants }; \ No newline at end of file From 3d3fa0c0c83050d26390ef5773c471e15c8f1b21 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Wed, 27 Apr 2022 06:09:04 +0000 Subject: [PATCH 24/63] Update package-lock.json --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 48578c5677e..7eaf992be67 100644 --- a/package-lock.json +++ b/package-lock.json @@ -638,9 +638,9 @@ "dev": true }, "@types/node": { - "version": "17.0.27", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.27.tgz", - "integrity": "sha512-4/Ke7bbWOasuT3kceBZFGakP1dYN2XFd8v2l9bqF2LNWrmeU07JLpp56aEeG6+Q3olqO5TvXpW0yaiYnZJ5CXg==", + "version": "17.0.29", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.29.tgz", + "integrity": "sha512-tx5jMmMFwx7wBwq/V7OohKDVb/JwJU5qCVkeLMh1//xycAJ/ESuw9aJ9SEtlCZDYi2pBfe4JkisSoAtbOsBNAA==", "dev": true }, "@types/node-fetch": { From bab02d24be4d1821e29c65100e282db26ee3e2c8 Mon Sep 17 00:00:00 2001 From: Darius D Date: Wed, 27 Apr 2022 10:50:22 -0500 Subject: [PATCH 25/63] Add Node v18 to CI (#48824) * Add Node v18 to CI * Address comments --- .github/workflows/accept-baselines-fix-lints.yaml | 2 +- .github/workflows/ci.yml | 6 +++--- .github/workflows/new-release-branch.yaml | 2 +- .github/workflows/nightly.yaml | 2 +- .github/workflows/release-branch-artifact.yaml | 2 +- .github/workflows/rich-navigation.yml | 2 +- .github/workflows/set-version.yaml | 2 +- .github/workflows/sync-branch.yaml | 2 +- .github/workflows/twoslash-repros.yaml | 4 ++-- .github/workflows/update-lkg.yml | 2 +- .github/workflows/update-package-lock.yaml | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/accept-baselines-fix-lints.yaml b/.github/workflows/accept-baselines-fix-lints.yaml index 640ed67e8c7..2662646cc05 100644 --- a/.github/workflows/accept-baselines-fix-lints.yaml +++ b/.github/workflows/accept-baselines-fix-lints.yaml @@ -10,7 +10,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Use node version 14 - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: 14 registry-url: https://registry.npmjs.org/ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 370575013cb..b95b0481ed2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,14 +16,14 @@ jobs: strategy: matrix: - node-version: [14.x, 16.x, 17.x] + node-version: [14.x, 16.x, 18.x] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 5 - name: Use node version ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - name: Remove existing TypeScript diff --git a/.github/workflows/new-release-branch.yaml b/.github/workflows/new-release-branch.yaml index 65c36525f38..90b8bbdf5ef 100644 --- a/.github/workflows/new-release-branch.yaml +++ b/.github/workflows/new-release-branch.yaml @@ -10,7 +10,7 @@ jobs: steps: - name: Use node version 14.x - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: 14.x - uses: actions/checkout@v2 diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index d425bea605f..d255a324f79 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Use node version 14 - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: 14 registry-url: https://registry.npmjs.org/ diff --git a/.github/workflows/release-branch-artifact.yaml b/.github/workflows/release-branch-artifact.yaml index 388f6415af6..17bb3be4680 100644 --- a/.github/workflows/release-branch-artifact.yaml +++ b/.github/workflows/release-branch-artifact.yaml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Use node version 14 - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: 14 - name: Remove existing TypeScript diff --git a/.github/workflows/rich-navigation.yml b/.github/workflows/rich-navigation.yml index 4097f2893c3..82ba9bf54f1 100644 --- a/.github/workflows/rich-navigation.yml +++ b/.github/workflows/rich-navigation.yml @@ -19,7 +19,7 @@ jobs: with: fetch-depth: 5 - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: node-version: 14 diff --git a/.github/workflows/set-version.yaml b/.github/workflows/set-version.yaml index a3077e39e2d..5b1338daff2 100644 --- a/.github/workflows/set-version.yaml +++ b/.github/workflows/set-version.yaml @@ -10,7 +10,7 @@ jobs: steps: - name: Use node version 14.x - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: 14.x - uses: actions/checkout@v2 diff --git a/.github/workflows/sync-branch.yaml b/.github/workflows/sync-branch.yaml index a26718e6063..fae67017c61 100644 --- a/.github/workflows/sync-branch.yaml +++ b/.github/workflows/sync-branch.yaml @@ -15,7 +15,7 @@ jobs: steps: - name: Use node version 14.x - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: 14.x - uses: actions/checkout@v2 diff --git a/.github/workflows/twoslash-repros.yaml b/.github/workflows/twoslash-repros.yaml index 9563d72136c..36a97b49ac5 100644 --- a/.github/workflows/twoslash-repros.yaml +++ b/.github/workflows/twoslash-repros.yaml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Use node - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 - uses: microsoft/TypeScript-Twoslash-Repro-Action@master with: github-token: ${{ secrets.TS_BOT_GITHUB_TOKEN }} @@ -36,7 +36,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v3 with: node-version: 16 - uses: microsoft/TypeScript-Twoslash-Repro-Action@master diff --git a/.github/workflows/update-lkg.yml b/.github/workflows/update-lkg.yml index 4faf242f8bf..cac9c6c4c06 100644 --- a/.github/workflows/update-lkg.yml +++ b/.github/workflows/update-lkg.yml @@ -10,7 +10,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Use node version 14 - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: 14 registry-url: https://registry.npmjs.org/ diff --git a/.github/workflows/update-package-lock.yaml b/.github/workflows/update-package-lock.yaml index 5c66d1078eb..1c54603f9ba 100644 --- a/.github/workflows/update-package-lock.yaml +++ b/.github/workflows/update-package-lock.yaml @@ -14,7 +14,7 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v3 with: node-version: 14 registry-url: https://registry.npmjs.org/ From 2a78b225d00170044becdbfe499909e7d6cad68b Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 27 Apr 2022 11:21:10 -0700 Subject: [PATCH 26/63] Stop tag after @callback from crashing (#48860) By copying the kludge in @typedef. @callback's order is simpler, so the kludge is simpler. However, it's wrong here, and in @typedef. Parsing tag comments is normally supposed to happen at the end of a tag, but in @callback and @typedef happens *before* parsing the nested @param/@property tags. I still need to figure out what a real fix is -- but for the beta, copying the existing crash-avoidance kludge from @typedef is best anyway. I added a test case for typedefs for future use as well. --- src/compiler/parser.ts | 3 ++- tests/cases/fourslash/jsTagAfterCallback1.ts | 19 +++++++++++++++++++ tests/cases/fourslash/jsTagAfterCallback2.ts | 19 +++++++++++++++++++ tests/cases/fourslash/jsTagAfterTypedef1.ts | 19 +++++++++++++++++++ 4 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 tests/cases/fourslash/jsTagAfterCallback1.ts create mode 100644 tests/cases/fourslash/jsTagAfterCallback2.ts create mode 100644 tests/cases/fourslash/jsTagAfterTypedef1.ts diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index e57a3fa98f3..884a5b36e38 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -8579,7 +8579,8 @@ namespace ts { if (!comment) { comment = parseTrailingTagComments(start, getNodePos(), indent, indentText); } - return finishNode(factory.createJSDocCallbackTag(tagName, typeExpression, fullName, comment), start); + const end = comment !== undefined ? getNodePos() : typeExpression.end; + return finishNode(factory.createJSDocCallbackTag(tagName, typeExpression, fullName, comment), start, end); } function escapedTextsEqual(a: EntityName, b: EntityName): boolean { diff --git a/tests/cases/fourslash/jsTagAfterCallback1.ts b/tests/cases/fourslash/jsTagAfterCallback1.ts new file mode 100644 index 00000000000..cc270afcf39 --- /dev/null +++ b/tests/cases/fourslash/jsTagAfterCallback1.ts @@ -0,0 +1,19 @@ +/// +// @Filename: foo.js +// @allowJs: true +// @checkJs: true +//// /** @callback Listener @yeturn {ListenerBlock} */ +//// /** +//// * The function used +//// * /*1*/ settings +//// */ +//// class /*2*/ListenerBlock { +//// } + +// Force a syntax tree to be created. +verify.noMatchingBracePositionInCurrentFile(0); + +goTo.marker('1'); +edit.insert('fenster'); + +verify.quickInfoAt('2', 'class ListenerBlock', 'The function used\nfenster settings') diff --git a/tests/cases/fourslash/jsTagAfterCallback2.ts b/tests/cases/fourslash/jsTagAfterCallback2.ts new file mode 100644 index 00000000000..3cfa493f32a --- /dev/null +++ b/tests/cases/fourslash/jsTagAfterCallback2.ts @@ -0,0 +1,19 @@ +/// +// @Filename: foo.js +// @allowJs: true +// @checkJs: true +//// /** @callback Listener @param x @yeturn {ListenerBlock} */ +//// /** +//// * The function used +//// * /*1*/ settings +//// */ +//// class /*2*/ListenerBlock { +//// } + +// Force a syntax tree to be created. +verify.noMatchingBracePositionInCurrentFile(0); + +goTo.marker('1'); +edit.insert('fenster'); + +verify.quickInfoAt('2', 'class ListenerBlock', 'The function used\nfenster settings') diff --git a/tests/cases/fourslash/jsTagAfterTypedef1.ts b/tests/cases/fourslash/jsTagAfterTypedef1.ts new file mode 100644 index 00000000000..d0cf99e6f18 --- /dev/null +++ b/tests/cases/fourslash/jsTagAfterTypedef1.ts @@ -0,0 +1,19 @@ +/// +// @Filename: foo.js +// @allowJs: true +// @checkJs: true +//// /** @typedef Lister @property p @yeturn {ListenerBlock} */ +//// /** +//// * The function used +//// * /*1*/ settings +//// */ +//// class /*2*/ListenerBlock { +//// } + +// Force a syntax tree to be created. +verify.noMatchingBracePositionInCurrentFile(0); + +goTo.marker('1'); +edit.insert('fenster'); + +verify.quickInfoAt('2', 'class ListenerBlock', 'The function used\nfenster settings') From d45012c5e2ab122919ee4777a7887307c5f4a1e0 Mon Sep 17 00:00:00 2001 From: Nicola Dardanis Date: Wed, 27 Apr 2022 20:55:35 +0200 Subject: [PATCH 27/63] Add JS-specific diagnostic message for `resolve()` in Promise where type argument can't be inferred (#48533) * change error message on Promise * fix(46570): Unhelpful Promise type argument hint in JS file * refactor: Reword void Promise message for JSDoc type hint to provide better feedback Co-authored-by: Osa --- src/compiler/checker.ts | 12 +++++++++--- src/compiler/diagnosticMessages.json | 4 ++++ src/services/codefixes/fixAddVoidToPromise.ts | 1 + tests/cases/fourslash/codeFixAddVoidToPromiseJS.1.ts | 2 +- tests/cases/fourslash/codeFixAddVoidToPromiseJS.2.ts | 2 +- tests/cases/fourslash/codeFixAddVoidToPromiseJS.3.ts | 2 +- tests/cases/fourslash/codeFixAddVoidToPromiseJS.4.ts | 2 +- 7 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 4fcb0d15a5f..1506c4809ef 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -30413,9 +30413,15 @@ namespace ts { const parameterRange = hasRestParameter ? min : min < max ? min + "-" + max : min; - const error = hasRestParameter ? Diagnostics.Expected_at_least_0_arguments_but_got_1 - : parameterRange === 1 && args.length === 0 && isPromiseResolveArityError(node) ? Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise - : Diagnostics.Expected_0_arguments_but_got_1; + const isVoidPromiseError = !hasRestParameter && parameterRange === 1 && args.length === 0 && isPromiseResolveArityError(node); + if (isVoidPromiseError && isInJSFile(node)) { + return getDiagnosticForCallNode(node, Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments); + } + const error = hasRestParameter + ? Diagnostics.Expected_at_least_0_arguments_but_got_1 + : isVoidPromiseError + ? Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise + : Diagnostics.Expected_0_arguments_but_got_1; if (min < args.length && args.length < max) { // between min and max, but with no matching overload return getDiagnosticForCallNode(node, Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, args.length, maxBelow, minAbove); diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index e8a765e514c..44fed63932d 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3369,6 +3369,10 @@ "category": "Error", "code": 2809 }, + "Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments.": { + "category": "Error", + "code": 2810 + }, "Initializer for property '{0}'": { "category": "Error", "code": 2811 diff --git a/src/services/codefixes/fixAddVoidToPromise.ts b/src/services/codefixes/fixAddVoidToPromise.ts index 5e6add96dac..b088f69594a 100644 --- a/src/services/codefixes/fixAddVoidToPromise.ts +++ b/src/services/codefixes/fixAddVoidToPromise.ts @@ -3,6 +3,7 @@ namespace ts.codefix { const fixName = "addVoidToPromise"; const fixId = "addVoidToPromise"; const errorCodes = [ + Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments.code, Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code ]; registerCodeFix({ diff --git a/tests/cases/fourslash/codeFixAddVoidToPromiseJS.1.ts b/tests/cases/fourslash/codeFixAddVoidToPromiseJS.1.ts index 417506a510c..42b4e07f4a6 100644 --- a/tests/cases/fourslash/codeFixAddVoidToPromiseJS.1.ts +++ b/tests/cases/fourslash/codeFixAddVoidToPromiseJS.1.ts @@ -9,7 +9,7 @@ ////const p1 = new Promise(resolve => resolve()); verify.codeFix({ - errorCode: 2794, + errorCode: 2810, description: "Add 'void' to Promise resolved without a value", index: 2, newFileContent: `const p1 = /** @type {Promise} */(new Promise(resolve => resolve()));` diff --git a/tests/cases/fourslash/codeFixAddVoidToPromiseJS.2.ts b/tests/cases/fourslash/codeFixAddVoidToPromiseJS.2.ts index f3bdbb635fe..d6d8a6ed9c3 100644 --- a/tests/cases/fourslash/codeFixAddVoidToPromiseJS.2.ts +++ b/tests/cases/fourslash/codeFixAddVoidToPromiseJS.2.ts @@ -9,7 +9,7 @@ ////const p2 = /** @type {Promise} */(new Promise(resolve => resolve())); verify.codeFix({ - errorCode: 2794, + errorCode: 2810, description: "Add 'void' to Promise resolved without a value", index: 2, newFileContent: `const p2 = /** @type {Promise} */(new Promise(resolve => resolve()));` diff --git a/tests/cases/fourslash/codeFixAddVoidToPromiseJS.3.ts b/tests/cases/fourslash/codeFixAddVoidToPromiseJS.3.ts index 92adfb610db..59aa8f45e9b 100644 --- a/tests/cases/fourslash/codeFixAddVoidToPromiseJS.3.ts +++ b/tests/cases/fourslash/codeFixAddVoidToPromiseJS.3.ts @@ -9,7 +9,7 @@ ////const p3 = /** @type {Promise} */(new Promise(resolve => resolve())); verify.codeFix({ - errorCode: 2794, + errorCode: 2810, description: "Add 'void' to Promise resolved without a value", index: 2, newFileContent: `const p3 = /** @type {Promise} */(new Promise(resolve => resolve()));` diff --git a/tests/cases/fourslash/codeFixAddVoidToPromiseJS.4.ts b/tests/cases/fourslash/codeFixAddVoidToPromiseJS.4.ts index 171e1135d1a..7985d9febc8 100644 --- a/tests/cases/fourslash/codeFixAddVoidToPromiseJS.4.ts +++ b/tests/cases/fourslash/codeFixAddVoidToPromiseJS.4.ts @@ -9,7 +9,7 @@ ////const p4 = /** @type {Promise<{ x: number } & { y: string }>} */(new Promise(resolve => resolve())); verify.codeFix({ - errorCode: 2794, + errorCode: 2810, description: "Add 'void' to Promise resolved without a value", index: 2, newFileContent: `const p4 = /** @type {Promise<({ x: number } & { y: string }) | void>} */(new Promise(resolve => resolve()));` From 717a1be3c9de75182f47d3508fd2193a22aae67d Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Thu, 28 Apr 2022 00:00:01 +0300 Subject: [PATCH 28/63] feat(48743): allow autocompletion in parameter object destructuring in JavaScript (#48757) --- src/services/completions.ts | 2 +- .../completionListInObjectBindingPattern16.ts | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 tests/cases/fourslash/completionListInObjectBindingPattern16.ts diff --git a/src/services/completions.ts b/src/services/completions.ts index 50bfad2d5e4..b7bb35e4a6b 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -3062,7 +3062,7 @@ namespace ts.Completions { // through type declaration or inference. // Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed - // type of parameter will flow in from the contextual type of the function - let canGetType = hasInitializer(rootDeclaration) || hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === SyntaxKind.ForOfStatement; + let canGetType = hasInitializer(rootDeclaration) || !!getEffectiveTypeAnnotationNode(rootDeclaration) || rootDeclaration.parent.parent.kind === SyntaxKind.ForOfStatement; if (!canGetType && rootDeclaration.kind === SyntaxKind.Parameter) { if (isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent as Expression); diff --git a/tests/cases/fourslash/completionListInObjectBindingPattern16.ts b/tests/cases/fourslash/completionListInObjectBindingPattern16.ts new file mode 100644 index 00000000000..87e534182d7 --- /dev/null +++ b/tests/cases/fourslash/completionListInObjectBindingPattern16.ts @@ -0,0 +1,18 @@ +/// + +// @allowJs: true +// @checkJs: true + +// @filename: a.js +/////** +//// * @typedef Foo +//// * @property {number} a +//// * @property {string} b +//// */ +//// +/////** +//// * @param {Foo} options +//// */ +////function f({ /**/ }) {} + +verify.completions({ marker: "", exact: ["a", "b"] }); From 476fc625df7666ae2c31cd91e109810186cd8b8e Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Wed, 27 Apr 2022 16:07:15 -0700 Subject: [PATCH 29/63] Eagerly resolve module specifiers for auto-import completions in `--moduleResolution node12+` (#48752) * Add failing test * Block auto-import module specifiers including node_modules path * Eagerly resolve module specifiers in completions in nodenext so failures can be filtered * Add completion info flags for telemetry * Update API baseline * Update completions baselines * Fix missed boolean flip * Fix remaining tests --- src/compiler/types.ts | 4 +- src/server/moduleSpecifierCache.ts | 14 +-- src/server/protocol.ts | 1 + src/services/codefixes/importFixes.ts | 25 ++--- src/services/completions.ts | 91 ++++++++++++++----- src/services/exportInfoMap.ts | 6 +- src/services/types.ts | 13 +++ src/services/utilities.ts | 8 ++ .../unittests/tsserver/completions.ts | 1 + .../unittests/tsserver/metadataInResponse.ts | 1 + .../tsserver/moduleSpecifierCache.ts | 6 +- .../reference/api/tsserverlibrary.d.ts | 12 +++ tests/baselines/reference/api/typescript.d.ts | 11 +++ .../completionEntryForUnionMethod.baseline | 1 + .../completionImportCallAssertion.baseline | 2 + .../completionsCommentsClass.baseline | 1 + .../completionsCommentsClassMembers.baseline | 39 ++++++++ ...completionsCommentsCommentParsing.baseline | 7 ++ ...etionsCommentsFunctionDeclaration.baseline | 3 + ...letionsCommentsFunctionExpression.baseline | 4 + .../reference/completionsJSDocTags.baseline | 1 + ...hodsOnAssignedFunctionExpressions.baseline | 1 + .../completionsStringMethods.baseline | 1 + tests/cases/fourslash/autoImportsNodeNext1.ts | 35 +++++++ .../server/autoImportProvider_exportMap3.ts | 10 -- .../server/autoImportProvider_exportMap8.ts | 14 --- 26 files changed, 239 insertions(+), 73 deletions(-) create mode 100644 tests/cases/fourslash/autoImportsNodeNext1.ts diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 1a221cc3932..c03a01f424b 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -8470,7 +8470,7 @@ namespace ts { export interface ResolvedModuleSpecifierInfo { modulePaths: readonly ModulePath[] | undefined; moduleSpecifiers: readonly string[] | undefined; - isAutoImportable: boolean | undefined; + isBlockedByPackageJsonDependencies: boolean | undefined; } /* @internal */ @@ -8482,7 +8482,7 @@ namespace ts { export interface ModuleSpecifierCache { get(fromFileName: Path, toFileName: Path, preferences: UserPreferences, options: ModuleSpecifierOptions): Readonly | undefined; set(fromFileName: Path, toFileName: Path, preferences: UserPreferences, options: ModuleSpecifierOptions, modulePaths: readonly ModulePath[], moduleSpecifiers: readonly string[]): void; - setIsAutoImportable(fromFileName: Path, toFileName: Path, preferences: UserPreferences, options: ModuleSpecifierOptions, isAutoImportable: boolean): void; + setBlockedByPackageJsonDependencies(fromFileName: Path, toFileName: Path, preferences: UserPreferences, options: ModuleSpecifierOptions, isBlockedByPackageJsonDependencies: boolean): void; setModulePaths(fromFileName: Path, toFileName: Path, preferences: UserPreferences, options: ModuleSpecifierOptions, modulePaths: readonly ModulePath[]): void; clear(): void; count(): number; diff --git a/src/server/moduleSpecifierCache.ts b/src/server/moduleSpecifierCache.ts index e5114fb6446..c4a26b3f80c 100644 --- a/src/server/moduleSpecifierCache.ts +++ b/src/server/moduleSpecifierCache.ts @@ -14,7 +14,7 @@ namespace ts.server { return cache.get(toFileName); }, set(fromFileName, toFileName, preferences, options, modulePaths, moduleSpecifiers) { - ensureCache(fromFileName, preferences, options).set(toFileName, createInfo(modulePaths, moduleSpecifiers, /*isAutoImportable*/ true)); + ensureCache(fromFileName, preferences, options).set(toFileName, createInfo(modulePaths, moduleSpecifiers, /*isBlockedByPackageJsonDependencies*/ false)); // If any module specifiers were generated based off paths in node_modules, // a package.json file in that package was read and is an input to the cached. @@ -43,17 +43,17 @@ namespace ts.server { info.modulePaths = modulePaths; } else { - cache.set(toFileName, createInfo(modulePaths, /*moduleSpecifiers*/ undefined, /*isAutoImportable*/ undefined)); + cache.set(toFileName, createInfo(modulePaths, /*moduleSpecifiers*/ undefined, /*isBlockedByPackageJsonDependencies*/ undefined)); } }, - setIsAutoImportable(fromFileName, toFileName, preferences, options, isAutoImportable) { + setBlockedByPackageJsonDependencies(fromFileName, toFileName, preferences, options, isBlockedByPackageJsonDependencies) { const cache = ensureCache(fromFileName, preferences, options); const info = cache.get(toFileName); if (info) { - info.isAutoImportable = isAutoImportable; + info.isBlockedByPackageJsonDependencies = isBlockedByPackageJsonDependencies; } else { - cache.set(toFileName, createInfo(/*modulePaths*/ undefined, /*moduleSpecifiers*/ undefined, isAutoImportable)); + cache.set(toFileName, createInfo(/*modulePaths*/ undefined, /*moduleSpecifiers*/ undefined, isBlockedByPackageJsonDependencies)); } }, clear() { @@ -87,9 +87,9 @@ namespace ts.server { function createInfo( modulePaths: readonly ModulePath[] | undefined, moduleSpecifiers: readonly string[] | undefined, - isAutoImportable: boolean | undefined, + isBlockedByPackageJsonDependencies: boolean | undefined, ): ResolvedModuleSpecifierInfo { - return { modulePaths, moduleSpecifiers, isAutoImportable }; + return { modulePaths, moduleSpecifiers, isBlockedByPackageJsonDependencies }; } } } diff --git a/src/server/protocol.ts b/src/server/protocol.ts index fc53ad151ed..121b69895f9 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -2403,6 +2403,7 @@ namespace ts.server.protocol { } export interface CompletionInfo { + readonly flags?: number; readonly isGlobalCompletion: boolean; readonly isMemberCompletion: boolean; readonly isNewIdentifierLocation: boolean; diff --git a/src/services/codefixes/importFixes.ts b/src/services/codefixes/importFixes.ts index e277a7d4e89..94b289cd317 100644 --- a/src/services/codefixes/importFixes.ts +++ b/src/services/codefixes/importFixes.ts @@ -644,6 +644,7 @@ namespace ts.codefix { const compilerOptions = program.getCompilerOptions(); const moduleSpecifierResolutionHost = createModuleSpecifierResolutionHost(program, host); const getChecker = memoizeOne((isFromPackageJson: boolean) => isFromPackageJson ? host.getPackageJsonAutoImportProvider!()!.getTypeChecker() : program.getTypeChecker()); + const rejectNodeModulesRelativePaths = moduleResolutionUsesNodeModules(getEmitModuleResolutionKind(compilerOptions)); const getModuleSpecifiers = fromCacheOnly ? (moduleSymbol: Symbol) => ({ moduleSpecifiers: moduleSpecifiers.tryGetModuleSpecifiersFromCache(moduleSymbol, sourceFile, moduleSpecifierResolutionHost, preferences), computedWithoutCache: false }) : (moduleSymbol: Symbol, checker: TypeChecker) => moduleSpecifiers.getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, sourceFile, moduleSpecifierResolutionHost, preferences); @@ -655,19 +656,19 @@ namespace ts.codefix { const importedSymbolHasValueMeaning = !!(exportInfo.targetFlags & SymbolFlags.Value); const addAsTypeOnly = getAddAsTypeOnly(isValidTypeOnlyUseSite, /*isForNewImportDeclaration*/ true, exportInfo.symbol, exportInfo.targetFlags, checker, compilerOptions); computedWithoutCacheCount += computedWithoutCache ? 1 : 0; - return moduleSpecifiers?.map((moduleSpecifier): FixAddNewImport | FixAddJsdocTypeImport => + return mapDefined(moduleSpecifiers, (moduleSpecifier): FixAddNewImport | FixAddJsdocTypeImport | undefined => + rejectNodeModulesRelativePaths && pathContainsNodeModules(moduleSpecifier) ? undefined : // `position` should only be undefined at a missing jsx namespace, in which case we shouldn't be looking for pure types. - !importedSymbolHasValueMeaning && isJs && position !== undefined - ? { kind: ImportFixKind.JsdocTypeImport, moduleSpecifier, position, exportInfo, isReExport: i > 0 } - : { - kind: ImportFixKind.AddNew, - moduleSpecifier, - importKind: getImportKind(sourceFile, exportInfo.exportKind, compilerOptions), - useRequire, - addAsTypeOnly, - exportInfo, - isReExport: i > 0, - } + !importedSymbolHasValueMeaning && isJs && position !== undefined ? { kind: ImportFixKind.JsdocTypeImport, moduleSpecifier, position, exportInfo, isReExport: i > 0 } : + { + kind: ImportFixKind.AddNew, + moduleSpecifier, + importKind: getImportKind(sourceFile, exportInfo.exportKind, compilerOptions), + useRequire, + addAsTypeOnly, + exportInfo, + isReExport: i > 0, + } ); }); diff --git a/src/services/completions.ts b/src/services/completions.ts index b7bb35e4a6b..a81ccfa788d 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -170,14 +170,16 @@ namespace ts.Completions { const enum GlobalsSearch { Continue, Success, Fail } interface ModuleSpecifierResolutioContext { - tryResolve: (exportInfo: readonly SymbolExportInfo[], symbolName: string, isFromAmbientModule: boolean) => ModuleSpecifierResolutionResult | undefined; - resolutionLimitExceeded: () => boolean; + tryResolve: (exportInfo: readonly SymbolExportInfo[], symbolName: string, isFromAmbientModule: boolean) => ModuleSpecifierResolutionResult; + resolvedAny: () => boolean; + skippedAny: () => boolean; + resolvedBeyondLimit: () => boolean; } - interface ModuleSpecifierResolutionResult { + type ModuleSpecifierResolutionResult = "skipped" | "failed" | { exportInfo?: SymbolExportInfo; moduleSpecifier: string; - } + }; function resolvingModuleSpecifiers( logPrefix: string, @@ -192,45 +194,56 @@ namespace ts.Completions { ): TReturn { const start = timestamp(); const packageJsonImportFilter = createPackageJsonImportFilter(sourceFile, preferences, host); - let resolutionLimitExceeded = false; + // Under `--moduleResolution nodenext`, we have to resolve module specifiers up front, because + // package.json exports can mean we *can't* resolve a module specifier (that doesn't include a + // relative path into node_modules), and we want to filter those completions out entirely. + // Import statement completions always need specifier resolution because the module specifier is + // part of their `insertText`, not the `codeActions` creating edits away from the cursor. + const needsFullResolution = isForImportStatementCompletion || moduleResolutionRespectsExports(getEmitModuleResolutionKind(program.getCompilerOptions())); + let skippedAny = false; let ambientCount = 0; let resolvedCount = 0; let resolvedFromCacheCount = 0; let cacheAttemptCount = 0; - const result = cb({ tryResolve, resolutionLimitExceeded: () => resolutionLimitExceeded }); + const result = cb({ + tryResolve, + skippedAny: () => skippedAny, + resolvedAny: () => resolvedCount > 0, + resolvedBeyondLimit: () => resolvedCount > moduleSpecifierResolutionLimit, + }); const hitRateMessage = cacheAttemptCount ? ` (${(resolvedFromCacheCount / cacheAttemptCount * 100).toFixed(1)}% hit rate)` : ""; host.log?.(`${logPrefix}: resolved ${resolvedCount} module specifiers, plus ${ambientCount} ambient and ${resolvedFromCacheCount} from cache${hitRateMessage}`); - host.log?.(`${logPrefix}: response is ${resolutionLimitExceeded ? "incomplete" : "complete"}`); + host.log?.(`${logPrefix}: response is ${skippedAny ? "incomplete" : "complete"}`); host.log?.(`${logPrefix}: ${timestamp() - start}`); return result; - function tryResolve(exportInfo: readonly SymbolExportInfo[], symbolName: string, isFromAmbientModule: boolean): ModuleSpecifierResolutionResult | undefined { + function tryResolve(exportInfo: readonly SymbolExportInfo[], symbolName: string, isFromAmbientModule: boolean): ModuleSpecifierResolutionResult { if (isFromAmbientModule) { const result = codefix.getModuleSpecifierForBestExportInfo(exportInfo, symbolName, position, isValidTypeOnlyUseSite, sourceFile, program, host, preferences); if (result) { ambientCount++; } - return result; + return result || "failed"; } - const shouldResolveModuleSpecifier = isForImportStatementCompletion || preferences.allowIncompleteCompletions && resolvedCount < moduleSpecifierResolutionLimit; + const shouldResolveModuleSpecifier = needsFullResolution || preferences.allowIncompleteCompletions && resolvedCount < moduleSpecifierResolutionLimit; const shouldGetModuleSpecifierFromCache = !shouldResolveModuleSpecifier && preferences.allowIncompleteCompletions && cacheAttemptCount < moduleSpecifierResolutionCacheAttemptLimit; const result = (shouldResolveModuleSpecifier || shouldGetModuleSpecifierFromCache) ? codefix.getModuleSpecifierForBestExportInfo(exportInfo, symbolName, position, isValidTypeOnlyUseSite, sourceFile, program, host, preferences, packageJsonImportFilter, shouldGetModuleSpecifierFromCache) : undefined; if (!shouldResolveModuleSpecifier && !shouldGetModuleSpecifierFromCache || shouldGetModuleSpecifierFromCache && !result) { - resolutionLimitExceeded = true; + skippedAny = true; } resolvedCount += result?.computedWithoutCacheCount || 0; - resolvedFromCacheCount += exportInfo.length - resolvedCount; + resolvedFromCacheCount += exportInfo.length - (result?.computedWithoutCacheCount || 0); if (shouldGetModuleSpecifierFromCache) { cacheAttemptCount++; } - return result; + return result || (needsFullResolution ? "failed" : "skipped"); } } @@ -379,7 +392,11 @@ namespace ts.Completions { const info = exportMap.get(file.path, entry.data.exportMapKey); const result = info && context.tryResolve(info, entry.name, !isExternalModuleNameRelative(stripQuotes(origin.moduleSymbol.name))); - if (!result) return entry; + if (result === "skipped") return entry; + if (!result || result === "failed") { + host.log?.(`Unexpected failure resolving auto import for '${entry.name}' from '${entry.source}'`); + return undefined; + } const newOrigin: SymbolOriginInfoResolvedExport = { ...origin, @@ -394,7 +411,7 @@ namespace ts.Completions { return entry; }); - if (!context.resolutionLimitExceeded()) { + if (!context.skippedAny()) { previousResponse.isIncomplete = undefined; } @@ -403,6 +420,7 @@ namespace ts.Completions { ); previousResponse.entries = newEntries; + previousResponse.flags = (previousResponse.flags || 0) | CompletionInfoFlags.IsContinuation; return previousResponse; } @@ -574,12 +592,13 @@ namespace ts.Completions { } return { + flags: completionData.flags, isGlobalCompletion: isInSnippetScope, isIncomplete: preferences.allowIncompleteCompletions && hasUnresolvedAutoImports ? true : undefined, isMemberCompletion: isMemberCompletionKind(completionKind), isNewIdentifierLocation, optionalReplacementSpan: getOptionalReplacementSpan(location), - entries + entries, }; } @@ -1841,6 +1860,7 @@ namespace ts.Completions { readonly isRightOfOpenTag: boolean; readonly importCompletionNode?: Node; readonly hasUnresolvedAutoImports?: boolean; + readonly flags: CompletionInfoFlags; } type Request = | { readonly kind: CompletionDataKind.JsDocTagName | CompletionDataKind.JsDocTag } @@ -2025,6 +2045,7 @@ namespace ts.Completions { let location = getTouchingPropertyName(sourceFile, position); let keywordFilters = KeywordCompletionFilters.None; let isNewIdentifierLocation = false; + let flags = CompletionInfoFlags.None; if (contextToken) { const importStatementCompletion = getImportStatementCompletionInfo(contextToken); @@ -2045,6 +2066,7 @@ namespace ts.Completions { // is not backward compatible with older clients, the language service defaults to disabling it, allowing newer clients // to opt in with the `includeCompletionsForImportStatements` user preference. importCompletionNode = importStatementCompletion.replacementNode; + flags |= CompletionInfoFlags.IsImportStatementCompletion; } // Bail out if this is a known invalid completion location if (!importCompletionNode && isCompletionListBlocker(contextToken)) { @@ -2252,6 +2274,7 @@ namespace ts.Completions { isRightOfOpenTag, importCompletionNode, hasUnresolvedAutoImports, + flags, }; type JSDocTagWithTypeExpression = JSDocParameterTag | JSDocPropertyTag | JSDocReturnTag | JSDocTypeTag | JSDocTypedefTag | JSDocTemplateTag; @@ -2692,6 +2715,7 @@ namespace ts.Completions { return; } + flags |= CompletionInfoFlags.MayIncludeAutoImports; // import { type | -> token text should be blank const isAfterTypeOnlyImportSpecifierModifier = previousToken === contextToken && importCompletionNode @@ -2736,14 +2760,34 @@ namespace ts.Completions { return; } - const defaultExportInfo = find(info, isImportableExportInfo); - if (!defaultExportInfo) { + // Do a relatively cheap check to bail early if all re-exports are non-importable + // due to file location or package.json dependency filtering. For non-node12+ + // module resolution modes, getting past this point guarantees that we'll be + // able to generate a suitable module specifier, so we can safely show a completion, + // even if we defer computing the module specifier. + const firstImportableExportInfo = find(info, isImportableExportInfo); + if (!firstImportableExportInfo) { return; } - // If we don't need to resolve module specifiers, we can use any re-export that is importable at all - // (We need to ensure that at least one is importable to show a completion.) - const { exportInfo = defaultExportInfo, moduleSpecifier } = context.tryResolve(info, symbolName, isFromAmbientModule) || {}; + // In node12+, module specifier resolution can fail due to modules being blocked + // by package.json `exports`. If that happens, don't show a completion item. + // N.B. in this resolution mode we always try to resolve module specifiers here, + // because we have to know now if it's going to fail so we can omit the completion + // from the list. + const result = context.tryResolve(info, symbolName, isFromAmbientModule) || {}; + if (result === "failed") return; + + // If we skipped resolving module specifiers, our selection of which ExportInfo + // to use here is arbitrary, since the info shown in the completion list derived from + // it should be identical regardless of which one is used. During the subsequent + // `CompletionEntryDetails` request, we'll get all the ExportInfos again and pick + // the best one based on the module specifier it produces. + let exportInfo = firstImportableExportInfo, moduleSpecifier; + if (result !== "skipped") { + ({ exportInfo = firstImportableExportInfo, moduleSpecifier } = result); + } + const isDefaultExport = exportInfo.exportKind === ExportKind.Default; const symbol = isDefaultExport && getLocalSymbolForExportDefault(exportInfo.symbol) || exportInfo.symbol; @@ -2761,7 +2805,9 @@ namespace ts.Completions { } ); - hasUnresolvedAutoImports = context.resolutionLimitExceeded(); + hasUnresolvedAutoImports = context.skippedAny(); + flags |= context.resolvedAny() ? CompletionInfoFlags.ResolvedModuleSpecifiers : 0; + flags |= context.resolvedBeyondLimit() ? CompletionInfoFlags.ResolvedModuleSpecifiersBeyondLimit : 0; } ); @@ -2831,6 +2877,7 @@ namespace ts.Completions { return; } const origin: SymbolOriginInfoObjectLiteralMethod = { kind: SymbolOriginInfoKind.ObjectLiteralMethod, ...entryProps }; + flags |= CompletionInfoFlags.MayIncludeMethodSnippets; symbolToOriginInfoMap[symbols.length] = origin; symbols.push(member); }); diff --git a/src/services/exportInfoMap.ts b/src/services/exportInfoMap.ts index 4004815a4a6..875511fdeff 100644 --- a/src/services/exportInfoMap.ts +++ b/src/services/exportInfoMap.ts @@ -291,8 +291,8 @@ namespace ts { ): boolean { if (from === to) return false; const cachedResult = moduleSpecifierCache?.get(from.path, to.path, preferences, {}); - if (cachedResult?.isAutoImportable !== undefined) { - return cachedResult.isAutoImportable; + if (cachedResult?.isBlockedByPackageJsonDependencies !== undefined) { + return !cachedResult.isBlockedByPackageJsonDependencies; } const getCanonicalFileName = hostGetCanonicalFileName(moduleSpecifierResolutionHost); @@ -313,7 +313,7 @@ namespace ts { if (packageJsonFilter) { const isAutoImportable = hasImportablePath && packageJsonFilter.allowsImportingSourceFile(to, moduleSpecifierResolutionHost); - moduleSpecifierCache?.setIsAutoImportable(from.path, to.path, preferences, {}, isAutoImportable); + moduleSpecifierCache?.setBlockedByPackageJsonDependencies(from.path, to.path, preferences, {}, !isAutoImportable); return isAutoImportable; } diff --git a/src/services/types.ts b/src/services/types.ts index f84ee7d3ca1..886546f5f06 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -1176,7 +1176,20 @@ namespace ts { argumentCount: number; } + // Do not change existing values, as they exist in telemetry. + export const enum CompletionInfoFlags { + None = 0, + MayIncludeAutoImports = 1 << 0, + IsImportStatementCompletion = 1 << 1, + IsContinuation = 1 << 2, + ResolvedModuleSpecifiers = 1 << 3, + ResolvedModuleSpecifiersBeyondLimit = 1 << 4, + MayIncludeMethodSnippets = 1 << 5, + } + export interface CompletionInfo { + /** For performance telemetry. */ + flags?: CompletionInfoFlags; /** Not true for all global completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */ isGlobalCompletion: boolean; isMemberCompletion: boolean; diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 16d406f7d25..a2f5846b82e 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1928,6 +1928,14 @@ namespace ts { }; } + export function moduleResolutionRespectsExports(moduleResolution: ModuleResolutionKind): boolean { + return moduleResolution >= ModuleResolutionKind.Node12 && moduleResolution <= ModuleResolutionKind.NodeNext; + } + + export function moduleResolutionUsesNodeModules(moduleResolution: ModuleResolutionKind): boolean { + return moduleResolution === ModuleResolutionKind.NodeJs || moduleResolution >= ModuleResolutionKind.Node12 && moduleResolution <= ModuleResolutionKind.NodeNext; + } + export function makeImportIfNecessary(defaultImport: Identifier | undefined, namedImports: readonly ImportSpecifier[] | undefined, moduleSpecifier: string, quotePreference: QuotePreference): ImportDeclaration | undefined { return defaultImport || namedImports && namedImports.length ? makeImport(defaultImport, namedImports, moduleSpecifier, quotePreference) : undefined; } diff --git a/src/testRunner/unittests/tsserver/completions.ts b/src/testRunner/unittests/tsserver/completions.ts index ab84366efc9..3da4c8fe8ca 100644 --- a/src/testRunner/unittests/tsserver/completions.ts +++ b/src/testRunner/unittests/tsserver/completions.ts @@ -52,6 +52,7 @@ namespace ts.projectSystem { assert.isString(exportMapKey); delete (response?.entries[0].data as any).exportMapKey; assert.deepEqual(response, { + flags: CompletionInfoFlags.MayIncludeAutoImports, isGlobalCompletion: true, isIncomplete: undefined, isMemberCompletion: false, diff --git a/src/testRunner/unittests/tsserver/metadataInResponse.ts b/src/testRunner/unittests/tsserver/metadataInResponse.ts index 2ca20ff4046..8ea9d5ff7f7 100644 --- a/src/testRunner/unittests/tsserver/metadataInResponse.ts +++ b/src/testRunner/unittests/tsserver/metadataInResponse.ts @@ -77,6 +77,7 @@ namespace ts.projectSystem { command: protocol.CommandTypes.CompletionInfo, arguments: completionRequestArgs }, { + flags: 0, isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: false, diff --git a/src/testRunner/unittests/tsserver/moduleSpecifierCache.ts b/src/testRunner/unittests/tsserver/moduleSpecifierCache.ts index 60e584882a0..e86cd6a694e 100644 --- a/src/testRunner/unittests/tsserver/moduleSpecifierCache.ts +++ b/src/testRunner/unittests/tsserver/moduleSpecifierCache.ts @@ -39,7 +39,7 @@ namespace ts.projectSystem { describe("unittests:: tsserver:: moduleSpecifierCache", () => { it("caches importability within a file", () => { const { moduleSpecifierCache } = setup(); - assert.isTrue(moduleSpecifierCache.get(bTs.path as Path, aTs.path as Path, {}, {})?.isAutoImportable); + assert.isFalse(moduleSpecifierCache.get(bTs.path as Path, aTs.path as Path, {}, {})?.isBlockedByPackageJsonDependencies); }); it("caches module specifiers within a file", () => { @@ -54,7 +54,7 @@ namespace ts.projectSystem { isRedirect: false }], moduleSpecifiers: ["mobx"], - isAutoImportable: true, + isBlockedByPackageJsonDependencies: false, }); }); @@ -72,7 +72,7 @@ namespace ts.projectSystem { const { host, moduleSpecifierCache } = setup(); host.writeFile("/src/a2.ts", aTs.content); host.runQueuedTimeoutCallbacks(); - assert.isTrue(moduleSpecifierCache.get(bTs.path as Path, aTs.path as Path, {}, {})?.isAutoImportable); + assert.isFalse(moduleSpecifierCache.get(bTs.path as Path, aTs.path as Path, {}, {})?.isBlockedByPackageJsonDependencies); }); it("invalidates the cache when symlinks are added or removed", () => { diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 0fd5bf9e0a9..1e389228866 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -6435,7 +6435,18 @@ declare namespace ts { argumentIndex: number; argumentCount: number; } + enum CompletionInfoFlags { + None = 0, + MayIncludeAutoImports = 1, + IsImportStatementCompletion = 2, + IsContinuation = 4, + ResolvedModuleSpecifiers = 8, + ResolvedModuleSpecifiersBeyondLimit = 16, + MayIncludeMethodSnippets = 32 + } interface CompletionInfo { + /** For performance telemetry. */ + flags?: CompletionInfoFlags; /** Not true for all global completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */ isGlobalCompletion: boolean; isMemberCompletion: boolean; @@ -8823,6 +8834,7 @@ declare namespace ts.server.protocol { body?: CompletionInfo; } interface CompletionInfo { + readonly flags?: number; readonly isGlobalCompletion: boolean; readonly isMemberCompletion: boolean; readonly isNewIdentifierLocation: boolean; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index beb29fd613a..c1fc7000c4b 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -6435,7 +6435,18 @@ declare namespace ts { argumentIndex: number; argumentCount: number; } + enum CompletionInfoFlags { + None = 0, + MayIncludeAutoImports = 1, + IsImportStatementCompletion = 2, + IsContinuation = 4, + ResolvedModuleSpecifiers = 8, + ResolvedModuleSpecifiersBeyondLimit = 16, + MayIncludeMethodSnippets = 32 + } interface CompletionInfo { + /** For performance telemetry. */ + flags?: CompletionInfoFlags; /** Not true for all global completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */ isGlobalCompletion: boolean; isMemberCompletion: boolean; diff --git a/tests/baselines/reference/completionEntryForUnionMethod.baseline b/tests/baselines/reference/completionEntryForUnionMethod.baseline index f03ee666dc0..b46b77f0f76 100644 --- a/tests/baselines/reference/completionEntryForUnionMethod.baseline +++ b/tests/baselines/reference/completionEntryForUnionMethod.baseline @@ -6,6 +6,7 @@ "name": "" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, diff --git a/tests/baselines/reference/completionImportCallAssertion.baseline b/tests/baselines/reference/completionImportCallAssertion.baseline index 6009fb9e67f..2e54c403997 100644 --- a/tests/baselines/reference/completionImportCallAssertion.baseline +++ b/tests/baselines/reference/completionImportCallAssertion.baseline @@ -6,6 +6,7 @@ "name": "0" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, @@ -73,6 +74,7 @@ "name": "1" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, diff --git a/tests/baselines/reference/completionsCommentsClass.baseline b/tests/baselines/reference/completionsCommentsClass.baseline index 66766ee70be..f7144af7e12 100644 --- a/tests/baselines/reference/completionsCommentsClass.baseline +++ b/tests/baselines/reference/completionsCommentsClass.baseline @@ -6,6 +6,7 @@ "name": "26" }, "completionList": { + "flags": 0, "isGlobalCompletion": true, "isMemberCompletion": false, "isNewIdentifierLocation": false, diff --git a/tests/baselines/reference/completionsCommentsClassMembers.baseline b/tests/baselines/reference/completionsCommentsClassMembers.baseline index af89101b92a..9a068cdbf28 100644 --- a/tests/baselines/reference/completionsCommentsClassMembers.baseline +++ b/tests/baselines/reference/completionsCommentsClassMembers.baseline @@ -6,6 +6,7 @@ "name": "4" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, @@ -754,6 +755,7 @@ "name": "5" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": false, "isNewIdentifierLocation": false, @@ -4818,6 +4820,7 @@ "name": "7" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, @@ -5566,6 +5569,7 @@ "name": "9" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, @@ -6314,6 +6318,7 @@ "name": "11" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, @@ -7062,6 +7067,7 @@ "name": "12" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, @@ -7810,6 +7816,7 @@ "name": "13" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": false, "isNewIdentifierLocation": true, @@ -11874,6 +11881,7 @@ "name": "16" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, @@ -12622,6 +12630,7 @@ "name": "17" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": false, "isNewIdentifierLocation": false, @@ -16686,6 +16695,7 @@ "name": "19" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, @@ -17434,6 +17444,7 @@ "name": "21" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, @@ -18182,6 +18193,7 @@ "name": "23" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, @@ -18930,6 +18942,7 @@ "name": "24" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, @@ -19678,6 +19691,7 @@ "name": "25" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": false, "isNewIdentifierLocation": true, @@ -23742,6 +23756,7 @@ "name": "29" }, "completionList": { + "flags": 0, "isGlobalCompletion": true, "isMemberCompletion": false, "isNewIdentifierLocation": false, @@ -27806,6 +27821,7 @@ "name": "30" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, @@ -28961,6 +28977,7 @@ "name": "31" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": false, "isNewIdentifierLocation": false, @@ -33025,6 +33042,7 @@ "name": "33" }, "completionList": { + "flags": 0, "isGlobalCompletion": true, "isMemberCompletion": false, "isNewIdentifierLocation": false, @@ -37043,6 +37061,7 @@ "name": "34" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, @@ -38198,6 +38217,7 @@ "name": "35" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": false, "isNewIdentifierLocation": true, @@ -42216,6 +42236,7 @@ "name": "36" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, @@ -43371,6 +43392,7 @@ "name": "38" }, "completionList": { + "flags": 0, "isGlobalCompletion": true, "isMemberCompletion": false, "isNewIdentifierLocation": false, @@ -47435,6 +47457,7 @@ "name": "39" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, @@ -48590,6 +48613,7 @@ "name": "40" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": false, "isNewIdentifierLocation": true, @@ -52654,6 +52678,7 @@ "name": "41" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, @@ -53809,6 +53834,7 @@ "name": "42" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": false, "isNewIdentifierLocation": true, @@ -57873,6 +57899,7 @@ "name": "45" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": false, "isNewIdentifierLocation": false, @@ -61932,6 +61959,7 @@ "name": "49" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": false, "isNewIdentifierLocation": true, @@ -65991,6 +66019,7 @@ "name": "52" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": false, "isNewIdentifierLocation": false, @@ -70050,6 +70079,7 @@ "name": "56" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": false, "isNewIdentifierLocation": true, @@ -74109,6 +74139,7 @@ "name": "59" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": false, "isNewIdentifierLocation": false, @@ -78168,6 +78199,7 @@ "name": "63" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": false, "isNewIdentifierLocation": true, @@ -82227,6 +82259,7 @@ "name": "67" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, @@ -82610,6 +82643,7 @@ "name": "87" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": false, "isNewIdentifierLocation": true, @@ -86782,6 +86816,7 @@ "name": "88" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, @@ -87937,6 +87972,7 @@ "name": "109" }, "completionList": { + "flags": 0, "isGlobalCompletion": true, "isMemberCompletion": false, "isNewIdentifierLocation": false, @@ -92138,6 +92174,7 @@ "name": "110" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, @@ -92362,6 +92399,7 @@ "name": "114" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, @@ -92461,6 +92499,7 @@ "name": "115" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": false, "isNewIdentifierLocation": true, diff --git a/tests/baselines/reference/completionsCommentsCommentParsing.baseline b/tests/baselines/reference/completionsCommentsCommentParsing.baseline index 1ec7d5e2072..f03678262a7 100644 --- a/tests/baselines/reference/completionsCommentsCommentParsing.baseline +++ b/tests/baselines/reference/completionsCommentsCommentParsing.baseline @@ -6,6 +6,7 @@ "name": "18" }, "completionList": { + "flags": 0, "isGlobalCompletion": true, "isMemberCompletion": false, "isNewIdentifierLocation": false, @@ -5653,6 +5654,7 @@ "name": "15" }, "completionList": { + "flags": 0, "isGlobalCompletion": true, "isMemberCompletion": false, "isNewIdentifierLocation": false, @@ -12096,6 +12098,7 @@ "name": "24" }, "completionList": { + "flags": 0, "isGlobalCompletion": true, "isMemberCompletion": false, "isNewIdentifierLocation": false, @@ -17719,6 +17722,7 @@ "name": "27" }, "completionList": { + "flags": 0, "isGlobalCompletion": true, "isMemberCompletion": false, "isNewIdentifierLocation": false, @@ -23419,6 +23423,7 @@ "name": "39" }, "completionList": { + "flags": 0, "isGlobalCompletion": true, "isMemberCompletion": false, "isNewIdentifierLocation": false, @@ -29161,6 +29166,7 @@ "name": "44" }, "completionList": { + "flags": 0, "isGlobalCompletion": true, "isMemberCompletion": false, "isNewIdentifierLocation": false, @@ -35604,6 +35610,7 @@ "name": "" }, "completionList": { + "flags": 0, "isGlobalCompletion": true, "isMemberCompletion": false, "isNewIdentifierLocation": false, diff --git a/tests/baselines/reference/completionsCommentsFunctionDeclaration.baseline b/tests/baselines/reference/completionsCommentsFunctionDeclaration.baseline index ae41c9cc50c..68e1b3d6ce0 100644 --- a/tests/baselines/reference/completionsCommentsFunctionDeclaration.baseline +++ b/tests/baselines/reference/completionsCommentsFunctionDeclaration.baseline @@ -6,6 +6,7 @@ "name": "3" }, "completionList": { + "flags": 0, "isGlobalCompletion": true, "isMemberCompletion": false, "isNewIdentifierLocation": false, @@ -4316,6 +4317,7 @@ "name": "7" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": false, "isNewIdentifierLocation": true, @@ -7792,6 +7794,7 @@ "name": "9" }, "completionList": { + "flags": 0, "isGlobalCompletion": true, "isMemberCompletion": false, "isNewIdentifierLocation": false, diff --git a/tests/baselines/reference/completionsCommentsFunctionExpression.baseline b/tests/baselines/reference/completionsCommentsFunctionExpression.baseline index 9c1bc339283..5be58374a3f 100644 --- a/tests/baselines/reference/completionsCommentsFunctionExpression.baseline +++ b/tests/baselines/reference/completionsCommentsFunctionExpression.baseline @@ -6,6 +6,7 @@ "name": "2" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": false, "isNewIdentifierLocation": false, @@ -3853,6 +3854,7 @@ "name": "4" }, "completionList": { + "flags": 0, "isGlobalCompletion": true, "isMemberCompletion": false, "isNewIdentifierLocation": false, @@ -8575,6 +8577,7 @@ "name": "15" }, "completionList": { + "flags": 0, "isGlobalCompletion": true, "isMemberCompletion": false, "isNewIdentifierLocation": false, @@ -12241,6 +12244,7 @@ "name": "17" }, "completionList": { + "flags": 0, "isGlobalCompletion": true, "isMemberCompletion": false, "isNewIdentifierLocation": false, diff --git a/tests/baselines/reference/completionsJSDocTags.baseline b/tests/baselines/reference/completionsJSDocTags.baseline index 4c876248179..945b84dd88b 100644 --- a/tests/baselines/reference/completionsJSDocTags.baseline +++ b/tests/baselines/reference/completionsJSDocTags.baseline @@ -6,6 +6,7 @@ "name": "14" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, diff --git a/tests/baselines/reference/completionsSalsaMethodsOnAssignedFunctionExpressions.baseline b/tests/baselines/reference/completionsSalsaMethodsOnAssignedFunctionExpressions.baseline index 4c5bcf2c68d..732ce4a3164 100644 --- a/tests/baselines/reference/completionsSalsaMethodsOnAssignedFunctionExpressions.baseline +++ b/tests/baselines/reference/completionsSalsaMethodsOnAssignedFunctionExpressions.baseline @@ -6,6 +6,7 @@ "name": "2" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, diff --git a/tests/baselines/reference/completionsStringMethods.baseline b/tests/baselines/reference/completionsStringMethods.baseline index 327daf9f0d9..0d3fe39d755 100644 --- a/tests/baselines/reference/completionsStringMethods.baseline +++ b/tests/baselines/reference/completionsStringMethods.baseline @@ -6,6 +6,7 @@ "name": "1" }, "completionList": { + "flags": 0, "isGlobalCompletion": false, "isMemberCompletion": true, "isNewIdentifierLocation": false, diff --git a/tests/cases/fourslash/autoImportsNodeNext1.ts b/tests/cases/fourslash/autoImportsNodeNext1.ts new file mode 100644 index 00000000000..32aeaaef28d --- /dev/null +++ b/tests/cases/fourslash/autoImportsNodeNext1.ts @@ -0,0 +1,35 @@ +/// + +// @module: nodenext + +// @Filename: /node_modules/pack/package.json +//// { +//// "name": "pack", +//// "version": "1.0.0", +//// "exports": { +//// ".": "./main.mjs" +//// } +//// } + +// @Filename: /node_modules/pack/main.d.mts +//// import {} from "./unreachable.mjs"; +//// export const fromMain = 0; + +// @Filename: /node_modules/pack/unreachable.d.mts +//// export const fromUnreachable = 0; + +// @Filename: /index.mts +//// import { fromMain } from "pack"; +//// fromUnreachable/**/ + +goTo.marker(""); +verify.importFixAtPosition([]); + +verify.completions({ + marker: "", + excludes: ["fromUnreachable"], + preferences: { + includeCompletionsForModuleExports: true, + allowIncompleteCompletions: false, + } +}); diff --git a/tests/cases/fourslash/server/autoImportProvider_exportMap3.ts b/tests/cases/fourslash/server/autoImportProvider_exportMap3.ts index e4e70c749fe..b31bc52cb69 100644 --- a/tests/cases/fourslash/server/autoImportProvider_exportMap3.ts +++ b/tests/cases/fourslash/server/autoImportProvider_exportMap3.ts @@ -39,16 +39,6 @@ goTo.marker(""); verify.completions({ marker: "", exact: completion.globalsPlus([{ - // TODO: We should filter this one out due to its bad module specifier, - // but we don't know it's going to be filtered out until we actually - // resolve the module specifier, which is a problem for completions - // that don't have their module specifiers eagerly resolved. - name: "fooFromIndex", - source: "../node_modules/dependency/lib/index.js", - sourceDisplay: "../node_modules/dependency/lib/index.js", - sortText: completion.SortText.AutoImportSuggestions, - hasAction: true, - }, { name: "fooFromLol", source: "dependency", sourceDisplay: "dependency", diff --git a/tests/cases/fourslash/server/autoImportProvider_exportMap8.ts b/tests/cases/fourslash/server/autoImportProvider_exportMap8.ts index b679c2184fd..cdee1fe7cc8 100644 --- a/tests/cases/fourslash/server/autoImportProvider_exportMap8.ts +++ b/tests/cases/fourslash/server/autoImportProvider_exportMap8.ts @@ -49,13 +49,6 @@ goTo.marker("cts"); verify.completions({ marker: "cts", exact: completion.globalsPlus([{ - // TODO: this one will go away (see note in ./autoImportProvider_exportMap3.ts) - name: "fooFromIndex", - source: "../node_modules/dependency/lib/index", - sourceDisplay: "../node_modules/dependency/lib/index", - sortText: completion.SortText.AutoImportSuggestions, - hasAction: true, - }, { name: "fooFromLol", source: "dependency/lol", sourceDisplay: "dependency/lol", @@ -78,13 +71,6 @@ verify.completions({ sourceDisplay: "dependency/lol", sortText: completion.SortText.AutoImportSuggestions, hasAction: true, - }, { - // TODO: this one will go away (see note in ./autoImportProvider_exportMap3.ts) - name: "fooFromLol", - source: "../node_modules/dependency/lib/lol.js", - sourceDisplay: "../node_modules/dependency/lib/lol.js", - sortText: completion.SortText.AutoImportSuggestions, - hasAction: true, }]), preferences: { includeCompletionsForModuleExports: true, From 0885482eeb17cfc8d965aaea6ed04490ae3f3e74 Mon Sep 17 00:00:00 2001 From: ZHAO Jinxiang Date: Thu, 28 Apr 2022 07:33:46 +0800 Subject: [PATCH 30/63] Fix export default expression comment (#48323) --- src/compiler/transformers/declarations.ts | 3 +++ .../exportDefaultExpressionComments.js | 22 +++++++++++++++++++ .../exportDefaultExpressionComments.symbols | 7 ++++++ .../exportDefaultExpressionComments.types | 7 ++++++ .../exportDefaultExpressionComments.ts | 6 +++++ 5 files changed, 45 insertions(+) create mode 100644 tests/baselines/reference/exportDefaultExpressionComments.js create mode 100644 tests/baselines/reference/exportDefaultExpressionComments.symbols create mode 100644 tests/baselines/reference/exportDefaultExpressionComments.types create mode 100644 tests/cases/conformance/declarationEmit/exportDefaultExpressionComments.ts diff --git a/src/compiler/transformers/declarations.ts b/src/compiler/transformers/declarations.ts index 3a3e237c5ea..0667cf386f7 100644 --- a/src/compiler/transformers/declarations.ts +++ b/src/compiler/transformers/declarations.ts @@ -1140,6 +1140,9 @@ namespace ts { const varDecl = factory.createVariableDeclaration(newId, /*exclamationToken*/ undefined, resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), /*initializer*/ undefined); errorFallbackNode = undefined; const statement = factory.createVariableStatement(needsDeclare ? [factory.createModifier(SyntaxKind.DeclareKeyword)] : [], factory.createVariableDeclarationList([varDecl], NodeFlags.Const)); + + preserveJsDoc(statement, input); + removeAllComments(input); return [statement, factory.updateExportAssignment(input, input.decorators, input.modifiers, newId)]; } } diff --git a/tests/baselines/reference/exportDefaultExpressionComments.js b/tests/baselines/reference/exportDefaultExpressionComments.js new file mode 100644 index 00000000000..c3a9bb61da6 --- /dev/null +++ b/tests/baselines/reference/exportDefaultExpressionComments.js @@ -0,0 +1,22 @@ +//// [exportDefaultExpressionComments.ts] +/** + * JSDoc Comments + */ +export default null + + +//// [exportDefaultExpressionComments.js] +"use strict"; +exports.__esModule = true; +/** + * JSDoc Comments + */ +exports["default"] = null; + + +//// [exportDefaultExpressionComments.d.ts] +/** + * JSDoc Comments + */ +declare const _default: any; +export default _default; diff --git a/tests/baselines/reference/exportDefaultExpressionComments.symbols b/tests/baselines/reference/exportDefaultExpressionComments.symbols new file mode 100644 index 00000000000..a3a94331a56 --- /dev/null +++ b/tests/baselines/reference/exportDefaultExpressionComments.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/declarationEmit/exportDefaultExpressionComments.ts === +/** +No type information for this code. * JSDoc Comments +No type information for this code. */ +No type information for this code.export default null +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/exportDefaultExpressionComments.types b/tests/baselines/reference/exportDefaultExpressionComments.types new file mode 100644 index 00000000000..012b8d32555 --- /dev/null +++ b/tests/baselines/reference/exportDefaultExpressionComments.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/declarationEmit/exportDefaultExpressionComments.ts === +/** + * JSDoc Comments + */ +export default null +>null : null + diff --git a/tests/cases/conformance/declarationEmit/exportDefaultExpressionComments.ts b/tests/cases/conformance/declarationEmit/exportDefaultExpressionComments.ts new file mode 100644 index 00000000000..a7477cc7557 --- /dev/null +++ b/tests/cases/conformance/declarationEmit/exportDefaultExpressionComments.ts @@ -0,0 +1,6 @@ +// @declaration: true + +/** + * JSDoc Comments + */ +export default null From 9b3853d49ed221f4bc180625d0595244dc0a5319 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Thu, 28 Apr 2022 03:51:05 +0300 Subject: [PATCH 31/63] fix(48851): exclude in from document highlights (#48853) --- src/services/documentHighlights.ts | 2 ++ tests/cases/fourslash/documentHighlightInKeyword.ts | 13 +++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 tests/cases/fourslash/documentHighlightInKeyword.ts diff --git a/src/services/documentHighlights.ts b/src/services/documentHighlights.ts index ffcec349cc6..698f82eda51 100644 --- a/src/services/documentHighlights.ts +++ b/src/services/documentHighlights.ts @@ -93,6 +93,8 @@ namespace ts { return highlightSpans(getAsyncAndAwaitOccurrences(node)); case SyntaxKind.YieldKeyword: return highlightSpans(getYieldOccurrences(node)); + case SyntaxKind.InKeyword: + return undefined; default: return isModifierKind(node.kind) && (isDeclaration(node.parent) || isVariableStatement(node.parent)) ? highlightSpans(getModifierOccurrences(node.kind, node.parent)) diff --git a/tests/cases/fourslash/documentHighlightInKeyword.ts b/tests/cases/fourslash/documentHighlightInKeyword.ts new file mode 100644 index 00000000000..b24d5827eca --- /dev/null +++ b/tests/cases/fourslash/documentHighlightInKeyword.ts @@ -0,0 +1,13 @@ +/// + +////export type Foo = { +//// [K [|in|] keyof T]: any; +////} +//// +////"a" [|in|] {}; +//// +////for (let a [|in|] {}) {} + +for (let range of test.ranges()) { + verify.noDocumentHighlights(range); +} From 61c3bfe484101cdabb6bf706c635122511b2574b Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 27 Apr 2022 18:07:54 -0700 Subject: [PATCH 32/63] Dont reload config file when package.json change is detected (#48866) Fixes #48315 --- src/compiler/tsbuildPublic.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/tsbuildPublic.ts b/src/compiler/tsbuildPublic.ts index e0825db6100..280ebfcd267 100644 --- a/src/compiler/tsbuildPublic.ts +++ b/src/compiler/tsbuildPublic.ts @@ -1896,7 +1896,7 @@ namespace ts { { createNewValue: (path, _input) => state.watchFile( path, - () => invalidateProjectAndScheduleBuilds(state, resolvedPath, ConfigFileProgramReloadLevel.Full), + () => invalidateProjectAndScheduleBuilds(state, resolvedPath, ConfigFileProgramReloadLevel.None), PollingInterval.High, parsed?.watchOptions, WatchType.PackageJson, From 189c2b9e4a4fc35f8a66c4796c0653229c71829d Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Fri, 29 Apr 2022 06:06:45 +0000 Subject: [PATCH 33/63] Update package-lock.json --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7eaf992be67..1ccfc8dafe3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -638,9 +638,9 @@ "dev": true }, "@types/node": { - "version": "17.0.29", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.29.tgz", - "integrity": "sha512-tx5jMmMFwx7wBwq/V7OohKDVb/JwJU5qCVkeLMh1//xycAJ/ESuw9aJ9SEtlCZDYi2pBfe4JkisSoAtbOsBNAA==", + "version": "17.0.30", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.30.tgz", + "integrity": "sha512-oNBIZjIqyHYP8VCNAV9uEytXVeXG2oR0w9lgAXro20eugRQfY002qr3CUl6BAe+Yf/z3CRjPdz27Pu6WWtuSRw==", "dev": true }, "@types/node-fetch": { From 18b08fc7c995c4d6ca5437f1dd0668568ae352bc Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 29 Apr 2022 10:45:20 -0700 Subject: [PATCH 34/63] Use same error for iteration in <=ES5 (#48881) * Use the same error for iterating over an Iterable in ES5 or lower. * Accepted baselines. --- src/compiler/checker.ts | 4 ++-- src/compiler/diagnosticMessages.json | 5 +---- src/services/codefixes/addMissingAwait.ts | 2 +- tests/baselines/reference/ES5For-ofTypeCheck13.errors.txt | 4 ++-- tests/baselines/reference/ES5For-ofTypeCheck14.errors.txt | 4 ++-- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 1506c4809ef..3795c475066 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -38250,7 +38250,7 @@ namespace ts { return (use & IterationUse.PossiblyOutOfBounds) ? includeUndefinedInIndexSignature(arrayElementType) : arrayElementType; - function getIterationDiagnosticDetails(allowsStrings: boolean, downlevelIteration: boolean | undefined): [DiagnosticMessage, boolean] { + function getIterationDiagnosticDetails(allowsStrings: boolean, downlevelIteration: boolean | undefined): [error: DiagnosticMessage, maybeMissingAwait: boolean] { if (downlevelIteration) { return allowsStrings ? [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, true] @@ -38260,7 +38260,7 @@ namespace ts { const yieldType = getIterationTypeOfIterable(use, IterationTypeKind.Yield, inputType, /*errorNode*/ undefined); if (yieldType) { - return [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators, false]; + return [Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher, false]; } if (isES2015OrLaterIterable(inputType.symbol?.escapedName)) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 44fed63932d..1b3e575fa6a 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2511,10 +2511,7 @@ "category": "Error", "code": 2568 }, - "Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.": { - "category": "Error", - "code": 2569 - }, + "Could not find name '{0}'. Did you mean '{1}'?": { "category": "Error", "code": 2570 diff --git a/src/services/codefixes/addMissingAwait.ts b/src/services/codefixes/addMissingAwait.ts index 1a9110227e5..d8b16cd4e54 100644 --- a/src/services/codefixes/addMissingAwait.ts +++ b/src/services/codefixes/addMissingAwait.ts @@ -17,7 +17,7 @@ namespace ts.codefix { Diagnostics.This_condition_will_always_return_true_since_this_0_is_always_defined.code, Diagnostics.Type_0_is_not_an_array_type.code, Diagnostics.Type_0_is_not_an_array_type_or_a_string_type.code, - Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators.code, + Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher.code, Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code, Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code, Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator.code, diff --git a/tests/baselines/reference/ES5For-ofTypeCheck13.errors.txt b/tests/baselines/reference/ES5For-ofTypeCheck13.errors.txt index b64781a4873..4d680b362ac 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck13.errors.txt +++ b/tests/baselines/reference/ES5For-ofTypeCheck13.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck13.ts(4,19): error TS2569: Type 'Set' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators. +tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck13.ts(4,19): error TS2802: Type 'Set' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher. ==== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck13.ts (1 errors) ==== @@ -7,4 +7,4 @@ tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck13.ts(4,19 strSet.add('World') for (const str of strSet) { } ~~~~~~ -!!! error TS2569: Type 'Set' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators. \ No newline at end of file +!!! error TS2802: Type 'Set' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher. \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-ofTypeCheck14.errors.txt b/tests/baselines/reference/ES5For-ofTypeCheck14.errors.txt index 1fde67722db..e815c53e2f3 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck14.errors.txt +++ b/tests/baselines/reference/ES5For-ofTypeCheck14.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck14.ts(2,17): error TS2569: Type 'Set' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators. +tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck14.ts(2,17): error TS2802: Type 'Set' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher. ==== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck14.ts (1 errors) ==== var union: string | Set for (const e of union) { } ~~~~~ -!!! error TS2569: Type 'Set' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators. \ No newline at end of file +!!! error TS2802: Type 'Set' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher. \ No newline at end of file From fd06132ce9308a2305e21b095477f3f8d61ace3e Mon Sep 17 00:00:00 2001 From: Felipe Armoni Date: Fri, 29 Apr 2022 20:45:00 +0000 Subject: [PATCH 35/63] Fix #47753 - Organize imports removes type imports that are only referenced in @link (jsdoc) (#47824) * Added unit test * Added baseline test * Dirty solution * Code refactoring and improvements * Added more test cases * Refactor to use flatMap * Added utility function to get all Nodes with JSDocs * Minor improvements * Use recursion to check all tree levels * Removed unit test * Removed previous changes * Updated resolveEntityName call * Updated dontResolveAlias clause * Updated symbol flags * Updated baseline * Fix dont resolve alias problem * Updated tests --- src/compiler/checker.ts | 2 +- tests/baselines/reference/jsdocLink3.baseline | 30 ++++----- tests/cases/fourslash/organizeImports10.ts | 18 ++++++ tests/cases/fourslash/organizeImports11.ts | 62 +++++++++++++++++++ 4 files changed, 96 insertions(+), 16 deletions(-) create mode 100644 tests/cases/fourslash/organizeImports10.ts create mode 100644 tests/cases/fourslash/organizeImports11.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 3795c475066..97e341b0c29 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -41898,7 +41898,7 @@ namespace ts { const symbol = getIntrinsicTagSymbol(name.parent as JsxOpeningLikeElement); return symbol === unknownSymbol ? undefined : symbol; } - const result = resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ !isJSDoc, getHostSignatureFromJSDoc(name)); + const result = resolveEntityName(name, meaning, /*ignoreErrors*/ false, /* dontResolveAlias */ true, getHostSignatureFromJSDoc(name)); if (!result && isJSDoc) { const container = findAncestor(name, or(isClassLike, isInterfaceDeclaration)); if (container) { diff --git a/tests/baselines/reference/jsdocLink3.baseline b/tests/baselines/reference/jsdocLink3.baseline index da1a6fa0cfb..039d48a13af 100644 --- a/tests/baselines/reference/jsdocLink3.baseline +++ b/tests/baselines/reference/jsdocLink3.baseline @@ -59,10 +59,10 @@ "text": "C", "kind": "linkName", "target": { - "fileName": "/jsdocLink3.ts", + "fileName": "/module1.ts", "textSpan": { - "start": 0, - "length": 18 + "start": 9, + "length": 1 } } }, @@ -87,10 +87,10 @@ "text": "C", "kind": "linkName", "target": { - "fileName": "/jsdocLink3.ts", + "fileName": "/module1.ts", "textSpan": { - "start": 0, - "length": 18 + "start": 9, + "length": 1 } } }, @@ -110,10 +110,10 @@ "text": "C()", "kind": "linkName", "target": { - "fileName": "/jsdocLink3.ts", + "fileName": "/module1.ts", "textSpan": { - "start": 0, - "length": 18 + "start": 9, + "length": 1 } } }, @@ -133,10 +133,10 @@ "text": "C", "kind": "linkName", "target": { - "fileName": "/jsdocLink3.ts", + "fileName": "/module1.ts", "textSpan": { - "start": 0, - "length": 18 + "start": 9, + "length": 1 } } }, @@ -181,10 +181,10 @@ "text": "C", "kind": "linkName", "target": { - "fileName": "/jsdocLink3.ts", + "fileName": "/module1.ts", "textSpan": { - "start": 0, - "length": 18 + "start": 9, + "length": 1 } } }, diff --git a/tests/cases/fourslash/organizeImports10.ts b/tests/cases/fourslash/organizeImports10.ts new file mode 100644 index 00000000000..de1acf551ee --- /dev/null +++ b/tests/cases/fourslash/organizeImports10.ts @@ -0,0 +1,18 @@ +/// + +// @Filename: /module.ts +////import type { ZodType } from './declaration'; +//// +/////** Intended to be used in combination with {@link ZodType} */ +////export function fun() { /* ... */ } + +// @Filename: /declaration.ts +//// type ZodType = {}; +//// export type { ZodType } + + +verify.organizeImports(`import type { ZodType } from './declaration'; + +/** Intended to be used in combination with {@link ZodType} */ +export function fun() { /* ... */ }` +); diff --git a/tests/cases/fourslash/organizeImports11.ts b/tests/cases/fourslash/organizeImports11.ts new file mode 100644 index 00000000000..d2ba946ef82 --- /dev/null +++ b/tests/cases/fourslash/organizeImports11.ts @@ -0,0 +1,62 @@ +/// + +// @Filename: /test.ts +////import { TypeA, TypeB, TypeC, UnreferencedType } from './my-types'; +//// +/////** +//// * MyClass {@link TypeA} +//// */ +////export class MyClass { +//// +//// /** +//// * Some Property {@link TypeB} +//// */ +//// public something; +//// +//// /** +//// * Some function {@link TypeC} +//// */ +//// public myMethod() { +//// +//// /** +//// * Some lambda function {@link TypeC} +//// */ +//// const someFunction = () => { +//// return ''; +//// } +//// someFunction(); +//// } +////} + +// @Filename: /my-types.ts +//// export type TypeA = string; +//// export class TypeB { } +//// export type TypeC = () => string; + +verify.organizeImports(`import { TypeA, TypeB, TypeC } from './my-types'; + +/** + * MyClass {@link TypeA} + */ +export class MyClass { + + /** + * Some Property {@link TypeB} + */ + public something; + + /** + * Some function {@link TypeC} + */ + public myMethod() { + + /** + * Some lambda function {@link TypeC} + */ + const someFunction = () => { + return ''; + } + someFunction(); + } +}` +); \ No newline at end of file From 99ffa394a838a5528d6118fb3c23f81fd8e99ab2 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Sat, 30 Apr 2022 00:19:20 +0300 Subject: [PATCH 36/63] fix(48759): throw an error on using import expression with type arguments (#48787) --- src/compiler/checker.ts | 5 ++++- src/compiler/diagnosticMessages.json | 2 +- .../importCallExpressionWithTypeArgument.errors.txt | 8 ++++---- .../reference/importWithTypeArguments.errors.txt | 12 ++++++++++++ tests/baselines/reference/importWithTypeArguments.js | 8 ++++++++ .../reference/importWithTypeArguments.symbols | 7 +++++++ .../reference/importWithTypeArguments.types | 5 +++++ .../types/import/importWithTypeArguments.ts | 2 ++ 8 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 tests/baselines/reference/importWithTypeArguments.errors.txt create mode 100644 tests/baselines/reference/importWithTypeArguments.js create mode 100644 tests/baselines/reference/importWithTypeArguments.symbols create mode 100644 tests/baselines/reference/importWithTypeArguments.types create mode 100644 tests/cases/conformance/types/import/importWithTypeArguments.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 97e341b0c29..5efefc51d24 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -43901,6 +43901,9 @@ namespace ts { } function checkGrammarExpressionWithTypeArguments(node: ExpressionWithTypeArguments | TypeQueryNode) { + if (isExpressionWithTypeArguments(node) && isImportKeyword(node.expression) && node.typeArguments) { + return grammarErrorOnNode(node, Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments); + } return checkGrammarTypeArguments(node, node.typeArguments); } @@ -44951,7 +44954,7 @@ namespace ts { } if (node.typeArguments) { - return grammarErrorOnNode(node, Diagnostics.Dynamic_import_cannot_have_type_arguments); + return grammarErrorOnNode(node, Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments); } const nodeArguments = node.arguments; diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 1b3e575fa6a..22c923012aa 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -956,7 +956,7 @@ "category": "Error", "code": 1325 }, - "Dynamic import cannot have type arguments.": { + "This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.": { "category": "Error", "code": 1326 }, diff --git a/tests/baselines/reference/importCallExpressionWithTypeArgument.errors.txt b/tests/baselines/reference/importCallExpressionWithTypeArgument.errors.txt index 65b8a2d631e..53920e46540 100644 --- a/tests/baselines/reference/importCallExpressionWithTypeArgument.errors.txt +++ b/tests/baselines/reference/importCallExpressionWithTypeArgument.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/dynamicImport/1.ts(2,10): error TS1326: Dynamic import cannot have type arguments. -tests/cases/conformance/dynamicImport/1.ts(3,10): error TS1326: Dynamic import cannot have type arguments. +tests/cases/conformance/dynamicImport/1.ts(2,10): error TS1326: This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments. +tests/cases/conformance/dynamicImport/1.ts(3,10): error TS1326: This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments. ==== tests/cases/conformance/dynamicImport/0.ts (0 errors) ==== @@ -9,7 +9,7 @@ tests/cases/conformance/dynamicImport/1.ts(3,10): error TS1326: Dynamic import c "use strict" var p1 = import>("./0"); // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1326: Dynamic import cannot have type arguments. +!!! error TS1326: This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments. var p2 = import<>("./0"); // error ~~~~~~~~~~~~~~~ -!!! error TS1326: Dynamic import cannot have type arguments. \ No newline at end of file +!!! error TS1326: This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments. \ No newline at end of file diff --git a/tests/baselines/reference/importWithTypeArguments.errors.txt b/tests/baselines/reference/importWithTypeArguments.errors.txt new file mode 100644 index 00000000000..2981a63bec7 --- /dev/null +++ b/tests/baselines/reference/importWithTypeArguments.errors.txt @@ -0,0 +1,12 @@ +tests/cases/conformance/types/import/importWithTypeArguments.ts(1,1): error TS1326: This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments. +tests/cases/conformance/types/import/importWithTypeArguments.ts(2,11): error TS1326: This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments. + + +==== tests/cases/conformance/types/import/importWithTypeArguments.ts (2 errors) ==== + import + ~~~~~~~~~ +!!! error TS1326: This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments. + const a = import + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1326: This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments. + \ No newline at end of file diff --git a/tests/baselines/reference/importWithTypeArguments.js b/tests/baselines/reference/importWithTypeArguments.js new file mode 100644 index 00000000000..9a54a823050 --- /dev/null +++ b/tests/baselines/reference/importWithTypeArguments.js @@ -0,0 +1,8 @@ +//// [importWithTypeArguments.ts] +import +const a = import + + +//// [importWithTypeArguments.js] +import; +var a = (import); diff --git a/tests/baselines/reference/importWithTypeArguments.symbols b/tests/baselines/reference/importWithTypeArguments.symbols new file mode 100644 index 00000000000..5f769bb1978 --- /dev/null +++ b/tests/baselines/reference/importWithTypeArguments.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/types/import/importWithTypeArguments.ts === +import +>T : Symbol(T) + +const a = import +>a : Symbol(a, Decl(importWithTypeArguments.ts, 1, 5)) + diff --git a/tests/baselines/reference/importWithTypeArguments.types b/tests/baselines/reference/importWithTypeArguments.types new file mode 100644 index 00000000000..442b3cc9ed9 --- /dev/null +++ b/tests/baselines/reference/importWithTypeArguments.types @@ -0,0 +1,5 @@ +=== tests/cases/conformance/types/import/importWithTypeArguments.ts === +import +const a = import +>a : any + diff --git a/tests/cases/conformance/types/import/importWithTypeArguments.ts b/tests/cases/conformance/types/import/importWithTypeArguments.ts new file mode 100644 index 00000000000..684260429c2 --- /dev/null +++ b/tests/cases/conformance/types/import/importWithTypeArguments.ts @@ -0,0 +1,2 @@ +import +const a = import From 7ae09880f87a9c01668ab1963327d1aa421bb8d9 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Sun, 1 May 2022 06:06:20 +0000 Subject: [PATCH 37/63] Update package-lock.json --- package-lock.json | 68 +++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 37 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1ccfc8dafe3..1171d5f813b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3334,12 +3334,6 @@ "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", "dev": true }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, "gulp": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz", @@ -4328,32 +4322,30 @@ "dev": true }, "mocha": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", - "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.0.0.tgz", + "integrity": "sha512-0Wl+elVUD43Y0BqPZBzZt8Tnkw9CMUdNYnUsTfOM1vuhJVZL+kiesFYsqwBkEEuEixaiPe5ZQdqDgX2jddhmoA==", "dev": true, "requires": { "@ungap/promise-all-settled": "1.1.2", "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", "chokidar": "3.5.3", - "debug": "4.3.3", + "debug": "4.3.4", "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", "glob": "7.2.0", - "growl": "1.10.5", "he": "1.2.0", "js-yaml": "4.1.0", "log-symbols": "4.1.0", - "minimatch": "4.2.1", + "minimatch": "5.0.1", "ms": "2.1.3", - "nanoid": "3.3.1", + "nanoid": "3.3.3", "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", - "which": "2.0.2", - "workerpool": "6.2.0", + "workerpool": "6.2.1", "yargs": "16.2.0", "yargs-parser": "20.2.4", "yargs-unparser": "2.0.0" @@ -4430,9 +4422,9 @@ } }, "debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "requires": { "ms": "2.1.2" @@ -4570,12 +4562,23 @@ } }, "minimatch": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", - "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", "dev": true, "requires": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + } } }, "p-limit": { @@ -4651,15 +4654,6 @@ "is-number": "^7.0.0" } }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, "wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -4726,9 +4720,9 @@ "optional": true }, "nanoid": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", - "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", + "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", "dev": true }, "nanomatch": { @@ -6685,9 +6679,9 @@ "dev": true }, "workerpool": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz", - "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", + "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", "dev": true }, "wrap-ansi": { From eca1b4586c962442b6f79e91453556b518148eea Mon Sep 17 00:00:00 2001 From: csigs Date: Sun, 1 May 2022 05:48:19 -0700 Subject: [PATCH 38/63] LEGO: Merge pull request 48909 LEGO: Merge pull request 48909 --- .../diagnosticMessages.generated.json.lcl | 39 +++++++++---------- .../diagnosticMessages.generated.json.lcl | 39 +++++++++---------- .../diagnosticMessages.generated.json.lcl | 39 +++++++++---------- .../diagnosticMessages.generated.json.lcl | 39 +++++++++---------- .../diagnosticMessages.generated.json.lcl | 39 +++++++++---------- .../diagnosticMessages.generated.json.lcl | 39 +++++++++---------- .../diagnosticMessages.generated.json.lcl | 39 +++++++++---------- .../diagnosticMessages.generated.json.lcl | 39 +++++++++---------- 8 files changed, 144 insertions(+), 168 deletions(-) diff --git a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl index 61a90c1c4d7..b20a7942045 100644 --- a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5349,18 +5349,6 @@ - - - - - - - - - - - - @@ -5997,6 +5985,15 @@ + + + + + + + + + @@ -13740,6 +13737,15 @@ + + + + + + + + + @@ -13977,15 +13983,6 @@ - - - - - - - - - diff --git a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl index 22eb8d6477c..f6b570fc6ff 100644 --- a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5349,18 +5349,6 @@ - - - - - - - - - - - - @@ -5997,6 +5985,15 @@ + + + + + + + + + @@ -13740,6 +13737,15 @@ + + + + + + + + + @@ -13977,15 +13983,6 @@ - - - - - - - - - diff --git a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl index 1647e0bb4d6..f614e8f1932 100644 --- a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5358,18 +5358,6 @@ - - - - - - - - - - - - @@ -6006,6 +5994,15 @@ + + + + + + + + + @@ -13749,6 +13746,15 @@ + + + + + + + + + @@ -13986,15 +13992,6 @@ - - - - - - - - - diff --git a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl index bd874578a99..e2263e2549d 100644 --- a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5361,18 +5361,6 @@ - - - - - - - - - - - - @@ -6009,6 +5997,15 @@ + + + + + + + + + @@ -13752,6 +13749,15 @@ + + + + + + + + + @@ -13989,15 +13995,6 @@ - - - - - - - - - diff --git a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl index c626ecc1200..372de213b24 100644 --- a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5349,18 +5349,6 @@ - - - - - - - - - - - - @@ -5997,6 +5985,15 @@ + + + + + + + + + @@ -13740,6 +13737,15 @@ + + + + + + + + + @@ -13977,15 +13983,6 @@ - - - - - - - - - diff --git a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl index 76e9e04018e..fb0bd7b0c44 100644 --- a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5349,18 +5349,6 @@ - - - - - - - - - - - - @@ -5997,6 +5985,15 @@ + + + + + + + + + @@ -13740,6 +13737,15 @@ + + + + + + + + + @@ -13977,15 +13983,6 @@ - - - - - - - - - diff --git a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl index 1508ab03620..303d5413039 100644 --- a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5342,18 +5342,6 @@ - - - - - - - - - - - - @@ -5990,6 +5978,15 @@ + + + + + + + + + @@ -13730,6 +13727,15 @@ + + + + + + + + + @@ -13967,15 +13973,6 @@ - - - - - - - - - diff --git a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl index 5dfe3d58385..2e8bc37a128 100644 --- a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5348,18 +5348,6 @@ - - - - - - - - - - - - @@ -5996,6 +5984,15 @@ + + + + + + + + + @@ -13739,6 +13736,15 @@ + + + + + + + + + @@ -13976,15 +13982,6 @@ - - - - - - - - - From 7cb88464deb0d081c628b3ef343915b78723c32c Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Mon, 2 May 2022 06:06:36 +0000 Subject: [PATCH 39/63] Update package-lock.json --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1171d5f813b..46831288f2d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -638,9 +638,9 @@ "dev": true }, "@types/node": { - "version": "17.0.30", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.30.tgz", - "integrity": "sha512-oNBIZjIqyHYP8VCNAV9uEytXVeXG2oR0w9lgAXro20eugRQfY002qr3CUl6BAe+Yf/z3CRjPdz27Pu6WWtuSRw==", + "version": "17.0.31", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.31.tgz", + "integrity": "sha512-AR0x5HbXGqkEx9CadRH3EBYx/VkiUgZIhP4wvPn/+5KIsgpNoyFaRlVe0Zlx9gRtg8fA06a9tskE2MSN7TcG4Q==", "dev": true }, "@types/node-fetch": { From 6834969f8f20d0cf64a40cc8d146a1be3d5440b0 Mon Sep 17 00:00:00 2001 From: csigs Date: Mon, 2 May 2022 06:37:43 -0700 Subject: [PATCH 40/63] LEGO: Merge pull request 48913 LEGO: Merge pull request 48913 --- .../diagnosticMessages.generated.json.lcl | 39 +++++++++---------- .../diagnosticMessages.generated.json.lcl | 39 +++++++++---------- .../diagnosticMessages.generated.json.lcl | 39 +++++++++---------- .../diagnosticMessages.generated.json.lcl | 39 +++++++++---------- .../diagnosticMessages.generated.json.lcl | 39 +++++++++---------- 5 files changed, 90 insertions(+), 105 deletions(-) diff --git a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl index c64af472bcb..33b4db6a78c 100644 --- a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5346,18 +5346,6 @@ - - - - - - - - - - - - @@ -5994,6 +5982,15 @@ + + + + + + + + + @@ -13734,6 +13731,15 @@ + + + + + + + + + @@ -13971,15 +13977,6 @@ - - - - - - - - - diff --git a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl index b6c18f4a981..0892782e82d 100644 --- a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5361,18 +5361,6 @@ - - - - - - - - - - - - @@ -6009,6 +5997,15 @@ + + + + + + + + + @@ -13752,6 +13749,15 @@ + + + + + + + + + @@ -13989,15 +13995,6 @@ - - - - - - - - - diff --git a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl index beb4187452a..e222b1f13d7 100644 --- a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5349,18 +5349,6 @@ - - - - - - - - - - - - @@ -5997,6 +5985,15 @@ + + + + + + + + + @@ -13740,6 +13737,15 @@ + + + + + + + + + @@ -13977,15 +13983,6 @@ - - - - - - - - - diff --git a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 1e9219f3e25..102654a92b6 100644 --- a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5339,18 +5339,6 @@ - - - - - - - - - - - - @@ -5987,6 +5975,15 @@ + + + + + + + + + @@ -13727,6 +13724,15 @@ + + + + + + + + + @@ -13964,15 +13970,6 @@ - - - - - - - - - diff --git a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 280067f85e8..9ae2836efbf 100644 --- a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5342,18 +5342,6 @@ - - - - - - - - - - - - @@ -5990,6 +5978,15 @@ + + + + + + + + + @@ -13733,6 +13730,15 @@ + + + + + + + + + @@ -13970,15 +13976,6 @@ - - - - - - - - - From 63a941dc2af51c45d6ba8f418011be14fa02fbdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Mon, 2 May 2022 21:27:49 +0200 Subject: [PATCH 41/63] Add a regression test for completion list in object literal involving inferred obj with optional members (#48910) --- .../completionListInObjectLiteral8.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/cases/fourslash/completionListInObjectLiteral8.ts diff --git a/tests/cases/fourslash/completionListInObjectLiteral8.ts b/tests/cases/fourslash/completionListInObjectLiteral8.ts new file mode 100644 index 00000000000..11b8a1844d4 --- /dev/null +++ b/tests/cases/fourslash/completionListInObjectLiteral8.ts @@ -0,0 +1,18 @@ +/// + +////declare function test< +//// Variants extends Partial>, +////>(v: Variants): void +//// +////test({ +//// hover: "", +//// /**/ +////}); + +verify.completions({ + marker: '', + exact: [{ + name: 'pressed', + sortText: completion.SortText.OptionalMember + }] +}); From e73d7556688977405f0397665d7634673f88bd26 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Mon, 2 May 2022 12:50:24 -0700 Subject: [PATCH 42/63] Fix formatter's processChildNodes (#48921) processChildNodes needs to skip processing when the node array is outside the target range, just like processChildNode already does for a single node. Fixes #48006 --- src/services/formatting/formatting.ts | 7 +++++++ src/services/formatting/formattingScanner.ts | 4 ++-- tests/cases/fourslash/formatAfterPasteInString.ts | 9 +++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 tests/cases/fourslash/formatAfterPasteInString.ts diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index 5a9948cd35f..cc5e2b6c41c 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -778,6 +778,13 @@ namespace ts.formatting { let listDynamicIndentation = parentDynamicIndentation; let startLine = parentStartLine; + // node range is outside the target range - do not dive inside + if (!rangeOverlapsWithStartEnd(originalRange, nodes.pos, nodes.end)) { + if (nodes.end < originalRange.pos) { + formattingScanner.skipToEndOf(nodes); + } + return; + } if (listStartToken !== SyntaxKind.Unknown) { // introduce a new indentation scope for lists (including list start and end tokens) diff --git a/src/services/formatting/formattingScanner.ts b/src/services/formatting/formattingScanner.ts index 05bbc340416..56ad87770ba 100644 --- a/src/services/formatting/formattingScanner.ts +++ b/src/services/formatting/formattingScanner.ts @@ -12,7 +12,7 @@ namespace ts.formatting { readEOFTokenRange(): TextRangeWithKind; getCurrentLeadingTrivia(): TextRangeWithKind[] | undefined; lastTrailingTriviaWasNewLine(): boolean; - skipToEndOf(node: Node): void; + skipToEndOf(node: Node | NodeArray): void; skipToStartOf(node: Node): void; } @@ -286,7 +286,7 @@ namespace ts.formatting { return tokenInfo; } - function skipToEndOf(node: Node): void { + function skipToEndOf(node: Node | NodeArray): void { scanner.setTextPos(node.end); savedPos = scanner.getStartPos(); lastScanAction = undefined; diff --git a/tests/cases/fourslash/formatAfterPasteInString.ts b/tests/cases/fourslash/formatAfterPasteInString.ts new file mode 100644 index 00000000000..716af9183bb --- /dev/null +++ b/tests/cases/fourslash/formatAfterPasteInString.ts @@ -0,0 +1,9 @@ +/// + +//// /*2*/const x = f('aa/*1*/a').x() + +goTo.marker('1'); +edit.paste("bb"); +format.document(); +goTo.marker('2'); +verify.currentLineContentIs("const x = f('aabba').x()"); From bb887ea1f2e5b46d5fa038a16d8c9c2f7aa27adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=A3=E9=87=8C=E5=A5=BD=E8=84=8F=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5?= <453491931@qq.com> Date: Tue, 3 May 2022 04:21:37 +0800 Subject: [PATCH 43/63] fix(48557): Add missing JSDoc parameters (#48560) * Fix jsdoc of some `DataView` method. * Add author by 'Fix jsdoc of some `DataView` method'. * Fix jsdoc of some `DataView` method. change 'written' to 'read' by `getXXX` methods, and remove 'otherwise' by every method which has `littleEndian` param. * Fix jsdoc of some `DataView` method in `es2020.bigint.d.ts`. change 'written' to 'read' by `getXXX` methods, and remove 'otherwise' by every method which has `littleEndian` param. --- AUTHORS.md | 1 + src/lib/es2020.bigint.d.ts | 8 ++++---- src/lib/es5.d.ts | 24 ++++++++++++------------ 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index b58f1a31efd..e02b495d242 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -169,6 +169,7 @@ TypeScript is authored by: - Gabriel Isenberg - Gabriela Araujo Britto - Gabriela Britto + - Gao Sheng - gb714us - Gilad Peleg - Godfrey Chan diff --git a/src/lib/es2020.bigint.d.ts b/src/lib/es2020.bigint.d.ts index 50a10c7b33e..e13da87bc71 100644 --- a/src/lib/es2020.bigint.d.ts +++ b/src/lib/es2020.bigint.d.ts @@ -673,6 +673,7 @@ interface DataView { * Gets the BigInt64 value at the specified byte offset from the start of the view. There is * no alignment constraint; multi-byte values may be fetched from any offset. * @param byteOffset The place in the buffer at which the value should be retrieved. + * @param littleEndian If false or undefined, a big-endian value should be read. */ getBigInt64(byteOffset: number, littleEndian?: boolean): bigint; @@ -680,6 +681,7 @@ interface DataView { * Gets the BigUint64 value at the specified byte offset from the start of the view. There is * no alignment constraint; multi-byte values may be fetched from any offset. * @param byteOffset The place in the buffer at which the value should be retrieved. + * @param littleEndian If false or undefined, a big-endian value should be read. */ getBigUint64(byteOffset: number, littleEndian?: boolean): bigint; @@ -687,8 +689,7 @@ interface DataView { * Stores a BigInt64 value at the specified byte offset from the start of the view. * @param byteOffset The place in the buffer at which the value should be set. * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. + * @param littleEndian If false or undefined, a big-endian value should be written. */ setBigInt64(byteOffset: number, value: bigint, littleEndian?: boolean): void; @@ -696,8 +697,7 @@ interface DataView { * Stores a BigUint64 value at the specified byte offset from the start of the view. * @param byteOffset The place in the buffer at which the value should be set. * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. + * @param littleEndian If false or undefined, a big-endian value should be written. */ setBigUint64(byteOffset: number, value: bigint, littleEndian?: boolean): void; } diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index d4d0bf3ffa0..3ee69f61a02 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -1669,6 +1669,7 @@ interface DataView { * Gets the Float32 value at the specified byte offset from the start of the view. There is * no alignment constraint; multi-byte values may be fetched from any offset. * @param byteOffset The place in the buffer at which the value should be retrieved. + * @param littleEndian If false or undefined, a big-endian value should be read. */ getFloat32(byteOffset: number, littleEndian?: boolean): number; @@ -1676,6 +1677,7 @@ interface DataView { * Gets the Float64 value at the specified byte offset from the start of the view. There is * no alignment constraint; multi-byte values may be fetched from any offset. * @param byteOffset The place in the buffer at which the value should be retrieved. + * @param littleEndian If false or undefined, a big-endian value should be read. */ getFloat64(byteOffset: number, littleEndian?: boolean): number; @@ -1690,12 +1692,14 @@ interface DataView { * Gets the Int16 value at the specified byte offset from the start of the view. There is * no alignment constraint; multi-byte values may be fetched from any offset. * @param byteOffset The place in the buffer at which the value should be retrieved. + * @param littleEndian If false or undefined, a big-endian value should be read. */ getInt16(byteOffset: number, littleEndian?: boolean): number; /** * Gets the Int32 value at the specified byte offset from the start of the view. There is * no alignment constraint; multi-byte values may be fetched from any offset. * @param byteOffset The place in the buffer at which the value should be retrieved. + * @param littleEndian If false or undefined, a big-endian value should be read. */ getInt32(byteOffset: number, littleEndian?: boolean): number; @@ -1710,6 +1714,7 @@ interface DataView { * Gets the Uint16 value at the specified byte offset from the start of the view. There is * no alignment constraint; multi-byte values may be fetched from any offset. * @param byteOffset The place in the buffer at which the value should be retrieved. + * @param littleEndian If false or undefined, a big-endian value should be read. */ getUint16(byteOffset: number, littleEndian?: boolean): number; @@ -1717,6 +1722,7 @@ interface DataView { * Gets the Uint32 value at the specified byte offset from the start of the view. There is * no alignment constraint; multi-byte values may be fetched from any offset. * @param byteOffset The place in the buffer at which the value should be retrieved. + * @param littleEndian If false or undefined, a big-endian value should be read. */ getUint32(byteOffset: number, littleEndian?: boolean): number; @@ -1724,8 +1730,7 @@ interface DataView { * Stores an Float32 value at the specified byte offset from the start of the view. * @param byteOffset The place in the buffer at which the value should be set. * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. + * @param littleEndian If false or undefined, a big-endian value should be written. */ setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; @@ -1733,8 +1738,7 @@ interface DataView { * Stores an Float64 value at the specified byte offset from the start of the view. * @param byteOffset The place in the buffer at which the value should be set. * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. + * @param littleEndian If false or undefined, a big-endian value should be written. */ setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; @@ -1749,8 +1753,7 @@ interface DataView { * Stores an Int16 value at the specified byte offset from the start of the view. * @param byteOffset The place in the buffer at which the value should be set. * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. + * @param littleEndian If false or undefined, a big-endian value should be written. */ setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; @@ -1758,8 +1761,7 @@ interface DataView { * Stores an Int32 value at the specified byte offset from the start of the view. * @param byteOffset The place in the buffer at which the value should be set. * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. + * @param littleEndian If false or undefined, a big-endian value should be written. */ setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; @@ -1774,8 +1776,7 @@ interface DataView { * Stores an Uint16 value at the specified byte offset from the start of the view. * @param byteOffset The place in the buffer at which the value should be set. * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. + * @param littleEndian If false or undefined, a big-endian value should be written. */ setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; @@ -1783,8 +1784,7 @@ interface DataView { * Stores an Uint32 value at the specified byte offset from the start of the view. * @param byteOffset The place in the buffer at which the value should be set. * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, - * otherwise a little-endian value should be written. + * @param littleEndian If false or undefined, a big-endian value should be written. */ setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; } From 3b8b2078a32894e0d66cc556c1fa7912f4540c09 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 2 May 2022 15:49:16 -0700 Subject: [PATCH 44/63] Temporarily revert unconstrained type parameter strictness in TS 4.7 (#48923) * Revert a change around allowing unconstrained type parameters to '{}'. * Accepted baselines. --- src/compiler/checker.ts | 9 +- src/compiler/diagnosticMessages.json | 4 - ...UnboundedTypeParamAssignability.errors.txt | 10 +- .../keyofAndIndexedAccess.errors.txt | 709 ------------------ .../mappedTypesAndObjects.errors.txt | 54 -- .../tsxNotUsingApparentTypeOfSFC.errors.txt | 22 +- .../reference/unknownType1.errors.txt | 6 +- 7 files changed, 6 insertions(+), 808 deletions(-) delete mode 100644 tests/baselines/reference/keyofAndIndexedAccess.errors.txt delete mode 100644 tests/baselines/reference/mappedTypesAndObjects.errors.txt diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5efefc51d24..5a1f6f440fe 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -18772,9 +18772,6 @@ namespace ts { return; } reportRelationError(headMessage, source, target); - if (strictNullChecks && source.flags & TypeFlags.TypeVariable && source.symbol?.declarations?.[0] && !getConstraintOfType(source as TypeVariable) && isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~TypeFlags.NonPrimitive))) { - associateRelatedInfo(createDiagnosticForNode(source.symbol.declarations[0], Diagnostics.This_type_parameter_probably_needs_an_extends_object_constraint)); - } } function traceUnionsOrIntersectionsTooLarge(source: Type, target: Type): void { @@ -19565,7 +19562,7 @@ namespace ts { // IndexedAccess comparisons are handled above in the `targetFlags & TypeFlage.IndexedAccess` branch if (!(sourceFlags & TypeFlags.IndexedAccess && targetFlags & TypeFlags.IndexedAccess)) { const constraint = getConstraintOfType(source as TypeVariable); - if (!strictNullChecks && (!constraint || (sourceFlags & TypeFlags.TypeParameter && constraint.flags & TypeFlags.Any))) { + if (!constraint || (sourceFlags & TypeFlags.TypeParameter && constraint.flags & TypeFlags.Any)) { // A type variable with no constraint is not related to the non-primitive object type. if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~TypeFlags.NonPrimitive), RecursionFlags.Both)) { resetErrorInfo(saveErrorInfo); @@ -19573,12 +19570,12 @@ namespace ts { } } // hi-speed no-this-instantiation check (less accurate, but avoids costly `this`-instantiation when the constraint will suffice), see #28231 for report on why this is needed - else if (constraint && (result = isRelatedTo(constraint, target, RecursionFlags.Source, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState))) { + else if (result = isRelatedTo(constraint, target, RecursionFlags.Source, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) { resetErrorInfo(saveErrorInfo); return result; } // slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example - else if (constraint && (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, RecursionFlags.Source, reportErrors && !(targetFlags & sourceFlags & TypeFlags.TypeParameter), /*headMessage*/ undefined, intersectionState))) { + else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, RecursionFlags.Source, reportErrors && !(targetFlags & sourceFlags & TypeFlags.TypeParameter), /*headMessage*/ undefined, intersectionState)) { resetErrorInfo(saveErrorInfo); return result; } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 22c923012aa..207b23d7013 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1506,10 +1506,6 @@ "category": "Error", "code": 2207 }, - "This type parameter probably needs an `extends object` constraint.": { - "category": "Error", - "code": 2208 - }, "Duplicate identifier '{0}'.": { "category": "Error", diff --git a/tests/baselines/reference/genericUnboundedTypeParamAssignability.errors.txt b/tests/baselines/reference/genericUnboundedTypeParamAssignability.errors.txt index 6d7b87ebd33..b00dfc3c328 100644 --- a/tests/baselines/reference/genericUnboundedTypeParamAssignability.errors.txt +++ b/tests/baselines/reference/genericUnboundedTypeParamAssignability.errors.txt @@ -1,10 +1,8 @@ tests/cases/compiler/genericUnboundedTypeParamAssignability.ts(2,5): error TS2339: Property 'toString' does not exist on type 'T'. -tests/cases/compiler/genericUnboundedTypeParamAssignability.ts(15,6): error TS2345: Argument of type 'T' is not assignable to parameter of type '{}'. -tests/cases/compiler/genericUnboundedTypeParamAssignability.ts(16,6): error TS2345: Argument of type 'T' is not assignable to parameter of type 'Record'. tests/cases/compiler/genericUnboundedTypeParamAssignability.ts(17,5): error TS2339: Property 'toString' does not exist on type 'T'. -==== tests/cases/compiler/genericUnboundedTypeParamAssignability.ts (4 errors) ==== +==== tests/cases/compiler/genericUnboundedTypeParamAssignability.ts (2 errors) ==== function f1(o: T) { o.toString(); // error ~~~~~~~~ @@ -22,13 +20,7 @@ tests/cases/compiler/genericUnboundedTypeParamAssignability.ts(17,5): error TS23 function user(t: T) { f1(t); f2(t); // error in strict, unbounded T doesn't satisfy the constraint - ~ -!!! error TS2345: Argument of type 'T' is not assignable to parameter of type '{}'. -!!! related TS2208 tests/cases/compiler/genericUnboundedTypeParamAssignability.ts:13:15: This type parameter probably needs an `extends object` constraint. f3(t); // error in strict, unbounded T doesn't satisfy the constraint - ~ -!!! error TS2345: Argument of type 'T' is not assignable to parameter of type 'Record'. -!!! related TS2208 tests/cases/compiler/genericUnboundedTypeParamAssignability.ts:13:15: This type parameter probably needs an `extends object` constraint. t.toString(); // error, for the same reason as f1() ~~~~~~~~ !!! error TS2339: Property 'toString' does not exist on type 'T'. diff --git a/tests/baselines/reference/keyofAndIndexedAccess.errors.txt b/tests/baselines/reference/keyofAndIndexedAccess.errors.txt deleted file mode 100644 index f5c436bbf1d..00000000000 --- a/tests/baselines/reference/keyofAndIndexedAccess.errors.txt +++ /dev/null @@ -1,709 +0,0 @@ -tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts(316,5): error TS2322: Type 'T' is not assignable to type '{}'. -tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts(317,5): error TS2322: Type 'T[keyof T]' is not assignable to type '{}'. - Type 'T[string] | T[number] | T[symbol]' is not assignable to type '{}'. - Type 'T[string]' is not assignable to type '{}'. -tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts(318,5): error TS2322: Type 'T[K]' is not assignable to type '{}'. - Type 'T[keyof T]' is not assignable to type '{}'. -tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts(323,5): error TS2322: Type 'T' is not assignable to type '{} | null | undefined'. -tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts(324,5): error TS2322: Type 'T[keyof T]' is not assignable to type '{} | null | undefined'. - Type 'T[string] | T[number] | T[symbol]' is not assignable to type '{} | null | undefined'. - Type 'T[string]' is not assignable to type '{} | null | undefined'. -tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts(325,5): error TS2322: Type 'T[K]' is not assignable to type '{} | null | undefined'. - Type 'T[keyof T]' is not assignable to type '{} | null | undefined'. -tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts(611,33): error TS2345: Argument of type 'T[K]' is not assignable to parameter of type '{} | null | undefined'. - Type 'T[keyof T]' is not assignable to type '{} | null | undefined'. - Type 'T[string] | T[number] | T[symbol]' is not assignable to type '{} | null | undefined'. - Type 'T[string]' is not assignable to type '{} | null | undefined'. -tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts(619,13): error TS2322: Type 'T[keyof T]' is not assignable to type '{} | null | undefined'. - Type 'T[string] | T[number] | T[symbol]' is not assignable to type '{} | null | undefined'. - Type 'T[string]' is not assignable to type '{} | null | undefined'. - - -==== tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts (8 errors) ==== - class Shape { - name: string; - width: number; - height: number; - visible: boolean; - } - - class TaggedShape extends Shape { - tag: string; - } - - class Item { - name: string; - price: number; - } - - class Options { - visible: "yes" | "no"; - } - - type Dictionary = { [x: string]: T }; - type NumericallyIndexed = { [x: number]: T }; - - const enum E { A, B, C } - - type K00 = keyof any; // string - type K01 = keyof string; // "toString" | "charAt" | ... - type K02 = keyof number; // "toString" | "toFixed" | "toExponential" | ... - type K03 = keyof boolean; // "valueOf" - type K04 = keyof void; // never - type K05 = keyof undefined; // never - type K06 = keyof null; // never - type K07 = keyof never; // string | number | symbol - type K08 = keyof unknown; // never - - type K10 = keyof Shape; // "name" | "width" | "height" | "visible" - type K11 = keyof Shape[]; // "length" | "toString" | ... - type K12 = keyof Dictionary; // string - type K13 = keyof {}; // never - type K14 = keyof Object; // "constructor" | "toString" | ... - type K15 = keyof E; // "toString" | "toFixed" | "toExponential" | ... - type K16 = keyof [string, number]; // "0" | "1" | "length" | "toString" | ... - type K17 = keyof (Shape | Item); // "name" - type K18 = keyof (Shape & Item); // "name" | "width" | "height" | "visible" | "price" - type K19 = keyof NumericallyIndexed // never - - type KeyOf = keyof T; - - type K20 = KeyOf; // "name" | "width" | "height" | "visible" - type K21 = KeyOf>; // string - - type NAME = "name"; - type WIDTH_OR_HEIGHT = "width" | "height"; - - type Q10 = Shape["name"]; // string - type Q11 = Shape["width" | "height"]; // number - type Q12 = Shape["name" | "visible"]; // string | boolean - - type Q20 = Shape[NAME]; // string - type Q21 = Shape[WIDTH_OR_HEIGHT]; // number - - type Q30 = [string, number][0]; // string - type Q31 = [string, number][1]; // number - type Q32 = [string, number][number]; // string | number - type Q33 = [string, number][E.A]; // string - type Q34 = [string, number][E.B]; // number - type Q35 = [string, number]["0"]; // string - type Q36 = [string, number]["1"]; // string - - type Q40 = (Shape | Options)["visible"]; // boolean | "yes" | "no" - type Q41 = (Shape & Options)["visible"]; // true & "yes" | true & "no" | false & "yes" | false & "no" - - type Q50 = Dictionary["howdy"]; // Shape - type Q51 = Dictionary[123]; // Shape - type Q52 = Dictionary[E.B]; // Shape - - declare let cond: boolean; - - function getProperty(obj: T, key: K) { - return obj[key]; - } - - function setProperty(obj: T, key: K, value: T[K]) { - obj[key] = value; - } - - function f10(shape: Shape) { - let name = getProperty(shape, "name"); // string - let widthOrHeight = getProperty(shape, cond ? "width" : "height"); // number - let nameOrVisible = getProperty(shape, cond ? "name" : "visible"); // string | boolean - setProperty(shape, "name", "rectangle"); - setProperty(shape, cond ? "width" : "height", 10); - setProperty(shape, cond ? "name" : "visible", true); // Technically not safe - } - - function f11(a: Shape[]) { - let len = getProperty(a, "length"); // number - setProperty(a, "length", len); - } - - function f12(t: [Shape, boolean]) { - let len = getProperty(t, "length"); - let s2 = getProperty(t, "0"); // Shape - let b2 = getProperty(t, "1"); // boolean - } - - function f13(foo: any, bar: any) { - let x = getProperty(foo, "x"); // any - let y = getProperty(foo, "100"); // any - let z = getProperty(foo, bar); // any - } - - class Component { - props: PropType; - getProperty(key: K) { - return this.props[key]; - } - setProperty(key: K, value: PropType[K]) { - this.props[key] = value; - } - } - - function f20(component: Component) { - let name = component.getProperty("name"); // string - let widthOrHeight = component.getProperty(cond ? "width" : "height"); // number - let nameOrVisible = component.getProperty(cond ? "name" : "visible"); // string | boolean - component.setProperty("name", "rectangle"); - component.setProperty(cond ? "width" : "height", 10) - component.setProperty(cond ? "name" : "visible", true); // Technically not safe - } - - function pluck(array: T[], key: K) { - return array.map(x => x[key]); - } - - function f30(shapes: Shape[]) { - let names = pluck(shapes, "name"); // string[] - let widths = pluck(shapes, "width"); // number[] - let nameOrVisibles = pluck(shapes, cond ? "name" : "visible"); // (string | boolean)[] - } - - function f31(key: K) { - const shape: Shape = { name: "foo", width: 5, height: 10, visible: true }; - return shape[key]; // Shape[K] - } - - function f32(key: K) { - const shape: Shape = { name: "foo", width: 5, height: 10, visible: true }; - return shape[key]; // Shape[K] - } - - function f33(shape: S, key: K) { - let name = getProperty(shape, "name"); - let prop = getProperty(shape, key); - return prop; - } - - function f34(ts: TaggedShape) { - let tag1 = f33(ts, "tag"); - let tag2 = getProperty(ts, "tag"); - } - - class C { - public x: string; - protected y: string; - private z: string; - } - - // Indexed access expressions have always permitted access to private and protected members. - // For consistency we also permit such access in indexed access types. - function f40(c: C) { - type X = C["x"]; - type Y = C["y"]; - type Z = C["z"]; - let x: X = c["x"]; - let y: Y = c["y"]; - let z: Z = c["z"]; - } - - function f50(k: keyof T, s: string) { - const x1 = s as keyof T; - const x2 = k as string; - } - - function f51(k: K, s: string) { - const x1 = s as keyof T; - const x2 = k as string; - } - - function f52(obj: { [x: string]: boolean }, k: Exclude, s: string, n: number) { - const x1 = obj[s]; - const x2 = obj[n]; - const x3 = obj[k]; - } - - function f53>(obj: { [x: string]: boolean }, k: K, s: string, n: number) { - const x1 = obj[s]; - const x2 = obj[n]; - const x3 = obj[k]; - } - - function f54(obj: T, key: keyof T) { - for (let s in obj[key]) { - } - const b = "foo" in obj[key]; - } - - function f55(obj: T, key: K) { - for (let s in obj[key]) { - } - const b = "foo" in obj[key]; - } - - function f60(source: T, target: T) { - for (let k in source) { - target[k] = source[k]; - } - } - - function f70(func: (k1: keyof (T | U), k2: keyof (T & U)) => void) { - func<{ a: any, b: any }, { a: any, c: any }>('a', 'a'); - func<{ a: any, b: any }, { a: any, c: any }>('a', 'b'); - func<{ a: any, b: any }, { a: any, c: any }>('a', 'c'); - } - - function f71(func: (x: T, y: U) => Partial) { - let x = func({ a: 1, b: "hello" }, { c: true }); - x.a; // number | undefined - x.b; // string | undefined - x.c; // boolean | undefined - } - - function f72(func: (x: T, y: U, k: K) => (T & U)[K]) { - let a = func({ a: 1, b: "hello" }, { c: true }, 'a'); // number - let b = func({ a: 1, b: "hello" }, { c: true }, 'b'); // string - let c = func({ a: 1, b: "hello" }, { c: true }, 'c'); // boolean - } - - function f73(func: (x: T, y: U, k: K) => (T & U)[K]) { - let a = func({ a: 1, b: "hello" }, { c: true }, 'a'); // number - let b = func({ a: 1, b: "hello" }, { c: true }, 'b'); // string - let c = func({ a: 1, b: "hello" }, { c: true }, 'c'); // boolean - } - - function f74(func: (x: T, y: U, k: K) => (T | U)[K]) { - let a = func({ a: 1, b: "hello" }, { a: 2, b: true }, 'a'); // number - let b = func({ a: 1, b: "hello" }, { a: 2, b: true }, 'b'); // string | boolean - } - - function f80(obj: T) { - let a1 = obj.a; // { x: any } - let a2 = obj['a']; // { x: any } - let a3 = obj['a'] as T['a']; // T["a"] - let x1 = obj.a.x; // any - let x2 = obj['a']['x']; // any - let x3 = obj['a']['x'] as T['a']['x']; // T["a"]["x"] - } - - function f81(obj: T) { - return obj['a']['x'] as T['a']['x']; - } - - function f82() { - let x1 = f81({ a: { x: "hello" } }); // string - let x2 = f81({ a: { x: 42 } }); // number - } - - function f83(obj: T, key: K) { - return obj[key]['x'] as T[K]['x']; - } - - function f84() { - let x1 = f83({ foo: { x: "hello" } }, "foo"); // string - let x2 = f83({ bar: { x: 42 } }, "bar"); // number - } - - class C1 { - x: number; - get(key: K) { - return this[key]; - } - set(key: K, value: this[K]) { - this[key] = value; - } - foo() { - let x1 = this.x; // number - let x2 = this["x"]; // number - let x3 = this.get("x"); // this["x"] - let x4 = getProperty(this, "x"); // this["x"] - this.x = 42; - this["x"] = 42; - this.set("x", 42); - setProperty(this, "x", 42); - } - } - - type S2 = { - a: string; - b: string; - }; - - function f90(x1: S2[keyof S2], x2: T[keyof S2], x3: S2[K]) { - x1 = x2; - x1 = x3; - x2 = x1; - x2 = x3; - x3 = x1; - x3 = x2; - x1.length; - x2.length; - x3.length; - } - - function f91(x: T, y: T[keyof T], z: T[K]) { - let a: {}; - a = x; - ~ -!!! error TS2322: Type 'T' is not assignable to type '{}'. -!!! related TS2208 tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts:314:14: This type parameter probably needs an `extends object` constraint. - a = y; - ~ -!!! error TS2322: Type 'T[keyof T]' is not assignable to type '{}'. -!!! error TS2322: Type 'T[string] | T[number] | T[symbol]' is not assignable to type '{}'. -!!! error TS2322: Type 'T[string]' is not assignable to type '{}'. - a = z; - ~ -!!! error TS2322: Type 'T[K]' is not assignable to type '{}'. -!!! error TS2322: Type 'T[keyof T]' is not assignable to type '{}'. - } - - function f92(x: T, y: T[keyof T], z: T[K]) { - let a: {} | null | undefined; - a = x; - ~ -!!! error TS2322: Type 'T' is not assignable to type '{} | null | undefined'. -!!! related TS2208 tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts:321:14: This type parameter probably needs an `extends object` constraint. - a = y; - ~ -!!! error TS2322: Type 'T[keyof T]' is not assignable to type '{} | null | undefined'. -!!! error TS2322: Type 'T[string] | T[number] | T[symbol]' is not assignable to type '{} | null | undefined'. -!!! error TS2322: Type 'T[string]' is not assignable to type '{} | null | undefined'. - a = z; - ~ -!!! error TS2322: Type 'T[K]' is not assignable to type '{} | null | undefined'. -!!! error TS2322: Type 'T[keyof T]' is not assignable to type '{} | null | undefined'. - } - - // Repros from #12011 - - class Base { - get(prop: K) { - return this[prop]; - } - set(prop: K, value: this[K]) { - this[prop] = value; - } - } - - class Person extends Base { - parts: number; - constructor(parts: number) { - super(); - this.set("parts", parts); - } - getParts() { - return this.get("parts") - } - } - - class OtherPerson { - parts: number; - constructor(parts: number) { - setProperty(this, "parts", parts); - } - getParts() { - return getProperty(this, "parts") - } - } - - // Modified repro from #12544 - - function path(obj: T, key1: K1): T[K1]; - function path(obj: T, key1: K1, key2: K2): T[K1][K2]; - function path(obj: T, key1: K1, key2: K2, key3: K3): T[K1][K2][K3]; - function path(obj: any, ...keys: (string | number)[]): any; - function path(obj: any, ...keys: (string | number)[]): any { - let result = obj; - for (let k of keys) { - result = result[k]; - } - return result; - } - - type Thing = { - a: { x: number, y: string }, - b: boolean - }; - - - function f1(thing: Thing) { - let x1 = path(thing, 'a'); // { x: number, y: string } - let x2 = path(thing, 'a', 'y'); // string - let x3 = path(thing, 'b'); // boolean - let x4 = path(thing, ...['a', 'x']); // any - } - - // Repro from comment in #12114 - - const assignTo2 = (object: T, key1: K1, key2: K2) => - (value: T[K1][K2]) => object[key1][key2] = value; - - // Modified repro from #12573 - - declare function one(handler: (t: T) => void): T - var empty = one(() => {}) // inferred as {}, expected - - type Handlers = { [K in keyof T]: (t: T[K]) => void } - declare function on(handlerHash: Handlers): T - var hashOfEmpty1 = on({ test: () => {} }); // {} - var hashOfEmpty2 = on({ test: (x: boolean) => {} }); // { test: boolean } - - // Repro from #12624 - - interface Options1 { - data?: Data - computed?: Computed; - } - - declare class Component1 { - constructor(options: Options1); - get(key: K): (Data & Computed)[K]; - } - - let c1 = new Component1({ - data: { - hello: "" - } - }); - - c1.get("hello"); - - // Repro from #12625 - - interface Options2 { - data?: Data - computed?: Computed; - } - - declare class Component2 { - constructor(options: Options2); - get(key: K): (Data & Computed)[K]; - } - - // Repro from #12641 - - interface R { - p: number; - } - - function f(p: K) { - let a: any; - a[p].add; // any - } - - // Repro from #12651 - - type MethodDescriptor = { - name: string; - args: any[]; - returnValue: any; - } - - declare function dispatchMethod(name: M['name'], args: M['args']): M['returnValue']; - - type SomeMethodDescriptor = { - name: "someMethod"; - args: [string, number]; - returnValue: string[]; - } - - let result = dispatchMethod("someMethod", ["hello", 35]); - - // Repro from #13073 - - type KeyTypes = "a" | "b" - let MyThingy: { [key in KeyTypes]: string[] }; - - function addToMyThingy(key: S) { - MyThingy[key].push("a"); - } - - // Repro from #13102 - - type Handler = { - onChange: (name: keyof T) => void; - }; - - function onChangeGenericFunction(handler: Handler) { - handler.onChange('preset') - } - - // Repro from #13285 - - function updateIds, K extends string>( - obj: T, - idFields: K[], - idMapping: Partial> - ): Record { - for (const idField of idFields) { - const newId: T[K] | undefined = idMapping[obj[idField]]; - if (newId) { - obj[idField] = newId; - } - } - return obj; - } - - // Repro from #13285 - - function updateIds2( - obj: T, - key: K, - stringMap: { [oldId: string]: string } - ) { - var x = obj[key]; - stringMap[x]; // Should be OK. - } - - // Repro from #13514 - - declare function head>(list: T): T[0]; - - // Repro from #13604 - - class A { - props: T & { foo: string }; - } - - class B extends A<{ x: number}> { - f(p: this["props"]) { - p.x; - } - } - - // Repro from #13749 - - class Form { - private childFormFactories: {[K in keyof T]: (v: T[K]) => Form} - - public set(prop: K, value: T[K]) { - this.childFormFactories[prop](value) - } - } - - // Repro from #13787 - - class SampleClass

{ - public props: Readonly

; - constructor(props: P) { - this.props = Object.freeze(props); - } - } - - interface Foo { - foo: string; - } - - declare function merge(obj1: T, obj2: U): T & U; - - class AnotherSampleClass extends SampleClass { - constructor(props: T) { - const foo: Foo = { foo: "bar" }; - super(merge(props, foo)); - } - - public brokenMethod() { - this.props.foo.concat; - } - } - new AnotherSampleClass({}); - - // Positive repro from #17166 - function f3>(t: T, k: K, tk: T[K]): void { - for (let key in t) { - key = k // ok, K ==> keyof T - t[key] = tk; // ok, T[K] ==> T[keyof T] - } - } - - // # 21185 - type Predicates = { - [T in keyof TaggedRecord]: (variant: TaggedRecord[keyof TaggedRecord]) => variant is TaggedRecord[T] - } - - // Repros from #23592 - - type Example = { [K in keyof T]: T[K]["prop"] }; - type Result = Example<{ a: { prop: string }; b: { prop: number } }>; - - type Helper2 = { [K in keyof T]: Extract }; - type Example2 = { [K in keyof Helper2]: Helper2[K]["prop"] }; - type Result2 = Example2<{ 1: { prop: string }; 2: { prop: number } }>; - - // Repro from #23618 - - type DBBoolTable = { [k in K]: 0 | 1 } - enum Flag { - FLAG_1 = "flag_1", - FLAG_2 = "flag_2" - } - - type SimpleDBRecord = { staticField: number } & DBBoolTable - function getFlagsFromSimpleRecord(record: SimpleDBRecord, flags: Flag[]) { - return record[flags[0]]; - } - - type DynamicDBRecord = ({ dynamicField: number } | { dynamicField: string }) & DBBoolTable - function getFlagsFromDynamicRecord(record: DynamicDBRecord, flags: Flag[]) { - return record[flags[0]]; - } - - // Repro from #21368 - - interface I { - foo: string; - } - - declare function take(p: T): void; - - function fn(o: T, k: K) { - take<{} | null | undefined>(o[k]); - ~~~~ -!!! error TS2345: Argument of type 'T[K]' is not assignable to parameter of type '{} | null | undefined'. -!!! error TS2345: Type 'T[keyof T]' is not assignable to type '{} | null | undefined'. -!!! error TS2345: Type 'T[string] | T[number] | T[symbol]' is not assignable to type '{} | null | undefined'. -!!! error TS2345: Type 'T[string]' is not assignable to type '{} | null | undefined'. - take(o[k]); - } - - // Repro from #23133 - - class Unbounded { - foo(x: T[keyof T]) { - let y: {} | undefined | null = x; - ~ -!!! error TS2322: Type 'T[keyof T]' is not assignable to type '{} | null | undefined'. -!!! error TS2322: Type 'T[string] | T[number] | T[symbol]' is not assignable to type '{} | null | undefined'. -!!! error TS2322: Type 'T[string]' is not assignable to type '{} | null | undefined'. - } - } - - // Repro from #23940 - - interface I7 { - x: any; - } - type Foo7 = T; - declare function f7(type: K): Foo7; - - // Repro from #21770 - - type Dict = { [key in T]: number }; - type DictDict = { [key in V]: Dict }; - - function ff1(dd: DictDict, k1: V, k2: T): number { - return dd[k1][k2]; - } - - function ff2(dd: DictDict, k1: V, k2: T): number { - const d: Dict = dd[k1]; - return d[k2]; - } - - // Repro from #26409 - - const cf1 = (t: T, k: K) => - { - const s: string = t[k]; - t.cool; - }; - - const cf2 = (t: T, k: K) => - { - const s: string = t[k]; - t.cool; - }; - \ No newline at end of file diff --git a/tests/baselines/reference/mappedTypesAndObjects.errors.txt b/tests/baselines/reference/mappedTypesAndObjects.errors.txt deleted file mode 100644 index c32fc58b370..00000000000 --- a/tests/baselines/reference/mappedTypesAndObjects.errors.txt +++ /dev/null @@ -1,54 +0,0 @@ -tests/cases/conformance/types/mapped/mappedTypesAndObjects.ts(25,11): error TS2430: Interface 'E1' incorrectly extends interface 'Base'. - Types of property 'foo' are incompatible. - Type 'T' is not assignable to type '{ [key: string]: any; }'. - - -==== tests/cases/conformance/types/mapped/mappedTypesAndObjects.ts (1 errors) ==== - function f1(x: Partial, y: Readonly) { - let obj: {}; - obj = x; - obj = y; - } - - function f2(x: Partial, y: Readonly) { - let obj: { [x: string]: any }; - obj = x; - obj = y; - } - - function f3(x: Partial) { - x = {}; - } - - // Repro from #12900 - - interface Base { - foo: { [key: string]: any }; - bar: any; - baz: any; - } - - interface E1 extends Base { - ~~ -!!! error TS2430: Interface 'E1' incorrectly extends interface 'Base'. -!!! error TS2430: Types of property 'foo' are incompatible. -!!! error TS2430: Type 'T' is not assignable to type '{ [key: string]: any; }'. -!!! related TS2208 tests/cases/conformance/types/mapped/mappedTypesAndObjects.ts:25:14: This type parameter probably needs an `extends object` constraint. - foo: T; - } - - interface Something { name: string, value: string }; - interface E2 extends Base { - foo: Partial; // or other mapped type - } - - interface E3 extends Base { - foo: Partial; // or other mapped type - } - - // Repro from #13747 - - class Form { - private values: {[P in keyof T]?: T[P]} = {} - } - \ No newline at end of file diff --git a/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt b/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt index a967c92e555..81231a34562 100644 --- a/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt +++ b/tests/baselines/reference/tsxNotUsingApparentTypeOfSFC.errors.txt @@ -5,17 +5,9 @@ tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(15,14): error TS2769: No o Type '{}' is not assignable to type 'Readonly

'. Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error. Type '{}' is not assignable to type 'Readonly

'. -tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(17,14): error TS2322: Type 'P' is not assignable to type 'IntrinsicAttributes & P'. - Type 'P' is not assignable to type 'IntrinsicAttributes'. -tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(18,14): error TS2769: No overload matches this call. - Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. - Type 'P' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly

'. - Type 'P' is not assignable to type 'IntrinsicAttributes'. - Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error. - Type 'P' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly

'. -==== tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx (4 errors) ==== +==== tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx (2 errors) ==== /// import React from 'react'; @@ -42,17 +34,5 @@ tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx(18,14): error TS2769: No o !!! error TS2769: Type '{}' is not assignable to type 'Readonly

'. let z = // should work - ~~~~~ -!!! error TS2322: Type 'P' is not assignable to type 'IntrinsicAttributes & P'. -!!! error TS2322: Type 'P' is not assignable to type 'IntrinsicAttributes'. -!!! related TS2208 tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx:5:15: This type parameter probably needs an `extends object` constraint. let q = // should work - ~~~~~~~~~~~ -!!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 2, '(props: Readonly

): MyComponent', gave the following error. -!!! error TS2769: Type 'P' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly

'. -!!! error TS2769: Type 'P' is not assignable to type 'IntrinsicAttributes'. -!!! error TS2769: Overload 2 of 2, '(props: P, context?: any): MyComponent', gave the following error. -!!! error TS2769: Type 'P' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly

'. -!!! related TS2208 tests/cases/compiler/tsxNotUsingApparentTypeOfSFC.tsx:5:15: This type parameter probably needs an `extends object` constraint. } \ No newline at end of file diff --git a/tests/baselines/reference/unknownType1.errors.txt b/tests/baselines/reference/unknownType1.errors.txt index 39d7a1feb52..138fff847cc 100644 --- a/tests/baselines/reference/unknownType1.errors.txt +++ b/tests/baselines/reference/unknownType1.errors.txt @@ -25,14 +25,13 @@ tests/cases/conformance/types/unknown/unknownType1.ts(144,29): error TS2698: Spr tests/cases/conformance/types/unknown/unknownType1.ts(150,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/conformance/types/unknown/unknownType1.ts(156,14): error TS2700: Rest types may only be created from object types. tests/cases/conformance/types/unknown/unknownType1.ts(162,5): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor. -tests/cases/conformance/types/unknown/unknownType1.ts(170,9): error TS2322: Type 'T' is not assignable to type '{}'. tests/cases/conformance/types/unknown/unknownType1.ts(171,9): error TS2322: Type 'U' is not assignable to type '{}'. Type 'unknown' is not assignable to type '{}'. tests/cases/conformance/types/unknown/unknownType1.ts(181,5): error TS2322: Type 'T' is not assignable to type '{}'. Type 'unknown' is not assignable to type '{}'. -==== tests/cases/conformance/types/unknown/unknownType1.ts (28 errors) ==== +==== tests/cases/conformance/types/unknown/unknownType1.ts (27 errors) ==== // In an intersection everything absorbs unknown type T00 = unknown & null; // null @@ -255,9 +254,6 @@ tests/cases/conformance/types/unknown/unknownType1.ts(181,5): error TS2322: Type function f30(t: T, u: U) { let x: {} = t; - ~ -!!! error TS2322: Type 'T' is not assignable to type '{}'. -!!! related TS2208 tests/cases/conformance/types/unknown/unknownType1.ts:169:14: This type parameter probably needs an `extends object` constraint. let y: {} = u; ~ !!! error TS2322: Type 'U' is not assignable to type '{}'. From 8f56f6b49d2fb282ff95df64f62dab2947004e95 Mon Sep 17 00:00:00 2001 From: Gabriela Araujo Britto Date: Tue, 3 May 2022 11:32:44 -0300 Subject: [PATCH 45/63] Don't go past import in cross-project renaming (#48758) * WIP * fix cross-project renaming logic * only use configure if prefix opt is defined * refactor skipAlias into stopAtAlias * fix stopAtAlias * update another stopAtAlias location --- src/harness/client.ts | 18 +++++++++++++-- src/server/session.ts | 15 ++++++++----- src/services/goToDefinition.ts | 14 ++++++------ src/services/services.ts | 4 ++-- src/services/types.ts | 5 ++++- .../reference/renameNamedImport.baseline | 4 ++++ .../reference/renameNamespaceImport.baseline | 4 ++++ .../fourslash/server/renameNamedImport.ts | 22 +++++++++++++++++++ .../fourslash/server/renameNamespaceImport.ts | 22 +++++++++++++++++++ 9 files changed, 90 insertions(+), 18 deletions(-) create mode 100644 tests/baselines/reference/renameNamedImport.baseline create mode 100644 tests/baselines/reference/renameNamespaceImport.baseline create mode 100644 tests/cases/fourslash/server/renameNamedImport.ts create mode 100644 tests/cases/fourslash/server/renameNamespaceImport.ts diff --git a/src/harness/client.ts b/src/harness/client.ts index 388f6473fa8..7c8869995bb 100644 --- a/src/harness/client.ts +++ b/src/harness/client.ts @@ -38,6 +38,7 @@ namespace ts.server { private lineMaps = new Map(); private messages: string[] = []; private lastRenameEntry: RenameEntry | undefined; + private preferences: UserPreferences | undefined; constructor(private host: SessionClientHost) { } @@ -124,6 +125,7 @@ namespace ts.server { /*@internal*/ configure(preferences: UserPreferences) { + this.preferences = preferences; const args: protocol.ConfigureRequestArguments = { preferences }; const request = this.processRequest(CommandNames.Configure, args); this.processResponse(request, /*expectEmptyBody*/ true); @@ -488,13 +490,25 @@ namespace ts.server { return notImplemented(); } - findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[] { + findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, providePrefixAndSuffixTextForRename?: boolean): RenameLocation[] { if (!this.lastRenameEntry || this.lastRenameEntry.inputs.fileName !== fileName || this.lastRenameEntry.inputs.position !== position || this.lastRenameEntry.inputs.findInStrings !== findInStrings || this.lastRenameEntry.inputs.findInComments !== findInComments) { - this.getRenameInfo(fileName, position, { allowRenameOfImportPath: true }, findInStrings, findInComments); + if (providePrefixAndSuffixTextForRename !== undefined) { + // User preferences have to be set through the `Configure` command + this.configure({ providePrefixAndSuffixTextForRename }); + // Options argument is not used, so don't pass in options + this.getRenameInfo(fileName, position, /*options*/{}, findInStrings, findInComments); + // Restore previous user preferences + if (this.preferences) { + this.configure(this.preferences); + } + } + else { + this.getRenameInfo(fileName, position, /*options*/{}, findInStrings, findInComments); + } } return this.lastRenameEntry!.locations; diff --git a/src/server/session.ts b/src/server/session.ts index 3345f362eda..81f1dba1fad 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -317,6 +317,7 @@ namespace ts.server { projects, defaultProject, initialLocation, + /*isForRename*/ true, (project, location, tryAddToTodo) => { const projectOutputs = project.getLanguageService().findRenameLocations(location.fileName, location.pos, findInStrings, findInComments, providePrefixAndSuffixTextForRename); if (projectOutputs) { @@ -332,8 +333,8 @@ namespace ts.server { return outputs; } - function getDefinitionLocation(defaultProject: Project, initialLocation: DocumentPosition): DocumentPosition | undefined { - const infos = defaultProject.getLanguageService().getDefinitionAtPosition(initialLocation.fileName, initialLocation.pos); + function getDefinitionLocation(defaultProject: Project, initialLocation: DocumentPosition, isForRename: boolean): DocumentPosition | undefined { + const infos = defaultProject.getLanguageService().getDefinitionAtPosition(initialLocation.fileName, initialLocation.pos, /*searchOtherFilesOnly*/ false, isForRename); const info = infos && firstOrUndefined(infos); return info && !info.isLocal ? { fileName: info.fileName, pos: info.textSpan.start } : undefined; } @@ -350,6 +351,7 @@ namespace ts.server { projects, defaultProject, initialLocation, + /*isForRename*/ false, (project, location, getMappedLocation) => { logger.info(`Finding references to ${location.fileName} position ${location.pos} in project ${project.getProjectName()}`); const projectOutputs = project.getLanguageService().findReferences(location.fileName, location.pos); @@ -417,7 +419,8 @@ namespace ts.server { projects: Projects, defaultProject: Project, initialLocation: TLocation, - cb: CombineProjectOutputCallback + isForRename: boolean, + cb: CombineProjectOutputCallback, ): void { const projectService = defaultProject.projectService; let toDo: ProjectAndLocation[] | undefined; @@ -430,7 +433,7 @@ namespace ts.server { // After initial references are collected, go over every other project and see if it has a reference for the symbol definition. if (initialLocation) { - const defaultDefinition = getDefinitionLocation(defaultProject, initialLocation); + const defaultDefinition = getDefinitionLocation(defaultProject, initialLocation, isForRename); if (defaultDefinition) { const getGeneratedDefinition = memoize(() => defaultProject.isSourceOfProjectReferenceRedirect(defaultDefinition.fileName) ? defaultDefinition : @@ -1243,7 +1246,7 @@ namespace ts.server { definitions?.forEach(d => definitionSet.add(d)); const noDtsProject = project.getNoDtsResolutionProject([file]); const ls = noDtsProject.getLanguageService(); - const jsDefinitions = ls.getDefinitionAtPosition(file, position, /*searchOtherFilesOnly*/ true) + const jsDefinitions = ls.getDefinitionAtPosition(file, position, /*searchOtherFilesOnly*/ true, /*stopAtAlias*/ false) ?.filter(d => toNormalizedPath(d.fileName) !== file); if (some(jsDefinitions)) { for (const jsDefinition of jsDefinitions) { @@ -1330,7 +1333,7 @@ namespace ts.server { if ((isStringLiteralLike(initialNode) || isIdentifier(initialNode)) && isAccessExpression(initialNode.parent)) { return forEachNameInAccessChainWalkingLeft(initialNode, nameInChain => { if (nameInChain === initialNode) return undefined; - const candidates = ls.getDefinitionAtPosition(file, nameInChain.getStart(), /*searchOtherFilesOnly*/ true) + const candidates = ls.getDefinitionAtPosition(file, nameInChain.getStart(), /*searchOtherFilesOnly*/ true, /*stopAtAlias*/ false) ?.filter(d => toNormalizedPath(d.fileName) !== file && d.isAmbient) .map(d => ({ fileName: d.fileName, diff --git a/src/services/goToDefinition.ts b/src/services/goToDefinition.ts index b1c8ec28c1b..f9f742e65a4 100644 --- a/src/services/goToDefinition.ts +++ b/src/services/goToDefinition.ts @@ -1,6 +1,6 @@ /* @internal */ namespace ts.GoToDefinition { - export function getDefinitionAtPosition(program: Program, sourceFile: SourceFile, position: number, searchOtherFilesOnly?: boolean): readonly DefinitionInfo[] | undefined { + export function getDefinitionAtPosition(program: Program, sourceFile: SourceFile, position: number, searchOtherFilesOnly?: boolean, stopAtAlias?: boolean): readonly DefinitionInfo[] | undefined { const resolvedRef = getReferenceAtPosition(sourceFile, position, program); const fileReferenceDefinition = resolvedRef && [getDefinitionInfoForFileReference(resolvedRef.reference.fileName, resolvedRef.fileName, resolvedRef.unverified)] || emptyArray; if (resolvedRef?.file) { @@ -28,7 +28,7 @@ namespace ts.GoToDefinition { if (isStaticModifier(node) && isClassStaticBlockDeclaration(node.parent)) { const classDecl = node.parent.parent; - const { symbol, failedAliasResolution } = getSymbol(classDecl, typeChecker); + const { symbol, failedAliasResolution } = getSymbol(classDecl, typeChecker, stopAtAlias); const staticBlocks = filter(classDecl.members, isClassStaticBlockDeclaration); const containerName = symbol ? typeChecker.symbolToString(symbol, classDecl) : ""; @@ -40,7 +40,7 @@ namespace ts.GoToDefinition { }); } - let { symbol, failedAliasResolution } = getSymbol(node, typeChecker); + let { symbol, failedAliasResolution } = getSymbol(node, typeChecker, stopAtAlias); let fallbackNode = node; if (searchOtherFilesOnly && failedAliasResolution) { @@ -48,7 +48,7 @@ namespace ts.GoToDefinition { const importDeclaration = forEach([node, ...symbol?.declarations || emptyArray], n => findAncestor(n, isAnyImportOrBareOrAccessedRequire)); const moduleSpecifier = importDeclaration && tryGetModuleSpecifierFromDeclaration(importDeclaration); if (moduleSpecifier) { - ({ symbol, failedAliasResolution } = getSymbol(moduleSpecifier, typeChecker)); + ({ symbol, failedAliasResolution } = getSymbol(moduleSpecifier, typeChecker, stopAtAlias)); fallbackNode = moduleSpecifier; } } @@ -235,7 +235,7 @@ namespace ts.GoToDefinition { return definitionFromType(typeChecker.getTypeAtLocation(node.parent), typeChecker, node.parent, /*failedAliasResolution*/ false); } - const { symbol, failedAliasResolution } = getSymbol(node, typeChecker); + const { symbol, failedAliasResolution } = getSymbol(node, typeChecker, /*stopAtAlias*/ false); if (!symbol) return undefined; const typeAtLocation = typeChecker.getTypeOfSymbolAtLocation(symbol, node); @@ -292,14 +292,14 @@ namespace ts.GoToDefinition { return mapDefined(checker.getIndexInfosAtLocation(node), info => info.declaration && createDefinitionFromSignatureDeclaration(checker, info.declaration)); } - function getSymbol(node: Node, checker: TypeChecker) { + function getSymbol(node: Node, checker: TypeChecker, stopAtAlias: boolean | undefined) { const symbol = checker.getSymbolAtLocation(node); // If this is an alias, and the request came at the declaration location // get the aliased symbol instead. This allows for goto def on an import e.g. // import {A, B} from "mod"; // to jump to the implementation directly. let failedAliasResolution = false; - if (symbol?.declarations && symbol.flags & SymbolFlags.Alias && shouldSkipAlias(node, symbol.declarations[0])) { + if (symbol?.declarations && symbol.flags & SymbolFlags.Alias && !stopAtAlias && shouldSkipAlias(node, symbol.declarations[0])) { const aliased = checker.getAliasedSymbol(symbol); if (aliased.declarations) { return { symbol: aliased }; diff --git a/src/services/services.ts b/src/services/services.ts index 20373fa773e..ac731115beb 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1768,9 +1768,9 @@ namespace ts { } /// Goto definition - function getDefinitionAtPosition(fileName: string, position: number, searchOtherFilesOnly?: boolean): readonly DefinitionInfo[] | undefined { + function getDefinitionAtPosition(fileName: string, position: number, searchOtherFilesOnly?: boolean, stopAtAlias?: boolean): readonly DefinitionInfo[] | undefined { synchronizeHostData(); - return GoToDefinition.getDefinitionAtPosition(program, getValidSourceFile(fileName), position, searchOtherFilesOnly); + return GoToDefinition.getDefinitionAtPosition(program, getValidSourceFile(fileName), position, searchOtherFilesOnly, stopAtAlias); } function getDefinitionAndBoundSpan(fileName: string, position: number): DefinitionInfoAndBoundSpan | undefined { diff --git a/src/services/types.ts b/src/services/types.ts index 886546f5f06..385f351c6aa 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -474,7 +474,10 @@ namespace ts { /*@internal*/ // eslint-disable-next-line @typescript-eslint/unified-signatures - getDefinitionAtPosition(fileName: string, position: number, searchOtherFilesOnly: boolean): readonly DefinitionInfo[] | undefined; + getDefinitionAtPosition(fileName: string, position: number, searchOtherFilesOnly: false, stopAtAlias: boolean): readonly DefinitionInfo[] | undefined; + /*@internal*/ + // eslint-disable-next-line @typescript-eslint/unified-signatures + getDefinitionAtPosition(fileName: string, position: number, searchOtherFilesOnly: boolean, stopAtAlias: false): readonly DefinitionInfo[] | undefined; getDefinitionAtPosition(fileName: string, position: number): readonly DefinitionInfo[] | undefined; getDefinitionAndBoundSpan(fileName: string, position: number): DefinitionInfoAndBoundSpan | undefined; getTypeDefinitionAtPosition(fileName: string, position: number): readonly DefinitionInfo[] | undefined; diff --git a/tests/baselines/reference/renameNamedImport.baseline b/tests/baselines/reference/renameNamedImport.baseline new file mode 100644 index 00000000000..02abd21a3c7 --- /dev/null +++ b/tests/baselines/reference/renameNamedImport.baseline @@ -0,0 +1,4 @@ +/*====== /src/index.ts ======*/ + +import { [|RENAME|] } from '../lib/index'; +RENAME; diff --git a/tests/baselines/reference/renameNamespaceImport.baseline b/tests/baselines/reference/renameNamespaceImport.baseline new file mode 100644 index 00000000000..7ebef850ab5 --- /dev/null +++ b/tests/baselines/reference/renameNamespaceImport.baseline @@ -0,0 +1,4 @@ +/*====== /src/index.ts ======*/ + +import * as [|RENAME|] from '../lib/index'; +RENAME.someExportedVariable; diff --git a/tests/cases/fourslash/server/renameNamedImport.ts b/tests/cases/fourslash/server/renameNamedImport.ts new file mode 100644 index 00000000000..07ae2b93c8b --- /dev/null +++ b/tests/cases/fourslash/server/renameNamedImport.ts @@ -0,0 +1,22 @@ +/// + +// @Filename: /lib/tsconfig.json +//// {} + +// @Filename: /lib/index.ts +//// const unrelatedLocalVariable = 123; +//// export const someExportedVariable = unrelatedLocalVariable; + +// @Filename: /src/tsconfig.json +//// {} + +// @Filename: /src/index.ts +//// import { /*i*/someExportedVariable } from '../lib/index'; +//// someExportedVariable; + +// @Filename: /tsconfig.json +//// {} + +goTo.file("/lib/index.ts"); +goTo.file("/src/index.ts"); +verify.baselineRename("i", { providePrefixAndSuffixTextForRename: true }); diff --git a/tests/cases/fourslash/server/renameNamespaceImport.ts b/tests/cases/fourslash/server/renameNamespaceImport.ts new file mode 100644 index 00000000000..a4b98baa01c --- /dev/null +++ b/tests/cases/fourslash/server/renameNamespaceImport.ts @@ -0,0 +1,22 @@ +/// + +// @Filename: /lib/tsconfig.json +//// {} + +// @Filename: /lib/index.ts +//// const unrelatedLocalVariable = 123; +//// export const someExportedVariable = unrelatedLocalVariable; + +// @Filename: /src/tsconfig.json +//// {} + +// @Filename: /src/index.ts +//// import * as /*i*/lib from '../lib/index'; +//// lib.someExportedVariable; + +// @Filename: /tsconfig.json +//// {} + +goTo.file("/lib/index.ts"); +goTo.file("/src/index.ts"); +verify.baselineRename("i", {}); From 38c14606b4c971e293fd120a8d85d0723e703d31 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 3 May 2022 14:20:35 -0700 Subject: [PATCH 46/63] Fix blocking of recursive dependencies in getNarrowedTypeOfSymbol (#48941) * Better blocking of recursive dependencies in getNarrowedTypeOfSymbol * Add regression test --- src/compiler/checker.ts | 2 +- .../dependentDestructuredVariables.errors.txt | 334 ++++++++++++++++++ .../dependentDestructuredVariables.js | 29 ++ .../dependentDestructuredVariables.symbols | 46 +++ .../dependentDestructuredVariables.types | 64 ++++ .../dependentDestructuredVariables.ts | 15 + 6 files changed, 489 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/dependentDestructuredVariables.errors.txt diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5a1f6f440fe..67fea0acf54 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -25528,7 +25528,7 @@ namespace ts { if (isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) { const parent = declaration.parent.parent; if (parent.kind === SyntaxKind.VariableDeclaration && getCombinedNodeFlags(declaration) & NodeFlags.Const || parent.kind === SyntaxKind.Parameter) { - const links = getNodeLinks(location); + const links = getNodeLinks(parent); if (!(links.flags & NodeCheckFlags.InCheckIdentifier)) { links.flags |= NodeCheckFlags.InCheckIdentifier; const parentType = getTypeForBindingElementParent(parent, CheckMode.Normal); diff --git a/tests/baselines/reference/dependentDestructuredVariables.errors.txt b/tests/baselines/reference/dependentDestructuredVariables.errors.txt new file mode 100644 index 00000000000..fbddf80744c --- /dev/null +++ b/tests/baselines/reference/dependentDestructuredVariables.errors.txt @@ -0,0 +1,334 @@ +tests/cases/conformance/controlFlow/dependentDestructuredVariables.ts(314,5): error TS7022: 'value1' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. +tests/cases/conformance/controlFlow/dependentDestructuredVariables.ts(314,5): error TS7031: Binding element 'value1' implicitly has an 'any' type. + + +==== tests/cases/conformance/controlFlow/dependentDestructuredVariables.ts (2 errors) ==== + type Action = + | { kind: 'A', payload: number } + | { kind: 'B', payload: string }; + + function f10({ kind, payload }: Action) { + if (kind === 'A') { + payload.toFixed(); + } + if (kind === 'B') { + payload.toUpperCase(); + } + } + + function f11(action: Action) { + const { kind, payload } = action; + if (kind === 'A') { + payload.toFixed(); + } + if (kind === 'B') { + payload.toUpperCase(); + } + } + + function f12({ kind, payload }: Action) { + switch (kind) { + case 'A': + payload.toFixed(); + break; + case 'B': + payload.toUpperCase(); + break; + default: + payload; // never + } + } + + type Action2 = + | { kind: 'A', payload: number | undefined } + | { kind: 'B', payload: string | undefined }; + + function f20({ kind, payload }: Action2) { + if (payload) { + if (kind === 'A') { + payload.toFixed(); + } + if (kind === 'B') { + payload.toUpperCase(); + } + } + } + + function f21(action: Action2) { + const { kind, payload } = action; + if (payload) { + if (kind === 'A') { + payload.toFixed(); + } + if (kind === 'B') { + payload.toUpperCase(); + } + } + } + + function f22(action: Action2) { + if (action.payload) { + const { kind, payload } = action; + if (kind === 'A') { + payload.toFixed(); + } + if (kind === 'B') { + payload.toUpperCase(); + } + } + } + + function f23({ kind, payload }: Action2) { + if (payload) { + switch (kind) { + case 'A': + payload.toFixed(); + break; + case 'B': + payload.toUpperCase(); + break; + default: + payload; // never + } + } + } + + type Foo = + | { kind: 'A', isA: true } + | { kind: 'B', isA: false } + | { kind: 'C', isA: false }; + + function f30({ kind, isA }: Foo) { + if (kind === 'A') { + isA; // true + } + if (kind === 'B') { + isA; // false + } + if (kind === 'C') { + isA; // false + } + if (isA) { + kind; // 'A' + } + else { + kind; // 'B' | 'C' + } + } + + type Args = ['A', number] | ['B', string] + + function f40(...[kind, data]: Args) { + if (kind === 'A') { + data.toFixed(); + } + if (kind === 'B') { + data.toUpperCase(); + } + } + + // Repro from #35283 + + interface A { variant: 'a', value: T } + + interface B { variant: 'b', value: Array } + + type AB = A | B; + + declare function printValue(t: T): void; + + declare function printValueList(t: Array): void; + + function unrefined1(ab: AB): void { + const { variant, value } = ab; + if (variant === 'a') { + printValue(value); + } + else { + printValueList(value); + } + } + + // Repro from #38020 + + type Action3 = + | {type: 'add', payload: { toAdd: number } } + | {type: 'remove', payload: { toRemove: number } }; + + const reducerBroken = (state: number, { type, payload }: Action3) => { + switch (type) { + case 'add': + return state + payload.toAdd; + case 'remove': + return state - payload.toRemove; + } + } + + // Repro from #46143 + + declare var it: Iterator; + const { value, done } = it.next(); + if (!done) { + value; // number + } + + // Repro from #46658 + + declare function f50(cb: (...args: Args) => void): void + + f50((kind, data) => { + if (kind === 'A') { + data.toFixed(); + } + if (kind === 'B') { + data.toUpperCase(); + } + }); + + const f51: (...args: ['A', number] | ['B', string]) => void = (kind, payload) => { + if (kind === 'A') { + payload.toFixed(); + } + if (kind === 'B') { + payload.toUpperCase(); + } + }; + + const f52: (...args: ['A', number] | ['B']) => void = (kind, payload?) => { + if (kind === 'A') { + payload.toFixed(); + } + else { + payload; // undefined + } + }; + + declare function readFile(path: string, callback: (...args: [err: null, data: unknown[]] | [err: Error, data: undefined]) => void): void; + + readFile('hello', (err, data) => { + if (err === null) { + data.length; + } + else { + err.message; + } + }); + + type ReducerArgs = ["add", { a: number, b: number }] | ["concat", { firstArr: any[], secondArr: any[] }]; + + const reducer: (...args: ReducerArgs) => void = (op, args) => { + switch (op) { + case "add": + console.log(args.a + args.b); + break; + case "concat": + console.log(args.firstArr.concat(args.secondArr)); + break; + } + } + + reducer("add", { a: 1, b: 3 }); + reducer("concat", { firstArr: [1, 2], secondArr: [3, 4] }); + + // repro from https://github.com/microsoft/TypeScript/pull/47190#issuecomment-1057603588 + + type FooMethod = { + method(...args: + [type: "str", cb: (e: string) => void] | + [type: "num", cb: (e: number) => void] + ): void; + } + + let fooM: FooMethod = { + method(type, cb) { + if (type == 'num') { + cb(123) + } else { + cb("abc") + } + } + }; + + type FooAsyncMethod = { + method(...args: + [type: "str", cb: (e: string) => void] | + [type: "num", cb: (e: number) => void] + ): Promise; + } + + let fooAsyncM: FooAsyncMethod = { + async method(type, cb) { + if (type == 'num') { + cb(123) + } else { + cb("abc") + } + } + }; + + type FooGenMethod = { + method(...args: + [type: "str", cb: (e: string) => void] | + [type: "num", cb: (e: number) => void] + ): Generator; + } + + let fooGenM: FooGenMethod = { + *method(type, cb) { + if (type == 'num') { + cb(123) + } else { + cb("abc") + } + } + }; + + type FooAsyncGenMethod = { + method(...args: + [type: "str", cb: (e: string) => void] | + [type: "num", cb: (e: number) => void] + ): AsyncGenerator; + } + + let fooAsyncGenM: FooAsyncGenMethod = { + async *method(type, cb) { + if (type == 'num') { + cb(123) + } else { + cb("abc") + } + } + }; + + // Repro from #48345 + + type Func = (...args: T) => void; + + const f60: Func = (kind, payload) => { + if (kind === "a") { + payload.toFixed(); // error + } + if (kind === "b") { + payload.toUpperCase(); // error + } + }; + + // Repro from #48902 + + function foo({ + value1, + ~~~~~~ +!!! error TS7022: 'value1' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. + ~~~~~~ +!!! error TS7031: Binding element 'value1' implicitly has an 'any' type. + test1 = value1.test1, + test2 = value1.test2, + test3 = value1.test3, + test4 = value1.test4, + test5 = value1.test5, + test6 = value1.test6, + test7 = value1.test7, + test8 = value1.test8, + test9 = value1.test9 + }) {} + \ No newline at end of file diff --git a/tests/baselines/reference/dependentDestructuredVariables.js b/tests/baselines/reference/dependentDestructuredVariables.js index a9f2006ec1e..eab12767faf 100644 --- a/tests/baselines/reference/dependentDestructuredVariables.js +++ b/tests/baselines/reference/dependentDestructuredVariables.js @@ -308,6 +308,21 @@ const f60: Func = (kind, payload) => { payload.toUpperCase(); // error } }; + +// Repro from #48902 + +function foo({ + value1, + test1 = value1.test1, + test2 = value1.test2, + test3 = value1.test3, + test4 = value1.test4, + test5 = value1.test5, + test6 = value1.test6, + test7 = value1.test7, + test8 = value1.test8, + test9 = value1.test9 +}) {} //// [dependentDestructuredVariables.js] @@ -550,6 +565,8 @@ const f60 = (kind, payload) => { payload.toUpperCase(); // error } }; +// Repro from #48902 +function foo({ value1, test1 = value1.test1, test2 = value1.test2, test3 = value1.test3, test4 = value1.test4, test5 = value1.test5, test6 = value1.test6, test7 = value1.test7, test8 = value1.test8, test9 = value1.test9 }) { } //// [dependentDestructuredVariables.d.ts] @@ -667,3 +684,15 @@ declare type FooAsyncGenMethod = { declare let fooAsyncGenM: FooAsyncGenMethod; declare type Func = (...args: T) => void; declare const f60: Func; +declare function foo({ value1, test1, test2, test3, test4, test5, test6, test7, test8, test9 }: { + value1: any; + test1?: any; + test2?: any; + test3?: any; + test4?: any; + test5?: any; + test6?: any; + test7?: any; + test8?: any; + test9?: any; +}): void; diff --git a/tests/baselines/reference/dependentDestructuredVariables.symbols b/tests/baselines/reference/dependentDestructuredVariables.symbols index f859b5ee756..ccaaaa72fe9 100644 --- a/tests/baselines/reference/dependentDestructuredVariables.symbols +++ b/tests/baselines/reference/dependentDestructuredVariables.symbols @@ -784,3 +784,49 @@ const f60: Func = (kind, payload) => { } }; +// Repro from #48902 + +function foo({ +>foo : Symbol(foo, Decl(dependentDestructuredVariables.ts, 308, 2)) + + value1, +>value1 : Symbol(value1, Decl(dependentDestructuredVariables.ts, 312, 14)) + + test1 = value1.test1, +>test1 : Symbol(test1, Decl(dependentDestructuredVariables.ts, 313, 11)) +>value1 : Symbol(value1, Decl(dependentDestructuredVariables.ts, 312, 14)) + + test2 = value1.test2, +>test2 : Symbol(test2, Decl(dependentDestructuredVariables.ts, 314, 25)) +>value1 : Symbol(value1, Decl(dependentDestructuredVariables.ts, 312, 14)) + + test3 = value1.test3, +>test3 : Symbol(test3, Decl(dependentDestructuredVariables.ts, 315, 25)) +>value1 : Symbol(value1, Decl(dependentDestructuredVariables.ts, 312, 14)) + + test4 = value1.test4, +>test4 : Symbol(test4, Decl(dependentDestructuredVariables.ts, 316, 25)) +>value1 : Symbol(value1, Decl(dependentDestructuredVariables.ts, 312, 14)) + + test5 = value1.test5, +>test5 : Symbol(test5, Decl(dependentDestructuredVariables.ts, 317, 25)) +>value1 : Symbol(value1, Decl(dependentDestructuredVariables.ts, 312, 14)) + + test6 = value1.test6, +>test6 : Symbol(test6, Decl(dependentDestructuredVariables.ts, 318, 25)) +>value1 : Symbol(value1, Decl(dependentDestructuredVariables.ts, 312, 14)) + + test7 = value1.test7, +>test7 : Symbol(test7, Decl(dependentDestructuredVariables.ts, 319, 25)) +>value1 : Symbol(value1, Decl(dependentDestructuredVariables.ts, 312, 14)) + + test8 = value1.test8, +>test8 : Symbol(test8, Decl(dependentDestructuredVariables.ts, 320, 25)) +>value1 : Symbol(value1, Decl(dependentDestructuredVariables.ts, 312, 14)) + + test9 = value1.test9 +>test9 : Symbol(test9, Decl(dependentDestructuredVariables.ts, 321, 25)) +>value1 : Symbol(value1, Decl(dependentDestructuredVariables.ts, 312, 14)) + +}) {} + diff --git a/tests/baselines/reference/dependentDestructuredVariables.types b/tests/baselines/reference/dependentDestructuredVariables.types index 440c42a3827..f3f90242313 100644 --- a/tests/baselines/reference/dependentDestructuredVariables.types +++ b/tests/baselines/reference/dependentDestructuredVariables.types @@ -891,3 +891,67 @@ const f60: Func = (kind, payload) => { } }; +// Repro from #48902 + +function foo({ +>foo : ({ value1, test1, test2, test3, test4, test5, test6, test7, test8, test9 }: { value1: any; test1?: any; test2?: any; test3?: any; test4?: any; test5?: any; test6?: any; test7?: any; test8?: any; test9?: any; }) => void + + value1, +>value1 : any + + test1 = value1.test1, +>test1 : any +>value1.test1 : any +>value1 : any +>test1 : any + + test2 = value1.test2, +>test2 : any +>value1.test2 : any +>value1 : any +>test2 : any + + test3 = value1.test3, +>test3 : any +>value1.test3 : any +>value1 : any +>test3 : any + + test4 = value1.test4, +>test4 : any +>value1.test4 : any +>value1 : any +>test4 : any + + test5 = value1.test5, +>test5 : any +>value1.test5 : any +>value1 : any +>test5 : any + + test6 = value1.test6, +>test6 : any +>value1.test6 : any +>value1 : any +>test6 : any + + test7 = value1.test7, +>test7 : any +>value1.test7 : any +>value1 : any +>test7 : any + + test8 = value1.test8, +>test8 : any +>value1.test8 : any +>value1 : any +>test8 : any + + test9 = value1.test9 +>test9 : any +>value1.test9 : any +>value1 : any +>test9 : any + +}) {} + diff --git a/tests/cases/conformance/controlFlow/dependentDestructuredVariables.ts b/tests/cases/conformance/controlFlow/dependentDestructuredVariables.ts index b56045e7ec0..ae11c010fad 100644 --- a/tests/cases/conformance/controlFlow/dependentDestructuredVariables.ts +++ b/tests/cases/conformance/controlFlow/dependentDestructuredVariables.ts @@ -312,3 +312,18 @@ const f60: Func = (kind, payload) => { payload.toUpperCase(); // error } }; + +// Repro from #48902 + +function foo({ + value1, + test1 = value1.test1, + test2 = value1.test2, + test3 = value1.test3, + test4 = value1.test4, + test5 = value1.test5, + test6 = value1.test6, + test7 = value1.test7, + test8 = value1.test8, + test9 = value1.test9 +}) {} From 5f9c9a6ccf61fa131849797248438e292e7b496a Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 3 May 2022 16:29:40 -0700 Subject: [PATCH 47/63] Start Node ESM stable version at Node16 (#48879) * Remove Node12, add Node16. * Accepted baselines. * Refactor checking for top-level await, give a better error message in CJS files. * Accepted baselines. * Stop erroring on JSON module imports in node ESM since they're no longer experimental. * Accepted baselines. * More refactoring, do the same checks for for-await loops. * Accepted baselines. * Adjust phrasing to permit for-await on CJS error. * Accepted baselines. * Accepted baselines. * Fix lints. --- src/compiler/checker.ts | 97 +- src/compiler/commandLineParser.ts | 6 +- src/compiler/diagnosticMessages.json | 26 +- src/compiler/moduleNameResolver.ts | 24 +- src/compiler/moduleSpecifiers.ts | 4 +- src/compiler/parser.ts | 2 +- src/compiler/program.ts | 10 +- src/compiler/transformer.ts | 2 +- src/compiler/types.ts | 19 +- src/compiler/utilities.ts | 16 +- src/harness/compilerImpl.ts | 2 +- src/server/session.ts | 2 +- .../codefixes/fixModuleAndTargetOptions.ts | 4 +- src/services/codefixes/importFixes.ts | 2 +- src/services/completions.ts | 4 +- src/services/documentRegistry.ts | 4 +- src/services/stringCompletions.ts | 4 +- src/services/types.ts | 2 +- src/services/utilities.ts | 4 +- .../unittests/config/commandLineParsing.ts | 4 +- .../unittests/tsbuild/moduleResolution.ts | 4 +- .../unittests/tsbuild/moduleSpecifiers.ts | 4 +- .../reference/api/tsserverlibrary.d.ts | 14 +- tests/baselines/reference/api/typescript.d.ts | 14 +- .../awaitInNonAsyncFunction.errors.txt | 8 +- ...lpersWithLocalCollisions(module=node16).js | 27 + ...portAssertion1(module=commonjs).errors.txt | 28 +- ...importAssertion1(module=es2015).errors.txt | 36 +- ...portCallExpressionErrorInES2015.errors.txt | 12 +- ...mportCallExpressionGrammarError.errors.txt | 4 +- ...mportCallExpressionNestedES2015.errors.txt | 8 +- ...portCallExpressionNestedES20152.errors.txt | 8 +- ...eta(module=commonjs,target=es5).errors.txt | 52 +- ...(module=commonjs,target=esnext).errors.txt | 52 +- ...odule=commonjs,moduleresolution=node16).js | 19 + ...=commonjs,moduleresolution=node16).symbols | 13 + ...le=commonjs,moduleresolution=node16).types | 14 + ...e=node16,moduleresolution=node).errors.txt | 16 + ...le(module=node16,moduleresolution=node).js | 42 + ...dule=node16,moduleresolution=node).symbols | 11 + ...module=node16,moduleresolution=node).types | 14 + ...(module=node16,moduleresolution=node16).js | 42 + ...le=node16,moduleresolution=node16).symbols | 13 + ...dule=node16,moduleresolution=node16).types | 14 + ...odule=node16,moduleresolution=nodenext).js | 42 + ...=node16,moduleresolution=nodenext).symbols | 13 + ...le=node16,moduleresolution=nodenext).types | 14 + ...odule=nodenext,moduleresolution=node16).js | 42 + ...=nodenext,moduleresolution=node16).symbols | 13 + ...le=nodenext,moduleresolution=node16).types | 14 + ...duleResolutionWithoutExtension1.errors.txt | 8 +- ...duleResolutionWithoutExtension3.errors.txt | 4 +- ...duleResolutionWithoutExtension4.errors.txt | 4 +- ...duleResolutionWithoutExtension5.errors.txt | 4 +- ...duleResolutionWithoutExtension8.errors.txt | 4 +- ...sPackageSelfName(module=node16).errors.txt | 24 + ...deAllowJsPackageSelfName(module=node16).js | 67 ++ ...owJsPackageSelfName(module=node16).symbols | 24 + ...llowJsPackageSelfName(module=node16).types | 24 + .../nodeModules1(module=node16).errors.txt | 564 ++++++++++ .../reference/nodeModules1(module=node16).js | 700 ++++++++++++ .../nodeModules1(module=node16).symbols | 817 ++++++++++++++ .../nodeModules1(module=node16).types | 997 ++++++++++++++++++ .../nodeModules1(module=nodenext).errors.txt | 200 ++-- ...eModulesAllowJs1(module=node16).errors.txt | 663 ++++++++++++ .../nodeModulesAllowJs1(module=node16).js | 688 ++++++++++++ ...nodeModulesAllowJs1(module=node16).symbols | 817 ++++++++++++++ .../nodeModulesAllowJs1(module=node16).types | 997 ++++++++++++++++++ ...odulesAllowJs1(module=nodenext).errors.txt | 200 ++-- ...lesAllowJsCjsFromJs(module=node16).symbols | 15 + ...dulesAllowJsCjsFromJs(module=node16).types | 17 + ...alPackageExports(module=node16).errors.txt | 135 +++ ...onditionalPackageExports(module=node16).js | 205 ++++ ...ionalPackageExports(module=node16).symbols | 243 +++++ ...itionalPackageExports(module=node16).types | 246 +++++ ...ulesAllowJsDynamicImport(module=node16).js | 45 + ...llowJsDynamicImport(module=node16).symbols | 22 + ...sAllowJsDynamicImport(module=node16).types | 26 + ...ExportAssignment(module=node16).errors.txt | 41 + ...sAllowJsExportAssignment(module=node16).js | 61 ++ ...wJsExportAssignment(module=node16).symbols | 36 + ...lowJsExportAssignment(module=node16).types | 45 + ...edNameCollisions(module=node16).errors.txt | 38 + ...sGeneratedNameCollisions(module=node16).js | 62 ++ ...ratedNameCollisions(module=node16).symbols | 38 + ...neratedNameCollisions(module=node16).types | 42 + ...ImportAssignment(module=node16).errors.txt | 49 + ...sAllowJsImportAssignment(module=node16).js | 68 ++ ...wJsImportAssignment(module=node16).symbols | 43 + ...lowJsImportAssignment(module=node16).types | 51 + ...lpersCollisions1(module=node16).errors.txt | 36 + ...ImportHelpersCollisions1(module=node16).js | 52 + ...tHelpersCollisions1(module=node16).symbols | 40 + ...ortHelpersCollisions1(module=node16).types | 48 + ...lpersCollisions2(module=node16).errors.txt | 32 + ...ImportHelpersCollisions2(module=node16).js | 48 + ...tHelpersCollisions2(module=node16).symbols | 22 + ...ortHelpersCollisions2(module=node16).types | 22 + ...lpersCollisions3(module=node16).errors.txt | 31 + ...ImportHelpersCollisions3(module=node16).js | 54 + ...tHelpersCollisions3(module=node16).symbols | 36 + ...ortHelpersCollisions3(module=node16).types | 36 + ...llowJsImportMeta(module=node16).errors.txt | 23 + ...ModulesAllowJsImportMeta(module=node16).js | 38 + ...esAllowJsImportMeta(module=node16).symbols | 24 + ...ulesAllowJsImportMeta(module=node16).types | 24 + ...JsPackageExports(module=node16).errors.txt | 107 ++ ...lesAllowJsPackageExports(module=node16).js | 165 +++ ...lowJsPackageExports(module=node16).symbols | 174 +++ ...AllowJsPackageExports(module=node16).types | 174 +++ ...JsPackageImports(module=node16).errors.txt | 44 + ...lesAllowJsPackageImports(module=node16).js | 96 ++ ...lowJsPackageImports(module=node16).symbols | 60 ++ ...AllowJsPackageImports(module=node16).types | 60 ++ ...gePatternExports(module=node16).errors.txt | 78 ++ ...wJsPackagePatternExports(module=node16).js | 124 +++ ...ckagePatternExports(module=node16).symbols | 120 +++ ...PackagePatternExports(module=node16).types | 120 +++ ...nExportsTrailers(module=node16).errors.txt | 78 ++ ...gePatternExportsTrailers(module=node16).js | 124 +++ ...ternExportsTrailers(module=node16).symbols | 120 +++ ...atternExportsTrailers(module=node16).types | 120 +++ ...ronousCallErrors(module=node16).errors.txt | 55 + ...wJsSynchronousCallErrors(module=node16).js | 60 ++ ...nchronousCallErrors(module=node16).symbols | 58 + ...SynchronousCallErrors(module=node16).types | 68 ++ ...wJsTopLevelAwait(module=node16).errors.txt | 28 + ...ulesAllowJsTopLevelAwait(module=node16).js | 42 + ...llowJsTopLevelAwait(module=node16).symbols | 22 + ...sAllowJsTopLevelAwait(module=node16).types | 28 + ...sTopLevelAwait(module=nodenext).errors.txt | 8 +- ...rmatFileAlwaysHasDefault(module=node16).js | 36 + ...ileAlwaysHasDefault(module=node16).symbols | 13 + ...tFileAlwaysHasDefault(module=node16).types | 14 + ...alPackageExports(module=node16).errors.txt | 135 +++ ...onditionalPackageExports(module=node16).js | 205 ++++ ...ionalPackageExports(module=node16).symbols | 243 +++++ ...itionalPackageExports(module=node16).types | 246 +++++ ...thPackageExports(module=node16).errors.txt | 116 ++ ...onEmitWithPackageExports(module=node16).js | 202 ++++ ...tWithPackageExports(module=node16).symbols | 201 ++++ ...mitWithPackageExports(module=node16).types | 204 ++++ ...nodeModulesDynamicImport(module=node16).js | 45 + ...odulesDynamicImport(module=node16).symbols | 22 + ...eModulesDynamicImport(module=node16).types | 26 + ...xportAssignments(module=node16).errors.txt | 23 + ...ModulesExportAssignments(module=node16).js | 38 + ...esExportAssignments(module=node16).symbols | 16 + ...ulesExportAssignments(module=node16).types | 18 + ...cifierResolution(module=node16).errors.txt | 33 + ...locksSpecifierResolution(module=node16).js | 30 + ...SpecifierResolution(module=node16).symbols | 25 + ...ksSpecifierResolution(module=node16).types | 26 + ...rationConditions(module=node16).errors.txt | 37 + ...fierGenerationConditions(module=node16).js | 41 + ...enerationConditions(module=node16).symbols | 25 + ...rGenerationConditions(module=node16).types | 26 + ...erationDirectory(module=node16).errors.txt | 32 + ...ifierGenerationDirectory(module=node16).js | 36 + ...GenerationDirectory(module=node16).symbols | 25 + ...erGenerationDirectory(module=node16).types | 26 + ...enerationPattern(module=node16).errors.txt | 32 + ...ecifierGenerationPattern(module=node16).js | 36 + ...erGenerationPattern(module=node16).symbols | 25 + ...fierGenerationPattern(module=node16).types | 26 + ...esForbidenSyntax(module=node16).errors.txt | 139 +++ ...odeModulesForbidenSyntax(module=node16).js | 172 +++ ...dulesForbidenSyntax(module=node16).symbols | 120 +++ ...ModulesForbidenSyntax(module=node16).types | 168 +++ ...edNameCollisions(module=node16).errors.txt | 38 + ...sGeneratedNameCollisions(module=node16).js | 64 ++ ...ratedNameCollisions(module=node16).symbols | 38 + ...neratedNameCollisions(module=node16).types | 42 + ...ImportAssertions(module=node16).errors.txt | 22 + ...eModulesImportAssertions(module=node16).js | 20 + ...lesImportAssertions(module=node16).symbols | 25 + ...dulesImportAssertions(module=node16).types | 36 + ...portAssertions(module=nodenext).errors.txt | 10 +- ...ModulesImportAssignments(module=node16).js | 65 ++ ...esImportAssignments(module=node16).symbols | 43 + ...ulesImportAssignments(module=node16).types | 51 + ...elpersCollisions(module=node16).errors.txt | 36 + ...sImportHelpersCollisions(module=node16).js | 52 + ...rtHelpersCollisions(module=node16).symbols | 40 + ...portHelpersCollisions(module=node16).types | 48 + ...lpersCollisions2(module=node16).errors.txt | 32 + ...ImportHelpersCollisions2(module=node16).js | 47 + ...tHelpersCollisions2(module=node16).symbols | 22 + ...ortHelpersCollisions2(module=node16).types | 22 + ...lpersCollisions3(module=node16).errors.txt | 27 + ...ImportHelpersCollisions3(module=node16).js | 44 + ...tHelpersCollisions3(module=node16).symbols | 20 + ...ortHelpersCollisions3(module=node16).types | 20 + ...odulesImportMeta(module=node16).errors.txt | 23 + .../nodeModulesImportMeta(module=node16).js | 40 + ...deModulesImportMeta(module=node16).symbols | 24 + ...nodeModulesImportMeta(module=node16).types | 24 + ...DeclarationEmit1(module=node16).errors.txt | 37 + ...portModeDeclarationEmit1(module=node16).js | 45 + ...odeDeclarationEmit1(module=node16).symbols | 38 + ...tModeDeclarationEmit1(module=node16).types | 30 + ...DeclarationEmit2(module=node16).errors.txt | 42 + ...portModeDeclarationEmit2(module=node16).js | 49 + ...odeDeclarationEmit2(module=node16).symbols | 38 + ...tModeDeclarationEmit2(module=node16).types | 30 + ...ationEmitErrors1(module=node16).errors.txt | 43 + ...deDeclarationEmitErrors1(module=node16).js | 39 + ...larationEmitErrors1(module=node16).symbols | 28 + ...eclarationEmitErrors1(module=node16).types | 24 + ...portResolutionIntoExport(module=node16).js | 70 ++ ...esolutionIntoExport(module=node16).symbols | 24 + ...tResolutionIntoExport(module=node16).types | 24 + ...esolutionNoCycle(module=node16).errors.txt | 33 + ...sImportResolutionNoCycle(module=node16).js | 70 ++ ...rtResolutionNoCycle(module=node16).symbols | 24 + ...portResolutionNoCycle(module=node16).types | 24 + ...TypeModeDeclarationEmit1(module=node16).js | 36 + ...odeDeclarationEmit1(module=node16).symbols | 26 + ...eModeDeclarationEmit1(module=node16).types | 26 + ...ationEmitErrors1(module=node16).errors.txt | 304 ++++++ ...deDeclarationEmitErrors1(module=node16).js | 147 +++ ...larationEmitErrors1(module=node16).symbols | 128 +++ ...eclarationEmitErrors1(module=node16).types | 193 ++++ ...esPackageExports(module=node16).errors.txt | 107 ++ ...odeModulesPackageExports(module=node16).js | 165 +++ ...dulesPackageExports(module=node16).symbols | 174 +++ ...ModulesPackageExports(module=node16).types | 174 +++ ...esPackageImports(module=node16).errors.txt | 44 + ...odeModulesPackageImports(module=node16).js | 96 ++ ...dulesPackageImports(module=node16).symbols | 60 ++ ...ModulesPackageImports(module=node16).types | 60 ++ ...gePatternExports(module=node16).errors.txt | 78 ++ ...lesPackagePatternExports(module=node16).js | 124 +++ ...ckagePatternExports(module=node16).symbols | 120 +++ ...PackagePatternExports(module=node16).types | 120 +++ ...nExportsTrailers(module=node16).errors.txt | 78 ++ ...gePatternExportsTrailers(module=node16).js | 124 +++ ...ternExportsTrailers(module=node16).symbols | 120 +++ ...atternExportsTrailers(module=node16).types | 120 +++ ...ModulesResolveJsonModule(module=node16).js | 120 +++ ...esResolveJsonModule(module=node16).symbols | 89 ++ ...ulesResolveJsonModule(module=node16).types | 95 ++ ...olveJsonModule(module=nodenext).errors.txt | 39 - ...ronousCallErrors(module=node16).errors.txt | 43 + ...lesSynchronousCallErrors(module=node16).js | 60 ++ ...nchronousCallErrors(module=node16).symbols | 58 + ...SynchronousCallErrors(module=node16).types | 68 ++ ...lesTopLevelAwait(module=node16).errors.txt | 28 + ...nodeModulesTopLevelAwait(module=node16).js | 44 + ...odulesTopLevelAwait(module=node16).symbols | 22 + ...eModulesTopLevelAwait(module=node16).types | 28 + ...sTopLevelAwait(module=nodenext).errors.txt | 8 +- ...enceModeDeclarationEmit1(module=node16).js | 35 + ...odeDeclarationEmit1(module=node16).symbols | 14 + ...eModeDeclarationEmit1(module=node16).types | 10 + ...enceModeDeclarationEmit2(module=node16).js | 39 + ...odeDeclarationEmit2(module=node16).symbols | 14 + ...eModeDeclarationEmit2(module=node16).types | 10 + ...enceModeDeclarationEmit3(module=node16).js | 39 + ...odeDeclarationEmit3(module=node16).symbols | 14 + ...eModeDeclarationEmit3(module=node16).types | 10 + ...enceModeDeclarationEmit4(module=node16).js | 35 + ...odeDeclarationEmit4(module=node16).symbols | 14 + ...eModeDeclarationEmit4(module=node16).types | 10 + ...enceModeDeclarationEmit5(module=node16).js | 38 + ...odeDeclarationEmit5(module=node16).symbols | 24 + ...eModeDeclarationEmit5(module=node16).types | 18 + ...enceModeDeclarationEmit6(module=node16).js | 53 + ...odeDeclarationEmit6(module=node16).symbols | 25 + ...eModeDeclarationEmit6(module=node16).types | 25 + ...enceModeDeclarationEmit7(module=node16).js | 78 ++ ...odeDeclarationEmit7(module=node16).symbols | 51 + ...eModeDeclarationEmit7(module=node16).types | 50 + ...nceModeOverride1(module=node16).errors.txt | 29 + ...shReferenceModeOverride1(module=node16).js | 33 + ...erenceModeOverride1(module=node16).symbols | 15 + ...eferenceModeOverride1(module=node16).types | 17 + ...nceModeOverride2(module=node16).errors.txt | 34 + ...shReferenceModeOverride2(module=node16).js | 37 + ...erenceModeOverride2(module=node16).symbols | 15 + ...eferenceModeOverride2(module=node16).types | 17 + ...nceModeOverride3(module=node16).errors.txt | 34 + ...shReferenceModeOverride3(module=node16).js | 37 + ...erenceModeOverride3(module=node16).symbols | 15 + ...eferenceModeOverride3(module=node16).types | 17 + ...nceModeOverride4(module=node16).errors.txt | 29 + ...shReferenceModeOverride4(module=node16).js | 33 + ...erenceModeOverride4(module=node16).symbols | 15 + ...eferenceModeOverride4(module=node16).types | 17 + ...shReferenceModeOverride5(module=node16).js | 39 + ...erenceModeOverride5(module=node16).symbols | 28 + ...eferenceModeOverride5(module=node16).types | 28 + ...verrideModeError(module=node16).errors.txt | 32 + ...nceModeOverrideModeError(module=node16).js | 33 + ...deOverrideModeError(module=node16).symbols | 15 + ...ModeOverrideModeError(module=node16).types | 17 + ...eModeOverrideOldResolutionError.errors.txt | 8 +- ...pesVersionPackageExports(module=node16).js | 98 ++ ...rsionPackageExports(module=node16).symbols | 57 + ...VersionPackageExports(module=node16).types | 63 ++ ...portModeImplicitIndexResolution.errors.txt | 8 +- ...ePackageSelfName(module=node16).errors.txt | 24 + .../nodePackageSelfName(module=node16).js | 67 ++ ...nodePackageSelfName(module=node16).symbols | 24 + .../nodePackageSelfName(module=node16).types | 24 + ...geSelfNameScoped(module=node16).errors.txt | 24 + ...odePackageSelfNameScoped(module=node16).js | 67 ++ ...ckageSelfNameScoped(module=node16).symbols | 24 + ...PackageSelfNameScoped(module=node16).types | 24 + .../parser.forAwait.es2018.errors.txt | 8 +- ....1(module=es2022,target=es2015).errors.txt | 12 +- ....1(module=esnext,target=es2015).errors.txt | 12 +- ....1(module=system,target=es2015).errors.txt | 12 +- ...ons module-kind is out-of-range.errors.txt | 4 +- ...nd is out-of-range.oldTranspile.errors.txt | 4 +- ...s target-script is out-of-range.errors.txt | 4 +- ...pt is out-of-range.oldTranspile.errors.txt | 4 +- ...thMissingExports(module=node16).errors.txt | 17 + ...erenceWithMissingExports(module=node16).js | 18 + ...eWithMissingExports(module=node16).symbols | 13 + ...nceWithMissingExports(module=node16).types | 13 + ...fiers-across-projects-resolve-correctly.js | 317 +----- ...t-correctly-with-cts-and-mts-extensions.js | 532 +--------- ...does-not-add-color-when-NO_COLOR-is-set.js | 2 +- ...-when-host-can't-provide-terminal-width.js | 2 +- ...tatus.DiagnosticsPresent_OutputsSkipped.js | 2 +- .../compiler/moduleResolutionWithModule.ts | 4 +- ...leSlashTypesReferenceWithMissingExports.ts | 2 +- .../moduleResolutionWithoutExtension1.ts | 4 +- .../moduleResolutionWithoutExtension2.ts | 4 +- .../moduleResolutionWithoutExtension5.ts | 4 +- .../moduleResolutionWithoutExtension6.ts | 4 +- .../moduleResolutionWithoutExtension7.ts | 4 +- .../moduleResolutionWithoutExtension8.ts | 4 +- .../allowJs/nodeAllowJsPackageSelfName.ts | 2 +- .../node/allowJs/nodeModulesAllowJs1.ts | 2 +- .../allowJs/nodeModulesAllowJsCjsFromJs.ts | 2 +- ...ModulesAllowJsConditionalPackageExports.ts | 2 +- .../nodeModulesAllowJsDynamicImport.ts | 2 +- .../nodeModulesAllowJsExportAssignment.ts | 2 +- ...deModulesAllowJsGeneratedNameCollisions.ts | 2 +- .../nodeModulesAllowJsImportAssignment.ts | 2 +- ...eModulesAllowJsImportHelpersCollisions1.ts | 2 +- ...eModulesAllowJsImportHelpersCollisions2.ts | 2 +- ...eModulesAllowJsImportHelpersCollisions3.ts | 2 +- .../allowJs/nodeModulesAllowJsImportMeta.ts | 2 +- .../nodeModulesAllowJsPackageExports.ts | 2 +- .../nodeModulesAllowJsPackageImports.ts | 2 +- ...nodeModulesAllowJsPackagePatternExports.ts | 2 +- ...lesAllowJsPackagePatternExportsTrailers.ts | 2 +- ...nodeModulesAllowJsSynchronousCallErrors.ts | 2 +- .../nodeModulesAllowJsTopLevelAwait.ts | 2 +- tests/cases/conformance/node/nodeModules1.ts | 2 +- ...odeModulesCjsFormatFileAlwaysHasDefault.ts | 2 +- .../nodeModulesConditionalPackageExports.ts | 2 +- ...odulesDeclarationEmitWithPackageExports.ts | 2 +- .../node/nodeModulesDynamicImport.ts | 2 +- .../node/nodeModulesExportAssignments.ts | 2 +- ...ModulesExportsBlocksSpecifierResolution.ts | 2 +- ...lesExportsSpecifierGenerationConditions.ts | 2 +- ...ulesExportsSpecifierGenerationDirectory.ts | 2 +- ...odulesExportsSpecifierGenerationPattern.ts | 2 +- .../node/nodeModulesForbidenSyntax.ts | 2 +- .../nodeModulesGeneratedNameCollisions.ts | 2 +- .../node/nodeModulesImportAssertions.ts | 2 +- .../node/nodeModulesImportAssignments.ts | 2 +- .../nodeModulesImportHelpersCollisions.ts | 2 +- .../nodeModulesImportHelpersCollisions2.ts | 2 +- .../nodeModulesImportHelpersCollisions3.ts | 2 +- .../conformance/node/nodeModulesImportMeta.ts | 2 +- .../nodeModulesImportModeDeclarationEmit1.ts | 2 +- .../nodeModulesImportModeDeclarationEmit2.ts | 2 +- ...ModulesImportModeDeclarationEmitErrors1.ts | 2 +- .../nodeModulesImportResolutionIntoExport.ts | 2 +- .../nodeModulesImportResolutionNoCycle.ts | 2 +- ...deModulesImportTypeModeDeclarationEmit1.ts | 2 +- ...lesImportTypeModeDeclarationEmitErrors1.ts | 2 +- .../node/nodeModulesPackageExports.ts | 2 +- .../node/nodeModulesPackageImports.ts | 2 +- .../node/nodeModulesPackagePatternExports.ts | 2 +- ...odeModulesPackagePatternExportsTrailers.ts | 2 +- .../node/nodeModulesResolveJsonModule.ts | 2 +- .../node/nodeModulesSynchronousCallErrors.ts | 2 +- .../node/nodeModulesTopLevelAwait.ts | 2 +- ...ripleSlashReferenceModeDeclarationEmit1.ts | 2 +- ...ripleSlashReferenceModeDeclarationEmit2.ts | 2 +- ...ripleSlashReferenceModeDeclarationEmit3.ts | 2 +- ...ripleSlashReferenceModeDeclarationEmit4.ts | 2 +- ...ripleSlashReferenceModeDeclarationEmit5.ts | 2 +- ...ripleSlashReferenceModeDeclarationEmit6.ts | 2 +- ...ripleSlashReferenceModeDeclarationEmit7.ts | 2 +- ...odulesTripleSlashReferenceModeOverride1.ts | 2 +- ...odulesTripleSlashReferenceModeOverride2.ts | 2 +- ...odulesTripleSlashReferenceModeOverride3.ts | 2 +- ...odulesTripleSlashReferenceModeOverride4.ts | 2 +- ...odulesTripleSlashReferenceModeOverride5.ts | 2 +- ...ipleSlashReferenceModeOverrideModeError.ts | 2 +- .../nodeModulesTypesVersionPackageExports.ts | 2 +- .../conformance/node/nodePackageSelfName.ts | 2 +- .../node/nodePackageSelfNameScoped.ts | 2 +- .../autoImport_node12_node_modules1.ts | 2 +- .../fourslash/moduleNodeNextImportFix.ts | 2 +- ...refactorConvertToEsModule_module_node12.ts | 2 +- 403 files changed, 21242 insertions(+), 1380 deletions(-) create mode 100644 tests/baselines/reference/emitHelpersWithLocalCollisions(module=node16).js create mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node16).js create mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node16).symbols create mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node16).types create mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node).errors.txt create mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node).js create mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node).symbols create mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node).types create mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node16).js create mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node16).symbols create mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node16).types create mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=nodenext).js create mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=nodenext).symbols create mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=nodenext).types create mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node16).js create mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node16).symbols create mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node16).types create mode 100644 tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).js create mode 100644 tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).symbols create mode 100644 tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).types create mode 100644 tests/baselines/reference/nodeModules1(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModules1(module=node16).js create mode 100644 tests/baselines/reference/nodeModules1(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModules1(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesAllowJs1(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJs1(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesAllowJs1(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJs1(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesDynamicImport(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesDynamicImport(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesDynamicImport(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesExportAssignments(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesExportAssignments(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesExportAssignments(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesExportAssignments(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesForbidenSyntax(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesForbidenSyntax(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesForbidenSyntax(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesForbidenSyntax(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesImportAssertions(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportAssertions(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesImportAssertions(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesImportAssertions(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesImportAssignments(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesImportAssignments(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesImportAssignments(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesImportMeta(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportMeta(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesImportMeta(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesImportMeta(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesPackageExports(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesPackageExports(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesPackageExports(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesPackageExports(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesPackageImports(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesPackageImports(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesPackageImports(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesPackageImports(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesPackagePatternExports(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesPackagePatternExports(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesPackagePatternExports(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesPackagePatternExports(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesResolveJsonModule(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesResolveJsonModule(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesResolveJsonModule(module=node16).types delete mode 100644 tests/baselines/reference/nodeModulesResolveJsonModule(module=nodenext).errors.txt create mode 100644 tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesTopLevelAwait(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesTopLevelAwait(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesTopLevelAwait(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesTopLevelAwait(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node16).types create mode 100644 tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node16).js create mode 100644 tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node16).symbols create mode 100644 tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node16).types create mode 100644 tests/baselines/reference/nodePackageSelfName(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodePackageSelfName(module=node16).js create mode 100644 tests/baselines/reference/nodePackageSelfName(module=node16).symbols create mode 100644 tests/baselines/reference/nodePackageSelfName(module=node16).types create mode 100644 tests/baselines/reference/nodePackageSelfNameScoped(module=node16).errors.txt create mode 100644 tests/baselines/reference/nodePackageSelfNameScoped(module=node16).js create mode 100644 tests/baselines/reference/nodePackageSelfNameScoped(module=node16).symbols create mode 100644 tests/baselines/reference/nodePackageSelfNameScoped(module=node16).types create mode 100644 tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node16).errors.txt create mode 100644 tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node16).js create mode 100644 tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node16).symbols create mode 100644 tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node16).types diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 67fea0acf54..8dc1e1df76f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1048,7 +1048,7 @@ namespace ts { const builtinGlobals = createSymbolTable(); builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol); - // Extensions suggested for path imports when module resolution is node12 or higher. + // Extensions suggested for path imports when module resolution is node16 or higher. // The first element of each tuple is the extension a file has. // The second element of each tuple is the extension that should be used in a path import. // e.g. if we want to import file `foo.mts`, we should write `import {} from "./foo.mjs". @@ -3528,7 +3528,7 @@ namespace ts { if (resolvedModule.isExternalLibraryImport && !resolutionExtensionIsTSOrJson(resolvedModule.extension)) { errorOnImplicitAnyModule(/*isError*/ false, errorNode, resolvedModule, moduleReference); } - if (getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.Node12 || getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.NodeNext) { + if (getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.Node16 || getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.NodeNext) { const isSyncImport = (currentSourceFile.impliedNodeFormat === ModuleKind.CommonJS && !findAncestor(location, isImportCall)) || !!findAncestor(location, isImportEqualsDeclaration); const overrideClauseHost = findAncestor(location, l => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l)) as ImportTypeNode | ImportDeclaration | ExportDeclaration | undefined; const overrideClause = overrideClauseHost && isImportTypeNode(overrideClauseHost) ? overrideClauseHost.assertions?.assertClause : overrideClauseHost?.assertClause; @@ -3537,9 +3537,6 @@ namespace ts { if (isSyncImport && sourceFile.impliedNodeFormat === ModuleKind.ESNext && !getResolutionModeOverrideForClause(overrideClause)) { error(errorNode, Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead, moduleReference); } - if (mode === ModuleKind.ESNext && compilerOptions.resolveJsonModule && resolvedModule.extension === Extension.Json) { - error(errorNode, Diagnostics.JSON_imports_are_experimental_in_ES_module_mode_imports); - } } // merged symbol is module declaration symbol combined with all augmentations return getMergedSymbol(sourceFile.symbol); @@ -3596,7 +3593,7 @@ namespace ts { const tsExtension = tryExtractTSExtension(moduleReference); const isExtensionlessRelativePathImport = pathIsRelative(moduleReference) && !hasExtension(moduleReference); const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions); - const resolutionIsNode12OrNext = moduleResolutionKind === ModuleResolutionKind.Node12 || + const resolutionIsNode16OrNext = moduleResolutionKind === ModuleResolutionKind.Node16 || moduleResolutionKind === ModuleResolutionKind.NodeNext; if (tsExtension) { const diag = Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead; @@ -3617,16 +3614,16 @@ namespace ts { hasJsonModuleEmitEnabled(compilerOptions)) { error(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference); } - else if (mode === ModuleKind.ESNext && resolutionIsNode12OrNext && isExtensionlessRelativePathImport) { + else if (mode === ModuleKind.ESNext && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) { const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path)); const suggestedExt = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))?.[1]; if (suggestedExt) { error(errorNode, - Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0, + Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt); } else { - error(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Consider_adding_an_extension_to_the_import_path); + error(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path); } } else { @@ -6191,7 +6188,7 @@ namespace ts { const targetFile = getSourceFileOfModule(chain[0]); let specifier: string | undefined; let assertion: ImportTypeAssertionContainer | undefined; - if (getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.Node12 || getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.NodeNext) { + if (getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.Node16 || getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.NodeNext) { // An `import` type directed at an esm format file is only going to resolve in esm mode - set the esm mode assertion if (targetFile?.impliedNodeFormat === ModuleKind.ESNext && targetFile.impliedNodeFormat !== contextFile?.impliedNodeFormat) { specifier = getSpecifierForModuleSymbol(chain[0], context, ModuleKind.ESNext); @@ -6208,7 +6205,7 @@ namespace ts { } if (!(context.flags & NodeBuilderFlags.AllowNodeModulesRelativePaths) && getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.Classic && specifier.indexOf("/node_modules/") >= 0) { const oldSpecifier = specifier; - if (getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.Node12 || getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.NodeNext) { + if (getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.Node16 || getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.NodeNext) { // We might be able to write a portable import type using a mode override; try specifier generation again, but with a different mode set const swappedMode = contextFile?.impliedNodeFormat === ModuleKind.ESNext ? ModuleKind.CommonJS : ModuleKind.ESNext; specifier = getSpecifierForModuleSymbol(chain[0], context, swappedMode); @@ -32057,13 +32054,13 @@ namespace ts { } function checkImportMetaProperty(node: MetaProperty) { - if (moduleKind === ModuleKind.Node12 || moduleKind === ModuleKind.NodeNext) { + if (moduleKind === ModuleKind.Node16 || moduleKind === ModuleKind.NodeNext) { if (getSourceFileOfNode(node).impliedNodeFormat !== ModuleKind.ESNext) { error(node, Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output); } } else if (moduleKind < ModuleKind.ES2020 && moduleKind !== ModuleKind.System) { - error(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node12_or_nodenext); + error(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext); } const file = getSourceFileOfNode(node); Debug.assert(!!(file.flags & NodeFlags.PossiblyContainsImportMeta), "Containing file is missing import meta node flag."); @@ -33093,16 +33090,37 @@ namespace ts { if (!hasParseDiagnostics(sourceFile)) { let span: TextSpan | undefined; if (!isEffectiveExternalModule(sourceFile, compilerOptions)) { - if (!span) span = getSpanOfTokenAtPosition(sourceFile, node.pos); + span ??= getSpanOfTokenAtPosition(sourceFile, node.pos); const diagnostic = createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module); diagnostics.add(diagnostic); } - if ((moduleKind !== ModuleKind.ES2022 && moduleKind !== ModuleKind.ESNext && moduleKind !== ModuleKind.System && !(moduleKind === ModuleKind.NodeNext && getSourceFileOfNode(node).impliedNodeFormat === ModuleKind.ESNext)) || languageVersion < ScriptTarget.ES2017) { - span = getSpanOfTokenAtPosition(sourceFile, node.pos); - const diagnostic = createFileDiagnostic(sourceFile, span.start, span.length, - Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher); - diagnostics.add(diagnostic); + switch (moduleKind) { + case ModuleKind.Node16: + case ModuleKind.NodeNext: + if (sourceFile.impliedNodeFormat === ModuleKind.CommonJS) { + span ??= getSpanOfTokenAtPosition(sourceFile, node.pos); + diagnostics.add( + createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level) + ); + break; + } + // fallthrough + case ModuleKind.ES2022: + case ModuleKind.ESNext: + case ModuleKind.System: + if (languageVersion >= ScriptTarget.ES2017) { + break; + } + // fallthrough + default: + span ??= getSpanOfTokenAtPosition(sourceFile, node.pos); + diagnostics.add( + createFileDiagnostic(sourceFile, span.start, span.length, + Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher + ) + ); + break; } } } @@ -35806,8 +35824,8 @@ namespace ts { if (node.assertions) { const override = getResolutionModeOverrideForClause(node.assertions.assertClause, grammarErrorOnNode); if (override) { - if (getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.Node12 && getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.NodeNext) { - grammarErrorOnNode(node.assertions.assertClause, Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext); + if (getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.Node16 && getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.NodeNext) { + grammarErrorOnNode(node.assertions.assertClause, Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext); } } } @@ -37425,7 +37443,7 @@ namespace ts { function checkCollisionWithRequireExportsInGeneratedCode(node: Node, name: Identifier | undefined) { // No need to check for require or exports for ES6 modules and later - if (moduleKind >= ModuleKind.ES2015 && !(moduleKind >= ModuleKind.Node12 && getSourceFileOfNode(node).impliedNodeFormat === ModuleKind.CommonJS)) { + if (moduleKind >= ModuleKind.ES2015 && !(moduleKind >= ModuleKind.Node16 && getSourceFileOfNode(node).impliedNodeFormat === ModuleKind.CommonJS)) { return; } @@ -40700,8 +40718,8 @@ namespace ts { const validForTypeAssertions = isExclusivelyTypeOnlyImportOrExport(declaration); const override = getResolutionModeOverrideForClause(declaration.assertClause, validForTypeAssertions ? grammarErrorOnNode : undefined); if (validForTypeAssertions && override) { - if (getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.Node12 && getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.NodeNext) { - return grammarErrorOnNode(declaration.assertClause, Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext); + if (getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.Node16 && getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.NodeNext) { + return grammarErrorOnNode(declaration.assertClause, Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext); } return; // Other grammar checks do not apply to type-only imports with resolution mode assertions } @@ -44173,9 +44191,30 @@ namespace ts { diagnostics.add(createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module)); } - if ((moduleKind !== ModuleKind.ES2022 && moduleKind !== ModuleKind.ESNext && moduleKind !== ModuleKind.System && !(moduleKind === ModuleKind.NodeNext && getSourceFileOfNode(forInOrOfStatement).impliedNodeFormat === ModuleKind.ESNext)) || languageVersion < ScriptTarget.ES2017) { - diagnostics.add(createDiagnosticForNode(forInOrOfStatement.awaitModifier, - Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher)); + switch (moduleKind) { + case ModuleKind.Node16: + case ModuleKind.NodeNext: + if (sourceFile.impliedNodeFormat === ModuleKind.CommonJS) { + diagnostics.add( + createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level) + ); + break; + } + // fallthrough + case ModuleKind.ES2022: + case ModuleKind.ESNext: + case ModuleKind.System: + if (languageVersion >= ScriptTarget.ES2017) { + break; + } + // fallthrough + default: + diagnostics.add( + createDiagnosticForNode(forInOrOfStatement.awaitModifier, + Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher + ) + ); + break; } } } @@ -44947,7 +44986,7 @@ namespace ts { function checkGrammarImportCallExpression(node: ImportCall): boolean { if (moduleKind === ModuleKind.ES2015) { - return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node12_or_nodenext); + return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext); } if (node.typeArguments) { @@ -44961,7 +45000,7 @@ namespace ts { if (nodeArguments.length > 1) { const assertionArgument = nodeArguments[1]; - return grammarErrorOnNode(assertionArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_or_nodenext); + return grammarErrorOnNode(assertionArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext); } } diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 6ed23d16e6b..d60facd264b 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -423,7 +423,7 @@ namespace ts { es2020: ModuleKind.ES2020, es2022: ModuleKind.ES2022, esnext: ModuleKind.ESNext, - node12: ModuleKind.Node12, + node16: ModuleKind.Node16, nodenext: ModuleKind.NodeNext, })), affectsModuleResolution: true, @@ -781,7 +781,7 @@ namespace ts { type: new Map(getEntries({ node: ModuleResolutionKind.NodeJs, classic: ModuleResolutionKind.Classic, - node12: ModuleResolutionKind.Node12, + node16: ModuleResolutionKind.Node16, nodenext: ModuleResolutionKind.NodeNext, })), affectsModuleResolution: true, @@ -1263,7 +1263,7 @@ namespace ts { affectsModuleResolution: true, description: Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files, category: Diagnostics.Language_and_Environment, - defaultValueDescription: Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node12_as_modules, + defaultValueDescription: Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules, } ]; diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 207b23d7013..3e1b4a3ad2d 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -900,6 +900,10 @@ "category": "Error", "code": 1308 }, + "The current file is a CommonJS module and cannot use 'await' at the top level.": { + "category": "Error", + "code": 1309 + }, "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern.": { "category": "Error", "code": 1312 @@ -944,11 +948,11 @@ "category": "Error", "code": 1322 }, - "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'.": { + "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'.": { "category": "Error", "code": 1323 }, - "Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'.": { + "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'.": { "category": "Error", "code": 1324 }, @@ -1016,7 +1020,7 @@ "category": "Error", "code": 1342 }, - "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'.": { + "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'.": { "category": "Error", "code": 1343 }, @@ -1140,7 +1144,7 @@ "category": "Message", "code": 1377 }, - "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher.": { + "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.": { "category": "Error", "code": 1378 }, @@ -1348,7 +1352,7 @@ "category": "Error", "code": 1431 }, - "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher.": { + "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.": { "category": "Error", "code": 1432 }, @@ -1420,7 +1424,7 @@ "category": "Error", "code": 1451 }, - "Resolution modes are only supported when `moduleResolution` is `node12` or `nodenext`.": { + "Resolution modes are only supported when `moduleResolution` is `node16` or `nodenext`.": { "category": "Error", "code": 1452 }, @@ -1465,7 +1469,7 @@ "category": "Message", "code": 1475 }, - "\"auto\": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node12+) as modules.": { + "\"auto\": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node16+) as modules.": { "category": "Message", "code": 1476 }, @@ -3418,11 +3422,11 @@ "category": "Error", "code": 2833 }, - "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path.": { + "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.": { "category": "Error", "code": 2834 }, - "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean '{0}'?": { + "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?": { "category": "Error", "code": 2835 }, @@ -6106,10 +6110,6 @@ "category": "Error", "code": 7061 }, - "JSON imports are experimental in ES module mode imports.": { - "category": "Error", - "code": 7062 - }, "You cannot rename this element.": { "category": "Error", diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts index 15022bd59f6..6b0664b835c 100644 --- a/src/compiler/moduleNameResolver.ts +++ b/src/compiler/moduleNameResolver.ts @@ -348,9 +348,9 @@ namespace ts { // set in a non-modal module resolution setting here. Do note that our behavior is not particularly well defined when these mode-overriding imports // are present in a non-modal project; while in theory we'd like to either ignore the mode or provide faithful modern resolution, depending on what we feel is best, // in practice, not every cache has the options available to intelligently make the choice to ignore the mode request, and it's unclear how modern "faithful modern - // resolution" should be (`node12`? `nodenext`?). As such, witnessing a mode-overriding triple-slash reference in a non-modal module resolution + // resolution" should be (`node16`? `nodenext`?). As such, witnessing a mode-overriding triple-slash reference in a non-modal module resolution // context should _probably_ be an error - and that should likely be handled by the `Program` (which is what we do). - if (resolutionMode === ModuleKind.ESNext && (getEmitModuleResolutionKind(options) === ModuleResolutionKind.Node12 || getEmitModuleResolutionKind(options) === ModuleResolutionKind.NodeNext)) { + if (resolutionMode === ModuleKind.ESNext && (getEmitModuleResolutionKind(options) === ModuleResolutionKind.Node16 || getEmitModuleResolutionKind(options) === ModuleResolutionKind.NodeNext)) { features |= NodeResolutionFeatures.EsmMode; } const conditions = features & NodeResolutionFeatures.Exports ? features & NodeResolutionFeatures.EsmMode ? ["node", "import", "types"] : ["node", "require", "types"] : []; @@ -444,7 +444,7 @@ namespace ts { } function getDefaultNodeResolutionFeatures(options: CompilerOptions) { - return getEmitModuleResolutionKind(options) === ModuleResolutionKind.Node12 ? NodeResolutionFeatures.Node12Default : + return getEmitModuleResolutionKind(options) === ModuleResolutionKind.Node16 ? NodeResolutionFeatures.Node16Default : getEmitModuleResolutionKind(options) === ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault : NodeResolutionFeatures.None; } @@ -950,8 +950,8 @@ namespace ts { case ModuleKind.CommonJS: moduleResolution = ModuleResolutionKind.NodeJs; break; - case ModuleKind.Node12: - moduleResolution = ModuleResolutionKind.Node12; + case ModuleKind.Node16: + moduleResolution = ModuleResolutionKind.Node16; break; case ModuleKind.NodeNext: moduleResolution = ModuleResolutionKind.NodeNext; @@ -972,8 +972,8 @@ namespace ts { perfLogger.logStartResolveModule(moduleName /* , containingFile, ModuleResolutionKind[moduleResolution]*/); switch (moduleResolution) { - case ModuleResolutionKind.Node12: - result = node12ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); + case ModuleResolutionKind.Node16: + result = node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); break; case ModuleResolutionKind.NodeNext: result = nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); @@ -1231,22 +1231,22 @@ namespace ts { // respecting the `.exports` member of packages' package.json files and its (conditional) mappings of export names Exports = 1 << 3, // allowing `*` in the LHS of an export to be followed by more content, eg `"./whatever/*.js"` - // not currently backported to node 12 - https://github.com/nodejs/Release/issues/690 + // not supported in node 12 - https://github.com/nodejs/Release/issues/690 ExportsPatternTrailers = 1 << 4, AllFeatures = Imports | SelfName | Exports | ExportsPatternTrailers, - Node12Default = Imports | SelfName | Exports, + Node16Default = Imports | SelfName | Exports | ExportsPatternTrailers, NodeNextDefault = AllFeatures, EsmMode = 1 << 5, } - function node12ModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, + function node16ModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference, resolutionMode?: ModuleKind.CommonJS | ModuleKind.ESNext): ResolvedModuleWithFailedLookupLocations { return nodeNextModuleNameResolverWorker( - NodeResolutionFeatures.Node12Default, + NodeResolutionFeatures.Node16Default, moduleName, containingFile, compilerOptions, @@ -1310,7 +1310,7 @@ namespace ts { const traceEnabled = isTraceEnabled(compilerOptions, host); const failedLookupLocations: string[] = []; - // conditions are only used by the node12/nodenext resolver - there's no priority order in the list, + // conditions are only used by the node16/nodenext resolver - there's no priority order in the list, //it's essentially a set (priority is determined by object insertion order in the object we look at). const conditions = features & NodeResolutionFeatures.EsmMode ? ["node", "import", "types"] : ["node", "require", "types"]; if (compilerOptions.noDtsResolution) { diff --git a/src/compiler/moduleSpecifiers.ts b/src/compiler/moduleSpecifiers.ts index 270bee0048e..542afb796a9 100644 --- a/src/compiler/moduleSpecifiers.ts +++ b/src/compiler/moduleSpecifiers.ts @@ -41,7 +41,7 @@ namespace ts.moduleSpecifiers { } function isFormatRequiringExtensions(compilerOptions: CompilerOptions, importingSourceFileName: Path, host: ModuleSpecifierResolutionHost) { - if (getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.Node12 + if (getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.Node16 && getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.NodeNext) { return false; } @@ -734,7 +734,7 @@ namespace ts.moduleSpecifiers { const cachedPackageJson = host.getPackageJsonInfoCache?.()?.getPackageJsonInfo(packageJsonPath); if (typeof cachedPackageJson === "object" || cachedPackageJson === undefined && host.fileExists(packageJsonPath)) { const packageJsonContent = cachedPackageJson?.packageJsonContent || JSON.parse(host.readFile!(packageJsonPath)!); - if (getEmitModuleResolutionKind(options) === ModuleResolutionKind.Node12 || getEmitModuleResolutionKind(options) === ModuleResolutionKind.NodeNext) { + if (getEmitModuleResolutionKind(options) === ModuleResolutionKind.Node16 || getEmitModuleResolutionKind(options) === ModuleResolutionKind.NodeNext) { // `conditions` *could* be made to go against `importingSourceFile.impliedNodeFormat` if something wanted to generate // an ImportEqualsDeclaration in an ESM-implied file or an ImportCall in a CJS-implied file. But since this function is // usually called to conjure an import out of thin air, we don't have an existing usage to call `getModeForUsageAtIndex` diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 884a5b36e38..32e00834bb4 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -683,7 +683,7 @@ namespace ts { /** * Controls the format the file is detected as - this can be derived from only the path * and files on disk, but needs to be done with a module resolution cache in scope to be performant. - * This is usually `undefined` for compilations that do not have `moduleResolution` values of `node12` or `nodenext`. + * This is usually `undefined` for compilations that do not have `moduleResolution` values of `node16` or `nodenext`. */ impliedNodeFormat?: ModuleKind.ESNext | ModuleKind.CommonJS; /** diff --git a/src/compiler/program.ts b/src/compiler/program.ts index c7f886ea311..14da7655333 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -858,7 +858,7 @@ namespace ts { */ export function getImpliedNodeFormatForFile(fileName: Path, packageJsonInfoCache: PackageJsonInfoCache | undefined, host: ModuleResolutionHost, options: CompilerOptions): ModuleKind.ESNext | ModuleKind.CommonJS | undefined { switch (getEmitModuleResolutionKind(options)) { - case ModuleResolutionKind.Node12: + case ModuleResolutionKind.Node16: case ModuleResolutionKind.NodeNext: return fileExtensionIsOneOf(fileName, [Extension.Dmts, Extension.Mts, Extension.Mjs]) ? ModuleKind.ESNext : fileExtensionIsOneOf(fileName, [Extension.Dcts, Extension.Cts, Extension.Cjs]) ? ModuleKind.CommonJS : @@ -1210,7 +1210,7 @@ namespace ts { const containingFilename = combinePaths(containingDirectory, inferredTypesContainingFile); const resolutions = resolveTypeReferenceDirectiveNamesWorker(typeReferences, containingFilename); for (let i = 0; i < typeReferences.length; i++) { - // under node12/nodenext module resolution, load `types`/ata include names as cjs resolution results by passing an `undefined` mode + // under node16/nodenext module resolution, load `types`/ata include names as cjs resolution results by passing an `undefined` mode processTypeReferenceDirective(typeReferences[i], /*mode*/ undefined, resolutions[i], { kind: FileIncludeKind.AutomaticTypeDirectiveFile, typeReference: typeReferences[i], packageId: resolutions[i]?.packageId }); } tracing?.pop(); @@ -3085,8 +3085,8 @@ namespace ts { const fileName = toFileNameLowerCase(ref.fileName); setResolvedTypeReferenceDirective(file, fileName, resolvedTypeReferenceDirective); const mode = ref.resolutionMode || file.impliedNodeFormat; - if (mode && getEmitModuleResolutionKind(options) !== ModuleResolutionKind.Node12 && getEmitModuleResolutionKind(options) !== ModuleResolutionKind.NodeNext) { - programDiagnostics.add(createDiagnosticForRange(file, ref, Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext)); + if (mode && getEmitModuleResolutionKind(options) !== ModuleResolutionKind.Node16 && getEmitModuleResolutionKind(options) !== ModuleResolutionKind.NodeNext) { + programDiagnostics.add(createDiagnosticForRange(file, ref, Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext)); } processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: FileIncludeKind.TypeReferenceDirective, file: file.path, index, }); } @@ -3515,7 +3515,7 @@ namespace ts { if (options.resolveJsonModule) { if (getEmitModuleResolutionKind(options) !== ModuleResolutionKind.NodeJs && - getEmitModuleResolutionKind(options) !== ModuleResolutionKind.Node12 && + getEmitModuleResolutionKind(options) !== ModuleResolutionKind.Node16 && getEmitModuleResolutionKind(options) !== ModuleResolutionKind.NodeNext) { createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy, "resolveJsonModule"); } diff --git a/src/compiler/transformer.ts b/src/compiler/transformer.ts index 7207d8a60d7..bfe70171504 100644 --- a/src/compiler/transformer.ts +++ b/src/compiler/transformer.ts @@ -9,7 +9,7 @@ namespace ts { return transformECMAScriptModule; case ModuleKind.System: return transformSystemModule; - case ModuleKind.Node12: + case ModuleKind.Node16: case ModuleKind.NodeNext: return transformNodeModule; default: diff --git a/src/compiler/types.ts b/src/compiler/types.ts index c03a01f424b..c3a2f8f72b2 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3615,7 +3615,7 @@ namespace ts { languageVersion: ScriptTarget; /** - * When `module` is `Node12` or `NodeNext`, this field controls whether the + * When `module` is `Node16` or `NodeNext`, this field controls whether the * source file in question is an ESNext-output-format file, or a CommonJS-output-format * module. This is derived by the module resolver as it looks up the file, since * it is derived from either the file extension of the module, or the containing @@ -6049,11 +6049,12 @@ namespace ts { Classic = 1, NodeJs = 2, // Starting with node12, node's module resolver has significant departures from traditional cjs resolution - // to better support ecmascript modules and their use within node - more features are still being added, so - // we can expect it to change over time, and as such, offer both a `NodeNext` moving resolution target, and a `Node12` - // version-anchored resolution target - Node12 = 3, - NodeNext = 99, // Not simply `Node12` so that compiled code linked against TS can use the `Next` value reliably (same as with `ModuleKind`) + // to better support ecmascript modules and their use within node - however more features are still being added. + // TypeScript's Node ESM support was introduced after Node 12 went end-of-life, and Node 14 is the earliest stable + // version that supports both pattern trailers - *but*, Node 16 is the first version that also supports ECMASCript 2022. + // In turn, we offer both a `NodeNext` moving resolution target, and a `Node16` version-anchored resolution target + Node16 = 3, + NodeNext = 99, // Not simply `Node16` so that compiled code linked against TS can use the `Next` value reliably (same as with `ModuleKind`) } export enum ModuleDetectionKind { @@ -6062,7 +6063,7 @@ namespace ts { */ Legacy = 1, /** - * Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution: node12+ + * Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution: node16+ */ Auto = 2, /** @@ -6281,8 +6282,8 @@ namespace ts { ES2022 = 7, ESNext = 99, - // Node12+ is an amalgam of commonjs (albeit updated) and es2020+, and represents a distinct module system from es2020/esnext - Node12 = 100, + // Node16+ is an amalgam of commonjs (albeit updated) and es2022+, and represents a distinct module system from es2020/esnext + Node16 = 100, NodeNext = 199, } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 7d860fa7a61..b4a22b298fe 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -808,7 +808,7 @@ namespace ts { } function isCommonJSContainingModuleKind(kind: ModuleKind) { - return kind === ModuleKind.CommonJS || kind === ModuleKind.Node12 || kind === ModuleKind.NodeNext; + return kind === ModuleKind.CommonJS || kind === ModuleKind.Node16 || kind === ModuleKind.NodeNext; } export function isEffectiveExternalModule(node: SourceFile, compilerOptions: CompilerOptions) { @@ -6319,7 +6319,7 @@ namespace ts { file.externalModuleIndicator = isFileProbablyExternalModule(file); }; case ModuleDetectionKind.Auto: - // If module is nodenext or node12, all esm format files are modules + // If module is nodenext or node16, all esm format files are modules // If jsx is react-jsx or react-jsxdev then jsx tags force module-ness // otherwise, the presence of import or export statments (or import.meta) implies module-ness const checks: ((file: SourceFile) => Node | true | undefined)[] = [isFileProbablyExternalModule]; @@ -6327,7 +6327,7 @@ namespace ts { checks.push(isFileModuleFromUsingJSXTag); } const moduleKind = getEmitModuleKind(options); - if (moduleKind === ModuleKind.Node12 || moduleKind === ModuleKind.NodeNext) { + if (moduleKind === ModuleKind.Node16 || moduleKind === ModuleKind.NodeNext) { checks.push(isFileForcedToBeModuleByFormat); } const combined = or(...checks); @@ -6338,7 +6338,7 @@ namespace ts { export function getEmitScriptTarget(compilerOptions: {module?: CompilerOptions["module"], target?: CompilerOptions["target"]}) { return compilerOptions.target || - (compilerOptions.module === ModuleKind.Node12 && ScriptTarget.ES2020) || + (compilerOptions.module === ModuleKind.Node16 && ScriptTarget.ES2022) || (compilerOptions.module === ModuleKind.NodeNext && ScriptTarget.ESNext) || ScriptTarget.ES3; } @@ -6356,8 +6356,8 @@ namespace ts { case ModuleKind.CommonJS: moduleResolution = ModuleResolutionKind.NodeJs; break; - case ModuleKind.Node12: - moduleResolution = ModuleResolutionKind.Node12; + case ModuleKind.Node16: + moduleResolution = ModuleResolutionKind.Node16; break; case ModuleKind.NodeNext: moduleResolution = ModuleResolutionKind.NodeNext; @@ -6382,7 +6382,7 @@ namespace ts { case ModuleKind.ES2020: case ModuleKind.ES2022: case ModuleKind.ESNext: - case ModuleKind.Node12: + case ModuleKind.Node16: case ModuleKind.NodeNext: return true; default: @@ -6407,7 +6407,7 @@ namespace ts { return compilerOptions.esModuleInterop; } switch (getEmitModuleKind(compilerOptions)) { - case ModuleKind.Node12: + case ModuleKind.Node16: case ModuleKind.NodeNext: return true; } diff --git a/src/harness/compilerImpl.ts b/src/harness/compilerImpl.ts index 40e3994b1c9..999c9d4e273 100644 --- a/src/harness/compilerImpl.ts +++ b/src/harness/compilerImpl.ts @@ -249,7 +249,7 @@ namespace compiler { } // establish defaults (aligns with old harness) - if (compilerOptions.target === undefined && compilerOptions.module !== ts.ModuleKind.Node12 && compilerOptions.module !== ts.ModuleKind.NodeNext) compilerOptions.target = ts.ScriptTarget.ES3; + if (compilerOptions.target === undefined && compilerOptions.module !== ts.ModuleKind.Node16 && compilerOptions.module !== ts.ModuleKind.NodeNext) compilerOptions.target = ts.ScriptTarget.ES3; if (compilerOptions.newLine === undefined) compilerOptions.newLine = ts.NewLineKind.CarriageReturnLineFeed; if (compilerOptions.skipDefaultLibCheck === undefined) compilerOptions.skipDefaultLibCheck = true; if (compilerOptions.noErrorTruncation === undefined) compilerOptions.noErrorTruncation = true; diff --git a/src/server/session.ts b/src/server/session.ts index 81f1dba1fad..8c92d71db1b 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -1291,7 +1291,7 @@ namespace ts.server { const compilerOptions = project.getCompilationSettings(); const packageJson = getPackageScopeForPath(project.toPath(packageDirectory + "/package.json"), packageJsonCache, project, compilerOptions); if (!packageJson) return undefined; - // Use fake options instead of actual compiler options to avoid following export map if the project uses node12 or nodenext - + // Use fake options instead of actual compiler options to avoid following export map if the project uses node16 or nodenext - // Mapping from an export map entry across packages is out of scope for now. Returned entrypoints will only be what can be // resolved from the package root under --moduleResolution node const entrypoints = getEntrypointsFromPackageJsonInfo( diff --git a/src/services/codefixes/fixModuleAndTargetOptions.ts b/src/services/codefixes/fixModuleAndTargetOptions.ts index c2d72d291e3..e60b95f6c27 100644 --- a/src/services/codefixes/fixModuleAndTargetOptions.ts +++ b/src/services/codefixes/fixModuleAndTargetOptions.ts @@ -2,8 +2,8 @@ namespace ts.codefix { registerCodeFix({ errorCodes: [ - Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code, - Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code, + Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code, + Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code, ], getCodeActions: function getCodeActionsToFixModuleAndTarget(context) { const compilerOptions = context.program.getCompilerOptions(); diff --git a/src/services/codefixes/importFixes.ts b/src/services/codefixes/importFixes.ts index 94b289cd317..5f908020168 100644 --- a/src/services/codefixes/importFixes.ts +++ b/src/services/codefixes/importFixes.ts @@ -864,7 +864,7 @@ namespace ts.codefix { case ModuleKind.None: // Fall back to the `import * as ns` style import. return ImportKind.Namespace; - case ModuleKind.Node12: + case ModuleKind.Node16: case ModuleKind.NodeNext: return importingFile.impliedNodeFormat === ModuleKind.ESNext ? ImportKind.Namespace : ImportKind.CommonJS; default: diff --git a/src/services/completions.ts b/src/services/completions.ts index a81ccfa788d..5a08941b9af 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -2761,7 +2761,7 @@ namespace ts.Completions { } // Do a relatively cheap check to bail early if all re-exports are non-importable - // due to file location or package.json dependency filtering. For non-node12+ + // due to file location or package.json dependency filtering. For non-node16+ // module resolution modes, getting past this point guarantees that we'll be // able to generate a suitable module specifier, so we can safely show a completion, // even if we defer computing the module specifier. @@ -2770,7 +2770,7 @@ namespace ts.Completions { return; } - // In node12+, module specifier resolution can fail due to modules being blocked + // In node16+, module specifier resolution can fail due to modules being blocked // by package.json `exports`. If that happens, don't show a completion item. // N.B. in this resolution mode we always try to resolve module specifiers here, // because we have to know now if it's going to fail so we can omit the completion diff --git a/src/services/documentRegistry.ts b/src/services/documentRegistry.ts index 5274aed06fd..7141bc12fd7 100644 --- a/src/services/documentRegistry.ts +++ b/src/services/documentRegistry.ts @@ -25,7 +25,7 @@ namespace ts { * shape of a the resulting SourceFile. This allows the DocumentRegistry to store * multiple copies of the same file for different compilation settings. A minimal * resolution cache is needed to fully define a source file's shape when - * the compilation settings include `module: node12`+, so providing a cache host + * the compilation settings include `module: node16`+, so providing a cache host * object should be preferred. A common host is a language service `ConfiguredProject`. * @param scriptSnapshot Text of the file. Only used if the file was not found * in the registry and a new one was created. @@ -58,7 +58,7 @@ namespace ts { * shape of a the resulting SourceFile. This allows the DocumentRegistry to store * multiple copies of the same file for different compilation settings. A minimal * resolution cache is needed to fully define a source file's shape when - * the compilation settings include `module: node12`+, so providing a cache host + * the compilation settings include `module: node16`+, so providing a cache host * object should be preferred. A common host is a language service `ConfiguredProject`. * @param scriptSnapshot Text of the file. * @param version Current version of the file. diff --git a/src/services/stringCompletions.ts b/src/services/stringCompletions.ts index 61f90c9817d..604a8337426 100644 --- a/src/services/stringCompletions.ts +++ b/src/services/stringCompletions.ts @@ -377,12 +377,12 @@ namespace ts.Completions.StringCompletions { function isEmitResolutionKindUsingNodeModules(compilerOptions: CompilerOptions): boolean { return getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.NodeJs || - getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.Node12 || + getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.Node16 || getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.NodeNext; } function isEmitModuleResolutionRespectingExportMaps(compilerOptions: CompilerOptions) { - return getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.Node12 || + return getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.Node16 || getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.NodeNext; } diff --git a/src/services/types.ts b/src/services/types.ts index 385f351c6aa..82ed0b94124 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -267,7 +267,7 @@ namespace ts { /* * Unlike `realpath and `readDirectory`, `readFile` and `fileExists` are now _required_ - * to properly acquire and setup source files under module: node12+ modes. + * to properly acquire and setup source files under module: node16+ modes. */ readFile(path: string, encoding?: string): string | undefined; fileExists(path: string): boolean; diff --git a/src/services/utilities.ts b/src/services/utilities.ts index a2f5846b82e..18f85ceb264 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1929,11 +1929,11 @@ namespace ts { } export function moduleResolutionRespectsExports(moduleResolution: ModuleResolutionKind): boolean { - return moduleResolution >= ModuleResolutionKind.Node12 && moduleResolution <= ModuleResolutionKind.NodeNext; + return moduleResolution >= ModuleResolutionKind.Node16 && moduleResolution <= ModuleResolutionKind.NodeNext; } export function moduleResolutionUsesNodeModules(moduleResolution: ModuleResolutionKind): boolean { - return moduleResolution === ModuleResolutionKind.NodeJs || moduleResolution >= ModuleResolutionKind.Node12 && moduleResolution <= ModuleResolutionKind.NodeNext; + return moduleResolution === ModuleResolutionKind.NodeJs || moduleResolution >= ModuleResolutionKind.Node16 && moduleResolution <= ModuleResolutionKind.NodeNext; } export function makeImportIfNecessary(defaultImport: Identifier | undefined, namedImports: readonly ImportSpecifier[] | undefined, moduleSpecifier: string, quotePreference: QuotePreference): ImportDeclaration | undefined { diff --git a/src/testRunner/unittests/config/commandLineParsing.ts b/src/testRunner/unittests/config/commandLineParsing.ts index 0c9a9fd954b..e2b48977106 100644 --- a/src/testRunner/unittests/config/commandLineParsing.ts +++ b/src/testRunner/unittests/config/commandLineParsing.ts @@ -159,7 +159,7 @@ namespace ts { start: undefined, length: undefined, }, { - messageText: "Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node12', 'nodenext'.", + messageText: "Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'nodenext'.", category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category, code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, @@ -237,7 +237,7 @@ namespace ts { start: undefined, length: undefined, }, { - messageText: "Argument for '--moduleResolution' option must be: 'node', 'classic', 'node12', 'nodenext'.", + messageText: "Argument for '--moduleResolution' option must be: 'node', 'classic', 'node16', 'nodenext'.", category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category, code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, diff --git a/src/testRunner/unittests/tsbuild/moduleResolution.ts b/src/testRunner/unittests/tsbuild/moduleResolution.ts index 0ac72229362..1a6a72fcb23 100644 --- a/src/testRunner/unittests/tsbuild/moduleResolution.ts +++ b/src/testRunner/unittests/tsbuild/moduleResolution.ts @@ -90,7 +90,7 @@ namespace ts.tscWatch { content: JSON.stringify({ compilerOptions: { outDir: "build", - module: "node12", + module: "node16", }, references: [{ path: "../pkg2" }] }) @@ -109,7 +109,7 @@ namespace ts.tscWatch { compilerOptions: { composite: true, outDir: "build", - module: "node12", + module: "node16", } }) }, diff --git a/src/testRunner/unittests/tsbuild/moduleSpecifiers.ts b/src/testRunner/unittests/tsbuild/moduleSpecifiers.ts index 9c560a1bd6f..19b47f2eb83 100644 --- a/src/testRunner/unittests/tsbuild/moduleSpecifiers.ts +++ b/src/testRunner/unittests/tsbuild/moduleSpecifiers.ts @@ -89,7 +89,7 @@ namespace ts { }); }); - // https://github.com/microsoft/TypeScript/issues/44434 but with `module: node12`, some `exports` maps blocking direct access, and no `baseUrl` + // https://github.com/microsoft/TypeScript/issues/44434 but with `module: node16`, some `exports` maps blocking direct access, and no `baseUrl` describe("unittests:: tsbuild:: moduleSpecifiers:: synthesized module specifiers across referenced projects resolve correctly", () => { verifyTsc({ scenario: "moduleSpecifiers", @@ -140,7 +140,7 @@ namespace ts { { "compilerOptions": { "declaration": true, - "module": "node12" + "module": "node16" } }`, "/src/src-types/package.json": Utils.dedent` diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 1e389228866..f7e45674ac0 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2063,7 +2063,7 @@ declare namespace ts { hasNoDefaultLib: boolean; languageVersion: ScriptTarget; /** - * When `module` is `Node12` or `NodeNext`, this field controls whether the + * When `module` is `Node16` or `NodeNext`, this field controls whether the * source file in question is an ESNext-output-format file, or a CommonJS-output-format * module. This is derived by the module resolver as it looks up the file, since * it is derived from either the file extension of the module, or the containing @@ -2893,7 +2893,7 @@ declare namespace ts { export enum ModuleResolutionKind { Classic = 1, NodeJs = 2, - Node12 = 3, + Node16 = 3, NodeNext = 99 } export enum ModuleDetectionKind { @@ -2902,7 +2902,7 @@ declare namespace ts { */ Legacy = 1, /** - * Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution: node12+ + * Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution: node16+ */ Auto = 2, /** @@ -3074,7 +3074,7 @@ declare namespace ts { ES2020 = 6, ES2022 = 7, ESNext = 99, - Node12 = 100, + Node16 = 100, NodeNext = 199 } export enum JsxEmit { @@ -4818,7 +4818,7 @@ declare namespace ts { /** * Controls the format the file is detected as - this can be derived from only the path * and files on disk, but needs to be done with a module resolution cache in scope to be performant. - * This is usually `undefined` for compilations that do not have `moduleResolution` values of `node12` or `nodenext`. + * This is usually `undefined` for compilations that do not have `moduleResolution` values of `node16` or `nodenext`. */ impliedNodeFormat?: ModuleKind.ESNext | ModuleKind.CommonJS; /** @@ -6822,7 +6822,7 @@ declare namespace ts { * shape of a the resulting SourceFile. This allows the DocumentRegistry to store * multiple copies of the same file for different compilation settings. A minimal * resolution cache is needed to fully define a source file's shape when - * the compilation settings include `module: node12`+, so providing a cache host + * the compilation settings include `module: node16`+, so providing a cache host * object should be preferred. A common host is a language service `ConfiguredProject`. * @param scriptSnapshot Text of the file. Only used if the file was not found * in the registry and a new one was created. @@ -6841,7 +6841,7 @@ declare namespace ts { * shape of a the resulting SourceFile. This allows the DocumentRegistry to store * multiple copies of the same file for different compilation settings. A minimal * resolution cache is needed to fully define a source file's shape when - * the compilation settings include `module: node12`+, so providing a cache host + * the compilation settings include `module: node16`+, so providing a cache host * object should be preferred. A common host is a language service `ConfiguredProject`. * @param scriptSnapshot Text of the file. * @param version Current version of the file. diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index c1fc7000c4b..fb0a5a0c1e7 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2063,7 +2063,7 @@ declare namespace ts { hasNoDefaultLib: boolean; languageVersion: ScriptTarget; /** - * When `module` is `Node12` or `NodeNext`, this field controls whether the + * When `module` is `Node16` or `NodeNext`, this field controls whether the * source file in question is an ESNext-output-format file, or a CommonJS-output-format * module. This is derived by the module resolver as it looks up the file, since * it is derived from either the file extension of the module, or the containing @@ -2893,7 +2893,7 @@ declare namespace ts { export enum ModuleResolutionKind { Classic = 1, NodeJs = 2, - Node12 = 3, + Node16 = 3, NodeNext = 99 } export enum ModuleDetectionKind { @@ -2902,7 +2902,7 @@ declare namespace ts { */ Legacy = 1, /** - * Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution: node12+ + * Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution: node16+ */ Auto = 2, /** @@ -3074,7 +3074,7 @@ declare namespace ts { ES2020 = 6, ES2022 = 7, ESNext = 99, - Node12 = 100, + Node16 = 100, NodeNext = 199 } export enum JsxEmit { @@ -4818,7 +4818,7 @@ declare namespace ts { /** * Controls the format the file is detected as - this can be derived from only the path * and files on disk, but needs to be done with a module resolution cache in scope to be performant. - * This is usually `undefined` for compilations that do not have `moduleResolution` values of `node12` or `nodenext`. + * This is usually `undefined` for compilations that do not have `moduleResolution` values of `node16` or `nodenext`. */ impliedNodeFormat?: ModuleKind.ESNext | ModuleKind.CommonJS; /** @@ -6822,7 +6822,7 @@ declare namespace ts { * shape of a the resulting SourceFile. This allows the DocumentRegistry to store * multiple copies of the same file for different compilation settings. A minimal * resolution cache is needed to fully define a source file's shape when - * the compilation settings include `module: node12`+, so providing a cache host + * the compilation settings include `module: node16`+, so providing a cache host * object should be preferred. A common host is a language service `ConfiguredProject`. * @param scriptSnapshot Text of the file. Only used if the file was not found * in the registry and a new one was created. @@ -6841,7 +6841,7 @@ declare namespace ts { * shape of a the resulting SourceFile. This allows the DocumentRegistry to store * multiple copies of the same file for different compilation settings. A minimal * resolution cache is needed to fully define a source file's shape when - * the compilation settings include `module: node12`+, so providing a cache host + * the compilation settings include `module: node16`+, so providing a cache host * object should be preferred. A common host is a language service `ConfiguredProject`. * @param scriptSnapshot Text of the file. * @param version Current version of the file. diff --git a/tests/baselines/reference/awaitInNonAsyncFunction.errors.txt b/tests/baselines/reference/awaitInNonAsyncFunction.errors.txt index 0c8ac2b8ec9..f97a066c8c8 100644 --- a/tests/baselines/reference/awaitInNonAsyncFunction.errors.txt +++ b/tests/baselines/reference/awaitInNonAsyncFunction.errors.txt @@ -12,8 +12,8 @@ tests/cases/compiler/awaitInNonAsyncFunction.ts(30,9): error TS1103: 'for await' tests/cases/compiler/awaitInNonAsyncFunction.ts(31,5): error TS1308: 'await' expressions are only allowed within async functions and at the top levels of modules. tests/cases/compiler/awaitInNonAsyncFunction.ts(34,7): error TS1103: 'for await' loops are only allowed within async functions and at the top levels of modules. tests/cases/compiler/awaitInNonAsyncFunction.ts(35,5): error TS1308: 'await' expressions are only allowed within async functions and at the top levels of modules. -tests/cases/compiler/awaitInNonAsyncFunction.ts(39,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. -tests/cases/compiler/awaitInNonAsyncFunction.ts(40,1): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +tests/cases/compiler/awaitInNonAsyncFunction.ts(39,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +tests/cases/compiler/awaitInNonAsyncFunction.ts(40,1): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. ==== tests/cases/compiler/awaitInNonAsyncFunction.ts (16 errors) ==== @@ -97,7 +97,7 @@ tests/cases/compiler/awaitInNonAsyncFunction.ts(40,1): error TS1378: Top-level ' for await (const _ of []); ~~~~~ -!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. await null; ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. \ No newline at end of file +!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. \ No newline at end of file diff --git a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=node16).js b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=node16).js new file mode 100644 index 00000000000..8aed6c9347a --- /dev/null +++ b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=node16).js @@ -0,0 +1,27 @@ +//// [a.ts] +declare var dec: any, __decorate: any; +@dec export class A { +} + +const o = { a: 1 }; +const y = { ...o }; + + +//// [a.js] +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.A = void 0; +let A = class A { +}; +A = __decorate([ + dec +], A); +exports.A = A; +const o = { a: 1 }; +const y = Object.assign({}, o); diff --git a/tests/baselines/reference/importAssertion1(module=commonjs).errors.txt b/tests/baselines/reference/importAssertion1(module=commonjs).errors.txt index fa365df88cd..b7a88e8ce62 100644 --- a/tests/baselines/reference/importAssertion1(module=commonjs).errors.txt +++ b/tests/baselines/reference/importAssertion1(module=commonjs).errors.txt @@ -3,14 +3,14 @@ tests/cases/conformance/importAssertion/1.ts(2,28): error TS2821: Import asserti tests/cases/conformance/importAssertion/1.ts(3,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. tests/cases/conformance/importAssertion/2.ts(1,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. tests/cases/conformance/importAssertion/2.ts(2,38): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. -tests/cases/conformance/importAssertion/3.ts(2,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'. -tests/cases/conformance/importAssertion/3.ts(3,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'. -tests/cases/conformance/importAssertion/3.ts(4,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'. -tests/cases/conformance/importAssertion/3.ts(5,26): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'. -tests/cases/conformance/importAssertion/3.ts(7,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'. +tests/cases/conformance/importAssertion/3.ts(2,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. +tests/cases/conformance/importAssertion/3.ts(3,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. +tests/cases/conformance/importAssertion/3.ts(4,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. +tests/cases/conformance/importAssertion/3.ts(5,26): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. +tests/cases/conformance/importAssertion/3.ts(7,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. tests/cases/conformance/importAssertion/3.ts(8,11): message TS1450: Dynamic imports can only accept a module specifier and an optional assertion as arguments -tests/cases/conformance/importAssertion/3.ts(9,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'. -tests/cases/conformance/importAssertion/3.ts(10,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'. +tests/cases/conformance/importAssertion/3.ts(9,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. +tests/cases/conformance/importAssertion/3.ts(10,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. tests/cases/conformance/importAssertion/3.ts(10,52): error TS1009: Trailing comma not allowed. @@ -49,29 +49,29 @@ tests/cases/conformance/importAssertion/3.ts(10,52): error TS1009: Trailing comm const a = import('./0') const b = import('./0', { assert: { type: "json" } }) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. const c = import('./0', { assert: { type: "json", ttype: "typo" } }) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. const d = import('./0', { assert: {} }) ~~~~~~~~~~~~~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. const dd = import('./0', {}) ~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. declare function foo(): any; const e = import('./0', foo()) ~~~~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. const f = import() ~~~~~~~~ !!! message TS1450: Dynamic imports can only accept a module specifier and an optional assertion as arguments const g = import('./0', {}, {}) ~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. const h = import('./0', { assert: { type: "json" }},) ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. ~ !!! error TS1009: Trailing comma not allowed. diff --git a/tests/baselines/reference/importAssertion1(module=es2015).errors.txt b/tests/baselines/reference/importAssertion1(module=es2015).errors.txt index fb959409350..266938cb7cd 100644 --- a/tests/baselines/reference/importAssertion1(module=es2015).errors.txt +++ b/tests/baselines/reference/importAssertion1(module=es2015).errors.txt @@ -3,15 +3,15 @@ tests/cases/conformance/importAssertion/1.ts(2,28): error TS2821: Import asserti tests/cases/conformance/importAssertion/1.ts(3,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. tests/cases/conformance/importAssertion/2.ts(1,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. tests/cases/conformance/importAssertion/2.ts(2,38): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. -tests/cases/conformance/importAssertion/3.ts(1,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. -tests/cases/conformance/importAssertion/3.ts(2,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. -tests/cases/conformance/importAssertion/3.ts(3,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. -tests/cases/conformance/importAssertion/3.ts(4,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. -tests/cases/conformance/importAssertion/3.ts(5,12): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. -tests/cases/conformance/importAssertion/3.ts(7,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. -tests/cases/conformance/importAssertion/3.ts(8,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. -tests/cases/conformance/importAssertion/3.ts(9,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. -tests/cases/conformance/importAssertion/3.ts(10,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. +tests/cases/conformance/importAssertion/3.ts(1,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. +tests/cases/conformance/importAssertion/3.ts(2,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. +tests/cases/conformance/importAssertion/3.ts(3,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. +tests/cases/conformance/importAssertion/3.ts(4,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. +tests/cases/conformance/importAssertion/3.ts(5,12): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. +tests/cases/conformance/importAssertion/3.ts(7,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. +tests/cases/conformance/importAssertion/3.ts(8,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. +tests/cases/conformance/importAssertion/3.ts(9,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. +tests/cases/conformance/importAssertion/3.ts(10,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. ==== tests/cases/conformance/importAssertion/0.ts (0 errors) ==== @@ -48,31 +48,31 @@ tests/cases/conformance/importAssertion/3.ts(10,11): error TS1323: Dynamic impor ==== tests/cases/conformance/importAssertion/3.ts (9 errors) ==== const a = import('./0') ~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. const b = import('./0', { assert: { type: "json" } }) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. const c = import('./0', { assert: { type: "json", ttype: "typo" } }) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. const d = import('./0', { assert: {} }) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. const dd = import('./0', {}) ~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. declare function foo(): any; const e = import('./0', foo()) ~~~~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. const f = import() ~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. const g = import('./0', {}, {}) ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. const h = import('./0', { assert: { type: "json" }},) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. \ No newline at end of file diff --git a/tests/baselines/reference/importCallExpressionErrorInES2015.errors.txt b/tests/baselines/reference/importCallExpressionErrorInES2015.errors.txt index 43821679002..5fbfb92fa50 100644 --- a/tests/baselines/reference/importCallExpressionErrorInES2015.errors.txt +++ b/tests/baselines/reference/importCallExpressionErrorInES2015.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/dynamicImport/1.ts(1,1): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. -tests/cases/conformance/dynamicImport/1.ts(2,10): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. -tests/cases/conformance/dynamicImport/1.ts(8,16): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. +tests/cases/conformance/dynamicImport/1.ts(1,1): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. +tests/cases/conformance/dynamicImport/1.ts(2,10): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. +tests/cases/conformance/dynamicImport/1.ts(8,16): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. ==== tests/cases/conformance/dynamicImport/0.ts (0 errors) ==== @@ -9,10 +9,10 @@ tests/cases/conformance/dynamicImport/1.ts(8,16): error TS1323: Dynamic imports ==== tests/cases/conformance/dynamicImport/1.ts (3 errors) ==== import("./0"); ~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. var p1 = import("./0"); ~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. p1.then(zero => { return zero.foo(); }) @@ -20,5 +20,5 @@ tests/cases/conformance/dynamicImport/1.ts(8,16): error TS1323: Dynamic imports function foo() { const p2 = import("./0"); ~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. } \ No newline at end of file diff --git a/tests/baselines/reference/importCallExpressionGrammarError.errors.txt b/tests/baselines/reference/importCallExpressionGrammarError.errors.txt index 063b200b672..ee698678c3c 100644 --- a/tests/baselines/reference/importCallExpressionGrammarError.errors.txt +++ b/tests/baselines/reference/importCallExpressionGrammarError.errors.txt @@ -2,7 +2,7 @@ tests/cases/conformance/dynamicImport/importCallExpressionGrammarError.ts(5,8): tests/cases/conformance/dynamicImport/importCallExpressionGrammarError.ts(7,17): error TS1325: Argument of dynamic import cannot be spread element. tests/cases/conformance/dynamicImport/importCallExpressionGrammarError.ts(8,12): message TS1450: Dynamic imports can only accept a module specifier and an optional assertion as arguments tests/cases/conformance/dynamicImport/importCallExpressionGrammarError.ts(9,19): error TS2307: Cannot find module 'pathToModule' or its corresponding type declarations. -tests/cases/conformance/dynamicImport/importCallExpressionGrammarError.ts(9,35): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'. +tests/cases/conformance/dynamicImport/importCallExpressionGrammarError.ts(9,35): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. tests/cases/conformance/dynamicImport/importCallExpressionGrammarError.ts(9,35): error TS2559: Type '"secondModule"' has no properties in common with type 'ImportCallOptions'. @@ -25,6 +25,6 @@ tests/cases/conformance/dynamicImport/importCallExpressionGrammarError.ts(9,35): ~~~~~~~~~~~~~~ !!! error TS2307: Cannot find module 'pathToModule' or its corresponding type declarations. ~~~~~~~~~~~~~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'. +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. ~~~~~~~~~~~~~~ !!! error TS2559: Type '"secondModule"' has no properties in common with type 'ImportCallOptions'. \ No newline at end of file diff --git a/tests/baselines/reference/importCallExpressionNestedES2015.errors.txt b/tests/baselines/reference/importCallExpressionNestedES2015.errors.txt index 5e37388bc02..de342b78047 100644 --- a/tests/baselines/reference/importCallExpressionNestedES2015.errors.txt +++ b/tests/baselines/reference/importCallExpressionNestedES2015.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/dynamicImport/index.ts(2,18): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. -tests/cases/conformance/dynamicImport/index.ts(2,32): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. +tests/cases/conformance/dynamicImport/index.ts(2,18): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. +tests/cases/conformance/dynamicImport/index.ts(2,32): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. ==== tests/cases/conformance/dynamicImport/foo.ts (0 errors) ==== @@ -9,7 +9,7 @@ tests/cases/conformance/dynamicImport/index.ts(2,32): error TS1323: Dynamic impo async function foo() { return await import((await import("./foo")).default); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. ~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. } \ No newline at end of file diff --git a/tests/baselines/reference/importCallExpressionNestedES20152.errors.txt b/tests/baselines/reference/importCallExpressionNestedES20152.errors.txt index 5e37388bc02..de342b78047 100644 --- a/tests/baselines/reference/importCallExpressionNestedES20152.errors.txt +++ b/tests/baselines/reference/importCallExpressionNestedES20152.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/dynamicImport/index.ts(2,18): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. -tests/cases/conformance/dynamicImport/index.ts(2,32): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. +tests/cases/conformance/dynamicImport/index.ts(2,18): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. +tests/cases/conformance/dynamicImport/index.ts(2,32): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. ==== tests/cases/conformance/dynamicImport/foo.ts (0 errors) ==== @@ -9,7 +9,7 @@ tests/cases/conformance/dynamicImport/index.ts(2,32): error TS1323: Dynamic impo async function foo() { return await import((await import("./foo")).default); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. ~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'. +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. } \ No newline at end of file diff --git a/tests/baselines/reference/importMeta(module=commonjs,target=es5).errors.txt b/tests/baselines/reference/importMeta(module=commonjs,target=es5).errors.txt index 9c82043ec74..2f65f3fc12c 100644 --- a/tests/baselines/reference/importMeta(module=commonjs,target=es5).errors.txt +++ b/tests/baselines/reference/importMeta(module=commonjs,target=es5).errors.txt @@ -1,25 +1,25 @@ error TS2468: Cannot find global value 'Promise'. -tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,32): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,32): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,44): error TS2339: Property 'blah' does not exist on type 'ImportMeta'. -tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,51): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,51): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,63): error TS2339: Property 'blue' does not exist on type 'ImportMeta'. -tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,70): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. -tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(2,1): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,70): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(2,1): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(2,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. -tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(11,21): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(11,21): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. tests/cases/conformance/es2019/importMeta/example.ts(2,2): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. -tests/cases/conformance/es2019/importMeta/example.ts(3,59): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. -tests/cases/conformance/es2019/importMeta/example.ts(6,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/example.ts(3,59): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/example.ts(6,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. tests/cases/conformance/es2019/importMeta/example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'. -tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(1,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. -tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(2,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(1,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(2,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(2,23): error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? -tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(3,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(3,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(3,23): error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? -tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(1,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. -tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(2,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(1,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(2,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(2,22): error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? -tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,22): error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? @@ -31,12 +31,12 @@ tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,22): error TS !!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString()); ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. const blob = await response.blob(); const size = import.meta.scriptElement.dataset.size || 300; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. ~~~~~~~~~~~~~ !!! error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'. @@ -50,48 +50,48 @@ tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,22): error TS ==== tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts (5 errors) ==== export let x = import.meta; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. export let y = import.metal; ~~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. ~~~~~ !!! error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? export let z = import.import.import.malkovich; ~~~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. ~~~~~~ !!! error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? ==== tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts (5 errors) ==== let globalA = import.meta; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. let globalB = import.metal; ~~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. ~~~~~ !!! error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? let globalC = import.import.import.malkovich; ~~~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. ~~~~~~ !!! error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? ==== tests/cases/conformance/es2019/importMeta/assignmentTargets.ts (8 errors) ==== export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'ImportMeta'. ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. ~~~~ !!! error TS2339: Property 'blue' does not exist on type 'ImportMeta'. ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. import.meta = foo; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. ~~~~~~~~~~~ !!! error TS2364: The left-hand side of an assignment expression must be a variable or a property access. @@ -104,4 +104,4 @@ tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,22): error TS const { a, b, c } = import.meta.wellKnownProperty; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. \ No newline at end of file +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. \ No newline at end of file diff --git a/tests/baselines/reference/importMeta(module=commonjs,target=esnext).errors.txt b/tests/baselines/reference/importMeta(module=commonjs,target=esnext).errors.txt index 9c82043ec74..2f65f3fc12c 100644 --- a/tests/baselines/reference/importMeta(module=commonjs,target=esnext).errors.txt +++ b/tests/baselines/reference/importMeta(module=commonjs,target=esnext).errors.txt @@ -1,25 +1,25 @@ error TS2468: Cannot find global value 'Promise'. -tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,32): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,32): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,44): error TS2339: Property 'blah' does not exist on type 'ImportMeta'. -tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,51): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,51): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,63): error TS2339: Property 'blue' does not exist on type 'ImportMeta'. -tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,70): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. -tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(2,1): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,70): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(2,1): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(2,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. -tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(11,21): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(11,21): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. tests/cases/conformance/es2019/importMeta/example.ts(2,2): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. -tests/cases/conformance/es2019/importMeta/example.ts(3,59): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. -tests/cases/conformance/es2019/importMeta/example.ts(6,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/example.ts(3,59): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/example.ts(6,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. tests/cases/conformance/es2019/importMeta/example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'. -tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(1,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. -tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(2,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(1,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(2,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(2,23): error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? -tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(3,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(3,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(3,23): error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? -tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(1,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. -tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(2,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(1,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(2,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(2,22): error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? -tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,15): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,22): error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? @@ -31,12 +31,12 @@ tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,22): error TS !!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option. const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString()); ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. const blob = await response.blob(); const size = import.meta.scriptElement.dataset.size || 300; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. ~~~~~~~~~~~~~ !!! error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'. @@ -50,48 +50,48 @@ tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,22): error TS ==== tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts (5 errors) ==== export let x = import.meta; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. export let y = import.metal; ~~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. ~~~~~ !!! error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? export let z = import.import.import.malkovich; ~~~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. ~~~~~~ !!! error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? ==== tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts (5 errors) ==== let globalA = import.meta; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. let globalB = import.metal; ~~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. ~~~~~ !!! error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? let globalC = import.import.import.malkovich; ~~~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. ~~~~~~ !!! error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? ==== tests/cases/conformance/es2019/importMeta/assignmentTargets.ts (8 errors) ==== export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'ImportMeta'. ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. ~~~~ !!! error TS2339: Property 'blue' does not exist on type 'ImportMeta'. ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. import.meta = foo; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. ~~~~~~~~~~~ !!! error TS2364: The left-hand side of an assignment expression must be a variable or a property access. @@ -104,4 +104,4 @@ tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,22): error TS const { a, b, c } = import.meta.wellKnownProperty; ~~~~~~~~~~~ -!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'. \ No newline at end of file +!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'. \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node16).js b/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node16).js new file mode 100644 index 00000000000..843190b26d3 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node16).js @@ -0,0 +1,19 @@ +//// [tests/cases/compiler/moduleResolutionWithModule.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": "./entrypoint.js" +} +//// [entrypoint.d.ts] +export declare function thing(): void; +//// [index.ts] +import * as p from "pkg"; +p.thing(); + +//// [index.js] +"use strict"; +exports.__esModule = true; +var p = require("pkg"); +p.thing(); diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node16).symbols b/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node16).symbols new file mode 100644 index 00000000000..8ab99790e5f --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node16).symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts === +export declare function thing(): void; +>thing : Symbol(thing, Decl(entrypoint.d.ts, 0, 0)) + +=== tests/cases/compiler/index.ts === +import * as p from "pkg"; +>p : Symbol(p, Decl(index.ts, 0, 6)) + +p.thing(); +>p.thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0)) +>p : Symbol(p, Decl(index.ts, 0, 6)) +>thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node16).types b/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node16).types new file mode 100644 index 00000000000..c49641fe551 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node16).types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts === +export declare function thing(): void; +>thing : () => void + +=== tests/cases/compiler/index.ts === +import * as p from "pkg"; +>p : typeof p + +p.thing(); +>p.thing() : void +>p.thing : () => void +>p : typeof p +>thing : () => void + diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node).errors.txt b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node).errors.txt new file mode 100644 index 00000000000..dc0e81b0259 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node).errors.txt @@ -0,0 +1,16 @@ +tests/cases/compiler/index.ts(1,20): error TS2307: Cannot find module 'pkg' or its corresponding type declarations. + + +==== tests/cases/compiler/node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": "./entrypoint.js" + } +==== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts (0 errors) ==== + export declare function thing(): void; +==== tests/cases/compiler/index.ts (1 errors) ==== + import * as p from "pkg"; + ~~~~~ +!!! error TS2307: Cannot find module 'pkg' or its corresponding type declarations. + p.thing(); \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node).js b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node).js new file mode 100644 index 00000000000..23844cf6bab --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node).js @@ -0,0 +1,42 @@ +//// [tests/cases/compiler/moduleResolutionWithModule.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": "./entrypoint.js" +} +//// [entrypoint.d.ts] +export declare function thing(): void; +//// [index.ts] +import * as p from "pkg"; +p.thing(); + +//// [index.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const p = __importStar(require("pkg")); +p.thing(); diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node).symbols b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node).symbols new file mode 100644 index 00000000000..40ac39fdf75 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node).symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts === +export declare function thing(): void; +>thing : Symbol(thing, Decl(entrypoint.d.ts, 0, 0)) + +=== tests/cases/compiler/index.ts === +import * as p from "pkg"; +>p : Symbol(p, Decl(index.ts, 0, 6)) + +p.thing(); +>p : Symbol(p, Decl(index.ts, 0, 6)) + diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node).types b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node).types new file mode 100644 index 00000000000..45eed8eb127 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node).types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts === +export declare function thing(): void; +>thing : () => void + +=== tests/cases/compiler/index.ts === +import * as p from "pkg"; +>p : any + +p.thing(); +>p.thing() : any +>p.thing : any +>p : any +>thing : any + diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node16).js b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node16).js new file mode 100644 index 00000000000..23844cf6bab --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node16).js @@ -0,0 +1,42 @@ +//// [tests/cases/compiler/moduleResolutionWithModule.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": "./entrypoint.js" +} +//// [entrypoint.d.ts] +export declare function thing(): void; +//// [index.ts] +import * as p from "pkg"; +p.thing(); + +//// [index.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const p = __importStar(require("pkg")); +p.thing(); diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node16).symbols b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node16).symbols new file mode 100644 index 00000000000..8ab99790e5f --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node16).symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts === +export declare function thing(): void; +>thing : Symbol(thing, Decl(entrypoint.d.ts, 0, 0)) + +=== tests/cases/compiler/index.ts === +import * as p from "pkg"; +>p : Symbol(p, Decl(index.ts, 0, 6)) + +p.thing(); +>p.thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0)) +>p : Symbol(p, Decl(index.ts, 0, 6)) +>thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node16).types b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node16).types new file mode 100644 index 00000000000..c49641fe551 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=node16).types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts === +export declare function thing(): void; +>thing : () => void + +=== tests/cases/compiler/index.ts === +import * as p from "pkg"; +>p : typeof p + +p.thing(); +>p.thing() : void +>p.thing : () => void +>p : typeof p +>thing : () => void + diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=nodenext).js b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=nodenext).js new file mode 100644 index 00000000000..23844cf6bab --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=nodenext).js @@ -0,0 +1,42 @@ +//// [tests/cases/compiler/moduleResolutionWithModule.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": "./entrypoint.js" +} +//// [entrypoint.d.ts] +export declare function thing(): void; +//// [index.ts] +import * as p from "pkg"; +p.thing(); + +//// [index.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const p = __importStar(require("pkg")); +p.thing(); diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=nodenext).symbols b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=nodenext).symbols new file mode 100644 index 00000000000..8ab99790e5f --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=nodenext).symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts === +export declare function thing(): void; +>thing : Symbol(thing, Decl(entrypoint.d.ts, 0, 0)) + +=== tests/cases/compiler/index.ts === +import * as p from "pkg"; +>p : Symbol(p, Decl(index.ts, 0, 6)) + +p.thing(); +>p.thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0)) +>p : Symbol(p, Decl(index.ts, 0, 6)) +>thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=nodenext).types b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=nodenext).types new file mode 100644 index 00000000000..c49641fe551 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=node16,moduleresolution=nodenext).types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts === +export declare function thing(): void; +>thing : () => void + +=== tests/cases/compiler/index.ts === +import * as p from "pkg"; +>p : typeof p + +p.thing(); +>p.thing() : void +>p.thing : () => void +>p : typeof p +>thing : () => void + diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node16).js b/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node16).js new file mode 100644 index 00000000000..23844cf6bab --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node16).js @@ -0,0 +1,42 @@ +//// [tests/cases/compiler/moduleResolutionWithModule.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": "./entrypoint.js" +} +//// [entrypoint.d.ts] +export declare function thing(): void; +//// [index.ts] +import * as p from "pkg"; +p.thing(); + +//// [index.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const p = __importStar(require("pkg")); +p.thing(); diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node16).symbols b/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node16).symbols new file mode 100644 index 00000000000..8ab99790e5f --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node16).symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts === +export declare function thing(): void; +>thing : Symbol(thing, Decl(entrypoint.d.ts, 0, 0)) + +=== tests/cases/compiler/index.ts === +import * as p from "pkg"; +>p : Symbol(p, Decl(index.ts, 0, 6)) + +p.thing(); +>p.thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0)) +>p : Symbol(p, Decl(index.ts, 0, 6)) +>thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node16).types b/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node16).types new file mode 100644 index 00000000000..c49641fe551 --- /dev/null +++ b/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node16).types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts === +export declare function thing(): void; +>thing : () => void + +=== tests/cases/compiler/index.ts === +import * as p from "pkg"; +>p : typeof p + +p.thing(); +>p.thing() : void +>p.thing : () => void +>p : typeof p +>thing : () => void + diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension1.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension1.errors.txt index 5f3cbbc121c..30a2033c2b1 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension1.errors.txt +++ b/tests/baselines/reference/moduleResolutionWithoutExtension1.errors.txt @@ -1,5 +1,5 @@ -/src/bar.mts(2,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.mjs'? -/src/bar.mts(3,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +/src/bar.mts(2,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './foo.mjs'? +/src/bar.mts(3,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. ==== /src/foo.mts (0 errors) ==== @@ -11,8 +11,8 @@ // Extensionless relative path ES import in an ES module import { foo } from "./foo"; // should error, suggest adding ".mjs" ~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './foo.mjs'? import { baz } from "./baz"; // should error, ask for extension, no extension suggestion ~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension3.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension3.errors.txt index 0c753a10299..356bbda92dd 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension3.errors.txt +++ b/tests/baselines/reference/moduleResolutionWithoutExtension3.errors.txt @@ -1,4 +1,4 @@ -/src/bar.mts(2,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.jsx'? +/src/bar.mts(2,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './foo.jsx'? ==== /src/foo.tsx (0 errors) ==== @@ -10,5 +10,5 @@ // Extensionless relative path ES import in an ES module import { foo } from "./foo"; // should error, suggest adding ".jsx" ~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.jsx'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './foo.jsx'? \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension4.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension4.errors.txt index afd24269d69..917ae242e7a 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension4.errors.txt +++ b/tests/baselines/reference/moduleResolutionWithoutExtension4.errors.txt @@ -1,4 +1,4 @@ -/src/bar.mts(2,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.js'? +/src/bar.mts(2,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './foo.js'? ==== /src/foo.tsx (0 errors) ==== @@ -10,5 +10,5 @@ // Extensionless relative path ES import in an ES module import { foo } from "./foo"; // should error, suggest adding ".js" ~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './foo.js'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './foo.js'? \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension5.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension5.errors.txt index b4b0a89ae97..2660f052ec9 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension5.errors.txt +++ b/tests/baselines/reference/moduleResolutionWithoutExtension5.errors.txt @@ -1,8 +1,8 @@ -/src/buzz.mts(2,8): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +/src/buzz.mts(2,8): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. ==== /src/buzz.mts (1 errors) ==== // Extensionless relative path dynamic import in an ES module import("./foo").then(x => x); // should error, ask for extension ~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. \ No newline at end of file +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithoutExtension8.errors.txt b/tests/baselines/reference/moduleResolutionWithoutExtension8.errors.txt index c990522c6c7..b857c4d7fbc 100644 --- a/tests/baselines/reference/moduleResolutionWithoutExtension8.errors.txt +++ b/tests/baselines/reference/moduleResolutionWithoutExtension8.errors.txt @@ -1,8 +1,8 @@ -/src/bar.cts(2,8): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +/src/bar.cts(2,8): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. ==== /src/bar.cts (1 errors) ==== // Extensionless relative path dynamic import in a cjs module import("./foo").then(x => x); // should error, ask for extension ~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. \ No newline at end of file +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. \ No newline at end of file diff --git a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).errors.txt b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).errors.txt new file mode 100644 index 00000000000..bdf6aba250c --- /dev/null +++ b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/node/allowJs/index.cjs(2,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + + +==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== + // esm format file + import * as self from "package"; + self; +==== tests/cases/conformance/node/allowJs/index.mjs (0 errors) ==== + // esm format file + import * as self from "package"; + self; +==== tests/cases/conformance/node/allowJs/index.cjs (1 errors) ==== + // esm format file + import * as self from "package"; + ~~~~~~~~~ +!!! error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + self; +==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).js b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).js new file mode 100644 index 00000000000..aeafa06e281 --- /dev/null +++ b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).js @@ -0,0 +1,67 @@ +//// [tests/cases/conformance/node/allowJs/nodeAllowJsPackageSelfName.ts] //// + +//// [index.js] +// esm format file +import * as self from "package"; +self; +//// [index.mjs] +// esm format file +import * as self from "package"; +self; +//// [index.cjs] +// esm format file +import * as self from "package"; +self; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js" +} + +//// [index.js] +// esm format file +import * as self from "package"; +self; +//// [index.mjs] +// esm format file +import * as self from "package"; +self; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// esm format file +const self = __importStar(require("package")); +self; + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).symbols b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).symbols new file mode 100644 index 00000000000..eb9fab3a89a --- /dev/null +++ b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).symbols @@ -0,0 +1,24 @@ +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +import * as self from "package"; +>self : Symbol(self, Decl(index.js, 1, 6)) + +self; +>self : Symbol(self, Decl(index.js, 1, 6)) + +=== tests/cases/conformance/node/allowJs/index.mjs === +// esm format file +import * as self from "package"; +>self : Symbol(self, Decl(index.mjs, 1, 6)) + +self; +>self : Symbol(self, Decl(index.mjs, 1, 6)) + +=== tests/cases/conformance/node/allowJs/index.cjs === +// esm format file +import * as self from "package"; +>self : Symbol(self, Decl(index.cjs, 1, 6)) + +self; +>self : Symbol(self, Decl(index.cjs, 1, 6)) + diff --git a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).types b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).types new file mode 100644 index 00000000000..894b0d65103 --- /dev/null +++ b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).types @@ -0,0 +1,24 @@ +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +import * as self from "package"; +>self : typeof self + +self; +>self : typeof self + +=== tests/cases/conformance/node/allowJs/index.mjs === +// esm format file +import * as self from "package"; +>self : typeof self + +self; +>self : typeof self + +=== tests/cases/conformance/node/allowJs/index.cjs === +// esm format file +import * as self from "package"; +>self : typeof self + +self; +>self : typeof self + diff --git a/tests/baselines/reference/nodeModules1(module=node16).errors.txt b/tests/baselines/reference/nodeModules1(module=node16).errors.txt new file mode 100644 index 00000000000..e8bcd1c06a7 --- /dev/null +++ b/tests/baselines/reference/nodeModules1(module=node16).errors.txt @@ -0,0 +1,564 @@ +tests/cases/conformance/node/index.cts(2,21): error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.cts(3,21): error TS1471: Module './index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.cts(6,21): error TS1471: Module './subfolder/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.cts(9,21): error TS1471: Module './subfolder2/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.cts(11,22): error TS1471: Module './subfolder2/another/index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.cts(12,22): error TS1471: Module './subfolder2/another/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.cts(15,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.cts(16,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.cts(23,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.cts(24,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.cts(25,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.cts(51,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.cts(52,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.cts(59,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.cts(60,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.cts(61,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.cts(75,21): error TS2307: Cannot find module './' or its corresponding type declarations. +tests/cases/conformance/node/index.cts(76,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.cts(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(78,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(79,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.cts(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(81,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(82,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.cts(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(84,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(85,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/index.mts(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. +tests/cases/conformance/node/index.mts(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.mts(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.mts(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.mts(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/index.mts(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.mts(51,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.mts(58,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.mts(59,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.mts(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.mts(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. +tests/cases/conformance/node/index.mts(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.mts(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.mts(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.mts(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/index.ts(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. +tests/cases/conformance/node/index.ts(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.ts(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.ts(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.ts(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/index.ts(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.ts(51,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.ts(58,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.ts(59,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.ts(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.ts(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. +tests/cases/conformance/node/index.ts(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.ts(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.ts(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.ts(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + + +==== tests/cases/conformance/node/subfolder/index.ts (0 errors) ==== + // cjs format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/subfolder/index.cts (0 errors) ==== + // cjs format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/subfolder/index.mts (0 errors) ==== + // esm format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/subfolder2/index.ts (0 errors) ==== + // cjs format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/subfolder2/index.cts (0 errors) ==== + // cjs format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/subfolder2/index.mts (0 errors) ==== + // esm format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/subfolder2/another/index.ts (0 errors) ==== + // esm format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/subfolder2/another/index.mts (0 errors) ==== + // esm format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/subfolder2/another/index.cts (0 errors) ==== + // cjs format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/index.mts (27 errors) ==== + import * as m1 from "./index.js"; + import * as m2 from "./index.mjs"; + import * as m3 from "./index.cjs"; + import * as m4 from "./subfolder/index.js"; + import * as m5 from "./subfolder/index.mjs"; + import * as m6 from "./subfolder/index.cjs"; + import * as m7 from "./subfolder2/index.js"; + import * as m8 from "./subfolder2/index.mjs"; + import * as m9 from "./subfolder2/index.cjs"; + import * as m10 from "./subfolder2/another/index.js"; + import * as m11 from "./subfolder2/another/index.mjs"; + import * as m12 from "./subfolder2/another/index.cjs"; + // The next ones should all fail - esm format files have no index resolution or extension resolution + import * as m13 from "./"; + ~~~~ +!!! error TS2307: Cannot find module './' or its corresponding type declarations. + import * as m14 from "./index"; + ~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? + import * as m15 from "./subfolder"; + ~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m16 from "./subfolder/"; + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m17 from "./subfolder/index"; + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? + import * as m18 from "./subfolder2"; + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m19 from "./subfolder2/"; + ~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m20 from "./subfolder2/index"; + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? + import * as m21 from "./subfolder2/another"; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m22 from "./subfolder2/another/"; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m23 from "./subfolder2/another/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + void m1; + void m2; + void m3; + void m4; + void m5; + void m6; + void m7; + void m8; + void m9; + void m10; + void m11; + void m12; + void m13; + void m14; + void m15; + void m16; + void m17; + void m18; + void m19; + void m20; + void m21; + void m22; + void m23; + + // These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) + import m24 = require("./"); + ~~~~ +!!! error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m25 = require("./index"); + ~~~~~~~~~ +!!! error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m26 = require("./subfolder"); + import m27 = require("./subfolder/"); + import m28 = require("./subfolder/index"); + import m29 = require("./subfolder2"); + import m30 = require("./subfolder2/"); + import m31 = require("./subfolder2/index"); + import m32 = require("./subfolder2/another"); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m33 = require("./subfolder2/another/"); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m34 = require("./subfolder2/another/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + void m24; + void m25; + void m26; + void m27; + void m28; + void m29; + void m30; + void m31; + void m32; + void m33; + void m34; + + // These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution + const _m35 = import("./"); + ~~~~ +!!! error TS2307: Cannot find module './' or its corresponding type declarations. + const _m36 = import("./index"); + ~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? + const _m37 = import("./subfolder"); + ~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m38 = import("./subfolder/"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m39 = import("./subfolder/index"); + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? + const _m40 = import("./subfolder2"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m41 = import("./subfolder2/"); + ~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m42 = import("./subfolder2/index"); + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? + const _m43 = import("./subfolder2/another"); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m44 = import("./subfolder2/another/"); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m45 = import("./subfolder2/another/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + + // esm format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/index.cts (27 errors) ==== + // ESM-format imports below should issue errors + import * as m1 from "./index.js"; + ~~~~~~~~~~~~ +!!! error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as m2 from "./index.mjs"; + ~~~~~~~~~~~~~ +!!! error TS1471: Module './index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as m3 from "./index.cjs"; + import * as m4 from "./subfolder/index.js"; + import * as m5 from "./subfolder/index.mjs"; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as m6 from "./subfolder/index.cjs"; + import * as m7 from "./subfolder2/index.js"; + import * as m8 from "./subfolder2/index.mjs"; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as m9 from "./subfolder2/index.cjs"; + import * as m10 from "./subfolder2/another/index.js"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as m11 from "./subfolder2/another/index.mjs"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as m12 from "./subfolder2/another/index.cjs"; + // The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) + import * as m13 from "./"; + ~~~~ +!!! error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as m14 from "./index"; + ~~~~~~~~~ +!!! error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as m15 from "./subfolder"; + import * as m16 from "./subfolder/"; + import * as m17 from "./subfolder/index"; + import * as m18 from "./subfolder2"; + import * as m19 from "./subfolder2/"; + import * as m20 from "./subfolder2/index"; + import * as m21 from "./subfolder2/another"; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as m22 from "./subfolder2/another/"; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as m23 from "./subfolder2/another/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + void m1; + void m2; + void m3; + void m4; + void m5; + void m6; + void m7; + void m8; + void m9; + void m10; + void m11; + void m12; + void m13; + void m14; + void m15; + void m16; + void m17; + void m18; + void m19; + void m20; + void m21; + void m22; + void m23; + + // These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) + import m24 = require("./"); + ~~~~ +!!! error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m25 = require("./index"); + ~~~~~~~~~ +!!! error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m26 = require("./subfolder"); + import m27 = require("./subfolder/"); + import m28 = require("./subfolder/index"); + import m29 = require("./subfolder2"); + import m30 = require("./subfolder2/"); + import m31 = require("./subfolder2/index"); + import m32 = require("./subfolder2/another"); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m33 = require("./subfolder2/another/"); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m34 = require("./subfolder2/another/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + void m24; + void m25; + void m26; + void m27; + void m28; + void m29; + void m30; + void m31; + void m32; + void m33; + void m34; + + // These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution + const _m35 = import("./"); + ~~~~ +!!! error TS2307: Cannot find module './' or its corresponding type declarations. + const _m36 = import("./index"); + ~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? + const _m37 = import("./subfolder"); + ~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m38 = import("./subfolder/"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m39 = import("./subfolder/index"); + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? + const _m40 = import("./subfolder2"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m41 = import("./subfolder2/"); + ~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m42 = import("./subfolder2/index"); + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? + const _m43 = import("./subfolder2/another"); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m44 = import("./subfolder2/another/"); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m45 = import("./subfolder2/another/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + // cjs format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/index.ts (27 errors) ==== + import * as m1 from "./index.js"; + import * as m2 from "./index.mjs"; + import * as m3 from "./index.cjs"; + import * as m4 from "./subfolder/index.js"; + import * as m5 from "./subfolder/index.mjs"; + import * as m6 from "./subfolder/index.cjs"; + import * as m7 from "./subfolder2/index.js"; + import * as m8 from "./subfolder2/index.mjs"; + import * as m9 from "./subfolder2/index.cjs"; + import * as m10 from "./subfolder2/another/index.js"; + import * as m11 from "./subfolder2/another/index.mjs"; + import * as m12 from "./subfolder2/another/index.cjs"; + // The next ones shouldn't all work - esm format files have no index resolution or extension resolution + import * as m13 from "./"; + ~~~~ +!!! error TS2307: Cannot find module './' or its corresponding type declarations. + import * as m14 from "./index"; + ~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? + import * as m15 from "./subfolder"; + ~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m16 from "./subfolder/"; + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m17 from "./subfolder/index"; + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? + import * as m18 from "./subfolder2"; + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m19 from "./subfolder2/"; + ~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m20 from "./subfolder2/index"; + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? + import * as m21 from "./subfolder2/another"; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m22 from "./subfolder2/another/"; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m23 from "./subfolder2/another/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + void m1; + void m2; + void m3; + void m4; + void m5; + void m6; + void m7; + void m8; + void m9; + void m10; + void m11; + void m12; + void m13; + void m14; + void m15; + void m16; + void m17; + void m18; + void m19; + void m20; + void m21; + void m22; + void m23; + + // These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) + import m24 = require("./"); + ~~~~ +!!! error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m25 = require("./index"); + ~~~~~~~~~ +!!! error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m26 = require("./subfolder"); + import m27 = require("./subfolder/"); + import m28 = require("./subfolder/index"); + import m29 = require("./subfolder2"); + import m30 = require("./subfolder2/"); + import m31 = require("./subfolder2/index"); + import m32 = require("./subfolder2/another"); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m33 = require("./subfolder2/another/"); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m34 = require("./subfolder2/another/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + void m24; + void m25; + void m26; + void m27; + void m28; + void m29; + void m30; + void m31; + void m32; + void m33; + void m34; + + // These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution + const _m35 = import("./"); + ~~~~ +!!! error TS2307: Cannot find module './' or its corresponding type declarations. + const _m36 = import("./index"); + ~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? + const _m37 = import("./subfolder"); + ~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m38 = import("./subfolder/"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m39 = import("./subfolder/index"); + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? + const _m40 = import("./subfolder2"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m41 = import("./subfolder2/"); + ~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m42 = import("./subfolder2/index"); + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? + const _m43 = import("./subfolder2/another"); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m44 = import("./subfolder2/another/"); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m45 = import("./subfolder2/another/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + // esm format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== tests/cases/conformance/node/subfolder2/package.json (0 errors) ==== + { + } +==== tests/cases/conformance/node/subfolder2/another/package.json (0 errors) ==== + { + "type": "module" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModules1(module=node16).js b/tests/baselines/reference/nodeModules1(module=node16).js new file mode 100644 index 00000000000..5b6840498ef --- /dev/null +++ b/tests/baselines/reference/nodeModules1(module=node16).js @@ -0,0 +1,700 @@ +//// [tests/cases/conformance/node/nodeModules1.ts] //// + +//// [index.ts] +// cjs format file +const x = 1; +export {x}; +//// [index.cts] +// cjs format file +const x = 1; +export {x}; +//// [index.mts] +// esm format file +const x = 1; +export {x}; +//// [index.ts] +// cjs format file +const x = 1; +export {x}; +//// [index.cts] +// cjs format file +const x = 1; +export {x}; +//// [index.mts] +// esm format file +const x = 1; +export {x}; +//// [index.ts] +// esm format file +const x = 1; +export {x}; +//// [index.mts] +// esm format file +const x = 1; +export {x}; +//// [index.cts] +// cjs format file +const x = 1; +export {x}; +//// [index.mts] +import * as m1 from "./index.js"; +import * as m2 from "./index.mjs"; +import * as m3 from "./index.cjs"; +import * as m4 from "./subfolder/index.js"; +import * as m5 from "./subfolder/index.mjs"; +import * as m6 from "./subfolder/index.cjs"; +import * as m7 from "./subfolder2/index.js"; +import * as m8 from "./subfolder2/index.mjs"; +import * as m9 from "./subfolder2/index.cjs"; +import * as m10 from "./subfolder2/another/index.js"; +import * as m11 from "./subfolder2/another/index.mjs"; +import * as m12 from "./subfolder2/another/index.cjs"; +// The next ones should all fail - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +import * as m14 from "./index"; +import * as m15 from "./subfolder"; +import * as m16 from "./subfolder/"; +import * as m17 from "./subfolder/index"; +import * as m18 from "./subfolder2"; +import * as m19 from "./subfolder2/"; +import * as m20 from "./subfolder2/index"; +import * as m21 from "./subfolder2/another"; +import * as m22 from "./subfolder2/another/"; +import * as m23 from "./subfolder2/another/index"; +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +import m25 = require("./index"); +import m26 = require("./subfolder"); +import m27 = require("./subfolder/"); +import m28 = require("./subfolder/index"); +import m29 = require("./subfolder2"); +import m30 = require("./subfolder2/"); +import m31 = require("./subfolder2/index"); +import m32 = require("./subfolder2/another"); +import m33 = require("./subfolder2/another/"); +import m34 = require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); + +// esm format file +const x = 1; +export {x}; +//// [index.cts] +// ESM-format imports below should issue errors +import * as m1 from "./index.js"; +import * as m2 from "./index.mjs"; +import * as m3 from "./index.cjs"; +import * as m4 from "./subfolder/index.js"; +import * as m5 from "./subfolder/index.mjs"; +import * as m6 from "./subfolder/index.cjs"; +import * as m7 from "./subfolder2/index.js"; +import * as m8 from "./subfolder2/index.mjs"; +import * as m9 from "./subfolder2/index.cjs"; +import * as m10 from "./subfolder2/another/index.js"; +import * as m11 from "./subfolder2/another/index.mjs"; +import * as m12 from "./subfolder2/another/index.cjs"; +// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) +import * as m13 from "./"; +import * as m14 from "./index"; +import * as m15 from "./subfolder"; +import * as m16 from "./subfolder/"; +import * as m17 from "./subfolder/index"; +import * as m18 from "./subfolder2"; +import * as m19 from "./subfolder2/"; +import * as m20 from "./subfolder2/index"; +import * as m21 from "./subfolder2/another"; +import * as m22 from "./subfolder2/another/"; +import * as m23 from "./subfolder2/another/index"; +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +import m25 = require("./index"); +import m26 = require("./subfolder"); +import m27 = require("./subfolder/"); +import m28 = require("./subfolder/index"); +import m29 = require("./subfolder2"); +import m30 = require("./subfolder2/"); +import m31 = require("./subfolder2/index"); +import m32 = require("./subfolder2/another"); +import m33 = require("./subfolder2/another/"); +import m34 = require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); +// cjs format file +const x = 1; +export {x}; +//// [index.ts] +import * as m1 from "./index.js"; +import * as m2 from "./index.mjs"; +import * as m3 from "./index.cjs"; +import * as m4 from "./subfolder/index.js"; +import * as m5 from "./subfolder/index.mjs"; +import * as m6 from "./subfolder/index.cjs"; +import * as m7 from "./subfolder2/index.js"; +import * as m8 from "./subfolder2/index.mjs"; +import * as m9 from "./subfolder2/index.cjs"; +import * as m10 from "./subfolder2/another/index.js"; +import * as m11 from "./subfolder2/another/index.mjs"; +import * as m12 from "./subfolder2/another/index.cjs"; +// The next ones shouldn't all work - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +import * as m14 from "./index"; +import * as m15 from "./subfolder"; +import * as m16 from "./subfolder/"; +import * as m17 from "./subfolder/index"; +import * as m18 from "./subfolder2"; +import * as m19 from "./subfolder2/"; +import * as m20 from "./subfolder2/index"; +import * as m21 from "./subfolder2/another"; +import * as m22 from "./subfolder2/another/"; +import * as m23 from "./subfolder2/another/index"; +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +import m25 = require("./index"); +import m26 = require("./subfolder"); +import m27 = require("./subfolder/"); +import m28 = require("./subfolder/index"); +import m29 = require("./subfolder2"); +import m30 = require("./subfolder2/"); +import m31 = require("./subfolder2/index"); +import m32 = require("./subfolder2/another"); +import m33 = require("./subfolder2/another/"); +import m34 = require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); +// esm format file +const x = 1; +export {x}; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [package.json] +{ +} +//// [package.json] +{ + "type": "module" +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = 1; +exports.x = x; +//// [index.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = 1; +exports.x = x; +//// [index.mjs] +// esm format file +const x = 1; +export { x }; +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = 1; +exports.x = x; +//// [index.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = 1; +exports.x = x; +//// [index.mjs] +// esm format file +const x = 1; +export { x }; +//// [index.js] +// esm format file +const x = 1; +export { x }; +//// [index.mjs] +// esm format file +const x = 1; +export { x }; +//// [index.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = 1; +exports.x = x; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// ESM-format imports below should issue errors +const m1 = __importStar(require("./index.js")); +const m2 = __importStar(require("./index.mjs")); +const m3 = __importStar(require("./index.cjs")); +const m4 = __importStar(require("./subfolder/index.js")); +const m5 = __importStar(require("./subfolder/index.mjs")); +const m6 = __importStar(require("./subfolder/index.cjs")); +const m7 = __importStar(require("./subfolder2/index.js")); +const m8 = __importStar(require("./subfolder2/index.mjs")); +const m9 = __importStar(require("./subfolder2/index.cjs")); +const m10 = __importStar(require("./subfolder2/another/index.js")); +const m11 = __importStar(require("./subfolder2/another/index.mjs")); +const m12 = __importStar(require("./subfolder2/another/index.cjs")); +// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) +const m13 = __importStar(require("./")); +const m14 = __importStar(require("./index")); +const m15 = __importStar(require("./subfolder")); +const m16 = __importStar(require("./subfolder/")); +const m17 = __importStar(require("./subfolder/index")); +const m18 = __importStar(require("./subfolder2")); +const m19 = __importStar(require("./subfolder2/")); +const m20 = __importStar(require("./subfolder2/index")); +const m21 = __importStar(require("./subfolder2/another")); +const m22 = __importStar(require("./subfolder2/another/")); +const m23 = __importStar(require("./subfolder2/another/index")); +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +const m24 = require("./"); +const m25 = require("./index"); +const m26 = require("./subfolder"); +const m27 = require("./subfolder/"); +const m28 = require("./subfolder/index"); +const m29 = require("./subfolder2"); +const m30 = require("./subfolder2/"); +const m31 = require("./subfolder2/index"); +const m32 = require("./subfolder2/another"); +const m33 = require("./subfolder2/another/"); +const m34 = require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); +// cjs format file +const x = 1; +exports.x = x; +//// [index.js] +import { createRequire as _createRequire } from "module"; +const __require = _createRequire(import.meta.url); +import * as m1 from "./index.js"; +import * as m2 from "./index.mjs"; +import * as m3 from "./index.cjs"; +import * as m4 from "./subfolder/index.js"; +import * as m5 from "./subfolder/index.mjs"; +import * as m6 from "./subfolder/index.cjs"; +import * as m7 from "./subfolder2/index.js"; +import * as m8 from "./subfolder2/index.mjs"; +import * as m9 from "./subfolder2/index.cjs"; +import * as m10 from "./subfolder2/another/index.js"; +import * as m11 from "./subfolder2/another/index.mjs"; +import * as m12 from "./subfolder2/another/index.cjs"; +// The next ones shouldn't all work - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +import * as m14 from "./index"; +import * as m15 from "./subfolder"; +import * as m16 from "./subfolder/"; +import * as m17 from "./subfolder/index"; +import * as m18 from "./subfolder2"; +import * as m19 from "./subfolder2/"; +import * as m20 from "./subfolder2/index"; +import * as m21 from "./subfolder2/another"; +import * as m22 from "./subfolder2/another/"; +import * as m23 from "./subfolder2/another/index"; +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +const m24 = __require("./"); +const m25 = __require("./index"); +const m26 = __require("./subfolder"); +const m27 = __require("./subfolder/"); +const m28 = __require("./subfolder/index"); +const m29 = __require("./subfolder2"); +const m30 = __require("./subfolder2/"); +const m31 = __require("./subfolder2/index"); +const m32 = __require("./subfolder2/another"); +const m33 = __require("./subfolder2/another/"); +const m34 = __require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); +// esm format file +const x = 1; +export { x }; +//// [index.mjs] +import { createRequire as _createRequire } from "module"; +const __require = _createRequire(import.meta.url); +import * as m1 from "./index.js"; +import * as m2 from "./index.mjs"; +import * as m3 from "./index.cjs"; +import * as m4 from "./subfolder/index.js"; +import * as m5 from "./subfolder/index.mjs"; +import * as m6 from "./subfolder/index.cjs"; +import * as m7 from "./subfolder2/index.js"; +import * as m8 from "./subfolder2/index.mjs"; +import * as m9 from "./subfolder2/index.cjs"; +import * as m10 from "./subfolder2/another/index.js"; +import * as m11 from "./subfolder2/another/index.mjs"; +import * as m12 from "./subfolder2/another/index.cjs"; +// The next ones should all fail - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +import * as m14 from "./index"; +import * as m15 from "./subfolder"; +import * as m16 from "./subfolder/"; +import * as m17 from "./subfolder/index"; +import * as m18 from "./subfolder2"; +import * as m19 from "./subfolder2/"; +import * as m20 from "./subfolder2/index"; +import * as m21 from "./subfolder2/another"; +import * as m22 from "./subfolder2/another/"; +import * as m23 from "./subfolder2/another/index"; +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +const m24 = __require("./"); +const m25 = __require("./index"); +const m26 = __require("./subfolder"); +const m27 = __require("./subfolder/"); +const m28 = __require("./subfolder/index"); +const m29 = __require("./subfolder2"); +const m30 = __require("./subfolder2/"); +const m31 = __require("./subfolder2/index"); +const m32 = __require("./subfolder2/another"); +const m33 = __require("./subfolder2/another/"); +const m34 = __require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); +// esm format file +const x = 1; +export { x }; + + +//// [index.d.ts] +declare const x = 1; +export { x }; +//// [index.d.cts] +declare const x = 1; +export { x }; +//// [index.d.mts] +declare const x = 1; +export { x }; +//// [index.d.ts] +declare const x = 1; +export { x }; +//// [index.d.cts] +declare const x = 1; +export { x }; +//// [index.d.mts] +declare const x = 1; +export { x }; +//// [index.d.ts] +declare const x = 1; +export { x }; +//// [index.d.mts] +declare const x = 1; +export { x }; +//// [index.d.cts] +declare const x = 1; +export { x }; +//// [index.d.cts] +declare const x = 1; +export { x }; +//// [index.d.ts] +declare const x = 1; +export { x }; +//// [index.d.mts] +declare const x = 1; +export { x }; diff --git a/tests/baselines/reference/nodeModules1(module=node16).symbols b/tests/baselines/reference/nodeModules1(module=node16).symbols new file mode 100644 index 00000000000..287b1e895d1 --- /dev/null +++ b/tests/baselines/reference/nodeModules1(module=node16).symbols @@ -0,0 +1,817 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.ts, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.ts, 2, 8)) + +=== tests/cases/conformance/node/subfolder/index.cts === +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.cts, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.cts, 2, 8)) + +=== tests/cases/conformance/node/subfolder/index.mts === +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.mts, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.mts, 2, 8)) + +=== tests/cases/conformance/node/subfolder2/index.ts === +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.ts, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.ts, 2, 8)) + +=== tests/cases/conformance/node/subfolder2/index.cts === +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.cts, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.cts, 2, 8)) + +=== tests/cases/conformance/node/subfolder2/index.mts === +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.mts, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.mts, 2, 8)) + +=== tests/cases/conformance/node/subfolder2/another/index.ts === +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.ts, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.ts, 2, 8)) + +=== tests/cases/conformance/node/subfolder2/another/index.mts === +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.mts, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.mts, 2, 8)) + +=== tests/cases/conformance/node/subfolder2/another/index.cts === +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.cts, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.cts, 2, 8)) + +=== tests/cases/conformance/node/index.mts === +import * as m1 from "./index.js"; +>m1 : Symbol(m1, Decl(index.mts, 0, 6)) + +import * as m2 from "./index.mjs"; +>m2 : Symbol(m2, Decl(index.mts, 1, 6)) + +import * as m3 from "./index.cjs"; +>m3 : Symbol(m3, Decl(index.mts, 2, 6)) + +import * as m4 from "./subfolder/index.js"; +>m4 : Symbol(m4, Decl(index.mts, 3, 6)) + +import * as m5 from "./subfolder/index.mjs"; +>m5 : Symbol(m5, Decl(index.mts, 4, 6)) + +import * as m6 from "./subfolder/index.cjs"; +>m6 : Symbol(m6, Decl(index.mts, 5, 6)) + +import * as m7 from "./subfolder2/index.js"; +>m7 : Symbol(m7, Decl(index.mts, 6, 6)) + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : Symbol(m8, Decl(index.mts, 7, 6)) + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : Symbol(m9, Decl(index.mts, 8, 6)) + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : Symbol(m10, Decl(index.mts, 9, 6)) + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : Symbol(m11, Decl(index.mts, 10, 6)) + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : Symbol(m12, Decl(index.mts, 11, 6)) + +// The next ones should all fail - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +>m13 : Symbol(m13, Decl(index.mts, 13, 6)) + +import * as m14 from "./index"; +>m14 : Symbol(m14, Decl(index.mts, 14, 6)) + +import * as m15 from "./subfolder"; +>m15 : Symbol(m15, Decl(index.mts, 15, 6)) + +import * as m16 from "./subfolder/"; +>m16 : Symbol(m16, Decl(index.mts, 16, 6)) + +import * as m17 from "./subfolder/index"; +>m17 : Symbol(m17, Decl(index.mts, 17, 6)) + +import * as m18 from "./subfolder2"; +>m18 : Symbol(m18, Decl(index.mts, 18, 6)) + +import * as m19 from "./subfolder2/"; +>m19 : Symbol(m19, Decl(index.mts, 19, 6)) + +import * as m20 from "./subfolder2/index"; +>m20 : Symbol(m20, Decl(index.mts, 20, 6)) + +import * as m21 from "./subfolder2/another"; +>m21 : Symbol(m21, Decl(index.mts, 21, 6)) + +import * as m22 from "./subfolder2/another/"; +>m22 : Symbol(m22, Decl(index.mts, 22, 6)) + +import * as m23 from "./subfolder2/another/index"; +>m23 : Symbol(m23, Decl(index.mts, 23, 6)) + +void m1; +>m1 : Symbol(m1, Decl(index.mts, 0, 6)) + +void m2; +>m2 : Symbol(m2, Decl(index.mts, 1, 6)) + +void m3; +>m3 : Symbol(m3, Decl(index.mts, 2, 6)) + +void m4; +>m4 : Symbol(m4, Decl(index.mts, 3, 6)) + +void m5; +>m5 : Symbol(m5, Decl(index.mts, 4, 6)) + +void m6; +>m6 : Symbol(m6, Decl(index.mts, 5, 6)) + +void m7; +>m7 : Symbol(m7, Decl(index.mts, 6, 6)) + +void m8; +>m8 : Symbol(m8, Decl(index.mts, 7, 6)) + +void m9; +>m9 : Symbol(m9, Decl(index.mts, 8, 6)) + +void m10; +>m10 : Symbol(m10, Decl(index.mts, 9, 6)) + +void m11; +>m11 : Symbol(m11, Decl(index.mts, 10, 6)) + +void m12; +>m12 : Symbol(m12, Decl(index.mts, 11, 6)) + +void m13; +>m13 : Symbol(m13, Decl(index.mts, 13, 6)) + +void m14; +>m14 : Symbol(m14, Decl(index.mts, 14, 6)) + +void m15; +>m15 : Symbol(m15, Decl(index.mts, 15, 6)) + +void m16; +>m16 : Symbol(m16, Decl(index.mts, 16, 6)) + +void m17; +>m17 : Symbol(m17, Decl(index.mts, 17, 6)) + +void m18; +>m18 : Symbol(m18, Decl(index.mts, 18, 6)) + +void m19; +>m19 : Symbol(m19, Decl(index.mts, 19, 6)) + +void m20; +>m20 : Symbol(m20, Decl(index.mts, 20, 6)) + +void m21; +>m21 : Symbol(m21, Decl(index.mts, 21, 6)) + +void m22; +>m22 : Symbol(m22, Decl(index.mts, 22, 6)) + +void m23; +>m23 : Symbol(m23, Decl(index.mts, 23, 6)) + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : Symbol(m24, Decl(index.mts, 46, 9)) + +import m25 = require("./index"); +>m25 : Symbol(m25, Decl(index.mts, 49, 27)) + +import m26 = require("./subfolder"); +>m26 : Symbol(m26, Decl(index.mts, 50, 32)) + +import m27 = require("./subfolder/"); +>m27 : Symbol(m27, Decl(index.mts, 51, 36)) + +import m28 = require("./subfolder/index"); +>m28 : Symbol(m28, Decl(index.mts, 52, 37)) + +import m29 = require("./subfolder2"); +>m29 : Symbol(m29, Decl(index.mts, 53, 42)) + +import m30 = require("./subfolder2/"); +>m30 : Symbol(m30, Decl(index.mts, 54, 37)) + +import m31 = require("./subfolder2/index"); +>m31 : Symbol(m31, Decl(index.mts, 55, 38)) + +import m32 = require("./subfolder2/another"); +>m32 : Symbol(m32, Decl(index.mts, 56, 43)) + +import m33 = require("./subfolder2/another/"); +>m33 : Symbol(m33, Decl(index.mts, 57, 45)) + +import m34 = require("./subfolder2/another/index"); +>m34 : Symbol(m34, Decl(index.mts, 58, 46)) + +void m24; +>m24 : Symbol(m24, Decl(index.mts, 46, 9)) + +void m25; +>m25 : Symbol(m25, Decl(index.mts, 49, 27)) + +void m26; +>m26 : Symbol(m26, Decl(index.mts, 50, 32)) + +void m27; +>m27 : Symbol(m27, Decl(index.mts, 51, 36)) + +void m28; +>m28 : Symbol(m28, Decl(index.mts, 52, 37)) + +void m29; +>m29 : Symbol(m29, Decl(index.mts, 53, 42)) + +void m30; +>m30 : Symbol(m30, Decl(index.mts, 54, 37)) + +void m31; +>m31 : Symbol(m31, Decl(index.mts, 55, 38)) + +void m32; +>m32 : Symbol(m32, Decl(index.mts, 56, 43)) + +void m33; +>m33 : Symbol(m33, Decl(index.mts, 57, 45)) + +void m34; +>m34 : Symbol(m34, Decl(index.mts, 58, 46)) + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Symbol(_m35, Decl(index.mts, 73, 5)) + +const _m36 = import("./index"); +>_m36 : Symbol(_m36, Decl(index.mts, 74, 5)) + +const _m37 = import("./subfolder"); +>_m37 : Symbol(_m37, Decl(index.mts, 75, 5)) + +const _m38 = import("./subfolder/"); +>_m38 : Symbol(_m38, Decl(index.mts, 76, 5)) + +const _m39 = import("./subfolder/index"); +>_m39 : Symbol(_m39, Decl(index.mts, 77, 5)) + +const _m40 = import("./subfolder2"); +>_m40 : Symbol(_m40, Decl(index.mts, 78, 5)) + +const _m41 = import("./subfolder2/"); +>_m41 : Symbol(_m41, Decl(index.mts, 79, 5)) + +const _m42 = import("./subfolder2/index"); +>_m42 : Symbol(_m42, Decl(index.mts, 80, 5)) + +const _m43 = import("./subfolder2/another"); +>_m43 : Symbol(_m43, Decl(index.mts, 81, 5)) + +const _m44 = import("./subfolder2/another/"); +>_m44 : Symbol(_m44, Decl(index.mts, 82, 5)) + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Symbol(_m45, Decl(index.mts, 83, 5)) + +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.mts, 86, 5)) + +export {x}; +>x : Symbol(m2.x, Decl(index.mts, 87, 8)) + +=== tests/cases/conformance/node/index.cts === +// ESM-format imports below should issue errors +import * as m1 from "./index.js"; +>m1 : Symbol(m1, Decl(index.cts, 1, 6)) + +import * as m2 from "./index.mjs"; +>m2 : Symbol(m2, Decl(index.cts, 2, 6)) + +import * as m3 from "./index.cjs"; +>m3 : Symbol(m3, Decl(index.cts, 3, 6)) + +import * as m4 from "./subfolder/index.js"; +>m4 : Symbol(m4, Decl(index.cts, 4, 6)) + +import * as m5 from "./subfolder/index.mjs"; +>m5 : Symbol(m5, Decl(index.cts, 5, 6)) + +import * as m6 from "./subfolder/index.cjs"; +>m6 : Symbol(m6, Decl(index.cts, 6, 6)) + +import * as m7 from "./subfolder2/index.js"; +>m7 : Symbol(m7, Decl(index.cts, 7, 6)) + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : Symbol(m8, Decl(index.cts, 8, 6)) + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : Symbol(m9, Decl(index.cts, 9, 6)) + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : Symbol(m10, Decl(index.cts, 10, 6)) + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : Symbol(m11, Decl(index.cts, 11, 6)) + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : Symbol(m12, Decl(index.cts, 12, 6)) + +// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) +import * as m13 from "./"; +>m13 : Symbol(m13, Decl(index.cts, 14, 6)) + +import * as m14 from "./index"; +>m14 : Symbol(m14, Decl(index.cts, 15, 6)) + +import * as m15 from "./subfolder"; +>m15 : Symbol(m15, Decl(index.cts, 16, 6)) + +import * as m16 from "./subfolder/"; +>m16 : Symbol(m16, Decl(index.cts, 17, 6)) + +import * as m17 from "./subfolder/index"; +>m17 : Symbol(m17, Decl(index.cts, 18, 6)) + +import * as m18 from "./subfolder2"; +>m18 : Symbol(m18, Decl(index.cts, 19, 6)) + +import * as m19 from "./subfolder2/"; +>m19 : Symbol(m19, Decl(index.cts, 20, 6)) + +import * as m20 from "./subfolder2/index"; +>m20 : Symbol(m20, Decl(index.cts, 21, 6)) + +import * as m21 from "./subfolder2/another"; +>m21 : Symbol(m21, Decl(index.cts, 22, 6)) + +import * as m22 from "./subfolder2/another/"; +>m22 : Symbol(m22, Decl(index.cts, 23, 6)) + +import * as m23 from "./subfolder2/another/index"; +>m23 : Symbol(m23, Decl(index.cts, 24, 6)) + +void m1; +>m1 : Symbol(m1, Decl(index.cts, 1, 6)) + +void m2; +>m2 : Symbol(m2, Decl(index.cts, 2, 6)) + +void m3; +>m3 : Symbol(m3, Decl(index.cts, 3, 6)) + +void m4; +>m4 : Symbol(m4, Decl(index.cts, 4, 6)) + +void m5; +>m5 : Symbol(m5, Decl(index.cts, 5, 6)) + +void m6; +>m6 : Symbol(m6, Decl(index.cts, 6, 6)) + +void m7; +>m7 : Symbol(m7, Decl(index.cts, 7, 6)) + +void m8; +>m8 : Symbol(m8, Decl(index.cts, 8, 6)) + +void m9; +>m9 : Symbol(m9, Decl(index.cts, 9, 6)) + +void m10; +>m10 : Symbol(m10, Decl(index.cts, 10, 6)) + +void m11; +>m11 : Symbol(m11, Decl(index.cts, 11, 6)) + +void m12; +>m12 : Symbol(m12, Decl(index.cts, 12, 6)) + +void m13; +>m13 : Symbol(m13, Decl(index.cts, 14, 6)) + +void m14; +>m14 : Symbol(m14, Decl(index.cts, 15, 6)) + +void m15; +>m15 : Symbol(m15, Decl(index.cts, 16, 6)) + +void m16; +>m16 : Symbol(m16, Decl(index.cts, 17, 6)) + +void m17; +>m17 : Symbol(m17, Decl(index.cts, 18, 6)) + +void m18; +>m18 : Symbol(m18, Decl(index.cts, 19, 6)) + +void m19; +>m19 : Symbol(m19, Decl(index.cts, 20, 6)) + +void m20; +>m20 : Symbol(m20, Decl(index.cts, 21, 6)) + +void m21; +>m21 : Symbol(m21, Decl(index.cts, 22, 6)) + +void m22; +>m22 : Symbol(m22, Decl(index.cts, 23, 6)) + +void m23; +>m23 : Symbol(m23, Decl(index.cts, 24, 6)) + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : Symbol(m24, Decl(index.cts, 47, 9)) + +import m25 = require("./index"); +>m25 : Symbol(m25, Decl(index.cts, 50, 27)) + +import m26 = require("./subfolder"); +>m26 : Symbol(m26, Decl(index.cts, 51, 32)) + +import m27 = require("./subfolder/"); +>m27 : Symbol(m27, Decl(index.cts, 52, 36)) + +import m28 = require("./subfolder/index"); +>m28 : Symbol(m28, Decl(index.cts, 53, 37)) + +import m29 = require("./subfolder2"); +>m29 : Symbol(m29, Decl(index.cts, 54, 42)) + +import m30 = require("./subfolder2/"); +>m30 : Symbol(m30, Decl(index.cts, 55, 37)) + +import m31 = require("./subfolder2/index"); +>m31 : Symbol(m31, Decl(index.cts, 56, 38)) + +import m32 = require("./subfolder2/another"); +>m32 : Symbol(m32, Decl(index.cts, 57, 43)) + +import m33 = require("./subfolder2/another/"); +>m33 : Symbol(m33, Decl(index.cts, 58, 45)) + +import m34 = require("./subfolder2/another/index"); +>m34 : Symbol(m34, Decl(index.cts, 59, 46)) + +void m24; +>m24 : Symbol(m24, Decl(index.cts, 47, 9)) + +void m25; +>m25 : Symbol(m25, Decl(index.cts, 50, 27)) + +void m26; +>m26 : Symbol(m26, Decl(index.cts, 51, 32)) + +void m27; +>m27 : Symbol(m27, Decl(index.cts, 52, 36)) + +void m28; +>m28 : Symbol(m28, Decl(index.cts, 53, 37)) + +void m29; +>m29 : Symbol(m29, Decl(index.cts, 54, 42)) + +void m30; +>m30 : Symbol(m30, Decl(index.cts, 55, 37)) + +void m31; +>m31 : Symbol(m31, Decl(index.cts, 56, 38)) + +void m32; +>m32 : Symbol(m32, Decl(index.cts, 57, 43)) + +void m33; +>m33 : Symbol(m33, Decl(index.cts, 58, 45)) + +void m34; +>m34 : Symbol(m34, Decl(index.cts, 59, 46)) + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Symbol(_m35, Decl(index.cts, 74, 5)) + +const _m36 = import("./index"); +>_m36 : Symbol(_m36, Decl(index.cts, 75, 5)) + +const _m37 = import("./subfolder"); +>_m37 : Symbol(_m37, Decl(index.cts, 76, 5)) + +const _m38 = import("./subfolder/"); +>_m38 : Symbol(_m38, Decl(index.cts, 77, 5)) + +const _m39 = import("./subfolder/index"); +>_m39 : Symbol(_m39, Decl(index.cts, 78, 5)) + +const _m40 = import("./subfolder2"); +>_m40 : Symbol(_m40, Decl(index.cts, 79, 5)) + +const _m41 = import("./subfolder2/"); +>_m41 : Symbol(_m41, Decl(index.cts, 80, 5)) + +const _m42 = import("./subfolder2/index"); +>_m42 : Symbol(_m42, Decl(index.cts, 81, 5)) + +const _m43 = import("./subfolder2/another"); +>_m43 : Symbol(_m43, Decl(index.cts, 82, 5)) + +const _m44 = import("./subfolder2/another/"); +>_m44 : Symbol(_m44, Decl(index.cts, 83, 5)) + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Symbol(_m45, Decl(index.cts, 84, 5)) + +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.cts, 86, 5)) + +export {x}; +>x : Symbol(m3.x, Decl(index.cts, 87, 8)) + +=== tests/cases/conformance/node/index.ts === +import * as m1 from "./index.js"; +>m1 : Symbol(m1, Decl(index.ts, 0, 6)) + +import * as m2 from "./index.mjs"; +>m2 : Symbol(m2, Decl(index.ts, 1, 6)) + +import * as m3 from "./index.cjs"; +>m3 : Symbol(m3, Decl(index.ts, 2, 6)) + +import * as m4 from "./subfolder/index.js"; +>m4 : Symbol(m4, Decl(index.ts, 3, 6)) + +import * as m5 from "./subfolder/index.mjs"; +>m5 : Symbol(m5, Decl(index.ts, 4, 6)) + +import * as m6 from "./subfolder/index.cjs"; +>m6 : Symbol(m6, Decl(index.ts, 5, 6)) + +import * as m7 from "./subfolder2/index.js"; +>m7 : Symbol(m7, Decl(index.ts, 6, 6)) + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : Symbol(m8, Decl(index.ts, 7, 6)) + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : Symbol(m9, Decl(index.ts, 8, 6)) + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : Symbol(m10, Decl(index.ts, 9, 6)) + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : Symbol(m11, Decl(index.ts, 10, 6)) + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : Symbol(m12, Decl(index.ts, 11, 6)) + +// The next ones shouldn't all work - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +>m13 : Symbol(m13, Decl(index.ts, 13, 6)) + +import * as m14 from "./index"; +>m14 : Symbol(m14, Decl(index.ts, 14, 6)) + +import * as m15 from "./subfolder"; +>m15 : Symbol(m15, Decl(index.ts, 15, 6)) + +import * as m16 from "./subfolder/"; +>m16 : Symbol(m16, Decl(index.ts, 16, 6)) + +import * as m17 from "./subfolder/index"; +>m17 : Symbol(m17, Decl(index.ts, 17, 6)) + +import * as m18 from "./subfolder2"; +>m18 : Symbol(m18, Decl(index.ts, 18, 6)) + +import * as m19 from "./subfolder2/"; +>m19 : Symbol(m19, Decl(index.ts, 19, 6)) + +import * as m20 from "./subfolder2/index"; +>m20 : Symbol(m20, Decl(index.ts, 20, 6)) + +import * as m21 from "./subfolder2/another"; +>m21 : Symbol(m21, Decl(index.ts, 21, 6)) + +import * as m22 from "./subfolder2/another/"; +>m22 : Symbol(m22, Decl(index.ts, 22, 6)) + +import * as m23 from "./subfolder2/another/index"; +>m23 : Symbol(m23, Decl(index.ts, 23, 6)) + +void m1; +>m1 : Symbol(m1, Decl(index.ts, 0, 6)) + +void m2; +>m2 : Symbol(m2, Decl(index.ts, 1, 6)) + +void m3; +>m3 : Symbol(m3, Decl(index.ts, 2, 6)) + +void m4; +>m4 : Symbol(m4, Decl(index.ts, 3, 6)) + +void m5; +>m5 : Symbol(m5, Decl(index.ts, 4, 6)) + +void m6; +>m6 : Symbol(m6, Decl(index.ts, 5, 6)) + +void m7; +>m7 : Symbol(m7, Decl(index.ts, 6, 6)) + +void m8; +>m8 : Symbol(m8, Decl(index.ts, 7, 6)) + +void m9; +>m9 : Symbol(m9, Decl(index.ts, 8, 6)) + +void m10; +>m10 : Symbol(m10, Decl(index.ts, 9, 6)) + +void m11; +>m11 : Symbol(m11, Decl(index.ts, 10, 6)) + +void m12; +>m12 : Symbol(m12, Decl(index.ts, 11, 6)) + +void m13; +>m13 : Symbol(m13, Decl(index.ts, 13, 6)) + +void m14; +>m14 : Symbol(m14, Decl(index.ts, 14, 6)) + +void m15; +>m15 : Symbol(m15, Decl(index.ts, 15, 6)) + +void m16; +>m16 : Symbol(m16, Decl(index.ts, 16, 6)) + +void m17; +>m17 : Symbol(m17, Decl(index.ts, 17, 6)) + +void m18; +>m18 : Symbol(m18, Decl(index.ts, 18, 6)) + +void m19; +>m19 : Symbol(m19, Decl(index.ts, 19, 6)) + +void m20; +>m20 : Symbol(m20, Decl(index.ts, 20, 6)) + +void m21; +>m21 : Symbol(m21, Decl(index.ts, 21, 6)) + +void m22; +>m22 : Symbol(m22, Decl(index.ts, 22, 6)) + +void m23; +>m23 : Symbol(m23, Decl(index.ts, 23, 6)) + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : Symbol(m24, Decl(index.ts, 46, 9)) + +import m25 = require("./index"); +>m25 : Symbol(m25, Decl(index.ts, 49, 27)) + +import m26 = require("./subfolder"); +>m26 : Symbol(m26, Decl(index.ts, 50, 32)) + +import m27 = require("./subfolder/"); +>m27 : Symbol(m27, Decl(index.ts, 51, 36)) + +import m28 = require("./subfolder/index"); +>m28 : Symbol(m28, Decl(index.ts, 52, 37)) + +import m29 = require("./subfolder2"); +>m29 : Symbol(m29, Decl(index.ts, 53, 42)) + +import m30 = require("./subfolder2/"); +>m30 : Symbol(m30, Decl(index.ts, 54, 37)) + +import m31 = require("./subfolder2/index"); +>m31 : Symbol(m31, Decl(index.ts, 55, 38)) + +import m32 = require("./subfolder2/another"); +>m32 : Symbol(m32, Decl(index.ts, 56, 43)) + +import m33 = require("./subfolder2/another/"); +>m33 : Symbol(m33, Decl(index.ts, 57, 45)) + +import m34 = require("./subfolder2/another/index"); +>m34 : Symbol(m34, Decl(index.ts, 58, 46)) + +void m24; +>m24 : Symbol(m24, Decl(index.ts, 46, 9)) + +void m25; +>m25 : Symbol(m25, Decl(index.ts, 49, 27)) + +void m26; +>m26 : Symbol(m26, Decl(index.ts, 50, 32)) + +void m27; +>m27 : Symbol(m27, Decl(index.ts, 51, 36)) + +void m28; +>m28 : Symbol(m28, Decl(index.ts, 52, 37)) + +void m29; +>m29 : Symbol(m29, Decl(index.ts, 53, 42)) + +void m30; +>m30 : Symbol(m30, Decl(index.ts, 54, 37)) + +void m31; +>m31 : Symbol(m31, Decl(index.ts, 55, 38)) + +void m32; +>m32 : Symbol(m32, Decl(index.ts, 56, 43)) + +void m33; +>m33 : Symbol(m33, Decl(index.ts, 57, 45)) + +void m34; +>m34 : Symbol(m34, Decl(index.ts, 58, 46)) + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Symbol(_m35, Decl(index.ts, 73, 5)) + +const _m36 = import("./index"); +>_m36 : Symbol(_m36, Decl(index.ts, 74, 5)) + +const _m37 = import("./subfolder"); +>_m37 : Symbol(_m37, Decl(index.ts, 75, 5)) + +const _m38 = import("./subfolder/"); +>_m38 : Symbol(_m38, Decl(index.ts, 76, 5)) + +const _m39 = import("./subfolder/index"); +>_m39 : Symbol(_m39, Decl(index.ts, 77, 5)) + +const _m40 = import("./subfolder2"); +>_m40 : Symbol(_m40, Decl(index.ts, 78, 5)) + +const _m41 = import("./subfolder2/"); +>_m41 : Symbol(_m41, Decl(index.ts, 79, 5)) + +const _m42 = import("./subfolder2/index"); +>_m42 : Symbol(_m42, Decl(index.ts, 80, 5)) + +const _m43 = import("./subfolder2/another"); +>_m43 : Symbol(_m43, Decl(index.ts, 81, 5)) + +const _m44 = import("./subfolder2/another/"); +>_m44 : Symbol(_m44, Decl(index.ts, 82, 5)) + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Symbol(_m45, Decl(index.ts, 83, 5)) + +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.ts, 85, 5)) + +export {x}; +>x : Symbol(m1.x, Decl(index.ts, 86, 8)) + diff --git a/tests/baselines/reference/nodeModules1(module=node16).types b/tests/baselines/reference/nodeModules1(module=node16).types new file mode 100644 index 00000000000..9f52683c7d7 --- /dev/null +++ b/tests/baselines/reference/nodeModules1(module=node16).types @@ -0,0 +1,997 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + +=== tests/cases/conformance/node/subfolder/index.cts === +// cjs format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + +=== tests/cases/conformance/node/subfolder/index.mts === +// esm format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + +=== tests/cases/conformance/node/subfolder2/index.ts === +// cjs format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + +=== tests/cases/conformance/node/subfolder2/index.cts === +// cjs format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + +=== tests/cases/conformance/node/subfolder2/index.mts === +// esm format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + +=== tests/cases/conformance/node/subfolder2/another/index.ts === +// esm format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + +=== tests/cases/conformance/node/subfolder2/another/index.mts === +// esm format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + +=== tests/cases/conformance/node/subfolder2/another/index.cts === +// cjs format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + +=== tests/cases/conformance/node/index.mts === +import * as m1 from "./index.js"; +>m1 : typeof m1 + +import * as m2 from "./index.mjs"; +>m2 : typeof m2 + +import * as m3 from "./index.cjs"; +>m3 : typeof m3 + +import * as m4 from "./subfolder/index.js"; +>m4 : typeof m4 + +import * as m5 from "./subfolder/index.mjs"; +>m5 : typeof m5 + +import * as m6 from "./subfolder/index.cjs"; +>m6 : typeof m6 + +import * as m7 from "./subfolder2/index.js"; +>m7 : typeof m7 + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : typeof m8 + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : typeof m9 + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : typeof m10 + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : typeof m11 + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : typeof m12 + +// The next ones should all fail - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +>m13 : any + +import * as m14 from "./index"; +>m14 : any + +import * as m15 from "./subfolder"; +>m15 : any + +import * as m16 from "./subfolder/"; +>m16 : any + +import * as m17 from "./subfolder/index"; +>m17 : any + +import * as m18 from "./subfolder2"; +>m18 : any + +import * as m19 from "./subfolder2/"; +>m19 : any + +import * as m20 from "./subfolder2/index"; +>m20 : any + +import * as m21 from "./subfolder2/another"; +>m21 : any + +import * as m22 from "./subfolder2/another/"; +>m22 : any + +import * as m23 from "./subfolder2/another/index"; +>m23 : any + +void m1; +>void m1 : undefined +>m1 : typeof m1 + +void m2; +>void m2 : undefined +>m2 : typeof m2 + +void m3; +>void m3 : undefined +>m3 : typeof m3 + +void m4; +>void m4 : undefined +>m4 : typeof m4 + +void m5; +>void m5 : undefined +>m5 : typeof m5 + +void m6; +>void m6 : undefined +>m6 : typeof m6 + +void m7; +>void m7 : undefined +>m7 : typeof m7 + +void m8; +>void m8 : undefined +>m8 : typeof m8 + +void m9; +>void m9 : undefined +>m9 : typeof m9 + +void m10; +>void m10 : undefined +>m10 : typeof m10 + +void m11; +>void m11 : undefined +>m11 : typeof m11 + +void m12; +>void m12 : undefined +>m12 : typeof m12 + +void m13; +>void m13 : undefined +>m13 : any + +void m14; +>void m14 : undefined +>m14 : any + +void m15; +>void m15 : undefined +>m15 : any + +void m16; +>void m16 : undefined +>m16 : any + +void m17; +>void m17 : undefined +>m17 : any + +void m18; +>void m18 : undefined +>m18 : any + +void m19; +>void m19 : undefined +>m19 : any + +void m20; +>void m20 : undefined +>m20 : any + +void m21; +>void m21 : undefined +>m21 : any + +void m22; +>void m22 : undefined +>m22 : any + +void m23; +>void m23 : undefined +>m23 : any + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : typeof m1 + +import m25 = require("./index"); +>m25 : typeof m1 + +import m26 = require("./subfolder"); +>m26 : typeof m26 + +import m27 = require("./subfolder/"); +>m27 : typeof m26 + +import m28 = require("./subfolder/index"); +>m28 : typeof m26 + +import m29 = require("./subfolder2"); +>m29 : typeof m29 + +import m30 = require("./subfolder2/"); +>m30 : typeof m29 + +import m31 = require("./subfolder2/index"); +>m31 : typeof m29 + +import m32 = require("./subfolder2/another"); +>m32 : typeof m10 + +import m33 = require("./subfolder2/another/"); +>m33 : typeof m10 + +import m34 = require("./subfolder2/another/index"); +>m34 : typeof m10 + +void m24; +>void m24 : undefined +>m24 : typeof m1 + +void m25; +>void m25 : undefined +>m25 : typeof m1 + +void m26; +>void m26 : undefined +>m26 : typeof m26 + +void m27; +>void m27 : undefined +>m27 : typeof m26 + +void m28; +>void m28 : undefined +>m28 : typeof m26 + +void m29; +>void m29 : undefined +>m29 : typeof m29 + +void m30; +>void m30 : undefined +>m30 : typeof m29 + +void m31; +>void m31 : undefined +>m31 : typeof m29 + +void m32; +>void m32 : undefined +>m32 : typeof m10 + +void m33; +>void m33 : undefined +>m33 : typeof m10 + +void m34; +>void m34 : undefined +>m34 : typeof m10 + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Promise +>import("./") : Promise +>"./" : "./" + +const _m36 = import("./index"); +>_m36 : Promise +>import("./index") : Promise +>"./index" : "./index" + +const _m37 = import("./subfolder"); +>_m37 : Promise +>import("./subfolder") : Promise +>"./subfolder" : "./subfolder" + +const _m38 = import("./subfolder/"); +>_m38 : Promise +>import("./subfolder/") : Promise +>"./subfolder/" : "./subfolder/" + +const _m39 = import("./subfolder/index"); +>_m39 : Promise +>import("./subfolder/index") : Promise +>"./subfolder/index" : "./subfolder/index" + +const _m40 = import("./subfolder2"); +>_m40 : Promise +>import("./subfolder2") : Promise +>"./subfolder2" : "./subfolder2" + +const _m41 = import("./subfolder2/"); +>_m41 : Promise +>import("./subfolder2/") : Promise +>"./subfolder2/" : "./subfolder2/" + +const _m42 = import("./subfolder2/index"); +>_m42 : Promise +>import("./subfolder2/index") : Promise +>"./subfolder2/index" : "./subfolder2/index" + +const _m43 = import("./subfolder2/another"); +>_m43 : Promise +>import("./subfolder2/another") : Promise +>"./subfolder2/another" : "./subfolder2/another" + +const _m44 = import("./subfolder2/another/"); +>_m44 : Promise +>import("./subfolder2/another/") : Promise +>"./subfolder2/another/" : "./subfolder2/another/" + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Promise +>import("./subfolder2/another/index") : Promise +>"./subfolder2/another/index" : "./subfolder2/another/index" + +// esm format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + +=== tests/cases/conformance/node/index.cts === +// ESM-format imports below should issue errors +import * as m1 from "./index.js"; +>m1 : typeof m1 + +import * as m2 from "./index.mjs"; +>m2 : typeof m2 + +import * as m3 from "./index.cjs"; +>m3 : typeof m3 + +import * as m4 from "./subfolder/index.js"; +>m4 : typeof m4 + +import * as m5 from "./subfolder/index.mjs"; +>m5 : typeof m5 + +import * as m6 from "./subfolder/index.cjs"; +>m6 : typeof m6 + +import * as m7 from "./subfolder2/index.js"; +>m7 : typeof m7 + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : typeof m8 + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : typeof m9 + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : typeof m10 + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : typeof m11 + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : typeof m12 + +// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) +import * as m13 from "./"; +>m13 : typeof m1 + +import * as m14 from "./index"; +>m14 : typeof m1 + +import * as m15 from "./subfolder"; +>m15 : typeof m4 + +import * as m16 from "./subfolder/"; +>m16 : typeof m4 + +import * as m17 from "./subfolder/index"; +>m17 : typeof m4 + +import * as m18 from "./subfolder2"; +>m18 : typeof m7 + +import * as m19 from "./subfolder2/"; +>m19 : typeof m7 + +import * as m20 from "./subfolder2/index"; +>m20 : typeof m7 + +import * as m21 from "./subfolder2/another"; +>m21 : typeof m10 + +import * as m22 from "./subfolder2/another/"; +>m22 : typeof m10 + +import * as m23 from "./subfolder2/another/index"; +>m23 : typeof m10 + +void m1; +>void m1 : undefined +>m1 : typeof m1 + +void m2; +>void m2 : undefined +>m2 : typeof m2 + +void m3; +>void m3 : undefined +>m3 : typeof m3 + +void m4; +>void m4 : undefined +>m4 : typeof m4 + +void m5; +>void m5 : undefined +>m5 : typeof m5 + +void m6; +>void m6 : undefined +>m6 : typeof m6 + +void m7; +>void m7 : undefined +>m7 : typeof m7 + +void m8; +>void m8 : undefined +>m8 : typeof m8 + +void m9; +>void m9 : undefined +>m9 : typeof m9 + +void m10; +>void m10 : undefined +>m10 : typeof m10 + +void m11; +>void m11 : undefined +>m11 : typeof m11 + +void m12; +>void m12 : undefined +>m12 : typeof m12 + +void m13; +>void m13 : undefined +>m13 : typeof m1 + +void m14; +>void m14 : undefined +>m14 : typeof m1 + +void m15; +>void m15 : undefined +>m15 : typeof m4 + +void m16; +>void m16 : undefined +>m16 : typeof m4 + +void m17; +>void m17 : undefined +>m17 : typeof m4 + +void m18; +>void m18 : undefined +>m18 : typeof m7 + +void m19; +>void m19 : undefined +>m19 : typeof m7 + +void m20; +>void m20 : undefined +>m20 : typeof m7 + +void m21; +>void m21 : undefined +>m21 : typeof m10 + +void m22; +>void m22 : undefined +>m22 : typeof m10 + +void m23; +>void m23 : undefined +>m23 : typeof m10 + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : typeof m1 + +import m25 = require("./index"); +>m25 : typeof m1 + +import m26 = require("./subfolder"); +>m26 : typeof m4 + +import m27 = require("./subfolder/"); +>m27 : typeof m4 + +import m28 = require("./subfolder/index"); +>m28 : typeof m4 + +import m29 = require("./subfolder2"); +>m29 : typeof m7 + +import m30 = require("./subfolder2/"); +>m30 : typeof m7 + +import m31 = require("./subfolder2/index"); +>m31 : typeof m7 + +import m32 = require("./subfolder2/another"); +>m32 : typeof m10 + +import m33 = require("./subfolder2/another/"); +>m33 : typeof m10 + +import m34 = require("./subfolder2/another/index"); +>m34 : typeof m10 + +void m24; +>void m24 : undefined +>m24 : typeof m1 + +void m25; +>void m25 : undefined +>m25 : typeof m1 + +void m26; +>void m26 : undefined +>m26 : typeof m4 + +void m27; +>void m27 : undefined +>m27 : typeof m4 + +void m28; +>void m28 : undefined +>m28 : typeof m4 + +void m29; +>void m29 : undefined +>m29 : typeof m7 + +void m30; +>void m30 : undefined +>m30 : typeof m7 + +void m31; +>void m31 : undefined +>m31 : typeof m7 + +void m32; +>void m32 : undefined +>m32 : typeof m10 + +void m33; +>void m33 : undefined +>m33 : typeof m10 + +void m34; +>void m34 : undefined +>m34 : typeof m10 + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Promise +>import("./") : Promise +>"./" : "./" + +const _m36 = import("./index"); +>_m36 : Promise +>import("./index") : Promise +>"./index" : "./index" + +const _m37 = import("./subfolder"); +>_m37 : Promise +>import("./subfolder") : Promise +>"./subfolder" : "./subfolder" + +const _m38 = import("./subfolder/"); +>_m38 : Promise +>import("./subfolder/") : Promise +>"./subfolder/" : "./subfolder/" + +const _m39 = import("./subfolder/index"); +>_m39 : Promise +>import("./subfolder/index") : Promise +>"./subfolder/index" : "./subfolder/index" + +const _m40 = import("./subfolder2"); +>_m40 : Promise +>import("./subfolder2") : Promise +>"./subfolder2" : "./subfolder2" + +const _m41 = import("./subfolder2/"); +>_m41 : Promise +>import("./subfolder2/") : Promise +>"./subfolder2/" : "./subfolder2/" + +const _m42 = import("./subfolder2/index"); +>_m42 : Promise +>import("./subfolder2/index") : Promise +>"./subfolder2/index" : "./subfolder2/index" + +const _m43 = import("./subfolder2/another"); +>_m43 : Promise +>import("./subfolder2/another") : Promise +>"./subfolder2/another" : "./subfolder2/another" + +const _m44 = import("./subfolder2/another/"); +>_m44 : Promise +>import("./subfolder2/another/") : Promise +>"./subfolder2/another/" : "./subfolder2/another/" + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Promise +>import("./subfolder2/another/index") : Promise +>"./subfolder2/another/index" : "./subfolder2/another/index" + +// cjs format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + +=== tests/cases/conformance/node/index.ts === +import * as m1 from "./index.js"; +>m1 : typeof m1 + +import * as m2 from "./index.mjs"; +>m2 : typeof m2 + +import * as m3 from "./index.cjs"; +>m3 : typeof m3 + +import * as m4 from "./subfolder/index.js"; +>m4 : typeof m4 + +import * as m5 from "./subfolder/index.mjs"; +>m5 : typeof m5 + +import * as m6 from "./subfolder/index.cjs"; +>m6 : typeof m6 + +import * as m7 from "./subfolder2/index.js"; +>m7 : typeof m7 + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : typeof m8 + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : typeof m9 + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : typeof m10 + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : typeof m11 + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : typeof m12 + +// The next ones shouldn't all work - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +>m13 : any + +import * as m14 from "./index"; +>m14 : any + +import * as m15 from "./subfolder"; +>m15 : any + +import * as m16 from "./subfolder/"; +>m16 : any + +import * as m17 from "./subfolder/index"; +>m17 : any + +import * as m18 from "./subfolder2"; +>m18 : any + +import * as m19 from "./subfolder2/"; +>m19 : any + +import * as m20 from "./subfolder2/index"; +>m20 : any + +import * as m21 from "./subfolder2/another"; +>m21 : any + +import * as m22 from "./subfolder2/another/"; +>m22 : any + +import * as m23 from "./subfolder2/another/index"; +>m23 : any + +void m1; +>void m1 : undefined +>m1 : typeof m1 + +void m2; +>void m2 : undefined +>m2 : typeof m2 + +void m3; +>void m3 : undefined +>m3 : typeof m3 + +void m4; +>void m4 : undefined +>m4 : typeof m4 + +void m5; +>void m5 : undefined +>m5 : typeof m5 + +void m6; +>void m6 : undefined +>m6 : typeof m6 + +void m7; +>void m7 : undefined +>m7 : typeof m7 + +void m8; +>void m8 : undefined +>m8 : typeof m8 + +void m9; +>void m9 : undefined +>m9 : typeof m9 + +void m10; +>void m10 : undefined +>m10 : typeof m10 + +void m11; +>void m11 : undefined +>m11 : typeof m11 + +void m12; +>void m12 : undefined +>m12 : typeof m12 + +void m13; +>void m13 : undefined +>m13 : any + +void m14; +>void m14 : undefined +>m14 : any + +void m15; +>void m15 : undefined +>m15 : any + +void m16; +>void m16 : undefined +>m16 : any + +void m17; +>void m17 : undefined +>m17 : any + +void m18; +>void m18 : undefined +>m18 : any + +void m19; +>void m19 : undefined +>m19 : any + +void m20; +>void m20 : undefined +>m20 : any + +void m21; +>void m21 : undefined +>m21 : any + +void m22; +>void m22 : undefined +>m22 : any + +void m23; +>void m23 : undefined +>m23 : any + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : typeof m1 + +import m25 = require("./index"); +>m25 : typeof m1 + +import m26 = require("./subfolder"); +>m26 : typeof m26 + +import m27 = require("./subfolder/"); +>m27 : typeof m26 + +import m28 = require("./subfolder/index"); +>m28 : typeof m26 + +import m29 = require("./subfolder2"); +>m29 : typeof m29 + +import m30 = require("./subfolder2/"); +>m30 : typeof m29 + +import m31 = require("./subfolder2/index"); +>m31 : typeof m29 + +import m32 = require("./subfolder2/another"); +>m32 : typeof m10 + +import m33 = require("./subfolder2/another/"); +>m33 : typeof m10 + +import m34 = require("./subfolder2/another/index"); +>m34 : typeof m10 + +void m24; +>void m24 : undefined +>m24 : typeof m1 + +void m25; +>void m25 : undefined +>m25 : typeof m1 + +void m26; +>void m26 : undefined +>m26 : typeof m26 + +void m27; +>void m27 : undefined +>m27 : typeof m26 + +void m28; +>void m28 : undefined +>m28 : typeof m26 + +void m29; +>void m29 : undefined +>m29 : typeof m29 + +void m30; +>void m30 : undefined +>m30 : typeof m29 + +void m31; +>void m31 : undefined +>m31 : typeof m29 + +void m32; +>void m32 : undefined +>m32 : typeof m10 + +void m33; +>void m33 : undefined +>m33 : typeof m10 + +void m34; +>void m34 : undefined +>m34 : typeof m10 + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Promise +>import("./") : Promise +>"./" : "./" + +const _m36 = import("./index"); +>_m36 : Promise +>import("./index") : Promise +>"./index" : "./index" + +const _m37 = import("./subfolder"); +>_m37 : Promise +>import("./subfolder") : Promise +>"./subfolder" : "./subfolder" + +const _m38 = import("./subfolder/"); +>_m38 : Promise +>import("./subfolder/") : Promise +>"./subfolder/" : "./subfolder/" + +const _m39 = import("./subfolder/index"); +>_m39 : Promise +>import("./subfolder/index") : Promise +>"./subfolder/index" : "./subfolder/index" + +const _m40 = import("./subfolder2"); +>_m40 : Promise +>import("./subfolder2") : Promise +>"./subfolder2" : "./subfolder2" + +const _m41 = import("./subfolder2/"); +>_m41 : Promise +>import("./subfolder2/") : Promise +>"./subfolder2/" : "./subfolder2/" + +const _m42 = import("./subfolder2/index"); +>_m42 : Promise +>import("./subfolder2/index") : Promise +>"./subfolder2/index" : "./subfolder2/index" + +const _m43 = import("./subfolder2/another"); +>_m43 : Promise +>import("./subfolder2/another") : Promise +>"./subfolder2/another" : "./subfolder2/another" + +const _m44 = import("./subfolder2/another/"); +>_m44 : Promise +>import("./subfolder2/another/") : Promise +>"./subfolder2/another/" : "./subfolder2/another/" + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Promise +>import("./subfolder2/another/index") : Promise +>"./subfolder2/another/index" : "./subfolder2/another/index" + +// esm format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + diff --git a/tests/baselines/reference/nodeModules1(module=nodenext).errors.txt b/tests/baselines/reference/nodeModules1(module=nodenext).errors.txt index 724e3b73ed7..e8bcd1c06a7 100644 --- a/tests/baselines/reference/nodeModules1(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModules1(module=nodenext).errors.txt @@ -15,70 +15,70 @@ tests/cases/conformance/node/index.cts(59,22): error TS1471: Module './subfolder tests/cases/conformance/node/index.cts(60,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(61,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(75,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(76,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/index.cts(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.cts(78,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.cts(79,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/index.cts(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.cts(81,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.cts(82,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/index.cts(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.cts(84,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.cts(85,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/index.cts(76,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.cts(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(78,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(79,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.cts(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(81,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(82,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.cts(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(84,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.cts(85,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/index.mts(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/index.mts(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/index.mts(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/index.mts(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/index.mts(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.mts(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.mts(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.mts(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/index.mts(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(51,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(58,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(59,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.mts(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/index.mts(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/index.mts(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/index.mts(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/index.mts(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.mts(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.mts(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.mts(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.mts(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/index.ts(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/index.ts(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/index.ts(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/index.ts(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/index.ts(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.ts(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.ts(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.ts(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/index.ts(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(51,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(58,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(59,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.ts(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/index.ts(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/index.ts(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/index.ts(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/index.ts(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/index.ts(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/index.ts(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/index.ts(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? ==== tests/cases/conformance/node/subfolder/index.ts (0 errors) ==== @@ -136,34 +136,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import path !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -228,34 +228,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import path !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1; @@ -372,34 +372,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import path !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // cjs format file const x = 1; export {x}; @@ -422,34 +422,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import path !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -514,34 +514,34 @@ tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import path !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1; export {x}; diff --git a/tests/baselines/reference/nodeModulesAllowJs1(module=node16).errors.txt b/tests/baselines/reference/nodeModulesAllowJs1(module=node16).errors.txt new file mode 100644 index 00000000000..83c4abe3350 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJs1(module=node16).errors.txt @@ -0,0 +1,663 @@ +tests/cases/conformance/node/allowJs/index.cjs(2,21): error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.cjs(3,21): error TS1471: Module './index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.cjs(6,21): error TS1471: Module './subfolder/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.cjs(9,21): error TS1471: Module './subfolder2/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.cjs(11,22): error TS1471: Module './subfolder2/another/index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.cjs(12,22): error TS1471: Module './subfolder2/another/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.cjs(15,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.cjs(16,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.cjs(23,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.cjs(24,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.cjs(25,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.cjs(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.cjs(51,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.cjs(52,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.cjs(52,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.cjs(53,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.cjs(54,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.cjs(55,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.cjs(56,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.cjs(57,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.cjs(58,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.cjs(59,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.cjs(59,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.cjs(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.cjs(60,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.cjs(61,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.cjs(61,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.cjs(75,21): error TS2307: Cannot find module './' or its corresponding type declarations. +tests/cases/conformance/node/allowJs/index.cjs(76,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(78,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(79,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(81,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(82,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(84,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(85,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. +tests/cases/conformance/node/allowJs/index.js(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.js(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(50,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.js(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.js(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.js(51,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.js(52,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.js(53,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.js(54,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.js(55,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.js(56,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.js(57,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.js(58,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.js(58,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.js(59,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.js(59,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.js(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.js(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.js(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. +tests/cases/conformance/node/allowJs/index.js(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.js(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. +tests/cases/conformance/node/allowJs/index.mjs(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(50,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.mjs(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.mjs(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.mjs(51,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.mjs(52,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.mjs(53,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.mjs(54,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.mjs(55,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.mjs(56,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.mjs(57,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.mjs(58,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.mjs(58,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.mjs(59,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.mjs(59,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.mjs(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.mjs(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.mjs(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. +tests/cases/conformance/node/allowJs/index.mjs(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + + +==== tests/cases/conformance/node/allowJs/subfolder/index.js (0 errors) ==== + // cjs format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/allowJs/subfolder/index.cjs (0 errors) ==== + // cjs format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/allowJs/subfolder/index.mjs (0 errors) ==== + // esm format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/allowJs/subfolder2/index.js (0 errors) ==== + // cjs format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/allowJs/subfolder2/index.cjs (0 errors) ==== + // cjs format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/allowJs/subfolder2/index.mjs (0 errors) ==== + // esm format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/allowJs/subfolder2/another/index.js (0 errors) ==== + // esm format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/allowJs/subfolder2/another/index.cjs (0 errors) ==== + // cjs format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/allowJs/subfolder2/another/index.mjs (0 errors) ==== + // esm format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/allowJs/index.js (38 errors) ==== + import * as m1 from "./index.js"; + import * as m2 from "./index.mjs"; + import * as m3 from "./index.cjs"; + import * as m4 from "./subfolder/index.js"; + import * as m5 from "./subfolder/index.mjs"; + import * as m6 from "./subfolder/index.cjs"; + import * as m7 from "./subfolder2/index.js"; + import * as m8 from "./subfolder2/index.mjs"; + import * as m9 from "./subfolder2/index.cjs"; + import * as m10 from "./subfolder2/another/index.js"; + import * as m11 from "./subfolder2/another/index.mjs"; + import * as m12 from "./subfolder2/another/index.cjs"; + // The next ones shouldn't all work - esm format files have no index resolution or extension resolution + import * as m13 from "./"; + ~~~~ +!!! error TS2307: Cannot find module './' or its corresponding type declarations. + import * as m14 from "./index"; + ~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? + import * as m15 from "./subfolder"; + ~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m16 from "./subfolder/"; + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m17 from "./subfolder/index"; + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? + import * as m18 from "./subfolder2"; + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m19 from "./subfolder2/"; + ~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m20 from "./subfolder2/index"; + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? + import * as m21 from "./subfolder2/another"; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m22 from "./subfolder2/another/"; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m23 from "./subfolder2/another/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + void m1; + void m2; + void m3; + void m4; + void m5; + void m6; + void m7; + void m8; + void m9; + void m10; + void m11; + void m12; + void m13; + void m14; + void m15; + void m16; + void m17; + void m18; + void m19; + void m20; + void m21; + void m22; + void m23; + + // These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) + import m24 = require("./"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~ +!!! error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m25 = require("./index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~ +!!! error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m26 = require("./subfolder"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m27 = require("./subfolder/"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m28 = require("./subfolder/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m29 = require("./subfolder2"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m30 = require("./subfolder2/"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m31 = require("./subfolder2/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m32 = require("./subfolder2/another"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m33 = require("./subfolder2/another/"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m34 = require("./subfolder2/another/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + void m24; + void m25; + void m26; + void m27; + void m28; + void m29; + void m30; + void m31; + void m32; + void m33; + void m34; + + // These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution + const _m35 = import("./"); + ~~~~ +!!! error TS2307: Cannot find module './' or its corresponding type declarations. + const _m36 = import("./index"); + ~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? + const _m37 = import("./subfolder"); + ~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m38 = import("./subfolder/"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m39 = import("./subfolder/index"); + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? + const _m40 = import("./subfolder2"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m41 = import("./subfolder2/"); + ~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m42 = import("./subfolder2/index"); + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? + const _m43 = import("./subfolder2/another"); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m44 = import("./subfolder2/another/"); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m45 = import("./subfolder2/another/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + // esm format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/allowJs/index.cjs (38 errors) ==== + // ESM-format imports below should issue errors + import * as m1 from "./index.js"; + ~~~~~~~~~~~~ +!!! error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as m2 from "./index.mjs"; + ~~~~~~~~~~~~~ +!!! error TS1471: Module './index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as m3 from "./index.cjs"; + import * as m4 from "./subfolder/index.js"; + import * as m5 from "./subfolder/index.mjs"; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as m6 from "./subfolder/index.cjs"; + import * as m7 from "./subfolder2/index.js"; + import * as m8 from "./subfolder2/index.mjs"; + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as m9 from "./subfolder2/index.cjs"; + import * as m10 from "./subfolder2/another/index.js"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as m11 from "./subfolder2/another/index.mjs"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as m12 from "./subfolder2/another/index.cjs"; + // The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) + import * as m13 from "./"; + ~~~~ +!!! error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as m14 from "./index"; + ~~~~~~~~~ +!!! error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as m15 from "./subfolder"; + import * as m16 from "./subfolder/"; + import * as m17 from "./subfolder/index"; + import * as m18 from "./subfolder2"; + import * as m19 from "./subfolder2/"; + import * as m20 from "./subfolder2/index"; + import * as m21 from "./subfolder2/another"; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as m22 from "./subfolder2/another/"; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as m23 from "./subfolder2/another/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + void m1; + void m2; + void m3; + void m4; + void m5; + void m6; + void m7; + void m8; + void m9; + void m10; + void m11; + void m12; + void m13; + void m14; + void m15; + void m16; + void m17; + void m18; + void m19; + void m20; + void m21; + void m22; + void m23; + + // These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) + import m24 = require("./"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~ +!!! error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m25 = require("./index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~ +!!! error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m26 = require("./subfolder"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m27 = require("./subfolder/"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m28 = require("./subfolder/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m29 = require("./subfolder2"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m30 = require("./subfolder2/"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m31 = require("./subfolder2/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m32 = require("./subfolder2/another"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m33 = require("./subfolder2/another/"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m34 = require("./subfolder2/another/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + void m24; + void m25; + void m26; + void m27; + void m28; + void m29; + void m30; + void m31; + void m32; + void m33; + void m34; + + // These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution + const _m35 = import("./"); + ~~~~ +!!! error TS2307: Cannot find module './' or its corresponding type declarations. + const _m36 = import("./index"); + ~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? + const _m37 = import("./subfolder"); + ~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m38 = import("./subfolder/"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m39 = import("./subfolder/index"); + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? + const _m40 = import("./subfolder2"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m41 = import("./subfolder2/"); + ~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m42 = import("./subfolder2/index"); + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? + const _m43 = import("./subfolder2/another"); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m44 = import("./subfolder2/another/"); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m45 = import("./subfolder2/another/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + // cjs format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/allowJs/index.mjs (38 errors) ==== + import * as m1 from "./index.js"; + import * as m2 from "./index.mjs"; + import * as m3 from "./index.cjs"; + import * as m4 from "./subfolder/index.js"; + import * as m5 from "./subfolder/index.mjs"; + import * as m6 from "./subfolder/index.cjs"; + import * as m7 from "./subfolder2/index.js"; + import * as m8 from "./subfolder2/index.mjs"; + import * as m9 from "./subfolder2/index.cjs"; + import * as m10 from "./subfolder2/another/index.js"; + import * as m11 from "./subfolder2/another/index.mjs"; + import * as m12 from "./subfolder2/another/index.cjs"; + // The next ones should all fail - esm format files have no index resolution or extension resolution + import * as m13 from "./"; + ~~~~ +!!! error TS2307: Cannot find module './' or its corresponding type declarations. + import * as m14 from "./index"; + ~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? + import * as m15 from "./subfolder"; + ~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m16 from "./subfolder/"; + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m17 from "./subfolder/index"; + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? + import * as m18 from "./subfolder2"; + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m19 from "./subfolder2/"; + ~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m20 from "./subfolder2/index"; + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? + import * as m21 from "./subfolder2/another"; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m22 from "./subfolder2/another/"; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + import * as m23 from "./subfolder2/another/index"; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + void m1; + void m2; + void m3; + void m4; + void m5; + void m6; + void m7; + void m8; + void m9; + void m10; + void m11; + void m12; + void m13; + void m14; + void m15; + void m16; + void m17; + void m18; + void m19; + void m20; + void m21; + void m22; + void m23; + + // These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) + import m24 = require("./"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~ +!!! error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m25 = require("./index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~ +!!! error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m26 = require("./subfolder"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m27 = require("./subfolder/"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m28 = require("./subfolder/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m29 = require("./subfolder2"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m30 = require("./subfolder2/"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m31 = require("./subfolder2/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + import m32 = require("./subfolder2/another"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m33 = require("./subfolder2/another/"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import m34 = require("./subfolder2/another/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + void m24; + void m25; + void m26; + void m27; + void m28; + void m29; + void m30; + void m31; + void m32; + void m33; + void m34; + + // These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution + const _m35 = import("./"); + ~~~~ +!!! error TS2307: Cannot find module './' or its corresponding type declarations. + const _m36 = import("./index"); + ~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? + const _m37 = import("./subfolder"); + ~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m38 = import("./subfolder/"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m39 = import("./subfolder/index"); + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? + const _m40 = import("./subfolder2"); + ~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m41 = import("./subfolder2/"); + ~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m42 = import("./subfolder2/index"); + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? + const _m43 = import("./subfolder2/another"); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m44 = import("./subfolder2/another/"); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. + const _m45 = import("./subfolder2/another/index"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? + + // esm format file + const x = 1; + export {x}; +==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/allowJs/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== tests/cases/conformance/node/allowJs/subfolder2/package.json (0 errors) ==== + { + } +==== tests/cases/conformance/node/allowJs/subfolder2/another/package.json (0 errors) ==== + { + "type": "module" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJs1(module=node16).js b/tests/baselines/reference/nodeModulesAllowJs1(module=node16).js new file mode 100644 index 00000000000..1376e7c5aea --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJs1(module=node16).js @@ -0,0 +1,688 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJs1.ts] //// + +//// [index.js] +// cjs format file +const x = 1; +export {x}; +//// [index.cjs] +// cjs format file +const x = 1; +export {x}; +//// [index.mjs] +// esm format file +const x = 1; +export {x}; +//// [index.js] +// cjs format file +const x = 1; +export {x}; +//// [index.cjs] +// cjs format file +const x = 1; +export {x}; +//// [index.mjs] +// esm format file +const x = 1; +export {x}; +//// [index.js] +// esm format file +const x = 1; +export {x}; +//// [index.cjs] +// cjs format file +const x = 1; +export {x}; +//// [index.mjs] +// esm format file +const x = 1; +export {x}; +//// [index.js] +import * as m1 from "./index.js"; +import * as m2 from "./index.mjs"; +import * as m3 from "./index.cjs"; +import * as m4 from "./subfolder/index.js"; +import * as m5 from "./subfolder/index.mjs"; +import * as m6 from "./subfolder/index.cjs"; +import * as m7 from "./subfolder2/index.js"; +import * as m8 from "./subfolder2/index.mjs"; +import * as m9 from "./subfolder2/index.cjs"; +import * as m10 from "./subfolder2/another/index.js"; +import * as m11 from "./subfolder2/another/index.mjs"; +import * as m12 from "./subfolder2/another/index.cjs"; +// The next ones shouldn't all work - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +import * as m14 from "./index"; +import * as m15 from "./subfolder"; +import * as m16 from "./subfolder/"; +import * as m17 from "./subfolder/index"; +import * as m18 from "./subfolder2"; +import * as m19 from "./subfolder2/"; +import * as m20 from "./subfolder2/index"; +import * as m21 from "./subfolder2/another"; +import * as m22 from "./subfolder2/another/"; +import * as m23 from "./subfolder2/another/index"; +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +import m25 = require("./index"); +import m26 = require("./subfolder"); +import m27 = require("./subfolder/"); +import m28 = require("./subfolder/index"); +import m29 = require("./subfolder2"); +import m30 = require("./subfolder2/"); +import m31 = require("./subfolder2/index"); +import m32 = require("./subfolder2/another"); +import m33 = require("./subfolder2/another/"); +import m34 = require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); +// esm format file +const x = 1; +export {x}; +//// [index.cjs] +// ESM-format imports below should issue errors +import * as m1 from "./index.js"; +import * as m2 from "./index.mjs"; +import * as m3 from "./index.cjs"; +import * as m4 from "./subfolder/index.js"; +import * as m5 from "./subfolder/index.mjs"; +import * as m6 from "./subfolder/index.cjs"; +import * as m7 from "./subfolder2/index.js"; +import * as m8 from "./subfolder2/index.mjs"; +import * as m9 from "./subfolder2/index.cjs"; +import * as m10 from "./subfolder2/another/index.js"; +import * as m11 from "./subfolder2/another/index.mjs"; +import * as m12 from "./subfolder2/another/index.cjs"; +// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) +import * as m13 from "./"; +import * as m14 from "./index"; +import * as m15 from "./subfolder"; +import * as m16 from "./subfolder/"; +import * as m17 from "./subfolder/index"; +import * as m18 from "./subfolder2"; +import * as m19 from "./subfolder2/"; +import * as m20 from "./subfolder2/index"; +import * as m21 from "./subfolder2/another"; +import * as m22 from "./subfolder2/another/"; +import * as m23 from "./subfolder2/another/index"; +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +import m25 = require("./index"); +import m26 = require("./subfolder"); +import m27 = require("./subfolder/"); +import m28 = require("./subfolder/index"); +import m29 = require("./subfolder2"); +import m30 = require("./subfolder2/"); +import m31 = require("./subfolder2/index"); +import m32 = require("./subfolder2/another"); +import m33 = require("./subfolder2/another/"); +import m34 = require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); +// cjs format file +const x = 1; +export {x}; +//// [index.mjs] +import * as m1 from "./index.js"; +import * as m2 from "./index.mjs"; +import * as m3 from "./index.cjs"; +import * as m4 from "./subfolder/index.js"; +import * as m5 from "./subfolder/index.mjs"; +import * as m6 from "./subfolder/index.cjs"; +import * as m7 from "./subfolder2/index.js"; +import * as m8 from "./subfolder2/index.mjs"; +import * as m9 from "./subfolder2/index.cjs"; +import * as m10 from "./subfolder2/another/index.js"; +import * as m11 from "./subfolder2/another/index.mjs"; +import * as m12 from "./subfolder2/another/index.cjs"; +// The next ones should all fail - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +import * as m14 from "./index"; +import * as m15 from "./subfolder"; +import * as m16 from "./subfolder/"; +import * as m17 from "./subfolder/index"; +import * as m18 from "./subfolder2"; +import * as m19 from "./subfolder2/"; +import * as m20 from "./subfolder2/index"; +import * as m21 from "./subfolder2/another"; +import * as m22 from "./subfolder2/another/"; +import * as m23 from "./subfolder2/another/index"; +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +import m25 = require("./index"); +import m26 = require("./subfolder"); +import m27 = require("./subfolder/"); +import m28 = require("./subfolder/index"); +import m29 = require("./subfolder2"); +import m30 = require("./subfolder2/"); +import m31 = require("./subfolder2/index"); +import m32 = require("./subfolder2/another"); +import m33 = require("./subfolder2/another/"); +import m34 = require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); + +// esm format file +const x = 1; +export {x}; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [package.json] +{ +} +//// [package.json] +{ + "type": "module" +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = 1; +exports.x = x; +//// [index.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = 1; +exports.x = x; +//// [index.mjs] +// esm format file +const x = 1; +export { x }; +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = 1; +exports.x = x; +//// [index.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = 1; +exports.x = x; +//// [index.mjs] +// esm format file +const x = 1; +export { x }; +//// [index.js] +// esm format file +const x = 1; +export { x }; +//// [index.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = 1; +exports.x = x; +//// [index.mjs] +// esm format file +const x = 1; +export { x }; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// ESM-format imports below should issue errors +const m1 = __importStar(require("./index.js")); +const m2 = __importStar(require("./index.mjs")); +const m3 = __importStar(require("./index.cjs")); +const m4 = __importStar(require("./subfolder/index.js")); +const m5 = __importStar(require("./subfolder/index.mjs")); +const m6 = __importStar(require("./subfolder/index.cjs")); +const m7 = __importStar(require("./subfolder2/index.js")); +const m8 = __importStar(require("./subfolder2/index.mjs")); +const m9 = __importStar(require("./subfolder2/index.cjs")); +const m10 = __importStar(require("./subfolder2/another/index.js")); +const m11 = __importStar(require("./subfolder2/another/index.mjs")); +const m12 = __importStar(require("./subfolder2/another/index.cjs")); +// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) +const m13 = __importStar(require("./")); +const m14 = __importStar(require("./index")); +const m15 = __importStar(require("./subfolder")); +const m16 = __importStar(require("./subfolder/")); +const m17 = __importStar(require("./subfolder/index")); +const m18 = __importStar(require("./subfolder2")); +const m19 = __importStar(require("./subfolder2/")); +const m20 = __importStar(require("./subfolder2/index")); +const m21 = __importStar(require("./subfolder2/another")); +const m22 = __importStar(require("./subfolder2/another/")); +const m23 = __importStar(require("./subfolder2/another/index")); +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +const m24 = require("./"); +const m25 = require("./index"); +const m26 = require("./subfolder"); +const m27 = require("./subfolder/"); +const m28 = require("./subfolder/index"); +const m29 = require("./subfolder2"); +const m30 = require("./subfolder2/"); +const m31 = require("./subfolder2/index"); +const m32 = require("./subfolder2/another"); +const m33 = require("./subfolder2/another/"); +const m34 = require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); +// cjs format file +const x = 1; +exports.x = x; +//// [index.mjs] +import { createRequire as _createRequire } from "module"; +const __require = _createRequire(import.meta.url); +import * as m1 from "./index.js"; +import * as m2 from "./index.mjs"; +import * as m3 from "./index.cjs"; +import * as m4 from "./subfolder/index.js"; +import * as m5 from "./subfolder/index.mjs"; +import * as m6 from "./subfolder/index.cjs"; +import * as m7 from "./subfolder2/index.js"; +import * as m8 from "./subfolder2/index.mjs"; +import * as m9 from "./subfolder2/index.cjs"; +import * as m10 from "./subfolder2/another/index.js"; +import * as m11 from "./subfolder2/another/index.mjs"; +import * as m12 from "./subfolder2/another/index.cjs"; +// The next ones should all fail - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +import * as m14 from "./index"; +import * as m15 from "./subfolder"; +import * as m16 from "./subfolder/"; +import * as m17 from "./subfolder/index"; +import * as m18 from "./subfolder2"; +import * as m19 from "./subfolder2/"; +import * as m20 from "./subfolder2/index"; +import * as m21 from "./subfolder2/another"; +import * as m22 from "./subfolder2/another/"; +import * as m23 from "./subfolder2/another/index"; +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +const m24 = __require("./"); +const m25 = __require("./index"); +const m26 = __require("./subfolder"); +const m27 = __require("./subfolder/"); +const m28 = __require("./subfolder/index"); +const m29 = __require("./subfolder2"); +const m30 = __require("./subfolder2/"); +const m31 = __require("./subfolder2/index"); +const m32 = __require("./subfolder2/another"); +const m33 = __require("./subfolder2/another/"); +const m34 = __require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); +// esm format file +const x = 1; +export { x }; +//// [index.js] +import { createRequire as _createRequire } from "module"; +const __require = _createRequire(import.meta.url); +import * as m1 from "./index.js"; +import * as m2 from "./index.mjs"; +import * as m3 from "./index.cjs"; +import * as m4 from "./subfolder/index.js"; +import * as m5 from "./subfolder/index.mjs"; +import * as m6 from "./subfolder/index.cjs"; +import * as m7 from "./subfolder2/index.js"; +import * as m8 from "./subfolder2/index.mjs"; +import * as m9 from "./subfolder2/index.cjs"; +import * as m10 from "./subfolder2/another/index.js"; +import * as m11 from "./subfolder2/another/index.mjs"; +import * as m12 from "./subfolder2/another/index.cjs"; +// The next ones shouldn't all work - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +import * as m14 from "./index"; +import * as m15 from "./subfolder"; +import * as m16 from "./subfolder/"; +import * as m17 from "./subfolder/index"; +import * as m18 from "./subfolder2"; +import * as m19 from "./subfolder2/"; +import * as m20 from "./subfolder2/index"; +import * as m21 from "./subfolder2/another"; +import * as m22 from "./subfolder2/another/"; +import * as m23 from "./subfolder2/another/index"; +void m1; +void m2; +void m3; +void m4; +void m5; +void m6; +void m7; +void m8; +void m9; +void m10; +void m11; +void m12; +void m13; +void m14; +void m15; +void m16; +void m17; +void m18; +void m19; +void m20; +void m21; +void m22; +void m23; +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +const m24 = __require("./"); +const m25 = __require("./index"); +const m26 = __require("./subfolder"); +const m27 = __require("./subfolder/"); +const m28 = __require("./subfolder/index"); +const m29 = __require("./subfolder2"); +const m30 = __require("./subfolder2/"); +const m31 = __require("./subfolder2/index"); +const m32 = __require("./subfolder2/another"); +const m33 = __require("./subfolder2/another/"); +const m34 = __require("./subfolder2/another/index"); +void m24; +void m25; +void m26; +void m27; +void m28; +void m29; +void m30; +void m31; +void m32; +void m33; +void m34; +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +const _m36 = import("./index"); +const _m37 = import("./subfolder"); +const _m38 = import("./subfolder/"); +const _m39 = import("./subfolder/index"); +const _m40 = import("./subfolder2"); +const _m41 = import("./subfolder2/"); +const _m42 = import("./subfolder2/index"); +const _m43 = import("./subfolder2/another"); +const _m44 = import("./subfolder2/another/"); +const _m45 = import("./subfolder2/another/index"); +// esm format file +const x = 1; +export { x }; + + +//// [index.d.ts] +export const x: 1; +//// [index.d.cts] +export const x: 1; +//// [index.d.mts] +export const x: 1; +//// [index.d.ts] +export const x: 1; +//// [index.d.cts] +export const x: 1; +//// [index.d.mts] +export const x: 1; +//// [index.d.ts] +export const x: 1; +//// [index.d.cts] +export const x: 1; +//// [index.d.mts] +export const x: 1; +//// [index.d.cts] +export const x: 1; +//// [index.d.mts] +export const x: 1; +//// [index.d.ts] +export const x: 1; diff --git a/tests/baselines/reference/nodeModulesAllowJs1(module=node16).symbols b/tests/baselines/reference/nodeModulesAllowJs1(module=node16).symbols new file mode 100644 index 00000000000..d874ab0c830 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJs1(module=node16).symbols @@ -0,0 +1,817 @@ +=== tests/cases/conformance/node/allowJs/subfolder/index.js === +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.js, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.js, 2, 8)) + +=== tests/cases/conformance/node/allowJs/subfolder/index.cjs === +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.cjs, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.cjs, 2, 8)) + +=== tests/cases/conformance/node/allowJs/subfolder/index.mjs === +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.mjs, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.mjs, 2, 8)) + +=== tests/cases/conformance/node/allowJs/subfolder2/index.js === +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.js, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.js, 2, 8)) + +=== tests/cases/conformance/node/allowJs/subfolder2/index.cjs === +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.cjs, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.cjs, 2, 8)) + +=== tests/cases/conformance/node/allowJs/subfolder2/index.mjs === +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.mjs, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.mjs, 2, 8)) + +=== tests/cases/conformance/node/allowJs/subfolder2/another/index.js === +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.js, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.js, 2, 8)) + +=== tests/cases/conformance/node/allowJs/subfolder2/another/index.cjs === +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.cjs, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.cjs, 2, 8)) + +=== tests/cases/conformance/node/allowJs/subfolder2/another/index.mjs === +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.mjs, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.mjs, 2, 8)) + +=== tests/cases/conformance/node/allowJs/index.js === +import * as m1 from "./index.js"; +>m1 : Symbol(m1, Decl(index.js, 0, 6)) + +import * as m2 from "./index.mjs"; +>m2 : Symbol(m2, Decl(index.js, 1, 6)) + +import * as m3 from "./index.cjs"; +>m3 : Symbol(m3, Decl(index.js, 2, 6)) + +import * as m4 from "./subfolder/index.js"; +>m4 : Symbol(m4, Decl(index.js, 3, 6)) + +import * as m5 from "./subfolder/index.mjs"; +>m5 : Symbol(m5, Decl(index.js, 4, 6)) + +import * as m6 from "./subfolder/index.cjs"; +>m6 : Symbol(m6, Decl(index.js, 5, 6)) + +import * as m7 from "./subfolder2/index.js"; +>m7 : Symbol(m7, Decl(index.js, 6, 6)) + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : Symbol(m8, Decl(index.js, 7, 6)) + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : Symbol(m9, Decl(index.js, 8, 6)) + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : Symbol(m10, Decl(index.js, 9, 6)) + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : Symbol(m11, Decl(index.js, 10, 6)) + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : Symbol(m12, Decl(index.js, 11, 6)) + +// The next ones shouldn't all work - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +>m13 : Symbol(m13, Decl(index.js, 13, 6)) + +import * as m14 from "./index"; +>m14 : Symbol(m14, Decl(index.js, 14, 6)) + +import * as m15 from "./subfolder"; +>m15 : Symbol(m15, Decl(index.js, 15, 6)) + +import * as m16 from "./subfolder/"; +>m16 : Symbol(m16, Decl(index.js, 16, 6)) + +import * as m17 from "./subfolder/index"; +>m17 : Symbol(m17, Decl(index.js, 17, 6)) + +import * as m18 from "./subfolder2"; +>m18 : Symbol(m18, Decl(index.js, 18, 6)) + +import * as m19 from "./subfolder2/"; +>m19 : Symbol(m19, Decl(index.js, 19, 6)) + +import * as m20 from "./subfolder2/index"; +>m20 : Symbol(m20, Decl(index.js, 20, 6)) + +import * as m21 from "./subfolder2/another"; +>m21 : Symbol(m21, Decl(index.js, 21, 6)) + +import * as m22 from "./subfolder2/another/"; +>m22 : Symbol(m22, Decl(index.js, 22, 6)) + +import * as m23 from "./subfolder2/another/index"; +>m23 : Symbol(m23, Decl(index.js, 23, 6)) + +void m1; +>m1 : Symbol(m1, Decl(index.js, 0, 6)) + +void m2; +>m2 : Symbol(m2, Decl(index.js, 1, 6)) + +void m3; +>m3 : Symbol(m3, Decl(index.js, 2, 6)) + +void m4; +>m4 : Symbol(m4, Decl(index.js, 3, 6)) + +void m5; +>m5 : Symbol(m5, Decl(index.js, 4, 6)) + +void m6; +>m6 : Symbol(m6, Decl(index.js, 5, 6)) + +void m7; +>m7 : Symbol(m7, Decl(index.js, 6, 6)) + +void m8; +>m8 : Symbol(m8, Decl(index.js, 7, 6)) + +void m9; +>m9 : Symbol(m9, Decl(index.js, 8, 6)) + +void m10; +>m10 : Symbol(m10, Decl(index.js, 9, 6)) + +void m11; +>m11 : Symbol(m11, Decl(index.js, 10, 6)) + +void m12; +>m12 : Symbol(m12, Decl(index.js, 11, 6)) + +void m13; +>m13 : Symbol(m13, Decl(index.js, 13, 6)) + +void m14; +>m14 : Symbol(m14, Decl(index.js, 14, 6)) + +void m15; +>m15 : Symbol(m15, Decl(index.js, 15, 6)) + +void m16; +>m16 : Symbol(m16, Decl(index.js, 16, 6)) + +void m17; +>m17 : Symbol(m17, Decl(index.js, 17, 6)) + +void m18; +>m18 : Symbol(m18, Decl(index.js, 18, 6)) + +void m19; +>m19 : Symbol(m19, Decl(index.js, 19, 6)) + +void m20; +>m20 : Symbol(m20, Decl(index.js, 20, 6)) + +void m21; +>m21 : Symbol(m21, Decl(index.js, 21, 6)) + +void m22; +>m22 : Symbol(m22, Decl(index.js, 22, 6)) + +void m23; +>m23 : Symbol(m23, Decl(index.js, 23, 6)) + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : Symbol(m24, Decl(index.js, 46, 9)) + +import m25 = require("./index"); +>m25 : Symbol(m25, Decl(index.js, 49, 27)) + +import m26 = require("./subfolder"); +>m26 : Symbol(m26, Decl(index.js, 50, 32)) + +import m27 = require("./subfolder/"); +>m27 : Symbol(m27, Decl(index.js, 51, 36)) + +import m28 = require("./subfolder/index"); +>m28 : Symbol(m28, Decl(index.js, 52, 37)) + +import m29 = require("./subfolder2"); +>m29 : Symbol(m29, Decl(index.js, 53, 42)) + +import m30 = require("./subfolder2/"); +>m30 : Symbol(m30, Decl(index.js, 54, 37)) + +import m31 = require("./subfolder2/index"); +>m31 : Symbol(m31, Decl(index.js, 55, 38)) + +import m32 = require("./subfolder2/another"); +>m32 : Symbol(m32, Decl(index.js, 56, 43)) + +import m33 = require("./subfolder2/another/"); +>m33 : Symbol(m33, Decl(index.js, 57, 45)) + +import m34 = require("./subfolder2/another/index"); +>m34 : Symbol(m34, Decl(index.js, 58, 46)) + +void m24; +>m24 : Symbol(m24, Decl(index.js, 46, 9)) + +void m25; +>m25 : Symbol(m25, Decl(index.js, 49, 27)) + +void m26; +>m26 : Symbol(m26, Decl(index.js, 50, 32)) + +void m27; +>m27 : Symbol(m27, Decl(index.js, 51, 36)) + +void m28; +>m28 : Symbol(m28, Decl(index.js, 52, 37)) + +void m29; +>m29 : Symbol(m29, Decl(index.js, 53, 42)) + +void m30; +>m30 : Symbol(m30, Decl(index.js, 54, 37)) + +void m31; +>m31 : Symbol(m31, Decl(index.js, 55, 38)) + +void m32; +>m32 : Symbol(m32, Decl(index.js, 56, 43)) + +void m33; +>m33 : Symbol(m33, Decl(index.js, 57, 45)) + +void m34; +>m34 : Symbol(m34, Decl(index.js, 58, 46)) + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Symbol(_m35, Decl(index.js, 73, 5)) + +const _m36 = import("./index"); +>_m36 : Symbol(_m36, Decl(index.js, 74, 5)) + +const _m37 = import("./subfolder"); +>_m37 : Symbol(_m37, Decl(index.js, 75, 5)) + +const _m38 = import("./subfolder/"); +>_m38 : Symbol(_m38, Decl(index.js, 76, 5)) + +const _m39 = import("./subfolder/index"); +>_m39 : Symbol(_m39, Decl(index.js, 77, 5)) + +const _m40 = import("./subfolder2"); +>_m40 : Symbol(_m40, Decl(index.js, 78, 5)) + +const _m41 = import("./subfolder2/"); +>_m41 : Symbol(_m41, Decl(index.js, 79, 5)) + +const _m42 = import("./subfolder2/index"); +>_m42 : Symbol(_m42, Decl(index.js, 80, 5)) + +const _m43 = import("./subfolder2/another"); +>_m43 : Symbol(_m43, Decl(index.js, 81, 5)) + +const _m44 = import("./subfolder2/another/"); +>_m44 : Symbol(_m44, Decl(index.js, 82, 5)) + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Symbol(_m45, Decl(index.js, 83, 5)) + +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.js, 85, 5)) + +export {x}; +>x : Symbol(m1.x, Decl(index.js, 86, 8)) + +=== tests/cases/conformance/node/allowJs/index.cjs === +// ESM-format imports below should issue errors +import * as m1 from "./index.js"; +>m1 : Symbol(m1, Decl(index.cjs, 1, 6)) + +import * as m2 from "./index.mjs"; +>m2 : Symbol(m2, Decl(index.cjs, 2, 6)) + +import * as m3 from "./index.cjs"; +>m3 : Symbol(m3, Decl(index.cjs, 3, 6)) + +import * as m4 from "./subfolder/index.js"; +>m4 : Symbol(m4, Decl(index.cjs, 4, 6)) + +import * as m5 from "./subfolder/index.mjs"; +>m5 : Symbol(m5, Decl(index.cjs, 5, 6)) + +import * as m6 from "./subfolder/index.cjs"; +>m6 : Symbol(m6, Decl(index.cjs, 6, 6)) + +import * as m7 from "./subfolder2/index.js"; +>m7 : Symbol(m7, Decl(index.cjs, 7, 6)) + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : Symbol(m8, Decl(index.cjs, 8, 6)) + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : Symbol(m9, Decl(index.cjs, 9, 6)) + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : Symbol(m10, Decl(index.cjs, 10, 6)) + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : Symbol(m11, Decl(index.cjs, 11, 6)) + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : Symbol(m12, Decl(index.cjs, 12, 6)) + +// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) +import * as m13 from "./"; +>m13 : Symbol(m13, Decl(index.cjs, 14, 6)) + +import * as m14 from "./index"; +>m14 : Symbol(m14, Decl(index.cjs, 15, 6)) + +import * as m15 from "./subfolder"; +>m15 : Symbol(m15, Decl(index.cjs, 16, 6)) + +import * as m16 from "./subfolder/"; +>m16 : Symbol(m16, Decl(index.cjs, 17, 6)) + +import * as m17 from "./subfolder/index"; +>m17 : Symbol(m17, Decl(index.cjs, 18, 6)) + +import * as m18 from "./subfolder2"; +>m18 : Symbol(m18, Decl(index.cjs, 19, 6)) + +import * as m19 from "./subfolder2/"; +>m19 : Symbol(m19, Decl(index.cjs, 20, 6)) + +import * as m20 from "./subfolder2/index"; +>m20 : Symbol(m20, Decl(index.cjs, 21, 6)) + +import * as m21 from "./subfolder2/another"; +>m21 : Symbol(m21, Decl(index.cjs, 22, 6)) + +import * as m22 from "./subfolder2/another/"; +>m22 : Symbol(m22, Decl(index.cjs, 23, 6)) + +import * as m23 from "./subfolder2/another/index"; +>m23 : Symbol(m23, Decl(index.cjs, 24, 6)) + +void m1; +>m1 : Symbol(m1, Decl(index.cjs, 1, 6)) + +void m2; +>m2 : Symbol(m2, Decl(index.cjs, 2, 6)) + +void m3; +>m3 : Symbol(m3, Decl(index.cjs, 3, 6)) + +void m4; +>m4 : Symbol(m4, Decl(index.cjs, 4, 6)) + +void m5; +>m5 : Symbol(m5, Decl(index.cjs, 5, 6)) + +void m6; +>m6 : Symbol(m6, Decl(index.cjs, 6, 6)) + +void m7; +>m7 : Symbol(m7, Decl(index.cjs, 7, 6)) + +void m8; +>m8 : Symbol(m8, Decl(index.cjs, 8, 6)) + +void m9; +>m9 : Symbol(m9, Decl(index.cjs, 9, 6)) + +void m10; +>m10 : Symbol(m10, Decl(index.cjs, 10, 6)) + +void m11; +>m11 : Symbol(m11, Decl(index.cjs, 11, 6)) + +void m12; +>m12 : Symbol(m12, Decl(index.cjs, 12, 6)) + +void m13; +>m13 : Symbol(m13, Decl(index.cjs, 14, 6)) + +void m14; +>m14 : Symbol(m14, Decl(index.cjs, 15, 6)) + +void m15; +>m15 : Symbol(m15, Decl(index.cjs, 16, 6)) + +void m16; +>m16 : Symbol(m16, Decl(index.cjs, 17, 6)) + +void m17; +>m17 : Symbol(m17, Decl(index.cjs, 18, 6)) + +void m18; +>m18 : Symbol(m18, Decl(index.cjs, 19, 6)) + +void m19; +>m19 : Symbol(m19, Decl(index.cjs, 20, 6)) + +void m20; +>m20 : Symbol(m20, Decl(index.cjs, 21, 6)) + +void m21; +>m21 : Symbol(m21, Decl(index.cjs, 22, 6)) + +void m22; +>m22 : Symbol(m22, Decl(index.cjs, 23, 6)) + +void m23; +>m23 : Symbol(m23, Decl(index.cjs, 24, 6)) + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : Symbol(m24, Decl(index.cjs, 47, 9)) + +import m25 = require("./index"); +>m25 : Symbol(m25, Decl(index.cjs, 50, 27)) + +import m26 = require("./subfolder"); +>m26 : Symbol(m26, Decl(index.cjs, 51, 32)) + +import m27 = require("./subfolder/"); +>m27 : Symbol(m27, Decl(index.cjs, 52, 36)) + +import m28 = require("./subfolder/index"); +>m28 : Symbol(m28, Decl(index.cjs, 53, 37)) + +import m29 = require("./subfolder2"); +>m29 : Symbol(m29, Decl(index.cjs, 54, 42)) + +import m30 = require("./subfolder2/"); +>m30 : Symbol(m30, Decl(index.cjs, 55, 37)) + +import m31 = require("./subfolder2/index"); +>m31 : Symbol(m31, Decl(index.cjs, 56, 38)) + +import m32 = require("./subfolder2/another"); +>m32 : Symbol(m32, Decl(index.cjs, 57, 43)) + +import m33 = require("./subfolder2/another/"); +>m33 : Symbol(m33, Decl(index.cjs, 58, 45)) + +import m34 = require("./subfolder2/another/index"); +>m34 : Symbol(m34, Decl(index.cjs, 59, 46)) + +void m24; +>m24 : Symbol(m24, Decl(index.cjs, 47, 9)) + +void m25; +>m25 : Symbol(m25, Decl(index.cjs, 50, 27)) + +void m26; +>m26 : Symbol(m26, Decl(index.cjs, 51, 32)) + +void m27; +>m27 : Symbol(m27, Decl(index.cjs, 52, 36)) + +void m28; +>m28 : Symbol(m28, Decl(index.cjs, 53, 37)) + +void m29; +>m29 : Symbol(m29, Decl(index.cjs, 54, 42)) + +void m30; +>m30 : Symbol(m30, Decl(index.cjs, 55, 37)) + +void m31; +>m31 : Symbol(m31, Decl(index.cjs, 56, 38)) + +void m32; +>m32 : Symbol(m32, Decl(index.cjs, 57, 43)) + +void m33; +>m33 : Symbol(m33, Decl(index.cjs, 58, 45)) + +void m34; +>m34 : Symbol(m34, Decl(index.cjs, 59, 46)) + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Symbol(_m35, Decl(index.cjs, 74, 5)) + +const _m36 = import("./index"); +>_m36 : Symbol(_m36, Decl(index.cjs, 75, 5)) + +const _m37 = import("./subfolder"); +>_m37 : Symbol(_m37, Decl(index.cjs, 76, 5)) + +const _m38 = import("./subfolder/"); +>_m38 : Symbol(_m38, Decl(index.cjs, 77, 5)) + +const _m39 = import("./subfolder/index"); +>_m39 : Symbol(_m39, Decl(index.cjs, 78, 5)) + +const _m40 = import("./subfolder2"); +>_m40 : Symbol(_m40, Decl(index.cjs, 79, 5)) + +const _m41 = import("./subfolder2/"); +>_m41 : Symbol(_m41, Decl(index.cjs, 80, 5)) + +const _m42 = import("./subfolder2/index"); +>_m42 : Symbol(_m42, Decl(index.cjs, 81, 5)) + +const _m43 = import("./subfolder2/another"); +>_m43 : Symbol(_m43, Decl(index.cjs, 82, 5)) + +const _m44 = import("./subfolder2/another/"); +>_m44 : Symbol(_m44, Decl(index.cjs, 83, 5)) + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Symbol(_m45, Decl(index.cjs, 84, 5)) + +// cjs format file +const x = 1; +>x : Symbol(x, Decl(index.cjs, 86, 5)) + +export {x}; +>x : Symbol(m3.x, Decl(index.cjs, 87, 8)) + +=== tests/cases/conformance/node/allowJs/index.mjs === +import * as m1 from "./index.js"; +>m1 : Symbol(m1, Decl(index.mjs, 0, 6)) + +import * as m2 from "./index.mjs"; +>m2 : Symbol(m2, Decl(index.mjs, 1, 6)) + +import * as m3 from "./index.cjs"; +>m3 : Symbol(m3, Decl(index.mjs, 2, 6)) + +import * as m4 from "./subfolder/index.js"; +>m4 : Symbol(m4, Decl(index.mjs, 3, 6)) + +import * as m5 from "./subfolder/index.mjs"; +>m5 : Symbol(m5, Decl(index.mjs, 4, 6)) + +import * as m6 from "./subfolder/index.cjs"; +>m6 : Symbol(m6, Decl(index.mjs, 5, 6)) + +import * as m7 from "./subfolder2/index.js"; +>m7 : Symbol(m7, Decl(index.mjs, 6, 6)) + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : Symbol(m8, Decl(index.mjs, 7, 6)) + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : Symbol(m9, Decl(index.mjs, 8, 6)) + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : Symbol(m10, Decl(index.mjs, 9, 6)) + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : Symbol(m11, Decl(index.mjs, 10, 6)) + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : Symbol(m12, Decl(index.mjs, 11, 6)) + +// The next ones should all fail - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +>m13 : Symbol(m13, Decl(index.mjs, 13, 6)) + +import * as m14 from "./index"; +>m14 : Symbol(m14, Decl(index.mjs, 14, 6)) + +import * as m15 from "./subfolder"; +>m15 : Symbol(m15, Decl(index.mjs, 15, 6)) + +import * as m16 from "./subfolder/"; +>m16 : Symbol(m16, Decl(index.mjs, 16, 6)) + +import * as m17 from "./subfolder/index"; +>m17 : Symbol(m17, Decl(index.mjs, 17, 6)) + +import * as m18 from "./subfolder2"; +>m18 : Symbol(m18, Decl(index.mjs, 18, 6)) + +import * as m19 from "./subfolder2/"; +>m19 : Symbol(m19, Decl(index.mjs, 19, 6)) + +import * as m20 from "./subfolder2/index"; +>m20 : Symbol(m20, Decl(index.mjs, 20, 6)) + +import * as m21 from "./subfolder2/another"; +>m21 : Symbol(m21, Decl(index.mjs, 21, 6)) + +import * as m22 from "./subfolder2/another/"; +>m22 : Symbol(m22, Decl(index.mjs, 22, 6)) + +import * as m23 from "./subfolder2/another/index"; +>m23 : Symbol(m23, Decl(index.mjs, 23, 6)) + +void m1; +>m1 : Symbol(m1, Decl(index.mjs, 0, 6)) + +void m2; +>m2 : Symbol(m2, Decl(index.mjs, 1, 6)) + +void m3; +>m3 : Symbol(m3, Decl(index.mjs, 2, 6)) + +void m4; +>m4 : Symbol(m4, Decl(index.mjs, 3, 6)) + +void m5; +>m5 : Symbol(m5, Decl(index.mjs, 4, 6)) + +void m6; +>m6 : Symbol(m6, Decl(index.mjs, 5, 6)) + +void m7; +>m7 : Symbol(m7, Decl(index.mjs, 6, 6)) + +void m8; +>m8 : Symbol(m8, Decl(index.mjs, 7, 6)) + +void m9; +>m9 : Symbol(m9, Decl(index.mjs, 8, 6)) + +void m10; +>m10 : Symbol(m10, Decl(index.mjs, 9, 6)) + +void m11; +>m11 : Symbol(m11, Decl(index.mjs, 10, 6)) + +void m12; +>m12 : Symbol(m12, Decl(index.mjs, 11, 6)) + +void m13; +>m13 : Symbol(m13, Decl(index.mjs, 13, 6)) + +void m14; +>m14 : Symbol(m14, Decl(index.mjs, 14, 6)) + +void m15; +>m15 : Symbol(m15, Decl(index.mjs, 15, 6)) + +void m16; +>m16 : Symbol(m16, Decl(index.mjs, 16, 6)) + +void m17; +>m17 : Symbol(m17, Decl(index.mjs, 17, 6)) + +void m18; +>m18 : Symbol(m18, Decl(index.mjs, 18, 6)) + +void m19; +>m19 : Symbol(m19, Decl(index.mjs, 19, 6)) + +void m20; +>m20 : Symbol(m20, Decl(index.mjs, 20, 6)) + +void m21; +>m21 : Symbol(m21, Decl(index.mjs, 21, 6)) + +void m22; +>m22 : Symbol(m22, Decl(index.mjs, 22, 6)) + +void m23; +>m23 : Symbol(m23, Decl(index.mjs, 23, 6)) + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : Symbol(m24, Decl(index.mjs, 46, 9)) + +import m25 = require("./index"); +>m25 : Symbol(m25, Decl(index.mjs, 49, 27)) + +import m26 = require("./subfolder"); +>m26 : Symbol(m26, Decl(index.mjs, 50, 32)) + +import m27 = require("./subfolder/"); +>m27 : Symbol(m27, Decl(index.mjs, 51, 36)) + +import m28 = require("./subfolder/index"); +>m28 : Symbol(m28, Decl(index.mjs, 52, 37)) + +import m29 = require("./subfolder2"); +>m29 : Symbol(m29, Decl(index.mjs, 53, 42)) + +import m30 = require("./subfolder2/"); +>m30 : Symbol(m30, Decl(index.mjs, 54, 37)) + +import m31 = require("./subfolder2/index"); +>m31 : Symbol(m31, Decl(index.mjs, 55, 38)) + +import m32 = require("./subfolder2/another"); +>m32 : Symbol(m32, Decl(index.mjs, 56, 43)) + +import m33 = require("./subfolder2/another/"); +>m33 : Symbol(m33, Decl(index.mjs, 57, 45)) + +import m34 = require("./subfolder2/another/index"); +>m34 : Symbol(m34, Decl(index.mjs, 58, 46)) + +void m24; +>m24 : Symbol(m24, Decl(index.mjs, 46, 9)) + +void m25; +>m25 : Symbol(m25, Decl(index.mjs, 49, 27)) + +void m26; +>m26 : Symbol(m26, Decl(index.mjs, 50, 32)) + +void m27; +>m27 : Symbol(m27, Decl(index.mjs, 51, 36)) + +void m28; +>m28 : Symbol(m28, Decl(index.mjs, 52, 37)) + +void m29; +>m29 : Symbol(m29, Decl(index.mjs, 53, 42)) + +void m30; +>m30 : Symbol(m30, Decl(index.mjs, 54, 37)) + +void m31; +>m31 : Symbol(m31, Decl(index.mjs, 55, 38)) + +void m32; +>m32 : Symbol(m32, Decl(index.mjs, 56, 43)) + +void m33; +>m33 : Symbol(m33, Decl(index.mjs, 57, 45)) + +void m34; +>m34 : Symbol(m34, Decl(index.mjs, 58, 46)) + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Symbol(_m35, Decl(index.mjs, 73, 5)) + +const _m36 = import("./index"); +>_m36 : Symbol(_m36, Decl(index.mjs, 74, 5)) + +const _m37 = import("./subfolder"); +>_m37 : Symbol(_m37, Decl(index.mjs, 75, 5)) + +const _m38 = import("./subfolder/"); +>_m38 : Symbol(_m38, Decl(index.mjs, 76, 5)) + +const _m39 = import("./subfolder/index"); +>_m39 : Symbol(_m39, Decl(index.mjs, 77, 5)) + +const _m40 = import("./subfolder2"); +>_m40 : Symbol(_m40, Decl(index.mjs, 78, 5)) + +const _m41 = import("./subfolder2/"); +>_m41 : Symbol(_m41, Decl(index.mjs, 79, 5)) + +const _m42 = import("./subfolder2/index"); +>_m42 : Symbol(_m42, Decl(index.mjs, 80, 5)) + +const _m43 = import("./subfolder2/another"); +>_m43 : Symbol(_m43, Decl(index.mjs, 81, 5)) + +const _m44 = import("./subfolder2/another/"); +>_m44 : Symbol(_m44, Decl(index.mjs, 82, 5)) + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Symbol(_m45, Decl(index.mjs, 83, 5)) + +// esm format file +const x = 1; +>x : Symbol(x, Decl(index.mjs, 86, 5)) + +export {x}; +>x : Symbol(m2.x, Decl(index.mjs, 87, 8)) + diff --git a/tests/baselines/reference/nodeModulesAllowJs1(module=node16).types b/tests/baselines/reference/nodeModulesAllowJs1(module=node16).types new file mode 100644 index 00000000000..bc08d749cf8 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJs1(module=node16).types @@ -0,0 +1,997 @@ +=== tests/cases/conformance/node/allowJs/subfolder/index.js === +// cjs format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + +=== tests/cases/conformance/node/allowJs/subfolder/index.cjs === +// cjs format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + +=== tests/cases/conformance/node/allowJs/subfolder/index.mjs === +// esm format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + +=== tests/cases/conformance/node/allowJs/subfolder2/index.js === +// cjs format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + +=== tests/cases/conformance/node/allowJs/subfolder2/index.cjs === +// cjs format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + +=== tests/cases/conformance/node/allowJs/subfolder2/index.mjs === +// esm format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + +=== tests/cases/conformance/node/allowJs/subfolder2/another/index.js === +// esm format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + +=== tests/cases/conformance/node/allowJs/subfolder2/another/index.cjs === +// cjs format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + +=== tests/cases/conformance/node/allowJs/subfolder2/another/index.mjs === +// esm format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + +=== tests/cases/conformance/node/allowJs/index.js === +import * as m1 from "./index.js"; +>m1 : typeof m1 + +import * as m2 from "./index.mjs"; +>m2 : typeof m2 + +import * as m3 from "./index.cjs"; +>m3 : typeof m3 + +import * as m4 from "./subfolder/index.js"; +>m4 : typeof m4 + +import * as m5 from "./subfolder/index.mjs"; +>m5 : typeof m5 + +import * as m6 from "./subfolder/index.cjs"; +>m6 : typeof m6 + +import * as m7 from "./subfolder2/index.js"; +>m7 : typeof m7 + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : typeof m8 + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : typeof m9 + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : typeof m10 + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : typeof m11 + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : typeof m12 + +// The next ones shouldn't all work - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +>m13 : any + +import * as m14 from "./index"; +>m14 : any + +import * as m15 from "./subfolder"; +>m15 : any + +import * as m16 from "./subfolder/"; +>m16 : any + +import * as m17 from "./subfolder/index"; +>m17 : any + +import * as m18 from "./subfolder2"; +>m18 : any + +import * as m19 from "./subfolder2/"; +>m19 : any + +import * as m20 from "./subfolder2/index"; +>m20 : any + +import * as m21 from "./subfolder2/another"; +>m21 : any + +import * as m22 from "./subfolder2/another/"; +>m22 : any + +import * as m23 from "./subfolder2/another/index"; +>m23 : any + +void m1; +>void m1 : undefined +>m1 : typeof m1 + +void m2; +>void m2 : undefined +>m2 : typeof m2 + +void m3; +>void m3 : undefined +>m3 : typeof m3 + +void m4; +>void m4 : undefined +>m4 : typeof m4 + +void m5; +>void m5 : undefined +>m5 : typeof m5 + +void m6; +>void m6 : undefined +>m6 : typeof m6 + +void m7; +>void m7 : undefined +>m7 : typeof m7 + +void m8; +>void m8 : undefined +>m8 : typeof m8 + +void m9; +>void m9 : undefined +>m9 : typeof m9 + +void m10; +>void m10 : undefined +>m10 : typeof m10 + +void m11; +>void m11 : undefined +>m11 : typeof m11 + +void m12; +>void m12 : undefined +>m12 : typeof m12 + +void m13; +>void m13 : undefined +>m13 : any + +void m14; +>void m14 : undefined +>m14 : any + +void m15; +>void m15 : undefined +>m15 : any + +void m16; +>void m16 : undefined +>m16 : any + +void m17; +>void m17 : undefined +>m17 : any + +void m18; +>void m18 : undefined +>m18 : any + +void m19; +>void m19 : undefined +>m19 : any + +void m20; +>void m20 : undefined +>m20 : any + +void m21; +>void m21 : undefined +>m21 : any + +void m22; +>void m22 : undefined +>m22 : any + +void m23; +>void m23 : undefined +>m23 : any + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : typeof m1 + +import m25 = require("./index"); +>m25 : typeof m1 + +import m26 = require("./subfolder"); +>m26 : typeof m26 + +import m27 = require("./subfolder/"); +>m27 : typeof m26 + +import m28 = require("./subfolder/index"); +>m28 : typeof m26 + +import m29 = require("./subfolder2"); +>m29 : typeof m29 + +import m30 = require("./subfolder2/"); +>m30 : typeof m29 + +import m31 = require("./subfolder2/index"); +>m31 : typeof m29 + +import m32 = require("./subfolder2/another"); +>m32 : typeof m10 + +import m33 = require("./subfolder2/another/"); +>m33 : typeof m10 + +import m34 = require("./subfolder2/another/index"); +>m34 : typeof m10 + +void m24; +>void m24 : undefined +>m24 : typeof m1 + +void m25; +>void m25 : undefined +>m25 : typeof m1 + +void m26; +>void m26 : undefined +>m26 : typeof m26 + +void m27; +>void m27 : undefined +>m27 : typeof m26 + +void m28; +>void m28 : undefined +>m28 : typeof m26 + +void m29; +>void m29 : undefined +>m29 : typeof m29 + +void m30; +>void m30 : undefined +>m30 : typeof m29 + +void m31; +>void m31 : undefined +>m31 : typeof m29 + +void m32; +>void m32 : undefined +>m32 : typeof m10 + +void m33; +>void m33 : undefined +>m33 : typeof m10 + +void m34; +>void m34 : undefined +>m34 : typeof m10 + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Promise +>import("./") : Promise +>"./" : "./" + +const _m36 = import("./index"); +>_m36 : Promise +>import("./index") : Promise +>"./index" : "./index" + +const _m37 = import("./subfolder"); +>_m37 : Promise +>import("./subfolder") : Promise +>"./subfolder" : "./subfolder" + +const _m38 = import("./subfolder/"); +>_m38 : Promise +>import("./subfolder/") : Promise +>"./subfolder/" : "./subfolder/" + +const _m39 = import("./subfolder/index"); +>_m39 : Promise +>import("./subfolder/index") : Promise +>"./subfolder/index" : "./subfolder/index" + +const _m40 = import("./subfolder2"); +>_m40 : Promise +>import("./subfolder2") : Promise +>"./subfolder2" : "./subfolder2" + +const _m41 = import("./subfolder2/"); +>_m41 : Promise +>import("./subfolder2/") : Promise +>"./subfolder2/" : "./subfolder2/" + +const _m42 = import("./subfolder2/index"); +>_m42 : Promise +>import("./subfolder2/index") : Promise +>"./subfolder2/index" : "./subfolder2/index" + +const _m43 = import("./subfolder2/another"); +>_m43 : Promise +>import("./subfolder2/another") : Promise +>"./subfolder2/another" : "./subfolder2/another" + +const _m44 = import("./subfolder2/another/"); +>_m44 : Promise +>import("./subfolder2/another/") : Promise +>"./subfolder2/another/" : "./subfolder2/another/" + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Promise +>import("./subfolder2/another/index") : Promise +>"./subfolder2/another/index" : "./subfolder2/another/index" + +// esm format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + +=== tests/cases/conformance/node/allowJs/index.cjs === +// ESM-format imports below should issue errors +import * as m1 from "./index.js"; +>m1 : typeof m1 + +import * as m2 from "./index.mjs"; +>m2 : typeof m2 + +import * as m3 from "./index.cjs"; +>m3 : typeof m3 + +import * as m4 from "./subfolder/index.js"; +>m4 : typeof m4 + +import * as m5 from "./subfolder/index.mjs"; +>m5 : typeof m5 + +import * as m6 from "./subfolder/index.cjs"; +>m6 : typeof m6 + +import * as m7 from "./subfolder2/index.js"; +>m7 : typeof m7 + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : typeof m8 + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : typeof m9 + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : typeof m10 + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : typeof m11 + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : typeof m12 + +// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) +import * as m13 from "./"; +>m13 : typeof m1 + +import * as m14 from "./index"; +>m14 : typeof m1 + +import * as m15 from "./subfolder"; +>m15 : typeof m4 + +import * as m16 from "./subfolder/"; +>m16 : typeof m4 + +import * as m17 from "./subfolder/index"; +>m17 : typeof m4 + +import * as m18 from "./subfolder2"; +>m18 : typeof m7 + +import * as m19 from "./subfolder2/"; +>m19 : typeof m7 + +import * as m20 from "./subfolder2/index"; +>m20 : typeof m7 + +import * as m21 from "./subfolder2/another"; +>m21 : typeof m10 + +import * as m22 from "./subfolder2/another/"; +>m22 : typeof m10 + +import * as m23 from "./subfolder2/another/index"; +>m23 : typeof m10 + +void m1; +>void m1 : undefined +>m1 : typeof m1 + +void m2; +>void m2 : undefined +>m2 : typeof m2 + +void m3; +>void m3 : undefined +>m3 : typeof m3 + +void m4; +>void m4 : undefined +>m4 : typeof m4 + +void m5; +>void m5 : undefined +>m5 : typeof m5 + +void m6; +>void m6 : undefined +>m6 : typeof m6 + +void m7; +>void m7 : undefined +>m7 : typeof m7 + +void m8; +>void m8 : undefined +>m8 : typeof m8 + +void m9; +>void m9 : undefined +>m9 : typeof m9 + +void m10; +>void m10 : undefined +>m10 : typeof m10 + +void m11; +>void m11 : undefined +>m11 : typeof m11 + +void m12; +>void m12 : undefined +>m12 : typeof m12 + +void m13; +>void m13 : undefined +>m13 : typeof m1 + +void m14; +>void m14 : undefined +>m14 : typeof m1 + +void m15; +>void m15 : undefined +>m15 : typeof m4 + +void m16; +>void m16 : undefined +>m16 : typeof m4 + +void m17; +>void m17 : undefined +>m17 : typeof m4 + +void m18; +>void m18 : undefined +>m18 : typeof m7 + +void m19; +>void m19 : undefined +>m19 : typeof m7 + +void m20; +>void m20 : undefined +>m20 : typeof m7 + +void m21; +>void m21 : undefined +>m21 : typeof m10 + +void m22; +>void m22 : undefined +>m22 : typeof m10 + +void m23; +>void m23 : undefined +>m23 : typeof m10 + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : typeof m1 + +import m25 = require("./index"); +>m25 : typeof m1 + +import m26 = require("./subfolder"); +>m26 : typeof m4 + +import m27 = require("./subfolder/"); +>m27 : typeof m4 + +import m28 = require("./subfolder/index"); +>m28 : typeof m4 + +import m29 = require("./subfolder2"); +>m29 : typeof m7 + +import m30 = require("./subfolder2/"); +>m30 : typeof m7 + +import m31 = require("./subfolder2/index"); +>m31 : typeof m7 + +import m32 = require("./subfolder2/another"); +>m32 : typeof m10 + +import m33 = require("./subfolder2/another/"); +>m33 : typeof m10 + +import m34 = require("./subfolder2/another/index"); +>m34 : typeof m10 + +void m24; +>void m24 : undefined +>m24 : typeof m1 + +void m25; +>void m25 : undefined +>m25 : typeof m1 + +void m26; +>void m26 : undefined +>m26 : typeof m4 + +void m27; +>void m27 : undefined +>m27 : typeof m4 + +void m28; +>void m28 : undefined +>m28 : typeof m4 + +void m29; +>void m29 : undefined +>m29 : typeof m7 + +void m30; +>void m30 : undefined +>m30 : typeof m7 + +void m31; +>void m31 : undefined +>m31 : typeof m7 + +void m32; +>void m32 : undefined +>m32 : typeof m10 + +void m33; +>void m33 : undefined +>m33 : typeof m10 + +void m34; +>void m34 : undefined +>m34 : typeof m10 + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Promise +>import("./") : Promise +>"./" : "./" + +const _m36 = import("./index"); +>_m36 : Promise +>import("./index") : Promise +>"./index" : "./index" + +const _m37 = import("./subfolder"); +>_m37 : Promise +>import("./subfolder") : Promise +>"./subfolder" : "./subfolder" + +const _m38 = import("./subfolder/"); +>_m38 : Promise +>import("./subfolder/") : Promise +>"./subfolder/" : "./subfolder/" + +const _m39 = import("./subfolder/index"); +>_m39 : Promise +>import("./subfolder/index") : Promise +>"./subfolder/index" : "./subfolder/index" + +const _m40 = import("./subfolder2"); +>_m40 : Promise +>import("./subfolder2") : Promise +>"./subfolder2" : "./subfolder2" + +const _m41 = import("./subfolder2/"); +>_m41 : Promise +>import("./subfolder2/") : Promise +>"./subfolder2/" : "./subfolder2/" + +const _m42 = import("./subfolder2/index"); +>_m42 : Promise +>import("./subfolder2/index") : Promise +>"./subfolder2/index" : "./subfolder2/index" + +const _m43 = import("./subfolder2/another"); +>_m43 : Promise +>import("./subfolder2/another") : Promise +>"./subfolder2/another" : "./subfolder2/another" + +const _m44 = import("./subfolder2/another/"); +>_m44 : Promise +>import("./subfolder2/another/") : Promise +>"./subfolder2/another/" : "./subfolder2/another/" + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Promise +>import("./subfolder2/another/index") : Promise +>"./subfolder2/another/index" : "./subfolder2/another/index" + +// cjs format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + +=== tests/cases/conformance/node/allowJs/index.mjs === +import * as m1 from "./index.js"; +>m1 : typeof m1 + +import * as m2 from "./index.mjs"; +>m2 : typeof m2 + +import * as m3 from "./index.cjs"; +>m3 : typeof m3 + +import * as m4 from "./subfolder/index.js"; +>m4 : typeof m4 + +import * as m5 from "./subfolder/index.mjs"; +>m5 : typeof m5 + +import * as m6 from "./subfolder/index.cjs"; +>m6 : typeof m6 + +import * as m7 from "./subfolder2/index.js"; +>m7 : typeof m7 + +import * as m8 from "./subfolder2/index.mjs"; +>m8 : typeof m8 + +import * as m9 from "./subfolder2/index.cjs"; +>m9 : typeof m9 + +import * as m10 from "./subfolder2/another/index.js"; +>m10 : typeof m10 + +import * as m11 from "./subfolder2/another/index.mjs"; +>m11 : typeof m11 + +import * as m12 from "./subfolder2/another/index.cjs"; +>m12 : typeof m12 + +// The next ones should all fail - esm format files have no index resolution or extension resolution +import * as m13 from "./"; +>m13 : any + +import * as m14 from "./index"; +>m14 : any + +import * as m15 from "./subfolder"; +>m15 : any + +import * as m16 from "./subfolder/"; +>m16 : any + +import * as m17 from "./subfolder/index"; +>m17 : any + +import * as m18 from "./subfolder2"; +>m18 : any + +import * as m19 from "./subfolder2/"; +>m19 : any + +import * as m20 from "./subfolder2/index"; +>m20 : any + +import * as m21 from "./subfolder2/another"; +>m21 : any + +import * as m22 from "./subfolder2/another/"; +>m22 : any + +import * as m23 from "./subfolder2/another/index"; +>m23 : any + +void m1; +>void m1 : undefined +>m1 : typeof m1 + +void m2; +>void m2 : undefined +>m2 : typeof m2 + +void m3; +>void m3 : undefined +>m3 : typeof m3 + +void m4; +>void m4 : undefined +>m4 : typeof m4 + +void m5; +>void m5 : undefined +>m5 : typeof m5 + +void m6; +>void m6 : undefined +>m6 : typeof m6 + +void m7; +>void m7 : undefined +>m7 : typeof m7 + +void m8; +>void m8 : undefined +>m8 : typeof m8 + +void m9; +>void m9 : undefined +>m9 : typeof m9 + +void m10; +>void m10 : undefined +>m10 : typeof m10 + +void m11; +>void m11 : undefined +>m11 : typeof m11 + +void m12; +>void m12 : undefined +>m12 : typeof m12 + +void m13; +>void m13 : undefined +>m13 : any + +void m14; +>void m14 : undefined +>m14 : any + +void m15; +>void m15 : undefined +>m15 : any + +void m16; +>void m16 : undefined +>m16 : any + +void m17; +>void m17 : undefined +>m17 : any + +void m18; +>void m18 : undefined +>m18 : any + +void m19; +>void m19 : undefined +>m19 : any + +void m20; +>void m20 : undefined +>m20 : any + +void m21; +>void m21 : undefined +>m21 : any + +void m22; +>void m22 : undefined +>m22 : any + +void m23; +>void m23 : undefined +>m23 : any + +// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) +import m24 = require("./"); +>m24 : typeof m1 + +import m25 = require("./index"); +>m25 : typeof m1 + +import m26 = require("./subfolder"); +>m26 : typeof m26 + +import m27 = require("./subfolder/"); +>m27 : typeof m26 + +import m28 = require("./subfolder/index"); +>m28 : typeof m26 + +import m29 = require("./subfolder2"); +>m29 : typeof m29 + +import m30 = require("./subfolder2/"); +>m30 : typeof m29 + +import m31 = require("./subfolder2/index"); +>m31 : typeof m29 + +import m32 = require("./subfolder2/another"); +>m32 : typeof m10 + +import m33 = require("./subfolder2/another/"); +>m33 : typeof m10 + +import m34 = require("./subfolder2/another/index"); +>m34 : typeof m10 + +void m24; +>void m24 : undefined +>m24 : typeof m1 + +void m25; +>void m25 : undefined +>m25 : typeof m1 + +void m26; +>void m26 : undefined +>m26 : typeof m26 + +void m27; +>void m27 : undefined +>m27 : typeof m26 + +void m28; +>void m28 : undefined +>m28 : typeof m26 + +void m29; +>void m29 : undefined +>m29 : typeof m29 + +void m30; +>void m30 : undefined +>m30 : typeof m29 + +void m31; +>void m31 : undefined +>m31 : typeof m29 + +void m32; +>void m32 : undefined +>m32 : typeof m10 + +void m33; +>void m33 : undefined +>m33 : typeof m10 + +void m34; +>void m34 : undefined +>m34 : typeof m10 + +// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution +const _m35 = import("./"); +>_m35 : Promise +>import("./") : Promise +>"./" : "./" + +const _m36 = import("./index"); +>_m36 : Promise +>import("./index") : Promise +>"./index" : "./index" + +const _m37 = import("./subfolder"); +>_m37 : Promise +>import("./subfolder") : Promise +>"./subfolder" : "./subfolder" + +const _m38 = import("./subfolder/"); +>_m38 : Promise +>import("./subfolder/") : Promise +>"./subfolder/" : "./subfolder/" + +const _m39 = import("./subfolder/index"); +>_m39 : Promise +>import("./subfolder/index") : Promise +>"./subfolder/index" : "./subfolder/index" + +const _m40 = import("./subfolder2"); +>_m40 : Promise +>import("./subfolder2") : Promise +>"./subfolder2" : "./subfolder2" + +const _m41 = import("./subfolder2/"); +>_m41 : Promise +>import("./subfolder2/") : Promise +>"./subfolder2/" : "./subfolder2/" + +const _m42 = import("./subfolder2/index"); +>_m42 : Promise +>import("./subfolder2/index") : Promise +>"./subfolder2/index" : "./subfolder2/index" + +const _m43 = import("./subfolder2/another"); +>_m43 : Promise +>import("./subfolder2/another") : Promise +>"./subfolder2/another" : "./subfolder2/another" + +const _m44 = import("./subfolder2/another/"); +>_m44 : Promise +>import("./subfolder2/another/") : Promise +>"./subfolder2/another/" : "./subfolder2/another/" + +const _m45 = import("./subfolder2/another/index"); +>_m45 : Promise +>import("./subfolder2/another/index") : Promise +>"./subfolder2/another/index" : "./subfolder2/another/index" + +// esm format file +const x = 1; +>x : 1 +>1 : 1 + +export {x}; +>x : 1 + diff --git a/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).errors.txt index 178c28ed460..83c4abe3350 100644 --- a/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJs1(module=nodenext).errors.txt @@ -26,27 +26,27 @@ tests/cases/conformance/node/allowJs/index.cjs(60,22): error TS1471: Module './s tests/cases/conformance/node/allowJs/index.cjs(61,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.cjs(61,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(75,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(76,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.cjs(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.cjs(78,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.cjs(79,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.cjs(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.cjs(81,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.cjs(82,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.cjs(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.cjs(84,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.cjs(85,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(76,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(78,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(79,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(81,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(82,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.cjs(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(84,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.cjs(85,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.js(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.js(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.js(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.js(50,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.js(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.js(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. @@ -64,27 +64,27 @@ tests/cases/conformance/node/allowJs/index.js(59,22): error TS1471: Module './su tests/cases/conformance/node/allowJs/index.js(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.js(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.js(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.js(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.js(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.js(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.js(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.mjs(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? tests/cases/conformance/node/allowJs/index.mjs(50,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.mjs(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.mjs(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. @@ -102,16 +102,16 @@ tests/cases/conformance/node/allowJs/index.mjs(59,22): error TS1471: Module './s tests/cases/conformance/node/allowJs/index.mjs(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. tests/cases/conformance/node/allowJs/index.mjs(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.mjs(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +tests/cases/conformance/node/allowJs/index.mjs(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? ==== tests/cases/conformance/node/allowJs/subfolder/index.js (0 errors) ==== @@ -169,34 +169,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative im !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -283,34 +283,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative im !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1; export {x}; @@ -448,34 +448,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative im !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // cjs format file const x = 1; export {x}; @@ -498,34 +498,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative im !!! error TS2307: Cannot find module './' or its corresponding type declarations. import * as m14 from "./index"; ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? import * as m15 from "./subfolder"; ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m16 from "./subfolder/"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m17 from "./subfolder/index"; ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? import * as m18 from "./subfolder2"; ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m19 from "./subfolder2/"; ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m20 from "./subfolder2/index"; ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? import * as m21 from "./subfolder2/another"; ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m22 from "./subfolder2/another/"; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import * as m23 from "./subfolder2/another/index"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? void m1; void m2; void m3; @@ -612,34 +612,34 @@ tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative im !!! error TS2307: Cannot find module './' or its corresponding type declarations. const _m36 = import("./index"); ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './index.mjs'? const _m37 = import("./subfolder"); ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m38 = import("./subfolder/"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m39 = import("./subfolder/index"); ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder/index.mjs'? const _m40 = import("./subfolder2"); ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m41 = import("./subfolder2/"); ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m42 = import("./subfolder2/index"); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/index.mjs'? const _m43 = import("./subfolder2/another"); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m44 = import("./subfolder2/another/"); ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. const _m45 = import("./subfolder2/another/index"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? +!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? // esm format file const x = 1; diff --git a/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node16).symbols b/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node16).symbols new file mode 100644 index 00000000000..8ec82fe7e05 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node16).symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/node/allowJs/foo.cjs === +exports.foo = "foo" +>exports.foo : Symbol(foo, Decl(foo.cjs, 0, 0)) +>exports : Symbol(foo, Decl(foo.cjs, 0, 0)) +>foo : Symbol(foo, Decl(foo.cjs, 0, 0)) + +=== tests/cases/conformance/node/allowJs/bar.ts === +import foo from "./foo.cjs" +>foo : Symbol(foo, Decl(bar.ts, 0, 6)) + +foo.foo; +>foo.foo : Symbol(foo.foo, Decl(foo.cjs, 0, 0)) +>foo : Symbol(foo, Decl(bar.ts, 0, 6)) +>foo : Symbol(foo.foo, Decl(foo.cjs, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node16).types b/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node16).types new file mode 100644 index 00000000000..7559910259c --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node16).types @@ -0,0 +1,17 @@ +=== tests/cases/conformance/node/allowJs/foo.cjs === +exports.foo = "foo" +>exports.foo = "foo" : "foo" +>exports.foo : "foo" +>exports : typeof import("tests/cases/conformance/node/allowJs/foo") +>foo : "foo" +>"foo" : "foo" + +=== tests/cases/conformance/node/allowJs/bar.ts === +import foo from "./foo.cjs" +>foo : typeof foo + +foo.foo; +>foo.foo : "foo" +>foo : typeof foo +>foo : "foo" + diff --git a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).errors.txt b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).errors.txt new file mode 100644 index 00000000000..83e50c001e7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).errors.txt @@ -0,0 +1,135 @@ +tests/cases/conformance/node/allowJs/index.cjs(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.cjs(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts(2,13): error TS2303: Circular definition of import alias 'cjs'. +tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. + + +==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== + // esm format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + cjs; + mjs; + type; + import * as cjsi from "inner/a"; + import * as mjsi from "inner/b"; + import * as typei from "inner"; + import * as ts from "inner/types"; + cjsi.mjsSource; + mjsi.mjsSource; + typei.mjsSource; + ts.mjsSource; +==== tests/cases/conformance/node/allowJs/index.mjs (0 errors) ==== + // esm format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + cjs; + mjs; + type; + import * as cjsi from "inner/a"; + import * as mjsi from "inner/b"; + import * as typei from "inner"; + import * as ts from "inner/types"; + cjsi.mjsSource; + mjsi.mjsSource; + typei.mjsSource; + ts.mjsSource; +==== tests/cases/conformance/node/allowJs/index.cjs (2 errors) ==== + // cjs format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + ~~~~~~~~~~~~~ +!!! error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as type from "package"; + ~~~~~~~~~ +!!! error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + cjs; + mjs; + type; + import * as cjsi from "inner/a"; + import * as mjsi from "inner/b"; + import * as typei from "inner"; + import * as ts from "inner/types"; + cjsi.cjsSource; + mjsi.cjsSource; + typei.implicitCjsSource; + ts.cjsSource; +==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts (1 errors) ==== + // cjs format file + import * as cjs from "inner/a"; + ~~~ +!!! error TS2303: Circular definition of import alias 'cjs'. + import * as mjs from "inner/b"; + import * as type from "inner"; + import * as ts from "inner/types"; + export { cjs }; + export { mjs }; + export { type }; + export { ts }; + export const implicitCjsSource = true; +==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts (1 errors) ==== + // esm format file + import * as cjs from "inner/a"; + ~~~ +!!! error TS2303: Circular definition of import alias 'cjs'. + import * as mjs from "inner/b"; + import * as type from "inner"; + import * as ts from "inner/types"; + export { cjs }; + export { mjs }; + export { type }; + export { ts }; + export const mjsSource = true; +==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts (0 errors) ==== + // cjs format file + import * as cjs from "inner/a"; + import * as mjs from "inner/b"; + import * as type from "inner"; + import * as ts from "inner/types"; + export { cjs }; + export { mjs }; + export { type }; + export { ts }; + export const cjsSource = true; +==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } + } +==== tests/cases/conformance/node/allowJs/node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "exports": { + "./a": { + "require": "./index.cjs", + "node": "./index.mjs" + }, + "./b": { + "import": "./index.mjs", + "node": "./index.cjs" + }, + ".": { + "import": "./index.mjs", + "node": "./index.js" + }, + "./types": { + "types": { + "import": "./index.d.mts", + "require": "./index.d.cts", + }, + "node": { + "import": "./index.mjs", + "require": "./index.cjs" + } + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).js b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).js new file mode 100644 index 00000000000..bd0f2a77807 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).js @@ -0,0 +1,205 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsConditionalPackageExports.ts] //// + +//// [index.js] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/a"; +import * as mjsi from "inner/b"; +import * as typei from "inner"; +import * as ts from "inner/types"; +cjsi.mjsSource; +mjsi.mjsSource; +typei.mjsSource; +ts.mjsSource; +//// [index.mjs] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/a"; +import * as mjsi from "inner/b"; +import * as typei from "inner"; +import * as ts from "inner/types"; +cjsi.mjsSource; +mjsi.mjsSource; +typei.mjsSource; +ts.mjsSource; +//// [index.cjs] +// cjs format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/a"; +import * as mjsi from "inner/b"; +import * as typei from "inner"; +import * as ts from "inner/types"; +cjsi.cjsSource; +mjsi.cjsSource; +typei.implicitCjsSource; +ts.cjsSource; +//// [index.d.ts] +// cjs format file +import * as cjs from "inner/a"; +import * as mjs from "inner/b"; +import * as type from "inner"; +import * as ts from "inner/types"; +export { cjs }; +export { mjs }; +export { type }; +export { ts }; +export const implicitCjsSource = true; +//// [index.d.mts] +// esm format file +import * as cjs from "inner/a"; +import * as mjs from "inner/b"; +import * as type from "inner"; +import * as ts from "inner/types"; +export { cjs }; +export { mjs }; +export { type }; +export { ts }; +export const mjsSource = true; +//// [index.d.cts] +// cjs format file +import * as cjs from "inner/a"; +import * as mjs from "inner/b"; +import * as type from "inner"; +import * as ts from "inner/types"; +export { cjs }; +export { mjs }; +export { type }; +export { ts }; +export const cjsSource = true; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } +} +//// [package.json] +{ + "name": "inner", + "private": true, + "exports": { + "./a": { + "require": "./index.cjs", + "node": "./index.mjs" + }, + "./b": { + "import": "./index.mjs", + "node": "./index.cjs" + }, + ".": { + "import": "./index.mjs", + "node": "./index.js" + }, + "./types": { + "types": { + "import": "./index.d.mts", + "require": "./index.d.cts", + }, + "node": { + "import": "./index.mjs", + "require": "./index.cjs" + } + } + } +} + +//// [index.js] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/a"; +import * as mjsi from "inner/b"; +import * as typei from "inner"; +import * as ts from "inner/types"; +cjsi.mjsSource; +mjsi.mjsSource; +typei.mjsSource; +ts.mjsSource; +//// [index.mjs] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/a"; +import * as mjsi from "inner/b"; +import * as typei from "inner"; +import * as ts from "inner/types"; +cjsi.mjsSource; +mjsi.mjsSource; +typei.mjsSource; +ts.mjsSource; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const cjs = __importStar(require("package/cjs")); +const mjs = __importStar(require("package/mjs")); +const type = __importStar(require("package")); +cjs; +mjs; +type; +const cjsi = __importStar(require("inner/a")); +const mjsi = __importStar(require("inner/b")); +const typei = __importStar(require("inner")); +const ts = __importStar(require("inner/types")); +cjsi.cjsSource; +mjsi.cjsSource; +typei.implicitCjsSource; +ts.cjsSource; + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).symbols b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).symbols new file mode 100644 index 00000000000..ce8944196c0 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).symbols @@ -0,0 +1,243 @@ +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.js, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.js, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.js, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.js, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.js, 2, 6)) + +type; +>type : Symbol(type, Decl(index.js, 3, 6)) + +import * as cjsi from "inner/a"; +>cjsi : Symbol(cjsi, Decl(index.js, 7, 6)) + +import * as mjsi from "inner/b"; +>mjsi : Symbol(mjsi, Decl(index.js, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.js, 9, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.js, 10, 6)) + +cjsi.mjsSource; +>cjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>cjsi : Symbol(cjsi, Decl(index.js, 7, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +mjsi.mjsSource; +>mjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>mjsi : Symbol(mjsi, Decl(index.js, 8, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +typei.mjsSource; +>typei.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>typei : Symbol(typei, Decl(index.js, 9, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +ts.mjsSource; +>ts.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>ts : Symbol(ts, Decl(index.js, 10, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +=== tests/cases/conformance/node/allowJs/index.mjs === +// esm format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.mjs, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.mjs, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.mjs, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.mjs, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.mjs, 2, 6)) + +type; +>type : Symbol(type, Decl(index.mjs, 3, 6)) + +import * as cjsi from "inner/a"; +>cjsi : Symbol(cjsi, Decl(index.mjs, 7, 6)) + +import * as mjsi from "inner/b"; +>mjsi : Symbol(mjsi, Decl(index.mjs, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.mjs, 9, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.mjs, 10, 6)) + +cjsi.mjsSource; +>cjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>cjsi : Symbol(cjsi, Decl(index.mjs, 7, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +mjsi.mjsSource; +>mjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>mjsi : Symbol(mjsi, Decl(index.mjs, 8, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +typei.mjsSource; +>typei.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>typei : Symbol(typei, Decl(index.mjs, 9, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +ts.mjsSource; +>ts.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>ts : Symbol(ts, Decl(index.mjs, 10, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +=== tests/cases/conformance/node/allowJs/index.cjs === +// cjs format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.cjs, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.cjs, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.cjs, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.cjs, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.cjs, 2, 6)) + +type; +>type : Symbol(type, Decl(index.cjs, 3, 6)) + +import * as cjsi from "inner/a"; +>cjsi : Symbol(cjsi, Decl(index.cjs, 7, 6)) + +import * as mjsi from "inner/b"; +>mjsi : Symbol(mjsi, Decl(index.cjs, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.cjs, 9, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.cjs, 10, 6)) + +cjsi.cjsSource; +>cjsi.cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) +>cjsi : Symbol(cjsi, Decl(index.cjs, 7, 6)) +>cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) + +mjsi.cjsSource; +>mjsi.cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) +>mjsi : Symbol(mjsi, Decl(index.cjs, 8, 6)) +>cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) + +typei.implicitCjsSource; +>typei.implicitCjsSource : Symbol(cjsi.type.implicitCjsSource, Decl(index.d.ts, 9, 12)) +>typei : Symbol(typei, Decl(index.cjs, 9, 6)) +>implicitCjsSource : Symbol(cjsi.type.implicitCjsSource, Decl(index.d.ts, 9, 12)) + +ts.cjsSource; +>ts.cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) +>ts : Symbol(ts, Decl(index.cjs, 10, 6)) +>cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/a"; +>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) + +import * as mjs from "inner/b"; +>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.ts, 3, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.d.ts, 4, 6)) + +export { cjs }; +>cjs : Symbol(mjs.type.cjs, Decl(index.d.ts, 5, 8)) + +export { mjs }; +>mjs : Symbol(mjs.type.mjs, Decl(index.d.ts, 6, 8)) + +export { type }; +>type : Symbol(mjs.type.type, Decl(index.d.ts, 7, 8)) + +export { ts }; +>ts : Symbol(mjs.type.ts, Decl(index.d.ts, 8, 8)) + +export const implicitCjsSource = true; +>implicitCjsSource : Symbol(mjs.type.implicitCjsSource, Decl(index.d.ts, 9, 12)) + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/a"; +>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) + +import * as mjs from "inner/b"; +>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.mts, 3, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.d.mts, 4, 6)) + +export { cjs }; +>cjs : Symbol(mjs.cjs, Decl(index.d.mts, 5, 8)) + +export { mjs }; +>mjs : Symbol(mjs.mjs, Decl(index.d.mts, 6, 8)) + +export { type }; +>type : Symbol(mjs.type, Decl(index.d.mts, 7, 8)) + +export { ts }; +>ts : Symbol(mjs.ts, Decl(index.d.mts, 8, 8)) + +export const mjsSource = true; +>mjsSource : Symbol(mjs.mjsSource, Decl(index.d.mts, 9, 12)) + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/a"; +>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) + +import * as mjs from "inner/b"; +>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.cts, 3, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.d.cts, 4, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs, Decl(index.d.cts, 5, 8)) + +export { mjs }; +>mjs : Symbol(cjs.mjs, Decl(index.d.cts, 6, 8)) + +export { type }; +>type : Symbol(cjs.type, Decl(index.d.cts, 7, 8)) + +export { ts }; +>ts : Symbol(cjs.ts, Decl(index.d.cts, 8, 8)) + +export const cjsSource = true; +>cjsSource : Symbol(cjs.cjsSource, Decl(index.d.cts, 9, 12)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).types b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).types new file mode 100644 index 00000000000..7b1fe309bb0 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).types @@ -0,0 +1,246 @@ +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs + +import * as mjs from "package/mjs"; +>mjs : typeof mjs + +import * as type from "package"; +>type : typeof type + +cjs; +>cjs : typeof cjs + +mjs; +>mjs : typeof mjs + +type; +>type : typeof type + +import * as cjsi from "inner/a"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/b"; +>mjsi : typeof cjsi + +import * as typei from "inner"; +>typei : typeof cjsi + +import * as ts from "inner/types"; +>ts : typeof cjsi + +cjsi.mjsSource; +>cjsi.mjsSource : true +>cjsi : typeof cjsi +>mjsSource : true + +mjsi.mjsSource; +>mjsi.mjsSource : true +>mjsi : typeof cjsi +>mjsSource : true + +typei.mjsSource; +>typei.mjsSource : true +>typei : typeof cjsi +>mjsSource : true + +ts.mjsSource; +>ts.mjsSource : true +>ts : typeof cjsi +>mjsSource : true + +=== tests/cases/conformance/node/allowJs/index.mjs === +// esm format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs + +import * as mjs from "package/mjs"; +>mjs : typeof mjs + +import * as type from "package"; +>type : typeof type + +cjs; +>cjs : typeof cjs + +mjs; +>mjs : typeof mjs + +type; +>type : typeof type + +import * as cjsi from "inner/a"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/b"; +>mjsi : typeof cjsi + +import * as typei from "inner"; +>typei : typeof cjsi + +import * as ts from "inner/types"; +>ts : typeof cjsi + +cjsi.mjsSource; +>cjsi.mjsSource : true +>cjsi : typeof cjsi +>mjsSource : true + +mjsi.mjsSource; +>mjsi.mjsSource : true +>mjsi : typeof cjsi +>mjsSource : true + +typei.mjsSource; +>typei.mjsSource : true +>typei : typeof cjsi +>mjsSource : true + +ts.mjsSource; +>ts.mjsSource : true +>ts : typeof cjsi +>mjsSource : true + +=== tests/cases/conformance/node/allowJs/index.cjs === +// cjs format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs + +import * as mjs from "package/mjs"; +>mjs : typeof mjs + +import * as type from "package"; +>type : typeof type + +cjs; +>cjs : typeof cjs + +mjs; +>mjs : typeof mjs + +type; +>type : typeof type + +import * as cjsi from "inner/a"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/b"; +>mjsi : typeof cjsi + +import * as typei from "inner"; +>typei : typeof cjsi.type + +import * as ts from "inner/types"; +>ts : typeof cjsi + +cjsi.cjsSource; +>cjsi.cjsSource : true +>cjsi : typeof cjsi +>cjsSource : true + +mjsi.cjsSource; +>mjsi.cjsSource : true +>mjsi : typeof cjsi +>cjsSource : true + +typei.implicitCjsSource; +>typei.implicitCjsSource : true +>typei : typeof cjsi.type +>implicitCjsSource : true + +ts.cjsSource; +>ts.cjsSource : true +>ts : typeof cjsi +>cjsSource : true + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/a"; +>cjs : any + +import * as mjs from "inner/b"; +>mjs : typeof mjs + +import * as type from "inner"; +>type : typeof mjs.type + +import * as ts from "inner/types"; +>ts : typeof mjs + +export { cjs }; +>cjs : any + +export { mjs }; +>mjs : typeof mjs + +export { type }; +>type : typeof mjs.type + +export { ts }; +>ts : typeof mjs + +export const implicitCjsSource = true; +>implicitCjsSource : true +>true : true + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/a"; +>cjs : any + +import * as mjs from "inner/b"; +>mjs : typeof mjs + +import * as type from "inner"; +>type : typeof mjs + +import * as ts from "inner/types"; +>ts : typeof mjs + +export { cjs }; +>cjs : any + +export { mjs }; +>mjs : typeof mjs + +export { type }; +>type : typeof mjs + +export { ts }; +>ts : typeof mjs + +export const mjsSource = true; +>mjsSource : true +>true : true + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/a"; +>cjs : typeof cjs + +import * as mjs from "inner/b"; +>mjs : typeof cjs + +import * as type from "inner"; +>type : typeof cjs.type + +import * as ts from "inner/types"; +>ts : typeof cjs + +export { cjs }; +>cjs : typeof cjs + +export { mjs }; +>mjs : typeof cjs + +export { type }; +>type : typeof cjs.type + +export { ts }; +>ts : typeof cjs + +export const cjsSource = true; +>cjsSource : true +>true : true + diff --git a/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node16).js b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node16).js new file mode 100644 index 00000000000..471912e1192 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node16).js @@ -0,0 +1,45 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsDynamicImport.ts] //// + +//// [index.js] +// cjs format file +export async function main() { + const { readFile } = await import("fs"); +} +//// [index.js] +// esm format file +export async function main() { + const { readFile } = await import("fs"); +} +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [types.d.ts] +declare module "fs"; + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.main = void 0; +// cjs format file +async function main() { + const { readFile } = await import("fs"); +} +exports.main = main; +//// [index.js] +// esm format file +export async function main() { + const { readFile } = await import("fs"); +} + + +//// [index.d.ts] +export function main(): Promise; +//// [index.d.ts] +export function main(): Promise; diff --git a/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node16).symbols b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node16).symbols new file mode 100644 index 00000000000..0b0c85a01f1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node16).symbols @@ -0,0 +1,22 @@ +=== tests/cases/conformance/node/allowJs/subfolder/index.js === +// cjs format file +export async function main() { +>main : Symbol(main, Decl(index.js, 0, 0)) + + const { readFile } = await import("fs"); +>readFile : Symbol(readFile, Decl(index.js, 2, 11)) +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) +} +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +export async function main() { +>main : Symbol(main, Decl(index.js, 0, 0)) + + const { readFile } = await import("fs"); +>readFile : Symbol(readFile, Decl(index.js, 2, 11)) +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) +} +=== tests/cases/conformance/node/allowJs/types.d.ts === +declare module "fs"; +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node16).types b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node16).types new file mode 100644 index 00000000000..650fcf3a637 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node16).types @@ -0,0 +1,26 @@ +=== tests/cases/conformance/node/allowJs/subfolder/index.js === +// cjs format file +export async function main() { +>main : () => Promise + + const { readFile } = await import("fs"); +>readFile : any +>await import("fs") : any +>import("fs") : Promise +>"fs" : "fs" +} +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +export async function main() { +>main : () => Promise + + const { readFile } = await import("fs"); +>readFile : any +>await import("fs") : any +>import("fs") : Promise +>"fs" : "fs" +} +=== tests/cases/conformance/node/allowJs/types.d.ts === +declare module "fs"; +>"fs" : any + diff --git a/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node16).errors.txt b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node16).errors.txt new file mode 100644 index 00000000000..a0a3d489f44 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node16).errors.txt @@ -0,0 +1,41 @@ +tests/cases/conformance/node/allowJs/file.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +tests/cases/conformance/node/allowJs/index.js(3,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. +tests/cases/conformance/node/allowJs/index.js(3,1): error TS8003: 'export =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/subfolder/index.js(3,1): error TS8003: 'export =' can only be used in TypeScript files. + + +==== tests/cases/conformance/node/allowJs/subfolder/index.js (1 errors) ==== + // cjs format file + const a = {}; + export = a; + ~~~~~~~~~~~ +!!! error TS8003: 'export =' can only be used in TypeScript files. +==== tests/cases/conformance/node/allowJs/subfolder/file.js (0 errors) ==== + // cjs format file + const a = {}; + module.exports = a; +==== tests/cases/conformance/node/allowJs/index.js (2 errors) ==== + // esm format file + const a = {}; + export = a; + ~~~~~~~~~~~ +!!! error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. + ~~~~~~~~~~~ +!!! error TS8003: 'export =' can only be used in TypeScript files. +==== tests/cases/conformance/node/allowJs/file.js (1 errors) ==== + // esm format file + import "fs"; + const a = {}; + module.exports = a; + ~~~~~~ +!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/allowJs/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node16).js b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node16).js new file mode 100644 index 00000000000..10d6da622e9 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node16).js @@ -0,0 +1,61 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportAssignment.ts] //// + +//// [index.js] +// cjs format file +const a = {}; +export = a; +//// [file.js] +// cjs format file +const a = {}; +module.exports = a; +//// [index.js] +// esm format file +const a = {}; +export = a; +//// [file.js] +// esm format file +import "fs"; +const a = {}; +module.exports = a; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} + +//// [index.js] +"use strict"; +// cjs format file +const a = {}; +module.exports = a; +//// [file.js] +// cjs format file +const a = {}; +module.exports = a; +//// [index.js] +// esm format file +const a = {}; +export {}; +//// [file.js] +// esm format file +import "fs"; +const a = {}; +module.exports = a; + + +//// [index.d.ts] +export = a; +declare const a: {}; +//// [file.d.ts] +export = a; +declare const a: {}; +//// [index.d.ts] +export = a; +declare const a: {}; +//// [file.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node16).symbols b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node16).symbols new file mode 100644 index 00000000000..4e0e3aed1a9 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node16).symbols @@ -0,0 +1,36 @@ +=== tests/cases/conformance/node/allowJs/subfolder/index.js === +// cjs format file +const a = {}; +>a : Symbol(a, Decl(index.js, 1, 5)) + +export = a; +>a : Symbol(a, Decl(index.js, 1, 5)) + +=== tests/cases/conformance/node/allowJs/subfolder/file.js === +// cjs format file +const a = {}; +>a : Symbol(a, Decl(file.js, 1, 5)) + +module.exports = a; +>module.exports : Symbol(module.exports, Decl(file.js, 0, 0)) +>module : Symbol(export=, Decl(file.js, 1, 13)) +>exports : Symbol(export=, Decl(file.js, 1, 13)) +>a : Symbol(a, Decl(file.js, 1, 5)) + +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +const a = {}; +>a : Symbol(a, Decl(index.js, 1, 5)) + +export = a; +>a : Symbol(a, Decl(index.js, 1, 5)) + +=== tests/cases/conformance/node/allowJs/file.js === +// esm format file +import "fs"; +const a = {}; +>a : Symbol(a, Decl(file.js, 2, 5)) + +module.exports = a; +>a : Symbol(a, Decl(file.js, 2, 5)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node16).types b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node16).types new file mode 100644 index 00000000000..e6543212f66 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node16).types @@ -0,0 +1,45 @@ +=== tests/cases/conformance/node/allowJs/subfolder/index.js === +// cjs format file +const a = {}; +>a : {} +>{} : {} + +export = a; +>a : {} + +=== tests/cases/conformance/node/allowJs/subfolder/file.js === +// cjs format file +const a = {}; +>a : {} +>{} : {} + +module.exports = a; +>module.exports = a : {} +>module.exports : {} +>module : { exports: {}; } +>exports : {} +>a : {} + +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +const a = {}; +>a : {} +>{} : {} + +export = a; +>a : {} + +=== tests/cases/conformance/node/allowJs/file.js === +// esm format file +import "fs"; +const a = {}; +>a : {} +>{} : {} + +module.exports = a; +>module.exports = a : any +>module.exports : any +>module : any +>exports : any +>a : {} + diff --git a/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node16).errors.txt b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node16).errors.txt new file mode 100644 index 00000000000..ed3dc20285b --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node16).errors.txt @@ -0,0 +1,38 @@ +tests/cases/conformance/node/allowJs/subfolder/index.js(2,10): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. +tests/cases/conformance/node/allowJs/subfolder/index.js(3,7): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. +tests/cases/conformance/node/allowJs/subfolder/index.js(4,7): error TS2725: Class name cannot be 'Object' when targeting ES5 with module Node16. +tests/cases/conformance/node/allowJs/subfolder/index.js(5,14): error TS1216: Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules. + + +==== tests/cases/conformance/node/allowJs/subfolder/index.js (4 errors) ==== + // cjs format file + function require() {} + ~~~~~~~ +!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. + const exports = {}; + ~~~~~~~ +!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. + class Object {} + ~~~~~~ +!!! error TS2725: Class name cannot be 'Object' when targeting ES5 with module Node16. + export const __esModule = false; + ~~~~~~~~~~ +!!! error TS1216: Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules. + export {require, exports, Object}; +==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== + // esm format file + function require() {} + const exports = {}; + class Object {} + export const __esModule = false; + export {require, exports, Object}; +==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/allowJs/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node16).js b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node16).js new file mode 100644 index 00000000000..3900870c747 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node16).js @@ -0,0 +1,62 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsGeneratedNameCollisions.ts] //// + +//// [index.js] +// cjs format file +function require() {} +const exports = {}; +class Object {} +export const __esModule = false; +export {require, exports, Object}; +//// [index.js] +// esm format file +function require() {} +const exports = {}; +class Object {} +export const __esModule = false; +export {require, exports, Object}; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Object = exports.exports = exports.require = exports.__esModule = void 0; +// cjs format file +function require() { } +exports.require = require; +const exports = {}; +exports.exports = exports; +class Object { +} +exports.Object = Object; +exports.__esModule = false; +//// [index.js] +// esm format file +function require() { } +const exports = {}; +class Object { +} +export const __esModule = false; +export { require, exports, Object }; + + +//// [index.d.ts] +export const __esModule: false; +export function require(): void; +export const exports: {}; +export class Object { +} +//// [index.d.ts] +export const __esModule: false; +export function require(): void; +export const exports: {}; +export class Object { +} diff --git a/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node16).symbols b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node16).symbols new file mode 100644 index 00000000000..8565d39212c --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node16).symbols @@ -0,0 +1,38 @@ +=== tests/cases/conformance/node/allowJs/subfolder/index.js === +// cjs format file +function require() {} +>require : Symbol(require, Decl(index.js, 0, 0)) + +const exports = {}; +>exports : Symbol(exports, Decl(index.js, 2, 5)) + +class Object {} +>Object : Symbol(Object, Decl(index.js, 2, 19)) + +export const __esModule = false; +>__esModule : Symbol(__esModule, Decl(index.js, 4, 12)) + +export {require, exports, Object}; +>require : Symbol(require, Decl(index.js, 5, 8)) +>exports : Symbol(exports, Decl(index.js, 5, 16)) +>Object : Symbol(Object, Decl(index.js, 5, 25)) + +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +function require() {} +>require : Symbol(require, Decl(index.js, 0, 0)) + +const exports = {}; +>exports : Symbol(exports, Decl(index.js, 2, 5)) + +class Object {} +>Object : Symbol(Object, Decl(index.js, 2, 19)) + +export const __esModule = false; +>__esModule : Symbol(__esModule, Decl(index.js, 4, 12)) + +export {require, exports, Object}; +>require : Symbol(require, Decl(index.js, 5, 8)) +>exports : Symbol(exports, Decl(index.js, 5, 16)) +>Object : Symbol(Object, Decl(index.js, 5, 25)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node16).types b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node16).types new file mode 100644 index 00000000000..a290eb3ca58 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node16).types @@ -0,0 +1,42 @@ +=== tests/cases/conformance/node/allowJs/subfolder/index.js === +// cjs format file +function require() {} +>require : () => void + +const exports = {}; +>exports : {} +>{} : {} + +class Object {} +>Object : Object + +export const __esModule = false; +>__esModule : false +>false : false + +export {require, exports, Object}; +>require : () => void +>exports : {} +>Object : typeof Object + +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +function require() {} +>require : () => void + +const exports = {}; +>exports : {} +>{} : {} + +class Object {} +>Object : Object + +export const __esModule = false; +>__esModule : false +>false : false + +export {require, exports, Object}; +>require : () => void +>exports : {} +>Object : typeof Object + diff --git a/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node16).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node16).errors.txt new file mode 100644 index 00000000000..bbc352d7a78 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node16).errors.txt @@ -0,0 +1,49 @@ +tests/cases/conformance/node/allowJs/file.js(4,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/file.js(6,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.js(2,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.js(4,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/subfolder/index.js(2,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/subfolder/index.js(4,1): error TS8002: 'import ... =' can only be used in TypeScript files. + + +==== tests/cases/conformance/node/allowJs/subfolder/index.js (2 errors) ==== + // cjs format file + import fs = require("fs"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + fs.readFile; + export import fs2 = require("fs"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. +==== tests/cases/conformance/node/allowJs/index.js (2 errors) ==== + // esm format file + import fs = require("fs"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + fs.readFile; + export import fs2 = require("fs"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. +==== tests/cases/conformance/node/allowJs/file.js (2 errors) ==== + // esm format file + const __require = null; + const _createRequire = null; + import fs = require("fs"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + fs.readFile; + export import fs2 = require("fs"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. +==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/allowJs/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== tests/cases/conformance/node/allowJs/types.d.ts (0 errors) ==== + declare module "fs"; \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node16).js b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node16).js new file mode 100644 index 00000000000..1e97293cca8 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node16).js @@ -0,0 +1,68 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportAssignment.ts] //// + +//// [index.js] +// cjs format file +import fs = require("fs"); +fs.readFile; +export import fs2 = require("fs"); +//// [index.js] +// esm format file +import fs = require("fs"); +fs.readFile; +export import fs2 = require("fs"); +//// [file.js] +// esm format file +const __require = null; +const _createRequire = null; +import fs = require("fs"); +fs.readFile; +export import fs2 = require("fs"); +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [types.d.ts] +declare module "fs"; + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const fs = require("fs"); +fs.readFile; +exports.fs2 = require("fs"); +//// [index.js] +import { createRequire as _createRequire } from "module"; +const __require = _createRequire(import.meta.url); +// esm format file +const fs = __require("fs"); +fs.readFile; +const fs2 = __require("fs"); +export { fs2 }; +//// [file.js] +import { createRequire as _createRequire_1 } from "module"; +const __require_1 = _createRequire_1(import.meta.url); +// esm format file +const __require = null; +const _createRequire = null; +const fs = __require_1("fs"); +fs.readFile; +const fs2 = __require_1("fs"); +export { fs2 }; + + +//// [index.d.ts] +/// +import fs2 = require("fs"); +//// [index.d.ts] +/// +import fs2 = require("fs"); +//// [file.d.ts] +/// +import fs2 = require("fs"); diff --git a/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node16).symbols b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node16).symbols new file mode 100644 index 00000000000..11b3047ebcd --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node16).symbols @@ -0,0 +1,43 @@ +=== tests/cases/conformance/node/allowJs/subfolder/index.js === +// cjs format file +import fs = require("fs"); +>fs : Symbol(fs, Decl(index.js, 0, 0)) + +fs.readFile; +>fs : Symbol(fs, Decl(index.js, 0, 0)) + +export import fs2 = require("fs"); +>fs2 : Symbol(fs2, Decl(index.js, 2, 12)) + +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +import fs = require("fs"); +>fs : Symbol(fs, Decl(index.js, 0, 0)) + +fs.readFile; +>fs : Symbol(fs, Decl(index.js, 0, 0)) + +export import fs2 = require("fs"); +>fs2 : Symbol(fs2, Decl(index.js, 2, 12)) + +=== tests/cases/conformance/node/allowJs/file.js === +// esm format file +const __require = null; +>__require : Symbol(__require, Decl(file.js, 1, 5)) + +const _createRequire = null; +>_createRequire : Symbol(_createRequire, Decl(file.js, 2, 5)) + +import fs = require("fs"); +>fs : Symbol(fs, Decl(file.js, 2, 28)) + +fs.readFile; +>fs : Symbol(fs, Decl(file.js, 2, 28)) + +export import fs2 = require("fs"); +>fs2 : Symbol(fs2, Decl(file.js, 4, 12)) + +=== tests/cases/conformance/node/allowJs/types.d.ts === +declare module "fs"; +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node16).types b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node16).types new file mode 100644 index 00000000000..2720b1f1b7d --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node16).types @@ -0,0 +1,51 @@ +=== tests/cases/conformance/node/allowJs/subfolder/index.js === +// cjs format file +import fs = require("fs"); +>fs : any + +fs.readFile; +>fs.readFile : any +>fs : any +>readFile : any + +export import fs2 = require("fs"); +>fs2 : any + +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +import fs = require("fs"); +>fs : any + +fs.readFile; +>fs.readFile : any +>fs : any +>readFile : any + +export import fs2 = require("fs"); +>fs2 : any + +=== tests/cases/conformance/node/allowJs/file.js === +// esm format file +const __require = null; +>__require : any +>null : null + +const _createRequire = null; +>_createRequire : any +>null : null + +import fs = require("fs"); +>fs : any + +fs.readFile; +>fs.readFile : any +>fs : any +>readFile : any + +export import fs2 = require("fs"); +>fs2 : any + +=== tests/cases/conformance/node/allowJs/types.d.ts === +declare module "fs"; +>"fs" : any + diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node16).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node16).errors.txt new file mode 100644 index 00000000000..b75c1c1e6f5 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node16).errors.txt @@ -0,0 +1,36 @@ +tests/cases/conformance/node/allowJs/subfolder/index.js(2,9): error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. +tests/cases/conformance/node/allowJs/subfolder/index.js(4,1): error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + + +==== tests/cases/conformance/node/allowJs/subfolder/index.js (2 errors) ==== + // cjs format file + import {default as _fs} from "fs"; + ~~~~~~~~~~~~~~ +!!! error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + _fs.readFile; + import * as fs from "fs"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + fs.readFile; +==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== + // esm format file + import {default as _fs} from "fs"; + _fs.readFile; + import * as fs from "fs"; + fs.readFile; +==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/allowJs/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== tests/cases/conformance/node/allowJs/types.d.ts (0 errors) ==== + declare module "fs"; + declare module "tslib" { + export {}; + // intentionally missing all helpers + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node16).js b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node16).js new file mode 100644 index 00000000000..a30d220227f --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node16).js @@ -0,0 +1,52 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions1.ts] //// + +//// [index.js] +// cjs format file +import {default as _fs} from "fs"; +_fs.readFile; +import * as fs from "fs"; +fs.readFile; +//// [index.js] +// esm format file +import {default as _fs} from "fs"; +_fs.readFile; +import * as fs from "fs"; +fs.readFile; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [types.d.ts] +declare module "fs"; +declare module "tslib" { + export {}; + // intentionally missing all helpers +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +// cjs format file +const fs_1 = tslib_1.__importDefault(require("fs")); +fs_1.default.readFile; +const fs = tslib_1.__importStar(require("fs")); +fs.readFile; +//// [index.js] +// esm format file +import { default as _fs } from "fs"; +_fs.readFile; +import * as fs from "fs"; +fs.readFile; + + +//// [index.d.ts] +export {}; +//// [index.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node16).symbols b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node16).symbols new file mode 100644 index 00000000000..3822c3fa16d --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node16).symbols @@ -0,0 +1,40 @@ +=== tests/cases/conformance/node/allowJs/subfolder/index.js === +// cjs format file +import {default as _fs} from "fs"; +>default : Symbol(_fs, Decl(types.d.ts, 0, 0)) +>_fs : Symbol(_fs, Decl(index.js, 1, 8)) + +_fs.readFile; +>_fs : Symbol(_fs, Decl(index.js, 1, 8)) + +import * as fs from "fs"; +>fs : Symbol(fs, Decl(index.js, 3, 6)) + +fs.readFile; +>fs : Symbol(fs, Decl(index.js, 3, 6)) + +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +import {default as _fs} from "fs"; +>default : Symbol(_fs, Decl(types.d.ts, 0, 0)) +>_fs : Symbol(_fs, Decl(index.js, 1, 8)) + +_fs.readFile; +>_fs : Symbol(_fs, Decl(index.js, 1, 8)) + +import * as fs from "fs"; +>fs : Symbol(fs, Decl(index.js, 3, 6)) + +fs.readFile; +>fs : Symbol(fs, Decl(index.js, 3, 6)) + +=== tests/cases/conformance/node/allowJs/types.d.ts === +declare module "fs"; +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) + +declare module "tslib" { +>"tslib" : Symbol("tslib", Decl(types.d.ts, 0, 20)) + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node16).types b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node16).types new file mode 100644 index 00000000000..0b27106eae0 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node16).types @@ -0,0 +1,48 @@ +=== tests/cases/conformance/node/allowJs/subfolder/index.js === +// cjs format file +import {default as _fs} from "fs"; +>default : any +>_fs : any + +_fs.readFile; +>_fs.readFile : any +>_fs : any +>readFile : any + +import * as fs from "fs"; +>fs : any + +fs.readFile; +>fs.readFile : any +>fs : any +>readFile : any + +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +import {default as _fs} from "fs"; +>default : any +>_fs : any + +_fs.readFile; +>_fs.readFile : any +>_fs : any +>readFile : any + +import * as fs from "fs"; +>fs : any + +fs.readFile; +>fs.readFile : any +>fs : any +>readFile : any + +=== tests/cases/conformance/node/allowJs/types.d.ts === +declare module "fs"; +>"fs" : any + +declare module "tslib" { +>"tslib" : typeof import("tslib") + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node16).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node16).errors.txt new file mode 100644 index 00000000000..e07871859db --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node16).errors.txt @@ -0,0 +1,32 @@ +tests/cases/conformance/node/allowJs/subfolder/index.ts(2,1): error TS2343: This syntax requires an imported helper named '__exportStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. +tests/cases/conformance/node/allowJs/subfolder/index.ts(3,1): error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + + +==== tests/cases/conformance/node/allowJs/subfolder/index.ts (2 errors) ==== + // cjs format file + export * from "fs"; + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2343: This syntax requires an imported helper named '__exportStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + export * as fs from "fs"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. +==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== + // esm format file + export * from "fs"; + export * as fs from "fs"; +==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/allowJs/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== tests/cases/conformance/node/allowJs/types.d.ts (0 errors) ==== + declare module "fs"; + declare module "tslib" { + export {}; + // intentionally missing all helpers + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node16).js b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node16).js new file mode 100644 index 00000000000..f689312eb37 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node16).js @@ -0,0 +1,48 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions2.ts] //// + +//// [index.ts] +// cjs format file +export * from "fs"; +export * as fs from "fs"; +//// [index.js] +// esm format file +export * from "fs"; +export * as fs from "fs"; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [types.d.ts] +declare module "fs"; +declare module "tslib" { + export {}; + // intentionally missing all helpers +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fs = void 0; +const tslib_1 = require("tslib"); +// cjs format file +tslib_1.__exportStar(require("fs"), exports); +exports.fs = tslib_1.__importStar(require("fs")); +//// [index.js] +// esm format file +export * from "fs"; +export * as fs from "fs"; + + +//// [index.d.ts] +export * from "fs"; +export * as fs from "fs"; +//// [index.d.ts] +/// +export * from "fs"; +export * as fs from "fs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node16).symbols b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node16).symbols new file mode 100644 index 00000000000..46c533db2dc --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node16).symbols @@ -0,0 +1,22 @@ +=== tests/cases/conformance/node/allowJs/subfolder/index.ts === +// cjs format file +export * from "fs"; +export * as fs from "fs"; +>fs : Symbol(fs, Decl(index.ts, 2, 6)) + +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +export * from "fs"; +export * as fs from "fs"; +>fs : Symbol(fs, Decl(index.js, 2, 6)) + +=== tests/cases/conformance/node/allowJs/types.d.ts === +declare module "fs"; +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) + +declare module "tslib" { +>"tslib" : Symbol("tslib", Decl(types.d.ts, 0, 20)) + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node16).types b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node16).types new file mode 100644 index 00000000000..bbcb3d29931 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node16).types @@ -0,0 +1,22 @@ +=== tests/cases/conformance/node/allowJs/subfolder/index.ts === +// cjs format file +export * from "fs"; +export * as fs from "fs"; +>fs : any + +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +export * from "fs"; +export * as fs from "fs"; +>fs : any + +=== tests/cases/conformance/node/allowJs/types.d.ts === +declare module "fs"; +>"fs" : any + +declare module "tslib" { +>"tslib" : typeof import("tslib") + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node16).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node16).errors.txt new file mode 100644 index 00000000000..cd8457101bb --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node16).errors.txt @@ -0,0 +1,31 @@ +tests/cases/conformance/node/allowJs/subfolder/index.js(2,9): error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + + +==== tests/cases/conformance/node/allowJs/subfolder/index.js (1 errors) ==== + // cjs format file + export {default} from "fs"; + ~~~~~~~ +!!! error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + export {default as foo} from "fs"; + export {bar as baz} from "fs"; +==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== + // esm format file + export {default} from "fs"; + export {default as foo} from "fs"; + export {bar as baz} from "fs"; +==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/allowJs/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== tests/cases/conformance/node/allowJs/types.d.ts (0 errors) ==== + declare module "fs"; + declare module "tslib" { + export {}; + // intentionally missing all helpers + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node16).js b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node16).js new file mode 100644 index 00000000000..8e07883b727 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node16).js @@ -0,0 +1,54 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions3.ts] //// + +//// [index.js] +// cjs format file +export {default} from "fs"; +export {default as foo} from "fs"; +export {bar as baz} from "fs"; +//// [index.js] +// esm format file +export {default} from "fs"; +export {default as foo} from "fs"; +export {bar as baz} from "fs"; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [types.d.ts] +declare module "fs"; +declare module "tslib" { + export {}; + // intentionally missing all helpers +} + +//// [index.js] +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.baz = exports.foo = exports.default = void 0; +// cjs format file +var fs_1 = require("fs"); +Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(fs_1).default; } }); +var fs_2 = require("fs"); +Object.defineProperty(exports, "foo", { enumerable: true, get: function () { return __importDefault(fs_2).default; } }); +var fs_3 = require("fs"); +Object.defineProperty(exports, "baz", { enumerable: true, get: function () { return fs_3.bar; } }); +//// [index.js] +// esm format file +export { default } from "fs"; +export { default as foo } from "fs"; +export { bar as baz } from "fs"; + + +//// [index.d.ts] +export { default, default as foo, bar as baz } from "fs"; +//// [index.d.ts] +export { default, default as foo, bar as baz } from "fs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node16).symbols b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node16).symbols new file mode 100644 index 00000000000..767be993d64 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node16).symbols @@ -0,0 +1,36 @@ +=== tests/cases/conformance/node/allowJs/subfolder/index.js === +// cjs format file +export {default} from "fs"; +>default : Symbol(default, Decl(index.js, 1, 8)) + +export {default as foo} from "fs"; +>default : Symbol("fs", Decl(types.d.ts, 0, 0)) +>foo : Symbol(foo, Decl(index.js, 2, 8)) + +export {bar as baz} from "fs"; +>bar : Symbol("fs", Decl(types.d.ts, 0, 0)) +>baz : Symbol(baz, Decl(index.js, 3, 8)) + +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +export {default} from "fs"; +>default : Symbol(default, Decl(index.js, 1, 8)) + +export {default as foo} from "fs"; +>default : Symbol("fs", Decl(types.d.ts, 0, 0)) +>foo : Symbol(foo, Decl(index.js, 2, 8)) + +export {bar as baz} from "fs"; +>bar : Symbol("fs", Decl(types.d.ts, 0, 0)) +>baz : Symbol(baz, Decl(index.js, 3, 8)) + +=== tests/cases/conformance/node/allowJs/types.d.ts === +declare module "fs"; +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) + +declare module "tslib" { +>"tslib" : Symbol("tslib", Decl(types.d.ts, 0, 20)) + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node16).types b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node16).types new file mode 100644 index 00000000000..b07207ec08d --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node16).types @@ -0,0 +1,36 @@ +=== tests/cases/conformance/node/allowJs/subfolder/index.js === +// cjs format file +export {default} from "fs"; +>default : any + +export {default as foo} from "fs"; +>default : any +>foo : any + +export {bar as baz} from "fs"; +>bar : any +>baz : any + +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +export {default} from "fs"; +>default : any + +export {default as foo} from "fs"; +>default : any +>foo : any + +export {bar as baz} from "fs"; +>bar : any +>baz : any + +=== tests/cases/conformance/node/allowJs/types.d.ts === +declare module "fs"; +>"fs" : any + +declare module "tslib" { +>"tslib" : typeof import("tslib") + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node16).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node16).errors.txt new file mode 100644 index 00000000000..7f8ce469152 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node16).errors.txt @@ -0,0 +1,23 @@ +tests/cases/conformance/node/allowJs/subfolder/index.js(2,11): error TS1470: The 'import.meta' meta-property is not allowed in files which will build into CommonJS output. + + +==== tests/cases/conformance/node/allowJs/subfolder/index.js (1 errors) ==== + // cjs format file + const x = import.meta.url; + ~~~~~~~~~~~ +!!! error TS1470: The 'import.meta' meta-property is not allowed in files which will build into CommonJS output. + export {x}; +==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== + // esm format file + const x = import.meta.url; + export {x}; +==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/allowJs/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node16).js b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node16).js new file mode 100644 index 00000000000..7e6d01b7daf --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node16).js @@ -0,0 +1,38 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportMeta.ts] //// + +//// [index.js] +// cjs format file +const x = import.meta.url; +export {x}; +//// [index.js] +// esm format file +const x = import.meta.url; +export {x}; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = import.meta.url; +exports.x = x; +//// [index.js] +// esm format file +const x = import.meta.url; +export { x }; + + +//// [index.d.ts] +export const x: string; +//// [index.d.ts] +export const x: string; diff --git a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node16).symbols b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node16).symbols new file mode 100644 index 00000000000..89649ba7b33 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node16).symbols @@ -0,0 +1,24 @@ +=== tests/cases/conformance/node/allowJs/subfolder/index.js === +// cjs format file +const x = import.meta.url; +>x : Symbol(x, Decl(index.js, 1, 5)) +>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) +>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) +>meta : Symbol(ImportMetaExpression.meta) +>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) + +export {x}; +>x : Symbol(x, Decl(index.js, 2, 8)) + +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +const x = import.meta.url; +>x : Symbol(x, Decl(index.js, 1, 5)) +>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) +>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) +>meta : Symbol(ImportMetaExpression.meta) +>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) + +export {x}; +>x : Symbol(x, Decl(index.js, 2, 8)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node16).types b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node16).types new file mode 100644 index 00000000000..de6d0c96059 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node16).types @@ -0,0 +1,24 @@ +=== tests/cases/conformance/node/allowJs/subfolder/index.js === +// cjs format file +const x = import.meta.url; +>x : string +>import.meta.url : string +>import.meta : ImportMeta +>meta : any +>url : string + +export {x}; +>x : string + +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +const x = import.meta.url; +>x : string +>import.meta.url : string +>import.meta : ImportMeta +>meta : any +>url : string + +export {x}; +>x : string + diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).errors.txt new file mode 100644 index 00000000000..e6f4b3ce2eb --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).errors.txt @@ -0,0 +1,107 @@ +tests/cases/conformance/node/allowJs/index.cjs(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.cjs(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.cjs(9,23): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts(3,22): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. +tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + + +==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== + // esm format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + cjs; + mjs; + type; + import * as cjsi from "inner/cjs"; + import * as mjsi from "inner/mjs"; + import * as typei from "inner"; + cjsi; + mjsi; + typei; +==== tests/cases/conformance/node/allowJs/index.mjs (0 errors) ==== + // esm format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + cjs; + mjs; + type; + import * as cjsi from "inner/cjs"; + import * as mjsi from "inner/mjs"; + import * as typei from "inner"; + cjsi; + mjsi; + typei; +==== tests/cases/conformance/node/allowJs/index.cjs (3 errors) ==== + // cjs format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + ~~~~~~~~~~~~~ +!!! error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as type from "package"; + ~~~~~~~~~ +!!! error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + cjs; + mjs; + type; + import * as cjsi from "inner/cjs"; + import * as mjsi from "inner/mjs"; + ~~~~~~~~~~~ +!!! error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as typei from "inner"; + cjsi; + mjsi; + typei; +==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts (2 errors) ==== + // cjs format file + import * as cjs from "inner/cjs"; + ~~~ +!!! error TS2303: Circular definition of import alias 'cjs'. + import * as mjs from "inner/mjs"; + ~~~~~~~~~~~ +!!! error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as type from "inner"; + export { cjs }; + export { mjs }; + export { type }; +==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts (0 errors) ==== + // esm format file + import * as cjs from "inner/cjs"; + import * as mjs from "inner/mjs"; + import * as type from "inner"; + export { cjs }; + export { mjs }; + export { type }; +==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts (1 errors) ==== + // cjs format file + import * as cjs from "inner/cjs"; + import * as mjs from "inner/mjs"; + ~~~~~~~~~~~ +!!! error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as type from "inner"; + export { cjs }; + export { mjs }; + export { type }; +==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } + } +==== tests/cases/conformance/node/allowJs/node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).js b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).js new file mode 100644 index 00000000000..cce457e2d41 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).js @@ -0,0 +1,165 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageExports.ts] //// + +//// [index.js] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +cjsi; +mjsi; +typei; +//// [index.mjs] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +cjsi; +mjsi; +typei; +//// [index.cjs] +// cjs format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +cjsi; +mjsi; +typei; +//// [index.d.ts] +// cjs format file +import * as cjs from "inner/cjs"; +import * as mjs from "inner/mjs"; +import * as type from "inner"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.mts] +// esm format file +import * as cjs from "inner/cjs"; +import * as mjs from "inner/mjs"; +import * as type from "inner"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.cts] +// cjs format file +import * as cjs from "inner/cjs"; +import * as mjs from "inner/mjs"; +import * as type from "inner"; +export { cjs }; +export { mjs }; +export { type }; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } +} +//// [package.json] +{ + "name": "inner", + "private": true, + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } +} + +//// [index.js] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +cjsi; +mjsi; +typei; +//// [index.mjs] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +cjsi; +mjsi; +typei; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const cjs = __importStar(require("package/cjs")); +const mjs = __importStar(require("package/mjs")); +const type = __importStar(require("package")); +cjs; +mjs; +type; +const cjsi = __importStar(require("inner/cjs")); +const mjsi = __importStar(require("inner/mjs")); +const typei = __importStar(require("inner")); +cjsi; +mjsi; +typei; + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).symbols b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).symbols new file mode 100644 index 00000000000..44c1af02648 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).symbols @@ -0,0 +1,174 @@ +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.js, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.js, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.js, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.js, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.js, 2, 6)) + +type; +>type : Symbol(type, Decl(index.js, 3, 6)) + +import * as cjsi from "inner/cjs"; +>cjsi : Symbol(cjsi, Decl(index.js, 7, 6)) + +import * as mjsi from "inner/mjs"; +>mjsi : Symbol(mjsi, Decl(index.js, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.js, 9, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.js, 7, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.js, 8, 6)) + +typei; +>typei : Symbol(typei, Decl(index.js, 9, 6)) + +=== tests/cases/conformance/node/allowJs/index.mjs === +// esm format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.mjs, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.mjs, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.mjs, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.mjs, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.mjs, 2, 6)) + +type; +>type : Symbol(type, Decl(index.mjs, 3, 6)) + +import * as cjsi from "inner/cjs"; +>cjsi : Symbol(cjsi, Decl(index.mjs, 7, 6)) + +import * as mjsi from "inner/mjs"; +>mjsi : Symbol(mjsi, Decl(index.mjs, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.mjs, 9, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.mjs, 7, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.mjs, 8, 6)) + +typei; +>typei : Symbol(typei, Decl(index.mjs, 9, 6)) + +=== tests/cases/conformance/node/allowJs/index.cjs === +// cjs format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.cjs, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.cjs, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.cjs, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.cjs, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.cjs, 2, 6)) + +type; +>type : Symbol(type, Decl(index.cjs, 3, 6)) + +import * as cjsi from "inner/cjs"; +>cjsi : Symbol(cjsi, Decl(index.cjs, 7, 6)) + +import * as mjsi from "inner/mjs"; +>mjsi : Symbol(mjsi, Decl(index.cjs, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.cjs, 9, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.cjs, 7, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.cjs, 8, 6)) + +typei; +>typei : Symbol(typei, Decl(index.cjs, 9, 6)) + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) + +import * as mjs from "inner/mjs"; +>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.ts, 3, 6)) + +export { cjs }; +>cjs : Symbol(mjs.cjs.cjs.type.cjs, Decl(index.d.ts, 4, 8)) + +export { mjs }; +>mjs : Symbol(mjs.cjs.cjs.type.mjs, Decl(index.d.ts, 5, 8)) + +export { type }; +>type : Symbol(mjs.cjs.cjs.type.type, Decl(index.d.ts, 6, 8)) + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs"; +>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) + +import * as mjs from "inner/mjs"; +>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.mts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs.mjs.cjs, Decl(index.d.mts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.cjs.mjs.mjs, Decl(index.d.mts, 5, 8)) + +export { type }; +>type : Symbol(cjs.cjs.mjs.type, Decl(index.d.mts, 6, 8)) + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) + +import * as mjs from "inner/mjs"; +>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.cts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs, Decl(index.d.cts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.mjs, Decl(index.d.cts, 5, 8)) + +export { type }; +>type : Symbol(cjs.type, Decl(index.d.cts, 6, 8)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).types b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).types new file mode 100644 index 00000000000..f610f5095dd --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).types @@ -0,0 +1,174 @@ +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs + +import * as mjs from "package/mjs"; +>mjs : typeof mjs + +import * as type from "package"; +>type : typeof type + +cjs; +>cjs : typeof cjs + +mjs; +>mjs : typeof mjs + +type; +>type : typeof type + +import * as cjsi from "inner/cjs"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/mjs"; +>mjsi : typeof cjsi.cjs.mjs + +import * as typei from "inner"; +>typei : typeof typei + +cjsi; +>cjsi : typeof cjsi + +mjsi; +>mjsi : typeof cjsi.cjs.mjs + +typei; +>typei : typeof typei + +=== tests/cases/conformance/node/allowJs/index.mjs === +// esm format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs + +import * as mjs from "package/mjs"; +>mjs : typeof mjs + +import * as type from "package"; +>type : typeof type + +cjs; +>cjs : typeof cjs + +mjs; +>mjs : typeof mjs + +type; +>type : typeof type + +import * as cjsi from "inner/cjs"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/mjs"; +>mjsi : typeof cjsi.cjs.mjs + +import * as typei from "inner"; +>typei : typeof typei + +cjsi; +>cjsi : typeof cjsi + +mjsi; +>mjsi : typeof cjsi.cjs.mjs + +typei; +>typei : typeof typei + +=== tests/cases/conformance/node/allowJs/index.cjs === +// cjs format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs + +import * as mjs from "package/mjs"; +>mjs : typeof mjs + +import * as type from "package"; +>type : typeof type + +cjs; +>cjs : typeof cjs + +mjs; +>mjs : typeof mjs + +type; +>type : typeof type + +import * as cjsi from "inner/cjs"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/mjs"; +>mjsi : typeof cjsi.mjs + +import * as typei from "inner"; +>typei : typeof cjsi.mjs.cjs.type + +cjsi; +>cjsi : typeof cjsi + +mjsi; +>mjsi : typeof cjsi.mjs + +typei; +>typei : typeof cjsi.mjs.cjs.type + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : any + +import * as mjs from "inner/mjs"; +>mjs : typeof mjs + +import * as type from "inner"; +>type : typeof mjs.cjs.cjs.type + +export { cjs }; +>cjs : any + +export { mjs }; +>mjs : typeof mjs + +export { type }; +>type : typeof mjs.cjs.cjs.type + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs"; +>cjs : typeof cjs + +import * as mjs from "inner/mjs"; +>mjs : typeof cjs.cjs.mjs + +import * as type from "inner"; +>type : typeof cjs.cjs.mjs.type + +export { cjs }; +>cjs : typeof cjs + +export { mjs }; +>mjs : typeof cjs.cjs.mjs + +export { type }; +>type : typeof cjs.cjs.mjs.type + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : typeof cjs + +import * as mjs from "inner/mjs"; +>mjs : typeof cjs.mjs + +import * as type from "inner"; +>type : typeof cjs.mjs.cjs.type + +export { cjs }; +>cjs : typeof cjs + +export { mjs }; +>mjs : typeof cjs.mjs + +export { type }; +>type : typeof cjs.mjs.cjs.type + diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).errors.txt new file mode 100644 index 00000000000..261be58f1a2 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).errors.txt @@ -0,0 +1,44 @@ +tests/cases/conformance/node/allowJs/index.cjs(3,22): error TS1471: Module '#mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.cjs(4,23): error TS1471: Module '#type' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + + +==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== + // esm format file + import * as cjs from "#cjs"; + import * as mjs from "#mjs"; + import * as type from "#type"; + cjs; + mjs; + type; +==== tests/cases/conformance/node/allowJs/index.mjs (0 errors) ==== + // esm format file + import * as cjs from "#cjs"; + import * as mjs from "#mjs"; + import * as type from "#type"; + cjs; + mjs; + type; +==== tests/cases/conformance/node/allowJs/index.cjs (2 errors) ==== + // esm format file + import * as cjs from "#cjs"; + import * as mjs from "#mjs"; + ~~~~~~ +!!! error TS1471: Module '#mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as type from "#type"; + ~~~~~~~ +!!! error TS1471: Module '#type' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + cjs; + mjs; + type; +==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js", + "imports": { + "#cjs": "./index.cjs", + "#mjs": "./index.mjs", + "#type": "./index.js" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).js b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).js new file mode 100644 index 00000000000..634e532de49 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).js @@ -0,0 +1,96 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageImports.ts] //// + +//// [index.js] +// esm format file +import * as cjs from "#cjs"; +import * as mjs from "#mjs"; +import * as type from "#type"; +cjs; +mjs; +type; +//// [index.mjs] +// esm format file +import * as cjs from "#cjs"; +import * as mjs from "#mjs"; +import * as type from "#type"; +cjs; +mjs; +type; +//// [index.cjs] +// esm format file +import * as cjs from "#cjs"; +import * as mjs from "#mjs"; +import * as type from "#type"; +cjs; +mjs; +type; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js", + "imports": { + "#cjs": "./index.cjs", + "#mjs": "./index.mjs", + "#type": "./index.js" + } +} + +//// [index.js] +// esm format file +import * as cjs from "#cjs"; +import * as mjs from "#mjs"; +import * as type from "#type"; +cjs; +mjs; +type; +//// [index.mjs] +// esm format file +import * as cjs from "#cjs"; +import * as mjs from "#mjs"; +import * as type from "#type"; +cjs; +mjs; +type; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// esm format file +const cjs = __importStar(require("#cjs")); +const mjs = __importStar(require("#mjs")); +const type = __importStar(require("#type")); +cjs; +mjs; +type; + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).symbols b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).symbols new file mode 100644 index 00000000000..196837bc0bc --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).symbols @@ -0,0 +1,60 @@ +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +import * as cjs from "#cjs"; +>cjs : Symbol(cjs, Decl(index.js, 1, 6)) + +import * as mjs from "#mjs"; +>mjs : Symbol(mjs, Decl(index.js, 2, 6)) + +import * as type from "#type"; +>type : Symbol(type, Decl(index.js, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.js, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.js, 2, 6)) + +type; +>type : Symbol(type, Decl(index.js, 3, 6)) + +=== tests/cases/conformance/node/allowJs/index.mjs === +// esm format file +import * as cjs from "#cjs"; +>cjs : Symbol(cjs, Decl(index.mjs, 1, 6)) + +import * as mjs from "#mjs"; +>mjs : Symbol(mjs, Decl(index.mjs, 2, 6)) + +import * as type from "#type"; +>type : Symbol(type, Decl(index.mjs, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.mjs, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.mjs, 2, 6)) + +type; +>type : Symbol(type, Decl(index.mjs, 3, 6)) + +=== tests/cases/conformance/node/allowJs/index.cjs === +// esm format file +import * as cjs from "#cjs"; +>cjs : Symbol(cjs, Decl(index.cjs, 1, 6)) + +import * as mjs from "#mjs"; +>mjs : Symbol(mjs, Decl(index.cjs, 2, 6)) + +import * as type from "#type"; +>type : Symbol(type, Decl(index.cjs, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.cjs, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.cjs, 2, 6)) + +type; +>type : Symbol(type, Decl(index.cjs, 3, 6)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).types b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).types new file mode 100644 index 00000000000..6387f04fcb6 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).types @@ -0,0 +1,60 @@ +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +import * as cjs from "#cjs"; +>cjs : typeof cjs + +import * as mjs from "#mjs"; +>mjs : typeof mjs + +import * as type from "#type"; +>type : typeof type + +cjs; +>cjs : typeof cjs + +mjs; +>mjs : typeof mjs + +type; +>type : typeof type + +=== tests/cases/conformance/node/allowJs/index.mjs === +// esm format file +import * as cjs from "#cjs"; +>cjs : typeof cjs + +import * as mjs from "#mjs"; +>mjs : typeof mjs + +import * as type from "#type"; +>type : typeof type + +cjs; +>cjs : typeof cjs + +mjs; +>mjs : typeof mjs + +type; +>type : typeof type + +=== tests/cases/conformance/node/allowJs/index.cjs === +// esm format file +import * as cjs from "#cjs"; +>cjs : typeof cjs + +import * as mjs from "#mjs"; +>mjs : typeof mjs + +import * as type from "#type"; +>type : typeof type + +cjs; +>cjs : typeof cjs + +mjs; +>mjs : typeof mjs + +type; +>type : typeof type + diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node16).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node16).errors.txt new file mode 100644 index 00000000000..0f199947722 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node16).errors.txt @@ -0,0 +1,78 @@ +tests/cases/conformance/node/allowJs/index.cjs(3,23): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts(3,22): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. +tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + + +==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== + // esm format file + import * as cjsi from "inner/cjs/index"; + import * as mjsi from "inner/mjs/index"; + import * as typei from "inner/js/index"; + cjsi; + mjsi; + typei; +==== tests/cases/conformance/node/allowJs/index.mjs (0 errors) ==== + // esm format file + import * as cjsi from "inner/cjs/index"; + import * as mjsi from "inner/mjs/index"; + import * as typei from "inner/js/index"; + cjsi; + mjsi; + typei; +==== tests/cases/conformance/node/allowJs/index.cjs (1 errors) ==== + // cjs format file + import * as cjsi from "inner/cjs/index"; + import * as mjsi from "inner/mjs/index"; + ~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as typei from "inner/js/index"; + cjsi; + mjsi; + typei; +==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts (2 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/index"; + ~~~ +!!! error TS2303: Circular definition of import alias 'cjs'. + import * as mjs from "inner/mjs/index"; + ~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as type from "inner/js/index"; + export { cjs }; + export { mjs }; + export { type }; +==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts (0 errors) ==== + // esm format file + import * as cjs from "inner/cjs/index"; + import * as mjs from "inner/mjs/index"; + import * as type from "inner/js/index"; + export { cjs }; + export { mjs }; + export { type }; +==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts (1 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/index"; + import * as mjs from "inner/mjs/index"; + ~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as type from "inner/js/index"; + export { cjs }; + export { mjs }; + export { type }; +==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + } +==== tests/cases/conformance/node/allowJs/node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "exports": { + "./cjs/*": "./*.cjs", + "./mjs/*": "./*.mjs", + "./js/*": "./*.js" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node16).js b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node16).js new file mode 100644 index 00000000000..db1bb37d36a --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node16).js @@ -0,0 +1,124 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExports.ts] //// + +//// [index.js] +// esm format file +import * as cjsi from "inner/cjs/index"; +import * as mjsi from "inner/mjs/index"; +import * as typei from "inner/js/index"; +cjsi; +mjsi; +typei; +//// [index.mjs] +// esm format file +import * as cjsi from "inner/cjs/index"; +import * as mjsi from "inner/mjs/index"; +import * as typei from "inner/js/index"; +cjsi; +mjsi; +typei; +//// [index.cjs] +// cjs format file +import * as cjsi from "inner/cjs/index"; +import * as mjsi from "inner/mjs/index"; +import * as typei from "inner/js/index"; +cjsi; +mjsi; +typei; +//// [index.d.ts] +// cjs format file +import * as cjs from "inner/cjs/index"; +import * as mjs from "inner/mjs/index"; +import * as type from "inner/js/index"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.mts] +// esm format file +import * as cjs from "inner/cjs/index"; +import * as mjs from "inner/mjs/index"; +import * as type from "inner/js/index"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.cts] +// cjs format file +import * as cjs from "inner/cjs/index"; +import * as mjs from "inner/mjs/index"; +import * as type from "inner/js/index"; +export { cjs }; +export { mjs }; +export { type }; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", +} +//// [package.json] +{ + "name": "inner", + "private": true, + "exports": { + "./cjs/*": "./*.cjs", + "./mjs/*": "./*.mjs", + "./js/*": "./*.js" + } +} + +//// [index.js] +// esm format file +import * as cjsi from "inner/cjs/index"; +import * as mjsi from "inner/mjs/index"; +import * as typei from "inner/js/index"; +cjsi; +mjsi; +typei; +//// [index.mjs] +// esm format file +import * as cjsi from "inner/cjs/index"; +import * as mjsi from "inner/mjs/index"; +import * as typei from "inner/js/index"; +cjsi; +mjsi; +typei; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const cjsi = __importStar(require("inner/cjs/index")); +const mjsi = __importStar(require("inner/mjs/index")); +const typei = __importStar(require("inner/js/index")); +cjsi; +mjsi; +typei; + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node16).symbols b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node16).symbols new file mode 100644 index 00000000000..714bff6bd6b --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node16).symbols @@ -0,0 +1,120 @@ +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +import * as cjsi from "inner/cjs/index"; +>cjsi : Symbol(cjsi, Decl(index.js, 1, 6)) + +import * as mjsi from "inner/mjs/index"; +>mjsi : Symbol(mjsi, Decl(index.js, 2, 6)) + +import * as typei from "inner/js/index"; +>typei : Symbol(typei, Decl(index.js, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.js, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.js, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.js, 3, 6)) + +=== tests/cases/conformance/node/allowJs/index.mjs === +// esm format file +import * as cjsi from "inner/cjs/index"; +>cjsi : Symbol(cjsi, Decl(index.mjs, 1, 6)) + +import * as mjsi from "inner/mjs/index"; +>mjsi : Symbol(mjsi, Decl(index.mjs, 2, 6)) + +import * as typei from "inner/js/index"; +>typei : Symbol(typei, Decl(index.mjs, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.mjs, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.mjs, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.mjs, 3, 6)) + +=== tests/cases/conformance/node/allowJs/index.cjs === +// cjs format file +import * as cjsi from "inner/cjs/index"; +>cjsi : Symbol(cjsi, Decl(index.cjs, 1, 6)) + +import * as mjsi from "inner/mjs/index"; +>mjsi : Symbol(mjsi, Decl(index.cjs, 2, 6)) + +import * as typei from "inner/js/index"; +>typei : Symbol(typei, Decl(index.cjs, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.cjs, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.cjs, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.cjs, 3, 6)) + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs/index"; +>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) + +import * as mjs from "inner/mjs/index"; +>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) + +import * as type from "inner/js/index"; +>type : Symbol(type, Decl(index.d.ts, 3, 6)) + +export { cjs }; +>cjs : Symbol(mjs.cjs.cjs.type.cjs, Decl(index.d.ts, 4, 8)) + +export { mjs }; +>mjs : Symbol(mjs.cjs.cjs.type.mjs, Decl(index.d.ts, 5, 8)) + +export { type }; +>type : Symbol(mjs.cjs.cjs.type.type, Decl(index.d.ts, 6, 8)) + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs/index"; +>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) + +import * as mjs from "inner/mjs/index"; +>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) + +import * as type from "inner/js/index"; +>type : Symbol(type, Decl(index.d.mts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs.mjs.cjs, Decl(index.d.mts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.cjs.mjs.mjs, Decl(index.d.mts, 5, 8)) + +export { type }; +>type : Symbol(cjs.cjs.mjs.type, Decl(index.d.mts, 6, 8)) + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs/index"; +>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) + +import * as mjs from "inner/mjs/index"; +>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) + +import * as type from "inner/js/index"; +>type : Symbol(type, Decl(index.d.cts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs, Decl(index.d.cts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.mjs, Decl(index.d.cts, 5, 8)) + +export { type }; +>type : Symbol(cjs.type, Decl(index.d.cts, 6, 8)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node16).types b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node16).types new file mode 100644 index 00000000000..2103a12734a --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node16).types @@ -0,0 +1,120 @@ +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +import * as cjsi from "inner/cjs/index"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/mjs/index"; +>mjsi : typeof cjsi.cjs.mjs + +import * as typei from "inner/js/index"; +>typei : typeof typei + +cjsi; +>cjsi : typeof cjsi + +mjsi; +>mjsi : typeof cjsi.cjs.mjs + +typei; +>typei : typeof typei + +=== tests/cases/conformance/node/allowJs/index.mjs === +// esm format file +import * as cjsi from "inner/cjs/index"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/mjs/index"; +>mjsi : typeof cjsi.cjs.mjs + +import * as typei from "inner/js/index"; +>typei : typeof typei + +cjsi; +>cjsi : typeof cjsi + +mjsi; +>mjsi : typeof cjsi.cjs.mjs + +typei; +>typei : typeof typei + +=== tests/cases/conformance/node/allowJs/index.cjs === +// cjs format file +import * as cjsi from "inner/cjs/index"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/mjs/index"; +>mjsi : typeof cjsi.mjs + +import * as typei from "inner/js/index"; +>typei : typeof cjsi.mjs.cjs.type + +cjsi; +>cjsi : typeof cjsi + +mjsi; +>mjsi : typeof cjsi.mjs + +typei; +>typei : typeof cjsi.mjs.cjs.type + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs/index"; +>cjs : any + +import * as mjs from "inner/mjs/index"; +>mjs : typeof mjs + +import * as type from "inner/js/index"; +>type : typeof mjs.cjs.cjs.type + +export { cjs }; +>cjs : any + +export { mjs }; +>mjs : typeof mjs + +export { type }; +>type : typeof mjs.cjs.cjs.type + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs/index"; +>cjs : typeof cjs + +import * as mjs from "inner/mjs/index"; +>mjs : typeof cjs.cjs.mjs + +import * as type from "inner/js/index"; +>type : typeof cjs.cjs.mjs.type + +export { cjs }; +>cjs : typeof cjs + +export { mjs }; +>mjs : typeof cjs.cjs.mjs + +export { type }; +>type : typeof cjs.cjs.mjs.type + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs/index"; +>cjs : typeof cjs + +import * as mjs from "inner/mjs/index"; +>mjs : typeof cjs.mjs + +import * as type from "inner/js/index"; +>type : typeof cjs.mjs.cjs.type + +export { cjs }; +>cjs : typeof cjs + +export { mjs }; +>mjs : typeof cjs.mjs + +export { type }; +>type : typeof cjs.mjs.cjs.type + diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node16).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node16).errors.txt new file mode 100644 index 00000000000..b989016f16a --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node16).errors.txt @@ -0,0 +1,78 @@ +tests/cases/conformance/node/allowJs/index.cjs(3,23): error TS1471: Module 'inner/mjs/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts(3,22): error TS1471: Module 'inner/mjs/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. +tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + + +==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== + // esm format file + import * as cjsi from "inner/cjs/index.cjs"; + import * as mjsi from "inner/mjs/index.mjs"; + import * as typei from "inner/js/index.js"; + cjsi; + mjsi; + typei; +==== tests/cases/conformance/node/allowJs/index.mjs (0 errors) ==== + // esm format file + import * as cjsi from "inner/cjs/index.cjs"; + import * as mjsi from "inner/mjs/index.mjs"; + import * as typei from "inner/js/index.js"; + cjsi; + mjsi; + typei; +==== tests/cases/conformance/node/allowJs/index.cjs (1 errors) ==== + // cjs format file + import * as cjsi from "inner/cjs/index.cjs"; + import * as mjsi from "inner/mjs/index.mjs"; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module 'inner/mjs/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as typei from "inner/js/index.js"; + cjsi; + mjsi; + typei; +==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts (2 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/index.cjs"; + ~~~ +!!! error TS2303: Circular definition of import alias 'cjs'. + import * as mjs from "inner/mjs/index.mjs"; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module 'inner/mjs/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as type from "inner/js/index.js"; + export { cjs }; + export { mjs }; + export { type }; +==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts (0 errors) ==== + // esm format file + import * as cjs from "inner/cjs/index.cjs"; + import * as mjs from "inner/mjs/index.mjs"; + import * as type from "inner/js/index.js"; + export { cjs }; + export { mjs }; + export { type }; +==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts (1 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/index.cjs"; + import * as mjs from "inner/mjs/index.mjs"; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module 'inner/mjs/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as type from "inner/js/index.js"; + export { cjs }; + export { mjs }; + export { type }; +==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + } +==== tests/cases/conformance/node/allowJs/node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "exports": { + "./cjs/*.cjs": "./*.cjs", + "./mjs/*.mjs": "./*.mjs", + "./js/*.js": "./*.js" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node16).js b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node16).js new file mode 100644 index 00000000000..e10a987a399 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node16).js @@ -0,0 +1,124 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsTrailers.ts] //// + +//// [index.js] +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +import * as mjsi from "inner/mjs/index.mjs"; +import * as typei from "inner/js/index.js"; +cjsi; +mjsi; +typei; +//// [index.mjs] +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +import * as mjsi from "inner/mjs/index.mjs"; +import * as typei from "inner/js/index.js"; +cjsi; +mjsi; +typei; +//// [index.cjs] +// cjs format file +import * as cjsi from "inner/cjs/index.cjs"; +import * as mjsi from "inner/mjs/index.mjs"; +import * as typei from "inner/js/index.js"; +cjsi; +mjsi; +typei; +//// [index.d.ts] +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +import * as mjs from "inner/mjs/index.mjs"; +import * as type from "inner/js/index.js"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.mts] +// esm format file +import * as cjs from "inner/cjs/index.cjs"; +import * as mjs from "inner/mjs/index.mjs"; +import * as type from "inner/js/index.js"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.cts] +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +import * as mjs from "inner/mjs/index.mjs"; +import * as type from "inner/js/index.js"; +export { cjs }; +export { mjs }; +export { type }; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", +} +//// [package.json] +{ + "name": "inner", + "private": true, + "exports": { + "./cjs/*.cjs": "./*.cjs", + "./mjs/*.mjs": "./*.mjs", + "./js/*.js": "./*.js" + } +} + +//// [index.js] +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +import * as mjsi from "inner/mjs/index.mjs"; +import * as typei from "inner/js/index.js"; +cjsi; +mjsi; +typei; +//// [index.mjs] +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +import * as mjsi from "inner/mjs/index.mjs"; +import * as typei from "inner/js/index.js"; +cjsi; +mjsi; +typei; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const cjsi = __importStar(require("inner/cjs/index.cjs")); +const mjsi = __importStar(require("inner/mjs/index.mjs")); +const typei = __importStar(require("inner/js/index.js")); +cjsi; +mjsi; +typei; + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node16).symbols b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node16).symbols new file mode 100644 index 00000000000..2e24aeb1a83 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node16).symbols @@ -0,0 +1,120 @@ +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : Symbol(cjsi, Decl(index.js, 1, 6)) + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : Symbol(mjsi, Decl(index.js, 2, 6)) + +import * as typei from "inner/js/index.js"; +>typei : Symbol(typei, Decl(index.js, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.js, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.js, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.js, 3, 6)) + +=== tests/cases/conformance/node/allowJs/index.mjs === +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : Symbol(cjsi, Decl(index.mjs, 1, 6)) + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : Symbol(mjsi, Decl(index.mjs, 2, 6)) + +import * as typei from "inner/js/index.js"; +>typei : Symbol(typei, Decl(index.mjs, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.mjs, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.mjs, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.mjs, 3, 6)) + +=== tests/cases/conformance/node/allowJs/index.cjs === +// cjs format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : Symbol(cjsi, Decl(index.cjs, 1, 6)) + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : Symbol(mjsi, Decl(index.cjs, 2, 6)) + +import * as typei from "inner/js/index.js"; +>typei : Symbol(typei, Decl(index.cjs, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.cjs, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.cjs, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.cjs, 3, 6)) + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) + +import * as type from "inner/js/index.js"; +>type : Symbol(type, Decl(index.d.ts, 3, 6)) + +export { cjs }; +>cjs : Symbol(mjs.cjs.cjs.type.cjs, Decl(index.d.ts, 4, 8)) + +export { mjs }; +>mjs : Symbol(mjs.cjs.cjs.type.mjs, Decl(index.d.ts, 5, 8)) + +export { type }; +>type : Symbol(mjs.cjs.cjs.type.type, Decl(index.d.ts, 6, 8)) + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) + +import * as type from "inner/js/index.js"; +>type : Symbol(type, Decl(index.d.mts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs.mjs.cjs, Decl(index.d.mts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.cjs.mjs.mjs, Decl(index.d.mts, 5, 8)) + +export { type }; +>type : Symbol(cjs.cjs.mjs.type, Decl(index.d.mts, 6, 8)) + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) + +import * as type from "inner/js/index.js"; +>type : Symbol(type, Decl(index.d.cts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs, Decl(index.d.cts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.mjs, Decl(index.d.cts, 5, 8)) + +export { type }; +>type : Symbol(cjs.type, Decl(index.d.cts, 6, 8)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node16).types b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node16).types new file mode 100644 index 00000000000..556b7c15a3d --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node16).types @@ -0,0 +1,120 @@ +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : typeof cjsi.cjs.mjs + +import * as typei from "inner/js/index.js"; +>typei : typeof typei + +cjsi; +>cjsi : typeof cjsi + +mjsi; +>mjsi : typeof cjsi.cjs.mjs + +typei; +>typei : typeof typei + +=== tests/cases/conformance/node/allowJs/index.mjs === +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : typeof cjsi.cjs.mjs + +import * as typei from "inner/js/index.js"; +>typei : typeof typei + +cjsi; +>cjsi : typeof cjsi + +mjsi; +>mjsi : typeof cjsi.cjs.mjs + +typei; +>typei : typeof typei + +=== tests/cases/conformance/node/allowJs/index.cjs === +// cjs format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : typeof cjsi.mjs + +import * as typei from "inner/js/index.js"; +>typei : typeof cjsi.mjs.cjs.type + +cjsi; +>cjsi : typeof cjsi + +mjsi; +>mjsi : typeof cjsi.mjs + +typei; +>typei : typeof cjsi.mjs.cjs.type + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : any + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : typeof mjs + +import * as type from "inner/js/index.js"; +>type : typeof mjs.cjs.cjs.type + +export { cjs }; +>cjs : any + +export { mjs }; +>mjs : typeof mjs + +export { type }; +>type : typeof mjs.cjs.cjs.type + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : typeof cjs + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : typeof cjs.cjs.mjs + +import * as type from "inner/js/index.js"; +>type : typeof cjs.cjs.mjs.type + +export { cjs }; +>cjs : typeof cjs + +export { mjs }; +>mjs : typeof cjs.cjs.mjs + +export { type }; +>type : typeof cjs.cjs.mjs.type + +=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : typeof cjs + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : typeof cjs.mjs + +import * as type from "inner/js/index.js"; +>type : typeof cjs.mjs.cjs.type + +export { cjs }; +>cjs : typeof cjs + +export { mjs }; +>mjs : typeof cjs.mjs + +export { type }; +>type : typeof cjs.mjs.cjs.type + diff --git a/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node16).errors.txt b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node16).errors.txt new file mode 100644 index 00000000000..c722192e670 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node16).errors.txt @@ -0,0 +1,55 @@ +tests/cases/conformance/node/allowJs/index.js(3,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/index.js(3,22): error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/index.js(5,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/subfolder/index.js(2,17): error TS1471: Module '../index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/subfolder/index.js(3,1): error TS8002: 'import ... =' can only be used in TypeScript files. +tests/cases/conformance/node/allowJs/subfolder/index.js(3,22): error TS1471: Module '../index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/allowJs/subfolder/index.js(5,1): error TS8002: 'import ... =' can only be used in TypeScript files. + + +==== tests/cases/conformance/node/allowJs/subfolder/index.js (4 errors) ==== + // cjs format file + import {h} from "../index.js"; + ~~~~~~~~~~~~~ +!!! error TS1471: Module '../index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import mod = require("../index.js"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~~~~~ +!!! error TS1471: Module '../index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import {f as _f} from "./index.js"; + import mod2 = require("./index.js"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + export async function f() { + const mod3 = await import ("../index.js"); + const mod4 = await import ("./index.js"); + h(); + } +==== tests/cases/conformance/node/allowJs/index.js (3 errors) ==== + // esm format file + import {h as _h} from "./index.js"; + import mod = require("./index.js"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + ~~~~~~~~~~~~ +!!! error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import {f} from "./subfolder/index.js"; + import mod2 = require("./subfolder/index.js"); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS8002: 'import ... =' can only be used in TypeScript files. + export async function h() { + const mod3 = await import ("./index.js"); + const mod4 = await import ("./subfolder/index.js"); + f(); + } +==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/allowJs/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node16).js b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node16).js new file mode 100644 index 00000000000..a02ef88f1e5 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node16).js @@ -0,0 +1,60 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsSynchronousCallErrors.ts] //// + +//// [index.js] +// cjs format file +import {h} from "../index.js"; +import mod = require("../index.js"); +import {f as _f} from "./index.js"; +import mod2 = require("./index.js"); +export async function f() { + const mod3 = await import ("../index.js"); + const mod4 = await import ("./index.js"); + h(); +} +//// [index.js] +// esm format file +import {h as _h} from "./index.js"; +import mod = require("./index.js"); +import {f} from "./subfolder/index.js"; +import mod2 = require("./subfolder/index.js"); +export async function h() { + const mod3 = await import ("./index.js"); + const mod4 = await import ("./subfolder/index.js"); + f(); +} +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} + +//// [index.js] +import { f } from "./subfolder/index.js"; +export async function h() { + const mod3 = await import("./index.js"); + const mod4 = await import("./subfolder/index.js"); + f(); +} +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.f = void 0; +// cjs format file +const index_js_1 = require("../index.js"); +async function f() { + const mod3 = await import("../index.js"); + const mod4 = await import("./index.js"); + (0, index_js_1.h)(); +} +exports.f = f; + + +//// [index.d.ts] +export function h(): Promise; +//// [index.d.ts] +export function f(): Promise; diff --git a/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node16).symbols b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node16).symbols new file mode 100644 index 00000000000..8cbba01b82f --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node16).symbols @@ -0,0 +1,58 @@ +=== tests/cases/conformance/node/allowJs/subfolder/index.js === +// cjs format file +import {h} from "../index.js"; +>h : Symbol(h, Decl(index.js, 1, 8)) + +import mod = require("../index.js"); +>mod : Symbol(mod, Decl(index.js, 1, 30)) + +import {f as _f} from "./index.js"; +>f : Symbol(f, Decl(index.js, 4, 36)) +>_f : Symbol(_f, Decl(index.js, 3, 8)) + +import mod2 = require("./index.js"); +>mod2 : Symbol(mod2, Decl(index.js, 3, 35)) + +export async function f() { +>f : Symbol(f, Decl(index.js, 4, 36)) + + const mod3 = await import ("../index.js"); +>mod3 : Symbol(mod3, Decl(index.js, 6, 9)) +>"../index.js" : Symbol(mod, Decl(index.js, 0, 0)) + + const mod4 = await import ("./index.js"); +>mod4 : Symbol(mod4, Decl(index.js, 7, 9)) +>"./index.js" : Symbol(mod2, Decl(index.js, 0, 0)) + + h(); +>h : Symbol(h, Decl(index.js, 1, 8)) +} +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +import {h as _h} from "./index.js"; +>h : Symbol(h, Decl(index.js, 4, 46)) +>_h : Symbol(_h, Decl(index.js, 1, 8)) + +import mod = require("./index.js"); +>mod : Symbol(mod, Decl(index.js, 1, 35)) + +import {f} from "./subfolder/index.js"; +>f : Symbol(f, Decl(index.js, 3, 8)) + +import mod2 = require("./subfolder/index.js"); +>mod2 : Symbol(mod2, Decl(index.js, 3, 39)) + +export async function h() { +>h : Symbol(h, Decl(index.js, 4, 46)) + + const mod3 = await import ("./index.js"); +>mod3 : Symbol(mod3, Decl(index.js, 6, 9)) +>"./index.js" : Symbol(mod, Decl(index.js, 0, 0)) + + const mod4 = await import ("./subfolder/index.js"); +>mod4 : Symbol(mod4, Decl(index.js, 7, 9)) +>"./subfolder/index.js" : Symbol(mod2, Decl(index.js, 0, 0)) + + f(); +>f : Symbol(f, Decl(index.js, 3, 8)) +} diff --git a/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node16).types b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node16).types new file mode 100644 index 00000000000..dde67707808 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node16).types @@ -0,0 +1,68 @@ +=== tests/cases/conformance/node/allowJs/subfolder/index.js === +// cjs format file +import {h} from "../index.js"; +>h : () => Promise + +import mod = require("../index.js"); +>mod : typeof mod + +import {f as _f} from "./index.js"; +>f : () => Promise +>_f : () => Promise + +import mod2 = require("./index.js"); +>mod2 : typeof mod2 + +export async function f() { +>f : () => Promise + + const mod3 = await import ("../index.js"); +>mod3 : typeof mod +>await import ("../index.js") : typeof mod +>import ("../index.js") : Promise +>"../index.js" : "../index.js" + + const mod4 = await import ("./index.js"); +>mod4 : { default: typeof mod2; f(): Promise; } +>await import ("./index.js") : { default: typeof mod2; f(): Promise; } +>import ("./index.js") : Promise<{ default: typeof mod2; f(): Promise; }> +>"./index.js" : "./index.js" + + h(); +>h() : Promise +>h : () => Promise +} +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +import {h as _h} from "./index.js"; +>h : () => Promise +>_h : () => Promise + +import mod = require("./index.js"); +>mod : typeof mod + +import {f} from "./subfolder/index.js"; +>f : () => Promise + +import mod2 = require("./subfolder/index.js"); +>mod2 : typeof mod2 + +export async function h() { +>h : () => Promise + + const mod3 = await import ("./index.js"); +>mod3 : typeof mod +>await import ("./index.js") : typeof mod +>import ("./index.js") : Promise +>"./index.js" : "./index.js" + + const mod4 = await import ("./subfolder/index.js"); +>mod4 : { default: typeof mod2; f(): Promise; } +>await import ("./subfolder/index.js") : { default: typeof mod2; f(): Promise; } +>import ("./subfolder/index.js") : Promise<{ default: typeof mod2; f(): Promise; }> +>"./subfolder/index.js" : "./subfolder/index.js" + + f(); +>f() : Promise +>f : () => Promise +} diff --git a/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node16).errors.txt b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node16).errors.txt new file mode 100644 index 00000000000..00d2aa600be --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node16).errors.txt @@ -0,0 +1,28 @@ +tests/cases/conformance/node/allowJs/subfolder/index.js(2,11): error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. +tests/cases/conformance/node/allowJs/subfolder/index.js(4,5): error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. + + +==== tests/cases/conformance/node/allowJs/subfolder/index.js (2 errors) ==== + // cjs format file + const x = await 1; + ~~~~~ +!!! error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. + export {x}; + for await (const y of []) {} + ~~~~~ +!!! error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. +==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== + // esm format file + const x = await 1; + export {x}; + for await (const y of []) {} +==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/allowJs/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node16).js b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node16).js new file mode 100644 index 00000000000..354fe725f09 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node16).js @@ -0,0 +1,42 @@ +//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsTopLevelAwait.ts] //// + +//// [index.js] +// cjs format file +const x = await 1; +export {x}; +for await (const y of []) {} +//// [index.js] +// esm format file +const x = await 1; +export {x}; +for await (const y of []) {} +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = await 1; +exports.x = x; +for await (const y of []) { } +//// [index.js] +// esm format file +const x = await 1; +export { x }; +for await (const y of []) { } + + +//// [index.d.ts] +export const x: 1; +//// [index.d.ts] +export const x: 1; diff --git a/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node16).symbols b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node16).symbols new file mode 100644 index 00000000000..09ad69c019c --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node16).symbols @@ -0,0 +1,22 @@ +=== tests/cases/conformance/node/allowJs/subfolder/index.js === +// cjs format file +const x = await 1; +>x : Symbol(x, Decl(index.js, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.js, 2, 8)) + +for await (const y of []) {} +>y : Symbol(y, Decl(index.js, 3, 16)) + +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +const x = await 1; +>x : Symbol(x, Decl(index.js, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.js, 2, 8)) + +for await (const y of []) {} +>y : Symbol(y, Decl(index.js, 3, 16)) + diff --git a/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node16).types b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node16).types new file mode 100644 index 00000000000..b50bdd2c107 --- /dev/null +++ b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node16).types @@ -0,0 +1,28 @@ +=== tests/cases/conformance/node/allowJs/subfolder/index.js === +// cjs format file +const x = await 1; +>x : 1 +>await 1 : 1 +>1 : 1 + +export {x}; +>x : 1 + +for await (const y of []) {} +>y : any +>[] : undefined[] + +=== tests/cases/conformance/node/allowJs/index.js === +// esm format file +const x = await 1; +>x : 1 +>await 1 : 1 +>1 : 1 + +export {x}; +>x : 1 + +for await (const y of []) {} +>y : any +>[] : undefined[] + diff --git a/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=nodenext).errors.txt index 50ff19655e9..00d2aa600be 100644 --- a/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=nodenext).errors.txt @@ -1,16 +1,16 @@ -tests/cases/conformance/node/allowJs/subfolder/index.js(2,11): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. -tests/cases/conformance/node/allowJs/subfolder/index.js(4,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +tests/cases/conformance/node/allowJs/subfolder/index.js(2,11): error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. +tests/cases/conformance/node/allowJs/subfolder/index.js(4,5): error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. ==== tests/cases/conformance/node/allowJs/subfolder/index.js (2 errors) ==== // cjs format file const x = await 1; ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +!!! error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. export {x}; for await (const y of []) {} ~~~~~ -!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +!!! error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. ==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== // esm format file const x = await 1; diff --git a/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node16).js b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node16).js new file mode 100644 index 00000000000..f0c9198a513 --- /dev/null +++ b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node16).js @@ -0,0 +1,36 @@ +//// [tests/cases/conformance/node/nodeModulesCjsFormatFileAlwaysHasDefault.ts] //// + +//// [index.ts] +// cjs format file +export const a = 1; +//// [index.ts] +// esm format file +import mod from "./subfolder/index.js"; +mod; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +// cjs format file +exports.a = 1; +//// [index.js] +// esm format file +import mod from "./subfolder/index.js"; +mod; + + +//// [index.d.ts] +export declare const a = 1; +//// [index.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node16).symbols b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node16).symbols new file mode 100644 index 00000000000..0d676181e27 --- /dev/null +++ b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node16).symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +export const a = 1; +>a : Symbol(a, Decl(index.ts, 1, 12)) + +=== tests/cases/conformance/node/index.ts === +// esm format file +import mod from "./subfolder/index.js"; +>mod : Symbol(mod, Decl(index.ts, 1, 6)) + +mod; +>mod : Symbol(mod, Decl(index.ts, 1, 6)) + diff --git a/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node16).types b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node16).types new file mode 100644 index 00000000000..abbc4f1b40e --- /dev/null +++ b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node16).types @@ -0,0 +1,14 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +export const a = 1; +>a : 1 +>1 : 1 + +=== tests/cases/conformance/node/index.ts === +// esm format file +import mod from "./subfolder/index.js"; +>mod : typeof mod + +mod; +>mod : typeof mod + diff --git a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).errors.txt b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).errors.txt new file mode 100644 index 00000000000..7397e1e1dbd --- /dev/null +++ b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).errors.txt @@ -0,0 +1,135 @@ +tests/cases/conformance/node/index.cts(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.cts(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/node_modules/inner/index.d.mts(2,13): error TS2303: Circular definition of import alias 'cjs'. +tests/cases/conformance/node/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. + + +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + cjs; + mjs; + type; + import * as cjsi from "inner/a"; + import * as mjsi from "inner/b"; + import * as typei from "inner"; + import * as ts from "inner/types"; + cjsi.mjsSource; + mjsi.mjsSource; + typei.mjsSource; + ts.mjsSource; +==== tests/cases/conformance/node/index.mts (0 errors) ==== + // esm format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + cjs; + mjs; + type; + import * as cjsi from "inner/a"; + import * as mjsi from "inner/b"; + import * as typei from "inner"; + import * as ts from "inner/types"; + cjsi.mjsSource; + mjsi.mjsSource; + typei.mjsSource; + ts.mjsSource; +==== tests/cases/conformance/node/index.cts (2 errors) ==== + // cjs format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + ~~~~~~~~~~~~~ +!!! error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as type from "package"; + ~~~~~~~~~ +!!! error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + cjs; + mjs; + type; + import * as cjsi from "inner/a"; + import * as mjsi from "inner/b"; + import * as typei from "inner"; + import * as ts from "inner/types"; + cjsi.cjsSource; + mjsi.cjsSource; + typei.implicitCjsSource; + ts.cjsSource; +==== tests/cases/conformance/node/node_modules/inner/index.d.ts (1 errors) ==== + // cjs format file + import * as cjs from "inner/a"; + ~~~ +!!! error TS2303: Circular definition of import alias 'cjs'. + import * as mjs from "inner/b"; + import * as type from "inner"; + import * as ts from "inner/types"; + export { cjs }; + export { mjs }; + export { type }; + export { ts }; + export const implicitCjsSource = true; +==== tests/cases/conformance/node/node_modules/inner/index.d.mts (1 errors) ==== + // esm format file + import * as cjs from "inner/a"; + ~~~ +!!! error TS2303: Circular definition of import alias 'cjs'. + import * as mjs from "inner/b"; + import * as type from "inner"; + import * as ts from "inner/types"; + export { cjs }; + export { mjs }; + export { type }; + export { ts }; + export const mjsSource = true; +==== tests/cases/conformance/node/node_modules/inner/index.d.cts (0 errors) ==== + // cjs format file + import * as cjs from "inner/a"; + import * as mjs from "inner/b"; + import * as type from "inner"; + import * as ts from "inner/types"; + export { cjs }; + export { mjs }; + export { type }; + export { ts }; + export const cjsSource = true; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } + } +==== tests/cases/conformance/node/node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "exports": { + "./a": { + "require": "./index.cjs", + "node": "./index.mjs" + }, + "./b": { + "import": "./index.mjs", + "node": "./index.cjs" + }, + ".": { + "import": "./index.mjs", + "node": "./index.js" + }, + "./types": { + "types": { + "import": "./index.d.mts", + "require": "./index.d.cts", + }, + "node": { + "import": "./index.mjs", + "require": "./index.cjs" + } + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).js b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).js new file mode 100644 index 00000000000..a67f7fdfdd4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).js @@ -0,0 +1,205 @@ +//// [tests/cases/conformance/node/nodeModulesConditionalPackageExports.ts] //// + +//// [index.ts] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/a"; +import * as mjsi from "inner/b"; +import * as typei from "inner"; +import * as ts from "inner/types"; +cjsi.mjsSource; +mjsi.mjsSource; +typei.mjsSource; +ts.mjsSource; +//// [index.mts] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/a"; +import * as mjsi from "inner/b"; +import * as typei from "inner"; +import * as ts from "inner/types"; +cjsi.mjsSource; +mjsi.mjsSource; +typei.mjsSource; +ts.mjsSource; +//// [index.cts] +// cjs format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/a"; +import * as mjsi from "inner/b"; +import * as typei from "inner"; +import * as ts from "inner/types"; +cjsi.cjsSource; +mjsi.cjsSource; +typei.implicitCjsSource; +ts.cjsSource; +//// [index.d.ts] +// cjs format file +import * as cjs from "inner/a"; +import * as mjs from "inner/b"; +import * as type from "inner"; +import * as ts from "inner/types"; +export { cjs }; +export { mjs }; +export { type }; +export { ts }; +export const implicitCjsSource = true; +//// [index.d.mts] +// esm format file +import * as cjs from "inner/a"; +import * as mjs from "inner/b"; +import * as type from "inner"; +import * as ts from "inner/types"; +export { cjs }; +export { mjs }; +export { type }; +export { ts }; +export const mjsSource = true; +//// [index.d.cts] +// cjs format file +import * as cjs from "inner/a"; +import * as mjs from "inner/b"; +import * as type from "inner"; +import * as ts from "inner/types"; +export { cjs }; +export { mjs }; +export { type }; +export { ts }; +export const cjsSource = true; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } +} +//// [package.json] +{ + "name": "inner", + "private": true, + "exports": { + "./a": { + "require": "./index.cjs", + "node": "./index.mjs" + }, + "./b": { + "import": "./index.mjs", + "node": "./index.cjs" + }, + ".": { + "import": "./index.mjs", + "node": "./index.js" + }, + "./types": { + "types": { + "import": "./index.d.mts", + "require": "./index.d.cts", + }, + "node": { + "import": "./index.mjs", + "require": "./index.cjs" + } + } + } +} + +//// [index.mjs] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/a"; +import * as mjsi from "inner/b"; +import * as typei from "inner"; +import * as ts from "inner/types"; +cjsi.mjsSource; +mjsi.mjsSource; +typei.mjsSource; +ts.mjsSource; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const cjs = __importStar(require("package/cjs")); +const mjs = __importStar(require("package/mjs")); +const type = __importStar(require("package")); +cjs; +mjs; +type; +const cjsi = __importStar(require("inner/a")); +const mjsi = __importStar(require("inner/b")); +const typei = __importStar(require("inner")); +const ts = __importStar(require("inner/types")); +cjsi.cjsSource; +mjsi.cjsSource; +typei.implicitCjsSource; +ts.cjsSource; +//// [index.js] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/a"; +import * as mjsi from "inner/b"; +import * as typei from "inner"; +import * as ts from "inner/types"; +cjsi.mjsSource; +mjsi.mjsSource; +typei.mjsSource; +ts.mjsSource; + + +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; +//// [index.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).symbols b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).symbols new file mode 100644 index 00000000000..88fdfed4eaa --- /dev/null +++ b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).symbols @@ -0,0 +1,243 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.ts, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.ts, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.ts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.ts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.ts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.ts, 3, 6)) + +import * as cjsi from "inner/a"; +>cjsi : Symbol(cjsi, Decl(index.ts, 7, 6)) + +import * as mjsi from "inner/b"; +>mjsi : Symbol(mjsi, Decl(index.ts, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.ts, 9, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.ts, 10, 6)) + +cjsi.mjsSource; +>cjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>cjsi : Symbol(cjsi, Decl(index.ts, 7, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +mjsi.mjsSource; +>mjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>mjsi : Symbol(mjsi, Decl(index.ts, 8, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +typei.mjsSource; +>typei.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>typei : Symbol(typei, Decl(index.ts, 9, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +ts.mjsSource; +>ts.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>ts : Symbol(ts, Decl(index.ts, 10, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +=== tests/cases/conformance/node/index.mts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.mts, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.mts, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.mts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.mts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.mts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.mts, 3, 6)) + +import * as cjsi from "inner/a"; +>cjsi : Symbol(cjsi, Decl(index.mts, 7, 6)) + +import * as mjsi from "inner/b"; +>mjsi : Symbol(mjsi, Decl(index.mts, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.mts, 9, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.mts, 10, 6)) + +cjsi.mjsSource; +>cjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>cjsi : Symbol(cjsi, Decl(index.mts, 7, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +mjsi.mjsSource; +>mjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>mjsi : Symbol(mjsi, Decl(index.mts, 8, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +typei.mjsSource; +>typei.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>typei : Symbol(typei, Decl(index.mts, 9, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +ts.mjsSource; +>ts.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) +>ts : Symbol(ts, Decl(index.mts, 10, 6)) +>mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) + +=== tests/cases/conformance/node/index.cts === +// cjs format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.cts, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.cts, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.cts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.cts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.cts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.cts, 3, 6)) + +import * as cjsi from "inner/a"; +>cjsi : Symbol(cjsi, Decl(index.cts, 7, 6)) + +import * as mjsi from "inner/b"; +>mjsi : Symbol(mjsi, Decl(index.cts, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.cts, 9, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.cts, 10, 6)) + +cjsi.cjsSource; +>cjsi.cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) +>cjsi : Symbol(cjsi, Decl(index.cts, 7, 6)) +>cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) + +mjsi.cjsSource; +>mjsi.cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) +>mjsi : Symbol(mjsi, Decl(index.cts, 8, 6)) +>cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) + +typei.implicitCjsSource; +>typei.implicitCjsSource : Symbol(cjsi.type.implicitCjsSource, Decl(index.d.ts, 9, 12)) +>typei : Symbol(typei, Decl(index.cts, 9, 6)) +>implicitCjsSource : Symbol(cjsi.type.implicitCjsSource, Decl(index.d.ts, 9, 12)) + +ts.cjsSource; +>ts.cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) +>ts : Symbol(ts, Decl(index.cts, 10, 6)) +>cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) + +=== tests/cases/conformance/node/node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/a"; +>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) + +import * as mjs from "inner/b"; +>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.ts, 3, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.d.ts, 4, 6)) + +export { cjs }; +>cjs : Symbol(mjs.type.cjs, Decl(index.d.ts, 5, 8)) + +export { mjs }; +>mjs : Symbol(mjs.type.mjs, Decl(index.d.ts, 6, 8)) + +export { type }; +>type : Symbol(mjs.type.type, Decl(index.d.ts, 7, 8)) + +export { ts }; +>ts : Symbol(mjs.type.ts, Decl(index.d.ts, 8, 8)) + +export const implicitCjsSource = true; +>implicitCjsSource : Symbol(mjs.type.implicitCjsSource, Decl(index.d.ts, 9, 12)) + +=== tests/cases/conformance/node/node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/a"; +>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) + +import * as mjs from "inner/b"; +>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.mts, 3, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.d.mts, 4, 6)) + +export { cjs }; +>cjs : Symbol(mjs.cjs, Decl(index.d.mts, 5, 8)) + +export { mjs }; +>mjs : Symbol(mjs.mjs, Decl(index.d.mts, 6, 8)) + +export { type }; +>type : Symbol(mjs.type, Decl(index.d.mts, 7, 8)) + +export { ts }; +>ts : Symbol(mjs.ts, Decl(index.d.mts, 8, 8)) + +export const mjsSource = true; +>mjsSource : Symbol(mjs.mjsSource, Decl(index.d.mts, 9, 12)) + +=== tests/cases/conformance/node/node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/a"; +>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) + +import * as mjs from "inner/b"; +>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.cts, 3, 6)) + +import * as ts from "inner/types"; +>ts : Symbol(ts, Decl(index.d.cts, 4, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs, Decl(index.d.cts, 5, 8)) + +export { mjs }; +>mjs : Symbol(cjs.mjs, Decl(index.d.cts, 6, 8)) + +export { type }; +>type : Symbol(cjs.type, Decl(index.d.cts, 7, 8)) + +export { ts }; +>ts : Symbol(cjs.ts, Decl(index.d.cts, 8, 8)) + +export const cjsSource = true; +>cjsSource : Symbol(cjs.cjsSource, Decl(index.d.cts, 9, 12)) + diff --git a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).types b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).types new file mode 100644 index 00000000000..d46ce7ffa46 --- /dev/null +++ b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).types @@ -0,0 +1,246 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs + +import * as mjs from "package/mjs"; +>mjs : typeof mjs + +import * as type from "package"; +>type : typeof type + +cjs; +>cjs : typeof cjs + +mjs; +>mjs : typeof mjs + +type; +>type : typeof type + +import * as cjsi from "inner/a"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/b"; +>mjsi : typeof cjsi + +import * as typei from "inner"; +>typei : typeof cjsi + +import * as ts from "inner/types"; +>ts : typeof cjsi + +cjsi.mjsSource; +>cjsi.mjsSource : true +>cjsi : typeof cjsi +>mjsSource : true + +mjsi.mjsSource; +>mjsi.mjsSource : true +>mjsi : typeof cjsi +>mjsSource : true + +typei.mjsSource; +>typei.mjsSource : true +>typei : typeof cjsi +>mjsSource : true + +ts.mjsSource; +>ts.mjsSource : true +>ts : typeof cjsi +>mjsSource : true + +=== tests/cases/conformance/node/index.mts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs + +import * as mjs from "package/mjs"; +>mjs : typeof mjs + +import * as type from "package"; +>type : typeof type + +cjs; +>cjs : typeof cjs + +mjs; +>mjs : typeof mjs + +type; +>type : typeof type + +import * as cjsi from "inner/a"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/b"; +>mjsi : typeof cjsi + +import * as typei from "inner"; +>typei : typeof cjsi + +import * as ts from "inner/types"; +>ts : typeof cjsi + +cjsi.mjsSource; +>cjsi.mjsSource : true +>cjsi : typeof cjsi +>mjsSource : true + +mjsi.mjsSource; +>mjsi.mjsSource : true +>mjsi : typeof cjsi +>mjsSource : true + +typei.mjsSource; +>typei.mjsSource : true +>typei : typeof cjsi +>mjsSource : true + +ts.mjsSource; +>ts.mjsSource : true +>ts : typeof cjsi +>mjsSource : true + +=== tests/cases/conformance/node/index.cts === +// cjs format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs + +import * as mjs from "package/mjs"; +>mjs : typeof mjs + +import * as type from "package"; +>type : typeof type + +cjs; +>cjs : typeof cjs + +mjs; +>mjs : typeof mjs + +type; +>type : typeof type + +import * as cjsi from "inner/a"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/b"; +>mjsi : typeof cjsi + +import * as typei from "inner"; +>typei : typeof cjsi.type + +import * as ts from "inner/types"; +>ts : typeof cjsi + +cjsi.cjsSource; +>cjsi.cjsSource : true +>cjsi : typeof cjsi +>cjsSource : true + +mjsi.cjsSource; +>mjsi.cjsSource : true +>mjsi : typeof cjsi +>cjsSource : true + +typei.implicitCjsSource; +>typei.implicitCjsSource : true +>typei : typeof cjsi.type +>implicitCjsSource : true + +ts.cjsSource; +>ts.cjsSource : true +>ts : typeof cjsi +>cjsSource : true + +=== tests/cases/conformance/node/node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/a"; +>cjs : any + +import * as mjs from "inner/b"; +>mjs : typeof mjs + +import * as type from "inner"; +>type : typeof mjs.type + +import * as ts from "inner/types"; +>ts : typeof mjs + +export { cjs }; +>cjs : any + +export { mjs }; +>mjs : typeof mjs + +export { type }; +>type : typeof mjs.type + +export { ts }; +>ts : typeof mjs + +export const implicitCjsSource = true; +>implicitCjsSource : true +>true : true + +=== tests/cases/conformance/node/node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/a"; +>cjs : any + +import * as mjs from "inner/b"; +>mjs : typeof mjs + +import * as type from "inner"; +>type : typeof mjs + +import * as ts from "inner/types"; +>ts : typeof mjs + +export { cjs }; +>cjs : any + +export { mjs }; +>mjs : typeof mjs + +export { type }; +>type : typeof mjs + +export { ts }; +>ts : typeof mjs + +export const mjsSource = true; +>mjsSource : true +>true : true + +=== tests/cases/conformance/node/node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/a"; +>cjs : typeof cjs + +import * as mjs from "inner/b"; +>mjs : typeof cjs + +import * as type from "inner"; +>type : typeof cjs.type + +import * as ts from "inner/types"; +>ts : typeof cjs + +export { cjs }; +>cjs : typeof cjs + +export { mjs }; +>mjs : typeof cjs + +export { type }; +>type : typeof cjs.type + +export { ts }; +>ts : typeof cjs + +export const cjsSource = true; +>cjsSource : true +>true : true + diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).errors.txt b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).errors.txt new file mode 100644 index 00000000000..11f39b9dd93 --- /dev/null +++ b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).errors.txt @@ -0,0 +1,116 @@ +tests/cases/conformance/node/index.cts(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.cts(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.cts(9,23): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/node_modules/inner/index.d.cts(3,22): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/node_modules/inner/index.d.cts(5,1): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/conformance/node/node_modules/inner/index.d.mts(5,1): error TS1036: Statements are not allowed in ambient contexts. +tests/cases/conformance/node/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/node_modules/inner/index.d.ts(5,1): error TS1036: Statements are not allowed in ambient contexts. + + +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + export const a = cjs; + export const b = mjs; + export const c = type; + import * as cjsi from "inner/cjs"; + import * as mjsi from "inner/mjs"; + import * as typei from "inner"; + export const d = cjsi; + export const e = mjsi; + export const f = typei; +==== tests/cases/conformance/node/index.mts (0 errors) ==== + // esm format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + export const a = cjs; + export const b = mjs; + export const c = type; + import * as cjsi from "inner/cjs"; + import * as mjsi from "inner/mjs"; + import * as typei from "inner"; + export const d = cjsi; + export const e = mjsi; + export const f = typei; +==== tests/cases/conformance/node/index.cts (3 errors) ==== + // cjs format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + ~~~~~~~~~~~~~ +!!! error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as type from "package"; + ~~~~~~~~~ +!!! error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + export const a = cjs; + export const b = mjs; + export const c = type; + import * as cjsi from "inner/cjs"; + import * as mjsi from "inner/mjs"; + ~~~~~~~~~~~ +!!! error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as typei from "inner"; + export const d = cjsi; + export const e = mjsi; + export const f = typei; +==== tests/cases/conformance/node/node_modules/inner/index.d.ts (2 errors) ==== + // cjs format file + import * as cjs from "inner/cjs"; + import * as mjs from "inner/mjs"; + ~~~~~~~~~~~ +!!! error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as type from "inner"; + cjs; + ~~~ +!!! error TS1036: Statements are not allowed in ambient contexts. + mjs; + type; + export const cjsMain = true; +==== tests/cases/conformance/node/node_modules/inner/index.d.mts (1 errors) ==== + // esm format file + import * as cjs from "inner/cjs"; + import * as mjs from "inner/mjs"; + import * as type from "inner"; + cjs; + ~~~ +!!! error TS1036: Statements are not allowed in ambient contexts. + mjs; + type; + export const esm = true; +==== tests/cases/conformance/node/node_modules/inner/index.d.cts (2 errors) ==== + // cjs format file + import * as cjs from "inner/cjs"; + import * as mjs from "inner/mjs"; + ~~~~~~~~~~~ +!!! error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as type from "inner"; + cjs; + ~~~ +!!! error TS1036: Statements are not allowed in ambient contexts. + mjs; + type; + export const cjsNonmain = true; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } + } +==== tests/cases/conformance/node/node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).js b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).js new file mode 100644 index 00000000000..7500542fd8d --- /dev/null +++ b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).js @@ -0,0 +1,202 @@ +//// [tests/cases/conformance/node/nodeModulesDeclarationEmitWithPackageExports.ts] //// + +//// [index.ts] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +export const a = cjs; +export const b = mjs; +export const c = type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +export const d = cjsi; +export const e = mjsi; +export const f = typei; +//// [index.mts] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +export const a = cjs; +export const b = mjs; +export const c = type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +export const d = cjsi; +export const e = mjsi; +export const f = typei; +//// [index.cts] +// cjs format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +export const a = cjs; +export const b = mjs; +export const c = type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +export const d = cjsi; +export const e = mjsi; +export const f = typei; +//// [index.d.ts] +// cjs format file +import * as cjs from "inner/cjs"; +import * as mjs from "inner/mjs"; +import * as type from "inner"; +cjs; +mjs; +type; +export const cjsMain = true; +//// [index.d.mts] +// esm format file +import * as cjs from "inner/cjs"; +import * as mjs from "inner/mjs"; +import * as type from "inner"; +cjs; +mjs; +type; +export const esm = true; +//// [index.d.cts] +// cjs format file +import * as cjs from "inner/cjs"; +import * as mjs from "inner/mjs"; +import * as type from "inner"; +cjs; +mjs; +type; +export const cjsNonmain = true; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } +} +//// [package.json] +{ + "name": "inner", + "private": true, + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } +} + +//// [index.mjs] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +export const a = cjs; +export const b = mjs; +export const c = type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +export const d = cjsi; +export const e = mjsi; +export const f = typei; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.f = exports.e = exports.d = exports.c = exports.b = exports.a = void 0; +// cjs format file +const cjs = __importStar(require("package/cjs")); +const mjs = __importStar(require("package/mjs")); +const type = __importStar(require("package")); +exports.a = cjs; +exports.b = mjs; +exports.c = type; +const cjsi = __importStar(require("inner/cjs")); +const mjsi = __importStar(require("inner/mjs")); +const typei = __importStar(require("inner")); +exports.d = cjsi; +exports.e = mjsi; +exports.f = typei; +//// [index.js] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +export const a = cjs; +export const b = mjs; +export const c = type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +export const d = cjsi; +export const e = mjsi; +export const f = typei; + + +//// [index.d.mts] +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +export declare const a: typeof cjs; +export declare const b: typeof mjs; +export declare const c: typeof type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +export declare const d: typeof cjsi; +export declare const e: typeof mjsi; +export declare const f: typeof typei; +//// [index.d.cts] +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +export declare const a: typeof cjs; +export declare const b: typeof mjs; +export declare const c: typeof type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +export declare const d: typeof cjsi; +export declare const e: typeof mjsi; +export declare const f: typeof typei; +//// [index.d.ts] +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +export declare const a: typeof cjs; +export declare const b: typeof mjs; +export declare const c: typeof type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +export declare const d: typeof cjsi; +export declare const e: typeof mjsi; +export declare const f: typeof typei; diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).symbols b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).symbols new file mode 100644 index 00000000000..3af13052d29 --- /dev/null +++ b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).symbols @@ -0,0 +1,201 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.ts, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.ts, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.ts, 3, 6)) + +export const a = cjs; +>a : Symbol(type.a, Decl(index.ts, 4, 12)) +>cjs : Symbol(cjs, Decl(index.ts, 1, 6)) + +export const b = mjs; +>b : Symbol(type.b, Decl(index.ts, 5, 12)) +>mjs : Symbol(mjs, Decl(index.ts, 2, 6)) + +export const c = type; +>c : Symbol(type.c, Decl(index.ts, 6, 12)) +>type : Symbol(type, Decl(index.ts, 3, 6)) + +import * as cjsi from "inner/cjs"; +>cjsi : Symbol(cjsi, Decl(index.ts, 7, 6)) + +import * as mjsi from "inner/mjs"; +>mjsi : Symbol(mjsi, Decl(index.ts, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.ts, 9, 6)) + +export const d = cjsi; +>d : Symbol(type.d, Decl(index.ts, 10, 12)) +>cjsi : Symbol(cjsi, Decl(index.ts, 7, 6)) + +export const e = mjsi; +>e : Symbol(type.e, Decl(index.ts, 11, 12)) +>mjsi : Symbol(mjsi, Decl(index.ts, 8, 6)) + +export const f = typei; +>f : Symbol(type.f, Decl(index.ts, 12, 12)) +>typei : Symbol(typei, Decl(index.ts, 9, 6)) + +=== tests/cases/conformance/node/index.mts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.mts, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.mts, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.mts, 3, 6)) + +export const a = cjs; +>a : Symbol(mjs.a, Decl(index.mts, 4, 12)) +>cjs : Symbol(cjs, Decl(index.mts, 1, 6)) + +export const b = mjs; +>b : Symbol(mjs.b, Decl(index.mts, 5, 12)) +>mjs : Symbol(mjs, Decl(index.mts, 2, 6)) + +export const c = type; +>c : Symbol(mjs.c, Decl(index.mts, 6, 12)) +>type : Symbol(type, Decl(index.mts, 3, 6)) + +import * as cjsi from "inner/cjs"; +>cjsi : Symbol(cjsi, Decl(index.mts, 7, 6)) + +import * as mjsi from "inner/mjs"; +>mjsi : Symbol(mjsi, Decl(index.mts, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.mts, 9, 6)) + +export const d = cjsi; +>d : Symbol(mjs.d, Decl(index.mts, 10, 12)) +>cjsi : Symbol(cjsi, Decl(index.mts, 7, 6)) + +export const e = mjsi; +>e : Symbol(mjs.e, Decl(index.mts, 11, 12)) +>mjsi : Symbol(mjsi, Decl(index.mts, 8, 6)) + +export const f = typei; +>f : Symbol(mjs.f, Decl(index.mts, 12, 12)) +>typei : Symbol(typei, Decl(index.mts, 9, 6)) + +=== tests/cases/conformance/node/index.cts === +// cjs format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.cts, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.cts, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.cts, 3, 6)) + +export const a = cjs; +>a : Symbol(cjs.a, Decl(index.cts, 4, 12)) +>cjs : Symbol(cjs, Decl(index.cts, 1, 6)) + +export const b = mjs; +>b : Symbol(cjs.b, Decl(index.cts, 5, 12)) +>mjs : Symbol(mjs, Decl(index.cts, 2, 6)) + +export const c = type; +>c : Symbol(cjs.c, Decl(index.cts, 6, 12)) +>type : Symbol(type, Decl(index.cts, 3, 6)) + +import * as cjsi from "inner/cjs"; +>cjsi : Symbol(cjsi, Decl(index.cts, 7, 6)) + +import * as mjsi from "inner/mjs"; +>mjsi : Symbol(mjsi, Decl(index.cts, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.cts, 9, 6)) + +export const d = cjsi; +>d : Symbol(cjs.d, Decl(index.cts, 10, 12)) +>cjsi : Symbol(cjsi, Decl(index.cts, 7, 6)) + +export const e = mjsi; +>e : Symbol(cjs.e, Decl(index.cts, 11, 12)) +>mjsi : Symbol(mjsi, Decl(index.cts, 8, 6)) + +export const f = typei; +>f : Symbol(cjs.f, Decl(index.cts, 12, 12)) +>typei : Symbol(typei, Decl(index.cts, 9, 6)) + +=== tests/cases/conformance/node/node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) + +import * as mjs from "inner/mjs"; +>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.ts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.d.ts, 3, 6)) + +export const cjsMain = true; +>cjsMain : Symbol(type.cjsMain, Decl(index.d.ts, 7, 12)) + +=== tests/cases/conformance/node/node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs"; +>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) + +import * as mjs from "inner/mjs"; +>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.mts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.d.mts, 3, 6)) + +export const esm = true; +>esm : Symbol(mjs.esm, Decl(index.d.mts, 7, 12)) + +=== tests/cases/conformance/node/node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) + +import * as mjs from "inner/mjs"; +>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.cts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.d.cts, 3, 6)) + +export const cjsNonmain = true; +>cjsNonmain : Symbol(cjs.cjsNonmain, Decl(index.d.cts, 7, 12)) + diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).types b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).types new file mode 100644 index 00000000000..5db63226d08 --- /dev/null +++ b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).types @@ -0,0 +1,204 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs + +import * as mjs from "package/mjs"; +>mjs : typeof mjs + +import * as type from "package"; +>type : typeof type + +export const a = cjs; +>a : typeof cjs +>cjs : typeof cjs + +export const b = mjs; +>b : typeof mjs +>mjs : typeof mjs + +export const c = type; +>c : typeof type +>type : typeof type + +import * as cjsi from "inner/cjs"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/mjs"; +>mjsi : typeof mjsi + +import * as typei from "inner"; +>typei : typeof typei + +export const d = cjsi; +>d : typeof cjsi +>cjsi : typeof cjsi + +export const e = mjsi; +>e : typeof mjsi +>mjsi : typeof mjsi + +export const f = typei; +>f : typeof typei +>typei : typeof typei + +=== tests/cases/conformance/node/index.mts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs + +import * as mjs from "package/mjs"; +>mjs : typeof mjs + +import * as type from "package"; +>type : typeof type + +export const a = cjs; +>a : typeof cjs +>cjs : typeof cjs + +export const b = mjs; +>b : typeof mjs +>mjs : typeof mjs + +export const c = type; +>c : typeof type +>type : typeof type + +import * as cjsi from "inner/cjs"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/mjs"; +>mjsi : typeof mjsi + +import * as typei from "inner"; +>typei : typeof typei + +export const d = cjsi; +>d : typeof cjsi +>cjsi : typeof cjsi + +export const e = mjsi; +>e : typeof mjsi +>mjsi : typeof mjsi + +export const f = typei; +>f : typeof typei +>typei : typeof typei + +=== tests/cases/conformance/node/index.cts === +// cjs format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs + +import * as mjs from "package/mjs"; +>mjs : typeof mjs + +import * as type from "package"; +>type : typeof type + +export const a = cjs; +>a : typeof cjs +>cjs : typeof cjs + +export const b = mjs; +>b : typeof mjs +>mjs : typeof mjs + +export const c = type; +>c : typeof type +>type : typeof type + +import * as cjsi from "inner/cjs"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/mjs"; +>mjsi : typeof mjsi + +import * as typei from "inner"; +>typei : typeof typei + +export const d = cjsi; +>d : typeof cjsi +>cjsi : typeof cjsi + +export const e = mjsi; +>e : typeof mjsi +>mjsi : typeof mjsi + +export const f = typei; +>f : typeof typei +>typei : typeof typei + +=== tests/cases/conformance/node/node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : typeof cjs + +import * as mjs from "inner/mjs"; +>mjs : typeof mjs + +import * as type from "inner"; +>type : typeof type + +cjs; +>cjs : typeof cjs + +mjs; +>mjs : typeof mjs + +type; +>type : typeof type + +export const cjsMain = true; +>cjsMain : true +>true : true + +=== tests/cases/conformance/node/node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs"; +>cjs : typeof cjs + +import * as mjs from "inner/mjs"; +>mjs : typeof mjs + +import * as type from "inner"; +>type : typeof type + +cjs; +>cjs : typeof cjs + +mjs; +>mjs : typeof mjs + +type; +>type : typeof type + +export const esm = true; +>esm : true +>true : true + +=== tests/cases/conformance/node/node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : typeof cjs + +import * as mjs from "inner/mjs"; +>mjs : typeof mjs + +import * as type from "inner"; +>type : typeof type + +cjs; +>cjs : typeof cjs + +mjs; +>mjs : typeof mjs + +type; +>type : typeof type + +export const cjsNonmain = true; +>cjsNonmain : true +>true : true + diff --git a/tests/baselines/reference/nodeModulesDynamicImport(module=node16).js b/tests/baselines/reference/nodeModulesDynamicImport(module=node16).js new file mode 100644 index 00000000000..aceeafb8c59 --- /dev/null +++ b/tests/baselines/reference/nodeModulesDynamicImport(module=node16).js @@ -0,0 +1,45 @@ +//// [tests/cases/conformance/node/nodeModulesDynamicImport.ts] //// + +//// [index.ts] +// cjs format file +export async function main() { + const { readFile } = await import("fs"); +} +//// [index.ts] +// esm format file +export async function main() { + const { readFile } = await import("fs"); +} +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [types.d.ts] +declare module "fs"; + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.main = void 0; +// cjs format file +async function main() { + const { readFile } = await import("fs"); +} +exports.main = main; +//// [index.js] +// esm format file +export async function main() { + const { readFile } = await import("fs"); +} + + +//// [index.d.ts] +export declare function main(): Promise; +//// [index.d.ts] +export declare function main(): Promise; diff --git a/tests/baselines/reference/nodeModulesDynamicImport(module=node16).symbols b/tests/baselines/reference/nodeModulesDynamicImport(module=node16).symbols new file mode 100644 index 00000000000..69296bc3fa9 --- /dev/null +++ b/tests/baselines/reference/nodeModulesDynamicImport(module=node16).symbols @@ -0,0 +1,22 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +export async function main() { +>main : Symbol(main, Decl(index.ts, 0, 0)) + + const { readFile } = await import("fs"); +>readFile : Symbol(readFile, Decl(index.ts, 2, 11)) +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) +} +=== tests/cases/conformance/node/index.ts === +// esm format file +export async function main() { +>main : Symbol(main, Decl(index.ts, 0, 0)) + + const { readFile } = await import("fs"); +>readFile : Symbol(readFile, Decl(index.ts, 2, 11)) +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) +} +=== tests/cases/conformance/node/types.d.ts === +declare module "fs"; +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesDynamicImport(module=node16).types b/tests/baselines/reference/nodeModulesDynamicImport(module=node16).types new file mode 100644 index 00000000000..879fb7ca71b --- /dev/null +++ b/tests/baselines/reference/nodeModulesDynamicImport(module=node16).types @@ -0,0 +1,26 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +export async function main() { +>main : () => Promise + + const { readFile } = await import("fs"); +>readFile : any +>await import("fs") : any +>import("fs") : Promise +>"fs" : "fs" +} +=== tests/cases/conformance/node/index.ts === +// esm format file +export async function main() { +>main : () => Promise + + const { readFile } = await import("fs"); +>readFile : any +>await import("fs") : any +>import("fs") : Promise +>"fs" : "fs" +} +=== tests/cases/conformance/node/types.d.ts === +declare module "fs"; +>"fs" : any + diff --git a/tests/baselines/reference/nodeModulesExportAssignments(module=node16).errors.txt b/tests/baselines/reference/nodeModulesExportAssignments(module=node16).errors.txt new file mode 100644 index 00000000000..cef29663806 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportAssignments(module=node16).errors.txt @@ -0,0 +1,23 @@ +tests/cases/conformance/node/index.ts(3,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. + + +==== tests/cases/conformance/node/subfolder/index.ts (0 errors) ==== + // cjs format file + const a = {}; + export = a; +==== tests/cases/conformance/node/index.ts (1 errors) ==== + // esm format file + const a = {}; + export = a; + ~~~~~~~~~~~ +!!! error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesExportAssignments(module=node16).js b/tests/baselines/reference/nodeModulesExportAssignments(module=node16).js new file mode 100644 index 00000000000..2d09438ae7c --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportAssignments(module=node16).js @@ -0,0 +1,38 @@ +//// [tests/cases/conformance/node/nodeModulesExportAssignments.ts] //// + +//// [index.ts] +// cjs format file +const a = {}; +export = a; +//// [index.ts] +// esm format file +const a = {}; +export = a; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} + +//// [index.js] +"use strict"; +// cjs format file +const a = {}; +module.exports = a; +//// [index.js] +// esm format file +const a = {}; +export {}; + + +//// [index.d.ts] +declare const a: {}; +export = a; +//// [index.d.ts] +declare const a: {}; +export = a; diff --git a/tests/baselines/reference/nodeModulesExportAssignments(module=node16).symbols b/tests/baselines/reference/nodeModulesExportAssignments(module=node16).symbols new file mode 100644 index 00000000000..4552dd34157 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportAssignments(module=node16).symbols @@ -0,0 +1,16 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +const a = {}; +>a : Symbol(a, Decl(index.ts, 1, 5)) + +export = a; +>a : Symbol(a, Decl(index.ts, 1, 5)) + +=== tests/cases/conformance/node/index.ts === +// esm format file +const a = {}; +>a : Symbol(a, Decl(index.ts, 1, 5)) + +export = a; +>a : Symbol(a, Decl(index.ts, 1, 5)) + diff --git a/tests/baselines/reference/nodeModulesExportAssignments(module=node16).types b/tests/baselines/reference/nodeModulesExportAssignments(module=node16).types new file mode 100644 index 00000000000..73f7e0869eb --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportAssignments(module=node16).types @@ -0,0 +1,18 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +const a = {}; +>a : {} +>{} : {} + +export = a; +>a : {} + +=== tests/cases/conformance/node/index.ts === +// esm format file +const a = {}; +>a : {} +>{} : {} + +export = a; +>a : {} + diff --git a/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node16).errors.txt b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node16).errors.txt new file mode 100644 index 00000000000..53ab414e38b --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node16).errors.txt @@ -0,0 +1,33 @@ +tests/cases/conformance/node/index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. +tests/cases/conformance/node/index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. + + +==== tests/cases/conformance/node/index.ts (2 errors) ==== + // esm format file + import { Thing } from "inner/other"; + ~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. + export const a = (await import("inner")).x(); + ~ +!!! error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. +==== tests/cases/conformance/node/node_modules/inner/index.d.ts (0 errors) ==== + // esm format file + export { x } from "./other.js"; +==== tests/cases/conformance/node/node_modules/inner/other.d.ts (0 errors) ==== + // esm format file + export interface Thing {} + export const x: () => Thing; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js" + } +==== tests/cases/conformance/node/node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "type": "module", + "exports": "./index.js" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node16).js b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node16).js new file mode 100644 index 00000000000..da6fe0fc800 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node16).js @@ -0,0 +1,30 @@ +//// [tests/cases/conformance/node/nodeModulesExportsBlocksSpecifierResolution.ts] //// + +//// [index.ts] +// esm format file +import { Thing } from "inner/other"; +export const a = (await import("inner")).x(); +//// [index.d.ts] +// esm format file +export { x } from "./other.js"; +//// [other.d.ts] +// esm format file +export interface Thing {} +export const x: () => Thing; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js" +} +//// [package.json] +{ + "name": "inner", + "private": true, + "type": "module", + "exports": "./index.js" +} + +//// [index.js] +export const a = (await import("inner")).x(); diff --git a/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node16).symbols b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node16).symbols new file mode 100644 index 00000000000..07abee8390f --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node16).symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import { Thing } from "inner/other"; +>Thing : Symbol(Thing, Decl(index.ts, 1, 8)) + +export const a = (await import("inner")).x(); +>a : Symbol(a, Decl(index.ts, 2, 12)) +>(await import("inner")).x : Symbol(x, Decl(index.d.ts, 1, 8)) +>"inner" : Symbol("tests/cases/conformance/node/node_modules/inner/index", Decl(index.d.ts, 0, 0)) +>x : Symbol(x, Decl(index.d.ts, 1, 8)) + +=== tests/cases/conformance/node/node_modules/inner/index.d.ts === +// esm format file +export { x } from "./other.js"; +>x : Symbol(x, Decl(index.d.ts, 1, 8)) + +=== tests/cases/conformance/node/node_modules/inner/other.d.ts === +// esm format file +export interface Thing {} +>Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) + +export const x: () => Thing; +>x : Symbol(x, Decl(other.d.ts, 2, 12)) +>Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node16).types b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node16).types new file mode 100644 index 00000000000..f7806a6a255 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node16).types @@ -0,0 +1,26 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import { Thing } from "inner/other"; +>Thing : any + +export const a = (await import("inner")).x(); +>a : import("tests/cases/conformance/node/node_modules/inner/other").Thing +>(await import("inner")).x() : import("tests/cases/conformance/node/node_modules/inner/other").Thing +>(await import("inner")).x : () => import("tests/cases/conformance/node/node_modules/inner/other").Thing +>(await import("inner")) : typeof import("tests/cases/conformance/node/node_modules/inner/index") +>await import("inner") : typeof import("tests/cases/conformance/node/node_modules/inner/index") +>import("inner") : Promise +>"inner" : "inner" +>x : () => import("tests/cases/conformance/node/node_modules/inner/other").Thing + +=== tests/cases/conformance/node/node_modules/inner/index.d.ts === +// esm format file +export { x } from "./other.js"; +>x : () => import("tests/cases/conformance/node/node_modules/inner/other").Thing + +=== tests/cases/conformance/node/node_modules/inner/other.d.ts === +// esm format file +export interface Thing {} +export const x: () => Thing; +>x : () => Thing + diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node16).errors.txt b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node16).errors.txt new file mode 100644 index 00000000000..b25fc090f8b --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node16).errors.txt @@ -0,0 +1,37 @@ +tests/cases/conformance/node/index.ts(2,23): error TS2307: Cannot find module 'inner/other.js' or its corresponding type declarations. + + +==== tests/cases/conformance/node/index.ts (1 errors) ==== + // esm format file + import { Thing } from "inner/other.js"; // should fail + ~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/other.js' or its corresponding type declarations. + export const a = (await import("inner")).x(); +==== tests/cases/conformance/node/node_modules/inner/index.d.ts (0 errors) ==== + // esm format file + export { x } from "./other.js"; +==== tests/cases/conformance/node/node_modules/inner/other.d.ts (0 errors) ==== + // esm format file + export interface Thing {} + export const x: () => Thing; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js" + } +==== tests/cases/conformance/node/node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "type": "module", + "exports": { + ".": { + "default": "./index.js" + }, + "./other": { + "default": "./other.js" + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node16).js b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node16).js new file mode 100644 index 00000000000..5db58ae2f7b --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node16).js @@ -0,0 +1,41 @@ +//// [tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationConditions.ts] //// + +//// [index.ts] +// esm format file +import { Thing } from "inner/other.js"; // should fail +export const a = (await import("inner")).x(); +//// [index.d.ts] +// esm format file +export { x } from "./other.js"; +//// [other.d.ts] +// esm format file +export interface Thing {} +export const x: () => Thing; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js" +} +//// [package.json] +{ + "name": "inner", + "private": true, + "type": "module", + "exports": { + ".": { + "default": "./index.js" + }, + "./other": { + "default": "./other.js" + } + } +} + +//// [index.js] +export const a = (await import("inner")).x(); + + +//// [index.d.ts] +export declare const a: import("inner/other").Thing; diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node16).symbols b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node16).symbols new file mode 100644 index 00000000000..1abea377c5f --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node16).symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import { Thing } from "inner/other.js"; // should fail +>Thing : Symbol(Thing, Decl(index.ts, 1, 8)) + +export const a = (await import("inner")).x(); +>a : Symbol(a, Decl(index.ts, 2, 12)) +>(await import("inner")).x : Symbol(x, Decl(index.d.ts, 1, 8)) +>"inner" : Symbol("tests/cases/conformance/node/node_modules/inner/index", Decl(index.d.ts, 0, 0)) +>x : Symbol(x, Decl(index.d.ts, 1, 8)) + +=== tests/cases/conformance/node/node_modules/inner/index.d.ts === +// esm format file +export { x } from "./other.js"; +>x : Symbol(x, Decl(index.d.ts, 1, 8)) + +=== tests/cases/conformance/node/node_modules/inner/other.d.ts === +// esm format file +export interface Thing {} +>Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) + +export const x: () => Thing; +>x : Symbol(x, Decl(other.d.ts, 2, 12)) +>Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node16).types b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node16).types new file mode 100644 index 00000000000..6020ebf5b21 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node16).types @@ -0,0 +1,26 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import { Thing } from "inner/other.js"; // should fail +>Thing : any + +export const a = (await import("inner")).x(); +>a : import("tests/cases/conformance/node/node_modules/inner/other").Thing +>(await import("inner")).x() : import("tests/cases/conformance/node/node_modules/inner/other").Thing +>(await import("inner")).x : () => import("tests/cases/conformance/node/node_modules/inner/other").Thing +>(await import("inner")) : typeof import("tests/cases/conformance/node/node_modules/inner/index") +>await import("inner") : typeof import("tests/cases/conformance/node/node_modules/inner/index") +>import("inner") : Promise +>"inner" : "inner" +>x : () => import("tests/cases/conformance/node/node_modules/inner/other").Thing + +=== tests/cases/conformance/node/node_modules/inner/index.d.ts === +// esm format file +export { x } from "./other.js"; +>x : () => import("tests/cases/conformance/node/node_modules/inner/other").Thing + +=== tests/cases/conformance/node/node_modules/inner/other.d.ts === +// esm format file +export interface Thing {} +export const x: () => Thing; +>x : () => Thing + diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node16).errors.txt b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node16).errors.txt new file mode 100644 index 00000000000..b2d874ee38b --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node16).errors.txt @@ -0,0 +1,32 @@ +tests/cases/conformance/node/index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. + + +==== tests/cases/conformance/node/index.ts (1 errors) ==== + // esm format file + import { Thing } from "inner/other"; + ~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. + export const a = (await import("inner/index.js")).x(); +==== tests/cases/conformance/node/node_modules/inner/index.d.ts (0 errors) ==== + // esm format file + export { x } from "./other.js"; +==== tests/cases/conformance/node/node_modules/inner/other.d.ts (0 errors) ==== + // esm format file + export interface Thing {} + export const x: () => Thing; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js" + } +==== tests/cases/conformance/node/node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "type": "module", + "exports": { + "./": "./" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node16).js b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node16).js new file mode 100644 index 00000000000..c0d6b006b33 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node16).js @@ -0,0 +1,36 @@ +//// [tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationDirectory.ts] //// + +//// [index.ts] +// esm format file +import { Thing } from "inner/other"; +export const a = (await import("inner/index.js")).x(); +//// [index.d.ts] +// esm format file +export { x } from "./other.js"; +//// [other.d.ts] +// esm format file +export interface Thing {} +export const x: () => Thing; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js" +} +//// [package.json] +{ + "name": "inner", + "private": true, + "type": "module", + "exports": { + "./": "./" + } +} + +//// [index.js] +export const a = (await import("inner/index.js")).x(); + + +//// [index.d.ts] +export declare const a: import("inner/other.js").Thing; diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node16).symbols b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node16).symbols new file mode 100644 index 00000000000..a12a7b1c026 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node16).symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import { Thing } from "inner/other"; +>Thing : Symbol(Thing, Decl(index.ts, 1, 8)) + +export const a = (await import("inner/index.js")).x(); +>a : Symbol(a, Decl(index.ts, 2, 12)) +>(await import("inner/index.js")).x : Symbol(x, Decl(index.d.ts, 1, 8)) +>"inner/index.js" : Symbol("tests/cases/conformance/node/node_modules/inner/index", Decl(index.d.ts, 0, 0)) +>x : Symbol(x, Decl(index.d.ts, 1, 8)) + +=== tests/cases/conformance/node/node_modules/inner/index.d.ts === +// esm format file +export { x } from "./other.js"; +>x : Symbol(x, Decl(index.d.ts, 1, 8)) + +=== tests/cases/conformance/node/node_modules/inner/other.d.ts === +// esm format file +export interface Thing {} +>Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) + +export const x: () => Thing; +>x : Symbol(x, Decl(other.d.ts, 2, 12)) +>Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node16).types b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node16).types new file mode 100644 index 00000000000..a75c2359eb0 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node16).types @@ -0,0 +1,26 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import { Thing } from "inner/other"; +>Thing : any + +export const a = (await import("inner/index.js")).x(); +>a : import("tests/cases/conformance/node/node_modules/inner/other").Thing +>(await import("inner/index.js")).x() : import("tests/cases/conformance/node/node_modules/inner/other").Thing +>(await import("inner/index.js")).x : () => import("tests/cases/conformance/node/node_modules/inner/other").Thing +>(await import("inner/index.js")) : typeof import("tests/cases/conformance/node/node_modules/inner/index") +>await import("inner/index.js") : typeof import("tests/cases/conformance/node/node_modules/inner/index") +>import("inner/index.js") : Promise +>"inner/index.js" : "inner/index.js" +>x : () => import("tests/cases/conformance/node/node_modules/inner/other").Thing + +=== tests/cases/conformance/node/node_modules/inner/index.d.ts === +// esm format file +export { x } from "./other.js"; +>x : () => import("tests/cases/conformance/node/node_modules/inner/other").Thing + +=== tests/cases/conformance/node/node_modules/inner/other.d.ts === +// esm format file +export interface Thing {} +export const x: () => Thing; +>x : () => Thing + diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node16).errors.txt b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node16).errors.txt new file mode 100644 index 00000000000..c315a2a5232 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node16).errors.txt @@ -0,0 +1,32 @@ +tests/cases/conformance/node/index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. + + +==== tests/cases/conformance/node/index.ts (1 errors) ==== + // esm format file + import { Thing } from "inner/other"; + ~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. + export const a = (await import("inner/index.js")).x(); +==== tests/cases/conformance/node/node_modules/inner/index.d.ts (0 errors) ==== + // esm format file + export { x } from "./other.js"; +==== tests/cases/conformance/node/node_modules/inner/other.d.ts (0 errors) ==== + // esm format file + export interface Thing {} + export const x: () => Thing; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js" + } +==== tests/cases/conformance/node/node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "type": "module", + "exports": { + "./*.js": "./*.js" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node16).js b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node16).js new file mode 100644 index 00000000000..dcdd62bed69 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node16).js @@ -0,0 +1,36 @@ +//// [tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationPattern.ts] //// + +//// [index.ts] +// esm format file +import { Thing } from "inner/other"; +export const a = (await import("inner/index.js")).x(); +//// [index.d.ts] +// esm format file +export { x } from "./other.js"; +//// [other.d.ts] +// esm format file +export interface Thing {} +export const x: () => Thing; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js" +} +//// [package.json] +{ + "name": "inner", + "private": true, + "type": "module", + "exports": { + "./*.js": "./*.js" + } +} + +//// [index.js] +export const a = (await import("inner/index.js")).x(); + + +//// [index.d.ts] +export declare const a: import("inner/other.js").Thing; diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node16).symbols b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node16).symbols new file mode 100644 index 00000000000..a12a7b1c026 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node16).symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import { Thing } from "inner/other"; +>Thing : Symbol(Thing, Decl(index.ts, 1, 8)) + +export const a = (await import("inner/index.js")).x(); +>a : Symbol(a, Decl(index.ts, 2, 12)) +>(await import("inner/index.js")).x : Symbol(x, Decl(index.d.ts, 1, 8)) +>"inner/index.js" : Symbol("tests/cases/conformance/node/node_modules/inner/index", Decl(index.d.ts, 0, 0)) +>x : Symbol(x, Decl(index.d.ts, 1, 8)) + +=== tests/cases/conformance/node/node_modules/inner/index.d.ts === +// esm format file +export { x } from "./other.js"; +>x : Symbol(x, Decl(index.d.ts, 1, 8)) + +=== tests/cases/conformance/node/node_modules/inner/other.d.ts === +// esm format file +export interface Thing {} +>Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) + +export const x: () => Thing; +>x : Symbol(x, Decl(other.d.ts, 2, 12)) +>Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node16).types b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node16).types new file mode 100644 index 00000000000..a75c2359eb0 --- /dev/null +++ b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node16).types @@ -0,0 +1,26 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import { Thing } from "inner/other"; +>Thing : any + +export const a = (await import("inner/index.js")).x(); +>a : import("tests/cases/conformance/node/node_modules/inner/other").Thing +>(await import("inner/index.js")).x() : import("tests/cases/conformance/node/node_modules/inner/other").Thing +>(await import("inner/index.js")).x : () => import("tests/cases/conformance/node/node_modules/inner/other").Thing +>(await import("inner/index.js")) : typeof import("tests/cases/conformance/node/node_modules/inner/index") +>await import("inner/index.js") : typeof import("tests/cases/conformance/node/node_modules/inner/index") +>import("inner/index.js") : Promise +>"inner/index.js" : "inner/index.js" +>x : () => import("tests/cases/conformance/node/node_modules/inner/other").Thing + +=== tests/cases/conformance/node/node_modules/inner/index.d.ts === +// esm format file +export { x } from "./other.js"; +>x : () => import("tests/cases/conformance/node/node_modules/inner/other").Thing + +=== tests/cases/conformance/node/node_modules/inner/other.d.ts === +// esm format file +export interface Thing {} +export const x: () => Thing; +>x : () => Thing + diff --git a/tests/baselines/reference/nodeModulesForbidenSyntax(module=node16).errors.txt b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node16).errors.txt new file mode 100644 index 00000000000..984483a332e --- /dev/null +++ b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node16).errors.txt @@ -0,0 +1,139 @@ +tests/cases/conformance/node/index.cts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. +tests/cases/conformance/node/index.cts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +tests/cases/conformance/node/index.cts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +tests/cases/conformance/node/index.mts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. +tests/cases/conformance/node/index.mts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +tests/cases/conformance/node/index.mts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +tests/cases/conformance/node/subfolder/index.cts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. +tests/cases/conformance/node/subfolder/index.cts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +tests/cases/conformance/node/subfolder/index.cts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +tests/cases/conformance/node/subfolder/index.mts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. +tests/cases/conformance/node/subfolder/index.mts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +tests/cases/conformance/node/subfolder/index.mts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +tests/cases/conformance/node/subfolder2/another/index.cts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. +tests/cases/conformance/node/subfolder2/another/index.cts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +tests/cases/conformance/node/subfolder2/another/index.cts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +tests/cases/conformance/node/subfolder2/another/index.mts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. +tests/cases/conformance/node/subfolder2/another/index.mts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +tests/cases/conformance/node/subfolder2/another/index.mts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +tests/cases/conformance/node/subfolder2/index.cts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. +tests/cases/conformance/node/subfolder2/index.cts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +tests/cases/conformance/node/subfolder2/index.cts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +tests/cases/conformance/node/subfolder2/index.mts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. +tests/cases/conformance/node/subfolder2/index.mts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. +tests/cases/conformance/node/subfolder2/index.mts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + + +==== tests/cases/conformance/node/subfolder/index.ts (0 errors) ==== + // cjs format file + const x = () => (void 0); + export {x}; +==== tests/cases/conformance/node/subfolder/index.cts (3 errors) ==== + // cjs format file + const x = () => (void 0); + ~ +!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. + ~~~~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + ~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + export {x}; +==== tests/cases/conformance/node/subfolder/index.mts (3 errors) ==== + // esm format file + const x = () => (void 0); + ~ +!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. + ~~~~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + ~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + export {x}; +==== tests/cases/conformance/node/subfolder2/index.ts (0 errors) ==== + // cjs format file + const x = () => (void 0); + export {x}; +==== tests/cases/conformance/node/subfolder2/index.cts (3 errors) ==== + // cjs format file + const x = () => (void 0); + ~ +!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. + ~~~~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + ~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + export {x}; +==== tests/cases/conformance/node/subfolder2/index.mts (3 errors) ==== + // esm format file + const x = () => (void 0); + ~ +!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. + ~~~~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + ~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + export {x}; +==== tests/cases/conformance/node/subfolder2/another/index.ts (0 errors) ==== + // esm format file + const x = () => (void 0); + export {x}; +==== tests/cases/conformance/node/subfolder2/another/index.mts (3 errors) ==== + // esm format file + const x = () => (void 0); + ~ +!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. + ~~~~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + ~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + export {x}; +==== tests/cases/conformance/node/subfolder2/another/index.cts (3 errors) ==== + // cjs format file + const x = () => (void 0); + ~ +!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. + ~~~~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + ~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + export {x}; +==== tests/cases/conformance/node/index.mts (3 errors) ==== + // esm format file + const x = () => (void 0); + ~ +!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. + ~~~~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + ~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + export {x}; +==== tests/cases/conformance/node/index.cts (3 errors) ==== + // cjs format file + const x = () => (void 0); + ~ +!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. + ~~~~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + ~~~~~~~~~~~~~ +!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. + export {x}; +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + const x = () => (void 0); + export {x}; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== tests/cases/conformance/node/subfolder2/package.json (0 errors) ==== + { + } +==== tests/cases/conformance/node/subfolder2/another/package.json (0 errors) ==== + { + "type": "module" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesForbidenSyntax(module=node16).js b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node16).js new file mode 100644 index 00000000000..4cca6af5a58 --- /dev/null +++ b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node16).js @@ -0,0 +1,172 @@ +//// [tests/cases/conformance/node/nodeModulesForbidenSyntax.ts] //// + +//// [index.ts] +// cjs format file +const x = () => (void 0); +export {x}; +//// [index.cts] +// cjs format file +const x = () => (void 0); +export {x}; +//// [index.mts] +// esm format file +const x = () => (void 0); +export {x}; +//// [index.ts] +// cjs format file +const x = () => (void 0); +export {x}; +//// [index.cts] +// cjs format file +const x = () => (void 0); +export {x}; +//// [index.mts] +// esm format file +const x = () => (void 0); +export {x}; +//// [index.ts] +// esm format file +const x = () => (void 0); +export {x}; +//// [index.mts] +// esm format file +const x = () => (void 0); +export {x}; +//// [index.cts] +// cjs format file +const x = () => (void 0); +export {x}; +//// [index.mts] +// esm format file +const x = () => (void 0); +export {x}; +//// [index.cts] +// cjs format file +const x = () => (void 0); +export {x}; +//// [index.ts] +// esm format file +const x = () => (void 0); +export {x}; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [package.json] +{ +} +//// [package.json] +{ + "type": "module" +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = () => (void 0); +exports.x = x; +//// [index.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = () => (void 0); +exports.x = x; +//// [index.mjs] +// esm format file +const x = () => (void 0); +export { x }; +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = () => (void 0); +exports.x = x; +//// [index.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = () => (void 0); +exports.x = x; +//// [index.mjs] +// esm format file +const x = () => (void 0); +export { x }; +//// [index.js] +// esm format file +const x = () => (void 0); +export { x }; +//// [index.mjs] +// esm format file +const x = () => (void 0); +export { x }; +//// [index.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = () => (void 0); +exports.x = x; +//// [index.mjs] +// esm format file +const x = () => (void 0); +export { x }; +//// [index.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = () => (void 0); +exports.x = x; +//// [index.js] +// esm format file +const x = () => (void 0); +export { x }; + + +//// [index.d.ts] +declare const x: () => T; +export { x }; +//// [index.d.cts] +declare const x: () => T; +export { x }; +//// [index.d.mts] +declare const x: () => T; +export { x }; +//// [index.d.ts] +declare const x: () => T; +export { x }; +//// [index.d.cts] +declare const x: () => T; +export { x }; +//// [index.d.mts] +declare const x: () => T; +export { x }; +//// [index.d.ts] +declare const x: () => T; +export { x }; +//// [index.d.mts] +declare const x: () => T; +export { x }; +//// [index.d.cts] +declare const x: () => T; +export { x }; +//// [index.d.mts] +declare const x: () => T; +export { x }; +//// [index.d.cts] +declare const x: () => T; +export { x }; +//// [index.d.ts] +declare const x: () => T; +export { x }; diff --git a/tests/baselines/reference/nodeModulesForbidenSyntax(module=node16).symbols b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node16).symbols new file mode 100644 index 00000000000..1ca35d0d3e3 --- /dev/null +++ b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node16).symbols @@ -0,0 +1,120 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.ts, 1, 5)) +>T : Symbol(T, Decl(index.ts, 1, 11)) +>T : Symbol(T, Decl(index.ts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.ts, 2, 8)) + +=== tests/cases/conformance/node/subfolder/index.cts === +// cjs format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.cts, 1, 5)) +>T : Symbol(T, Decl(index.cts, 1, 11)) +>T : Symbol(T, Decl(index.cts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.cts, 2, 8)) + +=== tests/cases/conformance/node/subfolder/index.mts === +// esm format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.mts, 1, 5)) +>T : Symbol(T, Decl(index.mts, 1, 11)) +>T : Symbol(T, Decl(index.mts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.mts, 2, 8)) + +=== tests/cases/conformance/node/subfolder2/index.ts === +// cjs format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.ts, 1, 5)) +>T : Symbol(T, Decl(index.ts, 1, 11)) +>T : Symbol(T, Decl(index.ts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.ts, 2, 8)) + +=== tests/cases/conformance/node/subfolder2/index.cts === +// cjs format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.cts, 1, 5)) +>T : Symbol(T, Decl(index.cts, 1, 11)) +>T : Symbol(T, Decl(index.cts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.cts, 2, 8)) + +=== tests/cases/conformance/node/subfolder2/index.mts === +// esm format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.mts, 1, 5)) +>T : Symbol(T, Decl(index.mts, 1, 11)) +>T : Symbol(T, Decl(index.mts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.mts, 2, 8)) + +=== tests/cases/conformance/node/subfolder2/another/index.ts === +// esm format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.ts, 1, 5)) +>T : Symbol(T, Decl(index.ts, 1, 11)) +>T : Symbol(T, Decl(index.ts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.ts, 2, 8)) + +=== tests/cases/conformance/node/subfolder2/another/index.mts === +// esm format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.mts, 1, 5)) +>T : Symbol(T, Decl(index.mts, 1, 11)) +>T : Symbol(T, Decl(index.mts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.mts, 2, 8)) + +=== tests/cases/conformance/node/subfolder2/another/index.cts === +// cjs format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.cts, 1, 5)) +>T : Symbol(T, Decl(index.cts, 1, 11)) +>T : Symbol(T, Decl(index.cts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.cts, 2, 8)) + +=== tests/cases/conformance/node/index.mts === +// esm format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.mts, 1, 5)) +>T : Symbol(T, Decl(index.mts, 1, 11)) +>T : Symbol(T, Decl(index.mts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.mts, 2, 8)) + +=== tests/cases/conformance/node/index.cts === +// cjs format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.cts, 1, 5)) +>T : Symbol(T, Decl(index.cts, 1, 11)) +>T : Symbol(T, Decl(index.cts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.cts, 2, 8)) + +=== tests/cases/conformance/node/index.ts === +// esm format file +const x = () => (void 0); +>x : Symbol(x, Decl(index.ts, 1, 5)) +>T : Symbol(T, Decl(index.ts, 1, 11)) +>T : Symbol(T, Decl(index.ts, 1, 11)) + +export {x}; +>x : Symbol(x, Decl(index.ts, 2, 8)) + diff --git a/tests/baselines/reference/nodeModulesForbidenSyntax(module=node16).types b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node16).types new file mode 100644 index 00000000000..016af4314d1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node16).types @@ -0,0 +1,168 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +const x = () => (void 0); +>x : () => T +>() => (void 0) : () => T +>(void 0) : T +>(void 0) : any +>(void 0) : undefined +>void 0 : undefined +>0 : 0 + +export {x}; +>x : () => T + +=== tests/cases/conformance/node/subfolder/index.cts === +// cjs format file +const x = () => (void 0); +>x : () => T +>() => (void 0) : () => T +>(void 0) : T +>(void 0) : any +>(void 0) : undefined +>void 0 : undefined +>0 : 0 + +export {x}; +>x : () => T + +=== tests/cases/conformance/node/subfolder/index.mts === +// esm format file +const x = () => (void 0); +>x : () => T +>() => (void 0) : () => T +>(void 0) : T +>(void 0) : any +>(void 0) : undefined +>void 0 : undefined +>0 : 0 + +export {x}; +>x : () => T + +=== tests/cases/conformance/node/subfolder2/index.ts === +// cjs format file +const x = () => (void 0); +>x : () => T +>() => (void 0) : () => T +>(void 0) : T +>(void 0) : any +>(void 0) : undefined +>void 0 : undefined +>0 : 0 + +export {x}; +>x : () => T + +=== tests/cases/conformance/node/subfolder2/index.cts === +// cjs format file +const x = () => (void 0); +>x : () => T +>() => (void 0) : () => T +>(void 0) : T +>(void 0) : any +>(void 0) : undefined +>void 0 : undefined +>0 : 0 + +export {x}; +>x : () => T + +=== tests/cases/conformance/node/subfolder2/index.mts === +// esm format file +const x = () => (void 0); +>x : () => T +>() => (void 0) : () => T +>(void 0) : T +>(void 0) : any +>(void 0) : undefined +>void 0 : undefined +>0 : 0 + +export {x}; +>x : () => T + +=== tests/cases/conformance/node/subfolder2/another/index.ts === +// esm format file +const x = () => (void 0); +>x : () => T +>() => (void 0) : () => T +>(void 0) : T +>(void 0) : any +>(void 0) : undefined +>void 0 : undefined +>0 : 0 + +export {x}; +>x : () => T + +=== tests/cases/conformance/node/subfolder2/another/index.mts === +// esm format file +const x = () => (void 0); +>x : () => T +>() => (void 0) : () => T +>(void 0) : T +>(void 0) : any +>(void 0) : undefined +>void 0 : undefined +>0 : 0 + +export {x}; +>x : () => T + +=== tests/cases/conformance/node/subfolder2/another/index.cts === +// cjs format file +const x = () => (void 0); +>x : () => T +>() => (void 0) : () => T +>(void 0) : T +>(void 0) : any +>(void 0) : undefined +>void 0 : undefined +>0 : 0 + +export {x}; +>x : () => T + +=== tests/cases/conformance/node/index.mts === +// esm format file +const x = () => (void 0); +>x : () => T +>() => (void 0) : () => T +>(void 0) : T +>(void 0) : any +>(void 0) : undefined +>void 0 : undefined +>0 : 0 + +export {x}; +>x : () => T + +=== tests/cases/conformance/node/index.cts === +// cjs format file +const x = () => (void 0); +>x : () => T +>() => (void 0) : () => T +>(void 0) : T +>(void 0) : any +>(void 0) : undefined +>void 0 : undefined +>0 : 0 + +export {x}; +>x : () => T + +=== tests/cases/conformance/node/index.ts === +// esm format file +const x = () => (void 0); +>x : () => T +>() => (void 0) : () => T +>(void 0) : T +>(void 0) : any +>(void 0) : undefined +>void 0 : undefined +>0 : 0 + +export {x}; +>x : () => T + diff --git a/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node16).errors.txt b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node16).errors.txt new file mode 100644 index 00000000000..e268184c7ff --- /dev/null +++ b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node16).errors.txt @@ -0,0 +1,38 @@ +tests/cases/conformance/node/subfolder/index.ts(2,10): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. +tests/cases/conformance/node/subfolder/index.ts(3,7): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. +tests/cases/conformance/node/subfolder/index.ts(4,7): error TS2725: Class name cannot be 'Object' when targeting ES5 with module Node16. +tests/cases/conformance/node/subfolder/index.ts(5,14): error TS1216: Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules. + + +==== tests/cases/conformance/node/subfolder/index.ts (4 errors) ==== + // cjs format file + function require() {} + ~~~~~~~ +!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. + const exports = {}; + ~~~~~~~ +!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. + class Object {} + ~~~~~~ +!!! error TS2725: Class name cannot be 'Object' when targeting ES5 with module Node16. + export const __esModule = false; + ~~~~~~~~~~ +!!! error TS1216: Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules. + export {require, exports, Object}; +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + function require() {} + const exports = {}; + class Object {} + export const __esModule = false; + export {require, exports, Object}; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node16).js b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node16).js new file mode 100644 index 00000000000..064128d216e --- /dev/null +++ b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node16).js @@ -0,0 +1,64 @@ +//// [tests/cases/conformance/node/nodeModulesGeneratedNameCollisions.ts] //// + +//// [index.ts] +// cjs format file +function require() {} +const exports = {}; +class Object {} +export const __esModule = false; +export {require, exports, Object}; +//// [index.ts] +// esm format file +function require() {} +const exports = {}; +class Object {} +export const __esModule = false; +export {require, exports, Object}; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Object = exports.exports = exports.require = exports.__esModule = void 0; +// cjs format file +function require() { } +exports.require = require; +const exports = {}; +exports.exports = exports; +class Object { +} +exports.Object = Object; +exports.__esModule = false; +//// [index.js] +// esm format file +function require() { } +const exports = {}; +class Object { +} +export const __esModule = false; +export { require, exports, Object }; + + +//// [index.d.ts] +declare function require(): void; +declare const exports: {}; +declare class Object { +} +export declare const __esModule = false; +export { require, exports, Object }; +//// [index.d.ts] +declare function require(): void; +declare const exports: {}; +declare class Object { +} +export declare const __esModule = false; +export { require, exports, Object }; diff --git a/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node16).symbols b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node16).symbols new file mode 100644 index 00000000000..9e967fe93b7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node16).symbols @@ -0,0 +1,38 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +function require() {} +>require : Symbol(require, Decl(index.ts, 0, 0)) + +const exports = {}; +>exports : Symbol(exports, Decl(index.ts, 2, 5)) + +class Object {} +>Object : Symbol(Object, Decl(index.ts, 2, 19)) + +export const __esModule = false; +>__esModule : Symbol(__esModule, Decl(index.ts, 4, 12)) + +export {require, exports, Object}; +>require : Symbol(require, Decl(index.ts, 5, 8)) +>exports : Symbol(exports, Decl(index.ts, 5, 16)) +>Object : Symbol(Object, Decl(index.ts, 5, 25)) + +=== tests/cases/conformance/node/index.ts === +// esm format file +function require() {} +>require : Symbol(require, Decl(index.ts, 0, 0)) + +const exports = {}; +>exports : Symbol(exports, Decl(index.ts, 2, 5)) + +class Object {} +>Object : Symbol(Object, Decl(index.ts, 2, 19)) + +export const __esModule = false; +>__esModule : Symbol(__esModule, Decl(index.ts, 4, 12)) + +export {require, exports, Object}; +>require : Symbol(require, Decl(index.ts, 5, 8)) +>exports : Symbol(exports, Decl(index.ts, 5, 16)) +>Object : Symbol(Object, Decl(index.ts, 5, 25)) + diff --git a/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node16).types b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node16).types new file mode 100644 index 00000000000..094de6c8692 --- /dev/null +++ b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node16).types @@ -0,0 +1,42 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +function require() {} +>require : () => void + +const exports = {}; +>exports : {} +>{} : {} + +class Object {} +>Object : Object + +export const __esModule = false; +>__esModule : false +>false : false + +export {require, exports, Object}; +>require : () => void +>exports : {} +>Object : typeof Object + +=== tests/cases/conformance/node/index.ts === +// esm format file +function require() {} +>require : () => void + +const exports = {}; +>exports : {} +>{} : {} + +class Object {} +>Object : Object + +export const __esModule = false; +>__esModule : false +>false : false + +export {require, exports, Object}; +>require : () => void +>exports : {} +>Object : typeof Object + diff --git a/tests/baselines/reference/nodeModulesImportAssertions(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportAssertions(module=node16).errors.txt new file mode 100644 index 00000000000..5730914f867 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAssertions(module=node16).errors.txt @@ -0,0 +1,22 @@ +tests/cases/conformance/node/index.ts(1,35): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +tests/cases/conformance/node/otherc.cts(1,35): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +tests/cases/conformance/node/otherc.cts(2,40): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. + + +==== tests/cases/conformance/node/index.ts (1 errors) ==== + import json from "./package.json" assert { type: "json" }; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +==== tests/cases/conformance/node/otherc.cts (2 errors) ==== + import json from "./package.json" assert { type: "json" }; // should error, cjs mode imports don't support assertions + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + const json2 = import("./package.json", { assert: { type: "json" } }); // should be fine + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "pkg", + "private": true, + "type": "module" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportAssertions(module=node16).js b/tests/baselines/reference/nodeModulesImportAssertions(module=node16).js new file mode 100644 index 00000000000..091166d523c --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAssertions(module=node16).js @@ -0,0 +1,20 @@ +//// [tests/cases/conformance/node/nodeModulesImportAssertions.ts] //// + +//// [index.ts] +import json from "./package.json" assert { type: "json" }; +//// [otherc.cts] +import json from "./package.json" assert { type: "json" }; // should error, cjs mode imports don't support assertions +const json2 = import("./package.json", { assert: { type: "json" } }); // should be fine +//// [package.json] +{ + "name": "pkg", + "private": true, + "type": "module" +} + +//// [index.js] +export {}; +//// [otherc.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const json2 = import("./package.json", { assert: { type: "json" } }); // should be fine diff --git a/tests/baselines/reference/nodeModulesImportAssertions(module=node16).symbols b/tests/baselines/reference/nodeModulesImportAssertions(module=node16).symbols new file mode 100644 index 00000000000..3bacb3cfabe --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAssertions(module=node16).symbols @@ -0,0 +1,25 @@ +=== tests/cases/conformance/node/index.ts === +import json from "./package.json" assert { type: "json" }; +>json : Symbol(json, Decl(index.ts, 0, 6)) + +=== tests/cases/conformance/node/otherc.cts === +import json from "./package.json" assert { type: "json" }; // should error, cjs mode imports don't support assertions +>json : Symbol(json, Decl(otherc.cts, 0, 6)) + +const json2 = import("./package.json", { assert: { type: "json" } }); // should be fine +>json2 : Symbol(json2, Decl(otherc.cts, 1, 5)) +>"./package.json" : Symbol("tests/cases/conformance/node/package", Decl(package.json, 0, 0)) +>assert : Symbol(assert, Decl(otherc.cts, 1, 40)) +>type : Symbol(type, Decl(otherc.cts, 1, 50)) + +=== tests/cases/conformance/node/package.json === +{ + "name": "pkg", +>"name" : Symbol("name", Decl(package.json, 0, 1)) + + "private": true, +>"private" : Symbol("private", Decl(package.json, 1, 18)) + + "type": "module" +>"type" : Symbol("type", Decl(package.json, 2, 20)) +} diff --git a/tests/baselines/reference/nodeModulesImportAssertions(module=node16).types b/tests/baselines/reference/nodeModulesImportAssertions(module=node16).types new file mode 100644 index 00000000000..36c03c4d926 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAssertions(module=node16).types @@ -0,0 +1,36 @@ +=== tests/cases/conformance/node/index.ts === +import json from "./package.json" assert { type: "json" }; +>json : { name: string; private: boolean; type: string; } +>type : any + +=== tests/cases/conformance/node/otherc.cts === +import json from "./package.json" assert { type: "json" }; // should error, cjs mode imports don't support assertions +>json : { name: string; private: boolean; type: string; } +>type : any + +const json2 = import("./package.json", { assert: { type: "json" } }); // should be fine +>json2 : Promise<{ default: { name: string; private: boolean; type: string; }; }> +>import("./package.json", { assert: { type: "json" } }) : Promise<{ default: { name: string; private: boolean; type: string; }; }> +>"./package.json" : "./package.json" +>{ assert: { type: "json" } } : { assert: { type: string; }; } +>assert : { type: string; } +>{ type: "json" } : { type: string; } +>type : string +>"json" : "json" + +=== tests/cases/conformance/node/package.json === +{ +>{ "name": "pkg", "private": true, "type": "module"} : { name: string; private: boolean; type: string; } + + "name": "pkg", +>"name" : string +>"pkg" : "pkg" + + "private": true, +>"private" : boolean +>true : true + + "type": "module" +>"type" : string +>"module" : "module" +} diff --git a/tests/baselines/reference/nodeModulesImportAssertions(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesImportAssertions(module=nodenext).errors.txt index 29dbcb839f5..1a3369a277e 100644 --- a/tests/baselines/reference/nodeModulesImportAssertions(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesImportAssertions(module=nodenext).errors.txt @@ -1,19 +1,13 @@ -tests/cases/conformance/node/index.ts(1,18): error TS7062: JSON imports are experimental in ES module mode imports. tests/cases/conformance/node/otherc.cts(1,35): error TS2836: Import assertions are not allowed on statements that transpile to commonjs 'require' calls. -tests/cases/conformance/node/otherc.cts(2,22): error TS7062: JSON imports are experimental in ES module mode imports. -==== tests/cases/conformance/node/index.ts (1 errors) ==== +==== tests/cases/conformance/node/index.ts (0 errors) ==== import json from "./package.json" assert { type: "json" }; - ~~~~~~~~~~~~~~~~ -!!! error TS7062: JSON imports are experimental in ES module mode imports. -==== tests/cases/conformance/node/otherc.cts (2 errors) ==== +==== tests/cases/conformance/node/otherc.cts (1 errors) ==== import json from "./package.json" assert { type: "json" }; // should error, cjs mode imports don't support assertions ~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2836: Import assertions are not allowed on statements that transpile to commonjs 'require' calls. const json2 = import("./package.json", { assert: { type: "json" } }); // should be fine - ~~~~~~~~~~~~~~~~ -!!! error TS7062: JSON imports are experimental in ES module mode imports. ==== tests/cases/conformance/node/package.json (0 errors) ==== { "name": "pkg", diff --git a/tests/baselines/reference/nodeModulesImportAssignments(module=node16).js b/tests/baselines/reference/nodeModulesImportAssignments(module=node16).js new file mode 100644 index 00000000000..c73ff1177a5 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAssignments(module=node16).js @@ -0,0 +1,65 @@ +//// [tests/cases/conformance/node/nodeModulesImportAssignments.ts] //// + +//// [index.ts] +// cjs format file +import fs = require("fs"); +fs.readFile; +export import fs2 = require("fs"); +//// [index.ts] +// esm format file +import fs = require("fs"); +fs.readFile; +export import fs2 = require("fs"); +//// [file.ts] +// esm format file +const __require = null; +const _createRequire = null; +import fs = require("fs"); +fs.readFile; +export import fs2 = require("fs"); +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [types.d.ts] +declare module "fs"; + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const fs = require("fs"); +fs.readFile; +exports.fs2 = require("fs"); +//// [index.js] +import { createRequire as _createRequire } from "module"; +const __require = _createRequire(import.meta.url); +// esm format file +const fs = __require("fs"); +fs.readFile; +const fs2 = __require("fs"); +export { fs2 }; +//// [file.js] +import { createRequire as _createRequire_1 } from "module"; +const __require_1 = _createRequire_1(import.meta.url); +// esm format file +const __require = null; +const _createRequire = null; +const fs = __require_1("fs"); +fs.readFile; +const fs2 = __require_1("fs"); +export { fs2 }; + + +//// [index.d.ts] +export import fs2 = require("fs"); +//// [index.d.ts] +export import fs2 = require("fs"); +//// [file.d.ts] +export import fs2 = require("fs"); diff --git a/tests/baselines/reference/nodeModulesImportAssignments(module=node16).symbols b/tests/baselines/reference/nodeModulesImportAssignments(module=node16).symbols new file mode 100644 index 00000000000..ae7fbc666da --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAssignments(module=node16).symbols @@ -0,0 +1,43 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +import fs = require("fs"); +>fs : Symbol(fs, Decl(index.ts, 0, 0)) + +fs.readFile; +>fs : Symbol(fs, Decl(index.ts, 0, 0)) + +export import fs2 = require("fs"); +>fs2 : Symbol(fs2, Decl(index.ts, 2, 12)) + +=== tests/cases/conformance/node/index.ts === +// esm format file +import fs = require("fs"); +>fs : Symbol(fs, Decl(index.ts, 0, 0)) + +fs.readFile; +>fs : Symbol(fs, Decl(index.ts, 0, 0)) + +export import fs2 = require("fs"); +>fs2 : Symbol(fs2, Decl(index.ts, 2, 12)) + +=== tests/cases/conformance/node/file.ts === +// esm format file +const __require = null; +>__require : Symbol(__require, Decl(file.ts, 1, 5)) + +const _createRequire = null; +>_createRequire : Symbol(_createRequire, Decl(file.ts, 2, 5)) + +import fs = require("fs"); +>fs : Symbol(fs, Decl(file.ts, 2, 28)) + +fs.readFile; +>fs : Symbol(fs, Decl(file.ts, 2, 28)) + +export import fs2 = require("fs"); +>fs2 : Symbol(fs2, Decl(file.ts, 4, 12)) + +=== tests/cases/conformance/node/types.d.ts === +declare module "fs"; +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesImportAssignments(module=node16).types b/tests/baselines/reference/nodeModulesImportAssignments(module=node16).types new file mode 100644 index 00000000000..21af2cd798f --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAssignments(module=node16).types @@ -0,0 +1,51 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +import fs = require("fs"); +>fs : any + +fs.readFile; +>fs.readFile : any +>fs : any +>readFile : any + +export import fs2 = require("fs"); +>fs2 : any + +=== tests/cases/conformance/node/index.ts === +// esm format file +import fs = require("fs"); +>fs : any + +fs.readFile; +>fs.readFile : any +>fs : any +>readFile : any + +export import fs2 = require("fs"); +>fs2 : any + +=== tests/cases/conformance/node/file.ts === +// esm format file +const __require = null; +>__require : any +>null : null + +const _createRequire = null; +>_createRequire : any +>null : null + +import fs = require("fs"); +>fs : any + +fs.readFile; +>fs.readFile : any +>fs : any +>readFile : any + +export import fs2 = require("fs"); +>fs2 : any + +=== tests/cases/conformance/node/types.d.ts === +declare module "fs"; +>"fs" : any + diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node16).errors.txt new file mode 100644 index 00000000000..b4ae0ff6fb0 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node16).errors.txt @@ -0,0 +1,36 @@ +tests/cases/conformance/node/subfolder/index.ts(2,9): error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. +tests/cases/conformance/node/subfolder/index.ts(4,1): error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + + +==== tests/cases/conformance/node/subfolder/index.ts (2 errors) ==== + // cjs format file + import {default as _fs} from "fs"; + ~~~~~~~~~~~~~~ +!!! error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + _fs.readFile; + import * as fs from "fs"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + fs.readFile; +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + import {default as _fs} from "fs"; + _fs.readFile; + import * as fs from "fs"; + fs.readFile; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== tests/cases/conformance/node/types.d.ts (0 errors) ==== + declare module "fs"; + declare module "tslib" { + export {}; + // intentionally missing all helpers + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node16).js b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node16).js new file mode 100644 index 00000000000..4712d65a099 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node16).js @@ -0,0 +1,52 @@ +//// [tests/cases/conformance/node/nodeModulesImportHelpersCollisions.ts] //// + +//// [index.ts] +// cjs format file +import {default as _fs} from "fs"; +_fs.readFile; +import * as fs from "fs"; +fs.readFile; +//// [index.ts] +// esm format file +import {default as _fs} from "fs"; +_fs.readFile; +import * as fs from "fs"; +fs.readFile; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [types.d.ts] +declare module "fs"; +declare module "tslib" { + export {}; + // intentionally missing all helpers +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +// cjs format file +const fs_1 = tslib_1.__importDefault(require("fs")); +fs_1.default.readFile; +const fs = tslib_1.__importStar(require("fs")); +fs.readFile; +//// [index.js] +// esm format file +import { default as _fs } from "fs"; +_fs.readFile; +import * as fs from "fs"; +fs.readFile; + + +//// [index.d.ts] +export {}; +//// [index.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node16).symbols b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node16).symbols new file mode 100644 index 00000000000..996840abd4e --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node16).symbols @@ -0,0 +1,40 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +import {default as _fs} from "fs"; +>default : Symbol(_fs, Decl(types.d.ts, 0, 0)) +>_fs : Symbol(_fs, Decl(index.ts, 1, 8)) + +_fs.readFile; +>_fs : Symbol(_fs, Decl(index.ts, 1, 8)) + +import * as fs from "fs"; +>fs : Symbol(fs, Decl(index.ts, 3, 6)) + +fs.readFile; +>fs : Symbol(fs, Decl(index.ts, 3, 6)) + +=== tests/cases/conformance/node/index.ts === +// esm format file +import {default as _fs} from "fs"; +>default : Symbol(_fs, Decl(types.d.ts, 0, 0)) +>_fs : Symbol(_fs, Decl(index.ts, 1, 8)) + +_fs.readFile; +>_fs : Symbol(_fs, Decl(index.ts, 1, 8)) + +import * as fs from "fs"; +>fs : Symbol(fs, Decl(index.ts, 3, 6)) + +fs.readFile; +>fs : Symbol(fs, Decl(index.ts, 3, 6)) + +=== tests/cases/conformance/node/types.d.ts === +declare module "fs"; +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) + +declare module "tslib" { +>"tslib" : Symbol("tslib", Decl(types.d.ts, 0, 20)) + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node16).types b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node16).types new file mode 100644 index 00000000000..e08e9456be9 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node16).types @@ -0,0 +1,48 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +import {default as _fs} from "fs"; +>default : any +>_fs : any + +_fs.readFile; +>_fs.readFile : any +>_fs : any +>readFile : any + +import * as fs from "fs"; +>fs : any + +fs.readFile; +>fs.readFile : any +>fs : any +>readFile : any + +=== tests/cases/conformance/node/index.ts === +// esm format file +import {default as _fs} from "fs"; +>default : any +>_fs : any + +_fs.readFile; +>_fs.readFile : any +>_fs : any +>readFile : any + +import * as fs from "fs"; +>fs : any + +fs.readFile; +>fs.readFile : any +>fs : any +>readFile : any + +=== tests/cases/conformance/node/types.d.ts === +declare module "fs"; +>"fs" : any + +declare module "tslib" { +>"tslib" : typeof import("tslib") + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node16).errors.txt new file mode 100644 index 00000000000..d2f62391af2 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node16).errors.txt @@ -0,0 +1,32 @@ +tests/cases/conformance/node/subfolder/index.ts(2,1): error TS2343: This syntax requires an imported helper named '__exportStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. +tests/cases/conformance/node/subfolder/index.ts(3,1): error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + + +==== tests/cases/conformance/node/subfolder/index.ts (2 errors) ==== + // cjs format file + export * from "fs"; + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2343: This syntax requires an imported helper named '__exportStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + export * as fs from "fs"; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + export * from "fs"; + export * as fs from "fs"; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== tests/cases/conformance/node/types.d.ts (0 errors) ==== + declare module "fs"; + declare module "tslib" { + export {}; + // intentionally missing all helpers + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node16).js b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node16).js new file mode 100644 index 00000000000..c058d00e216 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node16).js @@ -0,0 +1,47 @@ +//// [tests/cases/conformance/node/nodeModulesImportHelpersCollisions2.ts] //// + +//// [index.ts] +// cjs format file +export * from "fs"; +export * as fs from "fs"; +//// [index.ts] +// esm format file +export * from "fs"; +export * as fs from "fs"; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [types.d.ts] +declare module "fs"; +declare module "tslib" { + export {}; + // intentionally missing all helpers +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fs = void 0; +const tslib_1 = require("tslib"); +// cjs format file +tslib_1.__exportStar(require("fs"), exports); +exports.fs = tslib_1.__importStar(require("fs")); +//// [index.js] +// esm format file +export * from "fs"; +export * as fs from "fs"; + + +//// [index.d.ts] +export * from "fs"; +export * as fs from "fs"; +//// [index.d.ts] +export * from "fs"; +export * as fs from "fs"; diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node16).symbols b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node16).symbols new file mode 100644 index 00000000000..367ba59adf0 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node16).symbols @@ -0,0 +1,22 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +export * from "fs"; +export * as fs from "fs"; +>fs : Symbol(fs, Decl(index.ts, 2, 6)) + +=== tests/cases/conformance/node/index.ts === +// esm format file +export * from "fs"; +export * as fs from "fs"; +>fs : Symbol(fs, Decl(index.ts, 2, 6)) + +=== tests/cases/conformance/node/types.d.ts === +declare module "fs"; +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) + +declare module "tslib" { +>"tslib" : Symbol("tslib", Decl(types.d.ts, 0, 20)) + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node16).types b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node16).types new file mode 100644 index 00000000000..6a468baefa7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node16).types @@ -0,0 +1,22 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +export * from "fs"; +export * as fs from "fs"; +>fs : any + +=== tests/cases/conformance/node/index.ts === +// esm format file +export * from "fs"; +export * as fs from "fs"; +>fs : any + +=== tests/cases/conformance/node/types.d.ts === +declare module "fs"; +>"fs" : any + +declare module "tslib" { +>"tslib" : typeof import("tslib") + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node16).errors.txt new file mode 100644 index 00000000000..d511944f393 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node16).errors.txt @@ -0,0 +1,27 @@ +tests/cases/conformance/node/subfolder/index.ts(2,9): error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. + + +==== tests/cases/conformance/node/subfolder/index.ts (1 errors) ==== + // cjs format file + export {default} from "fs"; + ~~~~~~~ +!!! error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + export {default} from "fs"; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } +==== tests/cases/conformance/node/types.d.ts (0 errors) ==== + declare module "fs"; + declare module "tslib" { + export {}; + // intentionally missing all helpers + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node16).js b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node16).js new file mode 100644 index 00000000000..8abf8ba9ada --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node16).js @@ -0,0 +1,44 @@ +//// [tests/cases/conformance/node/nodeModulesImportHelpersCollisions3.ts] //// + +//// [index.ts] +// cjs format file +export {default} from "fs"; +//// [index.ts] +// esm format file +export {default} from "fs"; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} +//// [types.d.ts] +declare module "fs"; +declare module "tslib" { + export {}; + // intentionally missing all helpers +} + +//// [index.js] +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = void 0; +// cjs format file +var fs_1 = require("fs"); +Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(fs_1).default; } }); +//// [index.js] +// esm format file +export { default } from "fs"; + + +//// [index.d.ts] +export { default } from "fs"; +//// [index.d.ts] +export { default } from "fs"; diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node16).symbols b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node16).symbols new file mode 100644 index 00000000000..aec1d32dab1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node16).symbols @@ -0,0 +1,20 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +export {default} from "fs"; +>default : Symbol(default, Decl(index.ts, 1, 8)) + +=== tests/cases/conformance/node/index.ts === +// esm format file +export {default} from "fs"; +>default : Symbol(default, Decl(index.ts, 1, 8)) + +=== tests/cases/conformance/node/types.d.ts === +declare module "fs"; +>"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) + +declare module "tslib" { +>"tslib" : Symbol("tslib", Decl(types.d.ts, 0, 20)) + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node16).types b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node16).types new file mode 100644 index 00000000000..eef93356ac7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node16).types @@ -0,0 +1,20 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +export {default} from "fs"; +>default : any + +=== tests/cases/conformance/node/index.ts === +// esm format file +export {default} from "fs"; +>default : any + +=== tests/cases/conformance/node/types.d.ts === +declare module "fs"; +>"fs" : any + +declare module "tslib" { +>"tslib" : typeof import("tslib") + + export {}; + // intentionally missing all helpers +} diff --git a/tests/baselines/reference/nodeModulesImportMeta(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportMeta(module=node16).errors.txt new file mode 100644 index 00000000000..27f6e3c9e28 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportMeta(module=node16).errors.txt @@ -0,0 +1,23 @@ +tests/cases/conformance/node/subfolder/index.ts(2,11): error TS1470: The 'import.meta' meta-property is not allowed in files which will build into CommonJS output. + + +==== tests/cases/conformance/node/subfolder/index.ts (1 errors) ==== + // cjs format file + const x = import.meta.url; + ~~~~~~~~~~~ +!!! error TS1470: The 'import.meta' meta-property is not allowed in files which will build into CommonJS output. + export {x}; +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + const x = import.meta.url; + export {x}; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportMeta(module=node16).js b/tests/baselines/reference/nodeModulesImportMeta(module=node16).js new file mode 100644 index 00000000000..aa962a90bd3 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportMeta(module=node16).js @@ -0,0 +1,40 @@ +//// [tests/cases/conformance/node/nodeModulesImportMeta.ts] //// + +//// [index.ts] +// cjs format file +const x = import.meta.url; +export {x}; +//// [index.ts] +// esm format file +const x = import.meta.url; +export {x}; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = import.meta.url; +exports.x = x; +//// [index.js] +// esm format file +const x = import.meta.url; +export { x }; + + +//// [index.d.ts] +declare const x: string; +export { x }; +//// [index.d.ts] +declare const x: string; +export { x }; diff --git a/tests/baselines/reference/nodeModulesImportMeta(module=node16).symbols b/tests/baselines/reference/nodeModulesImportMeta(module=node16).symbols new file mode 100644 index 00000000000..4a9cda0f125 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportMeta(module=node16).symbols @@ -0,0 +1,24 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +const x = import.meta.url; +>x : Symbol(x, Decl(index.ts, 1, 5)) +>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) +>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) +>meta : Symbol(ImportMetaExpression.meta) +>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) + +export {x}; +>x : Symbol(x, Decl(index.ts, 2, 8)) + +=== tests/cases/conformance/node/index.ts === +// esm format file +const x = import.meta.url; +>x : Symbol(x, Decl(index.ts, 1, 5)) +>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) +>import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) +>meta : Symbol(ImportMetaExpression.meta) +>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) + +export {x}; +>x : Symbol(x, Decl(index.ts, 2, 8)) + diff --git a/tests/baselines/reference/nodeModulesImportMeta(module=node16).types b/tests/baselines/reference/nodeModulesImportMeta(module=node16).types new file mode 100644 index 00000000000..6f64dc2b5fa --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportMeta(module=node16).types @@ -0,0 +1,24 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +const x = import.meta.url; +>x : string +>import.meta.url : string +>import.meta : ImportMeta +>meta : any +>url : string + +export {x}; +>x : string + +=== tests/cases/conformance/node/index.ts === +// esm format file +const x = import.meta.url; +>x : string +>import.meta.url : string +>import.meta : ImportMeta +>meta : any +>url : string + +export {x}; +>x : string + diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).errors.txt new file mode 100644 index 00000000000..a8a76a05152 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).errors.txt @@ -0,0 +1,37 @@ +/index.ts(6,50): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +/index.ts(7,14): error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. +/index.ts(7,49): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + + +==== /index.ts (3 errors) ==== + import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; + import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + + export interface LocalInterface extends RequireInterface, ImportInterface {} + + import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~ +!!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + export interface Loc extends Req, Imp {} + + export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; + export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export interface ImportInterface {} +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export interface RequireInterface {} \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).js b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).js new file mode 100644 index 00000000000..1b8bc65976e --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).js @@ -0,0 +1,45 @@ +//// [tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit1.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} +//// [require.d.ts] +export interface RequireInterface {} +//// [index.ts] +import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + +export interface LocalInterface extends RequireInterface, ImportInterface {} + +import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; +import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; +export interface Loc extends Req, Imp {} + +export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [index.d.ts] +import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +export interface LocalInterface extends RequireInterface, ImportInterface { +} +import { type RequireInterface as Req } from "pkg" assert { "resolution-mode": "require" }; +import { type ImportInterface as Imp } from "pkg" assert { "resolution-mode": "import" }; +export interface Loc extends Req, Imp { +} +export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).symbols b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).symbols new file mode 100644 index 00000000000..e9a80972b95 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).symbols @@ -0,0 +1,38 @@ +=== /index.ts === +import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) + +import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) + +export interface LocalInterface extends RequireInterface, ImportInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 1, 82)) +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) + +import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) +>Req : Symbol(Req, Decl(index.ts, 5, 8)) + +import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; +>Imp : Symbol(Imp, Decl(index.ts, 6, 8)) + +export interface Loc extends Req, Imp {} +>Loc : Symbol(Loc, Decl(index.ts, 6, 87)) +>Req : Symbol(Req, Decl(index.ts, 5, 8)) +>Imp : Symbol(Imp, Decl(index.ts, 6, 8)) + +export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 9, 13)) + +export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 10, 13)) + +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).types b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).types new file mode 100644 index 00000000000..61190a772be --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).types @@ -0,0 +1,30 @@ +=== /index.ts === +import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : RequireInterface + +import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : ImportInterface + +export interface LocalInterface extends RequireInterface, ImportInterface {} + +import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : any +>Req : any + +import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : any +>Imp : any + +export interface Loc extends Req, Imp {} + +export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : RequireInterface + +export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : ImportInterface + +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +No type information for this code.=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).errors.txt new file mode 100644 index 00000000000..0403a6e026f --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).errors.txt @@ -0,0 +1,42 @@ +/index.ts(6,14): error TS2305: Module '"pkg"' has no exported member 'RequireInterface'. +/index.ts(6,50): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +/index.ts(7,49): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + + +==== /index.ts (3 errors) ==== + import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; + import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + + export interface LocalInterface extends RequireInterface, ImportInterface {} + + import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; + ~~~~~~~~~~~~~~~~ +!!! error TS2305: Module '"pkg"' has no exported member 'RequireInterface'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + export interface Loc extends Req, Imp {} + + export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; + export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export interface ImportInterface {} +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export interface RequireInterface {} +==== /package.json (0 errors) ==== + { + "private": true, + "type": "module" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).js b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).js new file mode 100644 index 00000000000..fad19d466a6 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).js @@ -0,0 +1,49 @@ +//// [tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit2.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} +//// [require.d.ts] +export interface RequireInterface {} +//// [package.json] +{ + "private": true, + "type": "module" +} +//// [index.ts] +import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + +export interface LocalInterface extends RequireInterface, ImportInterface {} + +import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; +import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; +export interface Loc extends Req, Imp {} + +export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + + +//// [index.js] +export {}; + + +//// [index.d.ts] +import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +export interface LocalInterface extends RequireInterface, ImportInterface { +} +import { type RequireInterface as Req } from "pkg" assert { "resolution-mode": "require" }; +import { type ImportInterface as Imp } from "pkg" assert { "resolution-mode": "import" }; +export interface Loc extends Req, Imp { +} +export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).symbols b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).symbols new file mode 100644 index 00000000000..fe172a1586e --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).symbols @@ -0,0 +1,38 @@ +=== /index.ts === +import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) + +import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) + +export interface LocalInterface extends RequireInterface, ImportInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 1, 82)) +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) + +import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; +>Req : Symbol(Req, Decl(index.ts, 5, 8)) + +import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) +>Imp : Symbol(Imp, Decl(index.ts, 6, 8)) + +export interface Loc extends Req, Imp {} +>Loc : Symbol(Loc, Decl(index.ts, 6, 87)) +>Req : Symbol(Req, Decl(index.ts, 5, 8)) +>Imp : Symbol(Imp, Decl(index.ts, 6, 8)) + +export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 9, 13)) + +export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 10, 13)) + +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).types b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).types new file mode 100644 index 00000000000..61190a772be --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).types @@ -0,0 +1,30 @@ +=== /index.ts === +import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : RequireInterface + +import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : ImportInterface + +export interface LocalInterface extends RequireInterface, ImportInterface {} + +import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : any +>Req : any + +import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : any +>Imp : any + +export interface Loc extends Req, Imp {} + +export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : RequireInterface + +export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : ImportInterface + +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +No type information for this code.=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).errors.txt new file mode 100644 index 00000000000..bc3eb30565c --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).errors.txt @@ -0,0 +1,43 @@ +/index.ts(2,45): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +/index.ts(2,73): error TS1453: `resolution-mode` should be either `require` or `import`. +/index.ts(4,10): error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. +/index.ts(4,39): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +/index.ts(6,76): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + + +==== /index.ts (5 errors) ==== + // incorrect mode + import type { RequireInterface } from "pkg" assert { "resolution-mode": "foobar" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + ~~~~~~~~ +!!! error TS1453: `resolution-mode` should be either `require` or `import`. + // not type-only + import { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~ +!!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + // not exclusively type-only + import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" assert { "resolution-mode": "require" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + + export interface LocalInterface extends RequireInterface, ImportInterface {} + + + + +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export interface ImportInterface {} +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export interface RequireInterface {} \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).js b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).js new file mode 100644 index 00000000000..3b2af2656d0 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).js @@ -0,0 +1,39 @@ +//// [tests/cases/conformance/node/nodeModulesImportModeDeclarationEmitErrors1.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} +//// [require.d.ts] +export interface RequireInterface {} +//// [index.ts] +// incorrect mode +import type { RequireInterface } from "pkg" assert { "resolution-mode": "foobar" }; +// not type-only +import { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +// not exclusively type-only +import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" assert { "resolution-mode": "require" }; + +export interface LocalInterface extends RequireInterface, ImportInterface {} + + + + + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [index.d.ts] +import type { RequireInterface } from "pkg"; +import { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +export interface LocalInterface extends RequireInterface, ImportInterface { +} diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).symbols b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).symbols new file mode 100644 index 00000000000..fd145783183 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).symbols @@ -0,0 +1,28 @@ +=== /index.ts === +// incorrect mode +import type { RequireInterface } from "pkg" assert { "resolution-mode": "foobar" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 1, 13)) + +// not type-only +import { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 3, 8)) + +// not exclusively type-only +import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) +>Req : Symbol(Req, Decl(index.ts, 5, 8)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) +>Req2 : Symbol(Req2, Decl(index.ts, 5, 37)) + +export interface LocalInterface extends RequireInterface, ImportInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 5, 115)) +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 1, 13)) +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 3, 8)) + + + + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).types b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).types new file mode 100644 index 00000000000..07bda5323db --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node16).types @@ -0,0 +1,24 @@ +=== /index.ts === +// incorrect mode +import type { RequireInterface } from "pkg" assert { "resolution-mode": "foobar" }; +>RequireInterface : RequireInterface + +// not type-only +import { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; +>ImportInterface : any + +// not exclusively type-only +import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" assert { "resolution-mode": "require" }; +>RequireInterface : any +>Req : any +>RequireInterface : any +>Req2 : any + +export interface LocalInterface extends RequireInterface, ImportInterface {} + + + + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node16).js b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node16).js new file mode 100644 index 00000000000..d9c0ba1a429 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node16).js @@ -0,0 +1,70 @@ +//// [tests/cases/conformance/node/nodeModulesImportResolutionIntoExport.ts] //// + +//// [index.ts] +// esm format file +import * as type from "#type"; +type; +//// [index.mts] +// esm format file +import * as type from "#type"; +type; +//// [index.cts] +// esm format file +import * as type from "#type"; +type; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": "./index.cjs", + "imports": { + "#type": "package" + } +} + +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// esm format file +const type = __importStar(require("#type")); +type; +//// [index.js] +// esm format file +import * as type from "#type"; +type; +//// [index.mjs] +// esm format file +import * as type from "#type"; +type; + + +//// [index.d.cts] +export {}; +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; diff --git a/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node16).symbols b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node16).symbols new file mode 100644 index 00000000000..1a0ad59fc81 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node16).symbols @@ -0,0 +1,24 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import * as type from "#type"; +>type : Symbol(type, Decl(index.ts, 1, 6)) + +type; +>type : Symbol(type, Decl(index.ts, 1, 6)) + +=== tests/cases/conformance/node/index.mts === +// esm format file +import * as type from "#type"; +>type : Symbol(type, Decl(index.mts, 1, 6)) + +type; +>type : Symbol(type, Decl(index.mts, 1, 6)) + +=== tests/cases/conformance/node/index.cts === +// esm format file +import * as type from "#type"; +>type : Symbol(type, Decl(index.cts, 1, 6)) + +type; +>type : Symbol(type, Decl(index.cts, 1, 6)) + diff --git a/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node16).types b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node16).types new file mode 100644 index 00000000000..cb05ede987e --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node16).types @@ -0,0 +1,24 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import * as type from "#type"; +>type : typeof type + +type; +>type : typeof type + +=== tests/cases/conformance/node/index.mts === +// esm format file +import * as type from "#type"; +>type : typeof type + +type; +>type : typeof type + +=== tests/cases/conformance/node/index.cts === +// esm format file +import * as type from "#type"; +>type : typeof type + +type; +>type : typeof type + diff --git a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node16).errors.txt new file mode 100644 index 00000000000..c73a7a7885f --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node16).errors.txt @@ -0,0 +1,33 @@ +tests/cases/conformance/node/index.cts(2,23): error TS2307: Cannot find module '#type' or its corresponding type declarations. +tests/cases/conformance/node/index.mts(2,23): error TS2307: Cannot find module '#type' or its corresponding type declarations. +tests/cases/conformance/node/index.ts(2,23): error TS2307: Cannot find module '#type' or its corresponding type declarations. + + +==== tests/cases/conformance/node/index.ts (1 errors) ==== + // esm format file + import * as type from "#type"; + ~~~~~~~ +!!! error TS2307: Cannot find module '#type' or its corresponding type declarations. + type; +==== tests/cases/conformance/node/index.mts (1 errors) ==== + // esm format file + import * as type from "#type"; + ~~~~~~~ +!!! error TS2307: Cannot find module '#type' or its corresponding type declarations. + type; +==== tests/cases/conformance/node/index.cts (1 errors) ==== + // esm format file + import * as type from "#type"; + ~~~~~~~ +!!! error TS2307: Cannot find module '#type' or its corresponding type declarations. + type; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": "package", + "imports": { + "#type": "package" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node16).js b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node16).js new file mode 100644 index 00000000000..a5ed511f6f5 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node16).js @@ -0,0 +1,70 @@ +//// [tests/cases/conformance/node/nodeModulesImportResolutionNoCycle.ts] //// + +//// [index.ts] +// esm format file +import * as type from "#type"; +type; +//// [index.mts] +// esm format file +import * as type from "#type"; +type; +//// [index.cts] +// esm format file +import * as type from "#type"; +type; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": "package", + "imports": { + "#type": "package" + } +} + +//// [index.js] +// esm format file +import * as type from "#type"; +type; +//// [index.mjs] +// esm format file +import * as type from "#type"; +type; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// esm format file +const type = __importStar(require("#type")); +type; + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node16).symbols b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node16).symbols new file mode 100644 index 00000000000..1a0ad59fc81 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node16).symbols @@ -0,0 +1,24 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import * as type from "#type"; +>type : Symbol(type, Decl(index.ts, 1, 6)) + +type; +>type : Symbol(type, Decl(index.ts, 1, 6)) + +=== tests/cases/conformance/node/index.mts === +// esm format file +import * as type from "#type"; +>type : Symbol(type, Decl(index.mts, 1, 6)) + +type; +>type : Symbol(type, Decl(index.mts, 1, 6)) + +=== tests/cases/conformance/node/index.cts === +// esm format file +import * as type from "#type"; +>type : Symbol(type, Decl(index.cts, 1, 6)) + +type; +>type : Symbol(type, Decl(index.cts, 1, 6)) + diff --git a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node16).types b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node16).types new file mode 100644 index 00000000000..8bfd3afd06e --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node16).types @@ -0,0 +1,24 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import * as type from "#type"; +>type : any + +type; +>type : any + +=== tests/cases/conformance/node/index.mts === +// esm format file +import * as type from "#type"; +>type : any + +type; +>type : any + +=== tests/cases/conformance/node/index.cts === +// esm format file +import * as type from "#type"; +>type : any + +type; +>type : any + diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).js b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).js new file mode 100644 index 00000000000..4a65e05cdd9 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).js @@ -0,0 +1,36 @@ +//// [tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmit1.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} +//// [require.d.ts] +export interface RequireInterface {} +//// [index.ts] +export type LocalInterface = + & import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface + & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface); +export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); + + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +exports.a = null; +exports.b = null; + + +//// [index.d.ts] +export declare type LocalInterface = import("pkg", { assert: { "resolution-mode": "require" } }).RequireInterface & import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; +export declare const a: import("pkg").RequireInterface; +export declare const b: import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).symbols b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).symbols new file mode 100644 index 00000000000..dd5d4527772 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).symbols @@ -0,0 +1,26 @@ +=== /index.ts === +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) + + & import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + + & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +export const a = (null as any as import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface); +>a : Symbol(a, Decl(index.ts, 4, 12)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); +>b : Symbol(b, Decl(index.ts, 5, 12)) +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).types b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).types new file mode 100644 index 00000000000..520761d1b0a --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).types @@ -0,0 +1,26 @@ +=== /index.ts === +export type LocalInterface = +>LocalInterface : import("/node_modules/pkg/require").RequireInterface & import("/node_modules/pkg/import").ImportInterface + + & import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface + & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface); +>a : import("/node_modules/pkg/require").RequireInterface +>(null as any as import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface +>null as any as import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface +>null as any : any +>null : null + +export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); +>b : import("/node_modules/pkg/import").ImportInterface +>(null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface) : import("/node_modules/pkg/import").ImportInterface +>null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface : import("/node_modules/pkg/import").ImportInterface +>null as any : any +>null : null + +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +No type information for this code.=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).errors.txt new file mode 100644 index 00000000000..b8b88af5ded --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).errors.txt @@ -0,0 +1,304 @@ +/index.ts(2,51): error TS1453: `resolution-mode` should be either `require` or `import`. +/index.ts(5,78): error TS1453: `resolution-mode` should be either `require` or `import`. +/other.ts(3,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other.ts(3,22): error TS1005: 'assert' expected. +/other.ts(3,39): error TS1005: ';' expected. +/other.ts(3,50): error TS1128: Declaration or statement expected. +/other.ts(3,51): error TS1128: Declaration or statement expected. +/other.ts(3,52): error TS1128: Declaration or statement expected. +/other.ts(3,53): error TS2304: Cannot find name 'RequireInterface'. +/other.ts(4,22): error TS2322: Type '{ "resolution-mode": string; }' is not assignable to type 'ImportCallOptions'. + Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'. +/other.ts(4,52): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. +/other.ts(6,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other.ts(6,49): error TS1005: 'assert' expected. +/other.ts(6,66): error TS1005: ';' expected. +/other.ts(6,77): error TS1128: Declaration or statement expected. +/other.ts(6,78): error TS1128: Declaration or statement expected. +/other.ts(6,79): error TS1128: Declaration or statement expected. +/other.ts(6,80): error TS1434: Unexpected keyword or identifier. +/other.ts(6,80): error TS2304: Cannot find name 'RequireInterface'. +/other.ts(6,96): error TS1128: Declaration or statement expected. +/other.ts(7,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other.ts(7,49): error TS1005: 'assert' expected. +/other.ts(7,66): error TS1005: ';' expected. +/other.ts(7,76): error TS1128: Declaration or statement expected. +/other.ts(7,77): error TS1128: Declaration or statement expected. +/other.ts(7,78): error TS1128: Declaration or statement expected. +/other.ts(7,79): error TS1434: Unexpected keyword or identifier. +/other.ts(7,79): error TS2304: Cannot find name 'ImportInterface'. +/other.ts(7,94): error TS1128: Declaration or statement expected. +/other2.ts(3,32): error TS1455: `resolution-mode` is the only valid key for type import assertions. +/other2.ts(4,32): error TS1455: `resolution-mode` is the only valid key for type import assertions. +/other2.ts(4,52): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. +/other2.ts(6,59): error TS1455: `resolution-mode` is the only valid key for type import assertions. +/other2.ts(7,59): error TS1455: `resolution-mode` is the only valid key for type import assertions. +/other2.ts(7,79): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. +/other3.ts(3,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other3.ts(3,21): error TS1005: '{' expected. +/other3.ts(3,23): error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. +/other3.ts(3,55): error TS1005: ';' expected. +/other3.ts(3,56): error TS1128: Declaration or statement expected. +/other3.ts(3,57): error TS2304: Cannot find name 'RequireInterface'. +/other3.ts(4,21): error TS2559: Type '{ "resolution-mode": string; }[]' has no properties in common with type 'ImportCallOptions'. +/other3.ts(4,56): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. +/other3.ts(6,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other3.ts(6,48): error TS1005: '{' expected. +/other3.ts(6,50): error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. +/other3.ts(6,100): error TS1005: ',' expected. +/other3.ts(7,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other3.ts(7,48): error TS1005: '{' expected. +/other3.ts(7,50): error TS2538: Type '{ "resolution-mode": "import"; }' cannot be used as an index type. +/other3.ts(7,98): error TS1005: ',' expected. +/other4.ts(6,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other4.ts(6,21): error TS1005: '{' expected. +/other4.ts(6,21): error TS2448: Block-scoped variable 'Asserts1' used before its declaration. +/other4.ts(6,29): error TS1128: Declaration or statement expected. +/other4.ts(6,30): error TS1128: Declaration or statement expected. +/other4.ts(6,31): error TS2448: Block-scoped variable 'RequireInterface' used before its declaration. +/other4.ts(7,21): error TS2448: Block-scoped variable 'Asserts2' used before its declaration. +/other4.ts(7,31): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. +/other4.ts(9,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other4.ts(9,48): error TS1005: '{' expected. +/other4.ts(9,56): error TS1005: ',' expected. +/other4.ts(9,57): error TS1134: Variable declaration expected. +/other4.ts(9,74): error TS1005: ',' expected. +/other4.ts(10,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other4.ts(10,48): error TS1005: '{' expected. +/other4.ts(10,56): error TS1005: ',' expected. +/other4.ts(10,57): error TS1134: Variable declaration expected. +/other4.ts(10,73): error TS1005: ',' expected. +/other5.ts(2,31): error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. +/other5.ts(3,31): error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. +/other5.ts(3,37): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. +/other5.ts(5,58): error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. +/other5.ts(6,58): error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. +/other5.ts(6,64): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. + + +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export interface ImportInterface {} +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export interface RequireInterface {} +==== /index.ts (2 errors) ==== + export type LocalInterface = + & import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface + ~~~~~~~~ +!!! error TS1453: `resolution-mode` should be either `require` or `import`. + & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; + + export const a = (null as any as import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface); + ~~~~~~~~ +!!! error TS1453: `resolution-mode` should be either `require` or `import`. + export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); +==== /other.ts (27 errors) ==== + // missing assert: + export type LocalInterface = + & import("pkg", {"resolution-mode": "require"}).RequireInterface + ~~~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~~~~~~~~ +!!! error TS1005: 'assert' expected. +!!! related TS1007 /other.ts:3:21: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'RequireInterface'. + & import("pkg", {"resolution-mode": "import"}).ImportInterface; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type '{ "resolution-mode": string; }' is not assignable to type 'ImportCallOptions'. +!!! error TS2322: Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'. + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. + + export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); + ~~~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~~~~~~~~ +!!! error TS1005: 'assert' expected. +!!! related TS1007 /other.ts:6:48: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~~ +!!! error TS1434: Unexpected keyword or identifier. + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'RequireInterface'. + ~ +!!! error TS1128: Declaration or statement expected. + export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); + ~~~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~~~~~~~~ +!!! error TS1005: 'assert' expected. +!!! related TS1007 /other.ts:7:48: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~ +!!! error TS1434: Unexpected keyword or identifier. + ~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'ImportInterface'. + ~ +!!! error TS1128: Declaration or statement expected. +==== /other2.ts (6 errors) ==== + // wrong assertion key + export type LocalInterface = + & import("pkg", { assert: {"bad": "require"} }).RequireInterface + ~~~~~ +!!! error TS1455: `resolution-mode` is the only valid key for type import assertions. + & import("pkg", { assert: {"bad": "import"} }).ImportInterface; + ~~~~~ +!!! error TS1455: `resolution-mode` is the only valid key for type import assertions. + ~~~~~~~~~~~~~~~ +!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. + + export const a = (null as any as import("pkg", { assert: {"bad": "require"} }).RequireInterface); + ~~~~~ +!!! error TS1455: `resolution-mode` is the only valid key for type import assertions. + export const b = (null as any as import("pkg", { assert: {"bad": "import"} }).ImportInterface); + ~~~~~ +!!! error TS1455: `resolution-mode` is the only valid key for type import assertions. + ~~~~~~~~~~~~~~~ +!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. +==== /other3.ts (16 errors) ==== + // Array instead of object-y thing + export type LocalInterface = + & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other3.ts:3:21: The parser expected to find a '}' to match the '{' token here. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'RequireInterface'. + & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2559: Type '{ "resolution-mode": string; }[]' has no properties in common with type 'ImportCallOptions'. + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. + + export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other3.ts:6:48: The parser expected to find a '}' to match the '{' token here. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. + ~ +!!! error TS1005: ',' expected. + export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other3.ts:7:48: The parser expected to find a '}' to match the '{' token here. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2538: Type '{ "resolution-mode": "import"; }' cannot be used as an index type. + ~ +!!! error TS1005: ',' expected. +==== /other4.ts (18 errors) ==== + // Indirected assertion objecty-thing - not allowed + type Asserts1 = { assert: {"resolution-mode": "require"} }; + type Asserts2 = { assert: {"resolution-mode": "import"} }; + + export type LocalInterface = + & import("pkg", Asserts1).RequireInterface + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other4.ts:6:21: The parser expected to find a '}' to match the '{' token here. + ~~~~~~~~ +!!! error TS2448: Block-scoped variable 'Asserts1' used before its declaration. +!!! related TS2728 /other4.ts:9:48: 'Asserts1' is declared here. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~~ +!!! error TS2448: Block-scoped variable 'RequireInterface' used before its declaration. +!!! related TS2728 /other4.ts:9:58: 'RequireInterface' is declared here. + & import("pkg", Asserts2).ImportInterface; + ~~~~~~~~ +!!! error TS2448: Block-scoped variable 'Asserts2' used before its declaration. +!!! related TS2728 /other4.ts:10:48: 'Asserts2' is declared here. + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. + + export const a = (null as any as import("pkg", Asserts1).RequireInterface); + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other4.ts:9:48: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1134: Variable declaration expected. + ~ +!!! error TS1005: ',' expected. + export const b = (null as any as import("pkg", Asserts2).ImportInterface); + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other4.ts:10:48: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1134: Variable declaration expected. + ~ +!!! error TS1005: ',' expected. +==== /other5.ts (6 errors) ==== + export type LocalInterface = + & import("pkg", { assert: {} }).RequireInterface + ~~ +!!! error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. + & import("pkg", { assert: {} }).ImportInterface; + ~~ +!!! error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. + ~~~~~~~~~~~~~~~ +!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. + + export const a = (null as any as import("pkg", { assert: {} }).RequireInterface); + ~~ +!!! error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. + export const b = (null as any as import("pkg", { assert: {} }).ImportInterface); + ~~ +!!! error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. + ~~~~~~~~~~~~~~~ +!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. + \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).js b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).js new file mode 100644 index 00000000000..7fd0aff8e8f --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).js @@ -0,0 +1,147 @@ +//// [tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmitErrors1.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} +//// [require.d.ts] +export interface RequireInterface {} +//// [index.ts] +export type LocalInterface = + & import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface + & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface); +export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); +//// [other.ts] +// missing assert: +export type LocalInterface = + & import("pkg", {"resolution-mode": "require"}).RequireInterface + & import("pkg", {"resolution-mode": "import"}).ImportInterface; + +export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); +export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); +//// [other2.ts] +// wrong assertion key +export type LocalInterface = + & import("pkg", { assert: {"bad": "require"} }).RequireInterface + & import("pkg", { assert: {"bad": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { assert: {"bad": "require"} }).RequireInterface); +export const b = (null as any as import("pkg", { assert: {"bad": "import"} }).ImportInterface); +//// [other3.ts] +// Array instead of object-y thing +export type LocalInterface = + & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface + & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; + +export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); +export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); +//// [other4.ts] +// Indirected assertion objecty-thing - not allowed +type Asserts1 = { assert: {"resolution-mode": "require"} }; +type Asserts2 = { assert: {"resolution-mode": "import"} }; + +export type LocalInterface = + & import("pkg", Asserts1).RequireInterface + & import("pkg", Asserts2).ImportInterface; + +export const a = (null as any as import("pkg", Asserts1).RequireInterface); +export const b = (null as any as import("pkg", Asserts2).ImportInterface); +//// [other5.ts] +export type LocalInterface = + & import("pkg", { assert: {} }).RequireInterface + & import("pkg", { assert: {} }).ImportInterface; + +export const a = (null as any as import("pkg", { assert: {} }).RequireInterface); +export const b = (null as any as import("pkg", { assert: {} }).ImportInterface); + + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +exports.a = null; +exports.b = null; +//// [other.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +"resolution-mode"; +"require"; +RequireInterface + & import("pkg", { "resolution-mode": "import" }).ImportInterface; +exports.a = null; +"resolution-mode"; +"require"; +RequireInterface; +; +exports.b = null; +"resolution-mode"; +"import"; +ImportInterface; +; +//// [other2.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +exports.a = null; +exports.b = null; +//// [other3.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +RequireInterface + & import("pkg", [{ "resolution-mode": "import" }]).ImportInterface; +exports.a = null.RequireInterface; +exports.b = null.ImportInterface; +//// [other4.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ImportInterface = exports.Asserts2 = exports.b = exports.RequireInterface = exports.Asserts1 = exports.a = void 0; +exports.Asserts1; +exports.RequireInterface + & import("pkg", exports.Asserts2).ImportInterface; +exports.a = null; +exports.b = null; +//// [other5.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +exports.a = null; +exports.b = null; + + +//// [index.d.ts] +export declare type LocalInterface = import("pkg", { assert: { "resolution-mode": "foobar" } }).RequireInterface & import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; +export declare const a: import("pkg").RequireInterface; +export declare const b: import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; +//// [other.d.ts] +export declare type LocalInterface = import("pkg", { assert: {} }); +export declare const a: any; +export declare const b: any; +//// [other2.d.ts] +export declare type LocalInterface = import("pkg", { assert: { "bad": "require" } }).RequireInterface & import("pkg", { assert: { "bad": "import" } }).ImportInterface; +export declare const a: import("pkg").RequireInterface; +export declare const b: any; +//// [other3.d.ts] +export declare type LocalInterface = import("pkg", { assert: {} })[{ + "resolution-mode": "require"; +}]; +export declare const a: any; +export declare const b: any; +//// [other4.d.ts] +export declare type LocalInterface = import("pkg", { assert: {} }); +export declare const a: any, Asserts1: any, RequireInterface: any; +export declare const b: any, Asserts2: any, ImportInterface: any; +//// [other5.d.ts] +export declare type LocalInterface = import("pkg", { assert: {} }).RequireInterface & import("pkg", { assert: {} }).ImportInterface; +export declare const a: import("pkg").RequireInterface; +export declare const b: any; diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).symbols b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).symbols new file mode 100644 index 00000000000..71b67ec81d6 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).symbols @@ -0,0 +1,128 @@ +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +=== /index.ts === +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) + + & import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + + & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +export const a = (null as any as import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface); +>a : Symbol(a, Decl(index.ts, 4, 12)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); +>b : Symbol(b, Decl(index.ts, 5, 12)) +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /other.ts === +// missing assert: +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other.ts, 0, 0)) + + & import("pkg", {"resolution-mode": "require"}).RequireInterface + & import("pkg", {"resolution-mode": "import"}).ImportInterface; +>"pkg" : Symbol("/node_modules/pkg/import", Decl(import.d.ts, 0, 0)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other.ts, 3, 21)) + +export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); +>a : Symbol(a, Decl(other.ts, 5, 12)) + +export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); +>b : Symbol(b, Decl(other.ts, 6, 12)) + +=== /other2.ts === +// wrong assertion key +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other2.ts, 0, 0)) + + & import("pkg", { assert: {"bad": "require"} }).RequireInterface +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + + & import("pkg", { assert: {"bad": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { assert: {"bad": "require"} }).RequireInterface); +>a : Symbol(a, Decl(other2.ts, 5, 12)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +export const b = (null as any as import("pkg", { assert: {"bad": "import"} }).ImportInterface); +>b : Symbol(b, Decl(other2.ts, 6, 12)) + +=== /other3.ts === +// Array instead of object-y thing +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other3.ts, 0, 0)) + + & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface +>"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 2, 23)) + + & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; +>"pkg" : Symbol("/node_modules/pkg/import", Decl(import.d.ts, 0, 0)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 3, 23)) + +export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); +>a : Symbol(a, Decl(other3.ts, 5, 12)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 5, 50)) + +export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); +>b : Symbol(b, Decl(other3.ts, 6, 12)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 6, 50)) + +=== /other4.ts === +// Indirected assertion objecty-thing - not allowed +type Asserts1 = { assert: {"resolution-mode": "require"} }; +>Asserts1 : Symbol(Asserts1, Decl(other4.ts, 0, 0), Decl(other4.ts, 8, 46)) +>assert : Symbol(assert, Decl(other4.ts, 1, 17)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other4.ts, 1, 27)) + +type Asserts2 = { assert: {"resolution-mode": "import"} }; +>Asserts2 : Symbol(Asserts2, Decl(other4.ts, 1, 59), Decl(other4.ts, 9, 46)) +>assert : Symbol(assert, Decl(other4.ts, 2, 17)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other4.ts, 2, 27)) + +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other4.ts, 2, 58)) + + & import("pkg", Asserts1).RequireInterface +>Asserts1 : Symbol(Asserts1, Decl(other4.ts, 8, 46)) +>RequireInterface : Symbol(RequireInterface, Decl(other4.ts, 8, 57)) + + & import("pkg", Asserts2).ImportInterface; +>"pkg" : Symbol("/node_modules/pkg/import", Decl(import.d.ts, 0, 0)) +>Asserts2 : Symbol(Asserts2, Decl(other4.ts, 9, 46)) + +export const a = (null as any as import("pkg", Asserts1).RequireInterface); +>a : Symbol(a, Decl(other4.ts, 8, 12)) +>Asserts1 : Symbol(Asserts1, Decl(other4.ts, 8, 46)) +>RequireInterface : Symbol(RequireInterface, Decl(other4.ts, 8, 57)) + +export const b = (null as any as import("pkg", Asserts2).ImportInterface); +>b : Symbol(b, Decl(other4.ts, 9, 12)) +>Asserts2 : Symbol(Asserts2, Decl(other4.ts, 9, 46)) +>ImportInterface : Symbol(ImportInterface, Decl(other4.ts, 9, 57)) + +=== /other5.ts === +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other5.ts, 0, 0)) + + & import("pkg", { assert: {} }).RequireInterface +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + + & import("pkg", { assert: {} }).ImportInterface; + +export const a = (null as any as import("pkg", { assert: {} }).RequireInterface); +>a : Symbol(a, Decl(other5.ts, 4, 12)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +export const b = (null as any as import("pkg", { assert: {} }).ImportInterface); +>b : Symbol(b, Decl(other5.ts, 5, 12)) + diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).types b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).types new file mode 100644 index 00000000000..1b75c0fff24 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).types @@ -0,0 +1,193 @@ +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +No type information for this code.=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +No type information for this code.=== /index.ts === +export type LocalInterface = +>LocalInterface : import("/node_modules/pkg/require").RequireInterface & import("/node_modules/pkg/import").ImportInterface + + & import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface + & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface); +>a : import("/node_modules/pkg/require").RequireInterface +>(null as any as import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface +>null as any as import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface +>null as any : any +>null : null + +export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); +>b : import("/node_modules/pkg/import").ImportInterface +>(null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface) : import("/node_modules/pkg/import").ImportInterface +>null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface : import("/node_modules/pkg/import").ImportInterface +>null as any : any +>null : null + +=== /other.ts === +// missing assert: +export type LocalInterface = +>LocalInterface : any + + & import("pkg", {"resolution-mode": "require"}).RequireInterface +>"resolution-mode" : "resolution-mode" +>"require" : "require" +>RequireInterface & import("pkg", {"resolution-mode": "import"}).ImportInterface : number +>RequireInterface : any + + & import("pkg", {"resolution-mode": "import"}).ImportInterface; +>import("pkg", {"resolution-mode": "import"}).ImportInterface : any +>import("pkg", {"resolution-mode": "import"}) : Promise<{ default: typeof import("/node_modules/pkg/import"); }> +>"pkg" : "pkg" +>{"resolution-mode": "import"} : { "resolution-mode": string; } +>"resolution-mode" : string +>"import" : "import" +>ImportInterface : any + +export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); +>a : any +>(null as any as import("pkg", { : any +>null as any as import("pkg", { : any +>null as any : any +>null : null +>"resolution-mode" : "resolution-mode" +>"require" : "require" +>RequireInterface : any + +export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); +>b : any +>(null as any as import("pkg", { : any +>null as any as import("pkg", { : any +>null as any : any +>null : null +>"resolution-mode" : "resolution-mode" +>"import" : "import" +>ImportInterface : any + +=== /other2.ts === +// wrong assertion key +export type LocalInterface = +>LocalInterface : any + + & import("pkg", { assert: {"bad": "require"} }).RequireInterface + & import("pkg", { assert: {"bad": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { assert: {"bad": "require"} }).RequireInterface); +>a : import("/node_modules/pkg/require").RequireInterface +>(null as any as import("pkg", { assert: {"bad": "require"} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface +>null as any as import("pkg", { assert: {"bad": "require"} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface +>null as any : any +>null : null + +export const b = (null as any as import("pkg", { assert: {"bad": "import"} }).ImportInterface); +>b : any +>(null as any as import("pkg", { assert: {"bad": "import"} }).ImportInterface) : any +>null as any as import("pkg", { assert: {"bad": "import"} }).ImportInterface : any +>null as any : any +>null : null + +=== /other3.ts === +// Array instead of object-y thing +export type LocalInterface = +>LocalInterface : any + + & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface +>"resolution-mode" : "require" +>RequireInterface & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface : number +>RequireInterface : any + + & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; +>import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface : any +>import("pkg", [ {"resolution-mode": "import"} ]) : Promise<{ default: typeof import("/node_modules/pkg/import"); }> +>"pkg" : "pkg" +>[ {"resolution-mode": "import"} ] : { "resolution-mode": string; }[] +>{"resolution-mode": "import"} : { "resolution-mode": string; } +>"resolution-mode" : string +>"import" : "import" +>ImportInterface : any + +export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); +>a : any +>(null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface : any +>(null as any as import("pkg", [ {"resolution-mode": "require"} ]) : any +>null as any as import("pkg", [ {"resolution-mode": "require"} ] : any +>null as any : any +>null : null +>"resolution-mode" : "require" +>RequireInterface : any + +export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); +>b : any +>(null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface : any +>(null as any as import("pkg", [ {"resolution-mode": "import"} ]) : any +>null as any as import("pkg", [ {"resolution-mode": "import"} ] : any +>null as any : any +>null : null +>"resolution-mode" : "import" +>ImportInterface : any + +=== /other4.ts === +// Indirected assertion objecty-thing - not allowed +type Asserts1 = { assert: {"resolution-mode": "require"} }; +>Asserts1 : { assert: { "resolution-mode": "require";}; } +>assert : { "resolution-mode": "require"; } +>"resolution-mode" : "require" + +type Asserts2 = { assert: {"resolution-mode": "import"} }; +>Asserts2 : { assert: { "resolution-mode": "import";}; } +>assert : { "resolution-mode": "import"; } +>"resolution-mode" : "import" + +export type LocalInterface = +>LocalInterface : any + + & import("pkg", Asserts1).RequireInterface +>Asserts1 : any +>RequireInterface & import("pkg", Asserts2).ImportInterface : number +>RequireInterface : any + + & import("pkg", Asserts2).ImportInterface; +>import("pkg", Asserts2).ImportInterface : any +>import("pkg", Asserts2) : Promise<{ default: typeof import("/node_modules/pkg/import"); }> +>"pkg" : "pkg" +>Asserts2 : any +>ImportInterface : any + +export const a = (null as any as import("pkg", Asserts1).RequireInterface); +>a : any +>(null as any as import("pkg", : any +>null as any as import("pkg", : any +>null as any : any +>null : null +>Asserts1 : any +>RequireInterface : any + +export const b = (null as any as import("pkg", Asserts2).ImportInterface); +>b : any +>(null as any as import("pkg", : any +>null as any as import("pkg", : any +>null as any : any +>null : null +>Asserts2 : any +>ImportInterface : any + +=== /other5.ts === +export type LocalInterface = +>LocalInterface : any + + & import("pkg", { assert: {} }).RequireInterface + & import("pkg", { assert: {} }).ImportInterface; + +export const a = (null as any as import("pkg", { assert: {} }).RequireInterface); +>a : import("/node_modules/pkg/require").RequireInterface +>(null as any as import("pkg", { assert: {} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface +>null as any as import("pkg", { assert: {} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface +>null as any : any +>null : null + +export const b = (null as any as import("pkg", { assert: {} }).ImportInterface); +>b : any +>(null as any as import("pkg", { assert: {} }).ImportInterface) : any +>null as any as import("pkg", { assert: {} }).ImportInterface : any +>null as any : any +>null : null + diff --git a/tests/baselines/reference/nodeModulesPackageExports(module=node16).errors.txt b/tests/baselines/reference/nodeModulesPackageExports(module=node16).errors.txt new file mode 100644 index 00000000000..464db33f319 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageExports(module=node16).errors.txt @@ -0,0 +1,107 @@ +tests/cases/conformance/node/index.cts(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.cts(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.cts(9,23): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/node_modules/inner/index.d.cts(3,22): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. +tests/cases/conformance/node/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + + +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + cjs; + mjs; + type; + import * as cjsi from "inner/cjs"; + import * as mjsi from "inner/mjs"; + import * as typei from "inner"; + cjsi; + mjsi; + typei; +==== tests/cases/conformance/node/index.mts (0 errors) ==== + // esm format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + import * as type from "package"; + cjs; + mjs; + type; + import * as cjsi from "inner/cjs"; + import * as mjsi from "inner/mjs"; + import * as typei from "inner"; + cjsi; + mjsi; + typei; +==== tests/cases/conformance/node/index.cts (3 errors) ==== + // cjs format file + import * as cjs from "package/cjs"; + import * as mjs from "package/mjs"; + ~~~~~~~~~~~~~ +!!! error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as type from "package"; + ~~~~~~~~~ +!!! error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + cjs; + mjs; + type; + import * as cjsi from "inner/cjs"; + import * as mjsi from "inner/mjs"; + ~~~~~~~~~~~ +!!! error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as typei from "inner"; + cjsi; + mjsi; + typei; +==== tests/cases/conformance/node/node_modules/inner/index.d.ts (2 errors) ==== + // cjs format file + import * as cjs from "inner/cjs"; + ~~~ +!!! error TS2303: Circular definition of import alias 'cjs'. + import * as mjs from "inner/mjs"; + ~~~~~~~~~~~ +!!! error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as type from "inner"; + export { cjs }; + export { mjs }; + export { type }; +==== tests/cases/conformance/node/node_modules/inner/index.d.mts (0 errors) ==== + // esm format file + import * as cjs from "inner/cjs"; + import * as mjs from "inner/mjs"; + import * as type from "inner"; + export { cjs }; + export { mjs }; + export { type }; +==== tests/cases/conformance/node/node_modules/inner/index.d.cts (1 errors) ==== + // cjs format file + import * as cjs from "inner/cjs"; + import * as mjs from "inner/mjs"; + ~~~~~~~~~~~ +!!! error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as type from "inner"; + export { cjs }; + export { mjs }; + export { type }; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } + } +==== tests/cases/conformance/node/node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesPackageExports(module=node16).js b/tests/baselines/reference/nodeModulesPackageExports(module=node16).js new file mode 100644 index 00000000000..d974207d7b4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageExports(module=node16).js @@ -0,0 +1,165 @@ +//// [tests/cases/conformance/node/nodeModulesPackageExports.ts] //// + +//// [index.ts] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +cjsi; +mjsi; +typei; +//// [index.mts] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +cjsi; +mjsi; +typei; +//// [index.cts] +// cjs format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +cjsi; +mjsi; +typei; +//// [index.d.ts] +// cjs format file +import * as cjs from "inner/cjs"; +import * as mjs from "inner/mjs"; +import * as type from "inner"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.mts] +// esm format file +import * as cjs from "inner/cjs"; +import * as mjs from "inner/mjs"; +import * as type from "inner"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.cts] +// cjs format file +import * as cjs from "inner/cjs"; +import * as mjs from "inner/mjs"; +import * as type from "inner"; +export { cjs }; +export { mjs }; +export { type }; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } +} +//// [package.json] +{ + "name": "inner", + "private": true, + "exports": { + "./cjs": "./index.cjs", + "./mjs": "./index.mjs", + ".": "./index.js" + } +} + +//// [index.mjs] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +cjsi; +mjsi; +typei; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const cjs = __importStar(require("package/cjs")); +const mjs = __importStar(require("package/mjs")); +const type = __importStar(require("package")); +cjs; +mjs; +type; +const cjsi = __importStar(require("inner/cjs")); +const mjsi = __importStar(require("inner/mjs")); +const typei = __importStar(require("inner")); +cjsi; +mjsi; +typei; +//// [index.js] +// esm format file +import * as cjs from "package/cjs"; +import * as mjs from "package/mjs"; +import * as type from "package"; +cjs; +mjs; +type; +import * as cjsi from "inner/cjs"; +import * as mjsi from "inner/mjs"; +import * as typei from "inner"; +cjsi; +mjsi; +typei; + + +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; +//// [index.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesPackageExports(module=node16).symbols b/tests/baselines/reference/nodeModulesPackageExports(module=node16).symbols new file mode 100644 index 00000000000..0a2a74496f4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageExports(module=node16).symbols @@ -0,0 +1,174 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.ts, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.ts, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.ts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.ts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.ts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.ts, 3, 6)) + +import * as cjsi from "inner/cjs"; +>cjsi : Symbol(cjsi, Decl(index.ts, 7, 6)) + +import * as mjsi from "inner/mjs"; +>mjsi : Symbol(mjsi, Decl(index.ts, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.ts, 9, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.ts, 7, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.ts, 8, 6)) + +typei; +>typei : Symbol(typei, Decl(index.ts, 9, 6)) + +=== tests/cases/conformance/node/index.mts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.mts, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.mts, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.mts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.mts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.mts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.mts, 3, 6)) + +import * as cjsi from "inner/cjs"; +>cjsi : Symbol(cjsi, Decl(index.mts, 7, 6)) + +import * as mjsi from "inner/mjs"; +>mjsi : Symbol(mjsi, Decl(index.mts, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.mts, 9, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.mts, 7, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.mts, 8, 6)) + +typei; +>typei : Symbol(typei, Decl(index.mts, 9, 6)) + +=== tests/cases/conformance/node/index.cts === +// cjs format file +import * as cjs from "package/cjs"; +>cjs : Symbol(cjs, Decl(index.cts, 1, 6)) + +import * as mjs from "package/mjs"; +>mjs : Symbol(mjs, Decl(index.cts, 2, 6)) + +import * as type from "package"; +>type : Symbol(type, Decl(index.cts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.cts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.cts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.cts, 3, 6)) + +import * as cjsi from "inner/cjs"; +>cjsi : Symbol(cjsi, Decl(index.cts, 7, 6)) + +import * as mjsi from "inner/mjs"; +>mjsi : Symbol(mjsi, Decl(index.cts, 8, 6)) + +import * as typei from "inner"; +>typei : Symbol(typei, Decl(index.cts, 9, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.cts, 7, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.cts, 8, 6)) + +typei; +>typei : Symbol(typei, Decl(index.cts, 9, 6)) + +=== tests/cases/conformance/node/node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) + +import * as mjs from "inner/mjs"; +>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.ts, 3, 6)) + +export { cjs }; +>cjs : Symbol(mjs.cjs.cjs.type.cjs, Decl(index.d.ts, 4, 8)) + +export { mjs }; +>mjs : Symbol(mjs.cjs.cjs.type.mjs, Decl(index.d.ts, 5, 8)) + +export { type }; +>type : Symbol(mjs.cjs.cjs.type.type, Decl(index.d.ts, 6, 8)) + +=== tests/cases/conformance/node/node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs"; +>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) + +import * as mjs from "inner/mjs"; +>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.mts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs.mjs.cjs, Decl(index.d.mts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.cjs.mjs.mjs, Decl(index.d.mts, 5, 8)) + +export { type }; +>type : Symbol(cjs.cjs.mjs.type, Decl(index.d.mts, 6, 8)) + +=== tests/cases/conformance/node/node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) + +import * as mjs from "inner/mjs"; +>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) + +import * as type from "inner"; +>type : Symbol(type, Decl(index.d.cts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs, Decl(index.d.cts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.mjs, Decl(index.d.cts, 5, 8)) + +export { type }; +>type : Symbol(cjs.type, Decl(index.d.cts, 6, 8)) + diff --git a/tests/baselines/reference/nodeModulesPackageExports(module=node16).types b/tests/baselines/reference/nodeModulesPackageExports(module=node16).types new file mode 100644 index 00000000000..8d3dcec7235 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageExports(module=node16).types @@ -0,0 +1,174 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs + +import * as mjs from "package/mjs"; +>mjs : typeof mjs + +import * as type from "package"; +>type : typeof type + +cjs; +>cjs : typeof cjs + +mjs; +>mjs : typeof mjs + +type; +>type : typeof type + +import * as cjsi from "inner/cjs"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/mjs"; +>mjsi : typeof cjsi.cjs.mjs + +import * as typei from "inner"; +>typei : typeof typei + +cjsi; +>cjsi : typeof cjsi + +mjsi; +>mjsi : typeof cjsi.cjs.mjs + +typei; +>typei : typeof typei + +=== tests/cases/conformance/node/index.mts === +// esm format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs + +import * as mjs from "package/mjs"; +>mjs : typeof mjs + +import * as type from "package"; +>type : typeof type + +cjs; +>cjs : typeof cjs + +mjs; +>mjs : typeof mjs + +type; +>type : typeof type + +import * as cjsi from "inner/cjs"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/mjs"; +>mjsi : typeof cjsi.cjs.mjs + +import * as typei from "inner"; +>typei : typeof typei + +cjsi; +>cjsi : typeof cjsi + +mjsi; +>mjsi : typeof cjsi.cjs.mjs + +typei; +>typei : typeof typei + +=== tests/cases/conformance/node/index.cts === +// cjs format file +import * as cjs from "package/cjs"; +>cjs : typeof cjs + +import * as mjs from "package/mjs"; +>mjs : typeof mjs + +import * as type from "package"; +>type : typeof type + +cjs; +>cjs : typeof cjs + +mjs; +>mjs : typeof mjs + +type; +>type : typeof type + +import * as cjsi from "inner/cjs"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/mjs"; +>mjsi : typeof cjsi.mjs + +import * as typei from "inner"; +>typei : typeof cjsi.mjs.cjs.type + +cjsi; +>cjsi : typeof cjsi + +mjsi; +>mjsi : typeof cjsi.mjs + +typei; +>typei : typeof cjsi.mjs.cjs.type + +=== tests/cases/conformance/node/node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : any + +import * as mjs from "inner/mjs"; +>mjs : typeof mjs + +import * as type from "inner"; +>type : typeof mjs.cjs.cjs.type + +export { cjs }; +>cjs : any + +export { mjs }; +>mjs : typeof mjs + +export { type }; +>type : typeof mjs.cjs.cjs.type + +=== tests/cases/conformance/node/node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs"; +>cjs : typeof cjs + +import * as mjs from "inner/mjs"; +>mjs : typeof cjs.cjs.mjs + +import * as type from "inner"; +>type : typeof cjs.cjs.mjs.type + +export { cjs }; +>cjs : typeof cjs + +export { mjs }; +>mjs : typeof cjs.cjs.mjs + +export { type }; +>type : typeof cjs.cjs.mjs.type + +=== tests/cases/conformance/node/node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs"; +>cjs : typeof cjs + +import * as mjs from "inner/mjs"; +>mjs : typeof cjs.mjs + +import * as type from "inner"; +>type : typeof cjs.mjs.cjs.type + +export { cjs }; +>cjs : typeof cjs + +export { mjs }; +>mjs : typeof cjs.mjs + +export { type }; +>type : typeof cjs.mjs.cjs.type + diff --git a/tests/baselines/reference/nodeModulesPackageImports(module=node16).errors.txt b/tests/baselines/reference/nodeModulesPackageImports(module=node16).errors.txt new file mode 100644 index 00000000000..cc174f1eb7e --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageImports(module=node16).errors.txt @@ -0,0 +1,44 @@ +tests/cases/conformance/node/index.cts(3,22): error TS1471: Module '#mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/index.cts(4,23): error TS1471: Module '#type' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + + +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + import * as cjs from "#cjs"; + import * as mjs from "#mjs"; + import * as type from "#type"; + cjs; + mjs; + type; +==== tests/cases/conformance/node/index.mts (0 errors) ==== + // esm format file + import * as cjs from "#cjs"; + import * as mjs from "#mjs"; + import * as type from "#type"; + cjs; + mjs; + type; +==== tests/cases/conformance/node/index.cts (2 errors) ==== + // esm format file + import * as cjs from "#cjs"; + import * as mjs from "#mjs"; + ~~~~~~ +!!! error TS1471: Module '#mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as type from "#type"; + ~~~~~~~ +!!! error TS1471: Module '#type' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + cjs; + mjs; + type; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js", + "imports": { + "#cjs": "./index.cjs", + "#mjs": "./index.mjs", + "#type": "./index.js" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesPackageImports(module=node16).js b/tests/baselines/reference/nodeModulesPackageImports(module=node16).js new file mode 100644 index 00000000000..fb612b6c2fd --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageImports(module=node16).js @@ -0,0 +1,96 @@ +//// [tests/cases/conformance/node/nodeModulesPackageImports.ts] //// + +//// [index.ts] +// esm format file +import * as cjs from "#cjs"; +import * as mjs from "#mjs"; +import * as type from "#type"; +cjs; +mjs; +type; +//// [index.mts] +// esm format file +import * as cjs from "#cjs"; +import * as mjs from "#mjs"; +import * as type from "#type"; +cjs; +mjs; +type; +//// [index.cts] +// esm format file +import * as cjs from "#cjs"; +import * as mjs from "#mjs"; +import * as type from "#type"; +cjs; +mjs; +type; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js", + "imports": { + "#cjs": "./index.cjs", + "#mjs": "./index.mjs", + "#type": "./index.js" + } +} + +//// [index.mjs] +// esm format file +import * as cjs from "#cjs"; +import * as mjs from "#mjs"; +import * as type from "#type"; +cjs; +mjs; +type; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// esm format file +const cjs = __importStar(require("#cjs")); +const mjs = __importStar(require("#mjs")); +const type = __importStar(require("#type")); +cjs; +mjs; +type; +//// [index.js] +// esm format file +import * as cjs from "#cjs"; +import * as mjs from "#mjs"; +import * as type from "#type"; +cjs; +mjs; +type; + + +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; +//// [index.d.ts] +export {}; diff --git a/tests/baselines/reference/nodeModulesPackageImports(module=node16).symbols b/tests/baselines/reference/nodeModulesPackageImports(module=node16).symbols new file mode 100644 index 00000000000..2a0fece7237 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageImports(module=node16).symbols @@ -0,0 +1,60 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import * as cjs from "#cjs"; +>cjs : Symbol(cjs, Decl(index.ts, 1, 6)) + +import * as mjs from "#mjs"; +>mjs : Symbol(mjs, Decl(index.ts, 2, 6)) + +import * as type from "#type"; +>type : Symbol(type, Decl(index.ts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.ts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.ts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.ts, 3, 6)) + +=== tests/cases/conformance/node/index.mts === +// esm format file +import * as cjs from "#cjs"; +>cjs : Symbol(cjs, Decl(index.mts, 1, 6)) + +import * as mjs from "#mjs"; +>mjs : Symbol(mjs, Decl(index.mts, 2, 6)) + +import * as type from "#type"; +>type : Symbol(type, Decl(index.mts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.mts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.mts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.mts, 3, 6)) + +=== tests/cases/conformance/node/index.cts === +// esm format file +import * as cjs from "#cjs"; +>cjs : Symbol(cjs, Decl(index.cts, 1, 6)) + +import * as mjs from "#mjs"; +>mjs : Symbol(mjs, Decl(index.cts, 2, 6)) + +import * as type from "#type"; +>type : Symbol(type, Decl(index.cts, 3, 6)) + +cjs; +>cjs : Symbol(cjs, Decl(index.cts, 1, 6)) + +mjs; +>mjs : Symbol(mjs, Decl(index.cts, 2, 6)) + +type; +>type : Symbol(type, Decl(index.cts, 3, 6)) + diff --git a/tests/baselines/reference/nodeModulesPackageImports(module=node16).types b/tests/baselines/reference/nodeModulesPackageImports(module=node16).types new file mode 100644 index 00000000000..b4ade055923 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackageImports(module=node16).types @@ -0,0 +1,60 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import * as cjs from "#cjs"; +>cjs : typeof cjs + +import * as mjs from "#mjs"; +>mjs : typeof mjs + +import * as type from "#type"; +>type : typeof type + +cjs; +>cjs : typeof cjs + +mjs; +>mjs : typeof mjs + +type; +>type : typeof type + +=== tests/cases/conformance/node/index.mts === +// esm format file +import * as cjs from "#cjs"; +>cjs : typeof cjs + +import * as mjs from "#mjs"; +>mjs : typeof mjs + +import * as type from "#type"; +>type : typeof type + +cjs; +>cjs : typeof cjs + +mjs; +>mjs : typeof mjs + +type; +>type : typeof type + +=== tests/cases/conformance/node/index.cts === +// esm format file +import * as cjs from "#cjs"; +>cjs : typeof cjs + +import * as mjs from "#mjs"; +>mjs : typeof mjs + +import * as type from "#type"; +>type : typeof type + +cjs; +>cjs : typeof cjs + +mjs; +>mjs : typeof mjs + +type; +>type : typeof type + diff --git a/tests/baselines/reference/nodeModulesPackagePatternExports(module=node16).errors.txt b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node16).errors.txt new file mode 100644 index 00000000000..0dc3774d5ef --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node16).errors.txt @@ -0,0 +1,78 @@ +tests/cases/conformance/node/index.cts(3,23): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/node_modules/inner/index.d.cts(3,22): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. +tests/cases/conformance/node/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + + +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + import * as cjsi from "inner/cjs/index"; + import * as mjsi from "inner/mjs/index"; + import * as typei from "inner/js/index"; + cjsi; + mjsi; + typei; +==== tests/cases/conformance/node/index.mts (0 errors) ==== + // esm format file + import * as cjsi from "inner/cjs/index"; + import * as mjsi from "inner/mjs/index"; + import * as typei from "inner/js/index"; + cjsi; + mjsi; + typei; +==== tests/cases/conformance/node/index.cts (1 errors) ==== + // cjs format file + import * as cjsi from "inner/cjs/index"; + import * as mjsi from "inner/mjs/index"; + ~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as typei from "inner/js/index"; + cjsi; + mjsi; + typei; +==== tests/cases/conformance/node/node_modules/inner/index.d.ts (2 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/index"; + ~~~ +!!! error TS2303: Circular definition of import alias 'cjs'. + import * as mjs from "inner/mjs/index"; + ~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as type from "inner/js/index"; + export { cjs }; + export { mjs }; + export { type }; +==== tests/cases/conformance/node/node_modules/inner/index.d.mts (0 errors) ==== + // esm format file + import * as cjs from "inner/cjs/index"; + import * as mjs from "inner/mjs/index"; + import * as type from "inner/js/index"; + export { cjs }; + export { mjs }; + export { type }; +==== tests/cases/conformance/node/node_modules/inner/index.d.cts (1 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/index"; + import * as mjs from "inner/mjs/index"; + ~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as type from "inner/js/index"; + export { cjs }; + export { mjs }; + export { type }; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + } +==== tests/cases/conformance/node/node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "exports": { + "./cjs/*": "./*.cjs", + "./mjs/*": "./*.mjs", + "./js/*": "./*.js" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesPackagePatternExports(module=node16).js b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node16).js new file mode 100644 index 00000000000..cef593a4246 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node16).js @@ -0,0 +1,124 @@ +//// [tests/cases/conformance/node/nodeModulesPackagePatternExports.ts] //// + +//// [index.ts] +// esm format file +import * as cjsi from "inner/cjs/index"; +import * as mjsi from "inner/mjs/index"; +import * as typei from "inner/js/index"; +cjsi; +mjsi; +typei; +//// [index.mts] +// esm format file +import * as cjsi from "inner/cjs/index"; +import * as mjsi from "inner/mjs/index"; +import * as typei from "inner/js/index"; +cjsi; +mjsi; +typei; +//// [index.cts] +// cjs format file +import * as cjsi from "inner/cjs/index"; +import * as mjsi from "inner/mjs/index"; +import * as typei from "inner/js/index"; +cjsi; +mjsi; +typei; +//// [index.d.ts] +// cjs format file +import * as cjs from "inner/cjs/index"; +import * as mjs from "inner/mjs/index"; +import * as type from "inner/js/index"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.mts] +// esm format file +import * as cjs from "inner/cjs/index"; +import * as mjs from "inner/mjs/index"; +import * as type from "inner/js/index"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.cts] +// cjs format file +import * as cjs from "inner/cjs/index"; +import * as mjs from "inner/mjs/index"; +import * as type from "inner/js/index"; +export { cjs }; +export { mjs }; +export { type }; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", +} +//// [package.json] +{ + "name": "inner", + "private": true, + "exports": { + "./cjs/*": "./*.cjs", + "./mjs/*": "./*.mjs", + "./js/*": "./*.js" + } +} + +//// [index.js] +// esm format file +import * as cjsi from "inner/cjs/index"; +import * as mjsi from "inner/mjs/index"; +import * as typei from "inner/js/index"; +cjsi; +mjsi; +typei; +//// [index.mjs] +// esm format file +import * as cjsi from "inner/cjs/index"; +import * as mjsi from "inner/mjs/index"; +import * as typei from "inner/js/index"; +cjsi; +mjsi; +typei; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const cjsi = __importStar(require("inner/cjs/index")); +const mjsi = __importStar(require("inner/mjs/index")); +const typei = __importStar(require("inner/js/index")); +cjsi; +mjsi; +typei; + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodeModulesPackagePatternExports(module=node16).symbols b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node16).symbols new file mode 100644 index 00000000000..c9823ad5c6c --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node16).symbols @@ -0,0 +1,120 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import * as cjsi from "inner/cjs/index"; +>cjsi : Symbol(cjsi, Decl(index.ts, 1, 6)) + +import * as mjsi from "inner/mjs/index"; +>mjsi : Symbol(mjsi, Decl(index.ts, 2, 6)) + +import * as typei from "inner/js/index"; +>typei : Symbol(typei, Decl(index.ts, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.ts, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.ts, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.ts, 3, 6)) + +=== tests/cases/conformance/node/index.mts === +// esm format file +import * as cjsi from "inner/cjs/index"; +>cjsi : Symbol(cjsi, Decl(index.mts, 1, 6)) + +import * as mjsi from "inner/mjs/index"; +>mjsi : Symbol(mjsi, Decl(index.mts, 2, 6)) + +import * as typei from "inner/js/index"; +>typei : Symbol(typei, Decl(index.mts, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.mts, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.mts, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.mts, 3, 6)) + +=== tests/cases/conformance/node/index.cts === +// cjs format file +import * as cjsi from "inner/cjs/index"; +>cjsi : Symbol(cjsi, Decl(index.cts, 1, 6)) + +import * as mjsi from "inner/mjs/index"; +>mjsi : Symbol(mjsi, Decl(index.cts, 2, 6)) + +import * as typei from "inner/js/index"; +>typei : Symbol(typei, Decl(index.cts, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.cts, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.cts, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.cts, 3, 6)) + +=== tests/cases/conformance/node/node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs/index"; +>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) + +import * as mjs from "inner/mjs/index"; +>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) + +import * as type from "inner/js/index"; +>type : Symbol(type, Decl(index.d.ts, 3, 6)) + +export { cjs }; +>cjs : Symbol(mjs.cjs.cjs.type.cjs, Decl(index.d.ts, 4, 8)) + +export { mjs }; +>mjs : Symbol(mjs.cjs.cjs.type.mjs, Decl(index.d.ts, 5, 8)) + +export { type }; +>type : Symbol(mjs.cjs.cjs.type.type, Decl(index.d.ts, 6, 8)) + +=== tests/cases/conformance/node/node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs/index"; +>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) + +import * as mjs from "inner/mjs/index"; +>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) + +import * as type from "inner/js/index"; +>type : Symbol(type, Decl(index.d.mts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs.mjs.cjs, Decl(index.d.mts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.cjs.mjs.mjs, Decl(index.d.mts, 5, 8)) + +export { type }; +>type : Symbol(cjs.cjs.mjs.type, Decl(index.d.mts, 6, 8)) + +=== tests/cases/conformance/node/node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs/index"; +>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) + +import * as mjs from "inner/mjs/index"; +>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) + +import * as type from "inner/js/index"; +>type : Symbol(type, Decl(index.d.cts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs, Decl(index.d.cts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.mjs, Decl(index.d.cts, 5, 8)) + +export { type }; +>type : Symbol(cjs.type, Decl(index.d.cts, 6, 8)) + diff --git a/tests/baselines/reference/nodeModulesPackagePatternExports(module=node16).types b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node16).types new file mode 100644 index 00000000000..3ebdb118fd9 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node16).types @@ -0,0 +1,120 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import * as cjsi from "inner/cjs/index"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/mjs/index"; +>mjsi : typeof cjsi.cjs.mjs + +import * as typei from "inner/js/index"; +>typei : typeof typei + +cjsi; +>cjsi : typeof cjsi + +mjsi; +>mjsi : typeof cjsi.cjs.mjs + +typei; +>typei : typeof typei + +=== tests/cases/conformance/node/index.mts === +// esm format file +import * as cjsi from "inner/cjs/index"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/mjs/index"; +>mjsi : typeof cjsi.cjs.mjs + +import * as typei from "inner/js/index"; +>typei : typeof typei + +cjsi; +>cjsi : typeof cjsi + +mjsi; +>mjsi : typeof cjsi.cjs.mjs + +typei; +>typei : typeof typei + +=== tests/cases/conformance/node/index.cts === +// cjs format file +import * as cjsi from "inner/cjs/index"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/mjs/index"; +>mjsi : typeof cjsi.mjs + +import * as typei from "inner/js/index"; +>typei : typeof cjsi.mjs.cjs.type + +cjsi; +>cjsi : typeof cjsi + +mjsi; +>mjsi : typeof cjsi.mjs + +typei; +>typei : typeof cjsi.mjs.cjs.type + +=== tests/cases/conformance/node/node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs/index"; +>cjs : any + +import * as mjs from "inner/mjs/index"; +>mjs : typeof mjs + +import * as type from "inner/js/index"; +>type : typeof mjs.cjs.cjs.type + +export { cjs }; +>cjs : any + +export { mjs }; +>mjs : typeof mjs + +export { type }; +>type : typeof mjs.cjs.cjs.type + +=== tests/cases/conformance/node/node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs/index"; +>cjs : typeof cjs + +import * as mjs from "inner/mjs/index"; +>mjs : typeof cjs.cjs.mjs + +import * as type from "inner/js/index"; +>type : typeof cjs.cjs.mjs.type + +export { cjs }; +>cjs : typeof cjs + +export { mjs }; +>mjs : typeof cjs.cjs.mjs + +export { type }; +>type : typeof cjs.cjs.mjs.type + +=== tests/cases/conformance/node/node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs/index"; +>cjs : typeof cjs + +import * as mjs from "inner/mjs/index"; +>mjs : typeof cjs.mjs + +import * as type from "inner/js/index"; +>type : typeof cjs.mjs.cjs.type + +export { cjs }; +>cjs : typeof cjs + +export { mjs }; +>mjs : typeof cjs.mjs + +export { type }; +>type : typeof cjs.mjs.cjs.type + diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).errors.txt b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).errors.txt new file mode 100644 index 00000000000..9aa041ab418 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).errors.txt @@ -0,0 +1,78 @@ +tests/cases/conformance/node/index.cts(3,23): error TS1471: Module 'inner/mjs/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/node_modules/inner/index.d.cts(3,22): error TS1471: Module 'inner/mjs/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. +tests/cases/conformance/node/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + + +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + import * as cjsi from "inner/cjs/index.cjs"; + import * as mjsi from "inner/mjs/index.mjs"; + import * as typei from "inner/js/index.js"; + cjsi; + mjsi; + typei; +==== tests/cases/conformance/node/index.mts (0 errors) ==== + // esm format file + import * as cjsi from "inner/cjs/index.cjs"; + import * as mjsi from "inner/mjs/index.mjs"; + import * as typei from "inner/js/index.js"; + cjsi; + mjsi; + typei; +==== tests/cases/conformance/node/index.cts (1 errors) ==== + // cjs format file + import * as cjsi from "inner/cjs/index.cjs"; + import * as mjsi from "inner/mjs/index.mjs"; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module 'inner/mjs/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as typei from "inner/js/index.js"; + cjsi; + mjsi; + typei; +==== tests/cases/conformance/node/node_modules/inner/index.d.ts (2 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/index.cjs"; + ~~~ +!!! error TS2303: Circular definition of import alias 'cjs'. + import * as mjs from "inner/mjs/index.mjs"; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module 'inner/mjs/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as type from "inner/js/index.js"; + export { cjs }; + export { mjs }; + export { type }; +==== tests/cases/conformance/node/node_modules/inner/index.d.mts (0 errors) ==== + // esm format file + import * as cjs from "inner/cjs/index.cjs"; + import * as mjs from "inner/mjs/index.mjs"; + import * as type from "inner/js/index.js"; + export { cjs }; + export { mjs }; + export { type }; +==== tests/cases/conformance/node/node_modules/inner/index.d.cts (1 errors) ==== + // cjs format file + import * as cjs from "inner/cjs/index.cjs"; + import * as mjs from "inner/mjs/index.mjs"; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1471: Module 'inner/mjs/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import * as type from "inner/js/index.js"; + export { cjs }; + export { mjs }; + export { type }; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + } +==== tests/cases/conformance/node/node_modules/inner/package.json (0 errors) ==== + { + "name": "inner", + "private": true, + "exports": { + "./cjs/*.cjs": "./*.cjs", + "./mjs/*.mjs": "./*.mjs", + "./js/*.js": "./*.js" + } + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).js b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).js new file mode 100644 index 00000000000..62c5b115698 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).js @@ -0,0 +1,124 @@ +//// [tests/cases/conformance/node/nodeModulesPackagePatternExportsTrailers.ts] //// + +//// [index.ts] +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +import * as mjsi from "inner/mjs/index.mjs"; +import * as typei from "inner/js/index.js"; +cjsi; +mjsi; +typei; +//// [index.mts] +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +import * as mjsi from "inner/mjs/index.mjs"; +import * as typei from "inner/js/index.js"; +cjsi; +mjsi; +typei; +//// [index.cts] +// cjs format file +import * as cjsi from "inner/cjs/index.cjs"; +import * as mjsi from "inner/mjs/index.mjs"; +import * as typei from "inner/js/index.js"; +cjsi; +mjsi; +typei; +//// [index.d.ts] +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +import * as mjs from "inner/mjs/index.mjs"; +import * as type from "inner/js/index.js"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.mts] +// esm format file +import * as cjs from "inner/cjs/index.cjs"; +import * as mjs from "inner/mjs/index.mjs"; +import * as type from "inner/js/index.js"; +export { cjs }; +export { mjs }; +export { type }; +//// [index.d.cts] +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +import * as mjs from "inner/mjs/index.mjs"; +import * as type from "inner/js/index.js"; +export { cjs }; +export { mjs }; +export { type }; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", +} +//// [package.json] +{ + "name": "inner", + "private": true, + "exports": { + "./cjs/*.cjs": "./*.cjs", + "./mjs/*.mjs": "./*.mjs", + "./js/*.js": "./*.js" + } +} + +//// [index.js] +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +import * as mjsi from "inner/mjs/index.mjs"; +import * as typei from "inner/js/index.js"; +cjsi; +mjsi; +typei; +//// [index.mjs] +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +import * as mjsi from "inner/mjs/index.mjs"; +import * as typei from "inner/js/index.js"; +cjsi; +mjsi; +typei; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const cjsi = __importStar(require("inner/cjs/index.cjs")); +const mjsi = __importStar(require("inner/mjs/index.mjs")); +const typei = __importStar(require("inner/js/index.js")); +cjsi; +mjsi; +typei; + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).symbols b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).symbols new file mode 100644 index 00000000000..59394e7d56d --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).symbols @@ -0,0 +1,120 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : Symbol(cjsi, Decl(index.ts, 1, 6)) + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : Symbol(mjsi, Decl(index.ts, 2, 6)) + +import * as typei from "inner/js/index.js"; +>typei : Symbol(typei, Decl(index.ts, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.ts, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.ts, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.ts, 3, 6)) + +=== tests/cases/conformance/node/index.mts === +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : Symbol(cjsi, Decl(index.mts, 1, 6)) + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : Symbol(mjsi, Decl(index.mts, 2, 6)) + +import * as typei from "inner/js/index.js"; +>typei : Symbol(typei, Decl(index.mts, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.mts, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.mts, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.mts, 3, 6)) + +=== tests/cases/conformance/node/index.cts === +// cjs format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : Symbol(cjsi, Decl(index.cts, 1, 6)) + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : Symbol(mjsi, Decl(index.cts, 2, 6)) + +import * as typei from "inner/js/index.js"; +>typei : Symbol(typei, Decl(index.cts, 3, 6)) + +cjsi; +>cjsi : Symbol(cjsi, Decl(index.cts, 1, 6)) + +mjsi; +>mjsi : Symbol(mjsi, Decl(index.cts, 2, 6)) + +typei; +>typei : Symbol(typei, Decl(index.cts, 3, 6)) + +=== tests/cases/conformance/node/node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) + +import * as type from "inner/js/index.js"; +>type : Symbol(type, Decl(index.d.ts, 3, 6)) + +export { cjs }; +>cjs : Symbol(mjs.cjs.cjs.type.cjs, Decl(index.d.ts, 4, 8)) + +export { mjs }; +>mjs : Symbol(mjs.cjs.cjs.type.mjs, Decl(index.d.ts, 5, 8)) + +export { type }; +>type : Symbol(mjs.cjs.cjs.type.type, Decl(index.d.ts, 6, 8)) + +=== tests/cases/conformance/node/node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) + +import * as type from "inner/js/index.js"; +>type : Symbol(type, Decl(index.d.mts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs.mjs.cjs, Decl(index.d.mts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.cjs.mjs.mjs, Decl(index.d.mts, 5, 8)) + +export { type }; +>type : Symbol(cjs.cjs.mjs.type, Decl(index.d.mts, 6, 8)) + +=== tests/cases/conformance/node/node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) + +import * as type from "inner/js/index.js"; +>type : Symbol(type, Decl(index.d.cts, 3, 6)) + +export { cjs }; +>cjs : Symbol(cjs.cjs, Decl(index.d.cts, 4, 8)) + +export { mjs }; +>mjs : Symbol(cjs.mjs, Decl(index.d.cts, 5, 8)) + +export { type }; +>type : Symbol(cjs.type, Decl(index.d.cts, 6, 8)) + diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).types b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).types new file mode 100644 index 00000000000..f72f1247699 --- /dev/null +++ b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node16).types @@ -0,0 +1,120 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : typeof cjsi.cjs.mjs + +import * as typei from "inner/js/index.js"; +>typei : typeof typei + +cjsi; +>cjsi : typeof cjsi + +mjsi; +>mjsi : typeof cjsi.cjs.mjs + +typei; +>typei : typeof typei + +=== tests/cases/conformance/node/index.mts === +// esm format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : typeof cjsi.cjs.mjs + +import * as typei from "inner/js/index.js"; +>typei : typeof typei + +cjsi; +>cjsi : typeof cjsi + +mjsi; +>mjsi : typeof cjsi.cjs.mjs + +typei; +>typei : typeof typei + +=== tests/cases/conformance/node/index.cts === +// cjs format file +import * as cjsi from "inner/cjs/index.cjs"; +>cjsi : typeof cjsi + +import * as mjsi from "inner/mjs/index.mjs"; +>mjsi : typeof cjsi.mjs + +import * as typei from "inner/js/index.js"; +>typei : typeof cjsi.mjs.cjs.type + +cjsi; +>cjsi : typeof cjsi + +mjsi; +>mjsi : typeof cjsi.mjs + +typei; +>typei : typeof cjsi.mjs.cjs.type + +=== tests/cases/conformance/node/node_modules/inner/index.d.ts === +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : any + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : typeof mjs + +import * as type from "inner/js/index.js"; +>type : typeof mjs.cjs.cjs.type + +export { cjs }; +>cjs : any + +export { mjs }; +>mjs : typeof mjs + +export { type }; +>type : typeof mjs.cjs.cjs.type + +=== tests/cases/conformance/node/node_modules/inner/index.d.mts === +// esm format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : typeof cjs + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : typeof cjs.cjs.mjs + +import * as type from "inner/js/index.js"; +>type : typeof cjs.cjs.mjs.type + +export { cjs }; +>cjs : typeof cjs + +export { mjs }; +>mjs : typeof cjs.cjs.mjs + +export { type }; +>type : typeof cjs.cjs.mjs.type + +=== tests/cases/conformance/node/node_modules/inner/index.d.cts === +// cjs format file +import * as cjs from "inner/cjs/index.cjs"; +>cjs : typeof cjs + +import * as mjs from "inner/mjs/index.mjs"; +>mjs : typeof cjs.mjs + +import * as type from "inner/js/index.js"; +>type : typeof cjs.mjs.cjs.type + +export { cjs }; +>cjs : typeof cjs + +export { mjs }; +>mjs : typeof cjs.mjs + +export { type }; +>type : typeof cjs.mjs.cjs.type + diff --git a/tests/baselines/reference/nodeModulesResolveJsonModule(module=node16).js b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node16).js new file mode 100644 index 00000000000..c349cb78a0f --- /dev/null +++ b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node16).js @@ -0,0 +1,120 @@ +//// [tests/cases/conformance/node/nodeModulesResolveJsonModule.ts] //// + +//// [index.ts] +import pkg from "./package.json" +export const name = pkg.name; +import * as ns from "./package.json"; +export const thing = ns; +export const name2 = ns.default.name; +//// [index.cts] +import pkg from "./package.json" +export const name = pkg.name; +import * as ns from "./package.json"; +export const thing = ns; +export const name2 = ns.default.name; +//// [index.mts] +import pkg from "./package.json" +export const name = pkg.name; +import * as ns from "./package.json"; +export const thing = ns; +export const name2 = ns.default.name; +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "type": "module", + "default": "misedirection" +} + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "type": "module", + "default": "misedirection" +} +//// [index.js] +import pkg from "./package.json"; +export const name = pkg.name; +import * as ns from "./package.json"; +export const thing = ns; +export const name2 = ns.default.name; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.name2 = exports.thing = exports.name = void 0; +const package_json_1 = __importDefault(require("./package.json")); +exports.name = package_json_1.default.name; +const ns = __importStar(require("./package.json")); +exports.thing = ns; +exports.name2 = ns.default.name; +//// [index.mjs] +import pkg from "./package.json"; +export const name = pkg.name; +import * as ns from "./package.json"; +export const thing = ns; +export const name2 = ns.default.name; + + +//// [index.d.ts] +export declare const name: string; +export declare const thing: { + default: { + name: string; + version: string; + type: string; + default: string; + }; +}; +export declare const name2: string; +//// [index.d.cts] +export declare const name: string; +export declare const thing: { + default: { + name: string; + version: string; + type: string; + default: string; + }; + name: string; + version: string; + type: string; +}; +export declare const name2: string; +//// [index.d.mts] +export declare const name: string; +export declare const thing: { + default: { + name: string; + version: string; + type: string; + default: string; + }; +}; +export declare const name2: string; diff --git a/tests/baselines/reference/nodeModulesResolveJsonModule(module=node16).symbols b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node16).symbols new file mode 100644 index 00000000000..f1927c68996 --- /dev/null +++ b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node16).symbols @@ -0,0 +1,89 @@ +=== tests/cases/conformance/node/index.ts === +import pkg from "./package.json" +>pkg : Symbol(pkg, Decl(index.ts, 0, 6)) + +export const name = pkg.name; +>name : Symbol(name, Decl(index.ts, 1, 12)) +>pkg.name : Symbol("name", Decl(package.json, 0, 1)) +>pkg : Symbol(pkg, Decl(index.ts, 0, 6)) +>name : Symbol("name", Decl(package.json, 0, 1)) + +import * as ns from "./package.json"; +>ns : Symbol(ns, Decl(index.ts, 2, 6)) + +export const thing = ns; +>thing : Symbol(thing, Decl(index.ts, 3, 12)) +>ns : Symbol(ns, Decl(index.ts, 2, 6)) + +export const name2 = ns.default.name; +>name2 : Symbol(name2, Decl(index.ts, 4, 12)) +>ns.default.name : Symbol("name", Decl(package.json, 0, 1)) +>ns.default : Symbol("tests/cases/conformance/node/package") +>ns : Symbol(ns, Decl(index.ts, 2, 6)) +>default : Symbol("tests/cases/conformance/node/package") +>name : Symbol("name", Decl(package.json, 0, 1)) + +=== tests/cases/conformance/node/index.cts === +import pkg from "./package.json" +>pkg : Symbol(pkg, Decl(index.cts, 0, 6)) + +export const name = pkg.name; +>name : Symbol(name, Decl(index.cts, 1, 12)) +>pkg.name : Symbol("name", Decl(package.json, 0, 1)) +>pkg : Symbol(pkg, Decl(index.cts, 0, 6)) +>name : Symbol("name", Decl(package.json, 0, 1)) + +import * as ns from "./package.json"; +>ns : Symbol(ns, Decl(index.cts, 2, 6)) + +export const thing = ns; +>thing : Symbol(thing, Decl(index.cts, 3, 12)) +>ns : Symbol(ns, Decl(index.cts, 2, 6)) + +export const name2 = ns.default.name; +>name2 : Symbol(name2, Decl(index.cts, 4, 12)) +>ns.default.name : Symbol("name", Decl(package.json, 0, 1)) +>ns.default : Symbol("tests/cases/conformance/node/package") +>ns : Symbol(ns, Decl(index.cts, 2, 6)) +>default : Symbol("tests/cases/conformance/node/package") +>name : Symbol("name", Decl(package.json, 0, 1)) + +=== tests/cases/conformance/node/index.mts === +import pkg from "./package.json" +>pkg : Symbol(pkg, Decl(index.mts, 0, 6)) + +export const name = pkg.name; +>name : Symbol(name, Decl(index.mts, 1, 12)) +>pkg.name : Symbol("name", Decl(package.json, 0, 1)) +>pkg : Symbol(pkg, Decl(index.mts, 0, 6)) +>name : Symbol("name", Decl(package.json, 0, 1)) + +import * as ns from "./package.json"; +>ns : Symbol(ns, Decl(index.mts, 2, 6)) + +export const thing = ns; +>thing : Symbol(thing, Decl(index.mts, 3, 12)) +>ns : Symbol(ns, Decl(index.mts, 2, 6)) + +export const name2 = ns.default.name; +>name2 : Symbol(name2, Decl(index.mts, 4, 12)) +>ns.default.name : Symbol("name", Decl(package.json, 0, 1)) +>ns.default : Symbol("tests/cases/conformance/node/package") +>ns : Symbol(ns, Decl(index.mts, 2, 6)) +>default : Symbol("tests/cases/conformance/node/package") +>name : Symbol("name", Decl(package.json, 0, 1)) + +=== tests/cases/conformance/node/package.json === +{ + "name": "pkg", +>"name" : Symbol("name", Decl(package.json, 0, 1)) + + "version": "0.0.1", +>"version" : Symbol("version", Decl(package.json, 1, 18)) + + "type": "module", +>"type" : Symbol("type", Decl(package.json, 2, 23)) + + "default": "misedirection" +>"default" : Symbol("default", Decl(package.json, 3, 21)) +} diff --git a/tests/baselines/reference/nodeModulesResolveJsonModule(module=node16).types b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node16).types new file mode 100644 index 00000000000..f6ad83e1754 --- /dev/null +++ b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node16).types @@ -0,0 +1,95 @@ +=== tests/cases/conformance/node/index.ts === +import pkg from "./package.json" +>pkg : { name: string; version: string; type: string; default: string; } + +export const name = pkg.name; +>name : string +>pkg.name : string +>pkg : { name: string; version: string; type: string; default: string; } +>name : string + +import * as ns from "./package.json"; +>ns : { default: { name: string; version: string; type: string; default: string; }; } + +export const thing = ns; +>thing : { default: { name: string; version: string; type: string; default: string; }; } +>ns : { default: { name: string; version: string; type: string; default: string; }; } + +export const name2 = ns.default.name; +>name2 : string +>ns.default.name : string +>ns.default : { name: string; version: string; type: string; default: string; } +>ns : { default: { name: string; version: string; type: string; default: string; }; } +>default : { name: string; version: string; type: string; default: string; } +>name : string + +=== tests/cases/conformance/node/index.cts === +import pkg from "./package.json" +>pkg : { name: string; version: string; type: string; default: string; } + +export const name = pkg.name; +>name : string +>pkg.name : string +>pkg : { name: string; version: string; type: string; default: string; } +>name : string + +import * as ns from "./package.json"; +>ns : { default: { name: string; version: string; type: string; default: string; }; name: string; version: string; type: string; } + +export const thing = ns; +>thing : { default: { name: string; version: string; type: string; default: string; }; name: string; version: string; type: string; } +>ns : { default: { name: string; version: string; type: string; default: string; }; name: string; version: string; type: string; } + +export const name2 = ns.default.name; +>name2 : string +>ns.default.name : string +>ns.default : { name: string; version: string; type: string; default: string; } +>ns : { default: { name: string; version: string; type: string; default: string; }; name: string; version: string; type: string; } +>default : { name: string; version: string; type: string; default: string; } +>name : string + +=== tests/cases/conformance/node/index.mts === +import pkg from "./package.json" +>pkg : { name: string; version: string; type: string; default: string; } + +export const name = pkg.name; +>name : string +>pkg.name : string +>pkg : { name: string; version: string; type: string; default: string; } +>name : string + +import * as ns from "./package.json"; +>ns : { default: { name: string; version: string; type: string; default: string; }; } + +export const thing = ns; +>thing : { default: { name: string; version: string; type: string; default: string; }; } +>ns : { default: { name: string; version: string; type: string; default: string; }; } + +export const name2 = ns.default.name; +>name2 : string +>ns.default.name : string +>ns.default : { name: string; version: string; type: string; default: string; } +>ns : { default: { name: string; version: string; type: string; default: string; }; } +>default : { name: string; version: string; type: string; default: string; } +>name : string + +=== tests/cases/conformance/node/package.json === +{ +>{ "name": "pkg", "version": "0.0.1", "type": "module", "default": "misedirection"} : { name: string; version: string; type: string; default: string; } + + "name": "pkg", +>"name" : string +>"pkg" : "pkg" + + "version": "0.0.1", +>"version" : string +>"0.0.1" : "0.0.1" + + "type": "module", +>"type" : string +>"module" : "module" + + "default": "misedirection" +>"default" : string +>"misedirection" : "misedirection" +} diff --git a/tests/baselines/reference/nodeModulesResolveJsonModule(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesResolveJsonModule(module=nodenext).errors.txt deleted file mode 100644 index 4200a11e7ba..00000000000 --- a/tests/baselines/reference/nodeModulesResolveJsonModule(module=nodenext).errors.txt +++ /dev/null @@ -1,39 +0,0 @@ -tests/cases/conformance/node/index.mts(1,17): error TS7062: JSON imports are experimental in ES module mode imports. -tests/cases/conformance/node/index.mts(3,21): error TS7062: JSON imports are experimental in ES module mode imports. -tests/cases/conformance/node/index.ts(1,17): error TS7062: JSON imports are experimental in ES module mode imports. -tests/cases/conformance/node/index.ts(3,21): error TS7062: JSON imports are experimental in ES module mode imports. - - -==== tests/cases/conformance/node/index.ts (2 errors) ==== - import pkg from "./package.json" - ~~~~~~~~~~~~~~~~ -!!! error TS7062: JSON imports are experimental in ES module mode imports. - export const name = pkg.name; - import * as ns from "./package.json"; - ~~~~~~~~~~~~~~~~ -!!! error TS7062: JSON imports are experimental in ES module mode imports. - export const thing = ns; - export const name2 = ns.default.name; -==== tests/cases/conformance/node/index.cts (0 errors) ==== - import pkg from "./package.json" - export const name = pkg.name; - import * as ns from "./package.json"; - export const thing = ns; - export const name2 = ns.default.name; -==== tests/cases/conformance/node/index.mts (2 errors) ==== - import pkg from "./package.json" - ~~~~~~~~~~~~~~~~ -!!! error TS7062: JSON imports are experimental in ES module mode imports. - export const name = pkg.name; - import * as ns from "./package.json"; - ~~~~~~~~~~~~~~~~ -!!! error TS7062: JSON imports are experimental in ES module mode imports. - export const thing = ns; - export const name2 = ns.default.name; -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "pkg", - "version": "0.0.1", - "type": "module", - "default": "misedirection" - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node16).errors.txt b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node16).errors.txt new file mode 100644 index 00000000000..012ef390621 --- /dev/null +++ b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node16).errors.txt @@ -0,0 +1,43 @@ +tests/cases/conformance/node/index.ts(3,22): error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/subfolder/index.ts(2,17): error TS1471: Module '../index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +tests/cases/conformance/node/subfolder/index.ts(3,22): error TS1471: Module '../index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + + +==== tests/cases/conformance/node/subfolder/index.ts (2 errors) ==== + // cjs format file + import {h} from "../index.js"; + ~~~~~~~~~~~~~ +!!! error TS1471: Module '../index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import mod = require("../index.js"); + ~~~~~~~~~~~~~ +!!! error TS1471: Module '../index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import {f as _f} from "./index.js"; + import mod2 = require("./index.js"); + export async function f() { + const mod3 = await import ("../index.js"); + const mod4 = await import ("./index.js"); + h(); + } +==== tests/cases/conformance/node/index.ts (1 errors) ==== + // esm format file + import {h as _h} from "./index.js"; + import mod = require("./index.js"); + ~~~~~~~~~~~~ +!!! error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + import {f} from "./subfolder/index.js"; + import mod2 = require("./subfolder/index.js"); + export async function h() { + const mod3 = await import ("./index.js"); + const mod4 = await import ("./subfolder/index.js"); + f(); + } +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node16).js b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node16).js new file mode 100644 index 00000000000..7ac63da5914 --- /dev/null +++ b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node16).js @@ -0,0 +1,60 @@ +//// [tests/cases/conformance/node/nodeModulesSynchronousCallErrors.ts] //// + +//// [index.ts] +// cjs format file +import {h} from "../index.js"; +import mod = require("../index.js"); +import {f as _f} from "./index.js"; +import mod2 = require("./index.js"); +export async function f() { + const mod3 = await import ("../index.js"); + const mod4 = await import ("./index.js"); + h(); +} +//// [index.ts] +// esm format file +import {h as _h} from "./index.js"; +import mod = require("./index.js"); +import {f} from "./subfolder/index.js"; +import mod2 = require("./subfolder/index.js"); +export async function h() { + const mod3 = await import ("./index.js"); + const mod4 = await import ("./subfolder/index.js"); + f(); +} +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} + +//// [index.js] +import { f } from "./subfolder/index.js"; +export async function h() { + const mod3 = await import("./index.js"); + const mod4 = await import("./subfolder/index.js"); + f(); +} +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.f = void 0; +// cjs format file +const index_js_1 = require("../index.js"); +async function f() { + const mod3 = await import("../index.js"); + const mod4 = await import("./index.js"); + (0, index_js_1.h)(); +} +exports.f = f; + + +//// [index.d.ts] +export declare function h(): Promise; +//// [index.d.ts] +export declare function f(): Promise; diff --git a/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node16).symbols b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node16).symbols new file mode 100644 index 00000000000..8b03ab0af9f --- /dev/null +++ b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node16).symbols @@ -0,0 +1,58 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +import {h} from "../index.js"; +>h : Symbol(h, Decl(index.ts, 1, 8)) + +import mod = require("../index.js"); +>mod : Symbol(mod, Decl(index.ts, 1, 30)) + +import {f as _f} from "./index.js"; +>f : Symbol(f, Decl(index.ts, 4, 36)) +>_f : Symbol(_f, Decl(index.ts, 3, 8)) + +import mod2 = require("./index.js"); +>mod2 : Symbol(mod2, Decl(index.ts, 3, 35)) + +export async function f() { +>f : Symbol(f, Decl(index.ts, 4, 36)) + + const mod3 = await import ("../index.js"); +>mod3 : Symbol(mod3, Decl(index.ts, 6, 9)) +>"../index.js" : Symbol(mod, Decl(index.ts, 0, 0)) + + const mod4 = await import ("./index.js"); +>mod4 : Symbol(mod4, Decl(index.ts, 7, 9)) +>"./index.js" : Symbol(mod2, Decl(index.ts, 0, 0)) + + h(); +>h : Symbol(h, Decl(index.ts, 1, 8)) +} +=== tests/cases/conformance/node/index.ts === +// esm format file +import {h as _h} from "./index.js"; +>h : Symbol(h, Decl(index.ts, 4, 46)) +>_h : Symbol(_h, Decl(index.ts, 1, 8)) + +import mod = require("./index.js"); +>mod : Symbol(mod, Decl(index.ts, 1, 35)) + +import {f} from "./subfolder/index.js"; +>f : Symbol(f, Decl(index.ts, 3, 8)) + +import mod2 = require("./subfolder/index.js"); +>mod2 : Symbol(mod2, Decl(index.ts, 3, 39)) + +export async function h() { +>h : Symbol(h, Decl(index.ts, 4, 46)) + + const mod3 = await import ("./index.js"); +>mod3 : Symbol(mod3, Decl(index.ts, 6, 9)) +>"./index.js" : Symbol(mod, Decl(index.ts, 0, 0)) + + const mod4 = await import ("./subfolder/index.js"); +>mod4 : Symbol(mod4, Decl(index.ts, 7, 9)) +>"./subfolder/index.js" : Symbol(mod2, Decl(index.ts, 0, 0)) + + f(); +>f : Symbol(f, Decl(index.ts, 3, 8)) +} diff --git a/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node16).types b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node16).types new file mode 100644 index 00000000000..0ded6fc1b88 --- /dev/null +++ b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node16).types @@ -0,0 +1,68 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +import {h} from "../index.js"; +>h : () => Promise + +import mod = require("../index.js"); +>mod : typeof mod + +import {f as _f} from "./index.js"; +>f : () => Promise +>_f : () => Promise + +import mod2 = require("./index.js"); +>mod2 : typeof mod2 + +export async function f() { +>f : () => Promise + + const mod3 = await import ("../index.js"); +>mod3 : typeof mod +>await import ("../index.js") : typeof mod +>import ("../index.js") : Promise +>"../index.js" : "../index.js" + + const mod4 = await import ("./index.js"); +>mod4 : { default: typeof mod2; f(): Promise; } +>await import ("./index.js") : { default: typeof mod2; f(): Promise; } +>import ("./index.js") : Promise<{ default: typeof mod2; f(): Promise; }> +>"./index.js" : "./index.js" + + h(); +>h() : Promise +>h : () => Promise +} +=== tests/cases/conformance/node/index.ts === +// esm format file +import {h as _h} from "./index.js"; +>h : () => Promise +>_h : () => Promise + +import mod = require("./index.js"); +>mod : typeof mod + +import {f} from "./subfolder/index.js"; +>f : () => Promise + +import mod2 = require("./subfolder/index.js"); +>mod2 : typeof mod2 + +export async function h() { +>h : () => Promise + + const mod3 = await import ("./index.js"); +>mod3 : typeof mod +>await import ("./index.js") : typeof mod +>import ("./index.js") : Promise +>"./index.js" : "./index.js" + + const mod4 = await import ("./subfolder/index.js"); +>mod4 : { default: typeof mod2; f(): Promise; } +>await import ("./subfolder/index.js") : { default: typeof mod2; f(): Promise; } +>import ("./subfolder/index.js") : Promise<{ default: typeof mod2; f(): Promise; }> +>"./subfolder/index.js" : "./subfolder/index.js" + + f(); +>f() : Promise +>f : () => Promise +} diff --git a/tests/baselines/reference/nodeModulesTopLevelAwait(module=node16).errors.txt b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node16).errors.txt new file mode 100644 index 00000000000..00001d997b4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node16).errors.txt @@ -0,0 +1,28 @@ +tests/cases/conformance/node/subfolder/index.ts(2,11): error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. +tests/cases/conformance/node/subfolder/index.ts(4,5): error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. + + +==== tests/cases/conformance/node/subfolder/index.ts (2 errors) ==== + // cjs format file + const x = await 1; + ~~~~~ +!!! error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. + export {x}; + for await (const y of []) {} + ~~~~~ +!!! error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + const x = await 1; + export {x}; + for await (const y of []) {} +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module" + } +==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== + { + "type": "commonjs" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesTopLevelAwait(module=node16).js b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node16).js new file mode 100644 index 00000000000..8d33777f0c4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node16).js @@ -0,0 +1,44 @@ +//// [tests/cases/conformance/node/nodeModulesTopLevelAwait.ts] //// + +//// [index.ts] +// cjs format file +const x = await 1; +export {x}; +for await (const y of []) {} +//// [index.ts] +// esm format file +const x = await 1; +export {x}; +for await (const y of []) {} +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module" +} +//// [package.json] +{ + "type": "commonjs" +} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +// cjs format file +const x = await 1; +exports.x = x; +for await (const y of []) { } +//// [index.js] +// esm format file +const x = await 1; +export { x }; +for await (const y of []) { } + + +//// [index.d.ts] +declare const x = 1; +export { x }; +//// [index.d.ts] +declare const x = 1; +export { x }; diff --git a/tests/baselines/reference/nodeModulesTopLevelAwait(module=node16).symbols b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node16).symbols new file mode 100644 index 00000000000..624f09cb773 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node16).symbols @@ -0,0 +1,22 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +const x = await 1; +>x : Symbol(x, Decl(index.ts, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.ts, 2, 8)) + +for await (const y of []) {} +>y : Symbol(y, Decl(index.ts, 3, 16)) + +=== tests/cases/conformance/node/index.ts === +// esm format file +const x = await 1; +>x : Symbol(x, Decl(index.ts, 1, 5)) + +export {x}; +>x : Symbol(x, Decl(index.ts, 2, 8)) + +for await (const y of []) {} +>y : Symbol(y, Decl(index.ts, 3, 16)) + diff --git a/tests/baselines/reference/nodeModulesTopLevelAwait(module=node16).types b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node16).types new file mode 100644 index 00000000000..ae8108f4020 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node16).types @@ -0,0 +1,28 @@ +=== tests/cases/conformance/node/subfolder/index.ts === +// cjs format file +const x = await 1; +>x : 1 +>await 1 : 1 +>1 : 1 + +export {x}; +>x : 1 + +for await (const y of []) {} +>y : any +>[] : undefined[] + +=== tests/cases/conformance/node/index.ts === +// esm format file +const x = await 1; +>x : 1 +>await 1 : 1 +>1 : 1 + +export {x}; +>x : 1 + +for await (const y of []) {} +>y : any +>[] : undefined[] + diff --git a/tests/baselines/reference/nodeModulesTopLevelAwait(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesTopLevelAwait(module=nodenext).errors.txt index 140c9f2c32c..00001d997b4 100644 --- a/tests/baselines/reference/nodeModulesTopLevelAwait(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesTopLevelAwait(module=nodenext).errors.txt @@ -1,16 +1,16 @@ -tests/cases/conformance/node/subfolder/index.ts(2,11): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. -tests/cases/conformance/node/subfolder/index.ts(4,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +tests/cases/conformance/node/subfolder/index.ts(2,11): error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. +tests/cases/conformance/node/subfolder/index.ts(4,5): error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. ==== tests/cases/conformance/node/subfolder/index.ts (2 errors) ==== // cjs format file const x = await 1; ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +!!! error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. export {x}; for await (const y of []) {} ~~~~~ -!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +!!! error TS1309: The current file is a CommonJS module and cannot use 'await' at the top level. ==== tests/cases/conformance/node/index.ts (0 errors) ==== // esm format file const x = await 1; diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node16).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node16).js new file mode 100644 index 00000000000..422ed137b0f --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node16).js @@ -0,0 +1,35 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit1.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + interface ImportInterface {} +} +//// [require.d.ts] +export {}; +declare global { + interface RequireInterface {} +} +//// [index.ts] +/// +export interface LocalInterface extends RequireInterface {} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/// + + +//// [index.d.ts] +/// +export interface LocalInterface extends RequireInterface { +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node16).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node16).symbols new file mode 100644 index 00000000000..b3bd9d822f3 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node16).symbols @@ -0,0 +1,14 @@ +=== /index.ts === +/// +export interface LocalInterface extends RequireInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) + +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(require.d.ts, 0, 10)) + + interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node16).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node16).types new file mode 100644 index 00000000000..5309ca6f8bc --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node16).types @@ -0,0 +1,10 @@ +=== /index.ts === +/// +No type information for this code.export interface LocalInterface extends RequireInterface {} +No type information for this code.=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : any + + interface RequireInterface {} +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node16).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node16).js new file mode 100644 index 00000000000..19f87244dba --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node16).js @@ -0,0 +1,39 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit2.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + interface ImportInterface {} +} +//// [require.d.ts] +export {}; +declare global { + interface RequireInterface {} +} +//// [package.json] +{ + "private": true, + "type": "module" +} +//// [index.ts] +/// +export interface LocalInterface extends ImportInterface {} + +//// [index.js] +/// +export {}; + + +//// [index.d.ts] +/// +export interface LocalInterface extends ImportInterface { +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node16).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node16).symbols new file mode 100644 index 00000000000..e21bf153066 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node16).symbols @@ -0,0 +1,14 @@ +=== /index.ts === +/// +export interface LocalInterface extends ImportInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) + +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(import.d.ts, 0, 10)) + + interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node16).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node16).types new file mode 100644 index 00000000000..e6e97a84b46 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node16).types @@ -0,0 +1,10 @@ +=== /index.ts === +/// +No type information for this code.export interface LocalInterface extends ImportInterface {} +No type information for this code.=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : any + + interface ImportInterface {} +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node16).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node16).js new file mode 100644 index 00000000000..78d1f72c4b1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node16).js @@ -0,0 +1,39 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit3.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + interface ImportInterface {} +} +//// [require.d.ts] +export {}; +declare global { + interface RequireInterface {} +} +//// [package.json] +{ + "private": true, + "type": "module" +} +//// [index.ts] +/// +export interface LocalInterface extends RequireInterface {} + +//// [index.js] +/// +export {}; + + +//// [index.d.ts] +/// +export interface LocalInterface extends RequireInterface { +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node16).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node16).symbols new file mode 100644 index 00000000000..da1b6a81fbb --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node16).symbols @@ -0,0 +1,14 @@ +=== /index.ts === +/// +export interface LocalInterface extends RequireInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) + +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(require.d.ts, 0, 10)) + + interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node16).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node16).types new file mode 100644 index 00000000000..abc205f8742 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node16).types @@ -0,0 +1,10 @@ +=== /index.ts === +/// +No type information for this code.export interface LocalInterface extends RequireInterface {} +No type information for this code.=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : any + + interface RequireInterface {} +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node16).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node16).js new file mode 100644 index 00000000000..9f2493f030a --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node16).js @@ -0,0 +1,35 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit4.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + interface ImportInterface {} +} +//// [require.d.ts] +export {}; +declare global { + interface RequireInterface {} +} +//// [index.ts] +/// +export interface LocalInterface extends ImportInterface {} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/// + + +//// [index.d.ts] +/// +export interface LocalInterface extends ImportInterface { +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node16).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node16).symbols new file mode 100644 index 00000000000..dcaf8d70169 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node16).symbols @@ -0,0 +1,14 @@ +=== /index.ts === +/// +export interface LocalInterface extends ImportInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) + +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(import.d.ts, 0, 10)) + + interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node16).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node16).types new file mode 100644 index 00000000000..62e354e99b1 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node16).types @@ -0,0 +1,10 @@ +=== /index.ts === +/// +No type information for this code.export interface LocalInterface extends ImportInterface {} +No type information for this code.=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : any + + interface ImportInterface {} +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node16).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node16).js new file mode 100644 index 00000000000..63ad10a1141 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node16).js @@ -0,0 +1,38 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit5.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + interface ImportInterface {} +} +//// [require.d.ts] +export {}; +declare global { + interface RequireInterface {} +} +//// [index.ts] +/// +/// +export interface LocalInterface extends ImportInterface, RequireInterface {} + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/// +/// + + +//// [index.d.ts] +/// +/// +export interface LocalInterface extends ImportInterface, RequireInterface { +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node16).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node16).symbols new file mode 100644 index 00000000000..6602737d542 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node16).symbols @@ -0,0 +1,24 @@ +=== /index.ts === +/// +/// +export interface LocalInterface extends ImportInterface, RequireInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) + +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(import.d.ts, 0, 10)) + + interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) +} +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(require.d.ts, 0, 10)) + + interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node16).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node16).types new file mode 100644 index 00000000000..1e3690c89f0 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node16).types @@ -0,0 +1,18 @@ +=== /index.ts === +/// +No type information for this code./// +No type information for this code.export interface LocalInterface extends ImportInterface, RequireInterface {} +No type information for this code.=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : any + + interface ImportInterface {} +} +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : any + + interface RequireInterface {} +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node16).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node16).js new file mode 100644 index 00000000000..34117c328c5 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node16).js @@ -0,0 +1,53 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit6.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + interface ImportInterface {} + function getInterI(): ImportInterface; +} +//// [require.d.ts] +export {}; +declare global { + interface RequireInterface {} + function getInterR(): RequireInterface; +} +//// [uses.ts] +/// +export default getInterR(); +//// [index.ts] +import obj from "./uses.js" +export default (obj as typeof obj); + +//// [uses.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/// +exports.default = getInterR(); +//// [index.js] +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const uses_js_1 = __importDefault(require("./uses.js")); +exports.default = uses_js_1.default; + + +//// [uses.d.ts] +/// +declare const _default: RequireInterface; +export default _default; +//// [index.d.ts] +/// +declare const _default: RequireInterface; +export default _default; diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node16).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node16).symbols new file mode 100644 index 00000000000..5aa8fccc15d --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node16).symbols @@ -0,0 +1,25 @@ +=== /index.ts === +import obj from "./uses.js" +>obj : Symbol(obj, Decl(index.ts, 0, 6)) + +export default (obj as typeof obj); +>obj : Symbol(obj, Decl(index.ts, 0, 6)) +>obj : Symbol(obj, Decl(index.ts, 0, 6)) + +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(require.d.ts, 0, 10)) + + interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) + + function getInterR(): RequireInterface; +>getInterR : Symbol(getInterR, Decl(require.d.ts, 2, 33)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) +} +=== /uses.ts === +/// +export default getInterR(); +>getInterR : Symbol(getInterR, Decl(require.d.ts, 2, 33)) + diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node16).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node16).types new file mode 100644 index 00000000000..8b46fbb9f54 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node16).types @@ -0,0 +1,25 @@ +=== /index.ts === +import obj from "./uses.js" +>obj : RequireInterface + +export default (obj as typeof obj); +>(obj as typeof obj) : RequireInterface +>obj as typeof obj : RequireInterface +>obj : RequireInterface +>obj : RequireInterface + +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : typeof global + + interface RequireInterface {} + function getInterR(): RequireInterface; +>getInterR : () => RequireInterface +} +=== /uses.ts === +/// +export default getInterR(); +>getInterR() : RequireInterface +>getInterR : () => RequireInterface + diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node16).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node16).js new file mode 100644 index 00000000000..2426cb28b25 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node16).js @@ -0,0 +1,78 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit7.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + interface ImportInterface { _i: any; } + function getInterI(): ImportInterface; +} +//// [require.d.ts] +export {}; +declare global { + interface RequireInterface { _r: any; } + function getInterR(): RequireInterface; +} +//// [uses.ts] +/// +export default getInterI(); +//// [package.json] +{ + "private": true, + "type": "module" +} +//// [uses.ts] +/// +export default getInterR(); +//// [package.json] +{ + "private": true, + "type": "commonjs" +} +//// [package.json] +{ + "private": true, + "type": "module" +} +//// [index.ts] +// only an esm file can `import` both kinds of files +import obj1 from "./sub1/uses.js" +import obj2 from "./sub2/uses.js" +export default [obj1, obj2.default] as const; + +//// [uses.js] +/// +export default getInterI(); +//// [uses.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/// +exports.default = getInterR(); +//// [index.js] +// only an esm file can `import` both kinds of files +import obj1 from "./sub1/uses.js"; +import obj2 from "./sub2/uses.js"; +export default [obj1, obj2.default]; + + +//// [uses.d.ts] +/// +declare const _default: ImportInterface; +export default _default; +//// [uses.d.ts] +/// +declare const _default: RequireInterface; +export default _default; +//// [index.d.ts] +/// +/// +declare const _default: readonly [ImportInterface, RequireInterface]; +export default _default; diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node16).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node16).symbols new file mode 100644 index 00000000000..8f29793a362 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node16).symbols @@ -0,0 +1,51 @@ +=== /index.ts === +// only an esm file can `import` both kinds of files +import obj1 from "./sub1/uses.js" +>obj1 : Symbol(obj1, Decl(index.ts, 1, 6)) + +import obj2 from "./sub2/uses.js" +>obj2 : Symbol(obj2, Decl(index.ts, 2, 6)) + +export default [obj1, obj2.default] as const; +>obj1 : Symbol(obj1, Decl(index.ts, 1, 6)) +>obj2.default : Symbol(obj2.default, Decl(uses.ts, 0, 0)) +>obj2 : Symbol(obj2, Decl(index.ts, 2, 6)) +>default : Symbol(obj2.default, Decl(uses.ts, 0, 0)) +>const : Symbol(const) + +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(import.d.ts, 0, 10)) + + interface ImportInterface { _i: any; } +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) +>_i : Symbol(ImportInterface._i, Decl(import.d.ts, 2, 31)) + + function getInterI(): ImportInterface; +>getInterI : Symbol(getInterI, Decl(import.d.ts, 2, 42)) +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) +} +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(require.d.ts, 0, 10)) + + interface RequireInterface { _r: any; } +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) +>_r : Symbol(RequireInterface._r, Decl(require.d.ts, 2, 32)) + + function getInterR(): RequireInterface; +>getInterR : Symbol(getInterR, Decl(require.d.ts, 2, 43)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) +} +=== /sub1/uses.ts === +/// +export default getInterI(); +>getInterI : Symbol(getInterI, Decl(import.d.ts, 2, 42)) + +=== /sub2/uses.ts === +/// +export default getInterR(); +>getInterR : Symbol(getInterR, Decl(require.d.ts, 2, 43)) + diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node16).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node16).types new file mode 100644 index 00000000000..20edd715aea --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node16).types @@ -0,0 +1,50 @@ +=== /index.ts === +// only an esm file can `import` both kinds of files +import obj1 from "./sub1/uses.js" +>obj1 : ImportInterface + +import obj2 from "./sub2/uses.js" +>obj2 : typeof obj2 + +export default [obj1, obj2.default] as const; +>[obj1, obj2.default] as const : readonly [ImportInterface, RequireInterface] +>[obj1, obj2.default] : readonly [ImportInterface, RequireInterface] +>obj1 : ImportInterface +>obj2.default : RequireInterface +>obj2 : typeof obj2 +>default : RequireInterface + +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : typeof global + + interface ImportInterface { _i: any; } +>_i : any + + function getInterI(): ImportInterface; +>getInterI : () => ImportInterface +} +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : typeof global + + interface RequireInterface { _r: any; } +>_r : any + + function getInterR(): RequireInterface; +>getInterR : () => RequireInterface +} +=== /sub1/uses.ts === +/// +export default getInterI(); +>getInterI() : ImportInterface +>getInterI : () => ImportInterface + +=== /sub2/uses.ts === +/// +export default getInterR(); +>getInterR() : RequireInterface +>getInterR : () => RequireInterface + diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node16).errors.txt b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node16).errors.txt new file mode 100644 index 00000000000..c9a6ac79317 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node16).errors.txt @@ -0,0 +1,29 @@ +/index.ts(2,1): error TS2304: Cannot find name 'foo'. + + +==== /index.ts (1 errors) ==== + /// + foo; + ~~~ +!!! error TS2304: Cannot find name 'foo'. + bar; // bar should resolve while foo should not, since index.js is cjs + export {}; +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export {}; + declare global { + var foo: number; + } +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export {}; + declare global { + var bar: number; + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node16).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node16).js new file mode 100644 index 00000000000..df6436da900 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node16).js @@ -0,0 +1,33 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride1.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + var foo: number; +} +//// [require.d.ts] +export {}; +declare global { + var bar: number; +} +//// [index.ts] +/// +foo; +bar; // bar should resolve while foo should not, since index.js is cjs +export {}; + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/// +foo; +bar; // bar should resolve while foo should not, since index.js is cjs diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node16).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node16).symbols new file mode 100644 index 00000000000..734168a97f3 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node16).symbols @@ -0,0 +1,15 @@ +=== /index.ts === +/// +foo; +bar; // bar should resolve while foo should not, since index.js is cjs +>bar : Symbol(bar, Decl(require.d.ts, 2, 7)) + +export {}; +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(require.d.ts, 0, 10)) + + var bar: number; +>bar : Symbol(bar, Decl(require.d.ts, 2, 7)) +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node16).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node16).types new file mode 100644 index 00000000000..992f05b1805 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node16).types @@ -0,0 +1,17 @@ +=== /index.ts === +/// +foo; +>foo : any + +bar; // bar should resolve while foo should not, since index.js is cjs +>bar : number + +export {}; +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : typeof global + + var bar: number; +>bar : number +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node16).errors.txt b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node16).errors.txt new file mode 100644 index 00000000000..13991aa1353 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node16).errors.txt @@ -0,0 +1,34 @@ +/index.ts(3,1): error TS2304: Cannot find name 'bar'. + + +==== /index.ts (1 errors) ==== + /// + foo; // foo should resolve while bar should not, since index.js is esm + bar; + ~~~ +!!! error TS2304: Cannot find name 'bar'. + export {}; +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export {}; + declare global { + var foo: number; + } +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export {}; + declare global { + var bar: number; + } +==== /package.json (0 errors) ==== + { + "private": true, + "type": "module" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node16).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node16).js new file mode 100644 index 00000000000..aee176689b2 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node16).js @@ -0,0 +1,37 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride2.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + var foo: number; +} +//// [require.d.ts] +export {}; +declare global { + var bar: number; +} +//// [package.json] +{ + "private": true, + "type": "module" +} +//// [index.ts] +/// +foo; // foo should resolve while bar should not, since index.js is esm +bar; +export {}; + +//// [index.js] +/// +foo; // foo should resolve while bar should not, since index.js is esm +bar; +export {}; diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node16).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node16).symbols new file mode 100644 index 00000000000..babba09bdf8 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node16).symbols @@ -0,0 +1,15 @@ +=== /index.ts === +/// +foo; // foo should resolve while bar should not, since index.js is esm +>foo : Symbol(foo, Decl(import.d.ts, 2, 7)) + +bar; +export {}; +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(import.d.ts, 0, 10)) + + var foo: number; +>foo : Symbol(foo, Decl(import.d.ts, 2, 7)) +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node16).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node16).types new file mode 100644 index 00000000000..baabb036278 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node16).types @@ -0,0 +1,17 @@ +=== /index.ts === +/// +foo; // foo should resolve while bar should not, since index.js is esm +>foo : number + +bar; +>bar : any + +export {}; +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : typeof global + + var foo: number; +>foo : number +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node16).errors.txt b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node16).errors.txt new file mode 100644 index 00000000000..477d247984d --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node16).errors.txt @@ -0,0 +1,34 @@ +/index.ts(2,1): error TS2304: Cannot find name 'foo'. + + +==== /index.ts (1 errors) ==== + /// + foo; + ~~~ +!!! error TS2304: Cannot find name 'foo'. + bar; // bar should resolve while foo should not, since even though index.js is esm, the reference is cjs + export {}; +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export {}; + declare global { + var foo: number; + } +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export {}; + declare global { + var bar: number; + } +==== /package.json (0 errors) ==== + { + "private": true, + "type": "module" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node16).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node16).js new file mode 100644 index 00000000000..c6806f897de --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node16).js @@ -0,0 +1,37 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride3.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + var foo: number; +} +//// [require.d.ts] +export {}; +declare global { + var bar: number; +} +//// [package.json] +{ + "private": true, + "type": "module" +} +//// [index.ts] +/// +foo; +bar; // bar should resolve while foo should not, since even though index.js is esm, the reference is cjs +export {}; + +//// [index.js] +/// +foo; +bar; // bar should resolve while foo should not, since even though index.js is esm, the reference is cjs +export {}; diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node16).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node16).symbols new file mode 100644 index 00000000000..dd4f1ee4370 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node16).symbols @@ -0,0 +1,15 @@ +=== /index.ts === +/// +foo; +bar; // bar should resolve while foo should not, since even though index.js is esm, the reference is cjs +>bar : Symbol(bar, Decl(require.d.ts, 2, 7)) + +export {}; +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(require.d.ts, 0, 10)) + + var bar: number; +>bar : Symbol(bar, Decl(require.d.ts, 2, 7)) +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node16).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node16).types new file mode 100644 index 00000000000..296d29ee050 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node16).types @@ -0,0 +1,17 @@ +=== /index.ts === +/// +foo; +>foo : any + +bar; // bar should resolve while foo should not, since even though index.js is esm, the reference is cjs +>bar : number + +export {}; +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : typeof global + + var bar: number; +>bar : number +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node16).errors.txt b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node16).errors.txt new file mode 100644 index 00000000000..3d7f07f2775 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node16).errors.txt @@ -0,0 +1,29 @@ +/index.ts(3,1): error TS2304: Cannot find name 'bar'. + + +==== /index.ts (1 errors) ==== + /// + foo; // foo should resolve while bar should not, since even though index.js is cjs, the refernce is esm + bar; + ~~~ +!!! error TS2304: Cannot find name 'bar'. + export {}; +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export {}; + declare global { + var foo: number; + } +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export {}; + declare global { + var bar: number; + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node16).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node16).js new file mode 100644 index 00000000000..74346916b26 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node16).js @@ -0,0 +1,33 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride4.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + var foo: number; +} +//// [require.d.ts] +export {}; +declare global { + var bar: number; +} +//// [index.ts] +/// +foo; // foo should resolve while bar should not, since even though index.js is cjs, the refernce is esm +bar; +export {}; + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/// +foo; // foo should resolve while bar should not, since even though index.js is cjs, the refernce is esm +bar; diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node16).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node16).symbols new file mode 100644 index 00000000000..c6420dbbea7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node16).symbols @@ -0,0 +1,15 @@ +=== /index.ts === +/// +foo; // foo should resolve while bar should not, since even though index.js is cjs, the refernce is esm +>foo : Symbol(foo, Decl(import.d.ts, 2, 7)) + +bar; +export {}; +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(import.d.ts, 0, 10)) + + var foo: number; +>foo : Symbol(foo, Decl(import.d.ts, 2, 7)) +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node16).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node16).types new file mode 100644 index 00000000000..eb9b906744a --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node16).types @@ -0,0 +1,17 @@ +=== /index.ts === +/// +foo; // foo should resolve while bar should not, since even though index.js is cjs, the refernce is esm +>foo : number + +bar; +>bar : any + +export {}; +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : typeof global + + var foo: number; +>foo : number +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node16).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node16).js new file mode 100644 index 00000000000..0c37dc00e4d --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node16).js @@ -0,0 +1,39 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride5.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + var foo: number; +} +//// [require.d.ts] +export {}; +declare global { + var bar: number; +} +//// [index.ts] +/// +/// +// Both `foo` and `bar` should resolve, as _both_ entrypoints are included by the two +// references above. +foo; +bar; +export {}; + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/// +/// +// Both `foo` and `bar` should resolve, as _both_ entrypoints are included by the two +// references above. +foo; +bar; diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node16).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node16).symbols new file mode 100644 index 00000000000..0dc4119ca97 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node16).symbols @@ -0,0 +1,28 @@ +=== /index.ts === +/// +/// +// Both `foo` and `bar` should resolve, as _both_ entrypoints are included by the two +// references above. +foo; +>foo : Symbol(foo, Decl(import.d.ts, 2, 7)) + +bar; +>bar : Symbol(bar, Decl(require.d.ts, 2, 7)) + +export {}; +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(import.d.ts, 0, 10)) + + var foo: number; +>foo : Symbol(foo, Decl(import.d.ts, 2, 7)) +} +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(require.d.ts, 0, 10)) + + var bar: number; +>bar : Symbol(bar, Decl(require.d.ts, 2, 7)) +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node16).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node16).types new file mode 100644 index 00000000000..047cef77a49 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node16).types @@ -0,0 +1,28 @@ +=== /index.ts === +/// +/// +// Both `foo` and `bar` should resolve, as _both_ entrypoints are included by the two +// references above. +foo; +>foo : number + +bar; +>bar : number + +export {}; +=== /node_modules/pkg/import.d.ts === +export {}; +declare global { +>global : typeof global + + var foo: number; +>foo : number +} +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : typeof global + + var bar: number; +>bar : number +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node16).errors.txt b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node16).errors.txt new file mode 100644 index 00000000000..68be0baf515 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node16).errors.txt @@ -0,0 +1,32 @@ +/index.ts(1,23): error TS1453: `resolution-mode` should be either `require` or `import`. +/index.ts(2,1): error TS2304: Cannot find name 'foo'. + + +==== /index.ts (2 errors) ==== + /// + ~~~ +!!! error TS1453: `resolution-mode` should be either `require` or `import`. + foo; // bad resolution mode, which resolves is arbitrary + ~~~ +!!! error TS2304: Cannot find name 'foo'. + bar; + export {}; +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export {}; + declare global { + var foo: number; + } +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export {}; + declare global { + var bar: number; + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node16).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node16).js new file mode 100644 index 00000000000..09540ae8aba --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node16).js @@ -0,0 +1,33 @@ +//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverrideModeError.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export {}; +declare global { + var foo: number; +} +//// [require.d.ts] +export {}; +declare global { + var bar: number; +} +//// [index.ts] +/// +foo; // bad resolution mode, which resolves is arbitrary +bar; +export {}; + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/// +foo; // bad resolution mode, which resolves is arbitrary +bar; diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node16).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node16).symbols new file mode 100644 index 00000000000..0b19a6c5440 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node16).symbols @@ -0,0 +1,15 @@ +=== /index.ts === +/// +foo; // bad resolution mode, which resolves is arbitrary +bar; +>bar : Symbol(bar, Decl(require.d.ts, 2, 7)) + +export {}; +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : Symbol(global, Decl(require.d.ts, 0, 10)) + + var bar: number; +>bar : Symbol(bar, Decl(require.d.ts, 2, 7)) +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node16).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node16).types new file mode 100644 index 00000000000..4f97b44ffc8 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node16).types @@ -0,0 +1,17 @@ +=== /index.ts === +/// +foo; // bad resolution mode, which resolves is arbitrary +>foo : any + +bar; +>bar : number + +export {}; +=== /node_modules/pkg/require.d.ts === +export {}; +declare global { +>global : typeof global + + var bar: number; +>bar : number +} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideOldResolutionError.errors.txt b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideOldResolutionError.errors.txt index ee262510ffd..05f937c37ad 100644 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideOldResolutionError.errors.txt +++ b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideOldResolutionError.errors.txt @@ -1,6 +1,6 @@ -/index.ts(1,23): error TS1452: Resolution modes are only supported when `moduleResolution` is `node12` or `nodenext`. +/index.ts(1,23): error TS1452: Resolution modes are only supported when `moduleResolution` is `node16` or `nodenext`. /index.ts(1,23): error TS2688: Cannot find type definition file for 'pkg'. -/index.ts(2,23): error TS1452: Resolution modes are only supported when `moduleResolution` is `node12` or `nodenext`. +/index.ts(2,23): error TS1452: Resolution modes are only supported when `moduleResolution` is `node16` or `nodenext`. /index.ts(2,23): error TS2688: Cannot find type definition file for 'pkg'. /index.ts(3,1): error TS2304: Cannot find name 'foo'. /index.ts(4,1): error TS2304: Cannot find name 'bar'. @@ -9,12 +9,12 @@ ==== /index.ts (6 errors) ==== /// ~~~ -!!! error TS1452: Resolution modes are only supported when `moduleResolution` is `node12` or `nodenext`. +!!! error TS1452: Resolution modes are only supported when `moduleResolution` is `node16` or `nodenext`. ~~~ !!! error TS2688: Cannot find type definition file for 'pkg'. /// ~~~ -!!! error TS1452: Resolution modes are only supported when `moduleResolution` is `node12` or `nodenext`. +!!! error TS1452: Resolution modes are only supported when `moduleResolution` is `node16` or `nodenext`. ~~~ !!! error TS2688: Cannot find type definition file for 'pkg'. foo; // `resolution-mode` is an error in old resolution settings, which resolves is arbitrary diff --git a/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node16).js b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node16).js new file mode 100644 index 00000000000..1553828a6ae --- /dev/null +++ b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node16).js @@ -0,0 +1,98 @@ +//// [tests/cases/conformance/node/nodeModulesTypesVersionPackageExports.ts] //// + +//// [index.ts] +// esm format file +import * as mod from "inner"; +mod.correctVersionApplied; + +//// [index.mts] +// esm format file +import * as mod from "inner"; +mod.correctVersionApplied; + +//// [index.cts] +// cjs format file +import * as mod from "inner"; +mod.correctVersionApplied; + +//// [index.d.ts] +// cjs format file +export const noConditionsApplied = true; +//// [index.d.mts] +// esm format file +export const importConditionApplied = true; +//// [index.d.cts] +// cjs format file +export const wrongConditionApplied = true; +//// [old-types.d.ts] +export const noVersionApplied = true; +//// [new-types.d.ts] +export const correctVersionApplied = true; +//// [future-types.d.ts] +export const futureVersionApplied = true; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", +} +//// [package.json] +{ + "name": "inner", + "private": true, + "exports": { + ".": { + "types@>=10000": "./future-types.d.ts", + "types@>=1": "./new-types.d.ts", + "types": "./old-types.d.ts", + "import": "./index.mjs", + "node": "./index.js" + }, + } +} + +//// [index.js] +// esm format file +import * as mod from "inner"; +mod.correctVersionApplied; +//// [index.mjs] +// esm format file +import * as mod from "inner"; +mod.correctVersionApplied; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const mod = __importStar(require("inner")); +mod.correctVersionApplied; + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node16).symbols b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node16).symbols new file mode 100644 index 00000000000..19b9d0e40d9 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node16).symbols @@ -0,0 +1,57 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import * as mod from "inner"; +>mod : Symbol(mod, Decl(index.ts, 1, 6)) + +mod.correctVersionApplied; +>mod.correctVersionApplied : Symbol(correctVersionApplied, Decl(new-types.d.ts, 0, 12)) +>mod : Symbol(mod, Decl(index.ts, 1, 6)) +>correctVersionApplied : Symbol(correctVersionApplied, Decl(new-types.d.ts, 0, 12)) + +=== tests/cases/conformance/node/index.mts === +// esm format file +import * as mod from "inner"; +>mod : Symbol(mod, Decl(index.mts, 1, 6)) + +mod.correctVersionApplied; +>mod.correctVersionApplied : Symbol(correctVersionApplied, Decl(new-types.d.ts, 0, 12)) +>mod : Symbol(mod, Decl(index.mts, 1, 6)) +>correctVersionApplied : Symbol(correctVersionApplied, Decl(new-types.d.ts, 0, 12)) + +=== tests/cases/conformance/node/index.cts === +// cjs format file +import * as mod from "inner"; +>mod : Symbol(mod, Decl(index.cts, 1, 6)) + +mod.correctVersionApplied; +>mod.correctVersionApplied : Symbol(mod.correctVersionApplied, Decl(new-types.d.ts, 0, 12)) +>mod : Symbol(mod, Decl(index.cts, 1, 6)) +>correctVersionApplied : Symbol(mod.correctVersionApplied, Decl(new-types.d.ts, 0, 12)) + +=== tests/cases/conformance/node/node_modules/inner/index.d.ts === +// cjs format file +export const noConditionsApplied = true; +>noConditionsApplied : Symbol(noConditionsApplied, Decl(index.d.ts, 1, 12)) + +=== tests/cases/conformance/node/node_modules/inner/index.d.mts === +// esm format file +export const importConditionApplied = true; +>importConditionApplied : Symbol(importConditionApplied, Decl(index.d.mts, 1, 12)) + +=== tests/cases/conformance/node/node_modules/inner/index.d.cts === +// cjs format file +export const wrongConditionApplied = true; +>wrongConditionApplied : Symbol(wrongConditionApplied, Decl(index.d.cts, 1, 12)) + +=== tests/cases/conformance/node/node_modules/inner/old-types.d.ts === +export const noVersionApplied = true; +>noVersionApplied : Symbol(noVersionApplied, Decl(old-types.d.ts, 0, 12)) + +=== tests/cases/conformance/node/node_modules/inner/new-types.d.ts === +export const correctVersionApplied = true; +>correctVersionApplied : Symbol(correctVersionApplied, Decl(new-types.d.ts, 0, 12)) + +=== tests/cases/conformance/node/node_modules/inner/future-types.d.ts === +export const futureVersionApplied = true; +>futureVersionApplied : Symbol(futureVersionApplied, Decl(future-types.d.ts, 0, 12)) + diff --git a/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node16).types b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node16).types new file mode 100644 index 00000000000..fe286fd6674 --- /dev/null +++ b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node16).types @@ -0,0 +1,63 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import * as mod from "inner"; +>mod : typeof mod + +mod.correctVersionApplied; +>mod.correctVersionApplied : true +>mod : typeof mod +>correctVersionApplied : true + +=== tests/cases/conformance/node/index.mts === +// esm format file +import * as mod from "inner"; +>mod : typeof mod + +mod.correctVersionApplied; +>mod.correctVersionApplied : true +>mod : typeof mod +>correctVersionApplied : true + +=== tests/cases/conformance/node/index.cts === +// cjs format file +import * as mod from "inner"; +>mod : typeof mod + +mod.correctVersionApplied; +>mod.correctVersionApplied : true +>mod : typeof mod +>correctVersionApplied : true + +=== tests/cases/conformance/node/node_modules/inner/index.d.ts === +// cjs format file +export const noConditionsApplied = true; +>noConditionsApplied : true +>true : true + +=== tests/cases/conformance/node/node_modules/inner/index.d.mts === +// esm format file +export const importConditionApplied = true; +>importConditionApplied : true +>true : true + +=== tests/cases/conformance/node/node_modules/inner/index.d.cts === +// cjs format file +export const wrongConditionApplied = true; +>wrongConditionApplied : true +>true : true + +=== tests/cases/conformance/node/node_modules/inner/old-types.d.ts === +export const noVersionApplied = true; +>noVersionApplied : true +>true : true + +=== tests/cases/conformance/node/node_modules/inner/new-types.d.ts === +export const correctVersionApplied = true; +>correctVersionApplied : true +>true : true + +=== tests/cases/conformance/node/node_modules/inner/future-types.d.ts === +export const futureVersionApplied = true; +>futureVersionApplied : true +>true : true + diff --git a/tests/baselines/reference/nodeNextImportModeImplicitIndexResolution.errors.txt b/tests/baselines/reference/nodeNextImportModeImplicitIndexResolution.errors.txt index cf759f6040d..20f2430229a 100644 --- a/tests/baselines/reference/nodeNextImportModeImplicitIndexResolution.errors.txt +++ b/tests/baselines/reference/nodeNextImportModeImplicitIndexResolution.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/index.ts(2,31): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/compiler/index.ts(3,31): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/compiler/index.ts(2,31): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. +tests/cases/compiler/index.ts(3,31): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. ==== tests/cases/compiler/node_modules/pkg/package.json (0 errors) ==== @@ -24,8 +24,8 @@ tests/cases/compiler/index.ts(3,31): error TS2834: Relative import paths need ex import { item } from "pkg"; // should work (`index.js` is assumed to be the entrypoint for packages found via nonrelative import) import { item as item2 } from "./pkg"; // shouldn't work (`index.js` is _not_ assumed to be the entrypoint for packages found via relative import) ~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. import { item as item3 } from "./node_modules/pkg" // _even if they're in a node_modules folder_ ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. +!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path. \ No newline at end of file diff --git a/tests/baselines/reference/nodePackageSelfName(module=node16).errors.txt b/tests/baselines/reference/nodePackageSelfName(module=node16).errors.txt new file mode 100644 index 00000000000..c1573b8f51d --- /dev/null +++ b/tests/baselines/reference/nodePackageSelfName(module=node16).errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/node/index.cts(2,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + + +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + import * as self from "package"; + self; +==== tests/cases/conformance/node/index.mts (0 errors) ==== + // esm format file + import * as self from "package"; + self; +==== tests/cases/conformance/node/index.cts (1 errors) ==== + // esm format file + import * as self from "package"; + ~~~~~~~~~ +!!! error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + self; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodePackageSelfName(module=node16).js b/tests/baselines/reference/nodePackageSelfName(module=node16).js new file mode 100644 index 00000000000..7061f58c6bb --- /dev/null +++ b/tests/baselines/reference/nodePackageSelfName(module=node16).js @@ -0,0 +1,67 @@ +//// [tests/cases/conformance/node/nodePackageSelfName.ts] //// + +//// [index.ts] +// esm format file +import * as self from "package"; +self; +//// [index.mts] +// esm format file +import * as self from "package"; +self; +//// [index.cts] +// esm format file +import * as self from "package"; +self; +//// [package.json] +{ + "name": "package", + "private": true, + "type": "module", + "exports": "./index.js" +} + +//// [index.js] +// esm format file +import * as self from "package"; +self; +//// [index.mjs] +// esm format file +import * as self from "package"; +self; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// esm format file +const self = __importStar(require("package")); +self; + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodePackageSelfName(module=node16).symbols b/tests/baselines/reference/nodePackageSelfName(module=node16).symbols new file mode 100644 index 00000000000..44b9566b90c --- /dev/null +++ b/tests/baselines/reference/nodePackageSelfName(module=node16).symbols @@ -0,0 +1,24 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import * as self from "package"; +>self : Symbol(self, Decl(index.ts, 1, 6)) + +self; +>self : Symbol(self, Decl(index.ts, 1, 6)) + +=== tests/cases/conformance/node/index.mts === +// esm format file +import * as self from "package"; +>self : Symbol(self, Decl(index.mts, 1, 6)) + +self; +>self : Symbol(self, Decl(index.mts, 1, 6)) + +=== tests/cases/conformance/node/index.cts === +// esm format file +import * as self from "package"; +>self : Symbol(self, Decl(index.cts, 1, 6)) + +self; +>self : Symbol(self, Decl(index.cts, 1, 6)) + diff --git a/tests/baselines/reference/nodePackageSelfName(module=node16).types b/tests/baselines/reference/nodePackageSelfName(module=node16).types new file mode 100644 index 00000000000..b41eef255ab --- /dev/null +++ b/tests/baselines/reference/nodePackageSelfName(module=node16).types @@ -0,0 +1,24 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import * as self from "package"; +>self : typeof self + +self; +>self : typeof self + +=== tests/cases/conformance/node/index.mts === +// esm format file +import * as self from "package"; +>self : typeof self + +self; +>self : typeof self + +=== tests/cases/conformance/node/index.cts === +// esm format file +import * as self from "package"; +>self : typeof self + +self; +>self : typeof self + diff --git a/tests/baselines/reference/nodePackageSelfNameScoped(module=node16).errors.txt b/tests/baselines/reference/nodePackageSelfNameScoped(module=node16).errors.txt new file mode 100644 index 00000000000..b2a9f313de7 --- /dev/null +++ b/tests/baselines/reference/nodePackageSelfNameScoped(module=node16).errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/node/index.cts(2,23): error TS1471: Module '@scope/package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + + +==== tests/cases/conformance/node/index.ts (0 errors) ==== + // esm format file + import * as self from "@scope/package"; + self; +==== tests/cases/conformance/node/index.mts (0 errors) ==== + // esm format file + import * as self from "@scope/package"; + self; +==== tests/cases/conformance/node/index.cts (1 errors) ==== + // cjs format file + import * as self from "@scope/package"; + ~~~~~~~~~~~~~~~~ +!!! error TS1471: Module '@scope/package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + self; +==== tests/cases/conformance/node/package.json (0 errors) ==== + { + "name": "@scope/package", + "private": true, + "type": "module", + "exports": "./index.js" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodePackageSelfNameScoped(module=node16).js b/tests/baselines/reference/nodePackageSelfNameScoped(module=node16).js new file mode 100644 index 00000000000..8738c8041a9 --- /dev/null +++ b/tests/baselines/reference/nodePackageSelfNameScoped(module=node16).js @@ -0,0 +1,67 @@ +//// [tests/cases/conformance/node/nodePackageSelfNameScoped.ts] //// + +//// [index.ts] +// esm format file +import * as self from "@scope/package"; +self; +//// [index.mts] +// esm format file +import * as self from "@scope/package"; +self; +//// [index.cts] +// cjs format file +import * as self from "@scope/package"; +self; +//// [package.json] +{ + "name": "@scope/package", + "private": true, + "type": "module", + "exports": "./index.js" +} + +//// [index.js] +// esm format file +import * as self from "@scope/package"; +self; +//// [index.mjs] +// esm format file +import * as self from "@scope/package"; +self; +//// [index.cjs] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// cjs format file +const self = __importStar(require("@scope/package")); +self; + + +//// [index.d.ts] +export {}; +//// [index.d.mts] +export {}; +//// [index.d.cts] +export {}; diff --git a/tests/baselines/reference/nodePackageSelfNameScoped(module=node16).symbols b/tests/baselines/reference/nodePackageSelfNameScoped(module=node16).symbols new file mode 100644 index 00000000000..e54b0cb667a --- /dev/null +++ b/tests/baselines/reference/nodePackageSelfNameScoped(module=node16).symbols @@ -0,0 +1,24 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import * as self from "@scope/package"; +>self : Symbol(self, Decl(index.ts, 1, 6)) + +self; +>self : Symbol(self, Decl(index.ts, 1, 6)) + +=== tests/cases/conformance/node/index.mts === +// esm format file +import * as self from "@scope/package"; +>self : Symbol(self, Decl(index.mts, 1, 6)) + +self; +>self : Symbol(self, Decl(index.mts, 1, 6)) + +=== tests/cases/conformance/node/index.cts === +// cjs format file +import * as self from "@scope/package"; +>self : Symbol(self, Decl(index.cts, 1, 6)) + +self; +>self : Symbol(self, Decl(index.cts, 1, 6)) + diff --git a/tests/baselines/reference/nodePackageSelfNameScoped(module=node16).types b/tests/baselines/reference/nodePackageSelfNameScoped(module=node16).types new file mode 100644 index 00000000000..3e5c141f63f --- /dev/null +++ b/tests/baselines/reference/nodePackageSelfNameScoped(module=node16).types @@ -0,0 +1,24 @@ +=== tests/cases/conformance/node/index.ts === +// esm format file +import * as self from "@scope/package"; +>self : typeof self + +self; +>self : typeof self + +=== tests/cases/conformance/node/index.mts === +// esm format file +import * as self from "@scope/package"; +>self : typeof self + +self; +>self : typeof self + +=== tests/cases/conformance/node/index.cts === +// cjs format file +import * as self from "@scope/package"; +>self : typeof self + +self; +>self : typeof self + diff --git a/tests/baselines/reference/parser.forAwait.es2018.errors.txt b/tests/baselines/reference/parser.forAwait.es2018.errors.txt index 1f1f9de0973..4627a2b674a 100644 --- a/tests/baselines/reference/parser.forAwait.es2018.errors.txt +++ b/tests/baselines/reference/parser.forAwait.es2018.errors.txt @@ -8,10 +8,10 @@ tests/cases/conformance/parser/ecmascript2018/forAwait/inFunctionDeclWithExprIsE tests/cases/conformance/parser/ecmascript2018/forAwait/inGeneratorWithDeclIsError.ts(3,9): error TS1103: 'for await' loops are only allowed within async functions and at the top levels of modules. tests/cases/conformance/parser/ecmascript2018/forAwait/inGeneratorWithExprIsError.ts(3,9): error TS1103: 'for await' loops are only allowed within async functions and at the top levels of modules. tests/cases/conformance/parser/ecmascript2018/forAwait/topLevelWithDeclIsError.ts(1,5): error TS1431: 'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module. -tests/cases/conformance/parser/ecmascript2018/forAwait/topLevelWithDeclIsError.ts(1,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +tests/cases/conformance/parser/ecmascript2018/forAwait/topLevelWithDeclIsError.ts(1,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. tests/cases/conformance/parser/ecmascript2018/forAwait/topLevelWithDeclIsError.ts(1,23): error TS2304: Cannot find name 'y'. tests/cases/conformance/parser/ecmascript2018/forAwait/topLevelWithExprIsError.ts(1,5): error TS1431: 'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module. -tests/cases/conformance/parser/ecmascript2018/forAwait/topLevelWithExprIsError.ts(1,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +tests/cases/conformance/parser/ecmascript2018/forAwait/topLevelWithExprIsError.ts(1,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. tests/cases/conformance/parser/ecmascript2018/forAwait/topLevelWithExprIsError.ts(1,12): error TS2304: Cannot find name 'x'. tests/cases/conformance/parser/ecmascript2018/forAwait/topLevelWithExprIsError.ts(1,17): error TS2304: Cannot find name 'y'. @@ -21,7 +21,7 @@ tests/cases/conformance/parser/ecmascript2018/forAwait/topLevelWithExprIsError.t ~~~~~ !!! error TS1431: 'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module. ~~~~~ -!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. ~ !!! error TS2304: Cannot find name 'y'. } @@ -30,7 +30,7 @@ tests/cases/conformance/parser/ecmascript2018/forAwait/topLevelWithExprIsError.t ~~~~~ !!! error TS1431: 'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module. ~~~~~ -!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. ~ !!! error TS2304: Cannot find name 'x'. ~ diff --git a/tests/baselines/reference/topLevelAwait.1(module=es2022,target=es2015).errors.txt b/tests/baselines/reference/topLevelAwait.1(module=es2022,target=es2015).errors.txt index 1c56871bbd5..b272ba8a8c6 100644 --- a/tests/baselines/reference/topLevelAwait.1(module=es2022,target=es2015).errors.txt +++ b/tests/baselines/reference/topLevelAwait.1(module=es2022,target=es2015).errors.txt @@ -1,13 +1,13 @@ -tests/cases/conformance/externalModules/index.ts(2,1): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. -tests/cases/conformance/externalModules/index.ts(46,3): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. -tests/cases/conformance/externalModules/other.ts(9,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +tests/cases/conformance/externalModules/index.ts(2,1): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +tests/cases/conformance/externalModules/index.ts(46,3): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +tests/cases/conformance/externalModules/other.ts(9,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. ==== tests/cases/conformance/externalModules/index.ts (2 errors) ==== export const x = 1; await x; ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. // reparse element access as await await [x]; @@ -53,7 +53,7 @@ tests/cases/conformance/externalModules/other.ts(9,5): error TS1432: Top-level ' declare const dec: any; @(await dec) ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. class C { } @@ -84,7 +84,7 @@ tests/cases/conformance/externalModules/other.ts(9,5): error TS1432: Top-level ' for await (const item of arr) { ~~~~~ -!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. item; } \ No newline at end of file diff --git a/tests/baselines/reference/topLevelAwait.1(module=esnext,target=es2015).errors.txt b/tests/baselines/reference/topLevelAwait.1(module=esnext,target=es2015).errors.txt index 1c56871bbd5..b272ba8a8c6 100644 --- a/tests/baselines/reference/topLevelAwait.1(module=esnext,target=es2015).errors.txt +++ b/tests/baselines/reference/topLevelAwait.1(module=esnext,target=es2015).errors.txt @@ -1,13 +1,13 @@ -tests/cases/conformance/externalModules/index.ts(2,1): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. -tests/cases/conformance/externalModules/index.ts(46,3): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. -tests/cases/conformance/externalModules/other.ts(9,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +tests/cases/conformance/externalModules/index.ts(2,1): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +tests/cases/conformance/externalModules/index.ts(46,3): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +tests/cases/conformance/externalModules/other.ts(9,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. ==== tests/cases/conformance/externalModules/index.ts (2 errors) ==== export const x = 1; await x; ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. // reparse element access as await await [x]; @@ -53,7 +53,7 @@ tests/cases/conformance/externalModules/other.ts(9,5): error TS1432: Top-level ' declare const dec: any; @(await dec) ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. class C { } @@ -84,7 +84,7 @@ tests/cases/conformance/externalModules/other.ts(9,5): error TS1432: Top-level ' for await (const item of arr) { ~~~~~ -!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. item; } \ No newline at end of file diff --git a/tests/baselines/reference/topLevelAwait.1(module=system,target=es2015).errors.txt b/tests/baselines/reference/topLevelAwait.1(module=system,target=es2015).errors.txt index 1c56871bbd5..b272ba8a8c6 100644 --- a/tests/baselines/reference/topLevelAwait.1(module=system,target=es2015).errors.txt +++ b/tests/baselines/reference/topLevelAwait.1(module=system,target=es2015).errors.txt @@ -1,13 +1,13 @@ -tests/cases/conformance/externalModules/index.ts(2,1): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. -tests/cases/conformance/externalModules/index.ts(46,3): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. -tests/cases/conformance/externalModules/other.ts(9,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +tests/cases/conformance/externalModules/index.ts(2,1): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +tests/cases/conformance/externalModules/index.ts(46,3): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +tests/cases/conformance/externalModules/other.ts(9,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. ==== tests/cases/conformance/externalModules/index.ts (2 errors) ==== export const x = 1; await x; ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. // reparse element access as await await [x]; @@ -53,7 +53,7 @@ tests/cases/conformance/externalModules/other.ts(9,5): error TS1432: Top-level ' declare const dec: any; @(await dec) ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. class C { } @@ -84,7 +84,7 @@ tests/cases/conformance/externalModules/other.ts(9,5): error TS1432: Top-level ' for await (const item of arr) { ~~~~~ -!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. +!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher. item; } \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.errors.txt b/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.errors.txt index 0fecbd4a916..d00a14233de 100644 --- a/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.errors.txt +++ b/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.errors.txt @@ -1,6 +1,6 @@ -error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node12', 'nodenext'. +error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'nodenext'. -!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node12', 'nodenext'. +!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'nodenext'. ==== file.ts (0 errors) ==== \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.oldTranspile.errors.txt index 0fecbd4a916..d00a14233de 100644 --- a/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Report an error when compiler-options module-kind is out-of-range.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node12', 'nodenext'. +error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'nodenext'. -!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node12', 'nodenext'. +!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'nodenext'. ==== file.ts (0 errors) ==== \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.errors.txt b/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.errors.txt index 0fecbd4a916..d00a14233de 100644 --- a/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.errors.txt +++ b/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.errors.txt @@ -1,6 +1,6 @@ -error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node12', 'nodenext'. +error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'nodenext'. -!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node12', 'nodenext'. +!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'nodenext'. ==== file.ts (0 errors) ==== \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.oldTranspile.errors.txt b/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.oldTranspile.errors.txt index 0fecbd4a916..d00a14233de 100644 --- a/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.oldTranspile.errors.txt +++ b/tests/baselines/reference/transpile/Report an error when compiler-options target-script is out-of-range.oldTranspile.errors.txt @@ -1,6 +1,6 @@ -error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node12', 'nodenext'. +error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'nodenext'. -!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node12', 'nodenext'. +!!! error TS6046: Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'nodenext'. ==== file.ts (0 errors) ==== \ No newline at end of file diff --git a/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node16).errors.txt b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node16).errors.txt new file mode 100644 index 00000000000..179a40218dc --- /dev/null +++ b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node16).errors.txt @@ -0,0 +1,17 @@ +tests/cases/compiler/usage.ts(1,23): error TS2688: Cannot find type definition file for 'pkg'. + + +==== tests/cases/compiler/node_modules/pkg/index.d.ts (0 errors) ==== + interface GlobalThing { a: number } +==== tests/cases/compiler/node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "types": "index.d.ts", + "exports": "some-other-thing.js" + } +==== tests/cases/compiler/usage.ts (1 errors) ==== + /// + ~~~ +!!! error TS2688: Cannot find type definition file for 'pkg'. + + const a: GlobalThing = { a: 0 }; \ No newline at end of file diff --git a/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node16).js b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node16).js new file mode 100644 index 00000000000..89dd2c7541a --- /dev/null +++ b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node16).js @@ -0,0 +1,18 @@ +//// [tests/cases/compiler/tripleSlashTypesReferenceWithMissingExports.ts] //// + +//// [index.d.ts] +interface GlobalThing { a: number } +//// [package.json] +{ + "name": "pkg", + "types": "index.d.ts", + "exports": "some-other-thing.js" +} +//// [usage.ts] +/// + +const a: GlobalThing = { a: 0 }; + +//// [usage.js] +/// +const a = { a: 0 }; diff --git a/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node16).symbols b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node16).symbols new file mode 100644 index 00000000000..b97c41025fe --- /dev/null +++ b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node16).symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/node_modules/pkg/index.d.ts === +interface GlobalThing { a: number } +>GlobalThing : Symbol(GlobalThing, Decl(index.d.ts, 0, 0)) +>a : Symbol(GlobalThing.a, Decl(index.d.ts, 0, 23)) + +=== tests/cases/compiler/usage.ts === +/// + +const a: GlobalThing = { a: 0 }; +>a : Symbol(a, Decl(usage.ts, 2, 5)) +>GlobalThing : Symbol(GlobalThing, Decl(index.d.ts, 0, 0)) +>a : Symbol(a, Decl(usage.ts, 2, 24)) + diff --git a/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node16).types b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node16).types new file mode 100644 index 00000000000..b107f91dcb2 --- /dev/null +++ b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node16).types @@ -0,0 +1,13 @@ +=== tests/cases/compiler/node_modules/pkg/index.d.ts === +interface GlobalThing { a: number } +>a : number + +=== tests/cases/compiler/usage.ts === +/// + +const a: GlobalThing = { a: 0 }; +>a : GlobalThing +>{ a: 0 } : { a: number; } +>a : number +>0 : 0 + diff --git a/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-across-projects-resolve-correctly.js b/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-across-projects-resolve-correctly.js index c8c48ac9ca7..fad710005a0 100644 --- a/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-across-projects-resolve-correctly.js +++ b/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-across-projects-resolve-correctly.js @@ -118,7 +118,7 @@ export * from './dogconfig.js'; { "compilerOptions": { "declaration": true, - "module": "node12" + "module": "node16" } } @@ -134,296 +134,33 @@ Output:: [12:00:26 AM] Building project '/src/src-types/tsconfig.json'... -[12:00:33 AM] Project 'src/src-dogs/tsconfig.json' is out of date because output file 'src/src-dogs/dog.js' does not exist +error TS6053: File '/lib/lib.es2022.full.d.ts' not found. + The file is in the program because: + Default library for target 'es2022' -[12:00:34 AM] Building project '/src/src-dogs/tsconfig.json'... +error TS2318: Cannot find global type 'Array'. -exitCode:: ExitStatus.Success +error TS2318: Cannot find global type 'Boolean'. + +error TS2318: Cannot find global type 'Function'. + +error TS2318: Cannot find global type 'IArguments'. + +error TS2318: Cannot find global type 'Number'. + +error TS2318: Cannot find global type 'Object'. + +error TS2318: Cannot find global type 'RegExp'. + +error TS2318: Cannot find global type 'String'. + +[12:00:27 AM] Project 'src/src-dogs/tsconfig.json' can't be built because its dependency 'src/src-types' has errors + +[12:00:28 AM] Skipping build of project '/src/src-dogs/tsconfig.json' because its dependency '/src/src-types' has errors + + +Found 9 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped -//// [/src/src-dogs/dog.d.ts] -import { DogConfig } from 'src-types'; -export declare abstract class Dog { - static getCapabilities(): DogConfig; -} - - -//// [/src/src-dogs/dog.js] -import { DOG_CONFIG } from './dogconfig.js'; -export class Dog { - static getCapabilities() { - return DOG_CONFIG; - } -} - - -//// [/src/src-dogs/dogconfig.d.ts] -import { DogConfig } from 'src-types'; -export declare const DOG_CONFIG: DogConfig; - - -//// [/src/src-dogs/dogconfig.js] -export const DOG_CONFIG = { - name: 'Default dog', -}; - - -//// [/src/src-dogs/index.d.ts] -export * from 'src-types'; -export * from './lassie/lassiedog.js'; - - -//// [/src/src-dogs/index.js] -export * from 'src-types'; -export * from './lassie/lassiedog.js'; - - -//// [/src/src-dogs/lassie/lassieconfig.d.ts] -import { DogConfig } from 'src-types'; -export declare const LASSIE_CONFIG: DogConfig; - - -//// [/src/src-dogs/lassie/lassieconfig.js] -export const LASSIE_CONFIG = { name: 'Lassie' }; - - -//// [/src/src-dogs/lassie/lassiedog.d.ts] -import { Dog } from '../dog.js'; -export declare class LassieDog extends Dog { - protected static getDogConfig: () => import("../index.js").DogConfig; -} - - -//// [/src/src-dogs/lassie/lassiedog.js] -import { Dog } from '../dog.js'; -import { LASSIE_CONFIG } from './lassieconfig.js'; -export class LassieDog extends Dog { -} -LassieDog.getDogConfig = () => LASSIE_CONFIG; - - -//// [/src/src-dogs/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.es2020.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":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true,"impliedFormat":1},{"version":"-2632060142-export interface DogConfig {\r\n name: string;\r\n}\r\n","impliedFormat":99},{"version":"-5608794531-export * from './dogconfig.js';\r\n","impliedFormat":99},{"version":"1966273863-import { DogConfig } from 'src-types';\n\nexport const DOG_CONFIG: DogConfig = {\n name: 'Default dog',\n};\n","signature":"17588480778-import { DogConfig } from 'src-types';\r\nexport declare const DOG_CONFIG: DogConfig;\r\n","impliedFormat":99},{"version":"6091345804-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}\n","signature":"22128633249-import { DogConfig } from 'src-types';\r\nexport declare abstract class Dog {\r\n static getCapabilities(): DogConfig;\r\n}\r\n","impliedFormat":99},{"version":"4440579024-import { DogConfig } from 'src-types';\n\nexport const LASSIE_CONFIG: DogConfig = { name: 'Lassie' };\n","signature":"8131483665-import { DogConfig } from 'src-types';\r\nexport declare const LASSIE_CONFIG: DogConfig;\r\n","impliedFormat":99},{"version":"-32303727812-import { Dog } from '../dog.js';\nimport { LASSIE_CONFIG } from './lassieconfig.js';\n\nexport class LassieDog extends Dog {\n protected static getDogConfig = () => LASSIE_CONFIG;\n}\n","signature":"-20244062422-import { Dog } from '../dog.js';\r\nexport declare class LassieDog extends Dog {\r\n protected static getDogConfig: () => import(\"../index.js\").DogConfig;\r\n}\r\n","impliedFormat":99},{"version":"-15974991320-export * from 'src-types';\nexport * from './lassie/lassiedog.js';\n","signature":"-16783836862-export * from 'src-types';\r\nexport * from './lassie/lassiedog.js';\r\n","impliedFormat":99}],"options":{"composite":true,"declaration":true,"module":100},"fileIdsList":[[3,4],[3],[3,7],[5,6],[2],[5,8]],"referencedMap":[[5,1],[4,2],[8,3],[6,2],[7,4],[3,5]],"exportedModulesMap":[[5,2],[4,2],[8,3],[6,2],[7,6],[3,5]],"semanticDiagnosticsPerFile":[1,5,4,8,6,7,2,3]},"version":"FakeTSVersion"} - -//// [/src/src-dogs/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "program": { - "fileNames": [ - "../../lib/lib.es2020.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" - ], - "fileNamesList": [ - [ - "../src-types/index.d.ts", - "./dogconfig.ts" - ], - [ - "../src-types/index.d.ts" - ], - [ - "../src-types/index.d.ts", - "./lassie/lassiedog.ts" - ], - [ - "./dog.ts", - "./lassie/lassieconfig.ts" - ], - [ - "../src-types/dogconfig.d.ts" - ], - [ - "./dog.ts", - "./index.ts" - ] - ], - "fileInfos": { - "../../lib/lib.es2020.full.d.ts": { - "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "../src-types/dogconfig.d.ts": { - "version": "-2632060142-export interface DogConfig {\r\n name: string;\r\n}\r\n", - "signature": "-2632060142-export interface DogConfig {\r\n name: string;\r\n}\r\n", - "impliedFormat": 99 - }, - "../src-types/index.d.ts": { - "version": "-5608794531-export * from './dogconfig.js';\r\n", - "signature": "-5608794531-export * from './dogconfig.js';\r\n", - "impliedFormat": 99 - }, - "./dogconfig.ts": { - "version": "1966273863-import { DogConfig } from 'src-types';\n\nexport const DOG_CONFIG: DogConfig = {\n name: 'Default dog',\n};\n", - "signature": "17588480778-import { DogConfig } from 'src-types';\r\nexport declare const DOG_CONFIG: DogConfig;\r\n", - "impliedFormat": 99 - }, - "./dog.ts": { - "version": "6091345804-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}\n", - "signature": "22128633249-import { DogConfig } from 'src-types';\r\nexport declare abstract class Dog {\r\n static getCapabilities(): DogConfig;\r\n}\r\n", - "impliedFormat": 99 - }, - "./lassie/lassieconfig.ts": { - "version": "4440579024-import { DogConfig } from 'src-types';\n\nexport const LASSIE_CONFIG: DogConfig = { name: 'Lassie' };\n", - "signature": "8131483665-import { DogConfig } from 'src-types';\r\nexport declare const LASSIE_CONFIG: DogConfig;\r\n", - "impliedFormat": 99 - }, - "./lassie/lassiedog.ts": { - "version": "-32303727812-import { Dog } from '../dog.js';\nimport { LASSIE_CONFIG } from './lassieconfig.js';\n\nexport class LassieDog extends Dog {\n protected static getDogConfig = () => LASSIE_CONFIG;\n}\n", - "signature": "-20244062422-import { Dog } from '../dog.js';\r\nexport declare class LassieDog extends Dog {\r\n protected static getDogConfig: () => import(\"../index.js\").DogConfig;\r\n}\r\n", - "impliedFormat": 99 - }, - "./index.ts": { - "version": "-15974991320-export * from 'src-types';\nexport * from './lassie/lassiedog.js';\n", - "signature": "-16783836862-export * from 'src-types';\r\nexport * from './lassie/lassiedog.js';\r\n", - "impliedFormat": 99 - } - }, - "options": { - "composite": true, - "declaration": true, - "module": 100 - }, - "referencedMap": { - "./dog.ts": [ - "../src-types/index.d.ts", - "./dogconfig.ts" - ], - "./dogconfig.ts": [ - "../src-types/index.d.ts" - ], - "./index.ts": [ - "../src-types/index.d.ts", - "./lassie/lassiedog.ts" - ], - "./lassie/lassieconfig.ts": [ - "../src-types/index.d.ts" - ], - "./lassie/lassiedog.ts": [ - "./dog.ts", - "./lassie/lassieconfig.ts" - ], - "../src-types/index.d.ts": [ - "../src-types/dogconfig.d.ts" - ] - }, - "exportedModulesMap": { - "./dog.ts": [ - "../src-types/index.d.ts" - ], - "./dogconfig.ts": [ - "../src-types/index.d.ts" - ], - "./index.ts": [ - "../src-types/index.d.ts", - "./lassie/lassiedog.ts" - ], - "./lassie/lassieconfig.ts": [ - "../src-types/index.d.ts" - ], - "./lassie/lassiedog.ts": [ - "./dog.ts", - "./index.ts" - ], - "../src-types/index.d.ts": [ - "../src-types/dogconfig.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.es2020.full.d.ts", - "./dog.ts", - "./dogconfig.ts", - "./index.ts", - "./lassie/lassieconfig.ts", - "./lassie/lassiedog.ts", - "../src-types/dogconfig.d.ts", - "../src-types/index.d.ts" - ] - }, - "version": "FakeTSVersion", - "size": 2712 -} - -//// [/src/src-types/dogconfig.d.ts] -export interface DogConfig { - name: string; -} - - -//// [/src/src-types/dogconfig.js] -export {}; - - -//// [/src/src-types/index.d.ts] -export * from './dogconfig.js'; - - -//// [/src/src-types/index.js] -export * from './dogconfig.js'; - - -//// [/src/src-types/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../lib/lib.es2020.full.d.ts","./dogconfig.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true,"impliedFormat":1},{"version":"-5575793279-export interface DogConfig {\n name: string;\n}","signature":"-2632060142-export interface DogConfig {\r\n name: string;\r\n}\r\n","impliedFormat":99},{"version":"-6189272282-export * from './dogconfig.js';","signature":"-5608794531-export * from './dogconfig.js';\r\n","impliedFormat":99}],"options":{"composite":true,"declaration":true,"module":100},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} - -//// [/src/src-types/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "program": { - "fileNames": [ - "../../lib/lib.es2020.full.d.ts", - "./dogconfig.ts", - "./index.ts" - ], - "fileNamesList": [ - [ - "./dogconfig.ts" - ] - ], - "fileInfos": { - "../../lib/lib.es2020.full.d.ts": { - "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "./dogconfig.ts": { - "version": "-5575793279-export interface DogConfig {\n name: string;\n}", - "signature": "-2632060142-export interface DogConfig {\r\n name: string;\r\n}\r\n", - "impliedFormat": 99 - }, - "./index.ts": { - "version": "-6189272282-export * from './dogconfig.js';", - "signature": "-5608794531-export * from './dogconfig.js';\r\n", - "impliedFormat": 99 - } - }, - "options": { - "composite": true, - "declaration": true, - "module": 100 - }, - "referencedMap": { - "./index.ts": [ - "./dogconfig.ts" - ] - }, - "exportedModulesMap": { - "./index.ts": [ - "./dogconfig.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../lib/lib.es2020.full.d.ts", - "./dogconfig.ts", - "./index.ts" - ] - }, - "version": "FakeTSVersion", - "size": 1038 -} - diff --git a/tests/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js b/tests/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js index 07de3842a6f..bc78d10564f 100644 --- a/tests/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js +++ b/tests/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js @@ -7,7 +7,7 @@ import type { TheNum } from 'pkg2' export const theNum: TheNum = 42; //// [/user/username/projects/myproject/packages/pkg1/tsconfig.json] -{"compilerOptions":{"outDir":"build","module":"node12"},"references":[{"path":"../pkg2"}]} +{"compilerOptions":{"outDir":"build","module":"node16"},"references":[{"path":"../pkg2"}]} //// [/user/username/projects/myproject/packages/pkg2/const.cts] export type TheNum = 42; @@ -16,7 +16,7 @@ export type TheNum = 42; export type { TheNum } from './const.cjs'; //// [/user/username/projects/myproject/packages/pkg2/tsconfig.json] -{"compilerOptions":{"composite":true,"outDir":"build","module":"node12"}} +{"compilerOptions":{"composite":true,"outDir":"build","module":"node16"}} //// [/user/username/projects/myproject/packages/pkg2/package.json] {"name":"pkg2","version":"1.0.0","main":"build/index.js","type":"module"} @@ -52,7 +52,7 @@ Output:: Found 'package.json' at '/user/username/projects/myproject/packages/pkg2/package.json'. 'package.json' does not have a 'typesVersions' field. ======== Resolving module './const.cjs' from '/user/username/projects/myproject/packages/pkg2/index.ts'. ======== -Module resolution kind is not specified, using 'Node12'. +Module resolution kind is not specified, using 'Node16'. Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const.cjs', target file type 'TypeScript'. File name '/user/username/projects/myproject/packages/pkg2/const.cjs' has a '.cjs' extension - stripping it. File '/user/username/projects/myproject/packages/pkg2/const.cts' exist - use it as a name resolution result. @@ -60,46 +60,31 @@ File '/user/username/projects/myproject/packages/pkg2/const.cts' exist - use it File '/a/lib/package.json' does not exist. File '/a/package.json' does not exist. File '/package.json' does not exist. -[12:01:00 AM] Project 'packages/pkg1/tsconfig.json' is out of date because output file 'packages/pkg1/build/index.js' does not exist +error TS6053: File '/a/lib/lib.es2022.full.d.ts' not found. + The file is in the program because: + Default library for target 'es2022' -[12:01:01 AM] Building project '/user/username/projects/myproject/packages/pkg1/tsconfig.json'... +error TS2318: Cannot find global type 'Array'. -Found 'package.json' at '/user/username/projects/myproject/packages/pkg1/package.json'. -'package.json' does not have a 'typesVersions' field. -======== Resolving module 'pkg2' from '/user/username/projects/myproject/packages/pkg1/index.ts'. ======== -Module resolution kind is not specified, using 'Node12'. -File '/user/username/projects/myproject/packages/pkg1/package.json' exists according to earlier cached lookups. -Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. -Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. -Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. -Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. -'package.json' does not have a 'typesVersions' field. -'package.json' does not have a 'typings' field. -'package.json' does not have a 'types' field. -'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' exist - use it as a name resolution result. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has an unsupported extension, so skipping it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file type 'TypeScript'. -File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts' exist - use it as a name resolution result. -Resolving real path for '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts', result '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. -======== Module name 'pkg2' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/index.d.ts' with Package ID 'pkg2/build/index.d.ts@1.0.0'. ======== -File '/user/username/projects/myproject/packages/pkg2/build/package.json' does not exist. -File '/user/username/projects/myproject/packages/pkg2/package.json' exists according to earlier cached lookups. -======== Resolving module './const.cjs' from '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. ======== -Using compiler options of project reference redirect '/user/username/projects/myproject/packages/pkg2/tsconfig.json'. -Module resolution kind is not specified, using 'Node12'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.cjs', target file type 'TypeScript'. -File name '/user/username/projects/myproject/packages/pkg2/build/const.cjs' has a '.cjs' extension - stripping it. -File '/user/username/projects/myproject/packages/pkg2/build/const.cts' does not exist. -File '/user/username/projects/myproject/packages/pkg2/build/const.d.cts' exist - use it as a name resolution result. -======== Module name './const.cjs' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/const.d.cts'. ======== -File '/a/lib/package.json' does not exist according to earlier cached lookups. -File '/a/package.json' does not exist according to earlier cached lookups. -File '/package.json' does not exist according to earlier cached lookups. -[12:01:07 AM] Found 0 errors. Watching for file changes. +error TS2318: Cannot find global type 'Boolean'. + +error TS2318: Cannot find global type 'Function'. + +error TS2318: Cannot find global type 'IArguments'. + +error TS2318: Cannot find global type 'Number'. + +error TS2318: Cannot find global type 'Object'. + +error TS2318: Cannot find global type 'RegExp'. + +error TS2318: Cannot find global type 'String'. + +[12:00:45 AM] Project 'packages/pkg1/tsconfig.json' can't be built because its dependency 'packages/pkg2' has errors + +[12:00:46 AM] Skipping build of project '/user/username/projects/myproject/packages/pkg1/tsconfig.json' because its dependency '/user/username/projects/myproject/packages/pkg2' has errors + +[12:00:47 AM] Found 9 errors. Watching for file changes. @@ -107,40 +92,12 @@ Program root files: ["/user/username/projects/myproject/packages/pkg2/const.cts" Program options: {"composite":true,"outDir":"/user/username/projects/myproject/packages/pkg2/build","module":100,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/packages/pkg2/tsconfig.json"} Program structureReused: Not Program files:: -/a/lib/lib.es2020.full.d.ts /user/username/projects/myproject/packages/pkg2/const.cts /user/username/projects/myproject/packages/pkg2/index.ts -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.es2020.full.d.ts -/user/username/projects/myproject/packages/pkg2/const.cts -/user/username/projects/myproject/packages/pkg2/index.ts +No cached semantic diagnostics in the builder:: -Shape signatures in builder refreshed for:: -/a/lib/lib.es2020.full.d.ts (used version) -/user/username/projects/myproject/packages/pkg2/const.cts (computed .d.ts during emit) -/user/username/projects/myproject/packages/pkg2/index.ts (computed .d.ts during emit) - -Program root files: ["/user/username/projects/myproject/packages/pkg1/index.ts"] -Program options: {"outDir":"/user/username/projects/myproject/packages/pkg1/build","module":100,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/packages/pkg1/tsconfig.json"} -Program structureReused: Not -Program files:: -/a/lib/lib.es2020.full.d.ts -/user/username/projects/myproject/packages/pkg2/build/const.d.cts -/user/username/projects/myproject/packages/pkg2/build/index.d.ts -/user/username/projects/myproject/packages/pkg1/index.ts - -Semantic diagnostics in builder refreshed for:: -/a/lib/lib.es2020.full.d.ts -/user/username/projects/myproject/packages/pkg2/build/const.d.cts -/user/username/projects/myproject/packages/pkg2/build/index.d.ts -/user/username/projects/myproject/packages/pkg1/index.ts - -Shape signatures in builder refreshed for:: -/a/lib/lib.es2020.full.d.ts (used version) -/user/username/projects/myproject/packages/pkg2/build/const.d.cts (used version) -/user/username/projects/myproject/packages/pkg2/build/index.d.ts (used version) -/user/username/projects/myproject/packages/pkg1/index.ts (used version) +No shapes updated in the builder:: WatchedFiles:: /user/username/projects/myproject/packages/pkg2/tsconfig.json: @@ -151,24 +108,16 @@ WatchedFiles:: {"fileName":"/user/username/projects/myproject/packages/pkg2/index.ts","pollingInterval":250} /user/username/projects/myproject/packages/pkg2/package.json: {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} - {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} /a/lib/package.json: {"fileName":"/a/lib/package.json","pollingInterval":250} - {"fileName":"/a/lib/package.json","pollingInterval":250} /a/package.json: {"fileName":"/a/package.json","pollingInterval":250} - {"fileName":"/a/package.json","pollingInterval":250} /package.json: {"fileName":"/package.json","pollingInterval":250} - {"fileName":"/package.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/tsconfig.json: {"fileName":"/user/username/projects/myproject/packages/pkg1/tsconfig.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/index.ts: {"fileName":"/user/username/projects/myproject/packages/pkg1/index.ts","pollingInterval":250} -/user/username/projects/myproject/packages/pkg1/package.json: - {"fileName":"/user/username/projects/myproject/packages/pkg1/package.json","pollingInterval":250} -/user/username/projects/myproject/packages/pkg2/build/package.json: - {"fileName":"/user/username/projects/myproject/packages/pkg2/build/package.json","pollingInterval":250} FsWatches:: @@ -180,86 +129,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -//// [/user/username/projects/myproject/packages/pkg2/build/const.cjs] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); - - -//// [/user/username/projects/myproject/packages/pkg2/build/const.d.cts] -export declare type TheNum = 42; - - -//// [/user/username/projects/myproject/packages/pkg2/build/index.js] -export {}; - - -//// [/user/username/projects/myproject/packages/pkg2/build/index.d.ts] -export type { TheNum } from './const.cjs'; - - -//// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../../a/lib/lib.es2020.full.d.ts","../const.cts","../index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true,"impliedFormat":1},{"version":"-11202312776-export type TheNum = 42;","signature":"-9649133742-export declare type TheNum = 42;\n","impliedFormat":1},{"version":"-9668872159-export type { TheNum } from './const.cjs';","signature":"-9835135925-export type { TheNum } from './const.cjs';\n","impliedFormat":99}],"options":{"composite":true,"module":100,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} - -//// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "program": { - "fileNames": [ - "../../../../../../../a/lib/lib.es2020.full.d.ts", - "../const.cts", - "../index.ts" - ], - "fileNamesList": [ - [ - "../const.cts" - ] - ], - "fileInfos": { - "../../../../../../../a/lib/lib.es2020.full.d.ts": { - "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "../const.cts": { - "version": "-11202312776-export type TheNum = 42;", - "signature": "-9649133742-export declare type TheNum = 42;\n", - "impliedFormat": 1 - }, - "../index.ts": { - "version": "-9668872159-export type { TheNum } from './const.cjs';", - "signature": "-9835135925-export type { TheNum } from './const.cjs';\n", - "impliedFormat": 99 - } - }, - "options": { - "composite": true, - "module": 100, - "outDir": "./" - }, - "referencedMap": { - "../index.ts": [ - "../const.cts" - ] - }, - "exportedModulesMap": { - "../index.ts": [ - "../const.cts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../../../../../../a/lib/lib.es2020.full.d.ts", - "../const.cts", - "../index.ts" - ] - }, - "version": "FakeTSVersion", - "size": 1019 -} - -//// [/user/username/projects/myproject/packages/pkg1/build/index.js] -export const theNum = 42; - - Change:: reports import errors after change to package file @@ -269,78 +138,6 @@ Input:: Output:: ->> Screen clear -[12:01:11 AM] File change detected. Starting incremental compilation... - -[12:01:12 AM] Project 'packages/pkg1/tsconfig.json' is out of date because oldest output 'packages/pkg1/build/index.js' is older than newest input 'packages/pkg2' - -[12:01:13 AM] Building project '/user/username/projects/myproject/packages/pkg1/tsconfig.json'... - -Found 'package.json' at '/user/username/projects/myproject/packages/pkg1/package.json'. -'package.json' does not have a 'typesVersions' field. -======== Resolving module 'pkg2' from '/user/username/projects/myproject/packages/pkg1/index.ts'. ======== -Module resolution kind is not specified, using 'Node12'. -File '/user/username/projects/myproject/packages/pkg1/package.json' exists according to earlier cached lookups. -Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. -Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. -Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. -Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. -'package.json' does not have a 'typesVersions' field. -File '/user/username/projects/myproject/node_modules/pkg2.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. -'package.json' does not have a 'typings' field. -'package.json' does not have a 'types' field. -'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' exist - use it as a name resolution result. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has an unsupported extension, so skipping it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file type 'TypeScript'. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.d.ts' does not exist. -File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts' exist - use it as a name resolution result. -Resolving real path for '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts', result '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. -======== Module name 'pkg2' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/index.d.ts' with Package ID 'pkg2/build/index.d.ts@1.0.0'. ======== -File '/user/username/projects/myproject/packages/pkg2/build/package.json' does not exist. -Found 'package.json' at '/user/username/projects/myproject/packages/pkg2/package.json'. -'package.json' does not have a 'typesVersions' field. -======== Resolving module './const.cjs' from '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. ======== -Using compiler options of project reference redirect '/user/username/projects/myproject/packages/pkg2/tsconfig.json'. -Module resolution kind is not specified, using 'Node12'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.cjs', target file type 'TypeScript'. -File name '/user/username/projects/myproject/packages/pkg2/build/const.cjs' has a '.cjs' extension - stripping it. -File '/user/username/projects/myproject/packages/pkg2/build/const.cts' does not exist. -File '/user/username/projects/myproject/packages/pkg2/build/const.d.cts' exist - use it as a name resolution result. -======== Module name './const.cjs' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/const.d.cts'. ======== -File '/a/lib/package.json' does not exist. -File '/a/package.json' does not exist. -File '/package.json' does not exist. -packages/pkg1/index.ts:1:29 - error TS1471: Module 'pkg2' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - -1 import type { TheNum } from 'pkg2' -   ~~~~~~ - -[12:01:14 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/packages/pkg1/index.ts"] -Program options: {"outDir":"/user/username/projects/myproject/packages/pkg1/build","module":100,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/packages/pkg1/tsconfig.json"} -Program structureReused: Not -Program files:: -/a/lib/lib.es2020.full.d.ts -/user/username/projects/myproject/packages/pkg2/build/const.d.cts -/user/username/projects/myproject/packages/pkg2/build/index.d.ts -/user/username/projects/myproject/packages/pkg1/index.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/myproject/packages/pkg1/index.ts - -Shape signatures in builder refreshed for:: -/user/username/projects/myproject/packages/pkg1/index.ts (computed .d.ts) WatchedFiles:: /user/username/projects/myproject/packages/pkg2/tsconfig.json: @@ -351,24 +148,16 @@ WatchedFiles:: {"fileName":"/user/username/projects/myproject/packages/pkg2/index.ts","pollingInterval":250} /user/username/projects/myproject/packages/pkg2/package.json: {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} - {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} /a/lib/package.json: {"fileName":"/a/lib/package.json","pollingInterval":250} - {"fileName":"/a/lib/package.json","pollingInterval":250} /a/package.json: {"fileName":"/a/package.json","pollingInterval":250} - {"fileName":"/a/package.json","pollingInterval":250} /package.json: {"fileName":"/package.json","pollingInterval":250} - {"fileName":"/package.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/tsconfig.json: {"fileName":"/user/username/projects/myproject/packages/pkg1/tsconfig.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/index.ts: {"fileName":"/user/username/projects/myproject/packages/pkg1/index.ts","pollingInterval":250} -/user/username/projects/myproject/packages/pkg1/package.json: - {"fileName":"/user/username/projects/myproject/packages/pkg1/package.json","pollingInterval":250} -/user/username/projects/myproject/packages/pkg2/build/package.json: - {"fileName":"/user/username/projects/myproject/packages/pkg2/build/package.json","pollingInterval":250} FsWatches:: @@ -389,67 +178,6 @@ Input:: Output:: ->> Screen clear -[12:01:18 AM] File change detected. Starting incremental compilation... - -[12:01:19 AM] Project 'packages/pkg1/tsconfig.json' is out of date because oldest output 'packages/pkg1/build/index.js' is older than newest input 'packages/pkg2' - -[12:01:20 AM] Building project '/user/username/projects/myproject/packages/pkg1/tsconfig.json'... - -Found 'package.json' at '/user/username/projects/myproject/packages/pkg1/package.json'. -'package.json' does not have a 'typesVersions' field. -======== Resolving module 'pkg2' from '/user/username/projects/myproject/packages/pkg1/index.ts'. ======== -Module resolution kind is not specified, using 'Node12'. -File '/user/username/projects/myproject/packages/pkg1/package.json' exists according to earlier cached lookups. -Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. -Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. -Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. -Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. -'package.json' does not have a 'typesVersions' field. -'package.json' does not have a 'typings' field. -'package.json' does not have a 'types' field. -'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' exist - use it as a name resolution result. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has an unsupported extension, so skipping it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file type 'TypeScript'. -File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts' exist - use it as a name resolution result. -Resolving real path for '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts', result '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. -======== Module name 'pkg2' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/index.d.ts' with Package ID 'pkg2/build/index.d.ts@1.0.0'. ======== -File '/user/username/projects/myproject/packages/pkg2/build/package.json' does not exist. -Found 'package.json' at '/user/username/projects/myproject/packages/pkg2/package.json'. -'package.json' does not have a 'typesVersions' field. -======== Resolving module './const.cjs' from '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. ======== -Using compiler options of project reference redirect '/user/username/projects/myproject/packages/pkg2/tsconfig.json'. -Module resolution kind is not specified, using 'Node12'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.cjs', target file type 'TypeScript'. -File name '/user/username/projects/myproject/packages/pkg2/build/const.cjs' has a '.cjs' extension - stripping it. -File '/user/username/projects/myproject/packages/pkg2/build/const.cts' does not exist. -File '/user/username/projects/myproject/packages/pkg2/build/const.d.cts' exist - use it as a name resolution result. -======== Module name './const.cjs' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/const.d.cts'. ======== -File '/a/lib/package.json' does not exist. -File '/a/package.json' does not exist. -File '/package.json' does not exist. -[12:01:24 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/packages/pkg1/index.ts"] -Program options: {"outDir":"/user/username/projects/myproject/packages/pkg1/build","module":100,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/packages/pkg1/tsconfig.json"} -Program structureReused: Not -Program files:: -/a/lib/lib.es2020.full.d.ts -/user/username/projects/myproject/packages/pkg2/build/const.d.cts -/user/username/projects/myproject/packages/pkg2/build/index.d.ts -/user/username/projects/myproject/packages/pkg1/index.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/myproject/packages/pkg1/index.ts - -Shape signatures in builder refreshed for:: -/user/username/projects/myproject/packages/pkg1/index.ts (computed .d.ts) WatchedFiles:: /user/username/projects/myproject/packages/pkg2/tsconfig.json: @@ -460,24 +188,16 @@ WatchedFiles:: {"fileName":"/user/username/projects/myproject/packages/pkg2/index.ts","pollingInterval":250} /user/username/projects/myproject/packages/pkg2/package.json: {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} - {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} /a/lib/package.json: {"fileName":"/a/lib/package.json","pollingInterval":250} - {"fileName":"/a/lib/package.json","pollingInterval":250} /a/package.json: {"fileName":"/a/package.json","pollingInterval":250} - {"fileName":"/a/package.json","pollingInterval":250} /package.json: {"fileName":"/package.json","pollingInterval":250} - {"fileName":"/package.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/tsconfig.json: {"fileName":"/user/username/projects/myproject/packages/pkg1/tsconfig.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/index.ts: {"fileName":"/user/username/projects/myproject/packages/pkg1/index.ts","pollingInterval":250} -/user/username/projects/myproject/packages/pkg1/package.json: - {"fileName":"/user/username/projects/myproject/packages/pkg1/package.json","pollingInterval":250} -/user/username/projects/myproject/packages/pkg2/build/package.json: - {"fileName":"/user/username/projects/myproject/packages/pkg2/build/package.json","pollingInterval":250} FsWatches:: @@ -489,7 +209,6 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -//// [/user/username/projects/myproject/packages/pkg1/build/index.js] file written with same contents Change:: reports import errors after change to package file @@ -499,78 +218,6 @@ Input:: Output:: ->> Screen clear -[12:01:28 AM] File change detected. Starting incremental compilation... - -[12:01:29 AM] Project 'packages/pkg1/tsconfig.json' is out of date because oldest output 'packages/pkg1/build/index.js' is older than newest input 'packages/pkg2' - -[12:01:30 AM] Building project '/user/username/projects/myproject/packages/pkg1/tsconfig.json'... - -Found 'package.json' at '/user/username/projects/myproject/packages/pkg1/package.json'. -'package.json' does not have a 'typesVersions' field. -======== Resolving module 'pkg2' from '/user/username/projects/myproject/packages/pkg1/index.ts'. ======== -Module resolution kind is not specified, using 'Node12'. -File '/user/username/projects/myproject/packages/pkg1/package.json' exists according to earlier cached lookups. -Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. -Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. -Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. -Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. -'package.json' does not have a 'typesVersions' field. -File '/user/username/projects/myproject/node_modules/pkg2.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. -'package.json' does not have a 'typings' field. -'package.json' does not have a 'types' field. -'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' exist - use it as a name resolution result. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has an unsupported extension, so skipping it. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file type 'TypeScript'. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.d.ts' does not exist. -File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. -File '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts' exist - use it as a name resolution result. -Resolving real path for '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts', result '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. -======== Module name 'pkg2' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/index.d.ts' with Package ID 'pkg2/build/index.d.ts@1.0.0'. ======== -File '/user/username/projects/myproject/packages/pkg2/build/package.json' does not exist. -Found 'package.json' at '/user/username/projects/myproject/packages/pkg2/package.json'. -'package.json' does not have a 'typesVersions' field. -======== Resolving module './const.cjs' from '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. ======== -Using compiler options of project reference redirect '/user/username/projects/myproject/packages/pkg2/tsconfig.json'. -Module resolution kind is not specified, using 'Node12'. -Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.cjs', target file type 'TypeScript'. -File name '/user/username/projects/myproject/packages/pkg2/build/const.cjs' has a '.cjs' extension - stripping it. -File '/user/username/projects/myproject/packages/pkg2/build/const.cts' does not exist. -File '/user/username/projects/myproject/packages/pkg2/build/const.d.cts' exist - use it as a name resolution result. -======== Module name './const.cjs' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/const.d.cts'. ======== -File '/a/lib/package.json' does not exist. -File '/a/package.json' does not exist. -File '/package.json' does not exist. -packages/pkg1/index.ts:1:29 - error TS1471: Module 'pkg2' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - -1 import type { TheNum } from 'pkg2' -   ~~~~~~ - -[12:01:31 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/packages/pkg1/index.ts"] -Program options: {"outDir":"/user/username/projects/myproject/packages/pkg1/build","module":100,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/packages/pkg1/tsconfig.json"} -Program structureReused: Not -Program files:: -/a/lib/lib.es2020.full.d.ts -/user/username/projects/myproject/packages/pkg2/build/const.d.cts -/user/username/projects/myproject/packages/pkg2/build/index.d.ts -/user/username/projects/myproject/packages/pkg1/index.ts - -Semantic diagnostics in builder refreshed for:: -/user/username/projects/myproject/packages/pkg1/index.ts - -Shape signatures in builder refreshed for:: -/user/username/projects/myproject/packages/pkg1/index.ts (computed .d.ts) WatchedFiles:: /user/username/projects/myproject/packages/pkg2/tsconfig.json: @@ -581,24 +228,16 @@ WatchedFiles:: {"fileName":"/user/username/projects/myproject/packages/pkg2/index.ts","pollingInterval":250} /user/username/projects/myproject/packages/pkg2/package.json: {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} - {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} /a/lib/package.json: {"fileName":"/a/lib/package.json","pollingInterval":250} - {"fileName":"/a/lib/package.json","pollingInterval":250} /a/package.json: {"fileName":"/a/package.json","pollingInterval":250} - {"fileName":"/a/package.json","pollingInterval":250} /package.json: {"fileName":"/package.json","pollingInterval":250} - {"fileName":"/package.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/tsconfig.json: {"fileName":"/user/username/projects/myproject/packages/pkg1/tsconfig.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/index.ts: {"fileName":"/user/username/projects/myproject/packages/pkg1/index.ts","pollingInterval":250} -/user/username/projects/myproject/packages/pkg1/package.json: - {"fileName":"/user/username/projects/myproject/packages/pkg1/package.json","pollingInterval":250} -/user/username/projects/myproject/packages/pkg2/build/package.json: - {"fileName":"/user/username/projects/myproject/packages/pkg2/build/package.json","pollingInterval":250} FsWatches:: @@ -624,14 +263,14 @@ export type { TheNum } from './const.cjs'; Output:: >> Screen clear -[12:01:38 AM] File change detected. Starting incremental compilation... +[12:01:03 AM] File change detected. Starting incremental compilation... -[12:01:39 AM] Project 'packages/pkg2/tsconfig.json' is out of date because oldest output 'packages/pkg2/build/const.cjs' is older than newest input 'packages/pkg2/index.cts' +[12:01:04 AM] Project 'packages/pkg2/tsconfig.json' is out of date because output file 'packages/pkg2/build/const.cjs' does not exist -[12:01:40 AM] Building project '/user/username/projects/myproject/packages/pkg2/tsconfig.json'... +[12:01:05 AM] Building project '/user/username/projects/myproject/packages/pkg2/tsconfig.json'... ======== Resolving module './const.cjs' from '/user/username/projects/myproject/packages/pkg2/index.cts'. ======== -Module resolution kind is not specified, using 'Node12'. +Module resolution kind is not specified, using 'Node16'. Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/const.cjs', target file type 'TypeScript'. File '/user/username/projects/myproject/packages/pkg2/const.cjs.ts' does not exist. File '/user/username/projects/myproject/packages/pkg2/const.cjs.tsx' does not exist. @@ -642,7 +281,27 @@ File '/user/username/projects/myproject/packages/pkg2/const.cts' exist - use it File '/a/lib/package.json' does not exist. File '/a/package.json' does not exist. File '/package.json' does not exist. -[12:01:49 AM] Updating unchanged output timestamps of project '/user/username/projects/myproject/packages/pkg2/tsconfig.json'... +error TS6053: File '/a/lib/lib.es2022.full.d.ts' not found. + The file is in the program because: + Default library for target 'es2022' + +error TS2318: Cannot find global type 'Array'. + +error TS2318: Cannot find global type 'Boolean'. + +error TS2318: Cannot find global type 'Function'. + +error TS2318: Cannot find global type 'IArguments'. + +error TS2318: Cannot find global type 'Number'. + +error TS2318: Cannot find global type 'Object'. + +error TS2318: Cannot find global type 'RegExp'. + +error TS2318: Cannot find global type 'String'. + +[12:01:06 AM] Found 9 errors. Watching for file changes. @@ -650,15 +309,12 @@ Program root files: ["/user/username/projects/myproject/packages/pkg2/const.cts" Program options: {"composite":true,"outDir":"/user/username/projects/myproject/packages/pkg2/build","module":100,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/packages/pkg2/tsconfig.json"} Program structureReused: Not Program files:: -/a/lib/lib.es2020.full.d.ts /user/username/projects/myproject/packages/pkg2/const.cts /user/username/projects/myproject/packages/pkg2/index.cts -Semantic diagnostics in builder refreshed for:: -/user/username/projects/myproject/packages/pkg2/index.cts +No cached semantic diagnostics in the builder:: -Shape signatures in builder refreshed for:: -/user/username/projects/myproject/packages/pkg2/index.cts (computed .d.ts) +No shapes updated in the builder:: WatchedFiles:: /user/username/projects/myproject/packages/pkg2/tsconfig.json: @@ -667,24 +323,16 @@ WatchedFiles:: {"fileName":"/user/username/projects/myproject/packages/pkg2/const.cts","pollingInterval":250} /user/username/projects/myproject/packages/pkg2/package.json: {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} - {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} /a/lib/package.json: {"fileName":"/a/lib/package.json","pollingInterval":250} - {"fileName":"/a/lib/package.json","pollingInterval":250} /a/package.json: {"fileName":"/a/package.json","pollingInterval":250} - {"fileName":"/a/package.json","pollingInterval":250} /package.json: {"fileName":"/package.json","pollingInterval":250} - {"fileName":"/package.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/tsconfig.json: {"fileName":"/user/username/projects/myproject/packages/pkg1/tsconfig.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/index.ts: {"fileName":"/user/username/projects/myproject/packages/pkg1/index.ts","pollingInterval":250} -/user/username/projects/myproject/packages/pkg1/package.json: - {"fileName":"/user/username/projects/myproject/packages/pkg1/package.json","pollingInterval":250} -/user/username/projects/myproject/packages/pkg2/build/package.json: - {"fileName":"/user/username/projects/myproject/packages/pkg2/build/package.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg2/index.cts: {"fileName":"/user/username/projects/myproject/packages/pkg2/index.cts","pollingInterval":250} @@ -698,73 +346,3 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined -//// [/user/username/projects/myproject/packages/pkg2/build/const.cjs] file changed its modified time -//// [/user/username/projects/myproject/packages/pkg2/build/const.d.cts] file changed its modified time -//// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo] -{"program":{"fileNames":["../../../../../../../a/lib/lib.es2020.full.d.ts","../const.cts","../index.cts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true,"impliedFormat":1},{"version":"-11202312776-export type TheNum = 42;","signature":"-9649133742-export declare type TheNum = 42;\n","impliedFormat":1},{"version":"-9668872159-export type { TheNum } from './const.cjs';","signature":"-9835135925-export type { TheNum } from './const.cjs';\n","impliedFormat":1}],"options":{"composite":true,"module":100,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} - -//// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "program": { - "fileNames": [ - "../../../../../../../a/lib/lib.es2020.full.d.ts", - "../const.cts", - "../index.cts" - ], - "fileNamesList": [ - [ - "../const.cts" - ] - ], - "fileInfos": { - "../../../../../../../a/lib/lib.es2020.full.d.ts": { - "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "affectsGlobalScope": true, - "impliedFormat": 1 - }, - "../const.cts": { - "version": "-11202312776-export type TheNum = 42;", - "signature": "-9649133742-export declare type TheNum = 42;\n", - "impliedFormat": 1 - }, - "../index.cts": { - "version": "-9668872159-export type { TheNum } from './const.cjs';", - "signature": "-9835135925-export type { TheNum } from './const.cjs';\n", - "impliedFormat": 1 - } - }, - "options": { - "composite": true, - "module": 100, - "outDir": "./" - }, - "referencedMap": { - "../index.cts": [ - "../const.cts" - ] - }, - "exportedModulesMap": { - "../index.cts": [ - "../const.cts" - ] - }, - "semanticDiagnosticsPerFile": [ - "../../../../../../../a/lib/lib.es2020.full.d.ts", - "../const.cts", - "../index.cts" - ] - }, - "version": "FakeTSVersion", - "size": 1019 -} - -//// [/user/username/projects/myproject/packages/pkg2/build/index.cjs] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); - - -//// [/user/username/projects/myproject/packages/pkg2/build/index.d.cts] -export type { TheNum } from './const.cjs'; - - diff --git a/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js b/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js index e9634479566..5e7ba543d34 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/does-not-add-color-when-NO_COLOR-is-set.js @@ -85,7 +85,7 @@ default: es3 --module, -m Specify what module code is generated. -one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node12, nodenext +one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node16, nodenext default: undefined --lib diff --git a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js index 50b1c2f7ed7..eb384f25ae3 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js @@ -85,7 +85,7 @@ default: es3 --module, -m Specify what module code is generated. -one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node12, nodenext +one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node16, nodenext default: undefined --lib diff --git a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js index 50b1c2f7ed7..eb384f25ae3 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js @@ -85,7 +85,7 @@ default: es3 --module, -m Specify what module code is generated. -one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node12, nodenext +one of: none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node16, nodenext default: undefined --lib diff --git a/tests/cases/compiler/moduleResolutionWithModule.ts b/tests/cases/compiler/moduleResolutionWithModule.ts index de0c873cdd0..74601d43da2 100644 --- a/tests/cases/compiler/moduleResolutionWithModule.ts +++ b/tests/cases/compiler/moduleResolutionWithModule.ts @@ -1,5 +1,5 @@ -// @moduleResolution: node,node12,nodenext -// @module: commonjs,node12,nodenext +// @moduleResolution: node16,nodenext +// @module: commonjs,node16,nodenext // @filename: node_modules/pkg/package.json { "name": "pkg", diff --git a/tests/cases/compiler/tripleSlashTypesReferenceWithMissingExports.ts b/tests/cases/compiler/tripleSlashTypesReferenceWithMissingExports.ts index d5b58f5077f..fe80146389c 100644 --- a/tests/cases/compiler/tripleSlashTypesReferenceWithMissingExports.ts +++ b/tests/cases/compiler/tripleSlashTypesReferenceWithMissingExports.ts @@ -1,4 +1,4 @@ -// @module: commonjs,node12,nodenext +// @module: commonjs,node16,nodenext // @filename: node_modules/pkg/index.d.ts interface GlobalThing { a: number } // @filename: node_modules/pkg/package.json diff --git a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension1.ts b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension1.ts index 83e86fc6c60..0b740390a8a 100644 --- a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension1.ts +++ b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension1.ts @@ -1,5 +1,5 @@ -// @moduleResolution: node12 -// @module: node12 +// @moduleResolution: node16 +// @module: node16 // @filename: /src/foo.mts export function foo() { diff --git a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension2.ts b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension2.ts index 0051e17401c..a7adfbcac57 100644 --- a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension2.ts +++ b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension2.ts @@ -1,5 +1,5 @@ -// @moduleResolution: node12 -// @module: node12 +// @moduleResolution: node16 +// @module: node16 // @filename: /src/buzz.mts // Extensionless relative path cjs import in an ES module diff --git a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension5.ts b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension5.ts index 5053a242cd5..08011b2be63 100644 --- a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension5.ts +++ b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension5.ts @@ -1,5 +1,5 @@ -// @moduleResolution: node12 -// @module: node12 +// @moduleResolution: node16 +// @module: node16 // @filename: /src/buzz.mts // Extensionless relative path dynamic import in an ES module diff --git a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension6.ts b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension6.ts index 2a6ef2645dd..c846e6fd260 100644 --- a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension6.ts +++ b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension6.ts @@ -1,5 +1,5 @@ -// @moduleResolution: node12 -// @module: node12 +// @moduleResolution: node16 +// @module: node16 // @filename: /src/bar.cts // Extensionless relative path import statement in a cjs module diff --git a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension7.ts b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension7.ts index 3b10dd6e48a..f5e27470a02 100644 --- a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension7.ts +++ b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension7.ts @@ -1,5 +1,5 @@ -// @moduleResolution: node12 -// @module: node12 +// @moduleResolution: node16 +// @module: node16 // @filename: /src/bar.cts // Extensionless relative path cjs import in a cjs module diff --git a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension8.ts b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension8.ts index fef17b3aa1e..d862ba69de1 100644 --- a/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension8.ts +++ b/tests/cases/conformance/externalModules/moduleResolutionWithoutExtension8.ts @@ -1,5 +1,5 @@ -// @moduleResolution: node12 -// @module: node12 +// @moduleResolution: node16 +// @module: node16 // @filename: /src/bar.cts // Extensionless relative path dynamic import in a cjs module diff --git a/tests/cases/conformance/node/allowJs/nodeAllowJsPackageSelfName.ts b/tests/cases/conformance/node/allowJs/nodeAllowJsPackageSelfName.ts index a19a7104ae1..bf4718d847a 100644 --- a/tests/cases/conformance/node/allowJs/nodeAllowJsPackageSelfName.ts +++ b/tests/cases/conformance/node/allowJs/nodeAllowJsPackageSelfName.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJs1.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJs1.ts index 113c1fdeb8a..f790752053f 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJs1.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJs1.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsCjsFromJs.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsCjsFromJs.ts index ea0821742f8..74143dcefaa 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsCjsFromJs.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsCjsFromJs.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @allowJs: true // @noEmit: true // @filename: foo.cjs diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsConditionalPackageExports.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsConditionalPackageExports.ts index 1020812d5ae..f6f62444a61 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsConditionalPackageExports.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsConditionalPackageExports.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsDynamicImport.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsDynamicImport.ts index d7032c648b4..5da3c3e5425 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsDynamicImport.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsDynamicImport.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportAssignment.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportAssignment.ts index f7d5aaf822a..0457ce4cb62 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportAssignment.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportAssignment.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsGeneratedNameCollisions.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsGeneratedNameCollisions.ts index 14783731bf9..7cb94da8f60 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsGeneratedNameCollisions.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsGeneratedNameCollisions.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportAssignment.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportAssignment.ts index 53e6b944500..2688b07fb99 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportAssignment.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportAssignment.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions1.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions1.ts index d5727a3dc78..26874896143 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions1.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions1.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @importHelpers: true // @allowJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions2.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions2.ts index 032290f78ba..af20a16ba76 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions2.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions2.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @importHelpers: true // @allowJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions3.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions3.ts index 9452e2003a6..a6b91898853 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions3.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions3.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @importHelpers: true // @allowJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportMeta.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportMeta.ts index a8708434b93..43fdf016c43 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportMeta.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportMeta.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageExports.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageExports.ts index 65e5721b0bb..23de392ed7e 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageExports.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageExports.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageImports.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageImports.ts index b9d6027f5d7..84d0f650abc 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageImports.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageImports.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExports.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExports.ts index 2691885690b..eab5792b8fb 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExports.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExports.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsTrailers.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsTrailers.ts index 6b96f347583..b8ea4f9cbd8 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsTrailers.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsTrailers.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsSynchronousCallErrors.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsSynchronousCallErrors.ts index 15892edbe32..78025e25074 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsSynchronousCallErrors.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsSynchronousCallErrors.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsTopLevelAwait.ts b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsTopLevelAwait.ts index 872cad71c91..e18c50fef7a 100644 --- a/tests/cases/conformance/node/allowJs/nodeModulesAllowJsTopLevelAwait.ts +++ b/tests/cases/conformance/node/allowJs/nodeModulesAllowJsTopLevelAwait.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @allowJs: true // @checkJs: true diff --git a/tests/cases/conformance/node/nodeModules1.ts b/tests/cases/conformance/node/nodeModules1.ts index 698a6efec1e..32c83b4525b 100644 --- a/tests/cases/conformance/node/nodeModules1.ts +++ b/tests/cases/conformance/node/nodeModules1.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @filename: subfolder/index.ts // cjs format file diff --git a/tests/cases/conformance/node/nodeModulesCjsFormatFileAlwaysHasDefault.ts b/tests/cases/conformance/node/nodeModulesCjsFormatFileAlwaysHasDefault.ts index 06c6320d779..31051b3a18b 100644 --- a/tests/cases/conformance/node/nodeModulesCjsFormatFileAlwaysHasDefault.ts +++ b/tests/cases/conformance/node/nodeModulesCjsFormatFileAlwaysHasDefault.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @filename: subfolder/index.ts // cjs format file diff --git a/tests/cases/conformance/node/nodeModulesConditionalPackageExports.ts b/tests/cases/conformance/node/nodeModulesConditionalPackageExports.ts index 07bf9d9724c..a0240cdef4e 100644 --- a/tests/cases/conformance/node/nodeModulesConditionalPackageExports.ts +++ b/tests/cases/conformance/node/nodeModulesConditionalPackageExports.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @outDir: out // @filename: index.ts diff --git a/tests/cases/conformance/node/nodeModulesDeclarationEmitWithPackageExports.ts b/tests/cases/conformance/node/nodeModulesDeclarationEmitWithPackageExports.ts index 2599ff429ff..9b4eb3ec9f8 100644 --- a/tests/cases/conformance/node/nodeModulesDeclarationEmitWithPackageExports.ts +++ b/tests/cases/conformance/node/nodeModulesDeclarationEmitWithPackageExports.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @outDir: out // @filename: index.ts diff --git a/tests/cases/conformance/node/nodeModulesDynamicImport.ts b/tests/cases/conformance/node/nodeModulesDynamicImport.ts index 46b317ca52d..0864b42bbaf 100644 --- a/tests/cases/conformance/node/nodeModulesDynamicImport.ts +++ b/tests/cases/conformance/node/nodeModulesDynamicImport.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @filename: subfolder/index.ts // cjs format file diff --git a/tests/cases/conformance/node/nodeModulesExportAssignments.ts b/tests/cases/conformance/node/nodeModulesExportAssignments.ts index 7cbcd200d96..efc867fa1c6 100644 --- a/tests/cases/conformance/node/nodeModulesExportAssignments.ts +++ b/tests/cases/conformance/node/nodeModulesExportAssignments.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @filename: subfolder/index.ts // cjs format file diff --git a/tests/cases/conformance/node/nodeModulesExportsBlocksSpecifierResolution.ts b/tests/cases/conformance/node/nodeModulesExportsBlocksSpecifierResolution.ts index ffc5adf8e07..ee6587b5ea0 100644 --- a/tests/cases/conformance/node/nodeModulesExportsBlocksSpecifierResolution.ts +++ b/tests/cases/conformance/node/nodeModulesExportsBlocksSpecifierResolution.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @filename: index.ts // esm format file diff --git a/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationConditions.ts b/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationConditions.ts index 2562c7a4a11..92c686f1c23 100644 --- a/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationConditions.ts +++ b/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationConditions.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @filename: index.ts // esm format file diff --git a/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationDirectory.ts b/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationDirectory.ts index 2eb8ac58e66..684cb5588fc 100644 --- a/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationDirectory.ts +++ b/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationDirectory.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @filename: index.ts // esm format file diff --git a/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationPattern.ts b/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationPattern.ts index 97812da5b57..a325a2dfe6c 100644 --- a/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationPattern.ts +++ b/tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationPattern.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @filename: index.ts // esm format file diff --git a/tests/cases/conformance/node/nodeModulesForbidenSyntax.ts b/tests/cases/conformance/node/nodeModulesForbidenSyntax.ts index d441627d7d0..ca9ff3cf413 100644 --- a/tests/cases/conformance/node/nodeModulesForbidenSyntax.ts +++ b/tests/cases/conformance/node/nodeModulesForbidenSyntax.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @filename: subfolder/index.ts // cjs format file diff --git a/tests/cases/conformance/node/nodeModulesGeneratedNameCollisions.ts b/tests/cases/conformance/node/nodeModulesGeneratedNameCollisions.ts index e9a9b9d9edd..6f6fa8acb07 100644 --- a/tests/cases/conformance/node/nodeModulesGeneratedNameCollisions.ts +++ b/tests/cases/conformance/node/nodeModulesGeneratedNameCollisions.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @filename: subfolder/index.ts // cjs format file diff --git a/tests/cases/conformance/node/nodeModulesImportAssertions.ts b/tests/cases/conformance/node/nodeModulesImportAssertions.ts index 0fe1ccdf820..ae941bd003b 100644 --- a/tests/cases/conformance/node/nodeModulesImportAssertions.ts +++ b/tests/cases/conformance/node/nodeModulesImportAssertions.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @resolveJsonModule: true // @filename: index.ts import json from "./package.json" assert { type: "json" }; diff --git a/tests/cases/conformance/node/nodeModulesImportAssignments.ts b/tests/cases/conformance/node/nodeModulesImportAssignments.ts index 6c22fe83e00..cce29eb0d75 100644 --- a/tests/cases/conformance/node/nodeModulesImportAssignments.ts +++ b/tests/cases/conformance/node/nodeModulesImportAssignments.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @filename: subfolder/index.ts // cjs format file diff --git a/tests/cases/conformance/node/nodeModulesImportHelpersCollisions.ts b/tests/cases/conformance/node/nodeModulesImportHelpersCollisions.ts index 103b5837124..0a4698a95fb 100644 --- a/tests/cases/conformance/node/nodeModulesImportHelpersCollisions.ts +++ b/tests/cases/conformance/node/nodeModulesImportHelpersCollisions.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @importHelpers: true // @filename: subfolder/index.ts diff --git a/tests/cases/conformance/node/nodeModulesImportHelpersCollisions2.ts b/tests/cases/conformance/node/nodeModulesImportHelpersCollisions2.ts index 7f90947a5fb..58e65723cbc 100644 --- a/tests/cases/conformance/node/nodeModulesImportHelpersCollisions2.ts +++ b/tests/cases/conformance/node/nodeModulesImportHelpersCollisions2.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @importHelpers: true // @filename: subfolder/index.ts diff --git a/tests/cases/conformance/node/nodeModulesImportHelpersCollisions3.ts b/tests/cases/conformance/node/nodeModulesImportHelpersCollisions3.ts index 5f6984ad1fb..3145df76cd5 100644 --- a/tests/cases/conformance/node/nodeModulesImportHelpersCollisions3.ts +++ b/tests/cases/conformance/node/nodeModulesImportHelpersCollisions3.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @importHelpers: true // @filename: subfolder/index.ts diff --git a/tests/cases/conformance/node/nodeModulesImportMeta.ts b/tests/cases/conformance/node/nodeModulesImportMeta.ts index d684c7b5cb2..cc8bdcce9da 100644 --- a/tests/cases/conformance/node/nodeModulesImportMeta.ts +++ b/tests/cases/conformance/node/nodeModulesImportMeta.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @filename: subfolder/index.ts // cjs format file diff --git a/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit1.ts b/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit1.ts index 5a9a0ef8cee..c1c0c57cf9d 100644 --- a/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit1.ts +++ b/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit1.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit2.ts b/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit2.ts index 7b819fddf49..06a9b226b21 100644 --- a/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit2.ts +++ b/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit2.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmitErrors1.ts b/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmitErrors1.ts index 1e475dfc63a..01907185636 100644 --- a/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmitErrors1.ts +++ b/tests/cases/conformance/node/nodeModulesImportModeDeclarationEmitErrors1.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesImportResolutionIntoExport.ts b/tests/cases/conformance/node/nodeModulesImportResolutionIntoExport.ts index 2a407b2bc68..58a8adbf9b0 100644 --- a/tests/cases/conformance/node/nodeModulesImportResolutionIntoExport.ts +++ b/tests/cases/conformance/node/nodeModulesImportResolutionIntoExport.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @filename: index.ts // esm format file diff --git a/tests/cases/conformance/node/nodeModulesImportResolutionNoCycle.ts b/tests/cases/conformance/node/nodeModulesImportResolutionNoCycle.ts index c0482c86ec2..b3a4139a00c 100644 --- a/tests/cases/conformance/node/nodeModulesImportResolutionNoCycle.ts +++ b/tests/cases/conformance/node/nodeModulesImportResolutionNoCycle.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @filename: index.ts // esm format file diff --git a/tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmit1.ts b/tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmit1.ts index 41d64844e09..c6ca4e2f13f 100644 --- a/tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmit1.ts +++ b/tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmit1.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmitErrors1.ts b/tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmitErrors1.ts index d6f35e46385..d118bc6da29 100644 --- a/tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmitErrors1.ts +++ b/tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmitErrors1.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesPackageExports.ts b/tests/cases/conformance/node/nodeModulesPackageExports.ts index 897d01b07d7..6433e49270f 100644 --- a/tests/cases/conformance/node/nodeModulesPackageExports.ts +++ b/tests/cases/conformance/node/nodeModulesPackageExports.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @outDir: out // @filename: index.ts diff --git a/tests/cases/conformance/node/nodeModulesPackageImports.ts b/tests/cases/conformance/node/nodeModulesPackageImports.ts index cccf930098e..55122ed464f 100644 --- a/tests/cases/conformance/node/nodeModulesPackageImports.ts +++ b/tests/cases/conformance/node/nodeModulesPackageImports.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @filename: index.ts // esm format file diff --git a/tests/cases/conformance/node/nodeModulesPackagePatternExports.ts b/tests/cases/conformance/node/nodeModulesPackagePatternExports.ts index e22e497a942..4a4af53809a 100644 --- a/tests/cases/conformance/node/nodeModulesPackagePatternExports.ts +++ b/tests/cases/conformance/node/nodeModulesPackagePatternExports.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @outDir: out // @filename: index.ts diff --git a/tests/cases/conformance/node/nodeModulesPackagePatternExportsTrailers.ts b/tests/cases/conformance/node/nodeModulesPackagePatternExportsTrailers.ts index 3abe36e0d69..ad842bcdb4a 100644 --- a/tests/cases/conformance/node/nodeModulesPackagePatternExportsTrailers.ts +++ b/tests/cases/conformance/node/nodeModulesPackagePatternExportsTrailers.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @outDir: out // @filename: index.ts diff --git a/tests/cases/conformance/node/nodeModulesResolveJsonModule.ts b/tests/cases/conformance/node/nodeModulesResolveJsonModule.ts index c298685c228..33bc45a2a07 100644 --- a/tests/cases/conformance/node/nodeModulesResolveJsonModule.ts +++ b/tests/cases/conformance/node/nodeModulesResolveJsonModule.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @resolveJsonModule: true // @outDir: ./out // @declaration: true diff --git a/tests/cases/conformance/node/nodeModulesSynchronousCallErrors.ts b/tests/cases/conformance/node/nodeModulesSynchronousCallErrors.ts index 78aa93ee17c..203760b4e5d 100644 --- a/tests/cases/conformance/node/nodeModulesSynchronousCallErrors.ts +++ b/tests/cases/conformance/node/nodeModulesSynchronousCallErrors.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @filename: subfolder/index.ts // cjs format file diff --git a/tests/cases/conformance/node/nodeModulesTopLevelAwait.ts b/tests/cases/conformance/node/nodeModulesTopLevelAwait.ts index 2fbd5d3b0cd..0e532ced3ba 100644 --- a/tests/cases/conformance/node/nodeModulesTopLevelAwait.ts +++ b/tests/cases/conformance/node/nodeModulesTopLevelAwait.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @filename: subfolder/index.ts // cjs format file diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit1.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit1.ts index 8e99536aa8c..b1e4156f7fe 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit1.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit1.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit2.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit2.ts index 9349d1c2767..501d62d8db4 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit2.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit2.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit3.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit3.ts index 8c16d1bd455..5ccdd5f1f9f 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit3.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit3.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit4.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit4.ts index 6d778bb754c..2efe66d7462 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit4.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit4.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit5.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit5.ts index 6694ad03d8d..849f1ee97cd 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit5.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit5.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit6.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit6.ts index 8a38a967170..4ceec4badef 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit6.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit6.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit7.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit7.ts index 317728fbaa8..5260cc2ae77 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit7.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit7.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @outDir: out // @filename: /node_modules/pkg/package.json diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride1.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride1.ts index 061d16a7560..c488964766d 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride1.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride1.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node12,nodenext +// @module: node16,nodenext // @outDir: out // @filename: /node_modules/pkg/package.json { diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride2.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride2.ts index 105e52cf2d8..79eeba94abf 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride2.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride2.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node12,nodenext +// @module: node16,nodenext // @outDir: out // @filename: /node_modules/pkg/package.json { diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride3.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride3.ts index d183196f176..74a9d2fffe5 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride3.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride3.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node12,nodenext +// @module: node16,nodenext // @outDir: out // @filename: /node_modules/pkg/package.json { diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride4.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride4.ts index 466d47fba20..26bc3c8f393 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride4.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride4.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node12,nodenext +// @module: node16,nodenext // @outDir: out // @filename: /node_modules/pkg/package.json { diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride5.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride5.ts index e9198bd5107..2174f959237 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride5.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride5.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node12,nodenext +// @module: node16,nodenext // @outDir: out // @filename: /node_modules/pkg/package.json { diff --git a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverrideModeError.ts b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverrideModeError.ts index 197b2db20ba..84828c5dabb 100644 --- a/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverrideModeError.ts +++ b/tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverrideModeError.ts @@ -1,5 +1,5 @@ // @noImplicitReferences: true -// @module: node12,nodenext +// @module: node16,nodenext // @outDir: out // @filename: /node_modules/pkg/package.json { diff --git a/tests/cases/conformance/node/nodeModulesTypesVersionPackageExports.ts b/tests/cases/conformance/node/nodeModulesTypesVersionPackageExports.ts index 52cda091b32..1cdaef53f24 100644 --- a/tests/cases/conformance/node/nodeModulesTypesVersionPackageExports.ts +++ b/tests/cases/conformance/node/nodeModulesTypesVersionPackageExports.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @outDir: out // @filename: index.ts diff --git a/tests/cases/conformance/node/nodePackageSelfName.ts b/tests/cases/conformance/node/nodePackageSelfName.ts index 099d9c424e1..ec9dd150591 100644 --- a/tests/cases/conformance/node/nodePackageSelfName.ts +++ b/tests/cases/conformance/node/nodePackageSelfName.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @filename: index.ts // esm format file diff --git a/tests/cases/conformance/node/nodePackageSelfNameScoped.ts b/tests/cases/conformance/node/nodePackageSelfNameScoped.ts index f4ef1e3798c..9e9eef38496 100644 --- a/tests/cases/conformance/node/nodePackageSelfNameScoped.ts +++ b/tests/cases/conformance/node/nodePackageSelfNameScoped.ts @@ -1,4 +1,4 @@ -// @module: node12,nodenext +// @module: node16,nodenext // @declaration: true // @filename: index.ts // esm format file diff --git a/tests/cases/fourslash/autoImport_node12_node_modules1.ts b/tests/cases/fourslash/autoImport_node12_node_modules1.ts index 5020f5809b4..80a9e157311 100644 --- a/tests/cases/fourslash/autoImport_node12_node_modules1.ts +++ b/tests/cases/fourslash/autoImport_node12_node_modules1.ts @@ -1,6 +1,6 @@ /// -// @module: node12 +// @module: node16 // @Filename: /node_modules/undici/index.d.ts //// export function request(): any; diff --git a/tests/cases/fourslash/moduleNodeNextImportFix.ts b/tests/cases/fourslash/moduleNodeNextImportFix.ts index 74edf7daff3..19b2aa291e1 100644 --- a/tests/cases/fourslash/moduleNodeNextImportFix.ts +++ b/tests/cases/fourslash/moduleNodeNextImportFix.ts @@ -8,7 +8,7 @@ ////{ //// "compilerOptions": { //// "outDir": "./dist", -//// "module": "node12", +//// "module": "node16", //// "target": "esnext" //// }, //// "include": ["./src"] diff --git a/tests/cases/fourslash/refactorConvertToEsModule_module_node12.ts b/tests/cases/fourslash/refactorConvertToEsModule_module_node12.ts index a7be99ba157..475fc0f5c53 100644 --- a/tests/cases/fourslash/refactorConvertToEsModule_module_node12.ts +++ b/tests/cases/fourslash/refactorConvertToEsModule_module_node12.ts @@ -2,7 +2,7 @@ // @allowJs: true // @target: esnext -// @module: node12 +// @module: node16 // @Filename: /a.js ////module.exports = 0; From 9469f95bd4befe41de4ed7f0c1728ca7be05c402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Wed, 4 May 2022 02:05:37 +0200 Subject: [PATCH 48/63] Add tests case for function check type being correctly paranthesized in quick info (#48836) --- tests/cases/fourslash/quickInfoFunctionCheckType.ts | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/cases/fourslash/quickInfoFunctionCheckType.ts diff --git a/tests/cases/fourslash/quickInfoFunctionCheckType.ts b/tests/cases/fourslash/quickInfoFunctionCheckType.ts new file mode 100644 index 00000000000..813b920db3b --- /dev/null +++ b/tests/cases/fourslash/quickInfoFunctionCheckType.ts @@ -0,0 +1,6 @@ +/// + +////export type /**/Tail = ((...t: T) => void) extends (h: any, ...rest: infer R) => void ? R : never; + +verify.quickInfoAt("", "type Tail = ((...t: T) => void) extends (h: any, ...rest: infer R) => void ? R : never"); + From ad2b7a6d3132910ad625757c453695ba040365ad Mon Sep 17 00:00:00 2001 From: BrandonXLF <42590338+BrandonXLF@users.noreply.github.com> Date: Wed, 4 May 2022 11:13:46 -0400 Subject: [PATCH 49/63] Document encodeURIComponent/encodeURI's argument as unencoded (#48803) --- src/lib/es5.d.ts | 4 +- .../completionsCommentsClass.baseline | 4 +- .../completionsCommentsClassMembers.baseline | 80 +++++++++---------- ...completionsCommentsCommentParsing.baseline | 28 +++---- ...etionsCommentsFunctionDeclaration.baseline | 12 +-- ...letionsCommentsFunctionExpression.baseline | 16 ++-- 6 files changed, 72 insertions(+), 72 deletions(-) diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 3ee69f61a02..75b9539cc75 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -52,13 +52,13 @@ declare function decodeURIComponent(encodedURIComponent: string): string; /** * Encodes a text string as a valid Uniform Resource Identifier (URI) - * @param uri A value representing an encoded URI. + * @param uri A value representing an unencoded URI. */ declare function encodeURI(uri: string): string; /** * Encodes a text string as a valid component of a Uniform Resource Identifier (URI). - * @param uriComponent A value representing an encoded URI component. + * @param uriComponent A value representing an unencoded URI component. */ declare function encodeURIComponent(uriComponent: string | number | boolean): string; diff --git a/tests/baselines/reference/completionsCommentsClass.baseline b/tests/baselines/reference/completionsCommentsClass.baseline index f7144af7e12..5dce64b756e 100644 --- a/tests/baselines/reference/completionsCommentsClass.baseline +++ b/tests/baselines/reference/completionsCommentsClass.baseline @@ -1340,7 +1340,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -1453,7 +1453,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] diff --git a/tests/baselines/reference/completionsCommentsClassMembers.baseline b/tests/baselines/reference/completionsCommentsClassMembers.baseline index 9a068cdbf28..6180976aaba 100644 --- a/tests/baselines/reference/completionsCommentsClassMembers.baseline +++ b/tests/baselines/reference/completionsCommentsClassMembers.baseline @@ -2369,7 +2369,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -2482,7 +2482,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -9430,7 +9430,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -9543,7 +9543,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -14244,7 +14244,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -14357,7 +14357,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -21305,7 +21305,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -21418,7 +21418,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -25370,7 +25370,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -25483,7 +25483,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -30591,7 +30591,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -30704,7 +30704,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -34610,7 +34610,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -34723,7 +34723,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -39785,7 +39785,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -39898,7 +39898,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -45006,7 +45006,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -45119,7 +45119,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -50227,7 +50227,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -50340,7 +50340,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -55448,7 +55448,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -55561,7 +55561,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -59508,7 +59508,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -59621,7 +59621,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -63568,7 +63568,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -63681,7 +63681,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -67628,7 +67628,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -67741,7 +67741,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -71688,7 +71688,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -71801,7 +71801,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -75748,7 +75748,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -75861,7 +75861,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -79808,7 +79808,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -79921,7 +79921,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -84209,7 +84209,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -84322,7 +84322,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -89567,7 +89567,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -89680,7 +89680,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -94181,7 +94181,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -94294,7 +94294,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] diff --git a/tests/baselines/reference/completionsCommentsCommentParsing.baseline b/tests/baselines/reference/completionsCommentsCommentParsing.baseline index f03678262a7..d4a9a88a0a1 100644 --- a/tests/baselines/reference/completionsCommentsCommentParsing.baseline +++ b/tests/baselines/reference/completionsCommentsCommentParsing.baseline @@ -3203,7 +3203,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -3316,7 +3316,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -8852,7 +8852,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -8965,7 +8965,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -15271,7 +15271,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -15384,7 +15384,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -20816,7 +20816,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -20929,7 +20929,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -26715,7 +26715,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -26828,7 +26828,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -32364,7 +32364,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -32477,7 +32477,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -38704,7 +38704,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -38817,7 +38817,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] diff --git a/tests/baselines/reference/completionsCommentsFunctionDeclaration.baseline b/tests/baselines/reference/completionsCommentsFunctionDeclaration.baseline index 68e1b3d6ce0..3c056e5f263 100644 --- a/tests/baselines/reference/completionsCommentsFunctionDeclaration.baseline +++ b/tests/baselines/reference/completionsCommentsFunctionDeclaration.baseline @@ -1071,7 +1071,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -1184,7 +1184,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -5343,7 +5343,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -5456,7 +5456,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -8859,7 +8859,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -8972,7 +8972,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] diff --git a/tests/baselines/reference/completionsCommentsFunctionExpression.baseline b/tests/baselines/reference/completionsCommentsFunctionExpression.baseline index 5be58374a3f..e153a2ecdaf 100644 --- a/tests/baselines/reference/completionsCommentsFunctionExpression.baseline +++ b/tests/baselines/reference/completionsCommentsFunctionExpression.baseline @@ -1247,7 +1247,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -1360,7 +1360,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -5175,7 +5175,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -5288,7 +5288,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -9793,7 +9793,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -9906,7 +9906,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] @@ -13493,7 +13493,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI.", + "text": "A value representing an unencoded URI.", "kind": "text" } ] @@ -13606,7 +13606,7 @@ "kind": "space" }, { - "text": "A value representing an encoded URI component.", + "text": "A value representing an unencoded URI component.", "kind": "text" } ] From d337cbc19f12159014fda24cef22e0e02f7a9314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Wed, 4 May 2022 17:23:08 +0200 Subject: [PATCH 50/63] Run `mocha` using `process.execPath` instead of harcoding `"node"` (#48797) --- scripts/build/tests.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/build/tests.js b/scripts/build/tests.js index 10c6db79cf1..84cd23bfc10 100644 --- a/scripts/build/tests.js +++ b/scripts/build/tests.js @@ -122,7 +122,9 @@ async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode, try { setNodeEnvToDevelopment(); - const { exitCode } = await exec("node", args, { cancelToken }); + const { exitCode } = await exec(process.execPath, args, { + cancelToken, + }); if (exitCode !== 0) { errorStatus = exitCode; error = new Error(`Process exited with status code ${errorStatus}.`); From d879880a3778d02b57642251e0d3d719ec95599a Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Wed, 4 May 2022 08:35:29 -0700 Subject: [PATCH 51/63] =?UTF-8?q?Don=E2=80=99t=20let=20other=20completions?= =?UTF-8?q?=20shadow=20type=20keywords=20in=20type=20locations=20(#48939)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Allow type keywords with the same names as other completions * Only add type keywords that are the same as other completions in type locations --- src/services/completions.ts | 4 +- ...rtProvider_namespaceSameNameAsIntrinsic.ts | 39 +++++++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 tests/cases/fourslash/server/autoImportProvider_namespaceSameNameAsIntrinsic.ts diff --git a/src/services/completions.ts b/src/services/completions.ts index 5a08941b9af..27066f7b72e 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -164,7 +164,7 @@ namespace ts.Completions { TypeAssertionKeywords, TypeKeywords, TypeKeyword, // Literally just `type` - Last = TypeKeywords + Last = TypeKeyword } const enum GlobalsSearch { Continue, Success, Fail } @@ -574,7 +574,7 @@ namespace ts.Completions { if (keywordFilters !== KeywordCompletionFilters.None) { const entryNames = new Set(entries.map(e => e.name)); for (const keywordEntry of getKeywordCompletions(keywordFilters, !insideJsDocTagTypeExpression && isSourceFileJS(sourceFile))) { - if (!entryNames.has(keywordEntry.name)) { + if (isTypeOnlyLocation && isTypeKeyword(stringToToken(keywordEntry.name)!) || !entryNames.has(keywordEntry.name)) { insertSorted(entries, keywordEntry, compareCompletionEntries, /*allowDuplicates*/ true); } } diff --git a/tests/cases/fourslash/server/autoImportProvider_namespaceSameNameAsIntrinsic.ts b/tests/cases/fourslash/server/autoImportProvider_namespaceSameNameAsIntrinsic.ts new file mode 100644 index 00000000000..f4c6342f44e --- /dev/null +++ b/tests/cases/fourslash/server/autoImportProvider_namespaceSameNameAsIntrinsic.ts @@ -0,0 +1,39 @@ +/// + +// @Filename: /node_modules/fp-ts/package.json +//// { "name": "fp-ts", "version": "0.10.4" } + +// @Filename: /node_modules/fp-ts/index.d.ts +//// export * as string from "./lib/string"; + +// @Filename: /node_modules/fp-ts/lib/string.d.ts +//// export declare const fromString: (s: string) => string; +//// export type SafeString = string; + +// @Filename: /package.json +//// { "dependencies": { "fp-ts": "^0.10.4" } } + +// @Filename: /tsconfig.json +//// { "compilerOptions": { "module": "commonjs" } } + +// @Filename: /index.ts +//// type A = { name: string/**/ } + +goTo.marker(""); +verify.completions({ + marker: "", + includes: [{ + name: "string", + sortText: completion.SortText.GlobalsOrKeywords, + }, { + name: "string", + sortText: completion.SortText.AutoImportSuggestions, + source: "fp-ts", + sourceDisplay: "fp-ts", + hasAction: true, + }], + preferences: { + includeCompletionsForModuleExports: true, + allowIncompleteCompletions: true, + }, +}); From c8ec855f9fd5efa2a324b08ad4cc468b4c3013d4 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 4 May 2022 08:59:11 -0700 Subject: [PATCH 52/63] When source file is redirected, set the prototype correctly in node factory (#48862) Fixes #48039 --- src/compiler/factory/nodeFactory.ts | 2 +- src/testRunner/tsconfig.json | 1 + src/testRunner/unittests/tsc/redirect.ts | 34 ++++++++++ .../tsc/redirect/when-redirecting-ts-file.js | 68 +++++++++++++++++++ 4 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 src/testRunner/unittests/tsc/redirect.ts create mode 100644 tests/baselines/reference/tsc/redirect/when-redirecting-ts-file.js diff --git a/src/compiler/factory/nodeFactory.ts b/src/compiler/factory/nodeFactory.ts index cbeb8df5e5b..9028c521a13 100644 --- a/src/compiler/factory/nodeFactory.ts +++ b/src/compiler/factory/nodeFactory.ts @@ -5275,7 +5275,7 @@ namespace ts { hasNoDefaultLib: boolean, libReferences: readonly FileReference[] ) { - const node = baseFactory.createBaseSourceFileNode(SyntaxKind.SourceFile) as Mutable; + const node = (source.redirectInfo ? Object.create(source.redirectInfo.redirectTarget) : baseFactory.createBaseSourceFileNode(SyntaxKind.SourceFile)) as Mutable; for (const p in source) { if (p === "emitNode" || hasProperty(node, p) || !hasProperty(source, p)) continue; (node as any)[p] = (source as any)[p]; diff --git a/src/testRunner/tsconfig.json b/src/testRunner/tsconfig.json index 599aaa19a86..619d3f245c7 100644 --- a/src/testRunner/tsconfig.json +++ b/src/testRunner/tsconfig.json @@ -154,6 +154,7 @@ "unittests/tsc/incremental.ts", "unittests/tsc/listFilesOnly.ts", "unittests/tsc/projectReferences.ts", + "unittests/tsc/redirect.ts", "unittests/tsc/runWithoutArgs.ts", "unittests/tscWatch/consoleClearing.ts", "unittests/tscWatch/emit.ts", diff --git a/src/testRunner/unittests/tsc/redirect.ts b/src/testRunner/unittests/tsc/redirect.ts new file mode 100644 index 00000000000..e131ba821af --- /dev/null +++ b/src/testRunner/unittests/tsc/redirect.ts @@ -0,0 +1,34 @@ +namespace ts { + describe("unittests:: tsc:: redirect::", () => { + verifyTsc({ + scenario: "redirect", + subScenario: "when redirecting ts file", + fs: () => loadProjectFromFiles({ + "/src/project/tsconfig.json": JSON.stringify({ + compilerOptions: { + outDir: "out" + }, + include: [ + "copy1/node_modules/target/*", + "copy2/node_modules/target/*", + ] + }), + "/src/project/copy1/node_modules/target/index.ts": "export const a = 1;", + "/src/project/copy1/node_modules/target/import.ts": `import {} from "./";`, + "/src/project/copy1/node_modules/target/package.json": JSON.stringify({ + name: "target", + version: "1.0.0", + main: "index.js", + }), + "/src/project/copy2/node_modules/target/index.ts": "export const a = 1;", + "/src/project/copy2/node_modules/target/import.ts": `import {} from "./";`, + "/src/project/copy2/node_modules/target/package.json": JSON.stringify({ + name: "target", + version: "1.0.0", + main: "index.js", + }), + }), + commandLineArgs: ["-p", "src/project"], + }); + }); +} diff --git a/tests/baselines/reference/tsc/redirect/when-redirecting-ts-file.js b/tests/baselines/reference/tsc/redirect/when-redirecting-ts-file.js new file mode 100644 index 00000000000..b50062956ca --- /dev/null +++ b/tests/baselines/reference/tsc/redirect/when-redirecting-ts-file.js @@ -0,0 +1,68 @@ +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/copy1/node_modules/target/import.ts] +import {} from "./"; + +//// [/src/project/copy1/node_modules/target/index.ts] +export const a = 1; + +//// [/src/project/copy1/node_modules/target/package.json] +{"name":"target","version":"1.0.0","main":"index.js"} + +//// [/src/project/copy2/node_modules/target/import.ts] +import {} from "./"; + +//// [/src/project/copy2/node_modules/target/index.ts] +export const a = 1; + +//// [/src/project/copy2/node_modules/target/package.json] +{"name":"target","version":"1.0.0","main":"index.js"} + +//// [/src/project/tsconfig.json] +{"compilerOptions":{"outDir":"out"},"include":["copy1/node_modules/target/*","copy2/node_modules/target/*"]} + + + +Output:: +/lib/tsc -p src/project +exitCode:: ExitStatus.Success + + +//// [/src/project/out/copy1/node_modules/target/import.js] +"use strict"; +exports.__esModule = true; + + +//// [/src/project/out/copy1/node_modules/target/index.js] +"use strict"; +exports.__esModule = true; +exports.a = void 0; +exports.a = 1; + + +//// [/src/project/out/copy2/node_modules/target/import.js] +"use strict"; +exports.__esModule = true; + + +//// [/src/project/out/copy2/node_modules/target/index.js] +"use strict"; +exports.__esModule = true; +exports.a = void 0; +exports.a = 1; + + From f579f3307e5d253b2ab07833458fcac469440619 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Wed, 4 May 2022 15:01:05 -0700 Subject: [PATCH 53/63] Revert "Don't treat a colon in a conditional expression branch as part of an arrow function" (#48940) --- src/compiler/parser.ts | 82 ++++++++----------- ...parserArrowFunctionExpression10.errors.txt | 20 ++--- .../parserArrowFunctionExpression10.js | 5 +- .../parserArrowFunctionExpression10.symbols | 6 +- .../parserArrowFunctionExpression10.types | 12 ++- ...parserArrowFunctionExpression11.errors.txt | 13 +-- .../parserArrowFunctionExpression11.js | 4 +- .../parserArrowFunctionExpression11.symbols | 3 +- .../parserArrowFunctionExpression11.types | 8 +- ...parserArrowFunctionExpression12.errors.txt | 13 +-- .../parserArrowFunctionExpression12.js | 4 +- .../parserArrowFunctionExpression12.symbols | 3 +- .../parserArrowFunctionExpression12.types | 10 +-- .../parserArrowFunctionExpression15.js | 6 ++ .../parserArrowFunctionExpression15.symbols | 5 ++ .../parserArrowFunctionExpression15.types | 9 ++ .../parserArrowFunctionExpression16.js | 6 ++ .../parserArrowFunctionExpression16.symbols | 5 ++ .../parserArrowFunctionExpression16.types | 12 +++ .../parserArrowFunctionExpression8.errors.txt | 13 ++- .../parserArrowFunctionExpression8.js | 7 +- .../parserArrowFunctionExpression8.symbols | 2 +- .../parserArrowFunctionExpression8.types | 11 ++- ...arserArrowFunctionExpression8Js.errors.txt | 16 +++- .../parserArrowFunctionExpression8Js.js | 7 +- .../parserArrowFunctionExpression8Js.symbols | 2 +- .../parserArrowFunctionExpression8Js.types | 11 ++- .../parserArrowFunctionExpression9.errors.txt | 13 +-- .../parserArrowFunctionExpression9.js | 4 +- .../parserArrowFunctionExpression9.symbols | 3 +- .../parserArrowFunctionExpression9.types | 6 +- .../parserArrowFunctionExpression15.ts | 1 + .../parserArrowFunctionExpression16.ts | 1 + 33 files changed, 199 insertions(+), 124 deletions(-) create mode 100644 tests/baselines/reference/parserArrowFunctionExpression15.js create mode 100644 tests/baselines/reference/parserArrowFunctionExpression15.symbols create mode 100644 tests/baselines/reference/parserArrowFunctionExpression15.types create mode 100644 tests/baselines/reference/parserArrowFunctionExpression16.js create mode 100644 tests/baselines/reference/parserArrowFunctionExpression16.symbols create mode 100644 tests/baselines/reference/parserArrowFunctionExpression16.types create mode 100644 tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression15.ts create mode 100644 tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression16.ts diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 32e00834bb4..594d7674b92 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -4290,10 +4290,10 @@ namespace ts { } const pos = getNodePos(); - let expr = parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false); + let expr = parseAssignmentExpressionOrHigher(); let operatorToken: BinaryOperatorToken; while ((operatorToken = parseOptionalToken(SyntaxKind.CommaToken))) { - expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false), pos); + expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher(), pos); } if (saveDecoratorContext) { @@ -4303,10 +4303,10 @@ namespace ts { } function parseInitializer(): Expression | undefined { - return parseOptional(SyntaxKind.EqualsToken) ? parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false) : undefined; + return parseOptional(SyntaxKind.EqualsToken) ? parseAssignmentExpressionOrHigher() : undefined; } - function parseAssignmentExpressionOrHigher(disallowReturnTypeInArrowFunction: boolean): Expression { + function parseAssignmentExpressionOrHigher(): Expression { // AssignmentExpression[in,yield]: // 1) ConditionalExpression[?in,?yield] // 2) LeftHandSideExpression = AssignmentExpression[?in,?yield] @@ -4334,7 +4334,7 @@ namespace ts { // If we do successfully parse arrow-function, we must *not* recurse for productions 1, 2 or 3. An ArrowFunction is // not a LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done // with AssignmentExpression if we see one. - const arrowExpression = tryParseParenthesizedArrowFunctionExpression(disallowReturnTypeInArrowFunction) || tryParseAsyncSimpleArrowFunctionExpression(disallowReturnTypeInArrowFunction); + const arrowExpression = tryParseParenthesizedArrowFunctionExpression() || tryParseAsyncSimpleArrowFunctionExpression(); if (arrowExpression) { return arrowExpression; } @@ -4355,7 +4355,7 @@ namespace ts { // parameter ('x => ...') above. We handle it here by checking if the parsed expression was a single // identifier and the current token is an arrow. if (expr.kind === SyntaxKind.Identifier && token() === SyntaxKind.EqualsGreaterThanToken) { - return parseSimpleArrowFunctionExpression(pos, expr as Identifier, disallowReturnTypeInArrowFunction, /*asyncModifier*/ undefined); + return parseSimpleArrowFunctionExpression(pos, expr as Identifier, /*asyncModifier*/ undefined); } // Now see if we might be in cases '2' or '3'. @@ -4365,7 +4365,7 @@ namespace ts { // Note: we call reScanGreaterToken so that we get an appropriately merged token // for cases like `> > =` becoming `>>=` if (isLeftHandSideExpression(expr) && isAssignmentOperator(reScanGreaterToken())) { - return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(disallowReturnTypeInArrowFunction), pos); + return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(), pos); } // It wasn't an assignment or a lambda. This is a conditional expression: @@ -4419,7 +4419,7 @@ namespace ts { return finishNode( factory.createYieldExpression( parseOptionalToken(SyntaxKind.AsteriskToken), - parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false) + parseAssignmentExpressionOrHigher() ), pos ); @@ -4431,7 +4431,7 @@ namespace ts { } } - function parseSimpleArrowFunctionExpression(pos: number, identifier: Identifier, disallowReturnTypeInArrowFunction: boolean, asyncModifier?: NodeArray | undefined): ArrowFunction { + function parseSimpleArrowFunctionExpression(pos: number, identifier: Identifier, asyncModifier?: NodeArray | undefined): ArrowFunction { Debug.assert(token() === SyntaxKind.EqualsGreaterThanToken, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); const parameter = factory.createParameterDeclaration( /*decorators*/ undefined, @@ -4446,12 +4446,12 @@ namespace ts { const parameters = createNodeArray([parameter], parameter.pos, parameter.end); const equalsGreaterThanToken = parseExpectedToken(SyntaxKind.EqualsGreaterThanToken); - const body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier, disallowReturnTypeInArrowFunction); + const body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier); const node = factory.createArrowFunction(asyncModifier, /*typeParameters*/ undefined, parameters, /*type*/ undefined, equalsGreaterThanToken, body); return addJSDocComment(finishNode(node, pos)); } - function tryParseParenthesizedArrowFunctionExpression(disallowReturnTypeInArrowFunction: boolean): Expression | undefined { + function tryParseParenthesizedArrowFunctionExpression(): Expression | undefined { const triState = isParenthesizedArrowFunctionExpression(); if (triState === Tristate.False) { // It's definitely not a parenthesized arrow function expression. @@ -4463,8 +4463,8 @@ namespace ts { // it out, but don't allow any ambiguity, and return 'undefined' if this could be an // expression instead. return triState === Tristate.True ? - parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ true, /*disallowReturnTypeInArrowFunction*/ false) : - tryParse(() => parsePossibleParenthesizedArrowFunctionExpression(disallowReturnTypeInArrowFunction)); + parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ true) : + tryParse(parsePossibleParenthesizedArrowFunctionExpression); } // True -> We definitely expect a parenthesized arrow function here. @@ -4610,13 +4610,13 @@ namespace ts { } } - function parsePossibleParenthesizedArrowFunctionExpression(disallowReturnTypeInArrowFunction: boolean): ArrowFunction | undefined { + function parsePossibleParenthesizedArrowFunctionExpression(): ArrowFunction | undefined { const tokenPos = scanner.getTokenPos(); if (notParenthesizedArrow?.has(tokenPos)) { return undefined; } - const result = parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ false, disallowReturnTypeInArrowFunction); + const result = parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ false); if (!result) { (notParenthesizedArrow || (notParenthesizedArrow = new Set())).add(tokenPos); } @@ -4624,14 +4624,14 @@ namespace ts { return result; } - function tryParseAsyncSimpleArrowFunctionExpression(disallowReturnTypeInArrowFunction: boolean): ArrowFunction | undefined { + function tryParseAsyncSimpleArrowFunctionExpression(): ArrowFunction | undefined { // We do a check here so that we won't be doing unnecessarily call to "lookAhead" if (token() === SyntaxKind.AsyncKeyword) { if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === Tristate.True) { const pos = getNodePos(); const asyncModifier = parseModifiersForArrowFunction(); const expr = parseBinaryExpressionOrHigher(OperatorPrecedence.Lowest); - return parseSimpleArrowFunctionExpression(pos, expr as Identifier, disallowReturnTypeInArrowFunction, asyncModifier); + return parseSimpleArrowFunctionExpression(pos, expr as Identifier, asyncModifier); } } return undefined; @@ -4658,7 +4658,7 @@ namespace ts { return Tristate.False; } - function parseParenthesizedArrowFunctionExpression(allowAmbiguity: boolean, disallowReturnTypeInArrowFunction: boolean): ArrowFunction | undefined { + function parseParenthesizedArrowFunctionExpression(allowAmbiguity: boolean): ArrowFunction | undefined { const pos = getNodePos(); const hasJSDoc = hasPrecedingJSDocComment(); const modifiers = parseModifiersForArrowFunction(); @@ -4695,24 +4695,6 @@ namespace ts { } } - // Given: - // x ? y => ({ y }) : z => ({ z }) - // We try to parse the body of the first arrow function by looking at: - // ({ y }) : z => ({ z }) - // This is a valid arrow function with "z" as the return type. - // - // But, if we're in the true side of a conditional expression, this colon - // terminates the expression, so we cannot allow a return type if we aren't - // certain whether or not the preceding text was parsed as a parameter list. - // - // For example, - // a() ? (b: number, c?: string): void => d() : e - // is determined by isParenthesizedArrowFunctionExpression to unambiguously - // be an arrow expression, so we allow a return type. - if (disallowReturnTypeInArrowFunction && token() === SyntaxKind.ColonToken) { - return undefined; - } - const type = parseReturnType(SyntaxKind.ColonToken, /*isType*/ false); if (type && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type)) { return undefined; @@ -4745,14 +4727,14 @@ namespace ts { const lastToken = token(); const equalsGreaterThanToken = parseExpectedToken(SyntaxKind.EqualsGreaterThanToken); const body = (lastToken === SyntaxKind.EqualsGreaterThanToken || lastToken === SyntaxKind.OpenBraceToken) - ? parseArrowFunctionExpressionBody(some(modifiers, isAsyncModifier), disallowReturnTypeInArrowFunction) + ? parseArrowFunctionExpressionBody(some(modifiers, isAsyncModifier)) : parseIdentifier(); const node = factory.createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body); return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseArrowFunctionExpressionBody(isAsync: boolean, disallowReturnTypeInArrowFunction: boolean): Block | Expression { + function parseArrowFunctionExpressionBody(isAsync: boolean): Block | Expression { if (token() === SyntaxKind.OpenBraceToken) { return parseFunctionBlock(isAsync ? SignatureFlags.Await : SignatureFlags.None); } @@ -4782,8 +4764,8 @@ namespace ts { const savedTopLevel = topLevel; topLevel = false; const node = isAsync - ? doInAwaitContext(() => parseAssignmentExpressionOrHigher(disallowReturnTypeInArrowFunction)) - : doOutsideOfAwaitContext(() => parseAssignmentExpressionOrHigher(disallowReturnTypeInArrowFunction)); + ? doInAwaitContext(parseAssignmentExpressionOrHigher) + : doOutsideOfAwaitContext(parseAssignmentExpressionOrHigher); topLevel = savedTopLevel; return node; } @@ -4802,10 +4784,10 @@ namespace ts { factory.createConditionalExpression( leftOperand, questionToken, - doOutsideOfContext(disallowInAndDecoratorContext, () => parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ true)), + doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher), colonToken = parseExpectedToken(SyntaxKind.ColonToken), nodeIsPresent(colonToken) - ? parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ true) + ? parseAssignmentExpressionOrHigher() : createMissingNode(SyntaxKind.Identifier, /*reportAtCurrentPosition*/ false, Diagnostics._0_expected, tokenToString(SyntaxKind.ColonToken)) ), pos @@ -5803,14 +5785,14 @@ namespace ts { function parseSpreadElement(): Expression { const pos = getNodePos(); parseExpected(SyntaxKind.DotDotDotToken); - const expression = parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false); + const expression = parseAssignmentExpressionOrHigher(); return finishNode(factory.createSpreadElement(expression), pos); } function parseArgumentOrArrayLiteralElement(): Expression { return token() === SyntaxKind.DotDotDotToken ? parseSpreadElement() : token() === SyntaxKind.CommaToken ? finishNode(factory.createOmittedExpression(), getNodePos()) : - parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false); + parseAssignmentExpressionOrHigher(); } function parseArgumentExpression(): Expression { @@ -5832,7 +5814,7 @@ namespace ts { const hasJSDoc = hasPrecedingJSDocComment(); if (parseOptionalToken(SyntaxKind.DotDotDotToken)) { - const expression = parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false); + const expression = parseAssignmentExpressionOrHigher(); return withJSDoc(finishNode(factory.createSpreadAssignment(expression), pos), hasJSDoc); } @@ -5867,7 +5849,7 @@ namespace ts { const isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== SyntaxKind.ColonToken); if (isShorthandPropertyAssignment) { const equalsToken = parseOptionalToken(SyntaxKind.EqualsToken); - const objectAssignmentInitializer = equalsToken ? allowInAnd(() => parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false)) : undefined; + const objectAssignmentInitializer = equalsToken ? allowInAnd(parseAssignmentExpressionOrHigher) : undefined; node = factory.createShorthandPropertyAssignment(name as Identifier, objectAssignmentInitializer); // Save equals token for error reporting. // TODO(rbuckton): Consider manufacturing this when we need to report an error as it is otherwise not useful. @@ -5875,7 +5857,7 @@ namespace ts { } else { parseExpected(SyntaxKind.ColonToken); - const initializer = allowInAnd(() => parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false)); + const initializer = allowInAnd(parseAssignmentExpressionOrHigher); node = factory.createPropertyAssignment(name, initializer); } // Decorators, Modifiers, questionToken, and exclamationToken are not supported by property assignments and are reported in the grammar checker @@ -6075,7 +6057,7 @@ namespace ts { let node: IterationStatement; if (awaitToken ? parseExpected(SyntaxKind.OfKeyword) : parseOptional(SyntaxKind.OfKeyword)) { - const expression = allowInAnd(() => parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false)); + const expression = allowInAnd(parseAssignmentExpressionOrHigher); parseExpected(SyntaxKind.CloseParenToken); node = factory.createForOfStatement(awaitToken, initializer, expression, parseStatement()); } @@ -7417,7 +7399,7 @@ namespace ts { const pos = getNodePos(); const name = tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(SyntaxKind.StringLiteral) as StringLiteral; parseExpected(SyntaxKind.ColonToken); - const value = parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false); + const value = parseAssignmentExpressionOrHigher(); return finishNode(factory.createAssertEntry(name, value), pos); } @@ -7683,7 +7665,7 @@ namespace ts { else { parseExpected(SyntaxKind.DefaultKeyword); } - const expression = parseAssignmentExpressionOrHigher(/*disallowReturnTypeInArrowFunction*/ false); + const expression = parseAssignmentExpressionOrHigher(); parseSemicolon(); setAwaitContext(savedAwaitContext); const node = factory.createExportAssignment(decorators, modifiers, isExportEquals, expression); diff --git a/tests/baselines/reference/parserArrowFunctionExpression10.errors.txt b/tests/baselines/reference/parserArrowFunctionExpression10.errors.txt index 43cf9de267b..f562408c93c 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression10.errors.txt +++ b/tests/baselines/reference/parserArrowFunctionExpression10.errors.txt @@ -1,20 +1,20 @@ tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression10.ts(1,1): error TS2304: Cannot find name 'a'. -tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression10.ts(1,6): error TS2304: Cannot find name 'b'. -tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression10.ts(1,17): error TS2304: Cannot find name 'd'. -tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression10.ts(1,20): error TS1005: ';' expected. +tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression10.ts(1,11): error TS2304: Cannot find name 'c'. +tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression10.ts(1,22): error TS2304: Cannot find name 'e'. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression10.ts(1,27): error TS2304: Cannot find name 'f'. +tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression10.ts(2,1): error TS1005: ':' expected. ==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression10.ts (5 errors) ==== a ? (b) : c => (d) : e => f ~ !!! error TS2304: Cannot find name 'a'. - ~ -!!! error TS2304: Cannot find name 'b'. - ~ -!!! error TS2304: Cannot find name 'd'. - ~ -!!! error TS1005: ';' expected. + ~ +!!! error TS2304: Cannot find name 'c'. + ~ +!!! error TS2304: Cannot find name 'e'. ~ !!! error TS2304: Cannot find name 'f'. - \ No newline at end of file + + +!!! error TS1005: ':' expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserArrowFunctionExpression10.js b/tests/baselines/reference/parserArrowFunctionExpression10.js index 86e1e61bb07..dde6e364265 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression10.js +++ b/tests/baselines/reference/parserArrowFunctionExpression10.js @@ -3,5 +3,6 @@ a ? (b) : c => (d) : e => f //// [parserArrowFunctionExpression10.js] -a ? (b) : function (c) { return (d); }; -(function (e) { return f; }); +a ? function (b) { return function (d) { return f; }; } + : +; diff --git a/tests/baselines/reference/parserArrowFunctionExpression10.symbols b/tests/baselines/reference/parserArrowFunctionExpression10.symbols index f30f0b3e3ca..7e7cdb86a0a 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression10.symbols +++ b/tests/baselines/reference/parserArrowFunctionExpression10.symbols @@ -1,5 +1,7 @@ === tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression10.ts === a ? (b) : c => (d) : e => f ->c : Symbol(c, Decl(parserArrowFunctionExpression10.ts, 0, 9)) ->e : Symbol(e, Decl(parserArrowFunctionExpression10.ts, 0, 20)) +>b : Symbol(b, Decl(parserArrowFunctionExpression10.ts, 0, 5)) +>c : Symbol(c) +>d : Symbol(d, Decl(parserArrowFunctionExpression10.ts, 0, 16)) +>e : Symbol(e) diff --git a/tests/baselines/reference/parserArrowFunctionExpression10.types b/tests/baselines/reference/parserArrowFunctionExpression10.types index 8ec7d69c295..25f24b99a46 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression10.types +++ b/tests/baselines/reference/parserArrowFunctionExpression10.types @@ -1,14 +1,12 @@ === tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression10.ts === a ? (b) : c => (d) : e => f ->a ? (b) : c => (d) : any +>a ? (b) : c => (d) : e => f : any >a : any ->(b) : any +>(b) : c => (d) : e => f : (b: any) => c >b : any ->c => (d) : (c: any) => any ->c : any ->(d) : any +>(d) : e => f : (d: any) => e >d : any ->e => f : (e: any) => any ->e : any >f : any +> : any + diff --git a/tests/baselines/reference/parserArrowFunctionExpression11.errors.txt b/tests/baselines/reference/parserArrowFunctionExpression11.errors.txt index 452c9fc6e64..d8abfd83fa4 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression11.errors.txt +++ b/tests/baselines/reference/parserArrowFunctionExpression11.errors.txt @@ -1,11 +1,12 @@ tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression11.ts(1,1): error TS2304: Cannot find name 'a'. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression11.ts(1,5): error TS2304: Cannot find name 'b'. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression11.ts(1,9): error TS2304: Cannot find name 'c'. -tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression11.ts(1,14): error TS2304: Cannot find name 'd'. +tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression11.ts(1,19): error TS2304: Cannot find name 'e'. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression11.ts(1,24): error TS2304: Cannot find name 'f'. +tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression11.ts(2,1): error TS1005: ':' expected. -==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression11.ts (5 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression11.ts (6 errors) ==== a ? b ? c : (d) : e => f ~ !!! error TS2304: Cannot find name 'a'. @@ -13,8 +14,10 @@ tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowF !!! error TS2304: Cannot find name 'b'. ~ !!! error TS2304: Cannot find name 'c'. - ~ -!!! error TS2304: Cannot find name 'd'. + ~ +!!! error TS2304: Cannot find name 'e'. ~ !!! error TS2304: Cannot find name 'f'. - \ No newline at end of file + + +!!! error TS1005: ':' expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserArrowFunctionExpression11.js b/tests/baselines/reference/parserArrowFunctionExpression11.js index 8562a6b57f9..bc2dcf4980b 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression11.js +++ b/tests/baselines/reference/parserArrowFunctionExpression11.js @@ -3,4 +3,6 @@ a ? b ? c : (d) : e => f //// [parserArrowFunctionExpression11.js] -a ? b ? c : (d) : function (e) { return f; }; +a ? b ? c : function (d) { return f; } + : +; diff --git a/tests/baselines/reference/parserArrowFunctionExpression11.symbols b/tests/baselines/reference/parserArrowFunctionExpression11.symbols index 361c2e7fd11..f49eae1e16c 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression11.symbols +++ b/tests/baselines/reference/parserArrowFunctionExpression11.symbols @@ -1,4 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression11.ts === a ? b ? c : (d) : e => f ->e : Symbol(e, Decl(parserArrowFunctionExpression11.ts, 0, 17)) +>d : Symbol(d, Decl(parserArrowFunctionExpression11.ts, 0, 13)) +>e : Symbol(e) diff --git a/tests/baselines/reference/parserArrowFunctionExpression11.types b/tests/baselines/reference/parserArrowFunctionExpression11.types index e4e9be428ad..9e3e5438eb6 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression11.types +++ b/tests/baselines/reference/parserArrowFunctionExpression11.types @@ -2,12 +2,12 @@ a ? b ? c : (d) : e => f >a ? b ? c : (d) : e => f : any >a : any ->b ? c : (d) : any +>b ? c : (d) : e => f : any >b : any >c : any ->(d) : any +>(d) : e => f : (d: any) => e >d : any ->e => f : (e: any) => any ->e : any >f : any +> : any + diff --git a/tests/baselines/reference/parserArrowFunctionExpression12.errors.txt b/tests/baselines/reference/parserArrowFunctionExpression12.errors.txt index c6cfd8f9ce8..59fc42b58c9 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression12.errors.txt +++ b/tests/baselines/reference/parserArrowFunctionExpression12.errors.txt @@ -1,14 +1,17 @@ tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression12.ts(1,1): error TS2304: Cannot find name 'a'. -tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression12.ts(1,13): error TS2304: Cannot find name 'c'. +tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression12.ts(1,17): error TS2304: Cannot find name 'd'. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression12.ts(1,22): error TS2304: Cannot find name 'e'. +tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression12.ts(2,1): error TS1005: ':' expected. -==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression12.ts (3 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression12.ts (4 errors) ==== a ? (b) => (c): d => e ~ !!! error TS2304: Cannot find name 'a'. - ~ -!!! error TS2304: Cannot find name 'c'. + ~ +!!! error TS2304: Cannot find name 'd'. ~ !!! error TS2304: Cannot find name 'e'. - \ No newline at end of file + + +!!! error TS1005: ':' expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserArrowFunctionExpression12.js b/tests/baselines/reference/parserArrowFunctionExpression12.js index dbee37a2660..b3750be26f2 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression12.js +++ b/tests/baselines/reference/parserArrowFunctionExpression12.js @@ -3,4 +3,6 @@ a ? (b) => (c): d => e //// [parserArrowFunctionExpression12.js] -a ? function (b) { return (c); } : function (d) { return e; }; +a ? function (b) { return function (c) { return e; }; } + : +; diff --git a/tests/baselines/reference/parserArrowFunctionExpression12.symbols b/tests/baselines/reference/parserArrowFunctionExpression12.symbols index 3a677172320..d092dfaf00d 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression12.symbols +++ b/tests/baselines/reference/parserArrowFunctionExpression12.symbols @@ -1,5 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression12.ts === a ? (b) => (c): d => e >b : Symbol(b, Decl(parserArrowFunctionExpression12.ts, 0, 5)) ->d : Symbol(d, Decl(parserArrowFunctionExpression12.ts, 0, 15)) +>c : Symbol(c, Decl(parserArrowFunctionExpression12.ts, 0, 12)) +>d : Symbol(d) diff --git a/tests/baselines/reference/parserArrowFunctionExpression12.types b/tests/baselines/reference/parserArrowFunctionExpression12.types index b833ae305a8..bab73d7a2d3 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression12.types +++ b/tests/baselines/reference/parserArrowFunctionExpression12.types @@ -1,12 +1,12 @@ === tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression12.ts === a ? (b) => (c): d => e ->a ? (b) => (c): d => e : (b: any) => any +>a ? (b) => (c): d => e : any >a : any ->(b) => (c) : (b: any) => any +>(b) => (c): d => e : (b: any) => (c: any) => d >b : any ->(c) : any +>(c): d => e : (c: any) => d >c : any ->d => e : (d: any) => any ->d : any >e : any +> : any + diff --git a/tests/baselines/reference/parserArrowFunctionExpression15.js b/tests/baselines/reference/parserArrowFunctionExpression15.js new file mode 100644 index 00000000000..a18efc84f09 --- /dev/null +++ b/tests/baselines/reference/parserArrowFunctionExpression15.js @@ -0,0 +1,6 @@ +//// [parserArrowFunctionExpression15.ts] +false ? (param): string => param : null + + +//// [parserArrowFunctionExpression15.js] +false ? function (param) { return param; } : null; diff --git a/tests/baselines/reference/parserArrowFunctionExpression15.symbols b/tests/baselines/reference/parserArrowFunctionExpression15.symbols new file mode 100644 index 00000000000..7cb354c7dc9 --- /dev/null +++ b/tests/baselines/reference/parserArrowFunctionExpression15.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression15.ts === +false ? (param): string => param : null +>param : Symbol(param, Decl(parserArrowFunctionExpression15.ts, 0, 9)) +>param : Symbol(param, Decl(parserArrowFunctionExpression15.ts, 0, 9)) + diff --git a/tests/baselines/reference/parserArrowFunctionExpression15.types b/tests/baselines/reference/parserArrowFunctionExpression15.types new file mode 100644 index 00000000000..46407638621 --- /dev/null +++ b/tests/baselines/reference/parserArrowFunctionExpression15.types @@ -0,0 +1,9 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression15.ts === +false ? (param): string => param : null +>false ? (param): string => param : null : (param: any) => string +>false : false +>(param): string => param : (param: any) => string +>param : any +>param : any +>null : null + diff --git a/tests/baselines/reference/parserArrowFunctionExpression16.js b/tests/baselines/reference/parserArrowFunctionExpression16.js new file mode 100644 index 00000000000..8d0404c91c8 --- /dev/null +++ b/tests/baselines/reference/parserArrowFunctionExpression16.js @@ -0,0 +1,6 @@ +//// [parserArrowFunctionExpression16.ts] +true ? false ? (param): string => param : null : null + + +//// [parserArrowFunctionExpression16.js] +true ? false ? function (param) { return param; } : null : null; diff --git a/tests/baselines/reference/parserArrowFunctionExpression16.symbols b/tests/baselines/reference/parserArrowFunctionExpression16.symbols new file mode 100644 index 00000000000..f2a4ff04df1 --- /dev/null +++ b/tests/baselines/reference/parserArrowFunctionExpression16.symbols @@ -0,0 +1,5 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression16.ts === +true ? false ? (param): string => param : null : null +>param : Symbol(param, Decl(parserArrowFunctionExpression16.ts, 0, 16)) +>param : Symbol(param, Decl(parserArrowFunctionExpression16.ts, 0, 16)) + diff --git a/tests/baselines/reference/parserArrowFunctionExpression16.types b/tests/baselines/reference/parserArrowFunctionExpression16.types new file mode 100644 index 00000000000..fffd623adac --- /dev/null +++ b/tests/baselines/reference/parserArrowFunctionExpression16.types @@ -0,0 +1,12 @@ +=== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression16.ts === +true ? false ? (param): string => param : null : null +>true ? false ? (param): string => param : null : null : (param: any) => string +>true : true +>false ? (param): string => param : null : (param: any) => string +>false : false +>(param): string => param : (param: any) => string +>param : any +>param : any +>null : null +>null : null + diff --git a/tests/baselines/reference/parserArrowFunctionExpression8.errors.txt b/tests/baselines/reference/parserArrowFunctionExpression8.errors.txt index 1678471ae83..8afc1298a29 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression8.errors.txt +++ b/tests/baselines/reference/parserArrowFunctionExpression8.errors.txt @@ -1,8 +1,17 @@ tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression8.ts(1,1): error TS2304: Cannot find name 'x'. +tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression8.ts(1,20): error TS2304: Cannot find name 'z'. +tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression8.ts(1,28): error TS18004: No value exists in scope for the shorthand property 'z'. Either declare one or provide an initializer. +tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression8.ts(2,1): error TS1005: ':' expected. -==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression8.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression8.ts (4 errors) ==== x ? y => ({ y }) : z => ({ z }) ~ !!! error TS2304: Cannot find name 'x'. - \ No newline at end of file + ~ +!!! error TS2304: Cannot find name 'z'. + ~ +!!! error TS18004: No value exists in scope for the shorthand property 'z'. Either declare one or provide an initializer. + + +!!! error TS1005: ':' expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserArrowFunctionExpression8.js b/tests/baselines/reference/parserArrowFunctionExpression8.js index d34457823bd..a8738ac8603 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression8.js +++ b/tests/baselines/reference/parserArrowFunctionExpression8.js @@ -3,4 +3,9 @@ x ? y => ({ y }) : z => ({ z }) //// [parserArrowFunctionExpression8.js] -x ? function (y) { return ({ y: y }); } : function (z) { return ({ z: z }); }; +x ? function (y) { return function (_a) { + var y = _a.y; + return ({ z: z }); +}; } + : +; diff --git a/tests/baselines/reference/parserArrowFunctionExpression8.symbols b/tests/baselines/reference/parserArrowFunctionExpression8.symbols index 728cf2a31b7..caae56c76fe 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression8.symbols +++ b/tests/baselines/reference/parserArrowFunctionExpression8.symbols @@ -2,6 +2,6 @@ x ? y => ({ y }) : z => ({ z }) >y : Symbol(y, Decl(parserArrowFunctionExpression8.ts, 0, 3)) >y : Symbol(y, Decl(parserArrowFunctionExpression8.ts, 0, 11)) ->z : Symbol(z, Decl(parserArrowFunctionExpression8.ts, 0, 18)) +>z : Symbol(z) >z : Symbol(z, Decl(parserArrowFunctionExpression8.ts, 0, 26)) diff --git a/tests/baselines/reference/parserArrowFunctionExpression8.types b/tests/baselines/reference/parserArrowFunctionExpression8.types index 29bdcaa25c9..14d62f307fb 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression8.types +++ b/tests/baselines/reference/parserArrowFunctionExpression8.types @@ -1,15 +1,14 @@ === tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression8.ts === x ? y => ({ y }) : z => ({ z }) ->x ? y => ({ y }) : z => ({ z }) : ((y: any) => { y: any; }) | ((z: any) => { z: any; }) +>x ? y => ({ y }) : z => ({ z }) : any >x : any ->y => ({ y }) : (y: any) => { y: any; } +>y => ({ y }) : z => ({ z }) : (y: any) => ({ y }: { y: any; }) => z >y : any ->({ y }) : { y: any; } ->{ y } : { y: any; } +>({ y }) : z => ({ z }) : ({ y }: { y: any; }) => z >y : any ->z => ({ z }) : (z: any) => { z: any; } ->z : any >({ z }) : { z: any; } >{ z } : { z: any; } >z : any +> : any + diff --git a/tests/baselines/reference/parserArrowFunctionExpression8Js.errors.txt b/tests/baselines/reference/parserArrowFunctionExpression8Js.errors.txt index d364171f849..ceb5a1c6168 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression8Js.errors.txt +++ b/tests/baselines/reference/parserArrowFunctionExpression8Js.errors.txt @@ -1,8 +1,20 @@ tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/file.js(1,1): error TS2304: Cannot find name 'x'. +tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/file.js(1,20): error TS2304: Cannot find name 'z'. +tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/file.js(1,20): error TS8010: Type annotations can only be used in TypeScript files. +tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/file.js(1,28): error TS18004: No value exists in scope for the shorthand property 'z'. Either declare one or provide an initializer. +tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/file.js(2,1): error TS1005: ':' expected. -==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/file.js (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/file.js (5 errors) ==== x ? y => ({ y }) : z => ({ z }) ~ !!! error TS2304: Cannot find name 'x'. - \ No newline at end of file + ~ +!!! error TS2304: Cannot find name 'z'. + ~ +!!! error TS8010: Type annotations can only be used in TypeScript files. + ~ +!!! error TS18004: No value exists in scope for the shorthand property 'z'. Either declare one or provide an initializer. + + +!!! error TS1005: ':' expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserArrowFunctionExpression8Js.js b/tests/baselines/reference/parserArrowFunctionExpression8Js.js index 50ba0a4f950..4de39348d9b 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression8Js.js +++ b/tests/baselines/reference/parserArrowFunctionExpression8Js.js @@ -3,4 +3,9 @@ x ? y => ({ y }) : z => ({ z }) //// [file.js] -x ? function (y) { return ({ y: y }); } : function (z) { return ({ z: z }); }; +x ? function (y) { return function (_a) { + var y = _a.y; + return ({ z: z }); +}; } + : +; diff --git a/tests/baselines/reference/parserArrowFunctionExpression8Js.symbols b/tests/baselines/reference/parserArrowFunctionExpression8Js.symbols index c1480e6a579..09684043a2b 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression8Js.symbols +++ b/tests/baselines/reference/parserArrowFunctionExpression8Js.symbols @@ -2,6 +2,6 @@ x ? y => ({ y }) : z => ({ z }) >y : Symbol(y, Decl(file.js, 0, 3)) >y : Symbol(y, Decl(file.js, 0, 11)) ->z : Symbol(z, Decl(file.js, 0, 18)) +>z : Symbol(z) >z : Symbol(z, Decl(file.js, 0, 26)) diff --git a/tests/baselines/reference/parserArrowFunctionExpression8Js.types b/tests/baselines/reference/parserArrowFunctionExpression8Js.types index 7ebfe1aa74a..392a558c184 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression8Js.types +++ b/tests/baselines/reference/parserArrowFunctionExpression8Js.types @@ -1,15 +1,14 @@ === tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/file.js === x ? y => ({ y }) : z => ({ z }) ->x ? y => ({ y }) : z => ({ z }) : ((y: any) => { y: any; }) | ((z: any) => { z: any; }) +>x ? y => ({ y }) : z => ({ z }) : any >x : any ->y => ({ y }) : (y: any) => { y: any; } +>y => ({ y }) : z => ({ z }) : (y: any) => ({ y }: { y: any; }) => z >y : any ->({ y }) : { y: any; } ->{ y } : { y: any; } +>({ y }) : z => ({ z }) : ({ y }: { y: any; }) => z >y : any ->z => ({ z }) : (z: any) => { z: any; } ->z : any >({ z }) : { z: any; } >{ z } : { z: any; } >z : any +> : any + diff --git a/tests/baselines/reference/parserArrowFunctionExpression9.errors.txt b/tests/baselines/reference/parserArrowFunctionExpression9.errors.txt index f779f2105a2..9b36e3d364a 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression9.errors.txt +++ b/tests/baselines/reference/parserArrowFunctionExpression9.errors.txt @@ -1,14 +1,17 @@ tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression9.ts(1,1): error TS2304: Cannot find name 'b'. -tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression9.ts(1,6): error TS2304: Cannot find name 'c'. +tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression9.ts(1,11): error TS2304: Cannot find name 'd'. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression9.ts(1,16): error TS2304: Cannot find name 'e'. +tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression9.ts(2,1): error TS1005: ':' expected. -==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression9.ts (3 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression9.ts (4 errors) ==== b ? (c) : d => e ~ !!! error TS2304: Cannot find name 'b'. - ~ -!!! error TS2304: Cannot find name 'c'. + ~ +!!! error TS2304: Cannot find name 'd'. ~ !!! error TS2304: Cannot find name 'e'. - \ No newline at end of file + + +!!! error TS1005: ':' expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserArrowFunctionExpression9.js b/tests/baselines/reference/parserArrowFunctionExpression9.js index ee3bab86c58..43143882395 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression9.js +++ b/tests/baselines/reference/parserArrowFunctionExpression9.js @@ -3,4 +3,6 @@ b ? (c) : d => e //// [parserArrowFunctionExpression9.js] -b ? (c) : function (d) { return e; }; +b ? function (c) { return e; } + : +; diff --git a/tests/baselines/reference/parserArrowFunctionExpression9.symbols b/tests/baselines/reference/parserArrowFunctionExpression9.symbols index dedb9c1e3a1..8b6cf75c11a 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression9.symbols +++ b/tests/baselines/reference/parserArrowFunctionExpression9.symbols @@ -1,4 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression9.ts === b ? (c) : d => e ->d : Symbol(d, Decl(parserArrowFunctionExpression9.ts, 0, 9)) +>c : Symbol(c, Decl(parserArrowFunctionExpression9.ts, 0, 5)) +>d : Symbol(d) diff --git a/tests/baselines/reference/parserArrowFunctionExpression9.types b/tests/baselines/reference/parserArrowFunctionExpression9.types index e97b04eb48a..e11b2e222f3 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression9.types +++ b/tests/baselines/reference/parserArrowFunctionExpression9.types @@ -2,9 +2,9 @@ b ? (c) : d => e >b ? (c) : d => e : any >b : any ->(c) : any +>(c) : d => e : (c: any) => d >c : any ->d => e : (d: any) => any ->d : any >e : any +> : any + diff --git a/tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression15.ts b/tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression15.ts new file mode 100644 index 00000000000..3348d24bfeb --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression15.ts @@ -0,0 +1 @@ +false ? (param): string => param : null diff --git a/tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression16.ts b/tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression16.ts new file mode 100644 index 00000000000..9a19bfdb6cf --- /dev/null +++ b/tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression16.ts @@ -0,0 +1 @@ +true ? false ? (param): string => param : null : null From e26bc8a117143acbca28921a67402b2824d9f15b Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Wed, 4 May 2022 15:07:34 -0700 Subject: [PATCH 54/63] Skip missing nodes in formatting (#48953) --- src/services/formatting/formatting.ts | 4 ++++ tests/cases/fourslash/formatV8Directive.ts | 7 +++++++ 2 files changed, 11 insertions(+) create mode 100644 tests/cases/fourslash/formatV8Directive.ts diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index cc5e2b6c41c..b3e84023d17 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -691,6 +691,10 @@ namespace ts.formatting { isListItem: boolean, isFirstListItem?: boolean): number { + if (nodeIsMissing(child)) { + return inheritedIndentation; + } + const childStartPos = child.getStart(sourceFile); const childStartLine = sourceFile.getLineAndCharacterOfPosition(childStartPos).line; diff --git a/tests/cases/fourslash/formatV8Directive.ts b/tests/cases/fourslash/formatV8Directive.ts new file mode 100644 index 00000000000..515ef57c7ca --- /dev/null +++ b/tests/cases/fourslash/formatV8Directive.ts @@ -0,0 +1,7 @@ +/// +// @Filename: foo.js +//// function foo() {} +//// /*1*/%PrepareFunctionForOptimization(foo)/*2*/; + +// Don't really care what it does beyond not crashing +format.selection("1", "2"); From 7d60dc1f5db04cc01cba2e1def292432fa41a7ee Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Wed, 4 May 2022 16:50:30 -0700 Subject: [PATCH 55/63] Revert "feat(47595): allow using private fields in type queries" (#48959) --- src/compiler/parser.ts | 16 ++++----- .../privateNameInTypeQuery.errors.txt | 21 ------------ .../reference/privateNameInTypeQuery.js | 25 -------------- .../reference/privateNameInTypeQuery.symbols | 28 --------------- .../reference/privateNameInTypeQuery.types | 34 ------------------- .../privateNames/privateNameInTypeQuery.ts | 14 -------- 6 files changed, 8 insertions(+), 130 deletions(-) delete mode 100644 tests/baselines/reference/privateNameInTypeQuery.errors.txt delete mode 100644 tests/baselines/reference/privateNameInTypeQuery.js delete mode 100644 tests/baselines/reference/privateNameInTypeQuery.symbols delete mode 100644 tests/baselines/reference/privateNameInTypeQuery.types delete mode 100644 tests/cases/conformance/classes/members/privateNames/privateNameInTypeQuery.ts diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 594d7674b92..240385df8df 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -944,7 +944,7 @@ namespace ts { initializeState("", content, languageVersion, /*syntaxCursor*/ undefined, ScriptKind.JS); // Prime the scanner. nextToken(); - const entityName = parseEntityName(/*allowReservedWords*/ true, /*allowPrivateIdentifiers*/ false); + const entityName = parseEntityName(/*allowReservedWords*/ true); const isInvalid = token() === SyntaxKind.EndOfFileToken && !parseDiagnostics.length; clearState(); return isInvalid ? entityName : undefined; @@ -2829,7 +2829,7 @@ namespace ts { return createMissingList(); } - function parseEntityName(allowReservedWords: boolean, allowPrivateIdentifiers: boolean, diagnosticMessage?: DiagnosticMessage): EntityName { + function parseEntityName(allowReservedWords: boolean, diagnosticMessage?: DiagnosticMessage): EntityName { const pos = getNodePos(); let entity: EntityName = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage); let dotPos = getNodePos(); @@ -2843,7 +2843,7 @@ namespace ts { entity = finishNode( factory.createQualifiedName( entity, - parseRightSideOfDot(allowReservedWords, allowPrivateIdentifiers) as Identifier + parseRightSideOfDot(allowReservedWords, /* allowPrivateIdentifiers */ false) as Identifier ), pos ); @@ -3028,7 +3028,7 @@ namespace ts { // TYPES function parseEntityNameOfTypeReference() { - return parseEntityName(/*allowReservedWords*/ true, /*allowPrivateIdentifiers*/ false, Diagnostics.Type_expected); + return parseEntityName(/*allowReservedWords*/ true, Diagnostics.Type_expected); } function parseTypeArgumentsOfTypeReference() { @@ -3188,7 +3188,7 @@ namespace ts { function parseTypeQuery(): TypeQueryNode { const pos = getNodePos(); parseExpected(SyntaxKind.TypeOfKeyword); - const entityName = parseEntityName(/*allowReservedWords*/ true, /*allowPrivateIdentifiers*/ true); + const entityName = parseEntityName(/*allowReservedWords*/ true); // Make sure we perform ASI to prevent parsing the next line's type arguments as part of an instantiation expression. const typeArguments = !scanner.hasPrecedingLineBreak() ? tryParseTypeArguments() : undefined; return finishNode(factory.createTypeQueryNode(entityName, typeArguments), pos); @@ -7470,7 +7470,7 @@ namespace ts { function parseModuleReference() { return isExternalModuleReference() ? parseExternalModuleReference() - : parseEntityName(/*allowReservedWords*/ false, /*allowPrivateIdentifiers*/ false); + : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { @@ -7743,7 +7743,7 @@ namespace ts { const pos = getNodePos(); const hasBrace = parseOptional(SyntaxKind.OpenBraceToken); const p2 = getNodePos(); - let entityName: EntityName | JSDocMemberName = parseEntityName(/* allowReservedWords*/ false, /*allowPrivateIdentifiers*/ false); + let entityName: EntityName | JSDocMemberName = parseEntityName(/* allowReservedWords*/ false); while (token() === SyntaxKind.PrivateIdentifier) { reScanHashToken(); // rescan #id as # id nextTokenJSDoc(); // then skip the # @@ -8206,7 +8206,7 @@ namespace ts { // parseEntityName logs an error for non-identifier, so create a MissingNode ourselves to avoid the error const p2 = getNodePos(); let name: EntityName | JSDocMemberName | undefined = tokenIsIdentifierOrKeyword(token()) - ? parseEntityName(/*allowReservedWords*/ true, /*allowPrivateIdentifiers*/ false) + ? parseEntityName(/*allowReservedWords*/ true) : undefined; if (name) { while (token() === SyntaxKind.PrivateIdentifier) { diff --git a/tests/baselines/reference/privateNameInTypeQuery.errors.txt b/tests/baselines/reference/privateNameInTypeQuery.errors.txt deleted file mode 100644 index c11a9db934a..00000000000 --- a/tests/baselines/reference/privateNameInTypeQuery.errors.txt +++ /dev/null @@ -1,21 +0,0 @@ -tests/cases/conformance/classes/members/privateNames/privateNameInTypeQuery.ts(6,15): error TS2322: Type 'number' is not assignable to type 'string'. -tests/cases/conformance/classes/members/privateNames/privateNameInTypeQuery.ts(11,19): error TS18013: Property '#a' is not accessible outside class 'C' because it has a private identifier. - - -==== tests/cases/conformance/classes/members/privateNames/privateNameInTypeQuery.ts (2 errors) ==== - class C { - #a = 'a'; - - constructor() { - const a: typeof this.#a = ''; // Ok - const b: typeof this.#a = 1; // Error - ~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. - } - } - - const c = new C(); - const a: typeof c.#a = ''; - ~~ -!!! error TS18013: Property '#a' is not accessible outside class 'C' because it has a private identifier. - \ No newline at end of file diff --git a/tests/baselines/reference/privateNameInTypeQuery.js b/tests/baselines/reference/privateNameInTypeQuery.js deleted file mode 100644 index 4f8e7cb38e1..00000000000 --- a/tests/baselines/reference/privateNameInTypeQuery.js +++ /dev/null @@ -1,25 +0,0 @@ -//// [privateNameInTypeQuery.ts] -class C { - #a = 'a'; - - constructor() { - const a: typeof this.#a = ''; // Ok - const b: typeof this.#a = 1; // Error - } -} - -const c = new C(); -const a: typeof c.#a = ''; - - -//// [privateNameInTypeQuery.js] -"use strict"; -class C { - #a = 'a'; - constructor() { - const a = ''; // Ok - const b = 1; // Error - } -} -const c = new C(); -const a = ''; diff --git a/tests/baselines/reference/privateNameInTypeQuery.symbols b/tests/baselines/reference/privateNameInTypeQuery.symbols deleted file mode 100644 index 1d32e5aab73..00000000000 --- a/tests/baselines/reference/privateNameInTypeQuery.symbols +++ /dev/null @@ -1,28 +0,0 @@ -=== tests/cases/conformance/classes/members/privateNames/privateNameInTypeQuery.ts === -class C { ->C : Symbol(C, Decl(privateNameInTypeQuery.ts, 0, 0)) - - #a = 'a'; ->#a : Symbol(C.#a, Decl(privateNameInTypeQuery.ts, 0, 9)) - - constructor() { - const a: typeof this.#a = ''; // Ok ->a : Symbol(a, Decl(privateNameInTypeQuery.ts, 4, 13)) ->this.#a : Symbol(C.#a, Decl(privateNameInTypeQuery.ts, 0, 9)) ->this : Symbol(C, Decl(privateNameInTypeQuery.ts, 0, 0)) - - const b: typeof this.#a = 1; // Error ->b : Symbol(b, Decl(privateNameInTypeQuery.ts, 5, 13)) ->this.#a : Symbol(C.#a, Decl(privateNameInTypeQuery.ts, 0, 9)) ->this : Symbol(C, Decl(privateNameInTypeQuery.ts, 0, 0)) - } -} - -const c = new C(); ->c : Symbol(c, Decl(privateNameInTypeQuery.ts, 9, 5)) ->C : Symbol(C, Decl(privateNameInTypeQuery.ts, 0, 0)) - -const a: typeof c.#a = ''; ->a : Symbol(a, Decl(privateNameInTypeQuery.ts, 10, 5)) ->c : Symbol(c, Decl(privateNameInTypeQuery.ts, 9, 5)) - diff --git a/tests/baselines/reference/privateNameInTypeQuery.types b/tests/baselines/reference/privateNameInTypeQuery.types deleted file mode 100644 index 22e34ba59b0..00000000000 --- a/tests/baselines/reference/privateNameInTypeQuery.types +++ /dev/null @@ -1,34 +0,0 @@ -=== tests/cases/conformance/classes/members/privateNames/privateNameInTypeQuery.ts === -class C { ->C : C - - #a = 'a'; ->#a : string ->'a' : "a" - - constructor() { - const a: typeof this.#a = ''; // Ok ->a : string ->this.#a : string ->this : this ->'' : "" - - const b: typeof this.#a = 1; // Error ->b : string ->this.#a : string ->this : this ->1 : 1 - } -} - -const c = new C(); ->c : C ->new C() : C ->C : typeof C - -const a: typeof c.#a = ''; ->a : any ->c.#a : any ->c : C ->'' : "" - diff --git a/tests/cases/conformance/classes/members/privateNames/privateNameInTypeQuery.ts b/tests/cases/conformance/classes/members/privateNames/privateNameInTypeQuery.ts deleted file mode 100644 index 3a7e966130a..00000000000 --- a/tests/cases/conformance/classes/members/privateNames/privateNameInTypeQuery.ts +++ /dev/null @@ -1,14 +0,0 @@ -// @strict: true -// @target: esnext - -class C { - #a = 'a'; - - constructor() { - const a: typeof this.#a = ''; // Ok - const b: typeof this.#a = 1; // Error - } -} - -const c = new C(); -const a: typeof c.#a = ''; From 46e8306050b957aad4e72d2c48c2f75dd12afdc3 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 5 May 2022 09:33:32 -0700 Subject: [PATCH 56/63] Skip ambient modules in globalThis (#48938) * Skip ambient modules in globalThis Previously, globalThis mistakenly included ambient modules, even though these are not values: ```ts declare module "ambientModule" { export type typ = 1 export var val: typ } type Oops = (typeof globalThis)[\"ambientModule\"] ``` This PR adds ambient modules to the kinds of things that are skipped when constructing `globalThis`' properties, along with block-scoped variables. * Skip only modules with every declaration ambient The modules are required to have at least one declaration so that our treatment of `globalThis` stays the same, and `globalThis.globalThis.globalThis` remains legal. --- src/compiler/checker.ts | 2 +- .../globalThisAmbientModules.errors.txt | 21 ++++++++++ .../reference/globalThisAmbientModules.js | 20 ++++++++++ .../globalThisAmbientModules.symbols | 38 +++++++++++++++++++ .../reference/globalThisAmbientModules.types | 37 ++++++++++++++++++ .../es2019/globalThisAmbientModules.ts | 11 ++++++ 6 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/globalThisAmbientModules.errors.txt create mode 100644 tests/baselines/reference/globalThisAmbientModules.js create mode 100644 tests/baselines/reference/globalThisAmbientModules.symbols create mode 100644 tests/baselines/reference/globalThisAmbientModules.types create mode 100644 tests/cases/conformance/es2019/globalThisAmbientModules.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 8dc1e1df76f..504cdf669c7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11504,7 +11504,7 @@ namespace ts { if (symbol === globalThisSymbol) { const varsOnly = new Map() as SymbolTable; members.forEach(p => { - if (!(p.flags & SymbolFlags.BlockScoped)) { + if (!(p.flags & SymbolFlags.BlockScoped) && !(p.flags & SymbolFlags.ValueModule && p.declarations?.length && every(p.declarations, isAmbientModule))) { varsOnly.set(p.escapedName, p); } }); diff --git a/tests/baselines/reference/globalThisAmbientModules.errors.txt b/tests/baselines/reference/globalThisAmbientModules.errors.txt new file mode 100644 index 00000000000..b29d977475f --- /dev/null +++ b/tests/baselines/reference/globalThisAmbientModules.errors.txt @@ -0,0 +1,21 @@ +tests/cases/conformance/es2019/globalThisAmbientModules.ts(8,39): error TS2339: Property '"ambientModule"' does not exist on type 'typeof globalThis'. +tests/cases/conformance/es2019/globalThisAmbientModules.ts(11,33): error TS2339: Property '"ambientModule"' does not exist on type 'typeof globalThis'. + + +==== tests/cases/conformance/es2019/globalThisAmbientModules.ts (2 errors) ==== + declare module "ambientModule" { + export type typ = 1 + export var val: typ + } + namespace valueModule { export var val = 1 } + namespace namespaceModule { export type typ = 1 } + // should error + type GlobalBad1 = (typeof globalThis)["\"ambientModule\""] + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property '"ambientModule"' does not exist on type 'typeof globalThis'. + type GlobalOk1 = (typeof globalThis)["valueModule"] + type GlobalOk2 = globalThis.namespaceModule.typ + const bad1: (typeof globalThis)["\"ambientModule\""] = 'ambientModule' + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property '"ambientModule"' does not exist on type 'typeof globalThis'. + \ No newline at end of file diff --git a/tests/baselines/reference/globalThisAmbientModules.js b/tests/baselines/reference/globalThisAmbientModules.js new file mode 100644 index 00000000000..ec032568e9b --- /dev/null +++ b/tests/baselines/reference/globalThisAmbientModules.js @@ -0,0 +1,20 @@ +//// [globalThisAmbientModules.ts] +declare module "ambientModule" { + export type typ = 1 + export var val: typ +} +namespace valueModule { export var val = 1 } +namespace namespaceModule { export type typ = 1 } +// should error +type GlobalBad1 = (typeof globalThis)["\"ambientModule\""] +type GlobalOk1 = (typeof globalThis)["valueModule"] +type GlobalOk2 = globalThis.namespaceModule.typ +const bad1: (typeof globalThis)["\"ambientModule\""] = 'ambientModule' + + +//// [globalThisAmbientModules.js] +var valueModule; +(function (valueModule) { + valueModule.val = 1; +})(valueModule || (valueModule = {})); +var bad1 = 'ambientModule'; diff --git a/tests/baselines/reference/globalThisAmbientModules.symbols b/tests/baselines/reference/globalThisAmbientModules.symbols new file mode 100644 index 00000000000..f27f2461baa --- /dev/null +++ b/tests/baselines/reference/globalThisAmbientModules.symbols @@ -0,0 +1,38 @@ +=== tests/cases/conformance/es2019/globalThisAmbientModules.ts === +declare module "ambientModule" { +>"ambientModule" : Symbol("ambientModule", Decl(globalThisAmbientModules.ts, 0, 0)) + + export type typ = 1 +>typ : Symbol(typ, Decl(globalThisAmbientModules.ts, 0, 32)) + + export var val: typ +>val : Symbol(val, Decl(globalThisAmbientModules.ts, 2, 14)) +>typ : Symbol(typ, Decl(globalThisAmbientModules.ts, 0, 32)) +} +namespace valueModule { export var val = 1 } +>valueModule : Symbol(valueModule, Decl(globalThisAmbientModules.ts, 3, 1)) +>val : Symbol(val, Decl(globalThisAmbientModules.ts, 4, 34)) + +namespace namespaceModule { export type typ = 1 } +>namespaceModule : Symbol(namespaceModule, Decl(globalThisAmbientModules.ts, 4, 44)) +>typ : Symbol(typ, Decl(globalThisAmbientModules.ts, 5, 27)) + +// should error +type GlobalBad1 = (typeof globalThis)["\"ambientModule\""] +>GlobalBad1 : Symbol(GlobalBad1, Decl(globalThisAmbientModules.ts, 5, 49)) +>globalThis : Symbol(globalThis) + +type GlobalOk1 = (typeof globalThis)["valueModule"] +>GlobalOk1 : Symbol(GlobalOk1, Decl(globalThisAmbientModules.ts, 7, 58)) +>globalThis : Symbol(globalThis) + +type GlobalOk2 = globalThis.namespaceModule.typ +>GlobalOk2 : Symbol(GlobalOk2, Decl(globalThisAmbientModules.ts, 8, 51)) +>globalThis : Symbol(globalThis) +>namespaceModule : Symbol(namespaceModule, Decl(globalThisAmbientModules.ts, 4, 44)) +>typ : Symbol(namespaceModule.typ, Decl(globalThisAmbientModules.ts, 5, 27)) + +const bad1: (typeof globalThis)["\"ambientModule\""] = 'ambientModule' +>bad1 : Symbol(bad1, Decl(globalThisAmbientModules.ts, 10, 5)) +>globalThis : Symbol(globalThis) + diff --git a/tests/baselines/reference/globalThisAmbientModules.types b/tests/baselines/reference/globalThisAmbientModules.types new file mode 100644 index 00000000000..9357ee67ead --- /dev/null +++ b/tests/baselines/reference/globalThisAmbientModules.types @@ -0,0 +1,37 @@ +=== tests/cases/conformance/es2019/globalThisAmbientModules.ts === +declare module "ambientModule" { +>"ambientModule" : typeof import("ambientModule") + + export type typ = 1 +>typ : 1 + + export var val: typ +>val : 1 +} +namespace valueModule { export var val = 1 } +>valueModule : typeof valueModule +>val : number +>1 : 1 + +namespace namespaceModule { export type typ = 1 } +>typ : 1 + +// should error +type GlobalBad1 = (typeof globalThis)["\"ambientModule\""] +>GlobalBad1 : any +>globalThis : typeof globalThis + +type GlobalOk1 = (typeof globalThis)["valueModule"] +>GlobalOk1 : typeof valueModule +>globalThis : typeof globalThis + +type GlobalOk2 = globalThis.namespaceModule.typ +>GlobalOk2 : 1 +>globalThis : any +>namespaceModule : any + +const bad1: (typeof globalThis)["\"ambientModule\""] = 'ambientModule' +>bad1 : any +>globalThis : typeof globalThis +>'ambientModule' : "ambientModule" + diff --git a/tests/cases/conformance/es2019/globalThisAmbientModules.ts b/tests/cases/conformance/es2019/globalThisAmbientModules.ts new file mode 100644 index 00000000000..5f170a0de27 --- /dev/null +++ b/tests/cases/conformance/es2019/globalThisAmbientModules.ts @@ -0,0 +1,11 @@ +declare module "ambientModule" { + export type typ = 1 + export var val: typ +} +namespace valueModule { export var val = 1 } +namespace namespaceModule { export type typ = 1 } +// should error +type GlobalBad1 = (typeof globalThis)["\"ambientModule\""] +type GlobalOk1 = (typeof globalThis)["valueModule"] +type GlobalOk2 = globalThis.namespaceModule.typ +const bad1: (typeof globalThis)["\"ambientModule\""] = 'ambientModule' From 650c056fa070daf5821c25e0253144587941066c Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 5 May 2022 09:35:15 -0700 Subject: [PATCH 57/63] No error on toplevel return in JS (#48874) * No error on toplevel return in JS Turns out it's only an error in modules. It's possible to keep this error on the list of "OK for JS" errors and make the checker code stop issuing it for JS scripts only. However, I don't think the error is valuable enough to do that. Fixes #48224 * Restore 'return' statement. * Update Baselines and/or Applied Lint Fixes * Re-add missing baselines * No error in toplevel script files Only issue "no top-level return" error for modules, not scripts, regardless of whether it's TS or JS. * Keep Disallowing return in ambient locations * Allow toplevel return only in non-ESM JS files * Add test of toplevel return in JS script * Revert "Add test of toplevel return in JS script" This reverts commit 2a6dec475a35ec104915000984ffb79452cb7350. * Revert "Allow toplevel return only in non-ESM JS files" This reverts commit 6291ae3ba2df305d287f02223d634e21808fd15a. * Revert "Keep Disallowing return in ambient locations" This reverts commit 714ea8e524ff1129d94679df78f7790534222980. * Revert "No error in toplevel script files" This reverts commit 2056e13d5294a4d923b3f7c8e43dbc72f595afc6. * restore orphaned baseline Co-authored-by: Daniel Rosenwasser Co-authored-by: TypeScript Bot --- src/compiler/program.ts | 1 - ...coratorMetadata_isolatedModules.errors.txt | 47 --------- .../emitDecoratorMetadata_isolatedModules.js | 99 ------------------- ...tDecoratorMetadata_isolatedModules.symbols | 72 -------------- ...mitDecoratorMetadata_isolatedModules.types | 74 -------------- .../reference/plainJSGrammarErrors.errors.txt | 5 +- 6 files changed, 1 insertion(+), 297 deletions(-) delete mode 100644 tests/baselines/reference/emitDecoratorMetadata_isolatedModules.errors.txt delete mode 100644 tests/baselines/reference/emitDecoratorMetadata_isolatedModules.js delete mode 100644 tests/baselines/reference/emitDecoratorMetadata_isolatedModules.symbols delete mode 100644 tests/baselines/reference/emitDecoratorMetadata_isolatedModules.types diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 14da7655333..2caa36f1425 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -913,7 +913,6 @@ namespace ts { Diagnostics.A_rest_parameter_cannot_have_an_initializer.code, Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list.code, Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code, - Diagnostics.A_return_statement_can_only_be_used_within_a_function_body.code, Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code, Diagnostics.A_set_accessor_cannot_have_rest_parameter.code, Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code, diff --git a/tests/baselines/reference/emitDecoratorMetadata_isolatedModules.errors.txt b/tests/baselines/reference/emitDecoratorMetadata_isolatedModules.errors.txt deleted file mode 100644 index cabda9caa7e..00000000000 --- a/tests/baselines/reference/emitDecoratorMetadata_isolatedModules.errors.txt +++ /dev/null @@ -1,47 +0,0 @@ -tests/cases/compiler/index.ts(8,23): error TS1267: A type referenced in a decorated signature must be imported with 'import type' when 'isolatedModules' and 'emitDecoratorMetadata' are enabled. -tests/cases/compiler/index.ts(14,8): error TS1267: A type referenced in a decorated signature must be imported with 'import type' when 'isolatedModules' and 'emitDecoratorMetadata' are enabled. -tests/cases/compiler/index.ts(20,28): error TS1267: A type referenced in a decorated signature must be imported with 'import type' when 'isolatedModules' and 'emitDecoratorMetadata' are enabled. - - -==== tests/cases/compiler/type1.ts (0 errors) ==== - interface T1 {} - export type { T1 } - -==== tests/cases/compiler/type2.ts (0 errors) ==== - export interface T2 {} - -==== tests/cases/compiler/class3.ts (0 errors) ==== - export class C3 {} - -==== tests/cases/compiler/index.ts (3 errors) ==== - import { T1 } from "./type1"; - import type { T2 } from "./type2"; - import { C3 } from "./class3"; - declare var EventListener: any; - - class HelloWorld { - @EventListener('1') - handleEvent1(event: T1) {} // Error - ~~ -!!! error TS1267: A type referenced in a decorated signature must be imported with 'import type' when 'isolatedModules' and 'emitDecoratorMetadata' are enabled. -!!! related TS1376 tests/cases/compiler/index.ts:1:10: 'T1' was imported here. - - @EventListener('2') - handleEvent2(event: T2) {} // Ok - - @EventListener('1') - p1!: T1; // Error - ~~ -!!! error TS1267: A type referenced in a decorated signature must be imported with 'import type' when 'isolatedModules' and 'emitDecoratorMetadata' are enabled. -!!! related TS1376 tests/cases/compiler/index.ts:1:10: 'T1' was imported here. - - @EventListener('2') - p2!: T2; // Ok - - @EventListener('3') - handleEvent3(event: C3): T1 { return undefined! } // Ok, Error - ~~ -!!! error TS1267: A type referenced in a decorated signature must be imported with 'import type' when 'isolatedModules' and 'emitDecoratorMetadata' are enabled. -!!! related TS1376 tests/cases/compiler/index.ts:1:10: 'T1' was imported here. - } - \ No newline at end of file diff --git a/tests/baselines/reference/emitDecoratorMetadata_isolatedModules.js b/tests/baselines/reference/emitDecoratorMetadata_isolatedModules.js deleted file mode 100644 index bb5e71383f4..00000000000 --- a/tests/baselines/reference/emitDecoratorMetadata_isolatedModules.js +++ /dev/null @@ -1,99 +0,0 @@ -//// [tests/cases/compiler/emitDecoratorMetadata_isolatedModules.ts] //// - -//// [type1.ts] -interface T1 {} -export type { T1 } - -//// [type2.ts] -export interface T2 {} - -//// [class3.ts] -export class C3 {} - -//// [index.ts] -import { T1 } from "./type1"; -import type { T2 } from "./type2"; -import { C3 } from "./class3"; -declare var EventListener: any; - -class HelloWorld { - @EventListener('1') - handleEvent1(event: T1) {} // Error - - @EventListener('2') - handleEvent2(event: T2) {} // Ok - - @EventListener('1') - p1!: T1; // Error - - @EventListener('2') - p2!: T2; // Ok - - @EventListener('3') - handleEvent3(event: C3): T1 { return undefined! } // Ok, Error -} - - -//// [type1.js] -"use strict"; -exports.__esModule = true; -//// [type2.js] -"use strict"; -exports.__esModule = true; -//// [class3.js] -"use strict"; -exports.__esModule = true; -exports.C3 = void 0; -var C3 = /** @class */ (function () { - function C3() { - } - return C3; -}()); -exports.C3 = C3; -//// [index.js] -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __metadata = (this && this.__metadata) || function (k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); -}; -exports.__esModule = true; -var class3_1 = require("./class3"); -var HelloWorld = /** @class */ (function () { - function HelloWorld() { - } - HelloWorld.prototype.handleEvent1 = function (event) { }; // Error - HelloWorld.prototype.handleEvent2 = function (event) { }; // Ok - HelloWorld.prototype.handleEvent3 = function (event) { return undefined; }; // Ok, Error - __decorate([ - EventListener('1'), - __metadata("design:type", Function), - __metadata("design:paramtypes", [Object]), - __metadata("design:returntype", void 0) - ], HelloWorld.prototype, "handleEvent1"); - __decorate([ - EventListener('2'), - __metadata("design:type", Function), - __metadata("design:paramtypes", [Object]), - __metadata("design:returntype", void 0) - ], HelloWorld.prototype, "handleEvent2"); - __decorate([ - EventListener('1'), - __metadata("design:type", Object) - ], HelloWorld.prototype, "p1"); - __decorate([ - EventListener('2'), - __metadata("design:type", Object) - ], HelloWorld.prototype, "p2"); - __decorate([ - EventListener('3'), - __metadata("design:type", Function), - __metadata("design:paramtypes", [class3_1.C3]), - __metadata("design:returntype", Object) - ], HelloWorld.prototype, "handleEvent3"); - return HelloWorld; -}()); diff --git a/tests/baselines/reference/emitDecoratorMetadata_isolatedModules.symbols b/tests/baselines/reference/emitDecoratorMetadata_isolatedModules.symbols deleted file mode 100644 index c957b1781e3..00000000000 --- a/tests/baselines/reference/emitDecoratorMetadata_isolatedModules.symbols +++ /dev/null @@ -1,72 +0,0 @@ -=== tests/cases/compiler/type1.ts === -interface T1 {} ->T1 : Symbol(T1, Decl(type1.ts, 0, 0)) - -export type { T1 } ->T1 : Symbol(T1, Decl(type1.ts, 1, 13)) - -=== tests/cases/compiler/type2.ts === -export interface T2 {} ->T2 : Symbol(T2, Decl(type2.ts, 0, 0)) - -=== tests/cases/compiler/class3.ts === -export class C3 {} ->C3 : Symbol(C3, Decl(class3.ts, 0, 0)) - -=== tests/cases/compiler/index.ts === -import { T1 } from "./type1"; ->T1 : Symbol(T1, Decl(index.ts, 0, 8)) - -import type { T2 } from "./type2"; ->T2 : Symbol(T2, Decl(index.ts, 1, 13)) - -import { C3 } from "./class3"; ->C3 : Symbol(C3, Decl(index.ts, 2, 8)) - -declare var EventListener: any; ->EventListener : Symbol(EventListener, Decl(index.ts, 3, 11)) - -class HelloWorld { ->HelloWorld : Symbol(HelloWorld, Decl(index.ts, 3, 31)) - - @EventListener('1') ->EventListener : Symbol(EventListener, Decl(index.ts, 3, 11)) - - handleEvent1(event: T1) {} // Error ->handleEvent1 : Symbol(HelloWorld.handleEvent1, Decl(index.ts, 5, 18)) ->event : Symbol(event, Decl(index.ts, 7, 15)) ->T1 : Symbol(T1, Decl(index.ts, 0, 8)) - - @EventListener('2') ->EventListener : Symbol(EventListener, Decl(index.ts, 3, 11)) - - handleEvent2(event: T2) {} // Ok ->handleEvent2 : Symbol(HelloWorld.handleEvent2, Decl(index.ts, 7, 28)) ->event : Symbol(event, Decl(index.ts, 10, 15)) ->T2 : Symbol(T2, Decl(index.ts, 1, 13)) - - @EventListener('1') ->EventListener : Symbol(EventListener, Decl(index.ts, 3, 11)) - - p1!: T1; // Error ->p1 : Symbol(HelloWorld.p1, Decl(index.ts, 10, 28)) ->T1 : Symbol(T1, Decl(index.ts, 0, 8)) - - @EventListener('2') ->EventListener : Symbol(EventListener, Decl(index.ts, 3, 11)) - - p2!: T2; // Ok ->p2 : Symbol(HelloWorld.p2, Decl(index.ts, 13, 10)) ->T2 : Symbol(T2, Decl(index.ts, 1, 13)) - - @EventListener('3') ->EventListener : Symbol(EventListener, Decl(index.ts, 3, 11)) - - handleEvent3(event: C3): T1 { return undefined! } // Ok, Error ->handleEvent3 : Symbol(HelloWorld.handleEvent3, Decl(index.ts, 16, 10)) ->event : Symbol(event, Decl(index.ts, 19, 15)) ->C3 : Symbol(C3, Decl(index.ts, 2, 8)) ->T1 : Symbol(T1, Decl(index.ts, 0, 8)) ->undefined : Symbol(undefined) -} - diff --git a/tests/baselines/reference/emitDecoratorMetadata_isolatedModules.types b/tests/baselines/reference/emitDecoratorMetadata_isolatedModules.types deleted file mode 100644 index 0048771bb4e..00000000000 --- a/tests/baselines/reference/emitDecoratorMetadata_isolatedModules.types +++ /dev/null @@ -1,74 +0,0 @@ -=== tests/cases/compiler/type1.ts === -interface T1 {} -export type { T1 } ->T1 : T1 - -=== tests/cases/compiler/type2.ts === -export interface T2 {} -No type information for this code. -No type information for this code.=== tests/cases/compiler/class3.ts === -export class C3 {} ->C3 : C3 - -=== tests/cases/compiler/index.ts === -import { T1 } from "./type1"; ->T1 : any - -import type { T2 } from "./type2"; ->T2 : T2 - -import { C3 } from "./class3"; ->C3 : typeof C3 - -declare var EventListener: any; ->EventListener : any - -class HelloWorld { ->HelloWorld : HelloWorld - - @EventListener('1') ->EventListener('1') : any ->EventListener : any ->'1' : "1" - - handleEvent1(event: T1) {} // Error ->handleEvent1 : (event: T1) => void ->event : T1 - - @EventListener('2') ->EventListener('2') : any ->EventListener : any ->'2' : "2" - - handleEvent2(event: T2) {} // Ok ->handleEvent2 : (event: T2) => void ->event : T2 - - @EventListener('1') ->EventListener('1') : any ->EventListener : any ->'1' : "1" - - p1!: T1; // Error ->p1 : T1 - - @EventListener('2') ->EventListener('2') : any ->EventListener : any ->'2' : "2" - - p2!: T2; // Ok ->p2 : T2 - - @EventListener('3') ->EventListener('3') : any ->EventListener : any ->'3' : "3" - - handleEvent3(event: C3): T1 { return undefined! } // Ok, Error ->handleEvent3 : (event: C3) => T1 ->event : C3 ->undefined! : undefined ->undefined : undefined -} - diff --git a/tests/baselines/reference/plainJSGrammarErrors.errors.txt b/tests/baselines/reference/plainJSGrammarErrors.errors.txt index c49f7618bf4..0ab5b17e0c2 100644 --- a/tests/baselines/reference/plainJSGrammarErrors.errors.txt +++ b/tests/baselines/reference/plainJSGrammarErrors.errors.txt @@ -100,10 +100,9 @@ tests/cases/conformance/salsa/plainJSGrammarErrors.js(202,22): error TS17012: 't tests/cases/conformance/salsa/plainJSGrammarErrors.js(203,30): message TS1450: Dynamic imports can only accept a module specifier and an optional assertion as arguments tests/cases/conformance/salsa/plainJSGrammarErrors.js(204,30): message TS1450: Dynamic imports can only accept a module specifier and an optional assertion as arguments tests/cases/conformance/salsa/plainJSGrammarErrors.js(205,36): error TS1325: Argument of dynamic import cannot be spread element. -tests/cases/conformance/salsa/plainJSGrammarErrors.js(207,1): error TS1108: A 'return' statement can only be used within a function body. -==== tests/cases/conformance/salsa/plainJSGrammarErrors.js (103 errors) ==== +==== tests/cases/conformance/salsa/plainJSGrammarErrors.js (102 errors) ==== class C { // #private mistakes q = #unbound @@ -515,6 +514,4 @@ tests/cases/conformance/salsa/plainJSGrammarErrors.js(207,1): error TS1108: A 'r !!! error TS1325: Argument of dynamic import cannot be spread element. return - ~~~~~~ -!!! error TS1108: A 'return' statement can only be used within a function body. \ No newline at end of file From eb1a8b14cc6f22b6b6ccbf6e40e878daccceab81 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 5 May 2022 10:33:52 -0700 Subject: [PATCH 58/63] Remove some unused baselines. (#48964) --- ...lpersWithLocalCollisions(module=node12).js | 27 - ...odule=commonjs,moduleresolution=node12).js | 19 - ...=commonjs,moduleresolution=node12).symbols | 13 - ...le=commonjs,moduleresolution=node12).types | 14 - ...e=node12,moduleresolution=node).errors.txt | 16 - ...le(module=node12,moduleresolution=node).js | 42 - ...dule=node12,moduleresolution=node).symbols | 11 - ...module=node12,moduleresolution=node).types | 14 - ...(module=node12,moduleresolution=node12).js | 42 - ...le=node12,moduleresolution=node12).symbols | 13 - ...dule=node12,moduleresolution=node12).types | 14 - ...odule=node12,moduleresolution=nodenext).js | 42 - ...=node12,moduleresolution=nodenext).symbols | 13 - ...le=node12,moduleresolution=nodenext).types | 14 - ...odule=nodenext,moduleresolution=node12).js | 42 - ...=nodenext,moduleresolution=node12).symbols | 13 - ...le=nodenext,moduleresolution=node12).types | 14 - ...sPackageSelfName(module=node12).errors.txt | 24 - ...deAllowJsPackageSelfName(module=node12).js | 67 -- ...owJsPackageSelfName(module=node12).symbols | 24 - ...llowJsPackageSelfName(module=node12).types | 24 - .../nodeModules1(module=node12).errors.txt | 564 ---------- .../reference/nodeModules1(module=node12).js | 700 ------------ .../nodeModules1(module=node12).symbols | 817 -------------- .../nodeModules1(module=node12).types | 997 ------------------ ...eModulesAllowJs1(module=node12).errors.txt | 663 ------------ .../nodeModulesAllowJs1(module=node12).js | 688 ------------ ...nodeModulesAllowJs1(module=node12).symbols | 817 -------------- .../nodeModulesAllowJs1(module=node12).types | 997 ------------------ ...lesAllowJsCjsFromJs(module=node12).symbols | 15 - ...dulesAllowJsCjsFromJs(module=node12).types | 17 - ...alPackageExports(module=node12).errors.txt | 135 --- ...onditionalPackageExports(module=node12).js | 205 ---- ...ionalPackageExports(module=node12).symbols | 243 ----- ...itionalPackageExports(module=node12).types | 246 ----- ...ulesAllowJsDynamicImport(module=node12).js | 45 - ...llowJsDynamicImport(module=node12).symbols | 22 - ...sAllowJsDynamicImport(module=node12).types | 26 - ...ExportAssignment(module=node12).errors.txt | 41 - ...sAllowJsExportAssignment(module=node12).js | 61 -- ...wJsExportAssignment(module=node12).symbols | 36 - ...lowJsExportAssignment(module=node12).types | 45 - ...edNameCollisions(module=node12).errors.txt | 38 - ...sGeneratedNameCollisions(module=node12).js | 62 -- ...ratedNameCollisions(module=node12).symbols | 38 - ...neratedNameCollisions(module=node12).types | 42 - ...ImportAssignment(module=node12).errors.txt | 49 - ...sAllowJsImportAssignment(module=node12).js | 68 -- ...wJsImportAssignment(module=node12).symbols | 43 - ...lowJsImportAssignment(module=node12).types | 51 - ...lpersCollisions1(module=node12).errors.txt | 36 - ...ImportHelpersCollisions1(module=node12).js | 52 - ...tHelpersCollisions1(module=node12).symbols | 40 - ...ortHelpersCollisions1(module=node12).types | 48 - ...lpersCollisions2(module=node12).errors.txt | 32 - ...ImportHelpersCollisions2(module=node12).js | 48 - ...tHelpersCollisions2(module=node12).symbols | 22 - ...ortHelpersCollisions2(module=node12).types | 22 - ...lpersCollisions3(module=node12).errors.txt | 31 - ...ImportHelpersCollisions3(module=node12).js | 54 - ...tHelpersCollisions3(module=node12).symbols | 36 - ...ortHelpersCollisions3(module=node12).types | 36 - ...llowJsImportMeta(module=node12).errors.txt | 23 - ...ModulesAllowJsImportMeta(module=node12).js | 38 - ...esAllowJsImportMeta(module=node12).symbols | 24 - ...ulesAllowJsImportMeta(module=node12).types | 24 - ...JsPackageExports(module=node12).errors.txt | 107 -- ...lesAllowJsPackageExports(module=node12).js | 165 --- ...lowJsPackageExports(module=node12).symbols | 174 --- ...AllowJsPackageExports(module=node12).types | 174 --- ...JsPackageImports(module=node12).errors.txt | 44 - ...lesAllowJsPackageImports(module=node12).js | 96 -- ...lowJsPackageImports(module=node12).symbols | 60 -- ...AllowJsPackageImports(module=node12).types | 60 -- ...gePatternExports(module=node12).errors.txt | 78 -- ...wJsPackagePatternExports(module=node12).js | 124 --- ...ckagePatternExports(module=node12).symbols | 120 --- ...PackagePatternExports(module=node12).types | 120 --- ...nExportsTrailers(module=node12).errors.txt | 120 --- ...gePatternExportsTrailers(module=node12).js | 124 --- ...ternExportsTrailers(module=node12).symbols | 120 --- ...atternExportsTrailers(module=node12).types | 120 --- ...ronousCallErrors(module=node12).errors.txt | 55 - ...wJsSynchronousCallErrors(module=node12).js | 60 -- ...nchronousCallErrors(module=node12).symbols | 58 - ...SynchronousCallErrors(module=node12).types | 68 -- ...wJsTopLevelAwait(module=node12).errors.txt | 34 - ...ulesAllowJsTopLevelAwait(module=node12).js | 42 - ...llowJsTopLevelAwait(module=node12).symbols | 22 - ...sAllowJsTopLevelAwait(module=node12).types | 28 - ...rmatFileAlwaysHasDefault(module=node12).js | 36 - ...ileAlwaysHasDefault(module=node12).symbols | 13 - ...tFileAlwaysHasDefault(module=node12).types | 14 - ...alPackageExports(module=node12).errors.txt | 135 --- ...onditionalPackageExports(module=node12).js | 205 ---- ...ionalPackageExports(module=node12).symbols | 243 ----- ...itionalPackageExports(module=node12).types | 246 ----- ...thPackageExports(module=node12).errors.txt | 116 -- ...onEmitWithPackageExports(module=node12).js | 202 ---- ...tWithPackageExports(module=node12).symbols | 201 ---- ...mitWithPackageExports(module=node12).types | 204 ---- ...nodeModulesDynamicImport(module=node12).js | 45 - ...odulesDynamicImport(module=node12).symbols | 22 - ...eModulesDynamicImport(module=node12).types | 26 - ...xportAssignments(module=node12).errors.txt | 23 - ...ModulesExportAssignments(module=node12).js | 38 - ...esExportAssignments(module=node12).symbols | 16 - ...ulesExportAssignments(module=node12).types | 18 - ...cifierResolution(module=node12).errors.txt | 36 - ...locksSpecifierResolution(module=node12).js | 30 - ...SpecifierResolution(module=node12).symbols | 25 - ...ksSpecifierResolution(module=node12).types | 26 - ...rationConditions(module=node12).errors.txt | 40 - ...fierGenerationConditions(module=node12).js | 41 - ...enerationConditions(module=node12).symbols | 25 - ...rGenerationConditions(module=node12).types | 26 - ...erationDirectory(module=node12).errors.txt | 35 - ...ifierGenerationDirectory(module=node12).js | 36 - ...GenerationDirectory(module=node12).symbols | 25 - ...erGenerationDirectory(module=node12).types | 26 - ...enerationPattern(module=node12).errors.txt | 38 - ...ecifierGenerationPattern(module=node12).js | 36 - ...erGenerationPattern(module=node12).symbols | 22 - ...fierGenerationPattern(module=node12).types | 26 - ...esForbidenSyntax(module=node12).errors.txt | 139 --- ...odeModulesForbidenSyntax(module=node12).js | 172 --- ...dulesForbidenSyntax(module=node12).symbols | 120 --- ...ModulesForbidenSyntax(module=node12).types | 168 --- ...edNameCollisions(module=node12).errors.txt | 38 - ...sGeneratedNameCollisions(module=node12).js | 64 -- ...ratedNameCollisions(module=node12).symbols | 38 - ...neratedNameCollisions(module=node12).types | 42 - ...ImportAssertions(module=node12).errors.txt | 28 - ...eModulesImportAssertions(module=node12).js | 20 - ...lesImportAssertions(module=node12).symbols | 25 - ...dulesImportAssertions(module=node12).types | 36 - ...ModulesImportAssignments(module=node12).js | 65 -- ...esImportAssignments(module=node12).symbols | 43 - ...ulesImportAssignments(module=node12).types | 51 - ...elpersCollisions(module=node12).errors.txt | 36 - ...sImportHelpersCollisions(module=node12).js | 52 - ...rtHelpersCollisions(module=node12).symbols | 40 - ...portHelpersCollisions(module=node12).types | 48 - ...lpersCollisions2(module=node12).errors.txt | 32 - ...ImportHelpersCollisions2(module=node12).js | 47 - ...tHelpersCollisions2(module=node12).symbols | 22 - ...ortHelpersCollisions2(module=node12).types | 22 - ...lpersCollisions3(module=node12).errors.txt | 27 - ...ImportHelpersCollisions3(module=node12).js | 44 - ...tHelpersCollisions3(module=node12).symbols | 20 - ...ortHelpersCollisions3(module=node12).types | 20 - ...odulesImportMeta(module=node12).errors.txt | 23 - .../nodeModulesImportMeta(module=node12).js | 40 - ...deModulesImportMeta(module=node12).symbols | 24 - ...nodeModulesImportMeta(module=node12).types | 24 - ...DeclarationEmit1(module=node12).errors.txt | 37 - ...portModeDeclarationEmit1(module=node12).js | 45 - ...odeDeclarationEmit1(module=node12).symbols | 38 - ...tModeDeclarationEmit1(module=node12).types | 30 - ...DeclarationEmit2(module=node12).errors.txt | 42 - ...portModeDeclarationEmit2(module=node12).js | 49 - ...odeDeclarationEmit2(module=node12).symbols | 38 - ...tModeDeclarationEmit2(module=node12).types | 30 - ...ationEmitErrors1(module=node12).errors.txt | 43 - ...deDeclarationEmitErrors1(module=node12).js | 39 - ...larationEmitErrors1(module=node12).symbols | 28 - ...eclarationEmitErrors1(module=node12).types | 24 - ...portResolutionIntoExport(module=node12).js | 70 -- ...esolutionIntoExport(module=node12).symbols | 24 - ...tResolutionIntoExport(module=node12).types | 24 - ...esolutionNoCycle(module=node12).errors.txt | 33 - ...sImportResolutionNoCycle(module=node12).js | 70 -- ...rtResolutionNoCycle(module=node12).symbols | 24 - ...portResolutionNoCycle(module=node12).types | 24 - ...TypeModeDeclarationEmit1(module=node12).js | 36 - ...odeDeclarationEmit1(module=node12).symbols | 26 - ...eModeDeclarationEmit1(module=node12).types | 26 - ...ationEmitErrors1(module=node12).errors.txt | 304 ------ ...deDeclarationEmitErrors1(module=node12).js | 147 --- ...larationEmitErrors1(module=node12).symbols | 128 --- ...eclarationEmitErrors1(module=node12).types | 193 ---- ...esPackageExports(module=node12).errors.txt | 107 -- ...odeModulesPackageExports(module=node12).js | 165 --- ...dulesPackageExports(module=node12).symbols | 174 --- ...ModulesPackageExports(module=node12).types | 174 --- ...esPackageImports(module=node12).errors.txt | 44 - ...odeModulesPackageImports(module=node12).js | 96 -- ...dulesPackageImports(module=node12).symbols | 60 -- ...ModulesPackageImports(module=node12).types | 60 -- ...gePatternExports(module=node12).errors.txt | 78 -- ...lesPackagePatternExports(module=node12).js | 124 --- ...ckagePatternExports(module=node12).symbols | 120 --- ...PackagePatternExports(module=node12).types | 120 --- ...nExportsTrailers(module=node12).errors.txt | 120 --- ...gePatternExportsTrailers(module=node12).js | 124 --- ...ternExportsTrailers(module=node12).symbols | 120 --- ...atternExportsTrailers(module=node12).types | 120 --- ...esolveJsonModule(module=node12).errors.txt | 39 - ...ModulesResolveJsonModule(module=node12).js | 120 --- ...esResolveJsonModule(module=node12).symbols | 89 -- ...ulesResolveJsonModule(module=node12).types | 95 -- ...ronousCallErrors(module=node12).errors.txt | 43 - ...lesSynchronousCallErrors(module=node12).js | 60 -- ...nchronousCallErrors(module=node12).symbols | 58 - ...SynchronousCallErrors(module=node12).types | 68 -- ...lesTopLevelAwait(module=node12).errors.txt | 34 - ...nodeModulesTopLevelAwait(module=node12).js | 44 - ...odulesTopLevelAwait(module=node12).symbols | 22 - ...eModulesTopLevelAwait(module=node12).types | 28 - ...enceModeDeclarationEmit1(module=node12).js | 35 - ...odeDeclarationEmit1(module=node12).symbols | 14 - ...eModeDeclarationEmit1(module=node12).types | 10 - ...enceModeDeclarationEmit2(module=node12).js | 39 - ...odeDeclarationEmit2(module=node12).symbols | 14 - ...eModeDeclarationEmit2(module=node12).types | 10 - ...enceModeDeclarationEmit3(module=node12).js | 39 - ...odeDeclarationEmit3(module=node12).symbols | 14 - ...eModeDeclarationEmit3(module=node12).types | 10 - ...enceModeDeclarationEmit4(module=node12).js | 35 - ...odeDeclarationEmit4(module=node12).symbols | 14 - ...eModeDeclarationEmit4(module=node12).types | 10 - ...enceModeDeclarationEmit5(module=node12).js | 38 - ...odeDeclarationEmit5(module=node12).symbols | 24 - ...eModeDeclarationEmit5(module=node12).types | 18 - ...enceModeDeclarationEmit6(module=node12).js | 53 - ...odeDeclarationEmit6(module=node12).symbols | 25 - ...eModeDeclarationEmit6(module=node12).types | 25 - ...enceModeDeclarationEmit7(module=node12).js | 78 -- ...odeDeclarationEmit7(module=node12).symbols | 51 - ...eModeDeclarationEmit7(module=node12).types | 50 - ...nceModeOverride1(module=node12).errors.txt | 29 - ...shReferenceModeOverride1(module=node12).js | 33 - ...erenceModeOverride1(module=node12).symbols | 15 - ...eferenceModeOverride1(module=node12).types | 17 - ...nceModeOverride2(module=node12).errors.txt | 34 - ...shReferenceModeOverride2(module=node12).js | 37 - ...erenceModeOverride2(module=node12).symbols | 15 - ...eferenceModeOverride2(module=node12).types | 17 - ...nceModeOverride3(module=node12).errors.txt | 34 - ...shReferenceModeOverride3(module=node12).js | 37 - ...erenceModeOverride3(module=node12).symbols | 15 - ...eferenceModeOverride3(module=node12).types | 17 - ...nceModeOverride4(module=node12).errors.txt | 29 - ...shReferenceModeOverride4(module=node12).js | 33 - ...erenceModeOverride4(module=node12).symbols | 15 - ...eferenceModeOverride4(module=node12).types | 17 - ...shReferenceModeOverride5(module=node12).js | 39 - ...erenceModeOverride5(module=node12).symbols | 28 - ...eferenceModeOverride5(module=node12).types | 28 - ...verrideModeError(module=node12).errors.txt | 32 - ...nceModeOverrideModeError(module=node12).js | 33 - ...deOverrideModeError(module=node12).symbols | 15 - ...ModeOverrideModeError(module=node12).types | 17 - ...pesVersionPackageExports(module=node12).js | 98 -- ...rsionPackageExports(module=node12).symbols | 57 - ...VersionPackageExports(module=node12).types | 63 -- ...ePackageSelfName(module=node12).errors.txt | 24 - .../nodePackageSelfName(module=node12).js | 67 -- ...nodePackageSelfName(module=node12).symbols | 24 - .../nodePackageSelfName(module=node12).types | 24 - ...geSelfNameScoped(module=node12).errors.txt | 24 - ...odePackageSelfNameScoped(module=node12).js | 67 -- ...ckageSelfNameScoped(module=node12).symbols | 24 - ...PackageSelfNameScoped(module=node12).types | 24 - ...thMissingExports(module=node12).errors.txt | 17 - ...erenceWithMissingExports(module=node12).js | 18 - ...eWithMissingExports(module=node12).symbols | 13 - ...nceWithMissingExports(module=node12).types | 13 - 268 files changed, 20705 deletions(-) delete mode 100644 tests/baselines/reference/emitHelpersWithLocalCollisions(module=node12).js delete mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node12).js delete mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node12).symbols delete mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node12).types delete mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node).errors.txt delete mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node).js delete mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node).symbols delete mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node).types delete mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node12).js delete mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node12).symbols delete mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node12).types delete mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=nodenext).js delete mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=nodenext).symbols delete mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=nodenext).types delete mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node12).js delete mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node12).symbols delete mode 100644 tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node12).types delete mode 100644 tests/baselines/reference/nodeAllowJsPackageSelfName(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeAllowJsPackageSelfName(module=node12).js delete mode 100644 tests/baselines/reference/nodeAllowJsPackageSelfName(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeAllowJsPackageSelfName(module=node12).types delete mode 100644 tests/baselines/reference/nodeModules1(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModules1(module=node12).js delete mode 100644 tests/baselines/reference/nodeModules1(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModules1(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesAllowJs1(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesAllowJs1(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesAllowJs1(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesAllowJs1(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesConditionalPackageExports(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesConditionalPackageExports(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesConditionalPackageExports(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesConditionalPackageExports(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesDynamicImport(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesDynamicImport(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesDynamicImport(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesExportAssignments(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesExportAssignments(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesExportAssignments(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesExportAssignments(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesForbidenSyntax(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesForbidenSyntax(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesForbidenSyntax(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesForbidenSyntax(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesImportAssertions(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesImportAssertions(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesImportAssertions(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesImportAssertions(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesImportAssignments(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesImportAssignments(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesImportAssignments(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesImportMeta(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesImportMeta(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesImportMeta(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesImportMeta(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesPackageExports(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesPackageExports(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesPackageExports(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesPackageExports(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesPackageImports(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesPackageImports(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesPackageImports(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesPackageImports(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesPackagePatternExports(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesPackagePatternExports(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesPackagePatternExports(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesPackagePatternExports(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesResolveJsonModule(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesResolveJsonModule(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesResolveJsonModule(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesResolveJsonModule(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesTopLevelAwait(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesTopLevelAwait(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesTopLevelAwait(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesTopLevelAwait(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node12).types delete mode 100644 tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node12).js delete mode 100644 tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node12).symbols delete mode 100644 tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node12).types delete mode 100644 tests/baselines/reference/nodePackageSelfName(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodePackageSelfName(module=node12).js delete mode 100644 tests/baselines/reference/nodePackageSelfName(module=node12).symbols delete mode 100644 tests/baselines/reference/nodePackageSelfName(module=node12).types delete mode 100644 tests/baselines/reference/nodePackageSelfNameScoped(module=node12).errors.txt delete mode 100644 tests/baselines/reference/nodePackageSelfNameScoped(module=node12).js delete mode 100644 tests/baselines/reference/nodePackageSelfNameScoped(module=node12).symbols delete mode 100644 tests/baselines/reference/nodePackageSelfNameScoped(module=node12).types delete mode 100644 tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).errors.txt delete mode 100644 tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).js delete mode 100644 tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).symbols delete mode 100644 tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).types diff --git a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=node12).js b/tests/baselines/reference/emitHelpersWithLocalCollisions(module=node12).js deleted file mode 100644 index 8aed6c9347a..00000000000 --- a/tests/baselines/reference/emitHelpersWithLocalCollisions(module=node12).js +++ /dev/null @@ -1,27 +0,0 @@ -//// [a.ts] -declare var dec: any, __decorate: any; -@dec export class A { -} - -const o = { a: 1 }; -const y = { ...o }; - - -//// [a.js] -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.A = void 0; -let A = class A { -}; -A = __decorate([ - dec -], A); -exports.A = A; -const o = { a: 1 }; -const y = Object.assign({}, o); diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node12).js b/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node12).js deleted file mode 100644 index 843190b26d3..00000000000 --- a/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node12).js +++ /dev/null @@ -1,19 +0,0 @@ -//// [tests/cases/compiler/moduleResolutionWithModule.ts] //// - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "exports": "./entrypoint.js" -} -//// [entrypoint.d.ts] -export declare function thing(): void; -//// [index.ts] -import * as p from "pkg"; -p.thing(); - -//// [index.js] -"use strict"; -exports.__esModule = true; -var p = require("pkg"); -p.thing(); diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node12).symbols b/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node12).symbols deleted file mode 100644 index 8ab99790e5f..00000000000 --- a/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node12).symbols +++ /dev/null @@ -1,13 +0,0 @@ -=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts === -export declare function thing(): void; ->thing : Symbol(thing, Decl(entrypoint.d.ts, 0, 0)) - -=== tests/cases/compiler/index.ts === -import * as p from "pkg"; ->p : Symbol(p, Decl(index.ts, 0, 6)) - -p.thing(); ->p.thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0)) ->p : Symbol(p, Decl(index.ts, 0, 6)) ->thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0)) - diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node12).types b/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node12).types deleted file mode 100644 index c49641fe551..00000000000 --- a/tests/baselines/reference/moduleResolutionWithModule(module=commonjs,moduleresolution=node12).types +++ /dev/null @@ -1,14 +0,0 @@ -=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts === -export declare function thing(): void; ->thing : () => void - -=== tests/cases/compiler/index.ts === -import * as p from "pkg"; ->p : typeof p - -p.thing(); ->p.thing() : void ->p.thing : () => void ->p : typeof p ->thing : () => void - diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node).errors.txt b/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node).errors.txt deleted file mode 100644 index dc0e81b0259..00000000000 --- a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node).errors.txt +++ /dev/null @@ -1,16 +0,0 @@ -tests/cases/compiler/index.ts(1,20): error TS2307: Cannot find module 'pkg' or its corresponding type declarations. - - -==== tests/cases/compiler/node_modules/pkg/package.json (0 errors) ==== - { - "name": "pkg", - "version": "0.0.1", - "exports": "./entrypoint.js" - } -==== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts (0 errors) ==== - export declare function thing(): void; -==== tests/cases/compiler/index.ts (1 errors) ==== - import * as p from "pkg"; - ~~~~~ -!!! error TS2307: Cannot find module 'pkg' or its corresponding type declarations. - p.thing(); \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node).js b/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node).js deleted file mode 100644 index 23844cf6bab..00000000000 --- a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node).js +++ /dev/null @@ -1,42 +0,0 @@ -//// [tests/cases/compiler/moduleResolutionWithModule.ts] //// - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "exports": "./entrypoint.js" -} -//// [entrypoint.d.ts] -export declare function thing(): void; -//// [index.ts] -import * as p from "pkg"; -p.thing(); - -//// [index.js] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const p = __importStar(require("pkg")); -p.thing(); diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node).symbols b/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node).symbols deleted file mode 100644 index 40ac39fdf75..00000000000 --- a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node).symbols +++ /dev/null @@ -1,11 +0,0 @@ -=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts === -export declare function thing(): void; ->thing : Symbol(thing, Decl(entrypoint.d.ts, 0, 0)) - -=== tests/cases/compiler/index.ts === -import * as p from "pkg"; ->p : Symbol(p, Decl(index.ts, 0, 6)) - -p.thing(); ->p : Symbol(p, Decl(index.ts, 0, 6)) - diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node).types b/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node).types deleted file mode 100644 index 45eed8eb127..00000000000 --- a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node).types +++ /dev/null @@ -1,14 +0,0 @@ -=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts === -export declare function thing(): void; ->thing : () => void - -=== tests/cases/compiler/index.ts === -import * as p from "pkg"; ->p : any - -p.thing(); ->p.thing() : any ->p.thing : any ->p : any ->thing : any - diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node12).js b/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node12).js deleted file mode 100644 index 23844cf6bab..00000000000 --- a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node12).js +++ /dev/null @@ -1,42 +0,0 @@ -//// [tests/cases/compiler/moduleResolutionWithModule.ts] //// - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "exports": "./entrypoint.js" -} -//// [entrypoint.d.ts] -export declare function thing(): void; -//// [index.ts] -import * as p from "pkg"; -p.thing(); - -//// [index.js] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const p = __importStar(require("pkg")); -p.thing(); diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node12).symbols b/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node12).symbols deleted file mode 100644 index 8ab99790e5f..00000000000 --- a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node12).symbols +++ /dev/null @@ -1,13 +0,0 @@ -=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts === -export declare function thing(): void; ->thing : Symbol(thing, Decl(entrypoint.d.ts, 0, 0)) - -=== tests/cases/compiler/index.ts === -import * as p from "pkg"; ->p : Symbol(p, Decl(index.ts, 0, 6)) - -p.thing(); ->p.thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0)) ->p : Symbol(p, Decl(index.ts, 0, 6)) ->thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0)) - diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node12).types b/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node12).types deleted file mode 100644 index c49641fe551..00000000000 --- a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=node12).types +++ /dev/null @@ -1,14 +0,0 @@ -=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts === -export declare function thing(): void; ->thing : () => void - -=== tests/cases/compiler/index.ts === -import * as p from "pkg"; ->p : typeof p - -p.thing(); ->p.thing() : void ->p.thing : () => void ->p : typeof p ->thing : () => void - diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=nodenext).js b/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=nodenext).js deleted file mode 100644 index 23844cf6bab..00000000000 --- a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=nodenext).js +++ /dev/null @@ -1,42 +0,0 @@ -//// [tests/cases/compiler/moduleResolutionWithModule.ts] //// - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "exports": "./entrypoint.js" -} -//// [entrypoint.d.ts] -export declare function thing(): void; -//// [index.ts] -import * as p from "pkg"; -p.thing(); - -//// [index.js] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const p = __importStar(require("pkg")); -p.thing(); diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=nodenext).symbols b/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=nodenext).symbols deleted file mode 100644 index 8ab99790e5f..00000000000 --- a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=nodenext).symbols +++ /dev/null @@ -1,13 +0,0 @@ -=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts === -export declare function thing(): void; ->thing : Symbol(thing, Decl(entrypoint.d.ts, 0, 0)) - -=== tests/cases/compiler/index.ts === -import * as p from "pkg"; ->p : Symbol(p, Decl(index.ts, 0, 6)) - -p.thing(); ->p.thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0)) ->p : Symbol(p, Decl(index.ts, 0, 6)) ->thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0)) - diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=nodenext).types b/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=nodenext).types deleted file mode 100644 index c49641fe551..00000000000 --- a/tests/baselines/reference/moduleResolutionWithModule(module=node12,moduleresolution=nodenext).types +++ /dev/null @@ -1,14 +0,0 @@ -=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts === -export declare function thing(): void; ->thing : () => void - -=== tests/cases/compiler/index.ts === -import * as p from "pkg"; ->p : typeof p - -p.thing(); ->p.thing() : void ->p.thing : () => void ->p : typeof p ->thing : () => void - diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node12).js b/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node12).js deleted file mode 100644 index 23844cf6bab..00000000000 --- a/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node12).js +++ /dev/null @@ -1,42 +0,0 @@ -//// [tests/cases/compiler/moduleResolutionWithModule.ts] //// - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "exports": "./entrypoint.js" -} -//// [entrypoint.d.ts] -export declare function thing(): void; -//// [index.ts] -import * as p from "pkg"; -p.thing(); - -//// [index.js] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const p = __importStar(require("pkg")); -p.thing(); diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node12).symbols b/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node12).symbols deleted file mode 100644 index 8ab99790e5f..00000000000 --- a/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node12).symbols +++ /dev/null @@ -1,13 +0,0 @@ -=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts === -export declare function thing(): void; ->thing : Symbol(thing, Decl(entrypoint.d.ts, 0, 0)) - -=== tests/cases/compiler/index.ts === -import * as p from "pkg"; ->p : Symbol(p, Decl(index.ts, 0, 6)) - -p.thing(); ->p.thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0)) ->p : Symbol(p, Decl(index.ts, 0, 6)) ->thing : Symbol(p.thing, Decl(entrypoint.d.ts, 0, 0)) - diff --git a/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node12).types b/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node12).types deleted file mode 100644 index c49641fe551..00000000000 --- a/tests/baselines/reference/moduleResolutionWithModule(module=nodenext,moduleresolution=node12).types +++ /dev/null @@ -1,14 +0,0 @@ -=== tests/cases/compiler/node_modules/pkg/entrypoint.d.ts === -export declare function thing(): void; ->thing : () => void - -=== tests/cases/compiler/index.ts === -import * as p from "pkg"; ->p : typeof p - -p.thing(); ->p.thing() : void ->p.thing : () => void ->p : typeof p ->thing : () => void - diff --git a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node12).errors.txt b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node12).errors.txt deleted file mode 100644 index bdf6aba250c..00000000000 --- a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node12).errors.txt +++ /dev/null @@ -1,24 +0,0 @@ -tests/cases/conformance/node/allowJs/index.cjs(2,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - - -==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== - // esm format file - import * as self from "package"; - self; -==== tests/cases/conformance/node/allowJs/index.mjs (0 errors) ==== - // esm format file - import * as self from "package"; - self; -==== tests/cases/conformance/node/allowJs/index.cjs (1 errors) ==== - // esm format file - import * as self from "package"; - ~~~~~~~~~ -!!! error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - self; -==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module", - "exports": "./index.js" - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node12).js b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node12).js deleted file mode 100644 index aeafa06e281..00000000000 --- a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node12).js +++ /dev/null @@ -1,67 +0,0 @@ -//// [tests/cases/conformance/node/allowJs/nodeAllowJsPackageSelfName.ts] //// - -//// [index.js] -// esm format file -import * as self from "package"; -self; -//// [index.mjs] -// esm format file -import * as self from "package"; -self; -//// [index.cjs] -// esm format file -import * as self from "package"; -self; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module", - "exports": "./index.js" -} - -//// [index.js] -// esm format file -import * as self from "package"; -self; -//// [index.mjs] -// esm format file -import * as self from "package"; -self; -//// [index.cjs] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// esm format file -const self = __importStar(require("package")); -self; - - -//// [index.d.ts] -export {}; -//// [index.d.mts] -export {}; -//// [index.d.cts] -export {}; diff --git a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node12).symbols b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node12).symbols deleted file mode 100644 index eb9fab3a89a..00000000000 --- a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node12).symbols +++ /dev/null @@ -1,24 +0,0 @@ -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -import * as self from "package"; ->self : Symbol(self, Decl(index.js, 1, 6)) - -self; ->self : Symbol(self, Decl(index.js, 1, 6)) - -=== tests/cases/conformance/node/allowJs/index.mjs === -// esm format file -import * as self from "package"; ->self : Symbol(self, Decl(index.mjs, 1, 6)) - -self; ->self : Symbol(self, Decl(index.mjs, 1, 6)) - -=== tests/cases/conformance/node/allowJs/index.cjs === -// esm format file -import * as self from "package"; ->self : Symbol(self, Decl(index.cjs, 1, 6)) - -self; ->self : Symbol(self, Decl(index.cjs, 1, 6)) - diff --git a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node12).types b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node12).types deleted file mode 100644 index 894b0d65103..00000000000 --- a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node12).types +++ /dev/null @@ -1,24 +0,0 @@ -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -import * as self from "package"; ->self : typeof self - -self; ->self : typeof self - -=== tests/cases/conformance/node/allowJs/index.mjs === -// esm format file -import * as self from "package"; ->self : typeof self - -self; ->self : typeof self - -=== tests/cases/conformance/node/allowJs/index.cjs === -// esm format file -import * as self from "package"; ->self : typeof self - -self; ->self : typeof self - diff --git a/tests/baselines/reference/nodeModules1(module=node12).errors.txt b/tests/baselines/reference/nodeModules1(module=node12).errors.txt deleted file mode 100644 index 724e3b73ed7..00000000000 --- a/tests/baselines/reference/nodeModules1(module=node12).errors.txt +++ /dev/null @@ -1,564 +0,0 @@ -tests/cases/conformance/node/index.cts(2,21): error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.cts(3,21): error TS1471: Module './index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.cts(6,21): error TS1471: Module './subfolder/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.cts(9,21): error TS1471: Module './subfolder2/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.cts(11,22): error TS1471: Module './subfolder2/another/index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.cts(12,22): error TS1471: Module './subfolder2/another/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.cts(15,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.cts(16,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.cts(23,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.cts(24,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.cts(25,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.cts(51,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.cts(52,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.cts(59,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.cts(60,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.cts(61,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.cts(75,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(76,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/index.cts(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.cts(78,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.cts(79,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/index.cts(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.cts(81,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.cts(82,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/index.cts(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.cts(84,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.cts(85,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? -tests/cases/conformance/node/index.mts(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/index.mts(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/index.mts(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/index.mts(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? -tests/cases/conformance/node/index.mts(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.mts(51,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.mts(58,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.mts(59,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.mts(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.mts(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/index.mts(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/index.mts(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/index.mts(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.mts(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? -tests/cases/conformance/node/index.ts(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/index.ts(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/index.ts(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/index.ts(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? -tests/cases/conformance/node/index.ts(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.ts(51,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.ts(58,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.ts(59,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.ts(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.ts(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/index.ts(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/index.ts(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/index.ts(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/index.ts(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? - - -==== tests/cases/conformance/node/subfolder/index.ts (0 errors) ==== - // cjs format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/subfolder/index.cts (0 errors) ==== - // cjs format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/subfolder/index.mts (0 errors) ==== - // esm format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/subfolder2/index.ts (0 errors) ==== - // cjs format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/subfolder2/index.cts (0 errors) ==== - // cjs format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/subfolder2/index.mts (0 errors) ==== - // esm format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/subfolder2/another/index.ts (0 errors) ==== - // esm format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/subfolder2/another/index.mts (0 errors) ==== - // esm format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/subfolder2/another/index.cts (0 errors) ==== - // cjs format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/index.mts (27 errors) ==== - import * as m1 from "./index.js"; - import * as m2 from "./index.mjs"; - import * as m3 from "./index.cjs"; - import * as m4 from "./subfolder/index.js"; - import * as m5 from "./subfolder/index.mjs"; - import * as m6 from "./subfolder/index.cjs"; - import * as m7 from "./subfolder2/index.js"; - import * as m8 from "./subfolder2/index.mjs"; - import * as m9 from "./subfolder2/index.cjs"; - import * as m10 from "./subfolder2/another/index.js"; - import * as m11 from "./subfolder2/another/index.mjs"; - import * as m12 from "./subfolder2/another/index.cjs"; - // The next ones should all fail - esm format files have no index resolution or extension resolution - import * as m13 from "./"; - ~~~~ -!!! error TS2307: Cannot find module './' or its corresponding type declarations. - import * as m14 from "./index"; - ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? - import * as m15 from "./subfolder"; - ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m16 from "./subfolder/"; - ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m17 from "./subfolder/index"; - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? - import * as m18 from "./subfolder2"; - ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m19 from "./subfolder2/"; - ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m20 from "./subfolder2/index"; - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? - import * as m21 from "./subfolder2/another"; - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m22 from "./subfolder2/another/"; - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m23 from "./subfolder2/another/index"; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? - void m1; - void m2; - void m3; - void m4; - void m5; - void m6; - void m7; - void m8; - void m9; - void m10; - void m11; - void m12; - void m13; - void m14; - void m15; - void m16; - void m17; - void m18; - void m19; - void m20; - void m21; - void m22; - void m23; - - // These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) - import m24 = require("./"); - ~~~~ -!!! error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m25 = require("./index"); - ~~~~~~~~~ -!!! error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m26 = require("./subfolder"); - import m27 = require("./subfolder/"); - import m28 = require("./subfolder/index"); - import m29 = require("./subfolder2"); - import m30 = require("./subfolder2/"); - import m31 = require("./subfolder2/index"); - import m32 = require("./subfolder2/another"); - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m33 = require("./subfolder2/another/"); - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m34 = require("./subfolder2/another/index"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - void m24; - void m25; - void m26; - void m27; - void m28; - void m29; - void m30; - void m31; - void m32; - void m33; - void m34; - - // These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution - const _m35 = import("./"); - ~~~~ -!!! error TS2307: Cannot find module './' or its corresponding type declarations. - const _m36 = import("./index"); - ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? - const _m37 = import("./subfolder"); - ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m38 = import("./subfolder/"); - ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m39 = import("./subfolder/index"); - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? - const _m40 = import("./subfolder2"); - ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m41 = import("./subfolder2/"); - ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m42 = import("./subfolder2/index"); - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? - const _m43 = import("./subfolder2/another"); - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m44 = import("./subfolder2/another/"); - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m45 = import("./subfolder2/another/index"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? - - // esm format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/index.cts (27 errors) ==== - // ESM-format imports below should issue errors - import * as m1 from "./index.js"; - ~~~~~~~~~~~~ -!!! error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as m2 from "./index.mjs"; - ~~~~~~~~~~~~~ -!!! error TS1471: Module './index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as m3 from "./index.cjs"; - import * as m4 from "./subfolder/index.js"; - import * as m5 from "./subfolder/index.mjs"; - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as m6 from "./subfolder/index.cjs"; - import * as m7 from "./subfolder2/index.js"; - import * as m8 from "./subfolder2/index.mjs"; - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as m9 from "./subfolder2/index.cjs"; - import * as m10 from "./subfolder2/another/index.js"; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another/index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as m11 from "./subfolder2/another/index.mjs"; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as m12 from "./subfolder2/another/index.cjs"; - // The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) - import * as m13 from "./"; - ~~~~ -!!! error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as m14 from "./index"; - ~~~~~~~~~ -!!! error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as m15 from "./subfolder"; - import * as m16 from "./subfolder/"; - import * as m17 from "./subfolder/index"; - import * as m18 from "./subfolder2"; - import * as m19 from "./subfolder2/"; - import * as m20 from "./subfolder2/index"; - import * as m21 from "./subfolder2/another"; - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as m22 from "./subfolder2/another/"; - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as m23 from "./subfolder2/another/index"; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - void m1; - void m2; - void m3; - void m4; - void m5; - void m6; - void m7; - void m8; - void m9; - void m10; - void m11; - void m12; - void m13; - void m14; - void m15; - void m16; - void m17; - void m18; - void m19; - void m20; - void m21; - void m22; - void m23; - - // These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) - import m24 = require("./"); - ~~~~ -!!! error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m25 = require("./index"); - ~~~~~~~~~ -!!! error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m26 = require("./subfolder"); - import m27 = require("./subfolder/"); - import m28 = require("./subfolder/index"); - import m29 = require("./subfolder2"); - import m30 = require("./subfolder2/"); - import m31 = require("./subfolder2/index"); - import m32 = require("./subfolder2/another"); - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m33 = require("./subfolder2/another/"); - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m34 = require("./subfolder2/another/index"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - void m24; - void m25; - void m26; - void m27; - void m28; - void m29; - void m30; - void m31; - void m32; - void m33; - void m34; - - // These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution - const _m35 = import("./"); - ~~~~ -!!! error TS2307: Cannot find module './' or its corresponding type declarations. - const _m36 = import("./index"); - ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? - const _m37 = import("./subfolder"); - ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m38 = import("./subfolder/"); - ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m39 = import("./subfolder/index"); - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? - const _m40 = import("./subfolder2"); - ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m41 = import("./subfolder2/"); - ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m42 = import("./subfolder2/index"); - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? - const _m43 = import("./subfolder2/another"); - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m44 = import("./subfolder2/another/"); - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m45 = import("./subfolder2/another/index"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? - // cjs format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/index.ts (27 errors) ==== - import * as m1 from "./index.js"; - import * as m2 from "./index.mjs"; - import * as m3 from "./index.cjs"; - import * as m4 from "./subfolder/index.js"; - import * as m5 from "./subfolder/index.mjs"; - import * as m6 from "./subfolder/index.cjs"; - import * as m7 from "./subfolder2/index.js"; - import * as m8 from "./subfolder2/index.mjs"; - import * as m9 from "./subfolder2/index.cjs"; - import * as m10 from "./subfolder2/another/index.js"; - import * as m11 from "./subfolder2/another/index.mjs"; - import * as m12 from "./subfolder2/another/index.cjs"; - // The next ones shouldn't all work - esm format files have no index resolution or extension resolution - import * as m13 from "./"; - ~~~~ -!!! error TS2307: Cannot find module './' or its corresponding type declarations. - import * as m14 from "./index"; - ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? - import * as m15 from "./subfolder"; - ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m16 from "./subfolder/"; - ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m17 from "./subfolder/index"; - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? - import * as m18 from "./subfolder2"; - ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m19 from "./subfolder2/"; - ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m20 from "./subfolder2/index"; - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? - import * as m21 from "./subfolder2/another"; - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m22 from "./subfolder2/another/"; - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m23 from "./subfolder2/another/index"; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? - void m1; - void m2; - void m3; - void m4; - void m5; - void m6; - void m7; - void m8; - void m9; - void m10; - void m11; - void m12; - void m13; - void m14; - void m15; - void m16; - void m17; - void m18; - void m19; - void m20; - void m21; - void m22; - void m23; - - // These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) - import m24 = require("./"); - ~~~~ -!!! error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m25 = require("./index"); - ~~~~~~~~~ -!!! error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m26 = require("./subfolder"); - import m27 = require("./subfolder/"); - import m28 = require("./subfolder/index"); - import m29 = require("./subfolder2"); - import m30 = require("./subfolder2/"); - import m31 = require("./subfolder2/index"); - import m32 = require("./subfolder2/another"); - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m33 = require("./subfolder2/another/"); - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m34 = require("./subfolder2/another/index"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - void m24; - void m25; - void m26; - void m27; - void m28; - void m29; - void m30; - void m31; - void m32; - void m33; - void m34; - - // These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution - const _m35 = import("./"); - ~~~~ -!!! error TS2307: Cannot find module './' or its corresponding type declarations. - const _m36 = import("./index"); - ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? - const _m37 = import("./subfolder"); - ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m38 = import("./subfolder/"); - ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m39 = import("./subfolder/index"); - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? - const _m40 = import("./subfolder2"); - ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m41 = import("./subfolder2/"); - ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m42 = import("./subfolder2/index"); - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? - const _m43 = import("./subfolder2/another"); - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m44 = import("./subfolder2/another/"); - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m45 = import("./subfolder2/another/index"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? - // esm format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module" - } -==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== - { - "type": "commonjs" - } -==== tests/cases/conformance/node/subfolder2/package.json (0 errors) ==== - { - } -==== tests/cases/conformance/node/subfolder2/another/package.json (0 errors) ==== - { - "type": "module" - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModules1(module=node12).js b/tests/baselines/reference/nodeModules1(module=node12).js deleted file mode 100644 index 5b6840498ef..00000000000 --- a/tests/baselines/reference/nodeModules1(module=node12).js +++ /dev/null @@ -1,700 +0,0 @@ -//// [tests/cases/conformance/node/nodeModules1.ts] //// - -//// [index.ts] -// cjs format file -const x = 1; -export {x}; -//// [index.cts] -// cjs format file -const x = 1; -export {x}; -//// [index.mts] -// esm format file -const x = 1; -export {x}; -//// [index.ts] -// cjs format file -const x = 1; -export {x}; -//// [index.cts] -// cjs format file -const x = 1; -export {x}; -//// [index.mts] -// esm format file -const x = 1; -export {x}; -//// [index.ts] -// esm format file -const x = 1; -export {x}; -//// [index.mts] -// esm format file -const x = 1; -export {x}; -//// [index.cts] -// cjs format file -const x = 1; -export {x}; -//// [index.mts] -import * as m1 from "./index.js"; -import * as m2 from "./index.mjs"; -import * as m3 from "./index.cjs"; -import * as m4 from "./subfolder/index.js"; -import * as m5 from "./subfolder/index.mjs"; -import * as m6 from "./subfolder/index.cjs"; -import * as m7 from "./subfolder2/index.js"; -import * as m8 from "./subfolder2/index.mjs"; -import * as m9 from "./subfolder2/index.cjs"; -import * as m10 from "./subfolder2/another/index.js"; -import * as m11 from "./subfolder2/another/index.mjs"; -import * as m12 from "./subfolder2/another/index.cjs"; -// The next ones should all fail - esm format files have no index resolution or extension resolution -import * as m13 from "./"; -import * as m14 from "./index"; -import * as m15 from "./subfolder"; -import * as m16 from "./subfolder/"; -import * as m17 from "./subfolder/index"; -import * as m18 from "./subfolder2"; -import * as m19 from "./subfolder2/"; -import * as m20 from "./subfolder2/index"; -import * as m21 from "./subfolder2/another"; -import * as m22 from "./subfolder2/another/"; -import * as m23 from "./subfolder2/another/index"; -void m1; -void m2; -void m3; -void m4; -void m5; -void m6; -void m7; -void m8; -void m9; -void m10; -void m11; -void m12; -void m13; -void m14; -void m15; -void m16; -void m17; -void m18; -void m19; -void m20; -void m21; -void m22; -void m23; - -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -import m24 = require("./"); -import m25 = require("./index"); -import m26 = require("./subfolder"); -import m27 = require("./subfolder/"); -import m28 = require("./subfolder/index"); -import m29 = require("./subfolder2"); -import m30 = require("./subfolder2/"); -import m31 = require("./subfolder2/index"); -import m32 = require("./subfolder2/another"); -import m33 = require("./subfolder2/another/"); -import m34 = require("./subfolder2/another/index"); -void m24; -void m25; -void m26; -void m27; -void m28; -void m29; -void m30; -void m31; -void m32; -void m33; -void m34; - -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); -const _m36 = import("./index"); -const _m37 = import("./subfolder"); -const _m38 = import("./subfolder/"); -const _m39 = import("./subfolder/index"); -const _m40 = import("./subfolder2"); -const _m41 = import("./subfolder2/"); -const _m42 = import("./subfolder2/index"); -const _m43 = import("./subfolder2/another"); -const _m44 = import("./subfolder2/another/"); -const _m45 = import("./subfolder2/another/index"); - -// esm format file -const x = 1; -export {x}; -//// [index.cts] -// ESM-format imports below should issue errors -import * as m1 from "./index.js"; -import * as m2 from "./index.mjs"; -import * as m3 from "./index.cjs"; -import * as m4 from "./subfolder/index.js"; -import * as m5 from "./subfolder/index.mjs"; -import * as m6 from "./subfolder/index.cjs"; -import * as m7 from "./subfolder2/index.js"; -import * as m8 from "./subfolder2/index.mjs"; -import * as m9 from "./subfolder2/index.cjs"; -import * as m10 from "./subfolder2/another/index.js"; -import * as m11 from "./subfolder2/another/index.mjs"; -import * as m12 from "./subfolder2/another/index.cjs"; -// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) -import * as m13 from "./"; -import * as m14 from "./index"; -import * as m15 from "./subfolder"; -import * as m16 from "./subfolder/"; -import * as m17 from "./subfolder/index"; -import * as m18 from "./subfolder2"; -import * as m19 from "./subfolder2/"; -import * as m20 from "./subfolder2/index"; -import * as m21 from "./subfolder2/another"; -import * as m22 from "./subfolder2/another/"; -import * as m23 from "./subfolder2/another/index"; -void m1; -void m2; -void m3; -void m4; -void m5; -void m6; -void m7; -void m8; -void m9; -void m10; -void m11; -void m12; -void m13; -void m14; -void m15; -void m16; -void m17; -void m18; -void m19; -void m20; -void m21; -void m22; -void m23; - -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -import m24 = require("./"); -import m25 = require("./index"); -import m26 = require("./subfolder"); -import m27 = require("./subfolder/"); -import m28 = require("./subfolder/index"); -import m29 = require("./subfolder2"); -import m30 = require("./subfolder2/"); -import m31 = require("./subfolder2/index"); -import m32 = require("./subfolder2/another"); -import m33 = require("./subfolder2/another/"); -import m34 = require("./subfolder2/another/index"); -void m24; -void m25; -void m26; -void m27; -void m28; -void m29; -void m30; -void m31; -void m32; -void m33; -void m34; - -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); -const _m36 = import("./index"); -const _m37 = import("./subfolder"); -const _m38 = import("./subfolder/"); -const _m39 = import("./subfolder/index"); -const _m40 = import("./subfolder2"); -const _m41 = import("./subfolder2/"); -const _m42 = import("./subfolder2/index"); -const _m43 = import("./subfolder2/another"); -const _m44 = import("./subfolder2/another/"); -const _m45 = import("./subfolder2/another/index"); -// cjs format file -const x = 1; -export {x}; -//// [index.ts] -import * as m1 from "./index.js"; -import * as m2 from "./index.mjs"; -import * as m3 from "./index.cjs"; -import * as m4 from "./subfolder/index.js"; -import * as m5 from "./subfolder/index.mjs"; -import * as m6 from "./subfolder/index.cjs"; -import * as m7 from "./subfolder2/index.js"; -import * as m8 from "./subfolder2/index.mjs"; -import * as m9 from "./subfolder2/index.cjs"; -import * as m10 from "./subfolder2/another/index.js"; -import * as m11 from "./subfolder2/another/index.mjs"; -import * as m12 from "./subfolder2/another/index.cjs"; -// The next ones shouldn't all work - esm format files have no index resolution or extension resolution -import * as m13 from "./"; -import * as m14 from "./index"; -import * as m15 from "./subfolder"; -import * as m16 from "./subfolder/"; -import * as m17 from "./subfolder/index"; -import * as m18 from "./subfolder2"; -import * as m19 from "./subfolder2/"; -import * as m20 from "./subfolder2/index"; -import * as m21 from "./subfolder2/another"; -import * as m22 from "./subfolder2/another/"; -import * as m23 from "./subfolder2/another/index"; -void m1; -void m2; -void m3; -void m4; -void m5; -void m6; -void m7; -void m8; -void m9; -void m10; -void m11; -void m12; -void m13; -void m14; -void m15; -void m16; -void m17; -void m18; -void m19; -void m20; -void m21; -void m22; -void m23; - -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -import m24 = require("./"); -import m25 = require("./index"); -import m26 = require("./subfolder"); -import m27 = require("./subfolder/"); -import m28 = require("./subfolder/index"); -import m29 = require("./subfolder2"); -import m30 = require("./subfolder2/"); -import m31 = require("./subfolder2/index"); -import m32 = require("./subfolder2/another"); -import m33 = require("./subfolder2/another/"); -import m34 = require("./subfolder2/another/index"); -void m24; -void m25; -void m26; -void m27; -void m28; -void m29; -void m30; -void m31; -void m32; -void m33; -void m34; - -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); -const _m36 = import("./index"); -const _m37 = import("./subfolder"); -const _m38 = import("./subfolder/"); -const _m39 = import("./subfolder/index"); -const _m40 = import("./subfolder2"); -const _m41 = import("./subfolder2/"); -const _m42 = import("./subfolder2/index"); -const _m43 = import("./subfolder2/another"); -const _m44 = import("./subfolder2/another/"); -const _m45 = import("./subfolder2/another/index"); -// esm format file -const x = 1; -export {x}; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} -//// [package.json] -{ -} -//// [package.json] -{ - "type": "module" -} - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.x = void 0; -// cjs format file -const x = 1; -exports.x = x; -//// [index.cjs] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.x = void 0; -// cjs format file -const x = 1; -exports.x = x; -//// [index.mjs] -// esm format file -const x = 1; -export { x }; -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.x = void 0; -// cjs format file -const x = 1; -exports.x = x; -//// [index.cjs] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.x = void 0; -// cjs format file -const x = 1; -exports.x = x; -//// [index.mjs] -// esm format file -const x = 1; -export { x }; -//// [index.js] -// esm format file -const x = 1; -export { x }; -//// [index.mjs] -// esm format file -const x = 1; -export { x }; -//// [index.cjs] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.x = void 0; -// cjs format file -const x = 1; -exports.x = x; -//// [index.cjs] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.x = void 0; -// ESM-format imports below should issue errors -const m1 = __importStar(require("./index.js")); -const m2 = __importStar(require("./index.mjs")); -const m3 = __importStar(require("./index.cjs")); -const m4 = __importStar(require("./subfolder/index.js")); -const m5 = __importStar(require("./subfolder/index.mjs")); -const m6 = __importStar(require("./subfolder/index.cjs")); -const m7 = __importStar(require("./subfolder2/index.js")); -const m8 = __importStar(require("./subfolder2/index.mjs")); -const m9 = __importStar(require("./subfolder2/index.cjs")); -const m10 = __importStar(require("./subfolder2/another/index.js")); -const m11 = __importStar(require("./subfolder2/another/index.mjs")); -const m12 = __importStar(require("./subfolder2/another/index.cjs")); -// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) -const m13 = __importStar(require("./")); -const m14 = __importStar(require("./index")); -const m15 = __importStar(require("./subfolder")); -const m16 = __importStar(require("./subfolder/")); -const m17 = __importStar(require("./subfolder/index")); -const m18 = __importStar(require("./subfolder2")); -const m19 = __importStar(require("./subfolder2/")); -const m20 = __importStar(require("./subfolder2/index")); -const m21 = __importStar(require("./subfolder2/another")); -const m22 = __importStar(require("./subfolder2/another/")); -const m23 = __importStar(require("./subfolder2/another/index")); -void m1; -void m2; -void m3; -void m4; -void m5; -void m6; -void m7; -void m8; -void m9; -void m10; -void m11; -void m12; -void m13; -void m14; -void m15; -void m16; -void m17; -void m18; -void m19; -void m20; -void m21; -void m22; -void m23; -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -const m24 = require("./"); -const m25 = require("./index"); -const m26 = require("./subfolder"); -const m27 = require("./subfolder/"); -const m28 = require("./subfolder/index"); -const m29 = require("./subfolder2"); -const m30 = require("./subfolder2/"); -const m31 = require("./subfolder2/index"); -const m32 = require("./subfolder2/another"); -const m33 = require("./subfolder2/another/"); -const m34 = require("./subfolder2/another/index"); -void m24; -void m25; -void m26; -void m27; -void m28; -void m29; -void m30; -void m31; -void m32; -void m33; -void m34; -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); -const _m36 = import("./index"); -const _m37 = import("./subfolder"); -const _m38 = import("./subfolder/"); -const _m39 = import("./subfolder/index"); -const _m40 = import("./subfolder2"); -const _m41 = import("./subfolder2/"); -const _m42 = import("./subfolder2/index"); -const _m43 = import("./subfolder2/another"); -const _m44 = import("./subfolder2/another/"); -const _m45 = import("./subfolder2/another/index"); -// cjs format file -const x = 1; -exports.x = x; -//// [index.js] -import { createRequire as _createRequire } from "module"; -const __require = _createRequire(import.meta.url); -import * as m1 from "./index.js"; -import * as m2 from "./index.mjs"; -import * as m3 from "./index.cjs"; -import * as m4 from "./subfolder/index.js"; -import * as m5 from "./subfolder/index.mjs"; -import * as m6 from "./subfolder/index.cjs"; -import * as m7 from "./subfolder2/index.js"; -import * as m8 from "./subfolder2/index.mjs"; -import * as m9 from "./subfolder2/index.cjs"; -import * as m10 from "./subfolder2/another/index.js"; -import * as m11 from "./subfolder2/another/index.mjs"; -import * as m12 from "./subfolder2/another/index.cjs"; -// The next ones shouldn't all work - esm format files have no index resolution or extension resolution -import * as m13 from "./"; -import * as m14 from "./index"; -import * as m15 from "./subfolder"; -import * as m16 from "./subfolder/"; -import * as m17 from "./subfolder/index"; -import * as m18 from "./subfolder2"; -import * as m19 from "./subfolder2/"; -import * as m20 from "./subfolder2/index"; -import * as m21 from "./subfolder2/another"; -import * as m22 from "./subfolder2/another/"; -import * as m23 from "./subfolder2/another/index"; -void m1; -void m2; -void m3; -void m4; -void m5; -void m6; -void m7; -void m8; -void m9; -void m10; -void m11; -void m12; -void m13; -void m14; -void m15; -void m16; -void m17; -void m18; -void m19; -void m20; -void m21; -void m22; -void m23; -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -const m24 = __require("./"); -const m25 = __require("./index"); -const m26 = __require("./subfolder"); -const m27 = __require("./subfolder/"); -const m28 = __require("./subfolder/index"); -const m29 = __require("./subfolder2"); -const m30 = __require("./subfolder2/"); -const m31 = __require("./subfolder2/index"); -const m32 = __require("./subfolder2/another"); -const m33 = __require("./subfolder2/another/"); -const m34 = __require("./subfolder2/another/index"); -void m24; -void m25; -void m26; -void m27; -void m28; -void m29; -void m30; -void m31; -void m32; -void m33; -void m34; -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); -const _m36 = import("./index"); -const _m37 = import("./subfolder"); -const _m38 = import("./subfolder/"); -const _m39 = import("./subfolder/index"); -const _m40 = import("./subfolder2"); -const _m41 = import("./subfolder2/"); -const _m42 = import("./subfolder2/index"); -const _m43 = import("./subfolder2/another"); -const _m44 = import("./subfolder2/another/"); -const _m45 = import("./subfolder2/another/index"); -// esm format file -const x = 1; -export { x }; -//// [index.mjs] -import { createRequire as _createRequire } from "module"; -const __require = _createRequire(import.meta.url); -import * as m1 from "./index.js"; -import * as m2 from "./index.mjs"; -import * as m3 from "./index.cjs"; -import * as m4 from "./subfolder/index.js"; -import * as m5 from "./subfolder/index.mjs"; -import * as m6 from "./subfolder/index.cjs"; -import * as m7 from "./subfolder2/index.js"; -import * as m8 from "./subfolder2/index.mjs"; -import * as m9 from "./subfolder2/index.cjs"; -import * as m10 from "./subfolder2/another/index.js"; -import * as m11 from "./subfolder2/another/index.mjs"; -import * as m12 from "./subfolder2/another/index.cjs"; -// The next ones should all fail - esm format files have no index resolution or extension resolution -import * as m13 from "./"; -import * as m14 from "./index"; -import * as m15 from "./subfolder"; -import * as m16 from "./subfolder/"; -import * as m17 from "./subfolder/index"; -import * as m18 from "./subfolder2"; -import * as m19 from "./subfolder2/"; -import * as m20 from "./subfolder2/index"; -import * as m21 from "./subfolder2/another"; -import * as m22 from "./subfolder2/another/"; -import * as m23 from "./subfolder2/another/index"; -void m1; -void m2; -void m3; -void m4; -void m5; -void m6; -void m7; -void m8; -void m9; -void m10; -void m11; -void m12; -void m13; -void m14; -void m15; -void m16; -void m17; -void m18; -void m19; -void m20; -void m21; -void m22; -void m23; -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -const m24 = __require("./"); -const m25 = __require("./index"); -const m26 = __require("./subfolder"); -const m27 = __require("./subfolder/"); -const m28 = __require("./subfolder/index"); -const m29 = __require("./subfolder2"); -const m30 = __require("./subfolder2/"); -const m31 = __require("./subfolder2/index"); -const m32 = __require("./subfolder2/another"); -const m33 = __require("./subfolder2/another/"); -const m34 = __require("./subfolder2/another/index"); -void m24; -void m25; -void m26; -void m27; -void m28; -void m29; -void m30; -void m31; -void m32; -void m33; -void m34; -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); -const _m36 = import("./index"); -const _m37 = import("./subfolder"); -const _m38 = import("./subfolder/"); -const _m39 = import("./subfolder/index"); -const _m40 = import("./subfolder2"); -const _m41 = import("./subfolder2/"); -const _m42 = import("./subfolder2/index"); -const _m43 = import("./subfolder2/another"); -const _m44 = import("./subfolder2/another/"); -const _m45 = import("./subfolder2/another/index"); -// esm format file -const x = 1; -export { x }; - - -//// [index.d.ts] -declare const x = 1; -export { x }; -//// [index.d.cts] -declare const x = 1; -export { x }; -//// [index.d.mts] -declare const x = 1; -export { x }; -//// [index.d.ts] -declare const x = 1; -export { x }; -//// [index.d.cts] -declare const x = 1; -export { x }; -//// [index.d.mts] -declare const x = 1; -export { x }; -//// [index.d.ts] -declare const x = 1; -export { x }; -//// [index.d.mts] -declare const x = 1; -export { x }; -//// [index.d.cts] -declare const x = 1; -export { x }; -//// [index.d.cts] -declare const x = 1; -export { x }; -//// [index.d.ts] -declare const x = 1; -export { x }; -//// [index.d.mts] -declare const x = 1; -export { x }; diff --git a/tests/baselines/reference/nodeModules1(module=node12).symbols b/tests/baselines/reference/nodeModules1(module=node12).symbols deleted file mode 100644 index 287b1e895d1..00000000000 --- a/tests/baselines/reference/nodeModules1(module=node12).symbols +++ /dev/null @@ -1,817 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -const x = 1; ->x : Symbol(x, Decl(index.ts, 1, 5)) - -export {x}; ->x : Symbol(x, Decl(index.ts, 2, 8)) - -=== tests/cases/conformance/node/subfolder/index.cts === -// cjs format file -const x = 1; ->x : Symbol(x, Decl(index.cts, 1, 5)) - -export {x}; ->x : Symbol(x, Decl(index.cts, 2, 8)) - -=== tests/cases/conformance/node/subfolder/index.mts === -// esm format file -const x = 1; ->x : Symbol(x, Decl(index.mts, 1, 5)) - -export {x}; ->x : Symbol(x, Decl(index.mts, 2, 8)) - -=== tests/cases/conformance/node/subfolder2/index.ts === -// cjs format file -const x = 1; ->x : Symbol(x, Decl(index.ts, 1, 5)) - -export {x}; ->x : Symbol(x, Decl(index.ts, 2, 8)) - -=== tests/cases/conformance/node/subfolder2/index.cts === -// cjs format file -const x = 1; ->x : Symbol(x, Decl(index.cts, 1, 5)) - -export {x}; ->x : Symbol(x, Decl(index.cts, 2, 8)) - -=== tests/cases/conformance/node/subfolder2/index.mts === -// esm format file -const x = 1; ->x : Symbol(x, Decl(index.mts, 1, 5)) - -export {x}; ->x : Symbol(x, Decl(index.mts, 2, 8)) - -=== tests/cases/conformance/node/subfolder2/another/index.ts === -// esm format file -const x = 1; ->x : Symbol(x, Decl(index.ts, 1, 5)) - -export {x}; ->x : Symbol(x, Decl(index.ts, 2, 8)) - -=== tests/cases/conformance/node/subfolder2/another/index.mts === -// esm format file -const x = 1; ->x : Symbol(x, Decl(index.mts, 1, 5)) - -export {x}; ->x : Symbol(x, Decl(index.mts, 2, 8)) - -=== tests/cases/conformance/node/subfolder2/another/index.cts === -// cjs format file -const x = 1; ->x : Symbol(x, Decl(index.cts, 1, 5)) - -export {x}; ->x : Symbol(x, Decl(index.cts, 2, 8)) - -=== tests/cases/conformance/node/index.mts === -import * as m1 from "./index.js"; ->m1 : Symbol(m1, Decl(index.mts, 0, 6)) - -import * as m2 from "./index.mjs"; ->m2 : Symbol(m2, Decl(index.mts, 1, 6)) - -import * as m3 from "./index.cjs"; ->m3 : Symbol(m3, Decl(index.mts, 2, 6)) - -import * as m4 from "./subfolder/index.js"; ->m4 : Symbol(m4, Decl(index.mts, 3, 6)) - -import * as m5 from "./subfolder/index.mjs"; ->m5 : Symbol(m5, Decl(index.mts, 4, 6)) - -import * as m6 from "./subfolder/index.cjs"; ->m6 : Symbol(m6, Decl(index.mts, 5, 6)) - -import * as m7 from "./subfolder2/index.js"; ->m7 : Symbol(m7, Decl(index.mts, 6, 6)) - -import * as m8 from "./subfolder2/index.mjs"; ->m8 : Symbol(m8, Decl(index.mts, 7, 6)) - -import * as m9 from "./subfolder2/index.cjs"; ->m9 : Symbol(m9, Decl(index.mts, 8, 6)) - -import * as m10 from "./subfolder2/another/index.js"; ->m10 : Symbol(m10, Decl(index.mts, 9, 6)) - -import * as m11 from "./subfolder2/another/index.mjs"; ->m11 : Symbol(m11, Decl(index.mts, 10, 6)) - -import * as m12 from "./subfolder2/another/index.cjs"; ->m12 : Symbol(m12, Decl(index.mts, 11, 6)) - -// The next ones should all fail - esm format files have no index resolution or extension resolution -import * as m13 from "./"; ->m13 : Symbol(m13, Decl(index.mts, 13, 6)) - -import * as m14 from "./index"; ->m14 : Symbol(m14, Decl(index.mts, 14, 6)) - -import * as m15 from "./subfolder"; ->m15 : Symbol(m15, Decl(index.mts, 15, 6)) - -import * as m16 from "./subfolder/"; ->m16 : Symbol(m16, Decl(index.mts, 16, 6)) - -import * as m17 from "./subfolder/index"; ->m17 : Symbol(m17, Decl(index.mts, 17, 6)) - -import * as m18 from "./subfolder2"; ->m18 : Symbol(m18, Decl(index.mts, 18, 6)) - -import * as m19 from "./subfolder2/"; ->m19 : Symbol(m19, Decl(index.mts, 19, 6)) - -import * as m20 from "./subfolder2/index"; ->m20 : Symbol(m20, Decl(index.mts, 20, 6)) - -import * as m21 from "./subfolder2/another"; ->m21 : Symbol(m21, Decl(index.mts, 21, 6)) - -import * as m22 from "./subfolder2/another/"; ->m22 : Symbol(m22, Decl(index.mts, 22, 6)) - -import * as m23 from "./subfolder2/another/index"; ->m23 : Symbol(m23, Decl(index.mts, 23, 6)) - -void m1; ->m1 : Symbol(m1, Decl(index.mts, 0, 6)) - -void m2; ->m2 : Symbol(m2, Decl(index.mts, 1, 6)) - -void m3; ->m3 : Symbol(m3, Decl(index.mts, 2, 6)) - -void m4; ->m4 : Symbol(m4, Decl(index.mts, 3, 6)) - -void m5; ->m5 : Symbol(m5, Decl(index.mts, 4, 6)) - -void m6; ->m6 : Symbol(m6, Decl(index.mts, 5, 6)) - -void m7; ->m7 : Symbol(m7, Decl(index.mts, 6, 6)) - -void m8; ->m8 : Symbol(m8, Decl(index.mts, 7, 6)) - -void m9; ->m9 : Symbol(m9, Decl(index.mts, 8, 6)) - -void m10; ->m10 : Symbol(m10, Decl(index.mts, 9, 6)) - -void m11; ->m11 : Symbol(m11, Decl(index.mts, 10, 6)) - -void m12; ->m12 : Symbol(m12, Decl(index.mts, 11, 6)) - -void m13; ->m13 : Symbol(m13, Decl(index.mts, 13, 6)) - -void m14; ->m14 : Symbol(m14, Decl(index.mts, 14, 6)) - -void m15; ->m15 : Symbol(m15, Decl(index.mts, 15, 6)) - -void m16; ->m16 : Symbol(m16, Decl(index.mts, 16, 6)) - -void m17; ->m17 : Symbol(m17, Decl(index.mts, 17, 6)) - -void m18; ->m18 : Symbol(m18, Decl(index.mts, 18, 6)) - -void m19; ->m19 : Symbol(m19, Decl(index.mts, 19, 6)) - -void m20; ->m20 : Symbol(m20, Decl(index.mts, 20, 6)) - -void m21; ->m21 : Symbol(m21, Decl(index.mts, 21, 6)) - -void m22; ->m22 : Symbol(m22, Decl(index.mts, 22, 6)) - -void m23; ->m23 : Symbol(m23, Decl(index.mts, 23, 6)) - -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -import m24 = require("./"); ->m24 : Symbol(m24, Decl(index.mts, 46, 9)) - -import m25 = require("./index"); ->m25 : Symbol(m25, Decl(index.mts, 49, 27)) - -import m26 = require("./subfolder"); ->m26 : Symbol(m26, Decl(index.mts, 50, 32)) - -import m27 = require("./subfolder/"); ->m27 : Symbol(m27, Decl(index.mts, 51, 36)) - -import m28 = require("./subfolder/index"); ->m28 : Symbol(m28, Decl(index.mts, 52, 37)) - -import m29 = require("./subfolder2"); ->m29 : Symbol(m29, Decl(index.mts, 53, 42)) - -import m30 = require("./subfolder2/"); ->m30 : Symbol(m30, Decl(index.mts, 54, 37)) - -import m31 = require("./subfolder2/index"); ->m31 : Symbol(m31, Decl(index.mts, 55, 38)) - -import m32 = require("./subfolder2/another"); ->m32 : Symbol(m32, Decl(index.mts, 56, 43)) - -import m33 = require("./subfolder2/another/"); ->m33 : Symbol(m33, Decl(index.mts, 57, 45)) - -import m34 = require("./subfolder2/another/index"); ->m34 : Symbol(m34, Decl(index.mts, 58, 46)) - -void m24; ->m24 : Symbol(m24, Decl(index.mts, 46, 9)) - -void m25; ->m25 : Symbol(m25, Decl(index.mts, 49, 27)) - -void m26; ->m26 : Symbol(m26, Decl(index.mts, 50, 32)) - -void m27; ->m27 : Symbol(m27, Decl(index.mts, 51, 36)) - -void m28; ->m28 : Symbol(m28, Decl(index.mts, 52, 37)) - -void m29; ->m29 : Symbol(m29, Decl(index.mts, 53, 42)) - -void m30; ->m30 : Symbol(m30, Decl(index.mts, 54, 37)) - -void m31; ->m31 : Symbol(m31, Decl(index.mts, 55, 38)) - -void m32; ->m32 : Symbol(m32, Decl(index.mts, 56, 43)) - -void m33; ->m33 : Symbol(m33, Decl(index.mts, 57, 45)) - -void m34; ->m34 : Symbol(m34, Decl(index.mts, 58, 46)) - -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); ->_m35 : Symbol(_m35, Decl(index.mts, 73, 5)) - -const _m36 = import("./index"); ->_m36 : Symbol(_m36, Decl(index.mts, 74, 5)) - -const _m37 = import("./subfolder"); ->_m37 : Symbol(_m37, Decl(index.mts, 75, 5)) - -const _m38 = import("./subfolder/"); ->_m38 : Symbol(_m38, Decl(index.mts, 76, 5)) - -const _m39 = import("./subfolder/index"); ->_m39 : Symbol(_m39, Decl(index.mts, 77, 5)) - -const _m40 = import("./subfolder2"); ->_m40 : Symbol(_m40, Decl(index.mts, 78, 5)) - -const _m41 = import("./subfolder2/"); ->_m41 : Symbol(_m41, Decl(index.mts, 79, 5)) - -const _m42 = import("./subfolder2/index"); ->_m42 : Symbol(_m42, Decl(index.mts, 80, 5)) - -const _m43 = import("./subfolder2/another"); ->_m43 : Symbol(_m43, Decl(index.mts, 81, 5)) - -const _m44 = import("./subfolder2/another/"); ->_m44 : Symbol(_m44, Decl(index.mts, 82, 5)) - -const _m45 = import("./subfolder2/another/index"); ->_m45 : Symbol(_m45, Decl(index.mts, 83, 5)) - -// esm format file -const x = 1; ->x : Symbol(x, Decl(index.mts, 86, 5)) - -export {x}; ->x : Symbol(m2.x, Decl(index.mts, 87, 8)) - -=== tests/cases/conformance/node/index.cts === -// ESM-format imports below should issue errors -import * as m1 from "./index.js"; ->m1 : Symbol(m1, Decl(index.cts, 1, 6)) - -import * as m2 from "./index.mjs"; ->m2 : Symbol(m2, Decl(index.cts, 2, 6)) - -import * as m3 from "./index.cjs"; ->m3 : Symbol(m3, Decl(index.cts, 3, 6)) - -import * as m4 from "./subfolder/index.js"; ->m4 : Symbol(m4, Decl(index.cts, 4, 6)) - -import * as m5 from "./subfolder/index.mjs"; ->m5 : Symbol(m5, Decl(index.cts, 5, 6)) - -import * as m6 from "./subfolder/index.cjs"; ->m6 : Symbol(m6, Decl(index.cts, 6, 6)) - -import * as m7 from "./subfolder2/index.js"; ->m7 : Symbol(m7, Decl(index.cts, 7, 6)) - -import * as m8 from "./subfolder2/index.mjs"; ->m8 : Symbol(m8, Decl(index.cts, 8, 6)) - -import * as m9 from "./subfolder2/index.cjs"; ->m9 : Symbol(m9, Decl(index.cts, 9, 6)) - -import * as m10 from "./subfolder2/another/index.js"; ->m10 : Symbol(m10, Decl(index.cts, 10, 6)) - -import * as m11 from "./subfolder2/another/index.mjs"; ->m11 : Symbol(m11, Decl(index.cts, 11, 6)) - -import * as m12 from "./subfolder2/another/index.cjs"; ->m12 : Symbol(m12, Decl(index.cts, 12, 6)) - -// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) -import * as m13 from "./"; ->m13 : Symbol(m13, Decl(index.cts, 14, 6)) - -import * as m14 from "./index"; ->m14 : Symbol(m14, Decl(index.cts, 15, 6)) - -import * as m15 from "./subfolder"; ->m15 : Symbol(m15, Decl(index.cts, 16, 6)) - -import * as m16 from "./subfolder/"; ->m16 : Symbol(m16, Decl(index.cts, 17, 6)) - -import * as m17 from "./subfolder/index"; ->m17 : Symbol(m17, Decl(index.cts, 18, 6)) - -import * as m18 from "./subfolder2"; ->m18 : Symbol(m18, Decl(index.cts, 19, 6)) - -import * as m19 from "./subfolder2/"; ->m19 : Symbol(m19, Decl(index.cts, 20, 6)) - -import * as m20 from "./subfolder2/index"; ->m20 : Symbol(m20, Decl(index.cts, 21, 6)) - -import * as m21 from "./subfolder2/another"; ->m21 : Symbol(m21, Decl(index.cts, 22, 6)) - -import * as m22 from "./subfolder2/another/"; ->m22 : Symbol(m22, Decl(index.cts, 23, 6)) - -import * as m23 from "./subfolder2/another/index"; ->m23 : Symbol(m23, Decl(index.cts, 24, 6)) - -void m1; ->m1 : Symbol(m1, Decl(index.cts, 1, 6)) - -void m2; ->m2 : Symbol(m2, Decl(index.cts, 2, 6)) - -void m3; ->m3 : Symbol(m3, Decl(index.cts, 3, 6)) - -void m4; ->m4 : Symbol(m4, Decl(index.cts, 4, 6)) - -void m5; ->m5 : Symbol(m5, Decl(index.cts, 5, 6)) - -void m6; ->m6 : Symbol(m6, Decl(index.cts, 6, 6)) - -void m7; ->m7 : Symbol(m7, Decl(index.cts, 7, 6)) - -void m8; ->m8 : Symbol(m8, Decl(index.cts, 8, 6)) - -void m9; ->m9 : Symbol(m9, Decl(index.cts, 9, 6)) - -void m10; ->m10 : Symbol(m10, Decl(index.cts, 10, 6)) - -void m11; ->m11 : Symbol(m11, Decl(index.cts, 11, 6)) - -void m12; ->m12 : Symbol(m12, Decl(index.cts, 12, 6)) - -void m13; ->m13 : Symbol(m13, Decl(index.cts, 14, 6)) - -void m14; ->m14 : Symbol(m14, Decl(index.cts, 15, 6)) - -void m15; ->m15 : Symbol(m15, Decl(index.cts, 16, 6)) - -void m16; ->m16 : Symbol(m16, Decl(index.cts, 17, 6)) - -void m17; ->m17 : Symbol(m17, Decl(index.cts, 18, 6)) - -void m18; ->m18 : Symbol(m18, Decl(index.cts, 19, 6)) - -void m19; ->m19 : Symbol(m19, Decl(index.cts, 20, 6)) - -void m20; ->m20 : Symbol(m20, Decl(index.cts, 21, 6)) - -void m21; ->m21 : Symbol(m21, Decl(index.cts, 22, 6)) - -void m22; ->m22 : Symbol(m22, Decl(index.cts, 23, 6)) - -void m23; ->m23 : Symbol(m23, Decl(index.cts, 24, 6)) - -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -import m24 = require("./"); ->m24 : Symbol(m24, Decl(index.cts, 47, 9)) - -import m25 = require("./index"); ->m25 : Symbol(m25, Decl(index.cts, 50, 27)) - -import m26 = require("./subfolder"); ->m26 : Symbol(m26, Decl(index.cts, 51, 32)) - -import m27 = require("./subfolder/"); ->m27 : Symbol(m27, Decl(index.cts, 52, 36)) - -import m28 = require("./subfolder/index"); ->m28 : Symbol(m28, Decl(index.cts, 53, 37)) - -import m29 = require("./subfolder2"); ->m29 : Symbol(m29, Decl(index.cts, 54, 42)) - -import m30 = require("./subfolder2/"); ->m30 : Symbol(m30, Decl(index.cts, 55, 37)) - -import m31 = require("./subfolder2/index"); ->m31 : Symbol(m31, Decl(index.cts, 56, 38)) - -import m32 = require("./subfolder2/another"); ->m32 : Symbol(m32, Decl(index.cts, 57, 43)) - -import m33 = require("./subfolder2/another/"); ->m33 : Symbol(m33, Decl(index.cts, 58, 45)) - -import m34 = require("./subfolder2/another/index"); ->m34 : Symbol(m34, Decl(index.cts, 59, 46)) - -void m24; ->m24 : Symbol(m24, Decl(index.cts, 47, 9)) - -void m25; ->m25 : Symbol(m25, Decl(index.cts, 50, 27)) - -void m26; ->m26 : Symbol(m26, Decl(index.cts, 51, 32)) - -void m27; ->m27 : Symbol(m27, Decl(index.cts, 52, 36)) - -void m28; ->m28 : Symbol(m28, Decl(index.cts, 53, 37)) - -void m29; ->m29 : Symbol(m29, Decl(index.cts, 54, 42)) - -void m30; ->m30 : Symbol(m30, Decl(index.cts, 55, 37)) - -void m31; ->m31 : Symbol(m31, Decl(index.cts, 56, 38)) - -void m32; ->m32 : Symbol(m32, Decl(index.cts, 57, 43)) - -void m33; ->m33 : Symbol(m33, Decl(index.cts, 58, 45)) - -void m34; ->m34 : Symbol(m34, Decl(index.cts, 59, 46)) - -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); ->_m35 : Symbol(_m35, Decl(index.cts, 74, 5)) - -const _m36 = import("./index"); ->_m36 : Symbol(_m36, Decl(index.cts, 75, 5)) - -const _m37 = import("./subfolder"); ->_m37 : Symbol(_m37, Decl(index.cts, 76, 5)) - -const _m38 = import("./subfolder/"); ->_m38 : Symbol(_m38, Decl(index.cts, 77, 5)) - -const _m39 = import("./subfolder/index"); ->_m39 : Symbol(_m39, Decl(index.cts, 78, 5)) - -const _m40 = import("./subfolder2"); ->_m40 : Symbol(_m40, Decl(index.cts, 79, 5)) - -const _m41 = import("./subfolder2/"); ->_m41 : Symbol(_m41, Decl(index.cts, 80, 5)) - -const _m42 = import("./subfolder2/index"); ->_m42 : Symbol(_m42, Decl(index.cts, 81, 5)) - -const _m43 = import("./subfolder2/another"); ->_m43 : Symbol(_m43, Decl(index.cts, 82, 5)) - -const _m44 = import("./subfolder2/another/"); ->_m44 : Symbol(_m44, Decl(index.cts, 83, 5)) - -const _m45 = import("./subfolder2/another/index"); ->_m45 : Symbol(_m45, Decl(index.cts, 84, 5)) - -// cjs format file -const x = 1; ->x : Symbol(x, Decl(index.cts, 86, 5)) - -export {x}; ->x : Symbol(m3.x, Decl(index.cts, 87, 8)) - -=== tests/cases/conformance/node/index.ts === -import * as m1 from "./index.js"; ->m1 : Symbol(m1, Decl(index.ts, 0, 6)) - -import * as m2 from "./index.mjs"; ->m2 : Symbol(m2, Decl(index.ts, 1, 6)) - -import * as m3 from "./index.cjs"; ->m3 : Symbol(m3, Decl(index.ts, 2, 6)) - -import * as m4 from "./subfolder/index.js"; ->m4 : Symbol(m4, Decl(index.ts, 3, 6)) - -import * as m5 from "./subfolder/index.mjs"; ->m5 : Symbol(m5, Decl(index.ts, 4, 6)) - -import * as m6 from "./subfolder/index.cjs"; ->m6 : Symbol(m6, Decl(index.ts, 5, 6)) - -import * as m7 from "./subfolder2/index.js"; ->m7 : Symbol(m7, Decl(index.ts, 6, 6)) - -import * as m8 from "./subfolder2/index.mjs"; ->m8 : Symbol(m8, Decl(index.ts, 7, 6)) - -import * as m9 from "./subfolder2/index.cjs"; ->m9 : Symbol(m9, Decl(index.ts, 8, 6)) - -import * as m10 from "./subfolder2/another/index.js"; ->m10 : Symbol(m10, Decl(index.ts, 9, 6)) - -import * as m11 from "./subfolder2/another/index.mjs"; ->m11 : Symbol(m11, Decl(index.ts, 10, 6)) - -import * as m12 from "./subfolder2/another/index.cjs"; ->m12 : Symbol(m12, Decl(index.ts, 11, 6)) - -// The next ones shouldn't all work - esm format files have no index resolution or extension resolution -import * as m13 from "./"; ->m13 : Symbol(m13, Decl(index.ts, 13, 6)) - -import * as m14 from "./index"; ->m14 : Symbol(m14, Decl(index.ts, 14, 6)) - -import * as m15 from "./subfolder"; ->m15 : Symbol(m15, Decl(index.ts, 15, 6)) - -import * as m16 from "./subfolder/"; ->m16 : Symbol(m16, Decl(index.ts, 16, 6)) - -import * as m17 from "./subfolder/index"; ->m17 : Symbol(m17, Decl(index.ts, 17, 6)) - -import * as m18 from "./subfolder2"; ->m18 : Symbol(m18, Decl(index.ts, 18, 6)) - -import * as m19 from "./subfolder2/"; ->m19 : Symbol(m19, Decl(index.ts, 19, 6)) - -import * as m20 from "./subfolder2/index"; ->m20 : Symbol(m20, Decl(index.ts, 20, 6)) - -import * as m21 from "./subfolder2/another"; ->m21 : Symbol(m21, Decl(index.ts, 21, 6)) - -import * as m22 from "./subfolder2/another/"; ->m22 : Symbol(m22, Decl(index.ts, 22, 6)) - -import * as m23 from "./subfolder2/another/index"; ->m23 : Symbol(m23, Decl(index.ts, 23, 6)) - -void m1; ->m1 : Symbol(m1, Decl(index.ts, 0, 6)) - -void m2; ->m2 : Symbol(m2, Decl(index.ts, 1, 6)) - -void m3; ->m3 : Symbol(m3, Decl(index.ts, 2, 6)) - -void m4; ->m4 : Symbol(m4, Decl(index.ts, 3, 6)) - -void m5; ->m5 : Symbol(m5, Decl(index.ts, 4, 6)) - -void m6; ->m6 : Symbol(m6, Decl(index.ts, 5, 6)) - -void m7; ->m7 : Symbol(m7, Decl(index.ts, 6, 6)) - -void m8; ->m8 : Symbol(m8, Decl(index.ts, 7, 6)) - -void m9; ->m9 : Symbol(m9, Decl(index.ts, 8, 6)) - -void m10; ->m10 : Symbol(m10, Decl(index.ts, 9, 6)) - -void m11; ->m11 : Symbol(m11, Decl(index.ts, 10, 6)) - -void m12; ->m12 : Symbol(m12, Decl(index.ts, 11, 6)) - -void m13; ->m13 : Symbol(m13, Decl(index.ts, 13, 6)) - -void m14; ->m14 : Symbol(m14, Decl(index.ts, 14, 6)) - -void m15; ->m15 : Symbol(m15, Decl(index.ts, 15, 6)) - -void m16; ->m16 : Symbol(m16, Decl(index.ts, 16, 6)) - -void m17; ->m17 : Symbol(m17, Decl(index.ts, 17, 6)) - -void m18; ->m18 : Symbol(m18, Decl(index.ts, 18, 6)) - -void m19; ->m19 : Symbol(m19, Decl(index.ts, 19, 6)) - -void m20; ->m20 : Symbol(m20, Decl(index.ts, 20, 6)) - -void m21; ->m21 : Symbol(m21, Decl(index.ts, 21, 6)) - -void m22; ->m22 : Symbol(m22, Decl(index.ts, 22, 6)) - -void m23; ->m23 : Symbol(m23, Decl(index.ts, 23, 6)) - -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -import m24 = require("./"); ->m24 : Symbol(m24, Decl(index.ts, 46, 9)) - -import m25 = require("./index"); ->m25 : Symbol(m25, Decl(index.ts, 49, 27)) - -import m26 = require("./subfolder"); ->m26 : Symbol(m26, Decl(index.ts, 50, 32)) - -import m27 = require("./subfolder/"); ->m27 : Symbol(m27, Decl(index.ts, 51, 36)) - -import m28 = require("./subfolder/index"); ->m28 : Symbol(m28, Decl(index.ts, 52, 37)) - -import m29 = require("./subfolder2"); ->m29 : Symbol(m29, Decl(index.ts, 53, 42)) - -import m30 = require("./subfolder2/"); ->m30 : Symbol(m30, Decl(index.ts, 54, 37)) - -import m31 = require("./subfolder2/index"); ->m31 : Symbol(m31, Decl(index.ts, 55, 38)) - -import m32 = require("./subfolder2/another"); ->m32 : Symbol(m32, Decl(index.ts, 56, 43)) - -import m33 = require("./subfolder2/another/"); ->m33 : Symbol(m33, Decl(index.ts, 57, 45)) - -import m34 = require("./subfolder2/another/index"); ->m34 : Symbol(m34, Decl(index.ts, 58, 46)) - -void m24; ->m24 : Symbol(m24, Decl(index.ts, 46, 9)) - -void m25; ->m25 : Symbol(m25, Decl(index.ts, 49, 27)) - -void m26; ->m26 : Symbol(m26, Decl(index.ts, 50, 32)) - -void m27; ->m27 : Symbol(m27, Decl(index.ts, 51, 36)) - -void m28; ->m28 : Symbol(m28, Decl(index.ts, 52, 37)) - -void m29; ->m29 : Symbol(m29, Decl(index.ts, 53, 42)) - -void m30; ->m30 : Symbol(m30, Decl(index.ts, 54, 37)) - -void m31; ->m31 : Symbol(m31, Decl(index.ts, 55, 38)) - -void m32; ->m32 : Symbol(m32, Decl(index.ts, 56, 43)) - -void m33; ->m33 : Symbol(m33, Decl(index.ts, 57, 45)) - -void m34; ->m34 : Symbol(m34, Decl(index.ts, 58, 46)) - -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); ->_m35 : Symbol(_m35, Decl(index.ts, 73, 5)) - -const _m36 = import("./index"); ->_m36 : Symbol(_m36, Decl(index.ts, 74, 5)) - -const _m37 = import("./subfolder"); ->_m37 : Symbol(_m37, Decl(index.ts, 75, 5)) - -const _m38 = import("./subfolder/"); ->_m38 : Symbol(_m38, Decl(index.ts, 76, 5)) - -const _m39 = import("./subfolder/index"); ->_m39 : Symbol(_m39, Decl(index.ts, 77, 5)) - -const _m40 = import("./subfolder2"); ->_m40 : Symbol(_m40, Decl(index.ts, 78, 5)) - -const _m41 = import("./subfolder2/"); ->_m41 : Symbol(_m41, Decl(index.ts, 79, 5)) - -const _m42 = import("./subfolder2/index"); ->_m42 : Symbol(_m42, Decl(index.ts, 80, 5)) - -const _m43 = import("./subfolder2/another"); ->_m43 : Symbol(_m43, Decl(index.ts, 81, 5)) - -const _m44 = import("./subfolder2/another/"); ->_m44 : Symbol(_m44, Decl(index.ts, 82, 5)) - -const _m45 = import("./subfolder2/another/index"); ->_m45 : Symbol(_m45, Decl(index.ts, 83, 5)) - -// esm format file -const x = 1; ->x : Symbol(x, Decl(index.ts, 85, 5)) - -export {x}; ->x : Symbol(m1.x, Decl(index.ts, 86, 8)) - diff --git a/tests/baselines/reference/nodeModules1(module=node12).types b/tests/baselines/reference/nodeModules1(module=node12).types deleted file mode 100644 index 9f52683c7d7..00000000000 --- a/tests/baselines/reference/nodeModules1(module=node12).types +++ /dev/null @@ -1,997 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - -=== tests/cases/conformance/node/subfolder/index.cts === -// cjs format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - -=== tests/cases/conformance/node/subfolder/index.mts === -// esm format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - -=== tests/cases/conformance/node/subfolder2/index.ts === -// cjs format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - -=== tests/cases/conformance/node/subfolder2/index.cts === -// cjs format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - -=== tests/cases/conformance/node/subfolder2/index.mts === -// esm format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - -=== tests/cases/conformance/node/subfolder2/another/index.ts === -// esm format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - -=== tests/cases/conformance/node/subfolder2/another/index.mts === -// esm format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - -=== tests/cases/conformance/node/subfolder2/another/index.cts === -// cjs format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - -=== tests/cases/conformance/node/index.mts === -import * as m1 from "./index.js"; ->m1 : typeof m1 - -import * as m2 from "./index.mjs"; ->m2 : typeof m2 - -import * as m3 from "./index.cjs"; ->m3 : typeof m3 - -import * as m4 from "./subfolder/index.js"; ->m4 : typeof m4 - -import * as m5 from "./subfolder/index.mjs"; ->m5 : typeof m5 - -import * as m6 from "./subfolder/index.cjs"; ->m6 : typeof m6 - -import * as m7 from "./subfolder2/index.js"; ->m7 : typeof m7 - -import * as m8 from "./subfolder2/index.mjs"; ->m8 : typeof m8 - -import * as m9 from "./subfolder2/index.cjs"; ->m9 : typeof m9 - -import * as m10 from "./subfolder2/another/index.js"; ->m10 : typeof m10 - -import * as m11 from "./subfolder2/another/index.mjs"; ->m11 : typeof m11 - -import * as m12 from "./subfolder2/another/index.cjs"; ->m12 : typeof m12 - -// The next ones should all fail - esm format files have no index resolution or extension resolution -import * as m13 from "./"; ->m13 : any - -import * as m14 from "./index"; ->m14 : any - -import * as m15 from "./subfolder"; ->m15 : any - -import * as m16 from "./subfolder/"; ->m16 : any - -import * as m17 from "./subfolder/index"; ->m17 : any - -import * as m18 from "./subfolder2"; ->m18 : any - -import * as m19 from "./subfolder2/"; ->m19 : any - -import * as m20 from "./subfolder2/index"; ->m20 : any - -import * as m21 from "./subfolder2/another"; ->m21 : any - -import * as m22 from "./subfolder2/another/"; ->m22 : any - -import * as m23 from "./subfolder2/another/index"; ->m23 : any - -void m1; ->void m1 : undefined ->m1 : typeof m1 - -void m2; ->void m2 : undefined ->m2 : typeof m2 - -void m3; ->void m3 : undefined ->m3 : typeof m3 - -void m4; ->void m4 : undefined ->m4 : typeof m4 - -void m5; ->void m5 : undefined ->m5 : typeof m5 - -void m6; ->void m6 : undefined ->m6 : typeof m6 - -void m7; ->void m7 : undefined ->m7 : typeof m7 - -void m8; ->void m8 : undefined ->m8 : typeof m8 - -void m9; ->void m9 : undefined ->m9 : typeof m9 - -void m10; ->void m10 : undefined ->m10 : typeof m10 - -void m11; ->void m11 : undefined ->m11 : typeof m11 - -void m12; ->void m12 : undefined ->m12 : typeof m12 - -void m13; ->void m13 : undefined ->m13 : any - -void m14; ->void m14 : undefined ->m14 : any - -void m15; ->void m15 : undefined ->m15 : any - -void m16; ->void m16 : undefined ->m16 : any - -void m17; ->void m17 : undefined ->m17 : any - -void m18; ->void m18 : undefined ->m18 : any - -void m19; ->void m19 : undefined ->m19 : any - -void m20; ->void m20 : undefined ->m20 : any - -void m21; ->void m21 : undefined ->m21 : any - -void m22; ->void m22 : undefined ->m22 : any - -void m23; ->void m23 : undefined ->m23 : any - -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -import m24 = require("./"); ->m24 : typeof m1 - -import m25 = require("./index"); ->m25 : typeof m1 - -import m26 = require("./subfolder"); ->m26 : typeof m26 - -import m27 = require("./subfolder/"); ->m27 : typeof m26 - -import m28 = require("./subfolder/index"); ->m28 : typeof m26 - -import m29 = require("./subfolder2"); ->m29 : typeof m29 - -import m30 = require("./subfolder2/"); ->m30 : typeof m29 - -import m31 = require("./subfolder2/index"); ->m31 : typeof m29 - -import m32 = require("./subfolder2/another"); ->m32 : typeof m10 - -import m33 = require("./subfolder2/another/"); ->m33 : typeof m10 - -import m34 = require("./subfolder2/another/index"); ->m34 : typeof m10 - -void m24; ->void m24 : undefined ->m24 : typeof m1 - -void m25; ->void m25 : undefined ->m25 : typeof m1 - -void m26; ->void m26 : undefined ->m26 : typeof m26 - -void m27; ->void m27 : undefined ->m27 : typeof m26 - -void m28; ->void m28 : undefined ->m28 : typeof m26 - -void m29; ->void m29 : undefined ->m29 : typeof m29 - -void m30; ->void m30 : undefined ->m30 : typeof m29 - -void m31; ->void m31 : undefined ->m31 : typeof m29 - -void m32; ->void m32 : undefined ->m32 : typeof m10 - -void m33; ->void m33 : undefined ->m33 : typeof m10 - -void m34; ->void m34 : undefined ->m34 : typeof m10 - -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); ->_m35 : Promise ->import("./") : Promise ->"./" : "./" - -const _m36 = import("./index"); ->_m36 : Promise ->import("./index") : Promise ->"./index" : "./index" - -const _m37 = import("./subfolder"); ->_m37 : Promise ->import("./subfolder") : Promise ->"./subfolder" : "./subfolder" - -const _m38 = import("./subfolder/"); ->_m38 : Promise ->import("./subfolder/") : Promise ->"./subfolder/" : "./subfolder/" - -const _m39 = import("./subfolder/index"); ->_m39 : Promise ->import("./subfolder/index") : Promise ->"./subfolder/index" : "./subfolder/index" - -const _m40 = import("./subfolder2"); ->_m40 : Promise ->import("./subfolder2") : Promise ->"./subfolder2" : "./subfolder2" - -const _m41 = import("./subfolder2/"); ->_m41 : Promise ->import("./subfolder2/") : Promise ->"./subfolder2/" : "./subfolder2/" - -const _m42 = import("./subfolder2/index"); ->_m42 : Promise ->import("./subfolder2/index") : Promise ->"./subfolder2/index" : "./subfolder2/index" - -const _m43 = import("./subfolder2/another"); ->_m43 : Promise ->import("./subfolder2/another") : Promise ->"./subfolder2/another" : "./subfolder2/another" - -const _m44 = import("./subfolder2/another/"); ->_m44 : Promise ->import("./subfolder2/another/") : Promise ->"./subfolder2/another/" : "./subfolder2/another/" - -const _m45 = import("./subfolder2/another/index"); ->_m45 : Promise ->import("./subfolder2/another/index") : Promise ->"./subfolder2/another/index" : "./subfolder2/another/index" - -// esm format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - -=== tests/cases/conformance/node/index.cts === -// ESM-format imports below should issue errors -import * as m1 from "./index.js"; ->m1 : typeof m1 - -import * as m2 from "./index.mjs"; ->m2 : typeof m2 - -import * as m3 from "./index.cjs"; ->m3 : typeof m3 - -import * as m4 from "./subfolder/index.js"; ->m4 : typeof m4 - -import * as m5 from "./subfolder/index.mjs"; ->m5 : typeof m5 - -import * as m6 from "./subfolder/index.cjs"; ->m6 : typeof m6 - -import * as m7 from "./subfolder2/index.js"; ->m7 : typeof m7 - -import * as m8 from "./subfolder2/index.mjs"; ->m8 : typeof m8 - -import * as m9 from "./subfolder2/index.cjs"; ->m9 : typeof m9 - -import * as m10 from "./subfolder2/another/index.js"; ->m10 : typeof m10 - -import * as m11 from "./subfolder2/another/index.mjs"; ->m11 : typeof m11 - -import * as m12 from "./subfolder2/another/index.cjs"; ->m12 : typeof m12 - -// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) -import * as m13 from "./"; ->m13 : typeof m1 - -import * as m14 from "./index"; ->m14 : typeof m1 - -import * as m15 from "./subfolder"; ->m15 : typeof m4 - -import * as m16 from "./subfolder/"; ->m16 : typeof m4 - -import * as m17 from "./subfolder/index"; ->m17 : typeof m4 - -import * as m18 from "./subfolder2"; ->m18 : typeof m7 - -import * as m19 from "./subfolder2/"; ->m19 : typeof m7 - -import * as m20 from "./subfolder2/index"; ->m20 : typeof m7 - -import * as m21 from "./subfolder2/another"; ->m21 : typeof m10 - -import * as m22 from "./subfolder2/another/"; ->m22 : typeof m10 - -import * as m23 from "./subfolder2/another/index"; ->m23 : typeof m10 - -void m1; ->void m1 : undefined ->m1 : typeof m1 - -void m2; ->void m2 : undefined ->m2 : typeof m2 - -void m3; ->void m3 : undefined ->m3 : typeof m3 - -void m4; ->void m4 : undefined ->m4 : typeof m4 - -void m5; ->void m5 : undefined ->m5 : typeof m5 - -void m6; ->void m6 : undefined ->m6 : typeof m6 - -void m7; ->void m7 : undefined ->m7 : typeof m7 - -void m8; ->void m8 : undefined ->m8 : typeof m8 - -void m9; ->void m9 : undefined ->m9 : typeof m9 - -void m10; ->void m10 : undefined ->m10 : typeof m10 - -void m11; ->void m11 : undefined ->m11 : typeof m11 - -void m12; ->void m12 : undefined ->m12 : typeof m12 - -void m13; ->void m13 : undefined ->m13 : typeof m1 - -void m14; ->void m14 : undefined ->m14 : typeof m1 - -void m15; ->void m15 : undefined ->m15 : typeof m4 - -void m16; ->void m16 : undefined ->m16 : typeof m4 - -void m17; ->void m17 : undefined ->m17 : typeof m4 - -void m18; ->void m18 : undefined ->m18 : typeof m7 - -void m19; ->void m19 : undefined ->m19 : typeof m7 - -void m20; ->void m20 : undefined ->m20 : typeof m7 - -void m21; ->void m21 : undefined ->m21 : typeof m10 - -void m22; ->void m22 : undefined ->m22 : typeof m10 - -void m23; ->void m23 : undefined ->m23 : typeof m10 - -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -import m24 = require("./"); ->m24 : typeof m1 - -import m25 = require("./index"); ->m25 : typeof m1 - -import m26 = require("./subfolder"); ->m26 : typeof m4 - -import m27 = require("./subfolder/"); ->m27 : typeof m4 - -import m28 = require("./subfolder/index"); ->m28 : typeof m4 - -import m29 = require("./subfolder2"); ->m29 : typeof m7 - -import m30 = require("./subfolder2/"); ->m30 : typeof m7 - -import m31 = require("./subfolder2/index"); ->m31 : typeof m7 - -import m32 = require("./subfolder2/another"); ->m32 : typeof m10 - -import m33 = require("./subfolder2/another/"); ->m33 : typeof m10 - -import m34 = require("./subfolder2/another/index"); ->m34 : typeof m10 - -void m24; ->void m24 : undefined ->m24 : typeof m1 - -void m25; ->void m25 : undefined ->m25 : typeof m1 - -void m26; ->void m26 : undefined ->m26 : typeof m4 - -void m27; ->void m27 : undefined ->m27 : typeof m4 - -void m28; ->void m28 : undefined ->m28 : typeof m4 - -void m29; ->void m29 : undefined ->m29 : typeof m7 - -void m30; ->void m30 : undefined ->m30 : typeof m7 - -void m31; ->void m31 : undefined ->m31 : typeof m7 - -void m32; ->void m32 : undefined ->m32 : typeof m10 - -void m33; ->void m33 : undefined ->m33 : typeof m10 - -void m34; ->void m34 : undefined ->m34 : typeof m10 - -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); ->_m35 : Promise ->import("./") : Promise ->"./" : "./" - -const _m36 = import("./index"); ->_m36 : Promise ->import("./index") : Promise ->"./index" : "./index" - -const _m37 = import("./subfolder"); ->_m37 : Promise ->import("./subfolder") : Promise ->"./subfolder" : "./subfolder" - -const _m38 = import("./subfolder/"); ->_m38 : Promise ->import("./subfolder/") : Promise ->"./subfolder/" : "./subfolder/" - -const _m39 = import("./subfolder/index"); ->_m39 : Promise ->import("./subfolder/index") : Promise ->"./subfolder/index" : "./subfolder/index" - -const _m40 = import("./subfolder2"); ->_m40 : Promise ->import("./subfolder2") : Promise ->"./subfolder2" : "./subfolder2" - -const _m41 = import("./subfolder2/"); ->_m41 : Promise ->import("./subfolder2/") : Promise ->"./subfolder2/" : "./subfolder2/" - -const _m42 = import("./subfolder2/index"); ->_m42 : Promise ->import("./subfolder2/index") : Promise ->"./subfolder2/index" : "./subfolder2/index" - -const _m43 = import("./subfolder2/another"); ->_m43 : Promise ->import("./subfolder2/another") : Promise ->"./subfolder2/another" : "./subfolder2/another" - -const _m44 = import("./subfolder2/another/"); ->_m44 : Promise ->import("./subfolder2/another/") : Promise ->"./subfolder2/another/" : "./subfolder2/another/" - -const _m45 = import("./subfolder2/another/index"); ->_m45 : Promise ->import("./subfolder2/another/index") : Promise ->"./subfolder2/another/index" : "./subfolder2/another/index" - -// cjs format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - -=== tests/cases/conformance/node/index.ts === -import * as m1 from "./index.js"; ->m1 : typeof m1 - -import * as m2 from "./index.mjs"; ->m2 : typeof m2 - -import * as m3 from "./index.cjs"; ->m3 : typeof m3 - -import * as m4 from "./subfolder/index.js"; ->m4 : typeof m4 - -import * as m5 from "./subfolder/index.mjs"; ->m5 : typeof m5 - -import * as m6 from "./subfolder/index.cjs"; ->m6 : typeof m6 - -import * as m7 from "./subfolder2/index.js"; ->m7 : typeof m7 - -import * as m8 from "./subfolder2/index.mjs"; ->m8 : typeof m8 - -import * as m9 from "./subfolder2/index.cjs"; ->m9 : typeof m9 - -import * as m10 from "./subfolder2/another/index.js"; ->m10 : typeof m10 - -import * as m11 from "./subfolder2/another/index.mjs"; ->m11 : typeof m11 - -import * as m12 from "./subfolder2/another/index.cjs"; ->m12 : typeof m12 - -// The next ones shouldn't all work - esm format files have no index resolution or extension resolution -import * as m13 from "./"; ->m13 : any - -import * as m14 from "./index"; ->m14 : any - -import * as m15 from "./subfolder"; ->m15 : any - -import * as m16 from "./subfolder/"; ->m16 : any - -import * as m17 from "./subfolder/index"; ->m17 : any - -import * as m18 from "./subfolder2"; ->m18 : any - -import * as m19 from "./subfolder2/"; ->m19 : any - -import * as m20 from "./subfolder2/index"; ->m20 : any - -import * as m21 from "./subfolder2/another"; ->m21 : any - -import * as m22 from "./subfolder2/another/"; ->m22 : any - -import * as m23 from "./subfolder2/another/index"; ->m23 : any - -void m1; ->void m1 : undefined ->m1 : typeof m1 - -void m2; ->void m2 : undefined ->m2 : typeof m2 - -void m3; ->void m3 : undefined ->m3 : typeof m3 - -void m4; ->void m4 : undefined ->m4 : typeof m4 - -void m5; ->void m5 : undefined ->m5 : typeof m5 - -void m6; ->void m6 : undefined ->m6 : typeof m6 - -void m7; ->void m7 : undefined ->m7 : typeof m7 - -void m8; ->void m8 : undefined ->m8 : typeof m8 - -void m9; ->void m9 : undefined ->m9 : typeof m9 - -void m10; ->void m10 : undefined ->m10 : typeof m10 - -void m11; ->void m11 : undefined ->m11 : typeof m11 - -void m12; ->void m12 : undefined ->m12 : typeof m12 - -void m13; ->void m13 : undefined ->m13 : any - -void m14; ->void m14 : undefined ->m14 : any - -void m15; ->void m15 : undefined ->m15 : any - -void m16; ->void m16 : undefined ->m16 : any - -void m17; ->void m17 : undefined ->m17 : any - -void m18; ->void m18 : undefined ->m18 : any - -void m19; ->void m19 : undefined ->m19 : any - -void m20; ->void m20 : undefined ->m20 : any - -void m21; ->void m21 : undefined ->m21 : any - -void m22; ->void m22 : undefined ->m22 : any - -void m23; ->void m23 : undefined ->m23 : any - -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -import m24 = require("./"); ->m24 : typeof m1 - -import m25 = require("./index"); ->m25 : typeof m1 - -import m26 = require("./subfolder"); ->m26 : typeof m26 - -import m27 = require("./subfolder/"); ->m27 : typeof m26 - -import m28 = require("./subfolder/index"); ->m28 : typeof m26 - -import m29 = require("./subfolder2"); ->m29 : typeof m29 - -import m30 = require("./subfolder2/"); ->m30 : typeof m29 - -import m31 = require("./subfolder2/index"); ->m31 : typeof m29 - -import m32 = require("./subfolder2/another"); ->m32 : typeof m10 - -import m33 = require("./subfolder2/another/"); ->m33 : typeof m10 - -import m34 = require("./subfolder2/another/index"); ->m34 : typeof m10 - -void m24; ->void m24 : undefined ->m24 : typeof m1 - -void m25; ->void m25 : undefined ->m25 : typeof m1 - -void m26; ->void m26 : undefined ->m26 : typeof m26 - -void m27; ->void m27 : undefined ->m27 : typeof m26 - -void m28; ->void m28 : undefined ->m28 : typeof m26 - -void m29; ->void m29 : undefined ->m29 : typeof m29 - -void m30; ->void m30 : undefined ->m30 : typeof m29 - -void m31; ->void m31 : undefined ->m31 : typeof m29 - -void m32; ->void m32 : undefined ->m32 : typeof m10 - -void m33; ->void m33 : undefined ->m33 : typeof m10 - -void m34; ->void m34 : undefined ->m34 : typeof m10 - -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); ->_m35 : Promise ->import("./") : Promise ->"./" : "./" - -const _m36 = import("./index"); ->_m36 : Promise ->import("./index") : Promise ->"./index" : "./index" - -const _m37 = import("./subfolder"); ->_m37 : Promise ->import("./subfolder") : Promise ->"./subfolder" : "./subfolder" - -const _m38 = import("./subfolder/"); ->_m38 : Promise ->import("./subfolder/") : Promise ->"./subfolder/" : "./subfolder/" - -const _m39 = import("./subfolder/index"); ->_m39 : Promise ->import("./subfolder/index") : Promise ->"./subfolder/index" : "./subfolder/index" - -const _m40 = import("./subfolder2"); ->_m40 : Promise ->import("./subfolder2") : Promise ->"./subfolder2" : "./subfolder2" - -const _m41 = import("./subfolder2/"); ->_m41 : Promise ->import("./subfolder2/") : Promise ->"./subfolder2/" : "./subfolder2/" - -const _m42 = import("./subfolder2/index"); ->_m42 : Promise ->import("./subfolder2/index") : Promise ->"./subfolder2/index" : "./subfolder2/index" - -const _m43 = import("./subfolder2/another"); ->_m43 : Promise ->import("./subfolder2/another") : Promise ->"./subfolder2/another" : "./subfolder2/another" - -const _m44 = import("./subfolder2/another/"); ->_m44 : Promise ->import("./subfolder2/another/") : Promise ->"./subfolder2/another/" : "./subfolder2/another/" - -const _m45 = import("./subfolder2/another/index"); ->_m45 : Promise ->import("./subfolder2/another/index") : Promise ->"./subfolder2/another/index" : "./subfolder2/another/index" - -// esm format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - diff --git a/tests/baselines/reference/nodeModulesAllowJs1(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJs1(module=node12).errors.txt deleted file mode 100644 index 178c28ed460..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJs1(module=node12).errors.txt +++ /dev/null @@ -1,663 +0,0 @@ -tests/cases/conformance/node/allowJs/index.cjs(2,21): error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.cjs(3,21): error TS1471: Module './index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.cjs(6,21): error TS1471: Module './subfolder/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.cjs(9,21): error TS1471: Module './subfolder2/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.cjs(11,22): error TS1471: Module './subfolder2/another/index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.cjs(12,22): error TS1471: Module './subfolder2/another/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.cjs(15,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.cjs(16,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.cjs(23,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.cjs(24,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.cjs(25,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.cjs(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.cjs(51,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.cjs(52,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.cjs(52,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.cjs(53,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.cjs(54,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.cjs(55,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.cjs(56,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.cjs(57,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.cjs(58,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.cjs(59,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.cjs(59,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.cjs(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.cjs(60,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.cjs(61,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.cjs(61,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.cjs(75,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(76,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.cjs(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.cjs(78,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.cjs(79,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.cjs(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.cjs(81,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.cjs(82,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.cjs(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.cjs(84,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.cjs(85,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.js(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(50,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.js(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.js(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.js(51,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.js(52,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.js(53,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.js(54,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.js(55,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.js(56,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.js(57,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.js(58,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.js(58,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.js(59,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.js(59,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.js(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.js(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.js(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.js(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.js(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.js(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(14,22): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(15,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(16,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(17,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(18,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(19,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(20,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(21,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(22,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(23,22): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(24,22): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(50,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.mjs(50,22): error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.mjs(51,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.mjs(51,22): error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.mjs(52,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.mjs(53,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.mjs(54,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.mjs(55,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.mjs(56,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.mjs(57,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.mjs(58,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.mjs(58,22): error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.mjs(59,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.mjs(59,22): error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.mjs(60,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.mjs(60,22): error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.mjs(74,21): error TS2307: Cannot find module './' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(75,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(76,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(77,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(78,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(79,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(80,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(81,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? -tests/cases/conformance/node/allowJs/index.mjs(82,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(83,21): error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. -tests/cases/conformance/node/allowJs/index.mjs(84,21): error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? - - -==== tests/cases/conformance/node/allowJs/subfolder/index.js (0 errors) ==== - // cjs format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/allowJs/subfolder/index.cjs (0 errors) ==== - // cjs format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/allowJs/subfolder/index.mjs (0 errors) ==== - // esm format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/allowJs/subfolder2/index.js (0 errors) ==== - // cjs format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/allowJs/subfolder2/index.cjs (0 errors) ==== - // cjs format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/allowJs/subfolder2/index.mjs (0 errors) ==== - // esm format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/allowJs/subfolder2/another/index.js (0 errors) ==== - // esm format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/allowJs/subfolder2/another/index.cjs (0 errors) ==== - // cjs format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/allowJs/subfolder2/another/index.mjs (0 errors) ==== - // esm format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/allowJs/index.js (38 errors) ==== - import * as m1 from "./index.js"; - import * as m2 from "./index.mjs"; - import * as m3 from "./index.cjs"; - import * as m4 from "./subfolder/index.js"; - import * as m5 from "./subfolder/index.mjs"; - import * as m6 from "./subfolder/index.cjs"; - import * as m7 from "./subfolder2/index.js"; - import * as m8 from "./subfolder2/index.mjs"; - import * as m9 from "./subfolder2/index.cjs"; - import * as m10 from "./subfolder2/another/index.js"; - import * as m11 from "./subfolder2/another/index.mjs"; - import * as m12 from "./subfolder2/another/index.cjs"; - // The next ones shouldn't all work - esm format files have no index resolution or extension resolution - import * as m13 from "./"; - ~~~~ -!!! error TS2307: Cannot find module './' or its corresponding type declarations. - import * as m14 from "./index"; - ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? - import * as m15 from "./subfolder"; - ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m16 from "./subfolder/"; - ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m17 from "./subfolder/index"; - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? - import * as m18 from "./subfolder2"; - ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m19 from "./subfolder2/"; - ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m20 from "./subfolder2/index"; - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? - import * as m21 from "./subfolder2/another"; - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m22 from "./subfolder2/another/"; - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m23 from "./subfolder2/another/index"; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? - void m1; - void m2; - void m3; - void m4; - void m5; - void m6; - void m7; - void m8; - void m9; - void m10; - void m11; - void m12; - void m13; - void m14; - void m15; - void m16; - void m17; - void m18; - void m19; - void m20; - void m21; - void m22; - void m23; - - // These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) - import m24 = require("./"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - ~~~~ -!!! error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m25 = require("./index"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - ~~~~~~~~~ -!!! error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m26 = require("./subfolder"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - import m27 = require("./subfolder/"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - import m28 = require("./subfolder/index"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - import m29 = require("./subfolder2"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - import m30 = require("./subfolder2/"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - import m31 = require("./subfolder2/index"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - import m32 = require("./subfolder2/another"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m33 = require("./subfolder2/another/"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m34 = require("./subfolder2/another/index"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - void m24; - void m25; - void m26; - void m27; - void m28; - void m29; - void m30; - void m31; - void m32; - void m33; - void m34; - - // These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution - const _m35 = import("./"); - ~~~~ -!!! error TS2307: Cannot find module './' or its corresponding type declarations. - const _m36 = import("./index"); - ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? - const _m37 = import("./subfolder"); - ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m38 = import("./subfolder/"); - ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m39 = import("./subfolder/index"); - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? - const _m40 = import("./subfolder2"); - ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m41 = import("./subfolder2/"); - ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m42 = import("./subfolder2/index"); - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? - const _m43 = import("./subfolder2/another"); - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m44 = import("./subfolder2/another/"); - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m45 = import("./subfolder2/another/index"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? - // esm format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/allowJs/index.cjs (38 errors) ==== - // ESM-format imports below should issue errors - import * as m1 from "./index.js"; - ~~~~~~~~~~~~ -!!! error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as m2 from "./index.mjs"; - ~~~~~~~~~~~~~ -!!! error TS1471: Module './index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as m3 from "./index.cjs"; - import * as m4 from "./subfolder/index.js"; - import * as m5 from "./subfolder/index.mjs"; - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as m6 from "./subfolder/index.cjs"; - import * as m7 from "./subfolder2/index.js"; - import * as m8 from "./subfolder2/index.mjs"; - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as m9 from "./subfolder2/index.cjs"; - import * as m10 from "./subfolder2/another/index.js"; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another/index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as m11 from "./subfolder2/another/index.mjs"; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another/index.mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as m12 from "./subfolder2/another/index.cjs"; - // The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) - import * as m13 from "./"; - ~~~~ -!!! error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as m14 from "./index"; - ~~~~~~~~~ -!!! error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as m15 from "./subfolder"; - import * as m16 from "./subfolder/"; - import * as m17 from "./subfolder/index"; - import * as m18 from "./subfolder2"; - import * as m19 from "./subfolder2/"; - import * as m20 from "./subfolder2/index"; - import * as m21 from "./subfolder2/another"; - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as m22 from "./subfolder2/another/"; - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as m23 from "./subfolder2/another/index"; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - void m1; - void m2; - void m3; - void m4; - void m5; - void m6; - void m7; - void m8; - void m9; - void m10; - void m11; - void m12; - void m13; - void m14; - void m15; - void m16; - void m17; - void m18; - void m19; - void m20; - void m21; - void m22; - void m23; - - // These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) - import m24 = require("./"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - ~~~~ -!!! error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m25 = require("./index"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - ~~~~~~~~~ -!!! error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m26 = require("./subfolder"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - import m27 = require("./subfolder/"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - import m28 = require("./subfolder/index"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - import m29 = require("./subfolder2"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - import m30 = require("./subfolder2/"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - import m31 = require("./subfolder2/index"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - import m32 = require("./subfolder2/another"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m33 = require("./subfolder2/another/"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m34 = require("./subfolder2/another/index"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - void m24; - void m25; - void m26; - void m27; - void m28; - void m29; - void m30; - void m31; - void m32; - void m33; - void m34; - - // These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution - const _m35 = import("./"); - ~~~~ -!!! error TS2307: Cannot find module './' or its corresponding type declarations. - const _m36 = import("./index"); - ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? - const _m37 = import("./subfolder"); - ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m38 = import("./subfolder/"); - ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m39 = import("./subfolder/index"); - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? - const _m40 = import("./subfolder2"); - ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m41 = import("./subfolder2/"); - ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m42 = import("./subfolder2/index"); - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? - const _m43 = import("./subfolder2/another"); - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m44 = import("./subfolder2/another/"); - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m45 = import("./subfolder2/another/index"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? - // cjs format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/allowJs/index.mjs (38 errors) ==== - import * as m1 from "./index.js"; - import * as m2 from "./index.mjs"; - import * as m3 from "./index.cjs"; - import * as m4 from "./subfolder/index.js"; - import * as m5 from "./subfolder/index.mjs"; - import * as m6 from "./subfolder/index.cjs"; - import * as m7 from "./subfolder2/index.js"; - import * as m8 from "./subfolder2/index.mjs"; - import * as m9 from "./subfolder2/index.cjs"; - import * as m10 from "./subfolder2/another/index.js"; - import * as m11 from "./subfolder2/another/index.mjs"; - import * as m12 from "./subfolder2/another/index.cjs"; - // The next ones should all fail - esm format files have no index resolution or extension resolution - import * as m13 from "./"; - ~~~~ -!!! error TS2307: Cannot find module './' or its corresponding type declarations. - import * as m14 from "./index"; - ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? - import * as m15 from "./subfolder"; - ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m16 from "./subfolder/"; - ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m17 from "./subfolder/index"; - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? - import * as m18 from "./subfolder2"; - ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m19 from "./subfolder2/"; - ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m20 from "./subfolder2/index"; - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? - import * as m21 from "./subfolder2/another"; - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m22 from "./subfolder2/another/"; - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - import * as m23 from "./subfolder2/another/index"; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? - void m1; - void m2; - void m3; - void m4; - void m5; - void m6; - void m7; - void m8; - void m9; - void m10; - void m11; - void m12; - void m13; - void m14; - void m15; - void m16; - void m17; - void m18; - void m19; - void m20; - void m21; - void m22; - void m23; - - // These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) - import m24 = require("./"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - ~~~~ -!!! error TS1471: Module './' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m25 = require("./index"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - ~~~~~~~~~ -!!! error TS1471: Module './index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m26 = require("./subfolder"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - import m27 = require("./subfolder/"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - import m28 = require("./subfolder/index"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - import m29 = require("./subfolder2"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - import m30 = require("./subfolder2/"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - import m31 = require("./subfolder2/index"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - import m32 = require("./subfolder2/another"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m33 = require("./subfolder2/another/"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another/' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import m34 = require("./subfolder2/another/index"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module './subfolder2/another/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - void m24; - void m25; - void m26; - void m27; - void m28; - void m29; - void m30; - void m31; - void m32; - void m33; - void m34; - - // These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution - const _m35 = import("./"); - ~~~~ -!!! error TS2307: Cannot find module './' or its corresponding type declarations. - const _m36 = import("./index"); - ~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './index.mjs'? - const _m37 = import("./subfolder"); - ~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m38 = import("./subfolder/"); - ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m39 = import("./subfolder/index"); - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder/index.mjs'? - const _m40 = import("./subfolder2"); - ~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m41 = import("./subfolder2/"); - ~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m42 = import("./subfolder2/index"); - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/index.mjs'? - const _m43 = import("./subfolder2/another"); - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m44 = import("./subfolder2/another/"); - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path. - const _m45 = import("./subfolder2/another/index"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean './subfolder2/another/index.mjs'? - - // esm format file - const x = 1; - export {x}; -==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module" - } -==== tests/cases/conformance/node/allowJs/subfolder/package.json (0 errors) ==== - { - "type": "commonjs" - } -==== tests/cases/conformance/node/allowJs/subfolder2/package.json (0 errors) ==== - { - } -==== tests/cases/conformance/node/allowJs/subfolder2/another/package.json (0 errors) ==== - { - "type": "module" - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJs1(module=node12).js b/tests/baselines/reference/nodeModulesAllowJs1(module=node12).js deleted file mode 100644 index 1376e7c5aea..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJs1(module=node12).js +++ /dev/null @@ -1,688 +0,0 @@ -//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJs1.ts] //// - -//// [index.js] -// cjs format file -const x = 1; -export {x}; -//// [index.cjs] -// cjs format file -const x = 1; -export {x}; -//// [index.mjs] -// esm format file -const x = 1; -export {x}; -//// [index.js] -// cjs format file -const x = 1; -export {x}; -//// [index.cjs] -// cjs format file -const x = 1; -export {x}; -//// [index.mjs] -// esm format file -const x = 1; -export {x}; -//// [index.js] -// esm format file -const x = 1; -export {x}; -//// [index.cjs] -// cjs format file -const x = 1; -export {x}; -//// [index.mjs] -// esm format file -const x = 1; -export {x}; -//// [index.js] -import * as m1 from "./index.js"; -import * as m2 from "./index.mjs"; -import * as m3 from "./index.cjs"; -import * as m4 from "./subfolder/index.js"; -import * as m5 from "./subfolder/index.mjs"; -import * as m6 from "./subfolder/index.cjs"; -import * as m7 from "./subfolder2/index.js"; -import * as m8 from "./subfolder2/index.mjs"; -import * as m9 from "./subfolder2/index.cjs"; -import * as m10 from "./subfolder2/another/index.js"; -import * as m11 from "./subfolder2/another/index.mjs"; -import * as m12 from "./subfolder2/another/index.cjs"; -// The next ones shouldn't all work - esm format files have no index resolution or extension resolution -import * as m13 from "./"; -import * as m14 from "./index"; -import * as m15 from "./subfolder"; -import * as m16 from "./subfolder/"; -import * as m17 from "./subfolder/index"; -import * as m18 from "./subfolder2"; -import * as m19 from "./subfolder2/"; -import * as m20 from "./subfolder2/index"; -import * as m21 from "./subfolder2/another"; -import * as m22 from "./subfolder2/another/"; -import * as m23 from "./subfolder2/another/index"; -void m1; -void m2; -void m3; -void m4; -void m5; -void m6; -void m7; -void m8; -void m9; -void m10; -void m11; -void m12; -void m13; -void m14; -void m15; -void m16; -void m17; -void m18; -void m19; -void m20; -void m21; -void m22; -void m23; - -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -import m24 = require("./"); -import m25 = require("./index"); -import m26 = require("./subfolder"); -import m27 = require("./subfolder/"); -import m28 = require("./subfolder/index"); -import m29 = require("./subfolder2"); -import m30 = require("./subfolder2/"); -import m31 = require("./subfolder2/index"); -import m32 = require("./subfolder2/another"); -import m33 = require("./subfolder2/another/"); -import m34 = require("./subfolder2/another/index"); -void m24; -void m25; -void m26; -void m27; -void m28; -void m29; -void m30; -void m31; -void m32; -void m33; -void m34; - -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); -const _m36 = import("./index"); -const _m37 = import("./subfolder"); -const _m38 = import("./subfolder/"); -const _m39 = import("./subfolder/index"); -const _m40 = import("./subfolder2"); -const _m41 = import("./subfolder2/"); -const _m42 = import("./subfolder2/index"); -const _m43 = import("./subfolder2/another"); -const _m44 = import("./subfolder2/another/"); -const _m45 = import("./subfolder2/another/index"); -// esm format file -const x = 1; -export {x}; -//// [index.cjs] -// ESM-format imports below should issue errors -import * as m1 from "./index.js"; -import * as m2 from "./index.mjs"; -import * as m3 from "./index.cjs"; -import * as m4 from "./subfolder/index.js"; -import * as m5 from "./subfolder/index.mjs"; -import * as m6 from "./subfolder/index.cjs"; -import * as m7 from "./subfolder2/index.js"; -import * as m8 from "./subfolder2/index.mjs"; -import * as m9 from "./subfolder2/index.cjs"; -import * as m10 from "./subfolder2/another/index.js"; -import * as m11 from "./subfolder2/another/index.mjs"; -import * as m12 from "./subfolder2/another/index.cjs"; -// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) -import * as m13 from "./"; -import * as m14 from "./index"; -import * as m15 from "./subfolder"; -import * as m16 from "./subfolder/"; -import * as m17 from "./subfolder/index"; -import * as m18 from "./subfolder2"; -import * as m19 from "./subfolder2/"; -import * as m20 from "./subfolder2/index"; -import * as m21 from "./subfolder2/another"; -import * as m22 from "./subfolder2/another/"; -import * as m23 from "./subfolder2/another/index"; -void m1; -void m2; -void m3; -void m4; -void m5; -void m6; -void m7; -void m8; -void m9; -void m10; -void m11; -void m12; -void m13; -void m14; -void m15; -void m16; -void m17; -void m18; -void m19; -void m20; -void m21; -void m22; -void m23; - -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -import m24 = require("./"); -import m25 = require("./index"); -import m26 = require("./subfolder"); -import m27 = require("./subfolder/"); -import m28 = require("./subfolder/index"); -import m29 = require("./subfolder2"); -import m30 = require("./subfolder2/"); -import m31 = require("./subfolder2/index"); -import m32 = require("./subfolder2/another"); -import m33 = require("./subfolder2/another/"); -import m34 = require("./subfolder2/another/index"); -void m24; -void m25; -void m26; -void m27; -void m28; -void m29; -void m30; -void m31; -void m32; -void m33; -void m34; - -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); -const _m36 = import("./index"); -const _m37 = import("./subfolder"); -const _m38 = import("./subfolder/"); -const _m39 = import("./subfolder/index"); -const _m40 = import("./subfolder2"); -const _m41 = import("./subfolder2/"); -const _m42 = import("./subfolder2/index"); -const _m43 = import("./subfolder2/another"); -const _m44 = import("./subfolder2/another/"); -const _m45 = import("./subfolder2/another/index"); -// cjs format file -const x = 1; -export {x}; -//// [index.mjs] -import * as m1 from "./index.js"; -import * as m2 from "./index.mjs"; -import * as m3 from "./index.cjs"; -import * as m4 from "./subfolder/index.js"; -import * as m5 from "./subfolder/index.mjs"; -import * as m6 from "./subfolder/index.cjs"; -import * as m7 from "./subfolder2/index.js"; -import * as m8 from "./subfolder2/index.mjs"; -import * as m9 from "./subfolder2/index.cjs"; -import * as m10 from "./subfolder2/another/index.js"; -import * as m11 from "./subfolder2/another/index.mjs"; -import * as m12 from "./subfolder2/another/index.cjs"; -// The next ones should all fail - esm format files have no index resolution or extension resolution -import * as m13 from "./"; -import * as m14 from "./index"; -import * as m15 from "./subfolder"; -import * as m16 from "./subfolder/"; -import * as m17 from "./subfolder/index"; -import * as m18 from "./subfolder2"; -import * as m19 from "./subfolder2/"; -import * as m20 from "./subfolder2/index"; -import * as m21 from "./subfolder2/another"; -import * as m22 from "./subfolder2/another/"; -import * as m23 from "./subfolder2/another/index"; -void m1; -void m2; -void m3; -void m4; -void m5; -void m6; -void m7; -void m8; -void m9; -void m10; -void m11; -void m12; -void m13; -void m14; -void m15; -void m16; -void m17; -void m18; -void m19; -void m20; -void m21; -void m22; -void m23; - -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -import m24 = require("./"); -import m25 = require("./index"); -import m26 = require("./subfolder"); -import m27 = require("./subfolder/"); -import m28 = require("./subfolder/index"); -import m29 = require("./subfolder2"); -import m30 = require("./subfolder2/"); -import m31 = require("./subfolder2/index"); -import m32 = require("./subfolder2/another"); -import m33 = require("./subfolder2/another/"); -import m34 = require("./subfolder2/another/index"); -void m24; -void m25; -void m26; -void m27; -void m28; -void m29; -void m30; -void m31; -void m32; -void m33; -void m34; - -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); -const _m36 = import("./index"); -const _m37 = import("./subfolder"); -const _m38 = import("./subfolder/"); -const _m39 = import("./subfolder/index"); -const _m40 = import("./subfolder2"); -const _m41 = import("./subfolder2/"); -const _m42 = import("./subfolder2/index"); -const _m43 = import("./subfolder2/another"); -const _m44 = import("./subfolder2/another/"); -const _m45 = import("./subfolder2/another/index"); - -// esm format file -const x = 1; -export {x}; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} -//// [package.json] -{ -} -//// [package.json] -{ - "type": "module" -} - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.x = void 0; -// cjs format file -const x = 1; -exports.x = x; -//// [index.cjs] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.x = void 0; -// cjs format file -const x = 1; -exports.x = x; -//// [index.mjs] -// esm format file -const x = 1; -export { x }; -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.x = void 0; -// cjs format file -const x = 1; -exports.x = x; -//// [index.cjs] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.x = void 0; -// cjs format file -const x = 1; -exports.x = x; -//// [index.mjs] -// esm format file -const x = 1; -export { x }; -//// [index.js] -// esm format file -const x = 1; -export { x }; -//// [index.cjs] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.x = void 0; -// cjs format file -const x = 1; -exports.x = x; -//// [index.mjs] -// esm format file -const x = 1; -export { x }; -//// [index.cjs] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.x = void 0; -// ESM-format imports below should issue errors -const m1 = __importStar(require("./index.js")); -const m2 = __importStar(require("./index.mjs")); -const m3 = __importStar(require("./index.cjs")); -const m4 = __importStar(require("./subfolder/index.js")); -const m5 = __importStar(require("./subfolder/index.mjs")); -const m6 = __importStar(require("./subfolder/index.cjs")); -const m7 = __importStar(require("./subfolder2/index.js")); -const m8 = __importStar(require("./subfolder2/index.mjs")); -const m9 = __importStar(require("./subfolder2/index.cjs")); -const m10 = __importStar(require("./subfolder2/another/index.js")); -const m11 = __importStar(require("./subfolder2/another/index.mjs")); -const m12 = __importStar(require("./subfolder2/another/index.cjs")); -// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) -const m13 = __importStar(require("./")); -const m14 = __importStar(require("./index")); -const m15 = __importStar(require("./subfolder")); -const m16 = __importStar(require("./subfolder/")); -const m17 = __importStar(require("./subfolder/index")); -const m18 = __importStar(require("./subfolder2")); -const m19 = __importStar(require("./subfolder2/")); -const m20 = __importStar(require("./subfolder2/index")); -const m21 = __importStar(require("./subfolder2/another")); -const m22 = __importStar(require("./subfolder2/another/")); -const m23 = __importStar(require("./subfolder2/another/index")); -void m1; -void m2; -void m3; -void m4; -void m5; -void m6; -void m7; -void m8; -void m9; -void m10; -void m11; -void m12; -void m13; -void m14; -void m15; -void m16; -void m17; -void m18; -void m19; -void m20; -void m21; -void m22; -void m23; -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -const m24 = require("./"); -const m25 = require("./index"); -const m26 = require("./subfolder"); -const m27 = require("./subfolder/"); -const m28 = require("./subfolder/index"); -const m29 = require("./subfolder2"); -const m30 = require("./subfolder2/"); -const m31 = require("./subfolder2/index"); -const m32 = require("./subfolder2/another"); -const m33 = require("./subfolder2/another/"); -const m34 = require("./subfolder2/another/index"); -void m24; -void m25; -void m26; -void m27; -void m28; -void m29; -void m30; -void m31; -void m32; -void m33; -void m34; -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); -const _m36 = import("./index"); -const _m37 = import("./subfolder"); -const _m38 = import("./subfolder/"); -const _m39 = import("./subfolder/index"); -const _m40 = import("./subfolder2"); -const _m41 = import("./subfolder2/"); -const _m42 = import("./subfolder2/index"); -const _m43 = import("./subfolder2/another"); -const _m44 = import("./subfolder2/another/"); -const _m45 = import("./subfolder2/another/index"); -// cjs format file -const x = 1; -exports.x = x; -//// [index.mjs] -import { createRequire as _createRequire } from "module"; -const __require = _createRequire(import.meta.url); -import * as m1 from "./index.js"; -import * as m2 from "./index.mjs"; -import * as m3 from "./index.cjs"; -import * as m4 from "./subfolder/index.js"; -import * as m5 from "./subfolder/index.mjs"; -import * as m6 from "./subfolder/index.cjs"; -import * as m7 from "./subfolder2/index.js"; -import * as m8 from "./subfolder2/index.mjs"; -import * as m9 from "./subfolder2/index.cjs"; -import * as m10 from "./subfolder2/another/index.js"; -import * as m11 from "./subfolder2/another/index.mjs"; -import * as m12 from "./subfolder2/another/index.cjs"; -// The next ones should all fail - esm format files have no index resolution or extension resolution -import * as m13 from "./"; -import * as m14 from "./index"; -import * as m15 from "./subfolder"; -import * as m16 from "./subfolder/"; -import * as m17 from "./subfolder/index"; -import * as m18 from "./subfolder2"; -import * as m19 from "./subfolder2/"; -import * as m20 from "./subfolder2/index"; -import * as m21 from "./subfolder2/another"; -import * as m22 from "./subfolder2/another/"; -import * as m23 from "./subfolder2/another/index"; -void m1; -void m2; -void m3; -void m4; -void m5; -void m6; -void m7; -void m8; -void m9; -void m10; -void m11; -void m12; -void m13; -void m14; -void m15; -void m16; -void m17; -void m18; -void m19; -void m20; -void m21; -void m22; -void m23; -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -const m24 = __require("./"); -const m25 = __require("./index"); -const m26 = __require("./subfolder"); -const m27 = __require("./subfolder/"); -const m28 = __require("./subfolder/index"); -const m29 = __require("./subfolder2"); -const m30 = __require("./subfolder2/"); -const m31 = __require("./subfolder2/index"); -const m32 = __require("./subfolder2/another"); -const m33 = __require("./subfolder2/another/"); -const m34 = __require("./subfolder2/another/index"); -void m24; -void m25; -void m26; -void m27; -void m28; -void m29; -void m30; -void m31; -void m32; -void m33; -void m34; -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); -const _m36 = import("./index"); -const _m37 = import("./subfolder"); -const _m38 = import("./subfolder/"); -const _m39 = import("./subfolder/index"); -const _m40 = import("./subfolder2"); -const _m41 = import("./subfolder2/"); -const _m42 = import("./subfolder2/index"); -const _m43 = import("./subfolder2/another"); -const _m44 = import("./subfolder2/another/"); -const _m45 = import("./subfolder2/another/index"); -// esm format file -const x = 1; -export { x }; -//// [index.js] -import { createRequire as _createRequire } from "module"; -const __require = _createRequire(import.meta.url); -import * as m1 from "./index.js"; -import * as m2 from "./index.mjs"; -import * as m3 from "./index.cjs"; -import * as m4 from "./subfolder/index.js"; -import * as m5 from "./subfolder/index.mjs"; -import * as m6 from "./subfolder/index.cjs"; -import * as m7 from "./subfolder2/index.js"; -import * as m8 from "./subfolder2/index.mjs"; -import * as m9 from "./subfolder2/index.cjs"; -import * as m10 from "./subfolder2/another/index.js"; -import * as m11 from "./subfolder2/another/index.mjs"; -import * as m12 from "./subfolder2/another/index.cjs"; -// The next ones shouldn't all work - esm format files have no index resolution or extension resolution -import * as m13 from "./"; -import * as m14 from "./index"; -import * as m15 from "./subfolder"; -import * as m16 from "./subfolder/"; -import * as m17 from "./subfolder/index"; -import * as m18 from "./subfolder2"; -import * as m19 from "./subfolder2/"; -import * as m20 from "./subfolder2/index"; -import * as m21 from "./subfolder2/another"; -import * as m22 from "./subfolder2/another/"; -import * as m23 from "./subfolder2/another/index"; -void m1; -void m2; -void m3; -void m4; -void m5; -void m6; -void m7; -void m8; -void m9; -void m10; -void m11; -void m12; -void m13; -void m14; -void m15; -void m16; -void m17; -void m18; -void m19; -void m20; -void m21; -void m22; -void m23; -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -const m24 = __require("./"); -const m25 = __require("./index"); -const m26 = __require("./subfolder"); -const m27 = __require("./subfolder/"); -const m28 = __require("./subfolder/index"); -const m29 = __require("./subfolder2"); -const m30 = __require("./subfolder2/"); -const m31 = __require("./subfolder2/index"); -const m32 = __require("./subfolder2/another"); -const m33 = __require("./subfolder2/another/"); -const m34 = __require("./subfolder2/another/index"); -void m24; -void m25; -void m26; -void m27; -void m28; -void m29; -void m30; -void m31; -void m32; -void m33; -void m34; -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); -const _m36 = import("./index"); -const _m37 = import("./subfolder"); -const _m38 = import("./subfolder/"); -const _m39 = import("./subfolder/index"); -const _m40 = import("./subfolder2"); -const _m41 = import("./subfolder2/"); -const _m42 = import("./subfolder2/index"); -const _m43 = import("./subfolder2/another"); -const _m44 = import("./subfolder2/another/"); -const _m45 = import("./subfolder2/another/index"); -// esm format file -const x = 1; -export { x }; - - -//// [index.d.ts] -export const x: 1; -//// [index.d.cts] -export const x: 1; -//// [index.d.mts] -export const x: 1; -//// [index.d.ts] -export const x: 1; -//// [index.d.cts] -export const x: 1; -//// [index.d.mts] -export const x: 1; -//// [index.d.ts] -export const x: 1; -//// [index.d.cts] -export const x: 1; -//// [index.d.mts] -export const x: 1; -//// [index.d.cts] -export const x: 1; -//// [index.d.mts] -export const x: 1; -//// [index.d.ts] -export const x: 1; diff --git a/tests/baselines/reference/nodeModulesAllowJs1(module=node12).symbols b/tests/baselines/reference/nodeModulesAllowJs1(module=node12).symbols deleted file mode 100644 index d874ab0c830..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJs1(module=node12).symbols +++ /dev/null @@ -1,817 +0,0 @@ -=== tests/cases/conformance/node/allowJs/subfolder/index.js === -// cjs format file -const x = 1; ->x : Symbol(x, Decl(index.js, 1, 5)) - -export {x}; ->x : Symbol(x, Decl(index.js, 2, 8)) - -=== tests/cases/conformance/node/allowJs/subfolder/index.cjs === -// cjs format file -const x = 1; ->x : Symbol(x, Decl(index.cjs, 1, 5)) - -export {x}; ->x : Symbol(x, Decl(index.cjs, 2, 8)) - -=== tests/cases/conformance/node/allowJs/subfolder/index.mjs === -// esm format file -const x = 1; ->x : Symbol(x, Decl(index.mjs, 1, 5)) - -export {x}; ->x : Symbol(x, Decl(index.mjs, 2, 8)) - -=== tests/cases/conformance/node/allowJs/subfolder2/index.js === -// cjs format file -const x = 1; ->x : Symbol(x, Decl(index.js, 1, 5)) - -export {x}; ->x : Symbol(x, Decl(index.js, 2, 8)) - -=== tests/cases/conformance/node/allowJs/subfolder2/index.cjs === -// cjs format file -const x = 1; ->x : Symbol(x, Decl(index.cjs, 1, 5)) - -export {x}; ->x : Symbol(x, Decl(index.cjs, 2, 8)) - -=== tests/cases/conformance/node/allowJs/subfolder2/index.mjs === -// esm format file -const x = 1; ->x : Symbol(x, Decl(index.mjs, 1, 5)) - -export {x}; ->x : Symbol(x, Decl(index.mjs, 2, 8)) - -=== tests/cases/conformance/node/allowJs/subfolder2/another/index.js === -// esm format file -const x = 1; ->x : Symbol(x, Decl(index.js, 1, 5)) - -export {x}; ->x : Symbol(x, Decl(index.js, 2, 8)) - -=== tests/cases/conformance/node/allowJs/subfolder2/another/index.cjs === -// cjs format file -const x = 1; ->x : Symbol(x, Decl(index.cjs, 1, 5)) - -export {x}; ->x : Symbol(x, Decl(index.cjs, 2, 8)) - -=== tests/cases/conformance/node/allowJs/subfolder2/another/index.mjs === -// esm format file -const x = 1; ->x : Symbol(x, Decl(index.mjs, 1, 5)) - -export {x}; ->x : Symbol(x, Decl(index.mjs, 2, 8)) - -=== tests/cases/conformance/node/allowJs/index.js === -import * as m1 from "./index.js"; ->m1 : Symbol(m1, Decl(index.js, 0, 6)) - -import * as m2 from "./index.mjs"; ->m2 : Symbol(m2, Decl(index.js, 1, 6)) - -import * as m3 from "./index.cjs"; ->m3 : Symbol(m3, Decl(index.js, 2, 6)) - -import * as m4 from "./subfolder/index.js"; ->m4 : Symbol(m4, Decl(index.js, 3, 6)) - -import * as m5 from "./subfolder/index.mjs"; ->m5 : Symbol(m5, Decl(index.js, 4, 6)) - -import * as m6 from "./subfolder/index.cjs"; ->m6 : Symbol(m6, Decl(index.js, 5, 6)) - -import * as m7 from "./subfolder2/index.js"; ->m7 : Symbol(m7, Decl(index.js, 6, 6)) - -import * as m8 from "./subfolder2/index.mjs"; ->m8 : Symbol(m8, Decl(index.js, 7, 6)) - -import * as m9 from "./subfolder2/index.cjs"; ->m9 : Symbol(m9, Decl(index.js, 8, 6)) - -import * as m10 from "./subfolder2/another/index.js"; ->m10 : Symbol(m10, Decl(index.js, 9, 6)) - -import * as m11 from "./subfolder2/another/index.mjs"; ->m11 : Symbol(m11, Decl(index.js, 10, 6)) - -import * as m12 from "./subfolder2/another/index.cjs"; ->m12 : Symbol(m12, Decl(index.js, 11, 6)) - -// The next ones shouldn't all work - esm format files have no index resolution or extension resolution -import * as m13 from "./"; ->m13 : Symbol(m13, Decl(index.js, 13, 6)) - -import * as m14 from "./index"; ->m14 : Symbol(m14, Decl(index.js, 14, 6)) - -import * as m15 from "./subfolder"; ->m15 : Symbol(m15, Decl(index.js, 15, 6)) - -import * as m16 from "./subfolder/"; ->m16 : Symbol(m16, Decl(index.js, 16, 6)) - -import * as m17 from "./subfolder/index"; ->m17 : Symbol(m17, Decl(index.js, 17, 6)) - -import * as m18 from "./subfolder2"; ->m18 : Symbol(m18, Decl(index.js, 18, 6)) - -import * as m19 from "./subfolder2/"; ->m19 : Symbol(m19, Decl(index.js, 19, 6)) - -import * as m20 from "./subfolder2/index"; ->m20 : Symbol(m20, Decl(index.js, 20, 6)) - -import * as m21 from "./subfolder2/another"; ->m21 : Symbol(m21, Decl(index.js, 21, 6)) - -import * as m22 from "./subfolder2/another/"; ->m22 : Symbol(m22, Decl(index.js, 22, 6)) - -import * as m23 from "./subfolder2/another/index"; ->m23 : Symbol(m23, Decl(index.js, 23, 6)) - -void m1; ->m1 : Symbol(m1, Decl(index.js, 0, 6)) - -void m2; ->m2 : Symbol(m2, Decl(index.js, 1, 6)) - -void m3; ->m3 : Symbol(m3, Decl(index.js, 2, 6)) - -void m4; ->m4 : Symbol(m4, Decl(index.js, 3, 6)) - -void m5; ->m5 : Symbol(m5, Decl(index.js, 4, 6)) - -void m6; ->m6 : Symbol(m6, Decl(index.js, 5, 6)) - -void m7; ->m7 : Symbol(m7, Decl(index.js, 6, 6)) - -void m8; ->m8 : Symbol(m8, Decl(index.js, 7, 6)) - -void m9; ->m9 : Symbol(m9, Decl(index.js, 8, 6)) - -void m10; ->m10 : Symbol(m10, Decl(index.js, 9, 6)) - -void m11; ->m11 : Symbol(m11, Decl(index.js, 10, 6)) - -void m12; ->m12 : Symbol(m12, Decl(index.js, 11, 6)) - -void m13; ->m13 : Symbol(m13, Decl(index.js, 13, 6)) - -void m14; ->m14 : Symbol(m14, Decl(index.js, 14, 6)) - -void m15; ->m15 : Symbol(m15, Decl(index.js, 15, 6)) - -void m16; ->m16 : Symbol(m16, Decl(index.js, 16, 6)) - -void m17; ->m17 : Symbol(m17, Decl(index.js, 17, 6)) - -void m18; ->m18 : Symbol(m18, Decl(index.js, 18, 6)) - -void m19; ->m19 : Symbol(m19, Decl(index.js, 19, 6)) - -void m20; ->m20 : Symbol(m20, Decl(index.js, 20, 6)) - -void m21; ->m21 : Symbol(m21, Decl(index.js, 21, 6)) - -void m22; ->m22 : Symbol(m22, Decl(index.js, 22, 6)) - -void m23; ->m23 : Symbol(m23, Decl(index.js, 23, 6)) - -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -import m24 = require("./"); ->m24 : Symbol(m24, Decl(index.js, 46, 9)) - -import m25 = require("./index"); ->m25 : Symbol(m25, Decl(index.js, 49, 27)) - -import m26 = require("./subfolder"); ->m26 : Symbol(m26, Decl(index.js, 50, 32)) - -import m27 = require("./subfolder/"); ->m27 : Symbol(m27, Decl(index.js, 51, 36)) - -import m28 = require("./subfolder/index"); ->m28 : Symbol(m28, Decl(index.js, 52, 37)) - -import m29 = require("./subfolder2"); ->m29 : Symbol(m29, Decl(index.js, 53, 42)) - -import m30 = require("./subfolder2/"); ->m30 : Symbol(m30, Decl(index.js, 54, 37)) - -import m31 = require("./subfolder2/index"); ->m31 : Symbol(m31, Decl(index.js, 55, 38)) - -import m32 = require("./subfolder2/another"); ->m32 : Symbol(m32, Decl(index.js, 56, 43)) - -import m33 = require("./subfolder2/another/"); ->m33 : Symbol(m33, Decl(index.js, 57, 45)) - -import m34 = require("./subfolder2/another/index"); ->m34 : Symbol(m34, Decl(index.js, 58, 46)) - -void m24; ->m24 : Symbol(m24, Decl(index.js, 46, 9)) - -void m25; ->m25 : Symbol(m25, Decl(index.js, 49, 27)) - -void m26; ->m26 : Symbol(m26, Decl(index.js, 50, 32)) - -void m27; ->m27 : Symbol(m27, Decl(index.js, 51, 36)) - -void m28; ->m28 : Symbol(m28, Decl(index.js, 52, 37)) - -void m29; ->m29 : Symbol(m29, Decl(index.js, 53, 42)) - -void m30; ->m30 : Symbol(m30, Decl(index.js, 54, 37)) - -void m31; ->m31 : Symbol(m31, Decl(index.js, 55, 38)) - -void m32; ->m32 : Symbol(m32, Decl(index.js, 56, 43)) - -void m33; ->m33 : Symbol(m33, Decl(index.js, 57, 45)) - -void m34; ->m34 : Symbol(m34, Decl(index.js, 58, 46)) - -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); ->_m35 : Symbol(_m35, Decl(index.js, 73, 5)) - -const _m36 = import("./index"); ->_m36 : Symbol(_m36, Decl(index.js, 74, 5)) - -const _m37 = import("./subfolder"); ->_m37 : Symbol(_m37, Decl(index.js, 75, 5)) - -const _m38 = import("./subfolder/"); ->_m38 : Symbol(_m38, Decl(index.js, 76, 5)) - -const _m39 = import("./subfolder/index"); ->_m39 : Symbol(_m39, Decl(index.js, 77, 5)) - -const _m40 = import("./subfolder2"); ->_m40 : Symbol(_m40, Decl(index.js, 78, 5)) - -const _m41 = import("./subfolder2/"); ->_m41 : Symbol(_m41, Decl(index.js, 79, 5)) - -const _m42 = import("./subfolder2/index"); ->_m42 : Symbol(_m42, Decl(index.js, 80, 5)) - -const _m43 = import("./subfolder2/another"); ->_m43 : Symbol(_m43, Decl(index.js, 81, 5)) - -const _m44 = import("./subfolder2/another/"); ->_m44 : Symbol(_m44, Decl(index.js, 82, 5)) - -const _m45 = import("./subfolder2/another/index"); ->_m45 : Symbol(_m45, Decl(index.js, 83, 5)) - -// esm format file -const x = 1; ->x : Symbol(x, Decl(index.js, 85, 5)) - -export {x}; ->x : Symbol(m1.x, Decl(index.js, 86, 8)) - -=== tests/cases/conformance/node/allowJs/index.cjs === -// ESM-format imports below should issue errors -import * as m1 from "./index.js"; ->m1 : Symbol(m1, Decl(index.cjs, 1, 6)) - -import * as m2 from "./index.mjs"; ->m2 : Symbol(m2, Decl(index.cjs, 2, 6)) - -import * as m3 from "./index.cjs"; ->m3 : Symbol(m3, Decl(index.cjs, 3, 6)) - -import * as m4 from "./subfolder/index.js"; ->m4 : Symbol(m4, Decl(index.cjs, 4, 6)) - -import * as m5 from "./subfolder/index.mjs"; ->m5 : Symbol(m5, Decl(index.cjs, 5, 6)) - -import * as m6 from "./subfolder/index.cjs"; ->m6 : Symbol(m6, Decl(index.cjs, 6, 6)) - -import * as m7 from "./subfolder2/index.js"; ->m7 : Symbol(m7, Decl(index.cjs, 7, 6)) - -import * as m8 from "./subfolder2/index.mjs"; ->m8 : Symbol(m8, Decl(index.cjs, 8, 6)) - -import * as m9 from "./subfolder2/index.cjs"; ->m9 : Symbol(m9, Decl(index.cjs, 9, 6)) - -import * as m10 from "./subfolder2/another/index.js"; ->m10 : Symbol(m10, Decl(index.cjs, 10, 6)) - -import * as m11 from "./subfolder2/another/index.mjs"; ->m11 : Symbol(m11, Decl(index.cjs, 11, 6)) - -import * as m12 from "./subfolder2/another/index.cjs"; ->m12 : Symbol(m12, Decl(index.cjs, 12, 6)) - -// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) -import * as m13 from "./"; ->m13 : Symbol(m13, Decl(index.cjs, 14, 6)) - -import * as m14 from "./index"; ->m14 : Symbol(m14, Decl(index.cjs, 15, 6)) - -import * as m15 from "./subfolder"; ->m15 : Symbol(m15, Decl(index.cjs, 16, 6)) - -import * as m16 from "./subfolder/"; ->m16 : Symbol(m16, Decl(index.cjs, 17, 6)) - -import * as m17 from "./subfolder/index"; ->m17 : Symbol(m17, Decl(index.cjs, 18, 6)) - -import * as m18 from "./subfolder2"; ->m18 : Symbol(m18, Decl(index.cjs, 19, 6)) - -import * as m19 from "./subfolder2/"; ->m19 : Symbol(m19, Decl(index.cjs, 20, 6)) - -import * as m20 from "./subfolder2/index"; ->m20 : Symbol(m20, Decl(index.cjs, 21, 6)) - -import * as m21 from "./subfolder2/another"; ->m21 : Symbol(m21, Decl(index.cjs, 22, 6)) - -import * as m22 from "./subfolder2/another/"; ->m22 : Symbol(m22, Decl(index.cjs, 23, 6)) - -import * as m23 from "./subfolder2/another/index"; ->m23 : Symbol(m23, Decl(index.cjs, 24, 6)) - -void m1; ->m1 : Symbol(m1, Decl(index.cjs, 1, 6)) - -void m2; ->m2 : Symbol(m2, Decl(index.cjs, 2, 6)) - -void m3; ->m3 : Symbol(m3, Decl(index.cjs, 3, 6)) - -void m4; ->m4 : Symbol(m4, Decl(index.cjs, 4, 6)) - -void m5; ->m5 : Symbol(m5, Decl(index.cjs, 5, 6)) - -void m6; ->m6 : Symbol(m6, Decl(index.cjs, 6, 6)) - -void m7; ->m7 : Symbol(m7, Decl(index.cjs, 7, 6)) - -void m8; ->m8 : Symbol(m8, Decl(index.cjs, 8, 6)) - -void m9; ->m9 : Symbol(m9, Decl(index.cjs, 9, 6)) - -void m10; ->m10 : Symbol(m10, Decl(index.cjs, 10, 6)) - -void m11; ->m11 : Symbol(m11, Decl(index.cjs, 11, 6)) - -void m12; ->m12 : Symbol(m12, Decl(index.cjs, 12, 6)) - -void m13; ->m13 : Symbol(m13, Decl(index.cjs, 14, 6)) - -void m14; ->m14 : Symbol(m14, Decl(index.cjs, 15, 6)) - -void m15; ->m15 : Symbol(m15, Decl(index.cjs, 16, 6)) - -void m16; ->m16 : Symbol(m16, Decl(index.cjs, 17, 6)) - -void m17; ->m17 : Symbol(m17, Decl(index.cjs, 18, 6)) - -void m18; ->m18 : Symbol(m18, Decl(index.cjs, 19, 6)) - -void m19; ->m19 : Symbol(m19, Decl(index.cjs, 20, 6)) - -void m20; ->m20 : Symbol(m20, Decl(index.cjs, 21, 6)) - -void m21; ->m21 : Symbol(m21, Decl(index.cjs, 22, 6)) - -void m22; ->m22 : Symbol(m22, Decl(index.cjs, 23, 6)) - -void m23; ->m23 : Symbol(m23, Decl(index.cjs, 24, 6)) - -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -import m24 = require("./"); ->m24 : Symbol(m24, Decl(index.cjs, 47, 9)) - -import m25 = require("./index"); ->m25 : Symbol(m25, Decl(index.cjs, 50, 27)) - -import m26 = require("./subfolder"); ->m26 : Symbol(m26, Decl(index.cjs, 51, 32)) - -import m27 = require("./subfolder/"); ->m27 : Symbol(m27, Decl(index.cjs, 52, 36)) - -import m28 = require("./subfolder/index"); ->m28 : Symbol(m28, Decl(index.cjs, 53, 37)) - -import m29 = require("./subfolder2"); ->m29 : Symbol(m29, Decl(index.cjs, 54, 42)) - -import m30 = require("./subfolder2/"); ->m30 : Symbol(m30, Decl(index.cjs, 55, 37)) - -import m31 = require("./subfolder2/index"); ->m31 : Symbol(m31, Decl(index.cjs, 56, 38)) - -import m32 = require("./subfolder2/another"); ->m32 : Symbol(m32, Decl(index.cjs, 57, 43)) - -import m33 = require("./subfolder2/another/"); ->m33 : Symbol(m33, Decl(index.cjs, 58, 45)) - -import m34 = require("./subfolder2/another/index"); ->m34 : Symbol(m34, Decl(index.cjs, 59, 46)) - -void m24; ->m24 : Symbol(m24, Decl(index.cjs, 47, 9)) - -void m25; ->m25 : Symbol(m25, Decl(index.cjs, 50, 27)) - -void m26; ->m26 : Symbol(m26, Decl(index.cjs, 51, 32)) - -void m27; ->m27 : Symbol(m27, Decl(index.cjs, 52, 36)) - -void m28; ->m28 : Symbol(m28, Decl(index.cjs, 53, 37)) - -void m29; ->m29 : Symbol(m29, Decl(index.cjs, 54, 42)) - -void m30; ->m30 : Symbol(m30, Decl(index.cjs, 55, 37)) - -void m31; ->m31 : Symbol(m31, Decl(index.cjs, 56, 38)) - -void m32; ->m32 : Symbol(m32, Decl(index.cjs, 57, 43)) - -void m33; ->m33 : Symbol(m33, Decl(index.cjs, 58, 45)) - -void m34; ->m34 : Symbol(m34, Decl(index.cjs, 59, 46)) - -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); ->_m35 : Symbol(_m35, Decl(index.cjs, 74, 5)) - -const _m36 = import("./index"); ->_m36 : Symbol(_m36, Decl(index.cjs, 75, 5)) - -const _m37 = import("./subfolder"); ->_m37 : Symbol(_m37, Decl(index.cjs, 76, 5)) - -const _m38 = import("./subfolder/"); ->_m38 : Symbol(_m38, Decl(index.cjs, 77, 5)) - -const _m39 = import("./subfolder/index"); ->_m39 : Symbol(_m39, Decl(index.cjs, 78, 5)) - -const _m40 = import("./subfolder2"); ->_m40 : Symbol(_m40, Decl(index.cjs, 79, 5)) - -const _m41 = import("./subfolder2/"); ->_m41 : Symbol(_m41, Decl(index.cjs, 80, 5)) - -const _m42 = import("./subfolder2/index"); ->_m42 : Symbol(_m42, Decl(index.cjs, 81, 5)) - -const _m43 = import("./subfolder2/another"); ->_m43 : Symbol(_m43, Decl(index.cjs, 82, 5)) - -const _m44 = import("./subfolder2/another/"); ->_m44 : Symbol(_m44, Decl(index.cjs, 83, 5)) - -const _m45 = import("./subfolder2/another/index"); ->_m45 : Symbol(_m45, Decl(index.cjs, 84, 5)) - -// cjs format file -const x = 1; ->x : Symbol(x, Decl(index.cjs, 86, 5)) - -export {x}; ->x : Symbol(m3.x, Decl(index.cjs, 87, 8)) - -=== tests/cases/conformance/node/allowJs/index.mjs === -import * as m1 from "./index.js"; ->m1 : Symbol(m1, Decl(index.mjs, 0, 6)) - -import * as m2 from "./index.mjs"; ->m2 : Symbol(m2, Decl(index.mjs, 1, 6)) - -import * as m3 from "./index.cjs"; ->m3 : Symbol(m3, Decl(index.mjs, 2, 6)) - -import * as m4 from "./subfolder/index.js"; ->m4 : Symbol(m4, Decl(index.mjs, 3, 6)) - -import * as m5 from "./subfolder/index.mjs"; ->m5 : Symbol(m5, Decl(index.mjs, 4, 6)) - -import * as m6 from "./subfolder/index.cjs"; ->m6 : Symbol(m6, Decl(index.mjs, 5, 6)) - -import * as m7 from "./subfolder2/index.js"; ->m7 : Symbol(m7, Decl(index.mjs, 6, 6)) - -import * as m8 from "./subfolder2/index.mjs"; ->m8 : Symbol(m8, Decl(index.mjs, 7, 6)) - -import * as m9 from "./subfolder2/index.cjs"; ->m9 : Symbol(m9, Decl(index.mjs, 8, 6)) - -import * as m10 from "./subfolder2/another/index.js"; ->m10 : Symbol(m10, Decl(index.mjs, 9, 6)) - -import * as m11 from "./subfolder2/another/index.mjs"; ->m11 : Symbol(m11, Decl(index.mjs, 10, 6)) - -import * as m12 from "./subfolder2/another/index.cjs"; ->m12 : Symbol(m12, Decl(index.mjs, 11, 6)) - -// The next ones should all fail - esm format files have no index resolution or extension resolution -import * as m13 from "./"; ->m13 : Symbol(m13, Decl(index.mjs, 13, 6)) - -import * as m14 from "./index"; ->m14 : Symbol(m14, Decl(index.mjs, 14, 6)) - -import * as m15 from "./subfolder"; ->m15 : Symbol(m15, Decl(index.mjs, 15, 6)) - -import * as m16 from "./subfolder/"; ->m16 : Symbol(m16, Decl(index.mjs, 16, 6)) - -import * as m17 from "./subfolder/index"; ->m17 : Symbol(m17, Decl(index.mjs, 17, 6)) - -import * as m18 from "./subfolder2"; ->m18 : Symbol(m18, Decl(index.mjs, 18, 6)) - -import * as m19 from "./subfolder2/"; ->m19 : Symbol(m19, Decl(index.mjs, 19, 6)) - -import * as m20 from "./subfolder2/index"; ->m20 : Symbol(m20, Decl(index.mjs, 20, 6)) - -import * as m21 from "./subfolder2/another"; ->m21 : Symbol(m21, Decl(index.mjs, 21, 6)) - -import * as m22 from "./subfolder2/another/"; ->m22 : Symbol(m22, Decl(index.mjs, 22, 6)) - -import * as m23 from "./subfolder2/another/index"; ->m23 : Symbol(m23, Decl(index.mjs, 23, 6)) - -void m1; ->m1 : Symbol(m1, Decl(index.mjs, 0, 6)) - -void m2; ->m2 : Symbol(m2, Decl(index.mjs, 1, 6)) - -void m3; ->m3 : Symbol(m3, Decl(index.mjs, 2, 6)) - -void m4; ->m4 : Symbol(m4, Decl(index.mjs, 3, 6)) - -void m5; ->m5 : Symbol(m5, Decl(index.mjs, 4, 6)) - -void m6; ->m6 : Symbol(m6, Decl(index.mjs, 5, 6)) - -void m7; ->m7 : Symbol(m7, Decl(index.mjs, 6, 6)) - -void m8; ->m8 : Symbol(m8, Decl(index.mjs, 7, 6)) - -void m9; ->m9 : Symbol(m9, Decl(index.mjs, 8, 6)) - -void m10; ->m10 : Symbol(m10, Decl(index.mjs, 9, 6)) - -void m11; ->m11 : Symbol(m11, Decl(index.mjs, 10, 6)) - -void m12; ->m12 : Symbol(m12, Decl(index.mjs, 11, 6)) - -void m13; ->m13 : Symbol(m13, Decl(index.mjs, 13, 6)) - -void m14; ->m14 : Symbol(m14, Decl(index.mjs, 14, 6)) - -void m15; ->m15 : Symbol(m15, Decl(index.mjs, 15, 6)) - -void m16; ->m16 : Symbol(m16, Decl(index.mjs, 16, 6)) - -void m17; ->m17 : Symbol(m17, Decl(index.mjs, 17, 6)) - -void m18; ->m18 : Symbol(m18, Decl(index.mjs, 18, 6)) - -void m19; ->m19 : Symbol(m19, Decl(index.mjs, 19, 6)) - -void m20; ->m20 : Symbol(m20, Decl(index.mjs, 20, 6)) - -void m21; ->m21 : Symbol(m21, Decl(index.mjs, 21, 6)) - -void m22; ->m22 : Symbol(m22, Decl(index.mjs, 22, 6)) - -void m23; ->m23 : Symbol(m23, Decl(index.mjs, 23, 6)) - -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -import m24 = require("./"); ->m24 : Symbol(m24, Decl(index.mjs, 46, 9)) - -import m25 = require("./index"); ->m25 : Symbol(m25, Decl(index.mjs, 49, 27)) - -import m26 = require("./subfolder"); ->m26 : Symbol(m26, Decl(index.mjs, 50, 32)) - -import m27 = require("./subfolder/"); ->m27 : Symbol(m27, Decl(index.mjs, 51, 36)) - -import m28 = require("./subfolder/index"); ->m28 : Symbol(m28, Decl(index.mjs, 52, 37)) - -import m29 = require("./subfolder2"); ->m29 : Symbol(m29, Decl(index.mjs, 53, 42)) - -import m30 = require("./subfolder2/"); ->m30 : Symbol(m30, Decl(index.mjs, 54, 37)) - -import m31 = require("./subfolder2/index"); ->m31 : Symbol(m31, Decl(index.mjs, 55, 38)) - -import m32 = require("./subfolder2/another"); ->m32 : Symbol(m32, Decl(index.mjs, 56, 43)) - -import m33 = require("./subfolder2/another/"); ->m33 : Symbol(m33, Decl(index.mjs, 57, 45)) - -import m34 = require("./subfolder2/another/index"); ->m34 : Symbol(m34, Decl(index.mjs, 58, 46)) - -void m24; ->m24 : Symbol(m24, Decl(index.mjs, 46, 9)) - -void m25; ->m25 : Symbol(m25, Decl(index.mjs, 49, 27)) - -void m26; ->m26 : Symbol(m26, Decl(index.mjs, 50, 32)) - -void m27; ->m27 : Symbol(m27, Decl(index.mjs, 51, 36)) - -void m28; ->m28 : Symbol(m28, Decl(index.mjs, 52, 37)) - -void m29; ->m29 : Symbol(m29, Decl(index.mjs, 53, 42)) - -void m30; ->m30 : Symbol(m30, Decl(index.mjs, 54, 37)) - -void m31; ->m31 : Symbol(m31, Decl(index.mjs, 55, 38)) - -void m32; ->m32 : Symbol(m32, Decl(index.mjs, 56, 43)) - -void m33; ->m33 : Symbol(m33, Decl(index.mjs, 57, 45)) - -void m34; ->m34 : Symbol(m34, Decl(index.mjs, 58, 46)) - -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); ->_m35 : Symbol(_m35, Decl(index.mjs, 73, 5)) - -const _m36 = import("./index"); ->_m36 : Symbol(_m36, Decl(index.mjs, 74, 5)) - -const _m37 = import("./subfolder"); ->_m37 : Symbol(_m37, Decl(index.mjs, 75, 5)) - -const _m38 = import("./subfolder/"); ->_m38 : Symbol(_m38, Decl(index.mjs, 76, 5)) - -const _m39 = import("./subfolder/index"); ->_m39 : Symbol(_m39, Decl(index.mjs, 77, 5)) - -const _m40 = import("./subfolder2"); ->_m40 : Symbol(_m40, Decl(index.mjs, 78, 5)) - -const _m41 = import("./subfolder2/"); ->_m41 : Symbol(_m41, Decl(index.mjs, 79, 5)) - -const _m42 = import("./subfolder2/index"); ->_m42 : Symbol(_m42, Decl(index.mjs, 80, 5)) - -const _m43 = import("./subfolder2/another"); ->_m43 : Symbol(_m43, Decl(index.mjs, 81, 5)) - -const _m44 = import("./subfolder2/another/"); ->_m44 : Symbol(_m44, Decl(index.mjs, 82, 5)) - -const _m45 = import("./subfolder2/another/index"); ->_m45 : Symbol(_m45, Decl(index.mjs, 83, 5)) - -// esm format file -const x = 1; ->x : Symbol(x, Decl(index.mjs, 86, 5)) - -export {x}; ->x : Symbol(m2.x, Decl(index.mjs, 87, 8)) - diff --git a/tests/baselines/reference/nodeModulesAllowJs1(module=node12).types b/tests/baselines/reference/nodeModulesAllowJs1(module=node12).types deleted file mode 100644 index bc08d749cf8..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJs1(module=node12).types +++ /dev/null @@ -1,997 +0,0 @@ -=== tests/cases/conformance/node/allowJs/subfolder/index.js === -// cjs format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - -=== tests/cases/conformance/node/allowJs/subfolder/index.cjs === -// cjs format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - -=== tests/cases/conformance/node/allowJs/subfolder/index.mjs === -// esm format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - -=== tests/cases/conformance/node/allowJs/subfolder2/index.js === -// cjs format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - -=== tests/cases/conformance/node/allowJs/subfolder2/index.cjs === -// cjs format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - -=== tests/cases/conformance/node/allowJs/subfolder2/index.mjs === -// esm format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - -=== tests/cases/conformance/node/allowJs/subfolder2/another/index.js === -// esm format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - -=== tests/cases/conformance/node/allowJs/subfolder2/another/index.cjs === -// cjs format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - -=== tests/cases/conformance/node/allowJs/subfolder2/another/index.mjs === -// esm format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - -=== tests/cases/conformance/node/allowJs/index.js === -import * as m1 from "./index.js"; ->m1 : typeof m1 - -import * as m2 from "./index.mjs"; ->m2 : typeof m2 - -import * as m3 from "./index.cjs"; ->m3 : typeof m3 - -import * as m4 from "./subfolder/index.js"; ->m4 : typeof m4 - -import * as m5 from "./subfolder/index.mjs"; ->m5 : typeof m5 - -import * as m6 from "./subfolder/index.cjs"; ->m6 : typeof m6 - -import * as m7 from "./subfolder2/index.js"; ->m7 : typeof m7 - -import * as m8 from "./subfolder2/index.mjs"; ->m8 : typeof m8 - -import * as m9 from "./subfolder2/index.cjs"; ->m9 : typeof m9 - -import * as m10 from "./subfolder2/another/index.js"; ->m10 : typeof m10 - -import * as m11 from "./subfolder2/another/index.mjs"; ->m11 : typeof m11 - -import * as m12 from "./subfolder2/another/index.cjs"; ->m12 : typeof m12 - -// The next ones shouldn't all work - esm format files have no index resolution or extension resolution -import * as m13 from "./"; ->m13 : any - -import * as m14 from "./index"; ->m14 : any - -import * as m15 from "./subfolder"; ->m15 : any - -import * as m16 from "./subfolder/"; ->m16 : any - -import * as m17 from "./subfolder/index"; ->m17 : any - -import * as m18 from "./subfolder2"; ->m18 : any - -import * as m19 from "./subfolder2/"; ->m19 : any - -import * as m20 from "./subfolder2/index"; ->m20 : any - -import * as m21 from "./subfolder2/another"; ->m21 : any - -import * as m22 from "./subfolder2/another/"; ->m22 : any - -import * as m23 from "./subfolder2/another/index"; ->m23 : any - -void m1; ->void m1 : undefined ->m1 : typeof m1 - -void m2; ->void m2 : undefined ->m2 : typeof m2 - -void m3; ->void m3 : undefined ->m3 : typeof m3 - -void m4; ->void m4 : undefined ->m4 : typeof m4 - -void m5; ->void m5 : undefined ->m5 : typeof m5 - -void m6; ->void m6 : undefined ->m6 : typeof m6 - -void m7; ->void m7 : undefined ->m7 : typeof m7 - -void m8; ->void m8 : undefined ->m8 : typeof m8 - -void m9; ->void m9 : undefined ->m9 : typeof m9 - -void m10; ->void m10 : undefined ->m10 : typeof m10 - -void m11; ->void m11 : undefined ->m11 : typeof m11 - -void m12; ->void m12 : undefined ->m12 : typeof m12 - -void m13; ->void m13 : undefined ->m13 : any - -void m14; ->void m14 : undefined ->m14 : any - -void m15; ->void m15 : undefined ->m15 : any - -void m16; ->void m16 : undefined ->m16 : any - -void m17; ->void m17 : undefined ->m17 : any - -void m18; ->void m18 : undefined ->m18 : any - -void m19; ->void m19 : undefined ->m19 : any - -void m20; ->void m20 : undefined ->m20 : any - -void m21; ->void m21 : undefined ->m21 : any - -void m22; ->void m22 : undefined ->m22 : any - -void m23; ->void m23 : undefined ->m23 : any - -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -import m24 = require("./"); ->m24 : typeof m1 - -import m25 = require("./index"); ->m25 : typeof m1 - -import m26 = require("./subfolder"); ->m26 : typeof m26 - -import m27 = require("./subfolder/"); ->m27 : typeof m26 - -import m28 = require("./subfolder/index"); ->m28 : typeof m26 - -import m29 = require("./subfolder2"); ->m29 : typeof m29 - -import m30 = require("./subfolder2/"); ->m30 : typeof m29 - -import m31 = require("./subfolder2/index"); ->m31 : typeof m29 - -import m32 = require("./subfolder2/another"); ->m32 : typeof m10 - -import m33 = require("./subfolder2/another/"); ->m33 : typeof m10 - -import m34 = require("./subfolder2/another/index"); ->m34 : typeof m10 - -void m24; ->void m24 : undefined ->m24 : typeof m1 - -void m25; ->void m25 : undefined ->m25 : typeof m1 - -void m26; ->void m26 : undefined ->m26 : typeof m26 - -void m27; ->void m27 : undefined ->m27 : typeof m26 - -void m28; ->void m28 : undefined ->m28 : typeof m26 - -void m29; ->void m29 : undefined ->m29 : typeof m29 - -void m30; ->void m30 : undefined ->m30 : typeof m29 - -void m31; ->void m31 : undefined ->m31 : typeof m29 - -void m32; ->void m32 : undefined ->m32 : typeof m10 - -void m33; ->void m33 : undefined ->m33 : typeof m10 - -void m34; ->void m34 : undefined ->m34 : typeof m10 - -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); ->_m35 : Promise ->import("./") : Promise ->"./" : "./" - -const _m36 = import("./index"); ->_m36 : Promise ->import("./index") : Promise ->"./index" : "./index" - -const _m37 = import("./subfolder"); ->_m37 : Promise ->import("./subfolder") : Promise ->"./subfolder" : "./subfolder" - -const _m38 = import("./subfolder/"); ->_m38 : Promise ->import("./subfolder/") : Promise ->"./subfolder/" : "./subfolder/" - -const _m39 = import("./subfolder/index"); ->_m39 : Promise ->import("./subfolder/index") : Promise ->"./subfolder/index" : "./subfolder/index" - -const _m40 = import("./subfolder2"); ->_m40 : Promise ->import("./subfolder2") : Promise ->"./subfolder2" : "./subfolder2" - -const _m41 = import("./subfolder2/"); ->_m41 : Promise ->import("./subfolder2/") : Promise ->"./subfolder2/" : "./subfolder2/" - -const _m42 = import("./subfolder2/index"); ->_m42 : Promise ->import("./subfolder2/index") : Promise ->"./subfolder2/index" : "./subfolder2/index" - -const _m43 = import("./subfolder2/another"); ->_m43 : Promise ->import("./subfolder2/another") : Promise ->"./subfolder2/another" : "./subfolder2/another" - -const _m44 = import("./subfolder2/another/"); ->_m44 : Promise ->import("./subfolder2/another/") : Promise ->"./subfolder2/another/" : "./subfolder2/another/" - -const _m45 = import("./subfolder2/another/index"); ->_m45 : Promise ->import("./subfolder2/another/index") : Promise ->"./subfolder2/another/index" : "./subfolder2/another/index" - -// esm format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - -=== tests/cases/conformance/node/allowJs/index.cjs === -// ESM-format imports below should issue errors -import * as m1 from "./index.js"; ->m1 : typeof m1 - -import * as m2 from "./index.mjs"; ->m2 : typeof m2 - -import * as m3 from "./index.cjs"; ->m3 : typeof m3 - -import * as m4 from "./subfolder/index.js"; ->m4 : typeof m4 - -import * as m5 from "./subfolder/index.mjs"; ->m5 : typeof m5 - -import * as m6 from "./subfolder/index.cjs"; ->m6 : typeof m6 - -import * as m7 from "./subfolder2/index.js"; ->m7 : typeof m7 - -import * as m8 from "./subfolder2/index.mjs"; ->m8 : typeof m8 - -import * as m9 from "./subfolder2/index.cjs"; ->m9 : typeof m9 - -import * as m10 from "./subfolder2/another/index.js"; ->m10 : typeof m10 - -import * as m11 from "./subfolder2/another/index.mjs"; ->m11 : typeof m11 - -import * as m12 from "./subfolder2/another/index.cjs"; ->m12 : typeof m12 - -// The next ones should _mostly_ work - cjs format files have index resolution and extension resolution (except for those which resolve to an esm format file) -import * as m13 from "./"; ->m13 : typeof m1 - -import * as m14 from "./index"; ->m14 : typeof m1 - -import * as m15 from "./subfolder"; ->m15 : typeof m4 - -import * as m16 from "./subfolder/"; ->m16 : typeof m4 - -import * as m17 from "./subfolder/index"; ->m17 : typeof m4 - -import * as m18 from "./subfolder2"; ->m18 : typeof m7 - -import * as m19 from "./subfolder2/"; ->m19 : typeof m7 - -import * as m20 from "./subfolder2/index"; ->m20 : typeof m7 - -import * as m21 from "./subfolder2/another"; ->m21 : typeof m10 - -import * as m22 from "./subfolder2/another/"; ->m22 : typeof m10 - -import * as m23 from "./subfolder2/another/index"; ->m23 : typeof m10 - -void m1; ->void m1 : undefined ->m1 : typeof m1 - -void m2; ->void m2 : undefined ->m2 : typeof m2 - -void m3; ->void m3 : undefined ->m3 : typeof m3 - -void m4; ->void m4 : undefined ->m4 : typeof m4 - -void m5; ->void m5 : undefined ->m5 : typeof m5 - -void m6; ->void m6 : undefined ->m6 : typeof m6 - -void m7; ->void m7 : undefined ->m7 : typeof m7 - -void m8; ->void m8 : undefined ->m8 : typeof m8 - -void m9; ->void m9 : undefined ->m9 : typeof m9 - -void m10; ->void m10 : undefined ->m10 : typeof m10 - -void m11; ->void m11 : undefined ->m11 : typeof m11 - -void m12; ->void m12 : undefined ->m12 : typeof m12 - -void m13; ->void m13 : undefined ->m13 : typeof m1 - -void m14; ->void m14 : undefined ->m14 : typeof m1 - -void m15; ->void m15 : undefined ->m15 : typeof m4 - -void m16; ->void m16 : undefined ->m16 : typeof m4 - -void m17; ->void m17 : undefined ->m17 : typeof m4 - -void m18; ->void m18 : undefined ->m18 : typeof m7 - -void m19; ->void m19 : undefined ->m19 : typeof m7 - -void m20; ->void m20 : undefined ->m20 : typeof m7 - -void m21; ->void m21 : undefined ->m21 : typeof m10 - -void m22; ->void m22 : undefined ->m22 : typeof m10 - -void m23; ->void m23 : undefined ->m23 : typeof m10 - -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -import m24 = require("./"); ->m24 : typeof m1 - -import m25 = require("./index"); ->m25 : typeof m1 - -import m26 = require("./subfolder"); ->m26 : typeof m4 - -import m27 = require("./subfolder/"); ->m27 : typeof m4 - -import m28 = require("./subfolder/index"); ->m28 : typeof m4 - -import m29 = require("./subfolder2"); ->m29 : typeof m7 - -import m30 = require("./subfolder2/"); ->m30 : typeof m7 - -import m31 = require("./subfolder2/index"); ->m31 : typeof m7 - -import m32 = require("./subfolder2/another"); ->m32 : typeof m10 - -import m33 = require("./subfolder2/another/"); ->m33 : typeof m10 - -import m34 = require("./subfolder2/another/index"); ->m34 : typeof m10 - -void m24; ->void m24 : undefined ->m24 : typeof m1 - -void m25; ->void m25 : undefined ->m25 : typeof m1 - -void m26; ->void m26 : undefined ->m26 : typeof m4 - -void m27; ->void m27 : undefined ->m27 : typeof m4 - -void m28; ->void m28 : undefined ->m28 : typeof m4 - -void m29; ->void m29 : undefined ->m29 : typeof m7 - -void m30; ->void m30 : undefined ->m30 : typeof m7 - -void m31; ->void m31 : undefined ->m31 : typeof m7 - -void m32; ->void m32 : undefined ->m32 : typeof m10 - -void m33; ->void m33 : undefined ->m33 : typeof m10 - -void m34; ->void m34 : undefined ->m34 : typeof m10 - -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); ->_m35 : Promise ->import("./") : Promise ->"./" : "./" - -const _m36 = import("./index"); ->_m36 : Promise ->import("./index") : Promise ->"./index" : "./index" - -const _m37 = import("./subfolder"); ->_m37 : Promise ->import("./subfolder") : Promise ->"./subfolder" : "./subfolder" - -const _m38 = import("./subfolder/"); ->_m38 : Promise ->import("./subfolder/") : Promise ->"./subfolder/" : "./subfolder/" - -const _m39 = import("./subfolder/index"); ->_m39 : Promise ->import("./subfolder/index") : Promise ->"./subfolder/index" : "./subfolder/index" - -const _m40 = import("./subfolder2"); ->_m40 : Promise ->import("./subfolder2") : Promise ->"./subfolder2" : "./subfolder2" - -const _m41 = import("./subfolder2/"); ->_m41 : Promise ->import("./subfolder2/") : Promise ->"./subfolder2/" : "./subfolder2/" - -const _m42 = import("./subfolder2/index"); ->_m42 : Promise ->import("./subfolder2/index") : Promise ->"./subfolder2/index" : "./subfolder2/index" - -const _m43 = import("./subfolder2/another"); ->_m43 : Promise ->import("./subfolder2/another") : Promise ->"./subfolder2/another" : "./subfolder2/another" - -const _m44 = import("./subfolder2/another/"); ->_m44 : Promise ->import("./subfolder2/another/") : Promise ->"./subfolder2/another/" : "./subfolder2/another/" - -const _m45 = import("./subfolder2/another/index"); ->_m45 : Promise ->import("./subfolder2/another/index") : Promise ->"./subfolder2/another/index" : "./subfolder2/another/index" - -// cjs format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - -=== tests/cases/conformance/node/allowJs/index.mjs === -import * as m1 from "./index.js"; ->m1 : typeof m1 - -import * as m2 from "./index.mjs"; ->m2 : typeof m2 - -import * as m3 from "./index.cjs"; ->m3 : typeof m3 - -import * as m4 from "./subfolder/index.js"; ->m4 : typeof m4 - -import * as m5 from "./subfolder/index.mjs"; ->m5 : typeof m5 - -import * as m6 from "./subfolder/index.cjs"; ->m6 : typeof m6 - -import * as m7 from "./subfolder2/index.js"; ->m7 : typeof m7 - -import * as m8 from "./subfolder2/index.mjs"; ->m8 : typeof m8 - -import * as m9 from "./subfolder2/index.cjs"; ->m9 : typeof m9 - -import * as m10 from "./subfolder2/another/index.js"; ->m10 : typeof m10 - -import * as m11 from "./subfolder2/another/index.mjs"; ->m11 : typeof m11 - -import * as m12 from "./subfolder2/another/index.cjs"; ->m12 : typeof m12 - -// The next ones should all fail - esm format files have no index resolution or extension resolution -import * as m13 from "./"; ->m13 : any - -import * as m14 from "./index"; ->m14 : any - -import * as m15 from "./subfolder"; ->m15 : any - -import * as m16 from "./subfolder/"; ->m16 : any - -import * as m17 from "./subfolder/index"; ->m17 : any - -import * as m18 from "./subfolder2"; ->m18 : any - -import * as m19 from "./subfolder2/"; ->m19 : any - -import * as m20 from "./subfolder2/index"; ->m20 : any - -import * as m21 from "./subfolder2/another"; ->m21 : any - -import * as m22 from "./subfolder2/another/"; ->m22 : any - -import * as m23 from "./subfolder2/another/index"; ->m23 : any - -void m1; ->void m1 : undefined ->m1 : typeof m1 - -void m2; ->void m2 : undefined ->m2 : typeof m2 - -void m3; ->void m3 : undefined ->m3 : typeof m3 - -void m4; ->void m4 : undefined ->m4 : typeof m4 - -void m5; ->void m5 : undefined ->m5 : typeof m5 - -void m6; ->void m6 : undefined ->m6 : typeof m6 - -void m7; ->void m7 : undefined ->m7 : typeof m7 - -void m8; ->void m8 : undefined ->m8 : typeof m8 - -void m9; ->void m9 : undefined ->m9 : typeof m9 - -void m10; ->void m10 : undefined ->m10 : typeof m10 - -void m11; ->void m11 : undefined ->m11 : typeof m11 - -void m12; ->void m12 : undefined ->m12 : typeof m12 - -void m13; ->void m13 : undefined ->m13 : any - -void m14; ->void m14 : undefined ->m14 : any - -void m15; ->void m15 : undefined ->m15 : any - -void m16; ->void m16 : undefined ->m16 : any - -void m17; ->void m17 : undefined ->m17 : any - -void m18; ->void m18 : undefined ->m18 : any - -void m19; ->void m19 : undefined ->m19 : any - -void m20; ->void m20 : undefined ->m20 : any - -void m21; ->void m21 : undefined ->m21 : any - -void m22; ->void m22 : undefined ->m22 : any - -void m23; ->void m23 : undefined ->m23 : any - -// These should _mostly_ work - `import = require` always desugars to require calls, which do have extension and index resolution (but can't load anything that resolves to esm!) -import m24 = require("./"); ->m24 : typeof m1 - -import m25 = require("./index"); ->m25 : typeof m1 - -import m26 = require("./subfolder"); ->m26 : typeof m26 - -import m27 = require("./subfolder/"); ->m27 : typeof m26 - -import m28 = require("./subfolder/index"); ->m28 : typeof m26 - -import m29 = require("./subfolder2"); ->m29 : typeof m29 - -import m30 = require("./subfolder2/"); ->m30 : typeof m29 - -import m31 = require("./subfolder2/index"); ->m31 : typeof m29 - -import m32 = require("./subfolder2/another"); ->m32 : typeof m10 - -import m33 = require("./subfolder2/another/"); ->m33 : typeof m10 - -import m34 = require("./subfolder2/another/index"); ->m34 : typeof m10 - -void m24; ->void m24 : undefined ->m24 : typeof m1 - -void m25; ->void m25 : undefined ->m25 : typeof m1 - -void m26; ->void m26 : undefined ->m26 : typeof m26 - -void m27; ->void m27 : undefined ->m27 : typeof m26 - -void m28; ->void m28 : undefined ->m28 : typeof m26 - -void m29; ->void m29 : undefined ->m29 : typeof m29 - -void m30; ->void m30 : undefined ->m30 : typeof m29 - -void m31; ->void m31 : undefined ->m31 : typeof m29 - -void m32; ->void m32 : undefined ->m32 : typeof m10 - -void m33; ->void m33 : undefined ->m33 : typeof m10 - -void m34; ->void m34 : undefined ->m34 : typeof m10 - -// These shouldn't work - dynamic `import()` always uses the esm resolver, which does not have extension resolution -const _m35 = import("./"); ->_m35 : Promise ->import("./") : Promise ->"./" : "./" - -const _m36 = import("./index"); ->_m36 : Promise ->import("./index") : Promise ->"./index" : "./index" - -const _m37 = import("./subfolder"); ->_m37 : Promise ->import("./subfolder") : Promise ->"./subfolder" : "./subfolder" - -const _m38 = import("./subfolder/"); ->_m38 : Promise ->import("./subfolder/") : Promise ->"./subfolder/" : "./subfolder/" - -const _m39 = import("./subfolder/index"); ->_m39 : Promise ->import("./subfolder/index") : Promise ->"./subfolder/index" : "./subfolder/index" - -const _m40 = import("./subfolder2"); ->_m40 : Promise ->import("./subfolder2") : Promise ->"./subfolder2" : "./subfolder2" - -const _m41 = import("./subfolder2/"); ->_m41 : Promise ->import("./subfolder2/") : Promise ->"./subfolder2/" : "./subfolder2/" - -const _m42 = import("./subfolder2/index"); ->_m42 : Promise ->import("./subfolder2/index") : Promise ->"./subfolder2/index" : "./subfolder2/index" - -const _m43 = import("./subfolder2/another"); ->_m43 : Promise ->import("./subfolder2/another") : Promise ->"./subfolder2/another" : "./subfolder2/another" - -const _m44 = import("./subfolder2/another/"); ->_m44 : Promise ->import("./subfolder2/another/") : Promise ->"./subfolder2/another/" : "./subfolder2/another/" - -const _m45 = import("./subfolder2/another/index"); ->_m45 : Promise ->import("./subfolder2/another/index") : Promise ->"./subfolder2/another/index" : "./subfolder2/another/index" - -// esm format file -const x = 1; ->x : 1 ->1 : 1 - -export {x}; ->x : 1 - diff --git a/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node12).symbols b/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node12).symbols deleted file mode 100644 index 8ec82fe7e05..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node12).symbols +++ /dev/null @@ -1,15 +0,0 @@ -=== tests/cases/conformance/node/allowJs/foo.cjs === -exports.foo = "foo" ->exports.foo : Symbol(foo, Decl(foo.cjs, 0, 0)) ->exports : Symbol(foo, Decl(foo.cjs, 0, 0)) ->foo : Symbol(foo, Decl(foo.cjs, 0, 0)) - -=== tests/cases/conformance/node/allowJs/bar.ts === -import foo from "./foo.cjs" ->foo : Symbol(foo, Decl(bar.ts, 0, 6)) - -foo.foo; ->foo.foo : Symbol(foo.foo, Decl(foo.cjs, 0, 0)) ->foo : Symbol(foo, Decl(bar.ts, 0, 6)) ->foo : Symbol(foo.foo, Decl(foo.cjs, 0, 0)) - diff --git a/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node12).types b/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node12).types deleted file mode 100644 index 7559910259c..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsCjsFromJs(module=node12).types +++ /dev/null @@ -1,17 +0,0 @@ -=== tests/cases/conformance/node/allowJs/foo.cjs === -exports.foo = "foo" ->exports.foo = "foo" : "foo" ->exports.foo : "foo" ->exports : typeof import("tests/cases/conformance/node/allowJs/foo") ->foo : "foo" ->"foo" : "foo" - -=== tests/cases/conformance/node/allowJs/bar.ts === -import foo from "./foo.cjs" ->foo : typeof foo - -foo.foo; ->foo.foo : "foo" ->foo : typeof foo ->foo : "foo" - diff --git a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node12).errors.txt deleted file mode 100644 index 83e50c001e7..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node12).errors.txt +++ /dev/null @@ -1,135 +0,0 @@ -tests/cases/conformance/node/allowJs/index.cjs(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.cjs(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts(2,13): error TS2303: Circular definition of import alias 'cjs'. -tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. - - -==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== - // esm format file - import * as cjs from "package/cjs"; - import * as mjs from "package/mjs"; - import * as type from "package"; - cjs; - mjs; - type; - import * as cjsi from "inner/a"; - import * as mjsi from "inner/b"; - import * as typei from "inner"; - import * as ts from "inner/types"; - cjsi.mjsSource; - mjsi.mjsSource; - typei.mjsSource; - ts.mjsSource; -==== tests/cases/conformance/node/allowJs/index.mjs (0 errors) ==== - // esm format file - import * as cjs from "package/cjs"; - import * as mjs from "package/mjs"; - import * as type from "package"; - cjs; - mjs; - type; - import * as cjsi from "inner/a"; - import * as mjsi from "inner/b"; - import * as typei from "inner"; - import * as ts from "inner/types"; - cjsi.mjsSource; - mjsi.mjsSource; - typei.mjsSource; - ts.mjsSource; -==== tests/cases/conformance/node/allowJs/index.cjs (2 errors) ==== - // cjs format file - import * as cjs from "package/cjs"; - import * as mjs from "package/mjs"; - ~~~~~~~~~~~~~ -!!! error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as type from "package"; - ~~~~~~~~~ -!!! error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - cjs; - mjs; - type; - import * as cjsi from "inner/a"; - import * as mjsi from "inner/b"; - import * as typei from "inner"; - import * as ts from "inner/types"; - cjsi.cjsSource; - mjsi.cjsSource; - typei.implicitCjsSource; - ts.cjsSource; -==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts (1 errors) ==== - // cjs format file - import * as cjs from "inner/a"; - ~~~ -!!! error TS2303: Circular definition of import alias 'cjs'. - import * as mjs from "inner/b"; - import * as type from "inner"; - import * as ts from "inner/types"; - export { cjs }; - export { mjs }; - export { type }; - export { ts }; - export const implicitCjsSource = true; -==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts (1 errors) ==== - // esm format file - import * as cjs from "inner/a"; - ~~~ -!!! error TS2303: Circular definition of import alias 'cjs'. - import * as mjs from "inner/b"; - import * as type from "inner"; - import * as ts from "inner/types"; - export { cjs }; - export { mjs }; - export { type }; - export { ts }; - export const mjsSource = true; -==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts (0 errors) ==== - // cjs format file - import * as cjs from "inner/a"; - import * as mjs from "inner/b"; - import * as type from "inner"; - import * as ts from "inner/types"; - export { cjs }; - export { mjs }; - export { type }; - export { ts }; - export const cjsSource = true; -==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module", - "exports": { - "./cjs": "./index.cjs", - "./mjs": "./index.mjs", - ".": "./index.js" - } - } -==== tests/cases/conformance/node/allowJs/node_modules/inner/package.json (0 errors) ==== - { - "name": "inner", - "private": true, - "exports": { - "./a": { - "require": "./index.cjs", - "node": "./index.mjs" - }, - "./b": { - "import": "./index.mjs", - "node": "./index.cjs" - }, - ".": { - "import": "./index.mjs", - "node": "./index.js" - }, - "./types": { - "types": { - "import": "./index.d.mts", - "require": "./index.d.cts", - }, - "node": { - "import": "./index.mjs", - "require": "./index.cjs" - } - } - } - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node12).js b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node12).js deleted file mode 100644 index bd0f2a77807..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node12).js +++ /dev/null @@ -1,205 +0,0 @@ -//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsConditionalPackageExports.ts] //// - -//// [index.js] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/a"; -import * as mjsi from "inner/b"; -import * as typei from "inner"; -import * as ts from "inner/types"; -cjsi.mjsSource; -mjsi.mjsSource; -typei.mjsSource; -ts.mjsSource; -//// [index.mjs] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/a"; -import * as mjsi from "inner/b"; -import * as typei from "inner"; -import * as ts from "inner/types"; -cjsi.mjsSource; -mjsi.mjsSource; -typei.mjsSource; -ts.mjsSource; -//// [index.cjs] -// cjs format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/a"; -import * as mjsi from "inner/b"; -import * as typei from "inner"; -import * as ts from "inner/types"; -cjsi.cjsSource; -mjsi.cjsSource; -typei.implicitCjsSource; -ts.cjsSource; -//// [index.d.ts] -// cjs format file -import * as cjs from "inner/a"; -import * as mjs from "inner/b"; -import * as type from "inner"; -import * as ts from "inner/types"; -export { cjs }; -export { mjs }; -export { type }; -export { ts }; -export const implicitCjsSource = true; -//// [index.d.mts] -// esm format file -import * as cjs from "inner/a"; -import * as mjs from "inner/b"; -import * as type from "inner"; -import * as ts from "inner/types"; -export { cjs }; -export { mjs }; -export { type }; -export { ts }; -export const mjsSource = true; -//// [index.d.cts] -// cjs format file -import * as cjs from "inner/a"; -import * as mjs from "inner/b"; -import * as type from "inner"; -import * as ts from "inner/types"; -export { cjs }; -export { mjs }; -export { type }; -export { ts }; -export const cjsSource = true; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module", - "exports": { - "./cjs": "./index.cjs", - "./mjs": "./index.mjs", - ".": "./index.js" - } -} -//// [package.json] -{ - "name": "inner", - "private": true, - "exports": { - "./a": { - "require": "./index.cjs", - "node": "./index.mjs" - }, - "./b": { - "import": "./index.mjs", - "node": "./index.cjs" - }, - ".": { - "import": "./index.mjs", - "node": "./index.js" - }, - "./types": { - "types": { - "import": "./index.d.mts", - "require": "./index.d.cts", - }, - "node": { - "import": "./index.mjs", - "require": "./index.cjs" - } - } - } -} - -//// [index.js] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/a"; -import * as mjsi from "inner/b"; -import * as typei from "inner"; -import * as ts from "inner/types"; -cjsi.mjsSource; -mjsi.mjsSource; -typei.mjsSource; -ts.mjsSource; -//// [index.mjs] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/a"; -import * as mjsi from "inner/b"; -import * as typei from "inner"; -import * as ts from "inner/types"; -cjsi.mjsSource; -mjsi.mjsSource; -typei.mjsSource; -ts.mjsSource; -//// [index.cjs] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// cjs format file -const cjs = __importStar(require("package/cjs")); -const mjs = __importStar(require("package/mjs")); -const type = __importStar(require("package")); -cjs; -mjs; -type; -const cjsi = __importStar(require("inner/a")); -const mjsi = __importStar(require("inner/b")); -const typei = __importStar(require("inner")); -const ts = __importStar(require("inner/types")); -cjsi.cjsSource; -mjsi.cjsSource; -typei.implicitCjsSource; -ts.cjsSource; - - -//// [index.d.ts] -export {}; -//// [index.d.mts] -export {}; -//// [index.d.cts] -export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node12).symbols b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node12).symbols deleted file mode 100644 index ce8944196c0..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node12).symbols +++ /dev/null @@ -1,243 +0,0 @@ -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -import * as cjs from "package/cjs"; ->cjs : Symbol(cjs, Decl(index.js, 1, 6)) - -import * as mjs from "package/mjs"; ->mjs : Symbol(mjs, Decl(index.js, 2, 6)) - -import * as type from "package"; ->type : Symbol(type, Decl(index.js, 3, 6)) - -cjs; ->cjs : Symbol(cjs, Decl(index.js, 1, 6)) - -mjs; ->mjs : Symbol(mjs, Decl(index.js, 2, 6)) - -type; ->type : Symbol(type, Decl(index.js, 3, 6)) - -import * as cjsi from "inner/a"; ->cjsi : Symbol(cjsi, Decl(index.js, 7, 6)) - -import * as mjsi from "inner/b"; ->mjsi : Symbol(mjsi, Decl(index.js, 8, 6)) - -import * as typei from "inner"; ->typei : Symbol(typei, Decl(index.js, 9, 6)) - -import * as ts from "inner/types"; ->ts : Symbol(ts, Decl(index.js, 10, 6)) - -cjsi.mjsSource; ->cjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) ->cjsi : Symbol(cjsi, Decl(index.js, 7, 6)) ->mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) - -mjsi.mjsSource; ->mjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) ->mjsi : Symbol(mjsi, Decl(index.js, 8, 6)) ->mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) - -typei.mjsSource; ->typei.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) ->typei : Symbol(typei, Decl(index.js, 9, 6)) ->mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) - -ts.mjsSource; ->ts.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) ->ts : Symbol(ts, Decl(index.js, 10, 6)) ->mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) - -=== tests/cases/conformance/node/allowJs/index.mjs === -// esm format file -import * as cjs from "package/cjs"; ->cjs : Symbol(cjs, Decl(index.mjs, 1, 6)) - -import * as mjs from "package/mjs"; ->mjs : Symbol(mjs, Decl(index.mjs, 2, 6)) - -import * as type from "package"; ->type : Symbol(type, Decl(index.mjs, 3, 6)) - -cjs; ->cjs : Symbol(cjs, Decl(index.mjs, 1, 6)) - -mjs; ->mjs : Symbol(mjs, Decl(index.mjs, 2, 6)) - -type; ->type : Symbol(type, Decl(index.mjs, 3, 6)) - -import * as cjsi from "inner/a"; ->cjsi : Symbol(cjsi, Decl(index.mjs, 7, 6)) - -import * as mjsi from "inner/b"; ->mjsi : Symbol(mjsi, Decl(index.mjs, 8, 6)) - -import * as typei from "inner"; ->typei : Symbol(typei, Decl(index.mjs, 9, 6)) - -import * as ts from "inner/types"; ->ts : Symbol(ts, Decl(index.mjs, 10, 6)) - -cjsi.mjsSource; ->cjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) ->cjsi : Symbol(cjsi, Decl(index.mjs, 7, 6)) ->mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) - -mjsi.mjsSource; ->mjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) ->mjsi : Symbol(mjsi, Decl(index.mjs, 8, 6)) ->mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) - -typei.mjsSource; ->typei.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) ->typei : Symbol(typei, Decl(index.mjs, 9, 6)) ->mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) - -ts.mjsSource; ->ts.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) ->ts : Symbol(ts, Decl(index.mjs, 10, 6)) ->mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) - -=== tests/cases/conformance/node/allowJs/index.cjs === -// cjs format file -import * as cjs from "package/cjs"; ->cjs : Symbol(cjs, Decl(index.cjs, 1, 6)) - -import * as mjs from "package/mjs"; ->mjs : Symbol(mjs, Decl(index.cjs, 2, 6)) - -import * as type from "package"; ->type : Symbol(type, Decl(index.cjs, 3, 6)) - -cjs; ->cjs : Symbol(cjs, Decl(index.cjs, 1, 6)) - -mjs; ->mjs : Symbol(mjs, Decl(index.cjs, 2, 6)) - -type; ->type : Symbol(type, Decl(index.cjs, 3, 6)) - -import * as cjsi from "inner/a"; ->cjsi : Symbol(cjsi, Decl(index.cjs, 7, 6)) - -import * as mjsi from "inner/b"; ->mjsi : Symbol(mjsi, Decl(index.cjs, 8, 6)) - -import * as typei from "inner"; ->typei : Symbol(typei, Decl(index.cjs, 9, 6)) - -import * as ts from "inner/types"; ->ts : Symbol(ts, Decl(index.cjs, 10, 6)) - -cjsi.cjsSource; ->cjsi.cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) ->cjsi : Symbol(cjsi, Decl(index.cjs, 7, 6)) ->cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) - -mjsi.cjsSource; ->mjsi.cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) ->mjsi : Symbol(mjsi, Decl(index.cjs, 8, 6)) ->cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) - -typei.implicitCjsSource; ->typei.implicitCjsSource : Symbol(cjsi.type.implicitCjsSource, Decl(index.d.ts, 9, 12)) ->typei : Symbol(typei, Decl(index.cjs, 9, 6)) ->implicitCjsSource : Symbol(cjsi.type.implicitCjsSource, Decl(index.d.ts, 9, 12)) - -ts.cjsSource; ->ts.cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) ->ts : Symbol(ts, Decl(index.cjs, 10, 6)) ->cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts === -// cjs format file -import * as cjs from "inner/a"; ->cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) - -import * as mjs from "inner/b"; ->mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) - -import * as type from "inner"; ->type : Symbol(type, Decl(index.d.ts, 3, 6)) - -import * as ts from "inner/types"; ->ts : Symbol(ts, Decl(index.d.ts, 4, 6)) - -export { cjs }; ->cjs : Symbol(mjs.type.cjs, Decl(index.d.ts, 5, 8)) - -export { mjs }; ->mjs : Symbol(mjs.type.mjs, Decl(index.d.ts, 6, 8)) - -export { type }; ->type : Symbol(mjs.type.type, Decl(index.d.ts, 7, 8)) - -export { ts }; ->ts : Symbol(mjs.type.ts, Decl(index.d.ts, 8, 8)) - -export const implicitCjsSource = true; ->implicitCjsSource : Symbol(mjs.type.implicitCjsSource, Decl(index.d.ts, 9, 12)) - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts === -// esm format file -import * as cjs from "inner/a"; ->cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) - -import * as mjs from "inner/b"; ->mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) - -import * as type from "inner"; ->type : Symbol(type, Decl(index.d.mts, 3, 6)) - -import * as ts from "inner/types"; ->ts : Symbol(ts, Decl(index.d.mts, 4, 6)) - -export { cjs }; ->cjs : Symbol(mjs.cjs, Decl(index.d.mts, 5, 8)) - -export { mjs }; ->mjs : Symbol(mjs.mjs, Decl(index.d.mts, 6, 8)) - -export { type }; ->type : Symbol(mjs.type, Decl(index.d.mts, 7, 8)) - -export { ts }; ->ts : Symbol(mjs.ts, Decl(index.d.mts, 8, 8)) - -export const mjsSource = true; ->mjsSource : Symbol(mjs.mjsSource, Decl(index.d.mts, 9, 12)) - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts === -// cjs format file -import * as cjs from "inner/a"; ->cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) - -import * as mjs from "inner/b"; ->mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) - -import * as type from "inner"; ->type : Symbol(type, Decl(index.d.cts, 3, 6)) - -import * as ts from "inner/types"; ->ts : Symbol(ts, Decl(index.d.cts, 4, 6)) - -export { cjs }; ->cjs : Symbol(cjs.cjs, Decl(index.d.cts, 5, 8)) - -export { mjs }; ->mjs : Symbol(cjs.mjs, Decl(index.d.cts, 6, 8)) - -export { type }; ->type : Symbol(cjs.type, Decl(index.d.cts, 7, 8)) - -export { ts }; ->ts : Symbol(cjs.ts, Decl(index.d.cts, 8, 8)) - -export const cjsSource = true; ->cjsSource : Symbol(cjs.cjsSource, Decl(index.d.cts, 9, 12)) - diff --git a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node12).types b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node12).types deleted file mode 100644 index 7b1fe309bb0..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node12).types +++ /dev/null @@ -1,246 +0,0 @@ -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -import * as cjs from "package/cjs"; ->cjs : typeof cjs - -import * as mjs from "package/mjs"; ->mjs : typeof mjs - -import * as type from "package"; ->type : typeof type - -cjs; ->cjs : typeof cjs - -mjs; ->mjs : typeof mjs - -type; ->type : typeof type - -import * as cjsi from "inner/a"; ->cjsi : typeof cjsi - -import * as mjsi from "inner/b"; ->mjsi : typeof cjsi - -import * as typei from "inner"; ->typei : typeof cjsi - -import * as ts from "inner/types"; ->ts : typeof cjsi - -cjsi.mjsSource; ->cjsi.mjsSource : true ->cjsi : typeof cjsi ->mjsSource : true - -mjsi.mjsSource; ->mjsi.mjsSource : true ->mjsi : typeof cjsi ->mjsSource : true - -typei.mjsSource; ->typei.mjsSource : true ->typei : typeof cjsi ->mjsSource : true - -ts.mjsSource; ->ts.mjsSource : true ->ts : typeof cjsi ->mjsSource : true - -=== tests/cases/conformance/node/allowJs/index.mjs === -// esm format file -import * as cjs from "package/cjs"; ->cjs : typeof cjs - -import * as mjs from "package/mjs"; ->mjs : typeof mjs - -import * as type from "package"; ->type : typeof type - -cjs; ->cjs : typeof cjs - -mjs; ->mjs : typeof mjs - -type; ->type : typeof type - -import * as cjsi from "inner/a"; ->cjsi : typeof cjsi - -import * as mjsi from "inner/b"; ->mjsi : typeof cjsi - -import * as typei from "inner"; ->typei : typeof cjsi - -import * as ts from "inner/types"; ->ts : typeof cjsi - -cjsi.mjsSource; ->cjsi.mjsSource : true ->cjsi : typeof cjsi ->mjsSource : true - -mjsi.mjsSource; ->mjsi.mjsSource : true ->mjsi : typeof cjsi ->mjsSource : true - -typei.mjsSource; ->typei.mjsSource : true ->typei : typeof cjsi ->mjsSource : true - -ts.mjsSource; ->ts.mjsSource : true ->ts : typeof cjsi ->mjsSource : true - -=== tests/cases/conformance/node/allowJs/index.cjs === -// cjs format file -import * as cjs from "package/cjs"; ->cjs : typeof cjs - -import * as mjs from "package/mjs"; ->mjs : typeof mjs - -import * as type from "package"; ->type : typeof type - -cjs; ->cjs : typeof cjs - -mjs; ->mjs : typeof mjs - -type; ->type : typeof type - -import * as cjsi from "inner/a"; ->cjsi : typeof cjsi - -import * as mjsi from "inner/b"; ->mjsi : typeof cjsi - -import * as typei from "inner"; ->typei : typeof cjsi.type - -import * as ts from "inner/types"; ->ts : typeof cjsi - -cjsi.cjsSource; ->cjsi.cjsSource : true ->cjsi : typeof cjsi ->cjsSource : true - -mjsi.cjsSource; ->mjsi.cjsSource : true ->mjsi : typeof cjsi ->cjsSource : true - -typei.implicitCjsSource; ->typei.implicitCjsSource : true ->typei : typeof cjsi.type ->implicitCjsSource : true - -ts.cjsSource; ->ts.cjsSource : true ->ts : typeof cjsi ->cjsSource : true - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts === -// cjs format file -import * as cjs from "inner/a"; ->cjs : any - -import * as mjs from "inner/b"; ->mjs : typeof mjs - -import * as type from "inner"; ->type : typeof mjs.type - -import * as ts from "inner/types"; ->ts : typeof mjs - -export { cjs }; ->cjs : any - -export { mjs }; ->mjs : typeof mjs - -export { type }; ->type : typeof mjs.type - -export { ts }; ->ts : typeof mjs - -export const implicitCjsSource = true; ->implicitCjsSource : true ->true : true - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts === -// esm format file -import * as cjs from "inner/a"; ->cjs : any - -import * as mjs from "inner/b"; ->mjs : typeof mjs - -import * as type from "inner"; ->type : typeof mjs - -import * as ts from "inner/types"; ->ts : typeof mjs - -export { cjs }; ->cjs : any - -export { mjs }; ->mjs : typeof mjs - -export { type }; ->type : typeof mjs - -export { ts }; ->ts : typeof mjs - -export const mjsSource = true; ->mjsSource : true ->true : true - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts === -// cjs format file -import * as cjs from "inner/a"; ->cjs : typeof cjs - -import * as mjs from "inner/b"; ->mjs : typeof cjs - -import * as type from "inner"; ->type : typeof cjs.type - -import * as ts from "inner/types"; ->ts : typeof cjs - -export { cjs }; ->cjs : typeof cjs - -export { mjs }; ->mjs : typeof cjs - -export { type }; ->type : typeof cjs.type - -export { ts }; ->ts : typeof cjs - -export const cjsSource = true; ->cjsSource : true ->true : true - diff --git a/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node12).js b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node12).js deleted file mode 100644 index 471912e1192..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node12).js +++ /dev/null @@ -1,45 +0,0 @@ -//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsDynamicImport.ts] //// - -//// [index.js] -// cjs format file -export async function main() { - const { readFile } = await import("fs"); -} -//// [index.js] -// esm format file -export async function main() { - const { readFile } = await import("fs"); -} -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} -//// [types.d.ts] -declare module "fs"; - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.main = void 0; -// cjs format file -async function main() { - const { readFile } = await import("fs"); -} -exports.main = main; -//// [index.js] -// esm format file -export async function main() { - const { readFile } = await import("fs"); -} - - -//// [index.d.ts] -export function main(): Promise; -//// [index.d.ts] -export function main(): Promise; diff --git a/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node12).symbols b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node12).symbols deleted file mode 100644 index 0b0c85a01f1..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node12).symbols +++ /dev/null @@ -1,22 +0,0 @@ -=== tests/cases/conformance/node/allowJs/subfolder/index.js === -// cjs format file -export async function main() { ->main : Symbol(main, Decl(index.js, 0, 0)) - - const { readFile } = await import("fs"); ->readFile : Symbol(readFile, Decl(index.js, 2, 11)) ->"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) -} -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -export async function main() { ->main : Symbol(main, Decl(index.js, 0, 0)) - - const { readFile } = await import("fs"); ->readFile : Symbol(readFile, Decl(index.js, 2, 11)) ->"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) -} -=== tests/cases/conformance/node/allowJs/types.d.ts === -declare module "fs"; ->"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) - diff --git a/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node12).types b/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node12).types deleted file mode 100644 index 650fcf3a637..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsDynamicImport(module=node12).types +++ /dev/null @@ -1,26 +0,0 @@ -=== tests/cases/conformance/node/allowJs/subfolder/index.js === -// cjs format file -export async function main() { ->main : () => Promise - - const { readFile } = await import("fs"); ->readFile : any ->await import("fs") : any ->import("fs") : Promise ->"fs" : "fs" -} -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -export async function main() { ->main : () => Promise - - const { readFile } = await import("fs"); ->readFile : any ->await import("fs") : any ->import("fs") : Promise ->"fs" : "fs" -} -=== tests/cases/conformance/node/allowJs/types.d.ts === -declare module "fs"; ->"fs" : any - diff --git a/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node12).errors.txt deleted file mode 100644 index a0a3d489f44..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node12).errors.txt +++ /dev/null @@ -1,41 +0,0 @@ -tests/cases/conformance/node/allowJs/file.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -tests/cases/conformance/node/allowJs/index.js(3,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. -tests/cases/conformance/node/allowJs/index.js(3,1): error TS8003: 'export =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/subfolder/index.js(3,1): error TS8003: 'export =' can only be used in TypeScript files. - - -==== tests/cases/conformance/node/allowJs/subfolder/index.js (1 errors) ==== - // cjs format file - const a = {}; - export = a; - ~~~~~~~~~~~ -!!! error TS8003: 'export =' can only be used in TypeScript files. -==== tests/cases/conformance/node/allowJs/subfolder/file.js (0 errors) ==== - // cjs format file - const a = {}; - module.exports = a; -==== tests/cases/conformance/node/allowJs/index.js (2 errors) ==== - // esm format file - const a = {}; - export = a; - ~~~~~~~~~~~ -!!! error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. - ~~~~~~~~~~~ -!!! error TS8003: 'export =' can only be used in TypeScript files. -==== tests/cases/conformance/node/allowJs/file.js (1 errors) ==== - // esm format file - import "fs"; - const a = {}; - module.exports = a; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module" - } -==== tests/cases/conformance/node/allowJs/subfolder/package.json (0 errors) ==== - { - "type": "commonjs" - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node12).js b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node12).js deleted file mode 100644 index 10d6da622e9..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node12).js +++ /dev/null @@ -1,61 +0,0 @@ -//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsExportAssignment.ts] //// - -//// [index.js] -// cjs format file -const a = {}; -export = a; -//// [file.js] -// cjs format file -const a = {}; -module.exports = a; -//// [index.js] -// esm format file -const a = {}; -export = a; -//// [file.js] -// esm format file -import "fs"; -const a = {}; -module.exports = a; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} - -//// [index.js] -"use strict"; -// cjs format file -const a = {}; -module.exports = a; -//// [file.js] -// cjs format file -const a = {}; -module.exports = a; -//// [index.js] -// esm format file -const a = {}; -export {}; -//// [file.js] -// esm format file -import "fs"; -const a = {}; -module.exports = a; - - -//// [index.d.ts] -export = a; -declare const a: {}; -//// [file.d.ts] -export = a; -declare const a: {}; -//// [index.d.ts] -export = a; -declare const a: {}; -//// [file.d.ts] -export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node12).symbols b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node12).symbols deleted file mode 100644 index 4e0e3aed1a9..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node12).symbols +++ /dev/null @@ -1,36 +0,0 @@ -=== tests/cases/conformance/node/allowJs/subfolder/index.js === -// cjs format file -const a = {}; ->a : Symbol(a, Decl(index.js, 1, 5)) - -export = a; ->a : Symbol(a, Decl(index.js, 1, 5)) - -=== tests/cases/conformance/node/allowJs/subfolder/file.js === -// cjs format file -const a = {}; ->a : Symbol(a, Decl(file.js, 1, 5)) - -module.exports = a; ->module.exports : Symbol(module.exports, Decl(file.js, 0, 0)) ->module : Symbol(export=, Decl(file.js, 1, 13)) ->exports : Symbol(export=, Decl(file.js, 1, 13)) ->a : Symbol(a, Decl(file.js, 1, 5)) - -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -const a = {}; ->a : Symbol(a, Decl(index.js, 1, 5)) - -export = a; ->a : Symbol(a, Decl(index.js, 1, 5)) - -=== tests/cases/conformance/node/allowJs/file.js === -// esm format file -import "fs"; -const a = {}; ->a : Symbol(a, Decl(file.js, 2, 5)) - -module.exports = a; ->a : Symbol(a, Decl(file.js, 2, 5)) - diff --git a/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node12).types b/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node12).types deleted file mode 100644 index e6543212f66..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsExportAssignment(module=node12).types +++ /dev/null @@ -1,45 +0,0 @@ -=== tests/cases/conformance/node/allowJs/subfolder/index.js === -// cjs format file -const a = {}; ->a : {} ->{} : {} - -export = a; ->a : {} - -=== tests/cases/conformance/node/allowJs/subfolder/file.js === -// cjs format file -const a = {}; ->a : {} ->{} : {} - -module.exports = a; ->module.exports = a : {} ->module.exports : {} ->module : { exports: {}; } ->exports : {} ->a : {} - -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -const a = {}; ->a : {} ->{} : {} - -export = a; ->a : {} - -=== tests/cases/conformance/node/allowJs/file.js === -// esm format file -import "fs"; -const a = {}; ->a : {} ->{} : {} - -module.exports = a; ->module.exports = a : any ->module.exports : any ->module : any ->exports : any ->a : {} - diff --git a/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node12).errors.txt deleted file mode 100644 index 84386984bc3..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node12).errors.txt +++ /dev/null @@ -1,38 +0,0 @@ -tests/cases/conformance/node/allowJs/subfolder/index.js(2,10): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. -tests/cases/conformance/node/allowJs/subfolder/index.js(3,7): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. -tests/cases/conformance/node/allowJs/subfolder/index.js(4,7): error TS2725: Class name cannot be 'Object' when targeting ES5 with module Node12. -tests/cases/conformance/node/allowJs/subfolder/index.js(5,14): error TS1216: Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules. - - -==== tests/cases/conformance/node/allowJs/subfolder/index.js (4 errors) ==== - // cjs format file - function require() {} - ~~~~~~~ -!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. - const exports = {}; - ~~~~~~~ -!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. - class Object {} - ~~~~~~ -!!! error TS2725: Class name cannot be 'Object' when targeting ES5 with module Node12. - export const __esModule = false; - ~~~~~~~~~~ -!!! error TS1216: Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules. - export {require, exports, Object}; -==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== - // esm format file - function require() {} - const exports = {}; - class Object {} - export const __esModule = false; - export {require, exports, Object}; -==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module" - } -==== tests/cases/conformance/node/allowJs/subfolder/package.json (0 errors) ==== - { - "type": "commonjs" - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node12).js b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node12).js deleted file mode 100644 index 3900870c747..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node12).js +++ /dev/null @@ -1,62 +0,0 @@ -//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsGeneratedNameCollisions.ts] //// - -//// [index.js] -// cjs format file -function require() {} -const exports = {}; -class Object {} -export const __esModule = false; -export {require, exports, Object}; -//// [index.js] -// esm format file -function require() {} -const exports = {}; -class Object {} -export const __esModule = false; -export {require, exports, Object}; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Object = exports.exports = exports.require = exports.__esModule = void 0; -// cjs format file -function require() { } -exports.require = require; -const exports = {}; -exports.exports = exports; -class Object { -} -exports.Object = Object; -exports.__esModule = false; -//// [index.js] -// esm format file -function require() { } -const exports = {}; -class Object { -} -export const __esModule = false; -export { require, exports, Object }; - - -//// [index.d.ts] -export const __esModule: false; -export function require(): void; -export const exports: {}; -export class Object { -} -//// [index.d.ts] -export const __esModule: false; -export function require(): void; -export const exports: {}; -export class Object { -} diff --git a/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node12).symbols b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node12).symbols deleted file mode 100644 index 8565d39212c..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node12).symbols +++ /dev/null @@ -1,38 +0,0 @@ -=== tests/cases/conformance/node/allowJs/subfolder/index.js === -// cjs format file -function require() {} ->require : Symbol(require, Decl(index.js, 0, 0)) - -const exports = {}; ->exports : Symbol(exports, Decl(index.js, 2, 5)) - -class Object {} ->Object : Symbol(Object, Decl(index.js, 2, 19)) - -export const __esModule = false; ->__esModule : Symbol(__esModule, Decl(index.js, 4, 12)) - -export {require, exports, Object}; ->require : Symbol(require, Decl(index.js, 5, 8)) ->exports : Symbol(exports, Decl(index.js, 5, 16)) ->Object : Symbol(Object, Decl(index.js, 5, 25)) - -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -function require() {} ->require : Symbol(require, Decl(index.js, 0, 0)) - -const exports = {}; ->exports : Symbol(exports, Decl(index.js, 2, 5)) - -class Object {} ->Object : Symbol(Object, Decl(index.js, 2, 19)) - -export const __esModule = false; ->__esModule : Symbol(__esModule, Decl(index.js, 4, 12)) - -export {require, exports, Object}; ->require : Symbol(require, Decl(index.js, 5, 8)) ->exports : Symbol(exports, Decl(index.js, 5, 16)) ->Object : Symbol(Object, Decl(index.js, 5, 25)) - diff --git a/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node12).types b/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node12).types deleted file mode 100644 index a290eb3ca58..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsGeneratedNameCollisions(module=node12).types +++ /dev/null @@ -1,42 +0,0 @@ -=== tests/cases/conformance/node/allowJs/subfolder/index.js === -// cjs format file -function require() {} ->require : () => void - -const exports = {}; ->exports : {} ->{} : {} - -class Object {} ->Object : Object - -export const __esModule = false; ->__esModule : false ->false : false - -export {require, exports, Object}; ->require : () => void ->exports : {} ->Object : typeof Object - -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -function require() {} ->require : () => void - -const exports = {}; ->exports : {} ->{} : {} - -class Object {} ->Object : Object - -export const __esModule = false; ->__esModule : false ->false : false - -export {require, exports, Object}; ->require : () => void ->exports : {} ->Object : typeof Object - diff --git a/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node12).errors.txt deleted file mode 100644 index bbc352d7a78..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node12).errors.txt +++ /dev/null @@ -1,49 +0,0 @@ -tests/cases/conformance/node/allowJs/file.js(4,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/file.js(6,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.js(2,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.js(4,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/subfolder/index.js(2,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/subfolder/index.js(4,1): error TS8002: 'import ... =' can only be used in TypeScript files. - - -==== tests/cases/conformance/node/allowJs/subfolder/index.js (2 errors) ==== - // cjs format file - import fs = require("fs"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - fs.readFile; - export import fs2 = require("fs"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. -==== tests/cases/conformance/node/allowJs/index.js (2 errors) ==== - // esm format file - import fs = require("fs"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - fs.readFile; - export import fs2 = require("fs"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. -==== tests/cases/conformance/node/allowJs/file.js (2 errors) ==== - // esm format file - const __require = null; - const _createRequire = null; - import fs = require("fs"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - fs.readFile; - export import fs2 = require("fs"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. -==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module" - } -==== tests/cases/conformance/node/allowJs/subfolder/package.json (0 errors) ==== - { - "type": "commonjs" - } -==== tests/cases/conformance/node/allowJs/types.d.ts (0 errors) ==== - declare module "fs"; \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node12).js b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node12).js deleted file mode 100644 index 1e97293cca8..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node12).js +++ /dev/null @@ -1,68 +0,0 @@ -//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportAssignment.ts] //// - -//// [index.js] -// cjs format file -import fs = require("fs"); -fs.readFile; -export import fs2 = require("fs"); -//// [index.js] -// esm format file -import fs = require("fs"); -fs.readFile; -export import fs2 = require("fs"); -//// [file.js] -// esm format file -const __require = null; -const _createRequire = null; -import fs = require("fs"); -fs.readFile; -export import fs2 = require("fs"); -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} -//// [types.d.ts] -declare module "fs"; - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -// cjs format file -const fs = require("fs"); -fs.readFile; -exports.fs2 = require("fs"); -//// [index.js] -import { createRequire as _createRequire } from "module"; -const __require = _createRequire(import.meta.url); -// esm format file -const fs = __require("fs"); -fs.readFile; -const fs2 = __require("fs"); -export { fs2 }; -//// [file.js] -import { createRequire as _createRequire_1 } from "module"; -const __require_1 = _createRequire_1(import.meta.url); -// esm format file -const __require = null; -const _createRequire = null; -const fs = __require_1("fs"); -fs.readFile; -const fs2 = __require_1("fs"); -export { fs2 }; - - -//// [index.d.ts] -/// -import fs2 = require("fs"); -//// [index.d.ts] -/// -import fs2 = require("fs"); -//// [file.d.ts] -/// -import fs2 = require("fs"); diff --git a/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node12).symbols b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node12).symbols deleted file mode 100644 index 11b3047ebcd..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node12).symbols +++ /dev/null @@ -1,43 +0,0 @@ -=== tests/cases/conformance/node/allowJs/subfolder/index.js === -// cjs format file -import fs = require("fs"); ->fs : Symbol(fs, Decl(index.js, 0, 0)) - -fs.readFile; ->fs : Symbol(fs, Decl(index.js, 0, 0)) - -export import fs2 = require("fs"); ->fs2 : Symbol(fs2, Decl(index.js, 2, 12)) - -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -import fs = require("fs"); ->fs : Symbol(fs, Decl(index.js, 0, 0)) - -fs.readFile; ->fs : Symbol(fs, Decl(index.js, 0, 0)) - -export import fs2 = require("fs"); ->fs2 : Symbol(fs2, Decl(index.js, 2, 12)) - -=== tests/cases/conformance/node/allowJs/file.js === -// esm format file -const __require = null; ->__require : Symbol(__require, Decl(file.js, 1, 5)) - -const _createRequire = null; ->_createRequire : Symbol(_createRequire, Decl(file.js, 2, 5)) - -import fs = require("fs"); ->fs : Symbol(fs, Decl(file.js, 2, 28)) - -fs.readFile; ->fs : Symbol(fs, Decl(file.js, 2, 28)) - -export import fs2 = require("fs"); ->fs2 : Symbol(fs2, Decl(file.js, 4, 12)) - -=== tests/cases/conformance/node/allowJs/types.d.ts === -declare module "fs"; ->"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) - diff --git a/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node12).types b/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node12).types deleted file mode 100644 index 2720b1f1b7d..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsImportAssignment(module=node12).types +++ /dev/null @@ -1,51 +0,0 @@ -=== tests/cases/conformance/node/allowJs/subfolder/index.js === -// cjs format file -import fs = require("fs"); ->fs : any - -fs.readFile; ->fs.readFile : any ->fs : any ->readFile : any - -export import fs2 = require("fs"); ->fs2 : any - -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -import fs = require("fs"); ->fs : any - -fs.readFile; ->fs.readFile : any ->fs : any ->readFile : any - -export import fs2 = require("fs"); ->fs2 : any - -=== tests/cases/conformance/node/allowJs/file.js === -// esm format file -const __require = null; ->__require : any ->null : null - -const _createRequire = null; ->_createRequire : any ->null : null - -import fs = require("fs"); ->fs : any - -fs.readFile; ->fs.readFile : any ->fs : any ->readFile : any - -export import fs2 = require("fs"); ->fs2 : any - -=== tests/cases/conformance/node/allowJs/types.d.ts === -declare module "fs"; ->"fs" : any - diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node12).errors.txt deleted file mode 100644 index b75c1c1e6f5..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node12).errors.txt +++ /dev/null @@ -1,36 +0,0 @@ -tests/cases/conformance/node/allowJs/subfolder/index.js(2,9): error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. -tests/cases/conformance/node/allowJs/subfolder/index.js(4,1): error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. - - -==== tests/cases/conformance/node/allowJs/subfolder/index.js (2 errors) ==== - // cjs format file - import {default as _fs} from "fs"; - ~~~~~~~~~~~~~~ -!!! error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. - _fs.readFile; - import * as fs from "fs"; - ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. - fs.readFile; -==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== - // esm format file - import {default as _fs} from "fs"; - _fs.readFile; - import * as fs from "fs"; - fs.readFile; -==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module" - } -==== tests/cases/conformance/node/allowJs/subfolder/package.json (0 errors) ==== - { - "type": "commonjs" - } -==== tests/cases/conformance/node/allowJs/types.d.ts (0 errors) ==== - declare module "fs"; - declare module "tslib" { - export {}; - // intentionally missing all helpers - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node12).js b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node12).js deleted file mode 100644 index a30d220227f..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node12).js +++ /dev/null @@ -1,52 +0,0 @@ -//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions1.ts] //// - -//// [index.js] -// cjs format file -import {default as _fs} from "fs"; -_fs.readFile; -import * as fs from "fs"; -fs.readFile; -//// [index.js] -// esm format file -import {default as _fs} from "fs"; -_fs.readFile; -import * as fs from "fs"; -fs.readFile; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} -//// [types.d.ts] -declare module "fs"; -declare module "tslib" { - export {}; - // intentionally missing all helpers -} - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = require("tslib"); -// cjs format file -const fs_1 = tslib_1.__importDefault(require("fs")); -fs_1.default.readFile; -const fs = tslib_1.__importStar(require("fs")); -fs.readFile; -//// [index.js] -// esm format file -import { default as _fs } from "fs"; -_fs.readFile; -import * as fs from "fs"; -fs.readFile; - - -//// [index.d.ts] -export {}; -//// [index.d.ts] -export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node12).symbols b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node12).symbols deleted file mode 100644 index 3822c3fa16d..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node12).symbols +++ /dev/null @@ -1,40 +0,0 @@ -=== tests/cases/conformance/node/allowJs/subfolder/index.js === -// cjs format file -import {default as _fs} from "fs"; ->default : Symbol(_fs, Decl(types.d.ts, 0, 0)) ->_fs : Symbol(_fs, Decl(index.js, 1, 8)) - -_fs.readFile; ->_fs : Symbol(_fs, Decl(index.js, 1, 8)) - -import * as fs from "fs"; ->fs : Symbol(fs, Decl(index.js, 3, 6)) - -fs.readFile; ->fs : Symbol(fs, Decl(index.js, 3, 6)) - -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -import {default as _fs} from "fs"; ->default : Symbol(_fs, Decl(types.d.ts, 0, 0)) ->_fs : Symbol(_fs, Decl(index.js, 1, 8)) - -_fs.readFile; ->_fs : Symbol(_fs, Decl(index.js, 1, 8)) - -import * as fs from "fs"; ->fs : Symbol(fs, Decl(index.js, 3, 6)) - -fs.readFile; ->fs : Symbol(fs, Decl(index.js, 3, 6)) - -=== tests/cases/conformance/node/allowJs/types.d.ts === -declare module "fs"; ->"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) - -declare module "tslib" { ->"tslib" : Symbol("tslib", Decl(types.d.ts, 0, 20)) - - export {}; - // intentionally missing all helpers -} diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node12).types b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node12).types deleted file mode 100644 index 0b27106eae0..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions1(module=node12).types +++ /dev/null @@ -1,48 +0,0 @@ -=== tests/cases/conformance/node/allowJs/subfolder/index.js === -// cjs format file -import {default as _fs} from "fs"; ->default : any ->_fs : any - -_fs.readFile; ->_fs.readFile : any ->_fs : any ->readFile : any - -import * as fs from "fs"; ->fs : any - -fs.readFile; ->fs.readFile : any ->fs : any ->readFile : any - -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -import {default as _fs} from "fs"; ->default : any ->_fs : any - -_fs.readFile; ->_fs.readFile : any ->_fs : any ->readFile : any - -import * as fs from "fs"; ->fs : any - -fs.readFile; ->fs.readFile : any ->fs : any ->readFile : any - -=== tests/cases/conformance/node/allowJs/types.d.ts === -declare module "fs"; ->"fs" : any - -declare module "tslib" { ->"tslib" : typeof import("tslib") - - export {}; - // intentionally missing all helpers -} diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node12).errors.txt deleted file mode 100644 index e07871859db..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node12).errors.txt +++ /dev/null @@ -1,32 +0,0 @@ -tests/cases/conformance/node/allowJs/subfolder/index.ts(2,1): error TS2343: This syntax requires an imported helper named '__exportStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. -tests/cases/conformance/node/allowJs/subfolder/index.ts(3,1): error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. - - -==== tests/cases/conformance/node/allowJs/subfolder/index.ts (2 errors) ==== - // cjs format file - export * from "fs"; - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2343: This syntax requires an imported helper named '__exportStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. - export * as fs from "fs"; - ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. -==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== - // esm format file - export * from "fs"; - export * as fs from "fs"; -==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module" - } -==== tests/cases/conformance/node/allowJs/subfolder/package.json (0 errors) ==== - { - "type": "commonjs" - } -==== tests/cases/conformance/node/allowJs/types.d.ts (0 errors) ==== - declare module "fs"; - declare module "tslib" { - export {}; - // intentionally missing all helpers - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node12).js b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node12).js deleted file mode 100644 index f689312eb37..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node12).js +++ /dev/null @@ -1,48 +0,0 @@ -//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions2.ts] //// - -//// [index.ts] -// cjs format file -export * from "fs"; -export * as fs from "fs"; -//// [index.js] -// esm format file -export * from "fs"; -export * as fs from "fs"; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} -//// [types.d.ts] -declare module "fs"; -declare module "tslib" { - export {}; - // intentionally missing all helpers -} - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.fs = void 0; -const tslib_1 = require("tslib"); -// cjs format file -tslib_1.__exportStar(require("fs"), exports); -exports.fs = tslib_1.__importStar(require("fs")); -//// [index.js] -// esm format file -export * from "fs"; -export * as fs from "fs"; - - -//// [index.d.ts] -export * from "fs"; -export * as fs from "fs"; -//// [index.d.ts] -/// -export * from "fs"; -export * as fs from "fs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node12).symbols b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node12).symbols deleted file mode 100644 index 46c533db2dc..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node12).symbols +++ /dev/null @@ -1,22 +0,0 @@ -=== tests/cases/conformance/node/allowJs/subfolder/index.ts === -// cjs format file -export * from "fs"; -export * as fs from "fs"; ->fs : Symbol(fs, Decl(index.ts, 2, 6)) - -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -export * from "fs"; -export * as fs from "fs"; ->fs : Symbol(fs, Decl(index.js, 2, 6)) - -=== tests/cases/conformance/node/allowJs/types.d.ts === -declare module "fs"; ->"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) - -declare module "tslib" { ->"tslib" : Symbol("tslib", Decl(types.d.ts, 0, 20)) - - export {}; - // intentionally missing all helpers -} diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node12).types b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node12).types deleted file mode 100644 index bbcb3d29931..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions2(module=node12).types +++ /dev/null @@ -1,22 +0,0 @@ -=== tests/cases/conformance/node/allowJs/subfolder/index.ts === -// cjs format file -export * from "fs"; -export * as fs from "fs"; ->fs : any - -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -export * from "fs"; -export * as fs from "fs"; ->fs : any - -=== tests/cases/conformance/node/allowJs/types.d.ts === -declare module "fs"; ->"fs" : any - -declare module "tslib" { ->"tslib" : typeof import("tslib") - - export {}; - // intentionally missing all helpers -} diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node12).errors.txt deleted file mode 100644 index cd8457101bb..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node12).errors.txt +++ /dev/null @@ -1,31 +0,0 @@ -tests/cases/conformance/node/allowJs/subfolder/index.js(2,9): error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. - - -==== tests/cases/conformance/node/allowJs/subfolder/index.js (1 errors) ==== - // cjs format file - export {default} from "fs"; - ~~~~~~~ -!!! error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. - export {default as foo} from "fs"; - export {bar as baz} from "fs"; -==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== - // esm format file - export {default} from "fs"; - export {default as foo} from "fs"; - export {bar as baz} from "fs"; -==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module" - } -==== tests/cases/conformance/node/allowJs/subfolder/package.json (0 errors) ==== - { - "type": "commonjs" - } -==== tests/cases/conformance/node/allowJs/types.d.ts (0 errors) ==== - declare module "fs"; - declare module "tslib" { - export {}; - // intentionally missing all helpers - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node12).js b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node12).js deleted file mode 100644 index 8e07883b727..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node12).js +++ /dev/null @@ -1,54 +0,0 @@ -//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportHelpersCollisions3.ts] //// - -//// [index.js] -// cjs format file -export {default} from "fs"; -export {default as foo} from "fs"; -export {bar as baz} from "fs"; -//// [index.js] -// esm format file -export {default} from "fs"; -export {default as foo} from "fs"; -export {bar as baz} from "fs"; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} -//// [types.d.ts] -declare module "fs"; -declare module "tslib" { - export {}; - // intentionally missing all helpers -} - -//// [index.js] -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.baz = exports.foo = exports.default = void 0; -// cjs format file -var fs_1 = require("fs"); -Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(fs_1).default; } }); -var fs_2 = require("fs"); -Object.defineProperty(exports, "foo", { enumerable: true, get: function () { return __importDefault(fs_2).default; } }); -var fs_3 = require("fs"); -Object.defineProperty(exports, "baz", { enumerable: true, get: function () { return fs_3.bar; } }); -//// [index.js] -// esm format file -export { default } from "fs"; -export { default as foo } from "fs"; -export { bar as baz } from "fs"; - - -//// [index.d.ts] -export { default, default as foo, bar as baz } from "fs"; -//// [index.d.ts] -export { default, default as foo, bar as baz } from "fs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node12).symbols b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node12).symbols deleted file mode 100644 index 767be993d64..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node12).symbols +++ /dev/null @@ -1,36 +0,0 @@ -=== tests/cases/conformance/node/allowJs/subfolder/index.js === -// cjs format file -export {default} from "fs"; ->default : Symbol(default, Decl(index.js, 1, 8)) - -export {default as foo} from "fs"; ->default : Symbol("fs", Decl(types.d.ts, 0, 0)) ->foo : Symbol(foo, Decl(index.js, 2, 8)) - -export {bar as baz} from "fs"; ->bar : Symbol("fs", Decl(types.d.ts, 0, 0)) ->baz : Symbol(baz, Decl(index.js, 3, 8)) - -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -export {default} from "fs"; ->default : Symbol(default, Decl(index.js, 1, 8)) - -export {default as foo} from "fs"; ->default : Symbol("fs", Decl(types.d.ts, 0, 0)) ->foo : Symbol(foo, Decl(index.js, 2, 8)) - -export {bar as baz} from "fs"; ->bar : Symbol("fs", Decl(types.d.ts, 0, 0)) ->baz : Symbol(baz, Decl(index.js, 3, 8)) - -=== tests/cases/conformance/node/allowJs/types.d.ts === -declare module "fs"; ->"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) - -declare module "tslib" { ->"tslib" : Symbol("tslib", Decl(types.d.ts, 0, 20)) - - export {}; - // intentionally missing all helpers -} diff --git a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node12).types b/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node12).types deleted file mode 100644 index b07207ec08d..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsImportHelpersCollisions3(module=node12).types +++ /dev/null @@ -1,36 +0,0 @@ -=== tests/cases/conformance/node/allowJs/subfolder/index.js === -// cjs format file -export {default} from "fs"; ->default : any - -export {default as foo} from "fs"; ->default : any ->foo : any - -export {bar as baz} from "fs"; ->bar : any ->baz : any - -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -export {default} from "fs"; ->default : any - -export {default as foo} from "fs"; ->default : any ->foo : any - -export {bar as baz} from "fs"; ->bar : any ->baz : any - -=== tests/cases/conformance/node/allowJs/types.d.ts === -declare module "fs"; ->"fs" : any - -declare module "tslib" { ->"tslib" : typeof import("tslib") - - export {}; - // intentionally missing all helpers -} diff --git a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).errors.txt deleted file mode 100644 index 7f8ce469152..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).errors.txt +++ /dev/null @@ -1,23 +0,0 @@ -tests/cases/conformance/node/allowJs/subfolder/index.js(2,11): error TS1470: The 'import.meta' meta-property is not allowed in files which will build into CommonJS output. - - -==== tests/cases/conformance/node/allowJs/subfolder/index.js (1 errors) ==== - // cjs format file - const x = import.meta.url; - ~~~~~~~~~~~ -!!! error TS1470: The 'import.meta' meta-property is not allowed in files which will build into CommonJS output. - export {x}; -==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== - // esm format file - const x = import.meta.url; - export {x}; -==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module" - } -==== tests/cases/conformance/node/allowJs/subfolder/package.json (0 errors) ==== - { - "type": "commonjs" - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).js b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).js deleted file mode 100644 index 7e6d01b7daf..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).js +++ /dev/null @@ -1,38 +0,0 @@ -//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsImportMeta.ts] //// - -//// [index.js] -// cjs format file -const x = import.meta.url; -export {x}; -//// [index.js] -// esm format file -const x = import.meta.url; -export {x}; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.x = void 0; -// cjs format file -const x = import.meta.url; -exports.x = x; -//// [index.js] -// esm format file -const x = import.meta.url; -export { x }; - - -//// [index.d.ts] -export const x: string; -//// [index.d.ts] -export const x: string; diff --git a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).symbols b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).symbols deleted file mode 100644 index 89649ba7b33..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).symbols +++ /dev/null @@ -1,24 +0,0 @@ -=== tests/cases/conformance/node/allowJs/subfolder/index.js === -// cjs format file -const x = import.meta.url; ->x : Symbol(x, Decl(index.js, 1, 5)) ->import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) ->import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) ->meta : Symbol(ImportMetaExpression.meta) ->url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) - -export {x}; ->x : Symbol(x, Decl(index.js, 2, 8)) - -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -const x = import.meta.url; ->x : Symbol(x, Decl(index.js, 1, 5)) ->import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) ->import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) ->meta : Symbol(ImportMetaExpression.meta) ->url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) - -export {x}; ->x : Symbol(x, Decl(index.js, 2, 8)) - diff --git a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).types b/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).types deleted file mode 100644 index de6d0c96059..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsImportMeta(module=node12).types +++ /dev/null @@ -1,24 +0,0 @@ -=== tests/cases/conformance/node/allowJs/subfolder/index.js === -// cjs format file -const x = import.meta.url; ->x : string ->import.meta.url : string ->import.meta : ImportMeta ->meta : any ->url : string - -export {x}; ->x : string - -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -const x = import.meta.url; ->x : string ->import.meta.url : string ->import.meta : ImportMeta ->meta : any ->url : string - -export {x}; ->x : string - diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node12).errors.txt deleted file mode 100644 index e6f4b3ce2eb..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node12).errors.txt +++ /dev/null @@ -1,107 +0,0 @@ -tests/cases/conformance/node/allowJs/index.cjs(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.cjs(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.cjs(9,23): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts(3,22): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. -tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - - -==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== - // esm format file - import * as cjs from "package/cjs"; - import * as mjs from "package/mjs"; - import * as type from "package"; - cjs; - mjs; - type; - import * as cjsi from "inner/cjs"; - import * as mjsi from "inner/mjs"; - import * as typei from "inner"; - cjsi; - mjsi; - typei; -==== tests/cases/conformance/node/allowJs/index.mjs (0 errors) ==== - // esm format file - import * as cjs from "package/cjs"; - import * as mjs from "package/mjs"; - import * as type from "package"; - cjs; - mjs; - type; - import * as cjsi from "inner/cjs"; - import * as mjsi from "inner/mjs"; - import * as typei from "inner"; - cjsi; - mjsi; - typei; -==== tests/cases/conformance/node/allowJs/index.cjs (3 errors) ==== - // cjs format file - import * as cjs from "package/cjs"; - import * as mjs from "package/mjs"; - ~~~~~~~~~~~~~ -!!! error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as type from "package"; - ~~~~~~~~~ -!!! error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - cjs; - mjs; - type; - import * as cjsi from "inner/cjs"; - import * as mjsi from "inner/mjs"; - ~~~~~~~~~~~ -!!! error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as typei from "inner"; - cjsi; - mjsi; - typei; -==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts (2 errors) ==== - // cjs format file - import * as cjs from "inner/cjs"; - ~~~ -!!! error TS2303: Circular definition of import alias 'cjs'. - import * as mjs from "inner/mjs"; - ~~~~~~~~~~~ -!!! error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as type from "inner"; - export { cjs }; - export { mjs }; - export { type }; -==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts (0 errors) ==== - // esm format file - import * as cjs from "inner/cjs"; - import * as mjs from "inner/mjs"; - import * as type from "inner"; - export { cjs }; - export { mjs }; - export { type }; -==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts (1 errors) ==== - // cjs format file - import * as cjs from "inner/cjs"; - import * as mjs from "inner/mjs"; - ~~~~~~~~~~~ -!!! error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as type from "inner"; - export { cjs }; - export { mjs }; - export { type }; -==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module", - "exports": { - "./cjs": "./index.cjs", - "./mjs": "./index.mjs", - ".": "./index.js" - } - } -==== tests/cases/conformance/node/allowJs/node_modules/inner/package.json (0 errors) ==== - { - "name": "inner", - "private": true, - "exports": { - "./cjs": "./index.cjs", - "./mjs": "./index.mjs", - ".": "./index.js" - } - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node12).js b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node12).js deleted file mode 100644 index cce457e2d41..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node12).js +++ /dev/null @@ -1,165 +0,0 @@ -//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageExports.ts] //// - -//// [index.js] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/cjs"; -import * as mjsi from "inner/mjs"; -import * as typei from "inner"; -cjsi; -mjsi; -typei; -//// [index.mjs] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/cjs"; -import * as mjsi from "inner/mjs"; -import * as typei from "inner"; -cjsi; -mjsi; -typei; -//// [index.cjs] -// cjs format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/cjs"; -import * as mjsi from "inner/mjs"; -import * as typei from "inner"; -cjsi; -mjsi; -typei; -//// [index.d.ts] -// cjs format file -import * as cjs from "inner/cjs"; -import * as mjs from "inner/mjs"; -import * as type from "inner"; -export { cjs }; -export { mjs }; -export { type }; -//// [index.d.mts] -// esm format file -import * as cjs from "inner/cjs"; -import * as mjs from "inner/mjs"; -import * as type from "inner"; -export { cjs }; -export { mjs }; -export { type }; -//// [index.d.cts] -// cjs format file -import * as cjs from "inner/cjs"; -import * as mjs from "inner/mjs"; -import * as type from "inner"; -export { cjs }; -export { mjs }; -export { type }; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module", - "exports": { - "./cjs": "./index.cjs", - "./mjs": "./index.mjs", - ".": "./index.js" - } -} -//// [package.json] -{ - "name": "inner", - "private": true, - "exports": { - "./cjs": "./index.cjs", - "./mjs": "./index.mjs", - ".": "./index.js" - } -} - -//// [index.js] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/cjs"; -import * as mjsi from "inner/mjs"; -import * as typei from "inner"; -cjsi; -mjsi; -typei; -//// [index.mjs] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/cjs"; -import * as mjsi from "inner/mjs"; -import * as typei from "inner"; -cjsi; -mjsi; -typei; -//// [index.cjs] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// cjs format file -const cjs = __importStar(require("package/cjs")); -const mjs = __importStar(require("package/mjs")); -const type = __importStar(require("package")); -cjs; -mjs; -type; -const cjsi = __importStar(require("inner/cjs")); -const mjsi = __importStar(require("inner/mjs")); -const typei = __importStar(require("inner")); -cjsi; -mjsi; -typei; - - -//// [index.d.ts] -export {}; -//// [index.d.mts] -export {}; -//// [index.d.cts] -export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node12).symbols b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node12).symbols deleted file mode 100644 index 44c1af02648..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node12).symbols +++ /dev/null @@ -1,174 +0,0 @@ -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -import * as cjs from "package/cjs"; ->cjs : Symbol(cjs, Decl(index.js, 1, 6)) - -import * as mjs from "package/mjs"; ->mjs : Symbol(mjs, Decl(index.js, 2, 6)) - -import * as type from "package"; ->type : Symbol(type, Decl(index.js, 3, 6)) - -cjs; ->cjs : Symbol(cjs, Decl(index.js, 1, 6)) - -mjs; ->mjs : Symbol(mjs, Decl(index.js, 2, 6)) - -type; ->type : Symbol(type, Decl(index.js, 3, 6)) - -import * as cjsi from "inner/cjs"; ->cjsi : Symbol(cjsi, Decl(index.js, 7, 6)) - -import * as mjsi from "inner/mjs"; ->mjsi : Symbol(mjsi, Decl(index.js, 8, 6)) - -import * as typei from "inner"; ->typei : Symbol(typei, Decl(index.js, 9, 6)) - -cjsi; ->cjsi : Symbol(cjsi, Decl(index.js, 7, 6)) - -mjsi; ->mjsi : Symbol(mjsi, Decl(index.js, 8, 6)) - -typei; ->typei : Symbol(typei, Decl(index.js, 9, 6)) - -=== tests/cases/conformance/node/allowJs/index.mjs === -// esm format file -import * as cjs from "package/cjs"; ->cjs : Symbol(cjs, Decl(index.mjs, 1, 6)) - -import * as mjs from "package/mjs"; ->mjs : Symbol(mjs, Decl(index.mjs, 2, 6)) - -import * as type from "package"; ->type : Symbol(type, Decl(index.mjs, 3, 6)) - -cjs; ->cjs : Symbol(cjs, Decl(index.mjs, 1, 6)) - -mjs; ->mjs : Symbol(mjs, Decl(index.mjs, 2, 6)) - -type; ->type : Symbol(type, Decl(index.mjs, 3, 6)) - -import * as cjsi from "inner/cjs"; ->cjsi : Symbol(cjsi, Decl(index.mjs, 7, 6)) - -import * as mjsi from "inner/mjs"; ->mjsi : Symbol(mjsi, Decl(index.mjs, 8, 6)) - -import * as typei from "inner"; ->typei : Symbol(typei, Decl(index.mjs, 9, 6)) - -cjsi; ->cjsi : Symbol(cjsi, Decl(index.mjs, 7, 6)) - -mjsi; ->mjsi : Symbol(mjsi, Decl(index.mjs, 8, 6)) - -typei; ->typei : Symbol(typei, Decl(index.mjs, 9, 6)) - -=== tests/cases/conformance/node/allowJs/index.cjs === -// cjs format file -import * as cjs from "package/cjs"; ->cjs : Symbol(cjs, Decl(index.cjs, 1, 6)) - -import * as mjs from "package/mjs"; ->mjs : Symbol(mjs, Decl(index.cjs, 2, 6)) - -import * as type from "package"; ->type : Symbol(type, Decl(index.cjs, 3, 6)) - -cjs; ->cjs : Symbol(cjs, Decl(index.cjs, 1, 6)) - -mjs; ->mjs : Symbol(mjs, Decl(index.cjs, 2, 6)) - -type; ->type : Symbol(type, Decl(index.cjs, 3, 6)) - -import * as cjsi from "inner/cjs"; ->cjsi : Symbol(cjsi, Decl(index.cjs, 7, 6)) - -import * as mjsi from "inner/mjs"; ->mjsi : Symbol(mjsi, Decl(index.cjs, 8, 6)) - -import * as typei from "inner"; ->typei : Symbol(typei, Decl(index.cjs, 9, 6)) - -cjsi; ->cjsi : Symbol(cjsi, Decl(index.cjs, 7, 6)) - -mjsi; ->mjsi : Symbol(mjsi, Decl(index.cjs, 8, 6)) - -typei; ->typei : Symbol(typei, Decl(index.cjs, 9, 6)) - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts === -// cjs format file -import * as cjs from "inner/cjs"; ->cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) - -import * as mjs from "inner/mjs"; ->mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) - -import * as type from "inner"; ->type : Symbol(type, Decl(index.d.ts, 3, 6)) - -export { cjs }; ->cjs : Symbol(mjs.cjs.cjs.type.cjs, Decl(index.d.ts, 4, 8)) - -export { mjs }; ->mjs : Symbol(mjs.cjs.cjs.type.mjs, Decl(index.d.ts, 5, 8)) - -export { type }; ->type : Symbol(mjs.cjs.cjs.type.type, Decl(index.d.ts, 6, 8)) - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts === -// esm format file -import * as cjs from "inner/cjs"; ->cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) - -import * as mjs from "inner/mjs"; ->mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) - -import * as type from "inner"; ->type : Symbol(type, Decl(index.d.mts, 3, 6)) - -export { cjs }; ->cjs : Symbol(cjs.cjs.mjs.cjs, Decl(index.d.mts, 4, 8)) - -export { mjs }; ->mjs : Symbol(cjs.cjs.mjs.mjs, Decl(index.d.mts, 5, 8)) - -export { type }; ->type : Symbol(cjs.cjs.mjs.type, Decl(index.d.mts, 6, 8)) - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts === -// cjs format file -import * as cjs from "inner/cjs"; ->cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) - -import * as mjs from "inner/mjs"; ->mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) - -import * as type from "inner"; ->type : Symbol(type, Decl(index.d.cts, 3, 6)) - -export { cjs }; ->cjs : Symbol(cjs.cjs, Decl(index.d.cts, 4, 8)) - -export { mjs }; ->mjs : Symbol(cjs.mjs, Decl(index.d.cts, 5, 8)) - -export { type }; ->type : Symbol(cjs.type, Decl(index.d.cts, 6, 8)) - diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node12).types b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node12).types deleted file mode 100644 index f610f5095dd..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node12).types +++ /dev/null @@ -1,174 +0,0 @@ -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -import * as cjs from "package/cjs"; ->cjs : typeof cjs - -import * as mjs from "package/mjs"; ->mjs : typeof mjs - -import * as type from "package"; ->type : typeof type - -cjs; ->cjs : typeof cjs - -mjs; ->mjs : typeof mjs - -type; ->type : typeof type - -import * as cjsi from "inner/cjs"; ->cjsi : typeof cjsi - -import * as mjsi from "inner/mjs"; ->mjsi : typeof cjsi.cjs.mjs - -import * as typei from "inner"; ->typei : typeof typei - -cjsi; ->cjsi : typeof cjsi - -mjsi; ->mjsi : typeof cjsi.cjs.mjs - -typei; ->typei : typeof typei - -=== tests/cases/conformance/node/allowJs/index.mjs === -// esm format file -import * as cjs from "package/cjs"; ->cjs : typeof cjs - -import * as mjs from "package/mjs"; ->mjs : typeof mjs - -import * as type from "package"; ->type : typeof type - -cjs; ->cjs : typeof cjs - -mjs; ->mjs : typeof mjs - -type; ->type : typeof type - -import * as cjsi from "inner/cjs"; ->cjsi : typeof cjsi - -import * as mjsi from "inner/mjs"; ->mjsi : typeof cjsi.cjs.mjs - -import * as typei from "inner"; ->typei : typeof typei - -cjsi; ->cjsi : typeof cjsi - -mjsi; ->mjsi : typeof cjsi.cjs.mjs - -typei; ->typei : typeof typei - -=== tests/cases/conformance/node/allowJs/index.cjs === -// cjs format file -import * as cjs from "package/cjs"; ->cjs : typeof cjs - -import * as mjs from "package/mjs"; ->mjs : typeof mjs - -import * as type from "package"; ->type : typeof type - -cjs; ->cjs : typeof cjs - -mjs; ->mjs : typeof mjs - -type; ->type : typeof type - -import * as cjsi from "inner/cjs"; ->cjsi : typeof cjsi - -import * as mjsi from "inner/mjs"; ->mjsi : typeof cjsi.mjs - -import * as typei from "inner"; ->typei : typeof cjsi.mjs.cjs.type - -cjsi; ->cjsi : typeof cjsi - -mjsi; ->mjsi : typeof cjsi.mjs - -typei; ->typei : typeof cjsi.mjs.cjs.type - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts === -// cjs format file -import * as cjs from "inner/cjs"; ->cjs : any - -import * as mjs from "inner/mjs"; ->mjs : typeof mjs - -import * as type from "inner"; ->type : typeof mjs.cjs.cjs.type - -export { cjs }; ->cjs : any - -export { mjs }; ->mjs : typeof mjs - -export { type }; ->type : typeof mjs.cjs.cjs.type - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts === -// esm format file -import * as cjs from "inner/cjs"; ->cjs : typeof cjs - -import * as mjs from "inner/mjs"; ->mjs : typeof cjs.cjs.mjs - -import * as type from "inner"; ->type : typeof cjs.cjs.mjs.type - -export { cjs }; ->cjs : typeof cjs - -export { mjs }; ->mjs : typeof cjs.cjs.mjs - -export { type }; ->type : typeof cjs.cjs.mjs.type - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts === -// cjs format file -import * as cjs from "inner/cjs"; ->cjs : typeof cjs - -import * as mjs from "inner/mjs"; ->mjs : typeof cjs.mjs - -import * as type from "inner"; ->type : typeof cjs.mjs.cjs.type - -export { cjs }; ->cjs : typeof cjs - -export { mjs }; ->mjs : typeof cjs.mjs - -export { type }; ->type : typeof cjs.mjs.cjs.type - diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node12).errors.txt deleted file mode 100644 index 261be58f1a2..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node12).errors.txt +++ /dev/null @@ -1,44 +0,0 @@ -tests/cases/conformance/node/allowJs/index.cjs(3,22): error TS1471: Module '#mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.cjs(4,23): error TS1471: Module '#type' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - - -==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== - // esm format file - import * as cjs from "#cjs"; - import * as mjs from "#mjs"; - import * as type from "#type"; - cjs; - mjs; - type; -==== tests/cases/conformance/node/allowJs/index.mjs (0 errors) ==== - // esm format file - import * as cjs from "#cjs"; - import * as mjs from "#mjs"; - import * as type from "#type"; - cjs; - mjs; - type; -==== tests/cases/conformance/node/allowJs/index.cjs (2 errors) ==== - // esm format file - import * as cjs from "#cjs"; - import * as mjs from "#mjs"; - ~~~~~~ -!!! error TS1471: Module '#mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as type from "#type"; - ~~~~~~~ -!!! error TS1471: Module '#type' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - cjs; - mjs; - type; -==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module", - "exports": "./index.js", - "imports": { - "#cjs": "./index.cjs", - "#mjs": "./index.mjs", - "#type": "./index.js" - } - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node12).js b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node12).js deleted file mode 100644 index 634e532de49..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node12).js +++ /dev/null @@ -1,96 +0,0 @@ -//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackageImports.ts] //// - -//// [index.js] -// esm format file -import * as cjs from "#cjs"; -import * as mjs from "#mjs"; -import * as type from "#type"; -cjs; -mjs; -type; -//// [index.mjs] -// esm format file -import * as cjs from "#cjs"; -import * as mjs from "#mjs"; -import * as type from "#type"; -cjs; -mjs; -type; -//// [index.cjs] -// esm format file -import * as cjs from "#cjs"; -import * as mjs from "#mjs"; -import * as type from "#type"; -cjs; -mjs; -type; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module", - "exports": "./index.js", - "imports": { - "#cjs": "./index.cjs", - "#mjs": "./index.mjs", - "#type": "./index.js" - } -} - -//// [index.js] -// esm format file -import * as cjs from "#cjs"; -import * as mjs from "#mjs"; -import * as type from "#type"; -cjs; -mjs; -type; -//// [index.mjs] -// esm format file -import * as cjs from "#cjs"; -import * as mjs from "#mjs"; -import * as type from "#type"; -cjs; -mjs; -type; -//// [index.cjs] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// esm format file -const cjs = __importStar(require("#cjs")); -const mjs = __importStar(require("#mjs")); -const type = __importStar(require("#type")); -cjs; -mjs; -type; - - -//// [index.d.ts] -export {}; -//// [index.d.mts] -export {}; -//// [index.d.cts] -export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node12).symbols b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node12).symbols deleted file mode 100644 index 196837bc0bc..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node12).symbols +++ /dev/null @@ -1,60 +0,0 @@ -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -import * as cjs from "#cjs"; ->cjs : Symbol(cjs, Decl(index.js, 1, 6)) - -import * as mjs from "#mjs"; ->mjs : Symbol(mjs, Decl(index.js, 2, 6)) - -import * as type from "#type"; ->type : Symbol(type, Decl(index.js, 3, 6)) - -cjs; ->cjs : Symbol(cjs, Decl(index.js, 1, 6)) - -mjs; ->mjs : Symbol(mjs, Decl(index.js, 2, 6)) - -type; ->type : Symbol(type, Decl(index.js, 3, 6)) - -=== tests/cases/conformance/node/allowJs/index.mjs === -// esm format file -import * as cjs from "#cjs"; ->cjs : Symbol(cjs, Decl(index.mjs, 1, 6)) - -import * as mjs from "#mjs"; ->mjs : Symbol(mjs, Decl(index.mjs, 2, 6)) - -import * as type from "#type"; ->type : Symbol(type, Decl(index.mjs, 3, 6)) - -cjs; ->cjs : Symbol(cjs, Decl(index.mjs, 1, 6)) - -mjs; ->mjs : Symbol(mjs, Decl(index.mjs, 2, 6)) - -type; ->type : Symbol(type, Decl(index.mjs, 3, 6)) - -=== tests/cases/conformance/node/allowJs/index.cjs === -// esm format file -import * as cjs from "#cjs"; ->cjs : Symbol(cjs, Decl(index.cjs, 1, 6)) - -import * as mjs from "#mjs"; ->mjs : Symbol(mjs, Decl(index.cjs, 2, 6)) - -import * as type from "#type"; ->type : Symbol(type, Decl(index.cjs, 3, 6)) - -cjs; ->cjs : Symbol(cjs, Decl(index.cjs, 1, 6)) - -mjs; ->mjs : Symbol(mjs, Decl(index.cjs, 2, 6)) - -type; ->type : Symbol(type, Decl(index.cjs, 3, 6)) - diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node12).types b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node12).types deleted file mode 100644 index 6387f04fcb6..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node12).types +++ /dev/null @@ -1,60 +0,0 @@ -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -import * as cjs from "#cjs"; ->cjs : typeof cjs - -import * as mjs from "#mjs"; ->mjs : typeof mjs - -import * as type from "#type"; ->type : typeof type - -cjs; ->cjs : typeof cjs - -mjs; ->mjs : typeof mjs - -type; ->type : typeof type - -=== tests/cases/conformance/node/allowJs/index.mjs === -// esm format file -import * as cjs from "#cjs"; ->cjs : typeof cjs - -import * as mjs from "#mjs"; ->mjs : typeof mjs - -import * as type from "#type"; ->type : typeof type - -cjs; ->cjs : typeof cjs - -mjs; ->mjs : typeof mjs - -type; ->type : typeof type - -=== tests/cases/conformance/node/allowJs/index.cjs === -// esm format file -import * as cjs from "#cjs"; ->cjs : typeof cjs - -import * as mjs from "#mjs"; ->mjs : typeof mjs - -import * as type from "#type"; ->type : typeof type - -cjs; ->cjs : typeof cjs - -mjs; ->mjs : typeof mjs - -type; ->type : typeof type - diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node12).errors.txt deleted file mode 100644 index 0f199947722..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node12).errors.txt +++ /dev/null @@ -1,78 +0,0 @@ -tests/cases/conformance/node/allowJs/index.cjs(3,23): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts(3,22): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. -tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - - -==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== - // esm format file - import * as cjsi from "inner/cjs/index"; - import * as mjsi from "inner/mjs/index"; - import * as typei from "inner/js/index"; - cjsi; - mjsi; - typei; -==== tests/cases/conformance/node/allowJs/index.mjs (0 errors) ==== - // esm format file - import * as cjsi from "inner/cjs/index"; - import * as mjsi from "inner/mjs/index"; - import * as typei from "inner/js/index"; - cjsi; - mjsi; - typei; -==== tests/cases/conformance/node/allowJs/index.cjs (1 errors) ==== - // cjs format file - import * as cjsi from "inner/cjs/index"; - import * as mjsi from "inner/mjs/index"; - ~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as typei from "inner/js/index"; - cjsi; - mjsi; - typei; -==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts (2 errors) ==== - // cjs format file - import * as cjs from "inner/cjs/index"; - ~~~ -!!! error TS2303: Circular definition of import alias 'cjs'. - import * as mjs from "inner/mjs/index"; - ~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as type from "inner/js/index"; - export { cjs }; - export { mjs }; - export { type }; -==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts (0 errors) ==== - // esm format file - import * as cjs from "inner/cjs/index"; - import * as mjs from "inner/mjs/index"; - import * as type from "inner/js/index"; - export { cjs }; - export { mjs }; - export { type }; -==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts (1 errors) ==== - // cjs format file - import * as cjs from "inner/cjs/index"; - import * as mjs from "inner/mjs/index"; - ~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as type from "inner/js/index"; - export { cjs }; - export { mjs }; - export { type }; -==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module", - } -==== tests/cases/conformance/node/allowJs/node_modules/inner/package.json (0 errors) ==== - { - "name": "inner", - "private": true, - "exports": { - "./cjs/*": "./*.cjs", - "./mjs/*": "./*.mjs", - "./js/*": "./*.js" - } - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node12).js b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node12).js deleted file mode 100644 index db1bb37d36a..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node12).js +++ /dev/null @@ -1,124 +0,0 @@ -//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExports.ts] //// - -//// [index.js] -// esm format file -import * as cjsi from "inner/cjs/index"; -import * as mjsi from "inner/mjs/index"; -import * as typei from "inner/js/index"; -cjsi; -mjsi; -typei; -//// [index.mjs] -// esm format file -import * as cjsi from "inner/cjs/index"; -import * as mjsi from "inner/mjs/index"; -import * as typei from "inner/js/index"; -cjsi; -mjsi; -typei; -//// [index.cjs] -// cjs format file -import * as cjsi from "inner/cjs/index"; -import * as mjsi from "inner/mjs/index"; -import * as typei from "inner/js/index"; -cjsi; -mjsi; -typei; -//// [index.d.ts] -// cjs format file -import * as cjs from "inner/cjs/index"; -import * as mjs from "inner/mjs/index"; -import * as type from "inner/js/index"; -export { cjs }; -export { mjs }; -export { type }; -//// [index.d.mts] -// esm format file -import * as cjs from "inner/cjs/index"; -import * as mjs from "inner/mjs/index"; -import * as type from "inner/js/index"; -export { cjs }; -export { mjs }; -export { type }; -//// [index.d.cts] -// cjs format file -import * as cjs from "inner/cjs/index"; -import * as mjs from "inner/mjs/index"; -import * as type from "inner/js/index"; -export { cjs }; -export { mjs }; -export { type }; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module", -} -//// [package.json] -{ - "name": "inner", - "private": true, - "exports": { - "./cjs/*": "./*.cjs", - "./mjs/*": "./*.mjs", - "./js/*": "./*.js" - } -} - -//// [index.js] -// esm format file -import * as cjsi from "inner/cjs/index"; -import * as mjsi from "inner/mjs/index"; -import * as typei from "inner/js/index"; -cjsi; -mjsi; -typei; -//// [index.mjs] -// esm format file -import * as cjsi from "inner/cjs/index"; -import * as mjsi from "inner/mjs/index"; -import * as typei from "inner/js/index"; -cjsi; -mjsi; -typei; -//// [index.cjs] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// cjs format file -const cjsi = __importStar(require("inner/cjs/index")); -const mjsi = __importStar(require("inner/mjs/index")); -const typei = __importStar(require("inner/js/index")); -cjsi; -mjsi; -typei; - - -//// [index.d.ts] -export {}; -//// [index.d.mts] -export {}; -//// [index.d.cts] -export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node12).symbols b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node12).symbols deleted file mode 100644 index 714bff6bd6b..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node12).symbols +++ /dev/null @@ -1,120 +0,0 @@ -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -import * as cjsi from "inner/cjs/index"; ->cjsi : Symbol(cjsi, Decl(index.js, 1, 6)) - -import * as mjsi from "inner/mjs/index"; ->mjsi : Symbol(mjsi, Decl(index.js, 2, 6)) - -import * as typei from "inner/js/index"; ->typei : Symbol(typei, Decl(index.js, 3, 6)) - -cjsi; ->cjsi : Symbol(cjsi, Decl(index.js, 1, 6)) - -mjsi; ->mjsi : Symbol(mjsi, Decl(index.js, 2, 6)) - -typei; ->typei : Symbol(typei, Decl(index.js, 3, 6)) - -=== tests/cases/conformance/node/allowJs/index.mjs === -// esm format file -import * as cjsi from "inner/cjs/index"; ->cjsi : Symbol(cjsi, Decl(index.mjs, 1, 6)) - -import * as mjsi from "inner/mjs/index"; ->mjsi : Symbol(mjsi, Decl(index.mjs, 2, 6)) - -import * as typei from "inner/js/index"; ->typei : Symbol(typei, Decl(index.mjs, 3, 6)) - -cjsi; ->cjsi : Symbol(cjsi, Decl(index.mjs, 1, 6)) - -mjsi; ->mjsi : Symbol(mjsi, Decl(index.mjs, 2, 6)) - -typei; ->typei : Symbol(typei, Decl(index.mjs, 3, 6)) - -=== tests/cases/conformance/node/allowJs/index.cjs === -// cjs format file -import * as cjsi from "inner/cjs/index"; ->cjsi : Symbol(cjsi, Decl(index.cjs, 1, 6)) - -import * as mjsi from "inner/mjs/index"; ->mjsi : Symbol(mjsi, Decl(index.cjs, 2, 6)) - -import * as typei from "inner/js/index"; ->typei : Symbol(typei, Decl(index.cjs, 3, 6)) - -cjsi; ->cjsi : Symbol(cjsi, Decl(index.cjs, 1, 6)) - -mjsi; ->mjsi : Symbol(mjsi, Decl(index.cjs, 2, 6)) - -typei; ->typei : Symbol(typei, Decl(index.cjs, 3, 6)) - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts === -// cjs format file -import * as cjs from "inner/cjs/index"; ->cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) - -import * as mjs from "inner/mjs/index"; ->mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) - -import * as type from "inner/js/index"; ->type : Symbol(type, Decl(index.d.ts, 3, 6)) - -export { cjs }; ->cjs : Symbol(mjs.cjs.cjs.type.cjs, Decl(index.d.ts, 4, 8)) - -export { mjs }; ->mjs : Symbol(mjs.cjs.cjs.type.mjs, Decl(index.d.ts, 5, 8)) - -export { type }; ->type : Symbol(mjs.cjs.cjs.type.type, Decl(index.d.ts, 6, 8)) - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts === -// esm format file -import * as cjs from "inner/cjs/index"; ->cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) - -import * as mjs from "inner/mjs/index"; ->mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) - -import * as type from "inner/js/index"; ->type : Symbol(type, Decl(index.d.mts, 3, 6)) - -export { cjs }; ->cjs : Symbol(cjs.cjs.mjs.cjs, Decl(index.d.mts, 4, 8)) - -export { mjs }; ->mjs : Symbol(cjs.cjs.mjs.mjs, Decl(index.d.mts, 5, 8)) - -export { type }; ->type : Symbol(cjs.cjs.mjs.type, Decl(index.d.mts, 6, 8)) - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts === -// cjs format file -import * as cjs from "inner/cjs/index"; ->cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) - -import * as mjs from "inner/mjs/index"; ->mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) - -import * as type from "inner/js/index"; ->type : Symbol(type, Decl(index.d.cts, 3, 6)) - -export { cjs }; ->cjs : Symbol(cjs.cjs, Decl(index.d.cts, 4, 8)) - -export { mjs }; ->mjs : Symbol(cjs.mjs, Decl(index.d.cts, 5, 8)) - -export { type }; ->type : Symbol(cjs.type, Decl(index.d.cts, 6, 8)) - diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node12).types b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node12).types deleted file mode 100644 index 2103a12734a..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExports(module=node12).types +++ /dev/null @@ -1,120 +0,0 @@ -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -import * as cjsi from "inner/cjs/index"; ->cjsi : typeof cjsi - -import * as mjsi from "inner/mjs/index"; ->mjsi : typeof cjsi.cjs.mjs - -import * as typei from "inner/js/index"; ->typei : typeof typei - -cjsi; ->cjsi : typeof cjsi - -mjsi; ->mjsi : typeof cjsi.cjs.mjs - -typei; ->typei : typeof typei - -=== tests/cases/conformance/node/allowJs/index.mjs === -// esm format file -import * as cjsi from "inner/cjs/index"; ->cjsi : typeof cjsi - -import * as mjsi from "inner/mjs/index"; ->mjsi : typeof cjsi.cjs.mjs - -import * as typei from "inner/js/index"; ->typei : typeof typei - -cjsi; ->cjsi : typeof cjsi - -mjsi; ->mjsi : typeof cjsi.cjs.mjs - -typei; ->typei : typeof typei - -=== tests/cases/conformance/node/allowJs/index.cjs === -// cjs format file -import * as cjsi from "inner/cjs/index"; ->cjsi : typeof cjsi - -import * as mjsi from "inner/mjs/index"; ->mjsi : typeof cjsi.mjs - -import * as typei from "inner/js/index"; ->typei : typeof cjsi.mjs.cjs.type - -cjsi; ->cjsi : typeof cjsi - -mjsi; ->mjsi : typeof cjsi.mjs - -typei; ->typei : typeof cjsi.mjs.cjs.type - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts === -// cjs format file -import * as cjs from "inner/cjs/index"; ->cjs : any - -import * as mjs from "inner/mjs/index"; ->mjs : typeof mjs - -import * as type from "inner/js/index"; ->type : typeof mjs.cjs.cjs.type - -export { cjs }; ->cjs : any - -export { mjs }; ->mjs : typeof mjs - -export { type }; ->type : typeof mjs.cjs.cjs.type - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts === -// esm format file -import * as cjs from "inner/cjs/index"; ->cjs : typeof cjs - -import * as mjs from "inner/mjs/index"; ->mjs : typeof cjs.cjs.mjs - -import * as type from "inner/js/index"; ->type : typeof cjs.cjs.mjs.type - -export { cjs }; ->cjs : typeof cjs - -export { mjs }; ->mjs : typeof cjs.cjs.mjs - -export { type }; ->type : typeof cjs.cjs.mjs.type - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts === -// cjs format file -import * as cjs from "inner/cjs/index"; ->cjs : typeof cjs - -import * as mjs from "inner/mjs/index"; ->mjs : typeof cjs.mjs - -import * as type from "inner/js/index"; ->type : typeof cjs.mjs.cjs.type - -export { cjs }; ->cjs : typeof cjs - -export { mjs }; ->mjs : typeof cjs.mjs - -export { type }; ->type : typeof cjs.mjs.cjs.type - diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node12).errors.txt deleted file mode 100644 index 2036308bb9b..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node12).errors.txt +++ /dev/null @@ -1,120 +0,0 @@ -tests/cases/conformance/node/allowJs/index.cjs(2,23): error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(3,23): error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.cjs(4,24): error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(2,23): error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(3,23): error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.js(4,24): error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(2,23): error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(3,23): error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/index.mjs(4,24): error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts(2,22): error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts(3,22): error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts(4,23): error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts(2,22): error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts(3,22): error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts(4,23): error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(2,22): error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(3,22): error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. -tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(4,23): error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. - - -==== tests/cases/conformance/node/allowJs/index.js (3 errors) ==== - // esm format file - import * as cjsi from "inner/cjs/index.cjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. - import * as mjsi from "inner/mjs/index.mjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. - import * as typei from "inner/js/index.js"; - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. - cjsi; - mjsi; - typei; -==== tests/cases/conformance/node/allowJs/index.mjs (3 errors) ==== - // esm format file - import * as cjsi from "inner/cjs/index.cjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. - import * as mjsi from "inner/mjs/index.mjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. - import * as typei from "inner/js/index.js"; - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. - cjsi; - mjsi; - typei; -==== tests/cases/conformance/node/allowJs/index.cjs (3 errors) ==== - // cjs format file - import * as cjsi from "inner/cjs/index.cjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. - import * as mjsi from "inner/mjs/index.mjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. - import * as typei from "inner/js/index.js"; - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. - cjsi; - mjsi; - typei; -==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts (3 errors) ==== - // cjs format file - import * as cjs from "inner/cjs/index.cjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. - import * as mjs from "inner/mjs/index.mjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. - import * as type from "inner/js/index.js"; - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. - export { cjs }; - export { mjs }; - export { type }; -==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts (3 errors) ==== - // esm format file - import * as cjs from "inner/cjs/index.cjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. - import * as mjs from "inner/mjs/index.mjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. - import * as type from "inner/js/index.js"; - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. - export { cjs }; - export { mjs }; - export { type }; -==== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts (3 errors) ==== - // cjs format file - import * as cjs from "inner/cjs/index.cjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. - import * as mjs from "inner/mjs/index.mjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. - import * as type from "inner/js/index.js"; - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. - export { cjs }; - export { mjs }; - export { type }; -==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module", - } -==== tests/cases/conformance/node/allowJs/node_modules/inner/package.json (0 errors) ==== - { - "name": "inner", - "private": true, - "exports": { - "./cjs/*.cjs": "./*.cjs", - "./mjs/*.mjs": "./*.mjs", - "./js/*.js": "./*.js" - } - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node12).js b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node12).js deleted file mode 100644 index e10a987a399..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node12).js +++ /dev/null @@ -1,124 +0,0 @@ -//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsPackagePatternExportsTrailers.ts] //// - -//// [index.js] -// esm format file -import * as cjsi from "inner/cjs/index.cjs"; -import * as mjsi from "inner/mjs/index.mjs"; -import * as typei from "inner/js/index.js"; -cjsi; -mjsi; -typei; -//// [index.mjs] -// esm format file -import * as cjsi from "inner/cjs/index.cjs"; -import * as mjsi from "inner/mjs/index.mjs"; -import * as typei from "inner/js/index.js"; -cjsi; -mjsi; -typei; -//// [index.cjs] -// cjs format file -import * as cjsi from "inner/cjs/index.cjs"; -import * as mjsi from "inner/mjs/index.mjs"; -import * as typei from "inner/js/index.js"; -cjsi; -mjsi; -typei; -//// [index.d.ts] -// cjs format file -import * as cjs from "inner/cjs/index.cjs"; -import * as mjs from "inner/mjs/index.mjs"; -import * as type from "inner/js/index.js"; -export { cjs }; -export { mjs }; -export { type }; -//// [index.d.mts] -// esm format file -import * as cjs from "inner/cjs/index.cjs"; -import * as mjs from "inner/mjs/index.mjs"; -import * as type from "inner/js/index.js"; -export { cjs }; -export { mjs }; -export { type }; -//// [index.d.cts] -// cjs format file -import * as cjs from "inner/cjs/index.cjs"; -import * as mjs from "inner/mjs/index.mjs"; -import * as type from "inner/js/index.js"; -export { cjs }; -export { mjs }; -export { type }; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module", -} -//// [package.json] -{ - "name": "inner", - "private": true, - "exports": { - "./cjs/*.cjs": "./*.cjs", - "./mjs/*.mjs": "./*.mjs", - "./js/*.js": "./*.js" - } -} - -//// [index.js] -// esm format file -import * as cjsi from "inner/cjs/index.cjs"; -import * as mjsi from "inner/mjs/index.mjs"; -import * as typei from "inner/js/index.js"; -cjsi; -mjsi; -typei; -//// [index.mjs] -// esm format file -import * as cjsi from "inner/cjs/index.cjs"; -import * as mjsi from "inner/mjs/index.mjs"; -import * as typei from "inner/js/index.js"; -cjsi; -mjsi; -typei; -//// [index.cjs] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// cjs format file -const cjsi = __importStar(require("inner/cjs/index.cjs")); -const mjsi = __importStar(require("inner/mjs/index.mjs")); -const typei = __importStar(require("inner/js/index.js")); -cjsi; -mjsi; -typei; - - -//// [index.d.ts] -export {}; -//// [index.d.mts] -export {}; -//// [index.d.cts] -export {}; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node12).symbols b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node12).symbols deleted file mode 100644 index 870a2298dea..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node12).symbols +++ /dev/null @@ -1,120 +0,0 @@ -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -import * as cjsi from "inner/cjs/index.cjs"; ->cjsi : Symbol(cjsi, Decl(index.js, 1, 6)) - -import * as mjsi from "inner/mjs/index.mjs"; ->mjsi : Symbol(mjsi, Decl(index.js, 2, 6)) - -import * as typei from "inner/js/index.js"; ->typei : Symbol(typei, Decl(index.js, 3, 6)) - -cjsi; ->cjsi : Symbol(cjsi, Decl(index.js, 1, 6)) - -mjsi; ->mjsi : Symbol(mjsi, Decl(index.js, 2, 6)) - -typei; ->typei : Symbol(typei, Decl(index.js, 3, 6)) - -=== tests/cases/conformance/node/allowJs/index.mjs === -// esm format file -import * as cjsi from "inner/cjs/index.cjs"; ->cjsi : Symbol(cjsi, Decl(index.mjs, 1, 6)) - -import * as mjsi from "inner/mjs/index.mjs"; ->mjsi : Symbol(mjsi, Decl(index.mjs, 2, 6)) - -import * as typei from "inner/js/index.js"; ->typei : Symbol(typei, Decl(index.mjs, 3, 6)) - -cjsi; ->cjsi : Symbol(cjsi, Decl(index.mjs, 1, 6)) - -mjsi; ->mjsi : Symbol(mjsi, Decl(index.mjs, 2, 6)) - -typei; ->typei : Symbol(typei, Decl(index.mjs, 3, 6)) - -=== tests/cases/conformance/node/allowJs/index.cjs === -// cjs format file -import * as cjsi from "inner/cjs/index.cjs"; ->cjsi : Symbol(cjsi, Decl(index.cjs, 1, 6)) - -import * as mjsi from "inner/mjs/index.mjs"; ->mjsi : Symbol(mjsi, Decl(index.cjs, 2, 6)) - -import * as typei from "inner/js/index.js"; ->typei : Symbol(typei, Decl(index.cjs, 3, 6)) - -cjsi; ->cjsi : Symbol(cjsi, Decl(index.cjs, 1, 6)) - -mjsi; ->mjsi : Symbol(mjsi, Decl(index.cjs, 2, 6)) - -typei; ->typei : Symbol(typei, Decl(index.cjs, 3, 6)) - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts === -// cjs format file -import * as cjs from "inner/cjs/index.cjs"; ->cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) - -import * as mjs from "inner/mjs/index.mjs"; ->mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) - -import * as type from "inner/js/index.js"; ->type : Symbol(type, Decl(index.d.ts, 3, 6)) - -export { cjs }; ->cjs : Symbol(cjs, Decl(index.d.ts, 4, 8)) - -export { mjs }; ->mjs : Symbol(mjs, Decl(index.d.ts, 5, 8)) - -export { type }; ->type : Symbol(type, Decl(index.d.ts, 6, 8)) - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts === -// esm format file -import * as cjs from "inner/cjs/index.cjs"; ->cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) - -import * as mjs from "inner/mjs/index.mjs"; ->mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) - -import * as type from "inner/js/index.js"; ->type : Symbol(type, Decl(index.d.mts, 3, 6)) - -export { cjs }; ->cjs : Symbol(cjs, Decl(index.d.mts, 4, 8)) - -export { mjs }; ->mjs : Symbol(mjs, Decl(index.d.mts, 5, 8)) - -export { type }; ->type : Symbol(type, Decl(index.d.mts, 6, 8)) - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts === -// cjs format file -import * as cjs from "inner/cjs/index.cjs"; ->cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) - -import * as mjs from "inner/mjs/index.mjs"; ->mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) - -import * as type from "inner/js/index.js"; ->type : Symbol(type, Decl(index.d.cts, 3, 6)) - -export { cjs }; ->cjs : Symbol(cjs, Decl(index.d.cts, 4, 8)) - -export { mjs }; ->mjs : Symbol(mjs, Decl(index.d.cts, 5, 8)) - -export { type }; ->type : Symbol(type, Decl(index.d.cts, 6, 8)) - diff --git a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node12).types b/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node12).types deleted file mode 100644 index c35a6bdbf60..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsPackagePatternExportsTrailers(module=node12).types +++ /dev/null @@ -1,120 +0,0 @@ -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -import * as cjsi from "inner/cjs/index.cjs"; ->cjsi : any - -import * as mjsi from "inner/mjs/index.mjs"; ->mjsi : any - -import * as typei from "inner/js/index.js"; ->typei : any - -cjsi; ->cjsi : any - -mjsi; ->mjsi : any - -typei; ->typei : any - -=== tests/cases/conformance/node/allowJs/index.mjs === -// esm format file -import * as cjsi from "inner/cjs/index.cjs"; ->cjsi : any - -import * as mjsi from "inner/mjs/index.mjs"; ->mjsi : any - -import * as typei from "inner/js/index.js"; ->typei : any - -cjsi; ->cjsi : any - -mjsi; ->mjsi : any - -typei; ->typei : any - -=== tests/cases/conformance/node/allowJs/index.cjs === -// cjs format file -import * as cjsi from "inner/cjs/index.cjs"; ->cjsi : any - -import * as mjsi from "inner/mjs/index.mjs"; ->mjsi : any - -import * as typei from "inner/js/index.js"; ->typei : any - -cjsi; ->cjsi : any - -mjsi; ->mjsi : any - -typei; ->typei : any - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts === -// cjs format file -import * as cjs from "inner/cjs/index.cjs"; ->cjs : any - -import * as mjs from "inner/mjs/index.mjs"; ->mjs : any - -import * as type from "inner/js/index.js"; ->type : any - -export { cjs }; ->cjs : any - -export { mjs }; ->mjs : any - -export { type }; ->type : any - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts === -// esm format file -import * as cjs from "inner/cjs/index.cjs"; ->cjs : any - -import * as mjs from "inner/mjs/index.mjs"; ->mjs : any - -import * as type from "inner/js/index.js"; ->type : any - -export { cjs }; ->cjs : any - -export { mjs }; ->mjs : any - -export { type }; ->type : any - -=== tests/cases/conformance/node/allowJs/node_modules/inner/index.d.cts === -// cjs format file -import * as cjs from "inner/cjs/index.cjs"; ->cjs : any - -import * as mjs from "inner/mjs/index.mjs"; ->mjs : any - -import * as type from "inner/js/index.js"; ->type : any - -export { cjs }; ->cjs : any - -export { mjs }; ->mjs : any - -export { type }; ->type : any - diff --git a/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node12).errors.txt deleted file mode 100644 index c722192e670..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node12).errors.txt +++ /dev/null @@ -1,55 +0,0 @@ -tests/cases/conformance/node/allowJs/index.js(3,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/index.js(3,22): error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/index.js(5,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/subfolder/index.js(2,17): error TS1471: Module '../index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/subfolder/index.js(3,1): error TS8002: 'import ... =' can only be used in TypeScript files. -tests/cases/conformance/node/allowJs/subfolder/index.js(3,22): error TS1471: Module '../index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/allowJs/subfolder/index.js(5,1): error TS8002: 'import ... =' can only be used in TypeScript files. - - -==== tests/cases/conformance/node/allowJs/subfolder/index.js (4 errors) ==== - // cjs format file - import {h} from "../index.js"; - ~~~~~~~~~~~~~ -!!! error TS1471: Module '../index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import mod = require("../index.js"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - ~~~~~~~~~~~~~ -!!! error TS1471: Module '../index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import {f as _f} from "./index.js"; - import mod2 = require("./index.js"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - export async function f() { - const mod3 = await import ("../index.js"); - const mod4 = await import ("./index.js"); - h(); - } -==== tests/cases/conformance/node/allowJs/index.js (3 errors) ==== - // esm format file - import {h as _h} from "./index.js"; - import mod = require("./index.js"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - ~~~~~~~~~~~~ -!!! error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import {f} from "./subfolder/index.js"; - import mod2 = require("./subfolder/index.js"); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. - export async function h() { - const mod3 = await import ("./index.js"); - const mod4 = await import ("./subfolder/index.js"); - f(); - } -==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module" - } -==== tests/cases/conformance/node/allowJs/subfolder/package.json (0 errors) ==== - { - "type": "commonjs" - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node12).js b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node12).js deleted file mode 100644 index a02ef88f1e5..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node12).js +++ /dev/null @@ -1,60 +0,0 @@ -//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsSynchronousCallErrors.ts] //// - -//// [index.js] -// cjs format file -import {h} from "../index.js"; -import mod = require("../index.js"); -import {f as _f} from "./index.js"; -import mod2 = require("./index.js"); -export async function f() { - const mod3 = await import ("../index.js"); - const mod4 = await import ("./index.js"); - h(); -} -//// [index.js] -// esm format file -import {h as _h} from "./index.js"; -import mod = require("./index.js"); -import {f} from "./subfolder/index.js"; -import mod2 = require("./subfolder/index.js"); -export async function h() { - const mod3 = await import ("./index.js"); - const mod4 = await import ("./subfolder/index.js"); - f(); -} -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} - -//// [index.js] -import { f } from "./subfolder/index.js"; -export async function h() { - const mod3 = await import("./index.js"); - const mod4 = await import("./subfolder/index.js"); - f(); -} -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.f = void 0; -// cjs format file -const index_js_1 = require("../index.js"); -async function f() { - const mod3 = await import("../index.js"); - const mod4 = await import("./index.js"); - (0, index_js_1.h)(); -} -exports.f = f; - - -//// [index.d.ts] -export function h(): Promise; -//// [index.d.ts] -export function f(): Promise; diff --git a/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node12).symbols b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node12).symbols deleted file mode 100644 index 8cbba01b82f..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node12).symbols +++ /dev/null @@ -1,58 +0,0 @@ -=== tests/cases/conformance/node/allowJs/subfolder/index.js === -// cjs format file -import {h} from "../index.js"; ->h : Symbol(h, Decl(index.js, 1, 8)) - -import mod = require("../index.js"); ->mod : Symbol(mod, Decl(index.js, 1, 30)) - -import {f as _f} from "./index.js"; ->f : Symbol(f, Decl(index.js, 4, 36)) ->_f : Symbol(_f, Decl(index.js, 3, 8)) - -import mod2 = require("./index.js"); ->mod2 : Symbol(mod2, Decl(index.js, 3, 35)) - -export async function f() { ->f : Symbol(f, Decl(index.js, 4, 36)) - - const mod3 = await import ("../index.js"); ->mod3 : Symbol(mod3, Decl(index.js, 6, 9)) ->"../index.js" : Symbol(mod, Decl(index.js, 0, 0)) - - const mod4 = await import ("./index.js"); ->mod4 : Symbol(mod4, Decl(index.js, 7, 9)) ->"./index.js" : Symbol(mod2, Decl(index.js, 0, 0)) - - h(); ->h : Symbol(h, Decl(index.js, 1, 8)) -} -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -import {h as _h} from "./index.js"; ->h : Symbol(h, Decl(index.js, 4, 46)) ->_h : Symbol(_h, Decl(index.js, 1, 8)) - -import mod = require("./index.js"); ->mod : Symbol(mod, Decl(index.js, 1, 35)) - -import {f} from "./subfolder/index.js"; ->f : Symbol(f, Decl(index.js, 3, 8)) - -import mod2 = require("./subfolder/index.js"); ->mod2 : Symbol(mod2, Decl(index.js, 3, 39)) - -export async function h() { ->h : Symbol(h, Decl(index.js, 4, 46)) - - const mod3 = await import ("./index.js"); ->mod3 : Symbol(mod3, Decl(index.js, 6, 9)) ->"./index.js" : Symbol(mod, Decl(index.js, 0, 0)) - - const mod4 = await import ("./subfolder/index.js"); ->mod4 : Symbol(mod4, Decl(index.js, 7, 9)) ->"./subfolder/index.js" : Symbol(mod2, Decl(index.js, 0, 0)) - - f(); ->f : Symbol(f, Decl(index.js, 3, 8)) -} diff --git a/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node12).types b/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node12).types deleted file mode 100644 index dde67707808..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsSynchronousCallErrors(module=node12).types +++ /dev/null @@ -1,68 +0,0 @@ -=== tests/cases/conformance/node/allowJs/subfolder/index.js === -// cjs format file -import {h} from "../index.js"; ->h : () => Promise - -import mod = require("../index.js"); ->mod : typeof mod - -import {f as _f} from "./index.js"; ->f : () => Promise ->_f : () => Promise - -import mod2 = require("./index.js"); ->mod2 : typeof mod2 - -export async function f() { ->f : () => Promise - - const mod3 = await import ("../index.js"); ->mod3 : typeof mod ->await import ("../index.js") : typeof mod ->import ("../index.js") : Promise ->"../index.js" : "../index.js" - - const mod4 = await import ("./index.js"); ->mod4 : { default: typeof mod2; f(): Promise; } ->await import ("./index.js") : { default: typeof mod2; f(): Promise; } ->import ("./index.js") : Promise<{ default: typeof mod2; f(): Promise; }> ->"./index.js" : "./index.js" - - h(); ->h() : Promise ->h : () => Promise -} -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -import {h as _h} from "./index.js"; ->h : () => Promise ->_h : () => Promise - -import mod = require("./index.js"); ->mod : typeof mod - -import {f} from "./subfolder/index.js"; ->f : () => Promise - -import mod2 = require("./subfolder/index.js"); ->mod2 : typeof mod2 - -export async function h() { ->h : () => Promise - - const mod3 = await import ("./index.js"); ->mod3 : typeof mod ->await import ("./index.js") : typeof mod ->import ("./index.js") : Promise ->"./index.js" : "./index.js" - - const mod4 = await import ("./subfolder/index.js"); ->mod4 : { default: typeof mod2; f(): Promise; } ->await import ("./subfolder/index.js") : { default: typeof mod2; f(): Promise; } ->import ("./subfolder/index.js") : Promise<{ default: typeof mod2; f(): Promise; }> ->"./subfolder/index.js" : "./subfolder/index.js" - - f(); ->f() : Promise ->f : () => Promise -} diff --git a/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node12).errors.txt b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node12).errors.txt deleted file mode 100644 index b7096bfd56e..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node12).errors.txt +++ /dev/null @@ -1,34 +0,0 @@ -tests/cases/conformance/node/allowJs/index.js(2,11): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. -tests/cases/conformance/node/allowJs/index.js(4,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. -tests/cases/conformance/node/allowJs/subfolder/index.js(2,11): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. -tests/cases/conformance/node/allowJs/subfolder/index.js(4,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. - - -==== tests/cases/conformance/node/allowJs/subfolder/index.js (2 errors) ==== - // cjs format file - const x = await 1; - ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. - export {x}; - for await (const y of []) {} - ~~~~~ -!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. -==== tests/cases/conformance/node/allowJs/index.js (2 errors) ==== - // esm format file - const x = await 1; - ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. - export {x}; - for await (const y of []) {} - ~~~~~ -!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. -==== tests/cases/conformance/node/allowJs/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module" - } -==== tests/cases/conformance/node/allowJs/subfolder/package.json (0 errors) ==== - { - "type": "commonjs" - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node12).js b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node12).js deleted file mode 100644 index 354fe725f09..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node12).js +++ /dev/null @@ -1,42 +0,0 @@ -//// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsTopLevelAwait.ts] //// - -//// [index.js] -// cjs format file -const x = await 1; -export {x}; -for await (const y of []) {} -//// [index.js] -// esm format file -const x = await 1; -export {x}; -for await (const y of []) {} -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.x = void 0; -// cjs format file -const x = await 1; -exports.x = x; -for await (const y of []) { } -//// [index.js] -// esm format file -const x = await 1; -export { x }; -for await (const y of []) { } - - -//// [index.d.ts] -export const x: 1; -//// [index.d.ts] -export const x: 1; diff --git a/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node12).symbols b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node12).symbols deleted file mode 100644 index 09ad69c019c..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node12).symbols +++ /dev/null @@ -1,22 +0,0 @@ -=== tests/cases/conformance/node/allowJs/subfolder/index.js === -// cjs format file -const x = await 1; ->x : Symbol(x, Decl(index.js, 1, 5)) - -export {x}; ->x : Symbol(x, Decl(index.js, 2, 8)) - -for await (const y of []) {} ->y : Symbol(y, Decl(index.js, 3, 16)) - -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -const x = await 1; ->x : Symbol(x, Decl(index.js, 1, 5)) - -export {x}; ->x : Symbol(x, Decl(index.js, 2, 8)) - -for await (const y of []) {} ->y : Symbol(y, Decl(index.js, 3, 16)) - diff --git a/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node12).types b/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node12).types deleted file mode 100644 index b50bdd2c107..00000000000 --- a/tests/baselines/reference/nodeModulesAllowJsTopLevelAwait(module=node12).types +++ /dev/null @@ -1,28 +0,0 @@ -=== tests/cases/conformance/node/allowJs/subfolder/index.js === -// cjs format file -const x = await 1; ->x : 1 ->await 1 : 1 ->1 : 1 - -export {x}; ->x : 1 - -for await (const y of []) {} ->y : any ->[] : undefined[] - -=== tests/cases/conformance/node/allowJs/index.js === -// esm format file -const x = await 1; ->x : 1 ->await 1 : 1 ->1 : 1 - -export {x}; ->x : 1 - -for await (const y of []) {} ->y : any ->[] : undefined[] - diff --git a/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node12).js b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node12).js deleted file mode 100644 index f0c9198a513..00000000000 --- a/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node12).js +++ /dev/null @@ -1,36 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesCjsFormatFileAlwaysHasDefault.ts] //// - -//// [index.ts] -// cjs format file -export const a = 1; -//// [index.ts] -// esm format file -import mod from "./subfolder/index.js"; -mod; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.a = void 0; -// cjs format file -exports.a = 1; -//// [index.js] -// esm format file -import mod from "./subfolder/index.js"; -mod; - - -//// [index.d.ts] -export declare const a = 1; -//// [index.d.ts] -export {}; diff --git a/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node12).symbols b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node12).symbols deleted file mode 100644 index 0d676181e27..00000000000 --- a/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node12).symbols +++ /dev/null @@ -1,13 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -export const a = 1; ->a : Symbol(a, Decl(index.ts, 1, 12)) - -=== tests/cases/conformance/node/index.ts === -// esm format file -import mod from "./subfolder/index.js"; ->mod : Symbol(mod, Decl(index.ts, 1, 6)) - -mod; ->mod : Symbol(mod, Decl(index.ts, 1, 6)) - diff --git a/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node12).types b/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node12).types deleted file mode 100644 index abbc4f1b40e..00000000000 --- a/tests/baselines/reference/nodeModulesCjsFormatFileAlwaysHasDefault(module=node12).types +++ /dev/null @@ -1,14 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -export const a = 1; ->a : 1 ->1 : 1 - -=== tests/cases/conformance/node/index.ts === -// esm format file -import mod from "./subfolder/index.js"; ->mod : typeof mod - -mod; ->mod : typeof mod - diff --git a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node12).errors.txt b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node12).errors.txt deleted file mode 100644 index 7397e1e1dbd..00000000000 --- a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node12).errors.txt +++ /dev/null @@ -1,135 +0,0 @@ -tests/cases/conformance/node/index.cts(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.cts(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/node_modules/inner/index.d.mts(2,13): error TS2303: Circular definition of import alias 'cjs'. -tests/cases/conformance/node/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. - - -==== tests/cases/conformance/node/index.ts (0 errors) ==== - // esm format file - import * as cjs from "package/cjs"; - import * as mjs from "package/mjs"; - import * as type from "package"; - cjs; - mjs; - type; - import * as cjsi from "inner/a"; - import * as mjsi from "inner/b"; - import * as typei from "inner"; - import * as ts from "inner/types"; - cjsi.mjsSource; - mjsi.mjsSource; - typei.mjsSource; - ts.mjsSource; -==== tests/cases/conformance/node/index.mts (0 errors) ==== - // esm format file - import * as cjs from "package/cjs"; - import * as mjs from "package/mjs"; - import * as type from "package"; - cjs; - mjs; - type; - import * as cjsi from "inner/a"; - import * as mjsi from "inner/b"; - import * as typei from "inner"; - import * as ts from "inner/types"; - cjsi.mjsSource; - mjsi.mjsSource; - typei.mjsSource; - ts.mjsSource; -==== tests/cases/conformance/node/index.cts (2 errors) ==== - // cjs format file - import * as cjs from "package/cjs"; - import * as mjs from "package/mjs"; - ~~~~~~~~~~~~~ -!!! error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as type from "package"; - ~~~~~~~~~ -!!! error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - cjs; - mjs; - type; - import * as cjsi from "inner/a"; - import * as mjsi from "inner/b"; - import * as typei from "inner"; - import * as ts from "inner/types"; - cjsi.cjsSource; - mjsi.cjsSource; - typei.implicitCjsSource; - ts.cjsSource; -==== tests/cases/conformance/node/node_modules/inner/index.d.ts (1 errors) ==== - // cjs format file - import * as cjs from "inner/a"; - ~~~ -!!! error TS2303: Circular definition of import alias 'cjs'. - import * as mjs from "inner/b"; - import * as type from "inner"; - import * as ts from "inner/types"; - export { cjs }; - export { mjs }; - export { type }; - export { ts }; - export const implicitCjsSource = true; -==== tests/cases/conformance/node/node_modules/inner/index.d.mts (1 errors) ==== - // esm format file - import * as cjs from "inner/a"; - ~~~ -!!! error TS2303: Circular definition of import alias 'cjs'. - import * as mjs from "inner/b"; - import * as type from "inner"; - import * as ts from "inner/types"; - export { cjs }; - export { mjs }; - export { type }; - export { ts }; - export const mjsSource = true; -==== tests/cases/conformance/node/node_modules/inner/index.d.cts (0 errors) ==== - // cjs format file - import * as cjs from "inner/a"; - import * as mjs from "inner/b"; - import * as type from "inner"; - import * as ts from "inner/types"; - export { cjs }; - export { mjs }; - export { type }; - export { ts }; - export const cjsSource = true; -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module", - "exports": { - "./cjs": "./index.cjs", - "./mjs": "./index.mjs", - ".": "./index.js" - } - } -==== tests/cases/conformance/node/node_modules/inner/package.json (0 errors) ==== - { - "name": "inner", - "private": true, - "exports": { - "./a": { - "require": "./index.cjs", - "node": "./index.mjs" - }, - "./b": { - "import": "./index.mjs", - "node": "./index.cjs" - }, - ".": { - "import": "./index.mjs", - "node": "./index.js" - }, - "./types": { - "types": { - "import": "./index.d.mts", - "require": "./index.d.cts", - }, - "node": { - "import": "./index.mjs", - "require": "./index.cjs" - } - } - } - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node12).js b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node12).js deleted file mode 100644 index a67f7fdfdd4..00000000000 --- a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node12).js +++ /dev/null @@ -1,205 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesConditionalPackageExports.ts] //// - -//// [index.ts] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/a"; -import * as mjsi from "inner/b"; -import * as typei from "inner"; -import * as ts from "inner/types"; -cjsi.mjsSource; -mjsi.mjsSource; -typei.mjsSource; -ts.mjsSource; -//// [index.mts] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/a"; -import * as mjsi from "inner/b"; -import * as typei from "inner"; -import * as ts from "inner/types"; -cjsi.mjsSource; -mjsi.mjsSource; -typei.mjsSource; -ts.mjsSource; -//// [index.cts] -// cjs format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/a"; -import * as mjsi from "inner/b"; -import * as typei from "inner"; -import * as ts from "inner/types"; -cjsi.cjsSource; -mjsi.cjsSource; -typei.implicitCjsSource; -ts.cjsSource; -//// [index.d.ts] -// cjs format file -import * as cjs from "inner/a"; -import * as mjs from "inner/b"; -import * as type from "inner"; -import * as ts from "inner/types"; -export { cjs }; -export { mjs }; -export { type }; -export { ts }; -export const implicitCjsSource = true; -//// [index.d.mts] -// esm format file -import * as cjs from "inner/a"; -import * as mjs from "inner/b"; -import * as type from "inner"; -import * as ts from "inner/types"; -export { cjs }; -export { mjs }; -export { type }; -export { ts }; -export const mjsSource = true; -//// [index.d.cts] -// cjs format file -import * as cjs from "inner/a"; -import * as mjs from "inner/b"; -import * as type from "inner"; -import * as ts from "inner/types"; -export { cjs }; -export { mjs }; -export { type }; -export { ts }; -export const cjsSource = true; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module", - "exports": { - "./cjs": "./index.cjs", - "./mjs": "./index.mjs", - ".": "./index.js" - } -} -//// [package.json] -{ - "name": "inner", - "private": true, - "exports": { - "./a": { - "require": "./index.cjs", - "node": "./index.mjs" - }, - "./b": { - "import": "./index.mjs", - "node": "./index.cjs" - }, - ".": { - "import": "./index.mjs", - "node": "./index.js" - }, - "./types": { - "types": { - "import": "./index.d.mts", - "require": "./index.d.cts", - }, - "node": { - "import": "./index.mjs", - "require": "./index.cjs" - } - } - } -} - -//// [index.mjs] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/a"; -import * as mjsi from "inner/b"; -import * as typei from "inner"; -import * as ts from "inner/types"; -cjsi.mjsSource; -mjsi.mjsSource; -typei.mjsSource; -ts.mjsSource; -//// [index.cjs] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// cjs format file -const cjs = __importStar(require("package/cjs")); -const mjs = __importStar(require("package/mjs")); -const type = __importStar(require("package")); -cjs; -mjs; -type; -const cjsi = __importStar(require("inner/a")); -const mjsi = __importStar(require("inner/b")); -const typei = __importStar(require("inner")); -const ts = __importStar(require("inner/types")); -cjsi.cjsSource; -mjsi.cjsSource; -typei.implicitCjsSource; -ts.cjsSource; -//// [index.js] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/a"; -import * as mjsi from "inner/b"; -import * as typei from "inner"; -import * as ts from "inner/types"; -cjsi.mjsSource; -mjsi.mjsSource; -typei.mjsSource; -ts.mjsSource; - - -//// [index.d.mts] -export {}; -//// [index.d.cts] -export {}; -//// [index.d.ts] -export {}; diff --git a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node12).symbols b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node12).symbols deleted file mode 100644 index 88fdfed4eaa..00000000000 --- a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node12).symbols +++ /dev/null @@ -1,243 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import * as cjs from "package/cjs"; ->cjs : Symbol(cjs, Decl(index.ts, 1, 6)) - -import * as mjs from "package/mjs"; ->mjs : Symbol(mjs, Decl(index.ts, 2, 6)) - -import * as type from "package"; ->type : Symbol(type, Decl(index.ts, 3, 6)) - -cjs; ->cjs : Symbol(cjs, Decl(index.ts, 1, 6)) - -mjs; ->mjs : Symbol(mjs, Decl(index.ts, 2, 6)) - -type; ->type : Symbol(type, Decl(index.ts, 3, 6)) - -import * as cjsi from "inner/a"; ->cjsi : Symbol(cjsi, Decl(index.ts, 7, 6)) - -import * as mjsi from "inner/b"; ->mjsi : Symbol(mjsi, Decl(index.ts, 8, 6)) - -import * as typei from "inner"; ->typei : Symbol(typei, Decl(index.ts, 9, 6)) - -import * as ts from "inner/types"; ->ts : Symbol(ts, Decl(index.ts, 10, 6)) - -cjsi.mjsSource; ->cjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) ->cjsi : Symbol(cjsi, Decl(index.ts, 7, 6)) ->mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) - -mjsi.mjsSource; ->mjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) ->mjsi : Symbol(mjsi, Decl(index.ts, 8, 6)) ->mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) - -typei.mjsSource; ->typei.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) ->typei : Symbol(typei, Decl(index.ts, 9, 6)) ->mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) - -ts.mjsSource; ->ts.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) ->ts : Symbol(ts, Decl(index.ts, 10, 6)) ->mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) - -=== tests/cases/conformance/node/index.mts === -// esm format file -import * as cjs from "package/cjs"; ->cjs : Symbol(cjs, Decl(index.mts, 1, 6)) - -import * as mjs from "package/mjs"; ->mjs : Symbol(mjs, Decl(index.mts, 2, 6)) - -import * as type from "package"; ->type : Symbol(type, Decl(index.mts, 3, 6)) - -cjs; ->cjs : Symbol(cjs, Decl(index.mts, 1, 6)) - -mjs; ->mjs : Symbol(mjs, Decl(index.mts, 2, 6)) - -type; ->type : Symbol(type, Decl(index.mts, 3, 6)) - -import * as cjsi from "inner/a"; ->cjsi : Symbol(cjsi, Decl(index.mts, 7, 6)) - -import * as mjsi from "inner/b"; ->mjsi : Symbol(mjsi, Decl(index.mts, 8, 6)) - -import * as typei from "inner"; ->typei : Symbol(typei, Decl(index.mts, 9, 6)) - -import * as ts from "inner/types"; ->ts : Symbol(ts, Decl(index.mts, 10, 6)) - -cjsi.mjsSource; ->cjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) ->cjsi : Symbol(cjsi, Decl(index.mts, 7, 6)) ->mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) - -mjsi.mjsSource; ->mjsi.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) ->mjsi : Symbol(mjsi, Decl(index.mts, 8, 6)) ->mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) - -typei.mjsSource; ->typei.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) ->typei : Symbol(typei, Decl(index.mts, 9, 6)) ->mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) - -ts.mjsSource; ->ts.mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) ->ts : Symbol(ts, Decl(index.mts, 10, 6)) ->mjsSource : Symbol(cjsi.mjsSource, Decl(index.d.mts, 9, 12)) - -=== tests/cases/conformance/node/index.cts === -// cjs format file -import * as cjs from "package/cjs"; ->cjs : Symbol(cjs, Decl(index.cts, 1, 6)) - -import * as mjs from "package/mjs"; ->mjs : Symbol(mjs, Decl(index.cts, 2, 6)) - -import * as type from "package"; ->type : Symbol(type, Decl(index.cts, 3, 6)) - -cjs; ->cjs : Symbol(cjs, Decl(index.cts, 1, 6)) - -mjs; ->mjs : Symbol(mjs, Decl(index.cts, 2, 6)) - -type; ->type : Symbol(type, Decl(index.cts, 3, 6)) - -import * as cjsi from "inner/a"; ->cjsi : Symbol(cjsi, Decl(index.cts, 7, 6)) - -import * as mjsi from "inner/b"; ->mjsi : Symbol(mjsi, Decl(index.cts, 8, 6)) - -import * as typei from "inner"; ->typei : Symbol(typei, Decl(index.cts, 9, 6)) - -import * as ts from "inner/types"; ->ts : Symbol(ts, Decl(index.cts, 10, 6)) - -cjsi.cjsSource; ->cjsi.cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) ->cjsi : Symbol(cjsi, Decl(index.cts, 7, 6)) ->cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) - -mjsi.cjsSource; ->mjsi.cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) ->mjsi : Symbol(mjsi, Decl(index.cts, 8, 6)) ->cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) - -typei.implicitCjsSource; ->typei.implicitCjsSource : Symbol(cjsi.type.implicitCjsSource, Decl(index.d.ts, 9, 12)) ->typei : Symbol(typei, Decl(index.cts, 9, 6)) ->implicitCjsSource : Symbol(cjsi.type.implicitCjsSource, Decl(index.d.ts, 9, 12)) - -ts.cjsSource; ->ts.cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) ->ts : Symbol(ts, Decl(index.cts, 10, 6)) ->cjsSource : Symbol(cjsi.cjsSource, Decl(index.d.cts, 9, 12)) - -=== tests/cases/conformance/node/node_modules/inner/index.d.ts === -// cjs format file -import * as cjs from "inner/a"; ->cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) - -import * as mjs from "inner/b"; ->mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) - -import * as type from "inner"; ->type : Symbol(type, Decl(index.d.ts, 3, 6)) - -import * as ts from "inner/types"; ->ts : Symbol(ts, Decl(index.d.ts, 4, 6)) - -export { cjs }; ->cjs : Symbol(mjs.type.cjs, Decl(index.d.ts, 5, 8)) - -export { mjs }; ->mjs : Symbol(mjs.type.mjs, Decl(index.d.ts, 6, 8)) - -export { type }; ->type : Symbol(mjs.type.type, Decl(index.d.ts, 7, 8)) - -export { ts }; ->ts : Symbol(mjs.type.ts, Decl(index.d.ts, 8, 8)) - -export const implicitCjsSource = true; ->implicitCjsSource : Symbol(mjs.type.implicitCjsSource, Decl(index.d.ts, 9, 12)) - -=== tests/cases/conformance/node/node_modules/inner/index.d.mts === -// esm format file -import * as cjs from "inner/a"; ->cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) - -import * as mjs from "inner/b"; ->mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) - -import * as type from "inner"; ->type : Symbol(type, Decl(index.d.mts, 3, 6)) - -import * as ts from "inner/types"; ->ts : Symbol(ts, Decl(index.d.mts, 4, 6)) - -export { cjs }; ->cjs : Symbol(mjs.cjs, Decl(index.d.mts, 5, 8)) - -export { mjs }; ->mjs : Symbol(mjs.mjs, Decl(index.d.mts, 6, 8)) - -export { type }; ->type : Symbol(mjs.type, Decl(index.d.mts, 7, 8)) - -export { ts }; ->ts : Symbol(mjs.ts, Decl(index.d.mts, 8, 8)) - -export const mjsSource = true; ->mjsSource : Symbol(mjs.mjsSource, Decl(index.d.mts, 9, 12)) - -=== tests/cases/conformance/node/node_modules/inner/index.d.cts === -// cjs format file -import * as cjs from "inner/a"; ->cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) - -import * as mjs from "inner/b"; ->mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) - -import * as type from "inner"; ->type : Symbol(type, Decl(index.d.cts, 3, 6)) - -import * as ts from "inner/types"; ->ts : Symbol(ts, Decl(index.d.cts, 4, 6)) - -export { cjs }; ->cjs : Symbol(cjs.cjs, Decl(index.d.cts, 5, 8)) - -export { mjs }; ->mjs : Symbol(cjs.mjs, Decl(index.d.cts, 6, 8)) - -export { type }; ->type : Symbol(cjs.type, Decl(index.d.cts, 7, 8)) - -export { ts }; ->ts : Symbol(cjs.ts, Decl(index.d.cts, 8, 8)) - -export const cjsSource = true; ->cjsSource : Symbol(cjs.cjsSource, Decl(index.d.cts, 9, 12)) - diff --git a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node12).types b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node12).types deleted file mode 100644 index d46ce7ffa46..00000000000 --- a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node12).types +++ /dev/null @@ -1,246 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import * as cjs from "package/cjs"; ->cjs : typeof cjs - -import * as mjs from "package/mjs"; ->mjs : typeof mjs - -import * as type from "package"; ->type : typeof type - -cjs; ->cjs : typeof cjs - -mjs; ->mjs : typeof mjs - -type; ->type : typeof type - -import * as cjsi from "inner/a"; ->cjsi : typeof cjsi - -import * as mjsi from "inner/b"; ->mjsi : typeof cjsi - -import * as typei from "inner"; ->typei : typeof cjsi - -import * as ts from "inner/types"; ->ts : typeof cjsi - -cjsi.mjsSource; ->cjsi.mjsSource : true ->cjsi : typeof cjsi ->mjsSource : true - -mjsi.mjsSource; ->mjsi.mjsSource : true ->mjsi : typeof cjsi ->mjsSource : true - -typei.mjsSource; ->typei.mjsSource : true ->typei : typeof cjsi ->mjsSource : true - -ts.mjsSource; ->ts.mjsSource : true ->ts : typeof cjsi ->mjsSource : true - -=== tests/cases/conformance/node/index.mts === -// esm format file -import * as cjs from "package/cjs"; ->cjs : typeof cjs - -import * as mjs from "package/mjs"; ->mjs : typeof mjs - -import * as type from "package"; ->type : typeof type - -cjs; ->cjs : typeof cjs - -mjs; ->mjs : typeof mjs - -type; ->type : typeof type - -import * as cjsi from "inner/a"; ->cjsi : typeof cjsi - -import * as mjsi from "inner/b"; ->mjsi : typeof cjsi - -import * as typei from "inner"; ->typei : typeof cjsi - -import * as ts from "inner/types"; ->ts : typeof cjsi - -cjsi.mjsSource; ->cjsi.mjsSource : true ->cjsi : typeof cjsi ->mjsSource : true - -mjsi.mjsSource; ->mjsi.mjsSource : true ->mjsi : typeof cjsi ->mjsSource : true - -typei.mjsSource; ->typei.mjsSource : true ->typei : typeof cjsi ->mjsSource : true - -ts.mjsSource; ->ts.mjsSource : true ->ts : typeof cjsi ->mjsSource : true - -=== tests/cases/conformance/node/index.cts === -// cjs format file -import * as cjs from "package/cjs"; ->cjs : typeof cjs - -import * as mjs from "package/mjs"; ->mjs : typeof mjs - -import * as type from "package"; ->type : typeof type - -cjs; ->cjs : typeof cjs - -mjs; ->mjs : typeof mjs - -type; ->type : typeof type - -import * as cjsi from "inner/a"; ->cjsi : typeof cjsi - -import * as mjsi from "inner/b"; ->mjsi : typeof cjsi - -import * as typei from "inner"; ->typei : typeof cjsi.type - -import * as ts from "inner/types"; ->ts : typeof cjsi - -cjsi.cjsSource; ->cjsi.cjsSource : true ->cjsi : typeof cjsi ->cjsSource : true - -mjsi.cjsSource; ->mjsi.cjsSource : true ->mjsi : typeof cjsi ->cjsSource : true - -typei.implicitCjsSource; ->typei.implicitCjsSource : true ->typei : typeof cjsi.type ->implicitCjsSource : true - -ts.cjsSource; ->ts.cjsSource : true ->ts : typeof cjsi ->cjsSource : true - -=== tests/cases/conformance/node/node_modules/inner/index.d.ts === -// cjs format file -import * as cjs from "inner/a"; ->cjs : any - -import * as mjs from "inner/b"; ->mjs : typeof mjs - -import * as type from "inner"; ->type : typeof mjs.type - -import * as ts from "inner/types"; ->ts : typeof mjs - -export { cjs }; ->cjs : any - -export { mjs }; ->mjs : typeof mjs - -export { type }; ->type : typeof mjs.type - -export { ts }; ->ts : typeof mjs - -export const implicitCjsSource = true; ->implicitCjsSource : true ->true : true - -=== tests/cases/conformance/node/node_modules/inner/index.d.mts === -// esm format file -import * as cjs from "inner/a"; ->cjs : any - -import * as mjs from "inner/b"; ->mjs : typeof mjs - -import * as type from "inner"; ->type : typeof mjs - -import * as ts from "inner/types"; ->ts : typeof mjs - -export { cjs }; ->cjs : any - -export { mjs }; ->mjs : typeof mjs - -export { type }; ->type : typeof mjs - -export { ts }; ->ts : typeof mjs - -export const mjsSource = true; ->mjsSource : true ->true : true - -=== tests/cases/conformance/node/node_modules/inner/index.d.cts === -// cjs format file -import * as cjs from "inner/a"; ->cjs : typeof cjs - -import * as mjs from "inner/b"; ->mjs : typeof cjs - -import * as type from "inner"; ->type : typeof cjs.type - -import * as ts from "inner/types"; ->ts : typeof cjs - -export { cjs }; ->cjs : typeof cjs - -export { mjs }; ->mjs : typeof cjs - -export { type }; ->type : typeof cjs.type - -export { ts }; ->ts : typeof cjs - -export const cjsSource = true; ->cjsSource : true ->true : true - diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node12).errors.txt b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node12).errors.txt deleted file mode 100644 index 11f39b9dd93..00000000000 --- a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node12).errors.txt +++ /dev/null @@ -1,116 +0,0 @@ -tests/cases/conformance/node/index.cts(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.cts(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.cts(9,23): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/node_modules/inner/index.d.cts(3,22): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/node_modules/inner/index.d.cts(5,1): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/conformance/node/node_modules/inner/index.d.mts(5,1): error TS1036: Statements are not allowed in ambient contexts. -tests/cases/conformance/node/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/node_modules/inner/index.d.ts(5,1): error TS1036: Statements are not allowed in ambient contexts. - - -==== tests/cases/conformance/node/index.ts (0 errors) ==== - // esm format file - import * as cjs from "package/cjs"; - import * as mjs from "package/mjs"; - import * as type from "package"; - export const a = cjs; - export const b = mjs; - export const c = type; - import * as cjsi from "inner/cjs"; - import * as mjsi from "inner/mjs"; - import * as typei from "inner"; - export const d = cjsi; - export const e = mjsi; - export const f = typei; -==== tests/cases/conformance/node/index.mts (0 errors) ==== - // esm format file - import * as cjs from "package/cjs"; - import * as mjs from "package/mjs"; - import * as type from "package"; - export const a = cjs; - export const b = mjs; - export const c = type; - import * as cjsi from "inner/cjs"; - import * as mjsi from "inner/mjs"; - import * as typei from "inner"; - export const d = cjsi; - export const e = mjsi; - export const f = typei; -==== tests/cases/conformance/node/index.cts (3 errors) ==== - // cjs format file - import * as cjs from "package/cjs"; - import * as mjs from "package/mjs"; - ~~~~~~~~~~~~~ -!!! error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as type from "package"; - ~~~~~~~~~ -!!! error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - export const a = cjs; - export const b = mjs; - export const c = type; - import * as cjsi from "inner/cjs"; - import * as mjsi from "inner/mjs"; - ~~~~~~~~~~~ -!!! error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as typei from "inner"; - export const d = cjsi; - export const e = mjsi; - export const f = typei; -==== tests/cases/conformance/node/node_modules/inner/index.d.ts (2 errors) ==== - // cjs format file - import * as cjs from "inner/cjs"; - import * as mjs from "inner/mjs"; - ~~~~~~~~~~~ -!!! error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as type from "inner"; - cjs; - ~~~ -!!! error TS1036: Statements are not allowed in ambient contexts. - mjs; - type; - export const cjsMain = true; -==== tests/cases/conformance/node/node_modules/inner/index.d.mts (1 errors) ==== - // esm format file - import * as cjs from "inner/cjs"; - import * as mjs from "inner/mjs"; - import * as type from "inner"; - cjs; - ~~~ -!!! error TS1036: Statements are not allowed in ambient contexts. - mjs; - type; - export const esm = true; -==== tests/cases/conformance/node/node_modules/inner/index.d.cts (2 errors) ==== - // cjs format file - import * as cjs from "inner/cjs"; - import * as mjs from "inner/mjs"; - ~~~~~~~~~~~ -!!! error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as type from "inner"; - cjs; - ~~~ -!!! error TS1036: Statements are not allowed in ambient contexts. - mjs; - type; - export const cjsNonmain = true; -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module", - "exports": { - "./cjs": "./index.cjs", - "./mjs": "./index.mjs", - ".": "./index.js" - } - } -==== tests/cases/conformance/node/node_modules/inner/package.json (0 errors) ==== - { - "name": "inner", - "private": true, - "exports": { - "./cjs": "./index.cjs", - "./mjs": "./index.mjs", - ".": "./index.js" - } - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node12).js b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node12).js deleted file mode 100644 index 7500542fd8d..00000000000 --- a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node12).js +++ /dev/null @@ -1,202 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesDeclarationEmitWithPackageExports.ts] //// - -//// [index.ts] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -export const a = cjs; -export const b = mjs; -export const c = type; -import * as cjsi from "inner/cjs"; -import * as mjsi from "inner/mjs"; -import * as typei from "inner"; -export const d = cjsi; -export const e = mjsi; -export const f = typei; -//// [index.mts] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -export const a = cjs; -export const b = mjs; -export const c = type; -import * as cjsi from "inner/cjs"; -import * as mjsi from "inner/mjs"; -import * as typei from "inner"; -export const d = cjsi; -export const e = mjsi; -export const f = typei; -//// [index.cts] -// cjs format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -export const a = cjs; -export const b = mjs; -export const c = type; -import * as cjsi from "inner/cjs"; -import * as mjsi from "inner/mjs"; -import * as typei from "inner"; -export const d = cjsi; -export const e = mjsi; -export const f = typei; -//// [index.d.ts] -// cjs format file -import * as cjs from "inner/cjs"; -import * as mjs from "inner/mjs"; -import * as type from "inner"; -cjs; -mjs; -type; -export const cjsMain = true; -//// [index.d.mts] -// esm format file -import * as cjs from "inner/cjs"; -import * as mjs from "inner/mjs"; -import * as type from "inner"; -cjs; -mjs; -type; -export const esm = true; -//// [index.d.cts] -// cjs format file -import * as cjs from "inner/cjs"; -import * as mjs from "inner/mjs"; -import * as type from "inner"; -cjs; -mjs; -type; -export const cjsNonmain = true; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module", - "exports": { - "./cjs": "./index.cjs", - "./mjs": "./index.mjs", - ".": "./index.js" - } -} -//// [package.json] -{ - "name": "inner", - "private": true, - "exports": { - "./cjs": "./index.cjs", - "./mjs": "./index.mjs", - ".": "./index.js" - } -} - -//// [index.mjs] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -export const a = cjs; -export const b = mjs; -export const c = type; -import * as cjsi from "inner/cjs"; -import * as mjsi from "inner/mjs"; -import * as typei from "inner"; -export const d = cjsi; -export const e = mjsi; -export const f = typei; -//// [index.cjs] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.f = exports.e = exports.d = exports.c = exports.b = exports.a = void 0; -// cjs format file -const cjs = __importStar(require("package/cjs")); -const mjs = __importStar(require("package/mjs")); -const type = __importStar(require("package")); -exports.a = cjs; -exports.b = mjs; -exports.c = type; -const cjsi = __importStar(require("inner/cjs")); -const mjsi = __importStar(require("inner/mjs")); -const typei = __importStar(require("inner")); -exports.d = cjsi; -exports.e = mjsi; -exports.f = typei; -//// [index.js] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -export const a = cjs; -export const b = mjs; -export const c = type; -import * as cjsi from "inner/cjs"; -import * as mjsi from "inner/mjs"; -import * as typei from "inner"; -export const d = cjsi; -export const e = mjsi; -export const f = typei; - - -//// [index.d.mts] -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -export declare const a: typeof cjs; -export declare const b: typeof mjs; -export declare const c: typeof type; -import * as cjsi from "inner/cjs"; -import * as mjsi from "inner/mjs"; -import * as typei from "inner"; -export declare const d: typeof cjsi; -export declare const e: typeof mjsi; -export declare const f: typeof typei; -//// [index.d.cts] -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -export declare const a: typeof cjs; -export declare const b: typeof mjs; -export declare const c: typeof type; -import * as cjsi from "inner/cjs"; -import * as mjsi from "inner/mjs"; -import * as typei from "inner"; -export declare const d: typeof cjsi; -export declare const e: typeof mjsi; -export declare const f: typeof typei; -//// [index.d.ts] -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -export declare const a: typeof cjs; -export declare const b: typeof mjs; -export declare const c: typeof type; -import * as cjsi from "inner/cjs"; -import * as mjsi from "inner/mjs"; -import * as typei from "inner"; -export declare const d: typeof cjsi; -export declare const e: typeof mjsi; -export declare const f: typeof typei; diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node12).symbols b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node12).symbols deleted file mode 100644 index 3af13052d29..00000000000 --- a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node12).symbols +++ /dev/null @@ -1,201 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import * as cjs from "package/cjs"; ->cjs : Symbol(cjs, Decl(index.ts, 1, 6)) - -import * as mjs from "package/mjs"; ->mjs : Symbol(mjs, Decl(index.ts, 2, 6)) - -import * as type from "package"; ->type : Symbol(type, Decl(index.ts, 3, 6)) - -export const a = cjs; ->a : Symbol(type.a, Decl(index.ts, 4, 12)) ->cjs : Symbol(cjs, Decl(index.ts, 1, 6)) - -export const b = mjs; ->b : Symbol(type.b, Decl(index.ts, 5, 12)) ->mjs : Symbol(mjs, Decl(index.ts, 2, 6)) - -export const c = type; ->c : Symbol(type.c, Decl(index.ts, 6, 12)) ->type : Symbol(type, Decl(index.ts, 3, 6)) - -import * as cjsi from "inner/cjs"; ->cjsi : Symbol(cjsi, Decl(index.ts, 7, 6)) - -import * as mjsi from "inner/mjs"; ->mjsi : Symbol(mjsi, Decl(index.ts, 8, 6)) - -import * as typei from "inner"; ->typei : Symbol(typei, Decl(index.ts, 9, 6)) - -export const d = cjsi; ->d : Symbol(type.d, Decl(index.ts, 10, 12)) ->cjsi : Symbol(cjsi, Decl(index.ts, 7, 6)) - -export const e = mjsi; ->e : Symbol(type.e, Decl(index.ts, 11, 12)) ->mjsi : Symbol(mjsi, Decl(index.ts, 8, 6)) - -export const f = typei; ->f : Symbol(type.f, Decl(index.ts, 12, 12)) ->typei : Symbol(typei, Decl(index.ts, 9, 6)) - -=== tests/cases/conformance/node/index.mts === -// esm format file -import * as cjs from "package/cjs"; ->cjs : Symbol(cjs, Decl(index.mts, 1, 6)) - -import * as mjs from "package/mjs"; ->mjs : Symbol(mjs, Decl(index.mts, 2, 6)) - -import * as type from "package"; ->type : Symbol(type, Decl(index.mts, 3, 6)) - -export const a = cjs; ->a : Symbol(mjs.a, Decl(index.mts, 4, 12)) ->cjs : Symbol(cjs, Decl(index.mts, 1, 6)) - -export const b = mjs; ->b : Symbol(mjs.b, Decl(index.mts, 5, 12)) ->mjs : Symbol(mjs, Decl(index.mts, 2, 6)) - -export const c = type; ->c : Symbol(mjs.c, Decl(index.mts, 6, 12)) ->type : Symbol(type, Decl(index.mts, 3, 6)) - -import * as cjsi from "inner/cjs"; ->cjsi : Symbol(cjsi, Decl(index.mts, 7, 6)) - -import * as mjsi from "inner/mjs"; ->mjsi : Symbol(mjsi, Decl(index.mts, 8, 6)) - -import * as typei from "inner"; ->typei : Symbol(typei, Decl(index.mts, 9, 6)) - -export const d = cjsi; ->d : Symbol(mjs.d, Decl(index.mts, 10, 12)) ->cjsi : Symbol(cjsi, Decl(index.mts, 7, 6)) - -export const e = mjsi; ->e : Symbol(mjs.e, Decl(index.mts, 11, 12)) ->mjsi : Symbol(mjsi, Decl(index.mts, 8, 6)) - -export const f = typei; ->f : Symbol(mjs.f, Decl(index.mts, 12, 12)) ->typei : Symbol(typei, Decl(index.mts, 9, 6)) - -=== tests/cases/conformance/node/index.cts === -// cjs format file -import * as cjs from "package/cjs"; ->cjs : Symbol(cjs, Decl(index.cts, 1, 6)) - -import * as mjs from "package/mjs"; ->mjs : Symbol(mjs, Decl(index.cts, 2, 6)) - -import * as type from "package"; ->type : Symbol(type, Decl(index.cts, 3, 6)) - -export const a = cjs; ->a : Symbol(cjs.a, Decl(index.cts, 4, 12)) ->cjs : Symbol(cjs, Decl(index.cts, 1, 6)) - -export const b = mjs; ->b : Symbol(cjs.b, Decl(index.cts, 5, 12)) ->mjs : Symbol(mjs, Decl(index.cts, 2, 6)) - -export const c = type; ->c : Symbol(cjs.c, Decl(index.cts, 6, 12)) ->type : Symbol(type, Decl(index.cts, 3, 6)) - -import * as cjsi from "inner/cjs"; ->cjsi : Symbol(cjsi, Decl(index.cts, 7, 6)) - -import * as mjsi from "inner/mjs"; ->mjsi : Symbol(mjsi, Decl(index.cts, 8, 6)) - -import * as typei from "inner"; ->typei : Symbol(typei, Decl(index.cts, 9, 6)) - -export const d = cjsi; ->d : Symbol(cjs.d, Decl(index.cts, 10, 12)) ->cjsi : Symbol(cjsi, Decl(index.cts, 7, 6)) - -export const e = mjsi; ->e : Symbol(cjs.e, Decl(index.cts, 11, 12)) ->mjsi : Symbol(mjsi, Decl(index.cts, 8, 6)) - -export const f = typei; ->f : Symbol(cjs.f, Decl(index.cts, 12, 12)) ->typei : Symbol(typei, Decl(index.cts, 9, 6)) - -=== tests/cases/conformance/node/node_modules/inner/index.d.ts === -// cjs format file -import * as cjs from "inner/cjs"; ->cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) - -import * as mjs from "inner/mjs"; ->mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) - -import * as type from "inner"; ->type : Symbol(type, Decl(index.d.ts, 3, 6)) - -cjs; ->cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) - -mjs; ->mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) - -type; ->type : Symbol(type, Decl(index.d.ts, 3, 6)) - -export const cjsMain = true; ->cjsMain : Symbol(type.cjsMain, Decl(index.d.ts, 7, 12)) - -=== tests/cases/conformance/node/node_modules/inner/index.d.mts === -// esm format file -import * as cjs from "inner/cjs"; ->cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) - -import * as mjs from "inner/mjs"; ->mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) - -import * as type from "inner"; ->type : Symbol(type, Decl(index.d.mts, 3, 6)) - -cjs; ->cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) - -mjs; ->mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) - -type; ->type : Symbol(type, Decl(index.d.mts, 3, 6)) - -export const esm = true; ->esm : Symbol(mjs.esm, Decl(index.d.mts, 7, 12)) - -=== tests/cases/conformance/node/node_modules/inner/index.d.cts === -// cjs format file -import * as cjs from "inner/cjs"; ->cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) - -import * as mjs from "inner/mjs"; ->mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) - -import * as type from "inner"; ->type : Symbol(type, Decl(index.d.cts, 3, 6)) - -cjs; ->cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) - -mjs; ->mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) - -type; ->type : Symbol(type, Decl(index.d.cts, 3, 6)) - -export const cjsNonmain = true; ->cjsNonmain : Symbol(cjs.cjsNonmain, Decl(index.d.cts, 7, 12)) - diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node12).types b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node12).types deleted file mode 100644 index 5db63226d08..00000000000 --- a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node12).types +++ /dev/null @@ -1,204 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import * as cjs from "package/cjs"; ->cjs : typeof cjs - -import * as mjs from "package/mjs"; ->mjs : typeof mjs - -import * as type from "package"; ->type : typeof type - -export const a = cjs; ->a : typeof cjs ->cjs : typeof cjs - -export const b = mjs; ->b : typeof mjs ->mjs : typeof mjs - -export const c = type; ->c : typeof type ->type : typeof type - -import * as cjsi from "inner/cjs"; ->cjsi : typeof cjsi - -import * as mjsi from "inner/mjs"; ->mjsi : typeof mjsi - -import * as typei from "inner"; ->typei : typeof typei - -export const d = cjsi; ->d : typeof cjsi ->cjsi : typeof cjsi - -export const e = mjsi; ->e : typeof mjsi ->mjsi : typeof mjsi - -export const f = typei; ->f : typeof typei ->typei : typeof typei - -=== tests/cases/conformance/node/index.mts === -// esm format file -import * as cjs from "package/cjs"; ->cjs : typeof cjs - -import * as mjs from "package/mjs"; ->mjs : typeof mjs - -import * as type from "package"; ->type : typeof type - -export const a = cjs; ->a : typeof cjs ->cjs : typeof cjs - -export const b = mjs; ->b : typeof mjs ->mjs : typeof mjs - -export const c = type; ->c : typeof type ->type : typeof type - -import * as cjsi from "inner/cjs"; ->cjsi : typeof cjsi - -import * as mjsi from "inner/mjs"; ->mjsi : typeof mjsi - -import * as typei from "inner"; ->typei : typeof typei - -export const d = cjsi; ->d : typeof cjsi ->cjsi : typeof cjsi - -export const e = mjsi; ->e : typeof mjsi ->mjsi : typeof mjsi - -export const f = typei; ->f : typeof typei ->typei : typeof typei - -=== tests/cases/conformance/node/index.cts === -// cjs format file -import * as cjs from "package/cjs"; ->cjs : typeof cjs - -import * as mjs from "package/mjs"; ->mjs : typeof mjs - -import * as type from "package"; ->type : typeof type - -export const a = cjs; ->a : typeof cjs ->cjs : typeof cjs - -export const b = mjs; ->b : typeof mjs ->mjs : typeof mjs - -export const c = type; ->c : typeof type ->type : typeof type - -import * as cjsi from "inner/cjs"; ->cjsi : typeof cjsi - -import * as mjsi from "inner/mjs"; ->mjsi : typeof mjsi - -import * as typei from "inner"; ->typei : typeof typei - -export const d = cjsi; ->d : typeof cjsi ->cjsi : typeof cjsi - -export const e = mjsi; ->e : typeof mjsi ->mjsi : typeof mjsi - -export const f = typei; ->f : typeof typei ->typei : typeof typei - -=== tests/cases/conformance/node/node_modules/inner/index.d.ts === -// cjs format file -import * as cjs from "inner/cjs"; ->cjs : typeof cjs - -import * as mjs from "inner/mjs"; ->mjs : typeof mjs - -import * as type from "inner"; ->type : typeof type - -cjs; ->cjs : typeof cjs - -mjs; ->mjs : typeof mjs - -type; ->type : typeof type - -export const cjsMain = true; ->cjsMain : true ->true : true - -=== tests/cases/conformance/node/node_modules/inner/index.d.mts === -// esm format file -import * as cjs from "inner/cjs"; ->cjs : typeof cjs - -import * as mjs from "inner/mjs"; ->mjs : typeof mjs - -import * as type from "inner"; ->type : typeof type - -cjs; ->cjs : typeof cjs - -mjs; ->mjs : typeof mjs - -type; ->type : typeof type - -export const esm = true; ->esm : true ->true : true - -=== tests/cases/conformance/node/node_modules/inner/index.d.cts === -// cjs format file -import * as cjs from "inner/cjs"; ->cjs : typeof cjs - -import * as mjs from "inner/mjs"; ->mjs : typeof mjs - -import * as type from "inner"; ->type : typeof type - -cjs; ->cjs : typeof cjs - -mjs; ->mjs : typeof mjs - -type; ->type : typeof type - -export const cjsNonmain = true; ->cjsNonmain : true ->true : true - diff --git a/tests/baselines/reference/nodeModulesDynamicImport(module=node12).js b/tests/baselines/reference/nodeModulesDynamicImport(module=node12).js deleted file mode 100644 index aceeafb8c59..00000000000 --- a/tests/baselines/reference/nodeModulesDynamicImport(module=node12).js +++ /dev/null @@ -1,45 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesDynamicImport.ts] //// - -//// [index.ts] -// cjs format file -export async function main() { - const { readFile } = await import("fs"); -} -//// [index.ts] -// esm format file -export async function main() { - const { readFile } = await import("fs"); -} -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} -//// [types.d.ts] -declare module "fs"; - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.main = void 0; -// cjs format file -async function main() { - const { readFile } = await import("fs"); -} -exports.main = main; -//// [index.js] -// esm format file -export async function main() { - const { readFile } = await import("fs"); -} - - -//// [index.d.ts] -export declare function main(): Promise; -//// [index.d.ts] -export declare function main(): Promise; diff --git a/tests/baselines/reference/nodeModulesDynamicImport(module=node12).symbols b/tests/baselines/reference/nodeModulesDynamicImport(module=node12).symbols deleted file mode 100644 index 69296bc3fa9..00000000000 --- a/tests/baselines/reference/nodeModulesDynamicImport(module=node12).symbols +++ /dev/null @@ -1,22 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -export async function main() { ->main : Symbol(main, Decl(index.ts, 0, 0)) - - const { readFile } = await import("fs"); ->readFile : Symbol(readFile, Decl(index.ts, 2, 11)) ->"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) -} -=== tests/cases/conformance/node/index.ts === -// esm format file -export async function main() { ->main : Symbol(main, Decl(index.ts, 0, 0)) - - const { readFile } = await import("fs"); ->readFile : Symbol(readFile, Decl(index.ts, 2, 11)) ->"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) -} -=== tests/cases/conformance/node/types.d.ts === -declare module "fs"; ->"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) - diff --git a/tests/baselines/reference/nodeModulesDynamicImport(module=node12).types b/tests/baselines/reference/nodeModulesDynamicImport(module=node12).types deleted file mode 100644 index 879fb7ca71b..00000000000 --- a/tests/baselines/reference/nodeModulesDynamicImport(module=node12).types +++ /dev/null @@ -1,26 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -export async function main() { ->main : () => Promise - - const { readFile } = await import("fs"); ->readFile : any ->await import("fs") : any ->import("fs") : Promise ->"fs" : "fs" -} -=== tests/cases/conformance/node/index.ts === -// esm format file -export async function main() { ->main : () => Promise - - const { readFile } = await import("fs"); ->readFile : any ->await import("fs") : any ->import("fs") : Promise ->"fs" : "fs" -} -=== tests/cases/conformance/node/types.d.ts === -declare module "fs"; ->"fs" : any - diff --git a/tests/baselines/reference/nodeModulesExportAssignments(module=node12).errors.txt b/tests/baselines/reference/nodeModulesExportAssignments(module=node12).errors.txt deleted file mode 100644 index cef29663806..00000000000 --- a/tests/baselines/reference/nodeModulesExportAssignments(module=node12).errors.txt +++ /dev/null @@ -1,23 +0,0 @@ -tests/cases/conformance/node/index.ts(3,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. - - -==== tests/cases/conformance/node/subfolder/index.ts (0 errors) ==== - // cjs format file - const a = {}; - export = a; -==== tests/cases/conformance/node/index.ts (1 errors) ==== - // esm format file - const a = {}; - export = a; - ~~~~~~~~~~~ -!!! error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module" - } -==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== - { - "type": "commonjs" - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesExportAssignments(module=node12).js b/tests/baselines/reference/nodeModulesExportAssignments(module=node12).js deleted file mode 100644 index 2d09438ae7c..00000000000 --- a/tests/baselines/reference/nodeModulesExportAssignments(module=node12).js +++ /dev/null @@ -1,38 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesExportAssignments.ts] //// - -//// [index.ts] -// cjs format file -const a = {}; -export = a; -//// [index.ts] -// esm format file -const a = {}; -export = a; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} - -//// [index.js] -"use strict"; -// cjs format file -const a = {}; -module.exports = a; -//// [index.js] -// esm format file -const a = {}; -export {}; - - -//// [index.d.ts] -declare const a: {}; -export = a; -//// [index.d.ts] -declare const a: {}; -export = a; diff --git a/tests/baselines/reference/nodeModulesExportAssignments(module=node12).symbols b/tests/baselines/reference/nodeModulesExportAssignments(module=node12).symbols deleted file mode 100644 index 4552dd34157..00000000000 --- a/tests/baselines/reference/nodeModulesExportAssignments(module=node12).symbols +++ /dev/null @@ -1,16 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -const a = {}; ->a : Symbol(a, Decl(index.ts, 1, 5)) - -export = a; ->a : Symbol(a, Decl(index.ts, 1, 5)) - -=== tests/cases/conformance/node/index.ts === -// esm format file -const a = {}; ->a : Symbol(a, Decl(index.ts, 1, 5)) - -export = a; ->a : Symbol(a, Decl(index.ts, 1, 5)) - diff --git a/tests/baselines/reference/nodeModulesExportAssignments(module=node12).types b/tests/baselines/reference/nodeModulesExportAssignments(module=node12).types deleted file mode 100644 index 73f7e0869eb..00000000000 --- a/tests/baselines/reference/nodeModulesExportAssignments(module=node12).types +++ /dev/null @@ -1,18 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -const a = {}; ->a : {} ->{} : {} - -export = a; ->a : {} - -=== tests/cases/conformance/node/index.ts === -// esm format file -const a = {}; ->a : {} ->{} : {} - -export = a; ->a : {} - diff --git a/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node12).errors.txt b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node12).errors.txt deleted file mode 100644 index d6b74fdf7e0..00000000000 --- a/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node12).errors.txt +++ /dev/null @@ -1,36 +0,0 @@ -tests/cases/conformance/node/index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(3,14): error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. -tests/cases/conformance/node/index.ts(3,19): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. - - -==== tests/cases/conformance/node/index.ts (3 errors) ==== - // esm format file - import { Thing } from "inner/other"; - ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. - export const a = (await import("inner")).x(); - ~ -!!! error TS2742: The inferred type of 'a' cannot be named without a reference to './node_modules/inner/other.js'. This is likely not portable. A type annotation is necessary. - ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. -==== tests/cases/conformance/node/node_modules/inner/index.d.ts (0 errors) ==== - // esm format file - export { x } from "./other.js"; -==== tests/cases/conformance/node/node_modules/inner/other.d.ts (0 errors) ==== - // esm format file - export interface Thing {} - export const x: () => Thing; -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module", - "exports": "./index.js" - } -==== tests/cases/conformance/node/node_modules/inner/package.json (0 errors) ==== - { - "name": "inner", - "private": true, - "type": "module", - "exports": "./index.js" - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node12).js b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node12).js deleted file mode 100644 index da6fe0fc800..00000000000 --- a/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node12).js +++ /dev/null @@ -1,30 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesExportsBlocksSpecifierResolution.ts] //// - -//// [index.ts] -// esm format file -import { Thing } from "inner/other"; -export const a = (await import("inner")).x(); -//// [index.d.ts] -// esm format file -export { x } from "./other.js"; -//// [other.d.ts] -// esm format file -export interface Thing {} -export const x: () => Thing; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module", - "exports": "./index.js" -} -//// [package.json] -{ - "name": "inner", - "private": true, - "type": "module", - "exports": "./index.js" -} - -//// [index.js] -export const a = (await import("inner")).x(); diff --git a/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node12).symbols b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node12).symbols deleted file mode 100644 index 07abee8390f..00000000000 --- a/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node12).symbols +++ /dev/null @@ -1,25 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import { Thing } from "inner/other"; ->Thing : Symbol(Thing, Decl(index.ts, 1, 8)) - -export const a = (await import("inner")).x(); ->a : Symbol(a, Decl(index.ts, 2, 12)) ->(await import("inner")).x : Symbol(x, Decl(index.d.ts, 1, 8)) ->"inner" : Symbol("tests/cases/conformance/node/node_modules/inner/index", Decl(index.d.ts, 0, 0)) ->x : Symbol(x, Decl(index.d.ts, 1, 8)) - -=== tests/cases/conformance/node/node_modules/inner/index.d.ts === -// esm format file -export { x } from "./other.js"; ->x : Symbol(x, Decl(index.d.ts, 1, 8)) - -=== tests/cases/conformance/node/node_modules/inner/other.d.ts === -// esm format file -export interface Thing {} ->Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) - -export const x: () => Thing; ->x : Symbol(x, Decl(other.d.ts, 2, 12)) ->Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) - diff --git a/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node12).types b/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node12).types deleted file mode 100644 index f7806a6a255..00000000000 --- a/tests/baselines/reference/nodeModulesExportsBlocksSpecifierResolution(module=node12).types +++ /dev/null @@ -1,26 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import { Thing } from "inner/other"; ->Thing : any - -export const a = (await import("inner")).x(); ->a : import("tests/cases/conformance/node/node_modules/inner/other").Thing ->(await import("inner")).x() : import("tests/cases/conformance/node/node_modules/inner/other").Thing ->(await import("inner")).x : () => import("tests/cases/conformance/node/node_modules/inner/other").Thing ->(await import("inner")) : typeof import("tests/cases/conformance/node/node_modules/inner/index") ->await import("inner") : typeof import("tests/cases/conformance/node/node_modules/inner/index") ->import("inner") : Promise ->"inner" : "inner" ->x : () => import("tests/cases/conformance/node/node_modules/inner/other").Thing - -=== tests/cases/conformance/node/node_modules/inner/index.d.ts === -// esm format file -export { x } from "./other.js"; ->x : () => import("tests/cases/conformance/node/node_modules/inner/other").Thing - -=== tests/cases/conformance/node/node_modules/inner/other.d.ts === -// esm format file -export interface Thing {} -export const x: () => Thing; ->x : () => Thing - diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node12).errors.txt b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node12).errors.txt deleted file mode 100644 index 1a9b16d74f2..00000000000 --- a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node12).errors.txt +++ /dev/null @@ -1,40 +0,0 @@ -tests/cases/conformance/node/index.ts(2,23): error TS2307: Cannot find module 'inner/other.js' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(3,19): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. - - -==== tests/cases/conformance/node/index.ts (2 errors) ==== - // esm format file - import { Thing } from "inner/other.js"; // should fail - ~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/other.js' or its corresponding type declarations. - export const a = (await import("inner")).x(); - ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. -==== tests/cases/conformance/node/node_modules/inner/index.d.ts (0 errors) ==== - // esm format file - export { x } from "./other.js"; -==== tests/cases/conformance/node/node_modules/inner/other.d.ts (0 errors) ==== - // esm format file - export interface Thing {} - export const x: () => Thing; -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module", - "exports": "./index.js" - } -==== tests/cases/conformance/node/node_modules/inner/package.json (0 errors) ==== - { - "name": "inner", - "private": true, - "type": "module", - "exports": { - ".": { - "default": "./index.js" - }, - "./other": { - "default": "./other.js" - } - } - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node12).js b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node12).js deleted file mode 100644 index 5db58ae2f7b..00000000000 --- a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node12).js +++ /dev/null @@ -1,41 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationConditions.ts] //// - -//// [index.ts] -// esm format file -import { Thing } from "inner/other.js"; // should fail -export const a = (await import("inner")).x(); -//// [index.d.ts] -// esm format file -export { x } from "./other.js"; -//// [other.d.ts] -// esm format file -export interface Thing {} -export const x: () => Thing; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module", - "exports": "./index.js" -} -//// [package.json] -{ - "name": "inner", - "private": true, - "type": "module", - "exports": { - ".": { - "default": "./index.js" - }, - "./other": { - "default": "./other.js" - } - } -} - -//// [index.js] -export const a = (await import("inner")).x(); - - -//// [index.d.ts] -export declare const a: import("inner/other").Thing; diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node12).symbols b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node12).symbols deleted file mode 100644 index 1abea377c5f..00000000000 --- a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node12).symbols +++ /dev/null @@ -1,25 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import { Thing } from "inner/other.js"; // should fail ->Thing : Symbol(Thing, Decl(index.ts, 1, 8)) - -export const a = (await import("inner")).x(); ->a : Symbol(a, Decl(index.ts, 2, 12)) ->(await import("inner")).x : Symbol(x, Decl(index.d.ts, 1, 8)) ->"inner" : Symbol("tests/cases/conformance/node/node_modules/inner/index", Decl(index.d.ts, 0, 0)) ->x : Symbol(x, Decl(index.d.ts, 1, 8)) - -=== tests/cases/conformance/node/node_modules/inner/index.d.ts === -// esm format file -export { x } from "./other.js"; ->x : Symbol(x, Decl(index.d.ts, 1, 8)) - -=== tests/cases/conformance/node/node_modules/inner/other.d.ts === -// esm format file -export interface Thing {} ->Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) - -export const x: () => Thing; ->x : Symbol(x, Decl(other.d.ts, 2, 12)) ->Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) - diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node12).types b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node12).types deleted file mode 100644 index 6020ebf5b21..00000000000 --- a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationConditions(module=node12).types +++ /dev/null @@ -1,26 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import { Thing } from "inner/other.js"; // should fail ->Thing : any - -export const a = (await import("inner")).x(); ->a : import("tests/cases/conformance/node/node_modules/inner/other").Thing ->(await import("inner")).x() : import("tests/cases/conformance/node/node_modules/inner/other").Thing ->(await import("inner")).x : () => import("tests/cases/conformance/node/node_modules/inner/other").Thing ->(await import("inner")) : typeof import("tests/cases/conformance/node/node_modules/inner/index") ->await import("inner") : typeof import("tests/cases/conformance/node/node_modules/inner/index") ->import("inner") : Promise ->"inner" : "inner" ->x : () => import("tests/cases/conformance/node/node_modules/inner/other").Thing - -=== tests/cases/conformance/node/node_modules/inner/index.d.ts === -// esm format file -export { x } from "./other.js"; ->x : () => import("tests/cases/conformance/node/node_modules/inner/other").Thing - -=== tests/cases/conformance/node/node_modules/inner/other.d.ts === -// esm format file -export interface Thing {} -export const x: () => Thing; ->x : () => Thing - diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node12).errors.txt b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node12).errors.txt deleted file mode 100644 index 7216f0655b9..00000000000 --- a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node12).errors.txt +++ /dev/null @@ -1,35 +0,0 @@ -tests/cases/conformance/node/index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(3,19): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. - - -==== tests/cases/conformance/node/index.ts (2 errors) ==== - // esm format file - import { Thing } from "inner/other"; - ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. - export const a = (await import("inner/index.js")).x(); - ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. -==== tests/cases/conformance/node/node_modules/inner/index.d.ts (0 errors) ==== - // esm format file - export { x } from "./other.js"; -==== tests/cases/conformance/node/node_modules/inner/other.d.ts (0 errors) ==== - // esm format file - export interface Thing {} - export const x: () => Thing; -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module", - "exports": "./index.js" - } -==== tests/cases/conformance/node/node_modules/inner/package.json (0 errors) ==== - { - "name": "inner", - "private": true, - "type": "module", - "exports": { - "./": "./" - } - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node12).js b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node12).js deleted file mode 100644 index c0d6b006b33..00000000000 --- a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node12).js +++ /dev/null @@ -1,36 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationDirectory.ts] //// - -//// [index.ts] -// esm format file -import { Thing } from "inner/other"; -export const a = (await import("inner/index.js")).x(); -//// [index.d.ts] -// esm format file -export { x } from "./other.js"; -//// [other.d.ts] -// esm format file -export interface Thing {} -export const x: () => Thing; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module", - "exports": "./index.js" -} -//// [package.json] -{ - "name": "inner", - "private": true, - "type": "module", - "exports": { - "./": "./" - } -} - -//// [index.js] -export const a = (await import("inner/index.js")).x(); - - -//// [index.d.ts] -export declare const a: import("inner/other.js").Thing; diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node12).symbols b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node12).symbols deleted file mode 100644 index a12a7b1c026..00000000000 --- a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node12).symbols +++ /dev/null @@ -1,25 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import { Thing } from "inner/other"; ->Thing : Symbol(Thing, Decl(index.ts, 1, 8)) - -export const a = (await import("inner/index.js")).x(); ->a : Symbol(a, Decl(index.ts, 2, 12)) ->(await import("inner/index.js")).x : Symbol(x, Decl(index.d.ts, 1, 8)) ->"inner/index.js" : Symbol("tests/cases/conformance/node/node_modules/inner/index", Decl(index.d.ts, 0, 0)) ->x : Symbol(x, Decl(index.d.ts, 1, 8)) - -=== tests/cases/conformance/node/node_modules/inner/index.d.ts === -// esm format file -export { x } from "./other.js"; ->x : Symbol(x, Decl(index.d.ts, 1, 8)) - -=== tests/cases/conformance/node/node_modules/inner/other.d.ts === -// esm format file -export interface Thing {} ->Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) - -export const x: () => Thing; ->x : Symbol(x, Decl(other.d.ts, 2, 12)) ->Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) - diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node12).types b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node12).types deleted file mode 100644 index a75c2359eb0..00000000000 --- a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationDirectory(module=node12).types +++ /dev/null @@ -1,26 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import { Thing } from "inner/other"; ->Thing : any - -export const a = (await import("inner/index.js")).x(); ->a : import("tests/cases/conformance/node/node_modules/inner/other").Thing ->(await import("inner/index.js")).x() : import("tests/cases/conformance/node/node_modules/inner/other").Thing ->(await import("inner/index.js")).x : () => import("tests/cases/conformance/node/node_modules/inner/other").Thing ->(await import("inner/index.js")) : typeof import("tests/cases/conformance/node/node_modules/inner/index") ->await import("inner/index.js") : typeof import("tests/cases/conformance/node/node_modules/inner/index") ->import("inner/index.js") : Promise ->"inner/index.js" : "inner/index.js" ->x : () => import("tests/cases/conformance/node/node_modules/inner/other").Thing - -=== tests/cases/conformance/node/node_modules/inner/index.d.ts === -// esm format file -export { x } from "./other.js"; ->x : () => import("tests/cases/conformance/node/node_modules/inner/other").Thing - -=== tests/cases/conformance/node/node_modules/inner/other.d.ts === -// esm format file -export interface Thing {} -export const x: () => Thing; ->x : () => Thing - diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node12).errors.txt b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node12).errors.txt deleted file mode 100644 index 9db51390624..00000000000 --- a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node12).errors.txt +++ /dev/null @@ -1,38 +0,0 @@ -tests/cases/conformance/node/index.ts(2,23): error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(3,19): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. -tests/cases/conformance/node/index.ts(3,32): error TS2307: Cannot find module 'inner/index.js' or its corresponding type declarations. - - -==== tests/cases/conformance/node/index.ts (3 errors) ==== - // esm format file - import { Thing } from "inner/other"; - ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/other' or its corresponding type declarations. - export const a = (await import("inner/index.js")).x(); - ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. - ~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/index.js' or its corresponding type declarations. -==== tests/cases/conformance/node/node_modules/inner/index.d.ts (0 errors) ==== - // esm format file - export { x } from "./other.js"; -==== tests/cases/conformance/node/node_modules/inner/other.d.ts (0 errors) ==== - // esm format file - export interface Thing {} - export const x: () => Thing; -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module", - "exports": "./index.js" - } -==== tests/cases/conformance/node/node_modules/inner/package.json (0 errors) ==== - { - "name": "inner", - "private": true, - "type": "module", - "exports": { - "./*.js": "./*.js" - } - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node12).js b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node12).js deleted file mode 100644 index 63cf2dae874..00000000000 --- a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node12).js +++ /dev/null @@ -1,36 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesExportsSpecifierGenerationPattern.ts] //// - -//// [index.ts] -// esm format file -import { Thing } from "inner/other"; -export const a = (await import("inner/index.js")).x(); -//// [index.d.ts] -// esm format file -export { x } from "./other.js"; -//// [other.d.ts] -// esm format file -export interface Thing {} -export const x: () => Thing; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module", - "exports": "./index.js" -} -//// [package.json] -{ - "name": "inner", - "private": true, - "type": "module", - "exports": { - "./*.js": "./*.js" - } -} - -//// [index.js] -export const a = (await import("inner/index.js")).x(); - - -//// [index.d.ts] -export declare const a: any; diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node12).symbols b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node12).symbols deleted file mode 100644 index 5bcb54a5bdb..00000000000 --- a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node12).symbols +++ /dev/null @@ -1,22 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import { Thing } from "inner/other"; ->Thing : Symbol(Thing, Decl(index.ts, 1, 8)) - -export const a = (await import("inner/index.js")).x(); ->a : Symbol(a, Decl(index.ts, 2, 12)) - -=== tests/cases/conformance/node/node_modules/inner/index.d.ts === -// esm format file -export { x } from "./other.js"; ->x : Symbol(x, Decl(index.d.ts, 1, 8)) - -=== tests/cases/conformance/node/node_modules/inner/other.d.ts === -// esm format file -export interface Thing {} ->Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) - -export const x: () => Thing; ->x : Symbol(x, Decl(other.d.ts, 2, 12)) ->Thing : Symbol(Thing, Decl(other.d.ts, 0, 0)) - diff --git a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node12).types b/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node12).types deleted file mode 100644 index 4ac4b8a432f..00000000000 --- a/tests/baselines/reference/nodeModulesExportsSpecifierGenerationPattern(module=node12).types +++ /dev/null @@ -1,26 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import { Thing } from "inner/other"; ->Thing : any - -export const a = (await import("inner/index.js")).x(); ->a : any ->(await import("inner/index.js")).x() : any ->(await import("inner/index.js")).x : any ->(await import("inner/index.js")) : any ->await import("inner/index.js") : any ->import("inner/index.js") : Promise ->"inner/index.js" : "inner/index.js" ->x : any - -=== tests/cases/conformance/node/node_modules/inner/index.d.ts === -// esm format file -export { x } from "./other.js"; ->x : () => import("tests/cases/conformance/node/node_modules/inner/other").Thing - -=== tests/cases/conformance/node/node_modules/inner/other.d.ts === -// esm format file -export interface Thing {} -export const x: () => Thing; ->x : () => Thing - diff --git a/tests/baselines/reference/nodeModulesForbidenSyntax(module=node12).errors.txt b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node12).errors.txt deleted file mode 100644 index 984483a332e..00000000000 --- a/tests/baselines/reference/nodeModulesForbidenSyntax(module=node12).errors.txt +++ /dev/null @@ -1,139 +0,0 @@ -tests/cases/conformance/node/index.cts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. -tests/cases/conformance/node/index.cts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. -tests/cases/conformance/node/index.cts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. -tests/cases/conformance/node/index.mts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. -tests/cases/conformance/node/index.mts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. -tests/cases/conformance/node/index.mts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. -tests/cases/conformance/node/subfolder/index.cts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. -tests/cases/conformance/node/subfolder/index.cts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. -tests/cases/conformance/node/subfolder/index.cts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. -tests/cases/conformance/node/subfolder/index.mts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. -tests/cases/conformance/node/subfolder/index.mts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. -tests/cases/conformance/node/subfolder/index.mts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. -tests/cases/conformance/node/subfolder2/another/index.cts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. -tests/cases/conformance/node/subfolder2/another/index.cts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. -tests/cases/conformance/node/subfolder2/another/index.cts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. -tests/cases/conformance/node/subfolder2/another/index.mts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. -tests/cases/conformance/node/subfolder2/another/index.mts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. -tests/cases/conformance/node/subfolder2/another/index.mts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. -tests/cases/conformance/node/subfolder2/index.cts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. -tests/cases/conformance/node/subfolder2/index.cts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. -tests/cases/conformance/node/subfolder2/index.cts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. -tests/cases/conformance/node/subfolder2/index.mts(2,12): error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. -tests/cases/conformance/node/subfolder2/index.mts(2,20): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. -tests/cases/conformance/node/subfolder2/index.mts(2,23): error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. - - -==== tests/cases/conformance/node/subfolder/index.ts (0 errors) ==== - // cjs format file - const x = () => (void 0); - export {x}; -==== tests/cases/conformance/node/subfolder/index.cts (3 errors) ==== - // cjs format file - const x = () => (void 0); - ~ -!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. - ~~~~~~~~~~~~~~~~ -!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. - ~~~~~~~~~~~~~ -!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. - export {x}; -==== tests/cases/conformance/node/subfolder/index.mts (3 errors) ==== - // esm format file - const x = () => (void 0); - ~ -!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. - ~~~~~~~~~~~~~~~~ -!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. - ~~~~~~~~~~~~~ -!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. - export {x}; -==== tests/cases/conformance/node/subfolder2/index.ts (0 errors) ==== - // cjs format file - const x = () => (void 0); - export {x}; -==== tests/cases/conformance/node/subfolder2/index.cts (3 errors) ==== - // cjs format file - const x = () => (void 0); - ~ -!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. - ~~~~~~~~~~~~~~~~ -!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. - ~~~~~~~~~~~~~ -!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. - export {x}; -==== tests/cases/conformance/node/subfolder2/index.mts (3 errors) ==== - // esm format file - const x = () => (void 0); - ~ -!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. - ~~~~~~~~~~~~~~~~ -!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. - ~~~~~~~~~~~~~ -!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. - export {x}; -==== tests/cases/conformance/node/subfolder2/another/index.ts (0 errors) ==== - // esm format file - const x = () => (void 0); - export {x}; -==== tests/cases/conformance/node/subfolder2/another/index.mts (3 errors) ==== - // esm format file - const x = () => (void 0); - ~ -!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. - ~~~~~~~~~~~~~~~~ -!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. - ~~~~~~~~~~~~~ -!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. - export {x}; -==== tests/cases/conformance/node/subfolder2/another/index.cts (3 errors) ==== - // cjs format file - const x = () => (void 0); - ~ -!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. - ~~~~~~~~~~~~~~~~ -!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. - ~~~~~~~~~~~~~ -!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. - export {x}; -==== tests/cases/conformance/node/index.mts (3 errors) ==== - // esm format file - const x = () => (void 0); - ~ -!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. - ~~~~~~~~~~~~~~~~ -!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. - ~~~~~~~~~~~~~ -!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. - export {x}; -==== tests/cases/conformance/node/index.cts (3 errors) ==== - // cjs format file - const x = () => (void 0); - ~ -!!! error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint. - ~~~~~~~~~~~~~~~~ -!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. - ~~~~~~~~~~~~~ -!!! error TS7059: This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead. - export {x}; -==== tests/cases/conformance/node/index.ts (0 errors) ==== - // esm format file - const x = () => (void 0); - export {x}; -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module" - } -==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== - { - "type": "commonjs" - } -==== tests/cases/conformance/node/subfolder2/package.json (0 errors) ==== - { - } -==== tests/cases/conformance/node/subfolder2/another/package.json (0 errors) ==== - { - "type": "module" - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesForbidenSyntax(module=node12).js b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node12).js deleted file mode 100644 index 4cca6af5a58..00000000000 --- a/tests/baselines/reference/nodeModulesForbidenSyntax(module=node12).js +++ /dev/null @@ -1,172 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesForbidenSyntax.ts] //// - -//// [index.ts] -// cjs format file -const x = () => (void 0); -export {x}; -//// [index.cts] -// cjs format file -const x = () => (void 0); -export {x}; -//// [index.mts] -// esm format file -const x = () => (void 0); -export {x}; -//// [index.ts] -// cjs format file -const x = () => (void 0); -export {x}; -//// [index.cts] -// cjs format file -const x = () => (void 0); -export {x}; -//// [index.mts] -// esm format file -const x = () => (void 0); -export {x}; -//// [index.ts] -// esm format file -const x = () => (void 0); -export {x}; -//// [index.mts] -// esm format file -const x = () => (void 0); -export {x}; -//// [index.cts] -// cjs format file -const x = () => (void 0); -export {x}; -//// [index.mts] -// esm format file -const x = () => (void 0); -export {x}; -//// [index.cts] -// cjs format file -const x = () => (void 0); -export {x}; -//// [index.ts] -// esm format file -const x = () => (void 0); -export {x}; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} -//// [package.json] -{ -} -//// [package.json] -{ - "type": "module" -} - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.x = void 0; -// cjs format file -const x = () => (void 0); -exports.x = x; -//// [index.cjs] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.x = void 0; -// cjs format file -const x = () => (void 0); -exports.x = x; -//// [index.mjs] -// esm format file -const x = () => (void 0); -export { x }; -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.x = void 0; -// cjs format file -const x = () => (void 0); -exports.x = x; -//// [index.cjs] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.x = void 0; -// cjs format file -const x = () => (void 0); -exports.x = x; -//// [index.mjs] -// esm format file -const x = () => (void 0); -export { x }; -//// [index.js] -// esm format file -const x = () => (void 0); -export { x }; -//// [index.mjs] -// esm format file -const x = () => (void 0); -export { x }; -//// [index.cjs] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.x = void 0; -// cjs format file -const x = () => (void 0); -exports.x = x; -//// [index.mjs] -// esm format file -const x = () => (void 0); -export { x }; -//// [index.cjs] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.x = void 0; -// cjs format file -const x = () => (void 0); -exports.x = x; -//// [index.js] -// esm format file -const x = () => (void 0); -export { x }; - - -//// [index.d.ts] -declare const x: () => T; -export { x }; -//// [index.d.cts] -declare const x: () => T; -export { x }; -//// [index.d.mts] -declare const x: () => T; -export { x }; -//// [index.d.ts] -declare const x: () => T; -export { x }; -//// [index.d.cts] -declare const x: () => T; -export { x }; -//// [index.d.mts] -declare const x: () => T; -export { x }; -//// [index.d.ts] -declare const x: () => T; -export { x }; -//// [index.d.mts] -declare const x: () => T; -export { x }; -//// [index.d.cts] -declare const x: () => T; -export { x }; -//// [index.d.mts] -declare const x: () => T; -export { x }; -//// [index.d.cts] -declare const x: () => T; -export { x }; -//// [index.d.ts] -declare const x: () => T; -export { x }; diff --git a/tests/baselines/reference/nodeModulesForbidenSyntax(module=node12).symbols b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node12).symbols deleted file mode 100644 index 1ca35d0d3e3..00000000000 --- a/tests/baselines/reference/nodeModulesForbidenSyntax(module=node12).symbols +++ /dev/null @@ -1,120 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -const x = () => (void 0); ->x : Symbol(x, Decl(index.ts, 1, 5)) ->T : Symbol(T, Decl(index.ts, 1, 11)) ->T : Symbol(T, Decl(index.ts, 1, 11)) - -export {x}; ->x : Symbol(x, Decl(index.ts, 2, 8)) - -=== tests/cases/conformance/node/subfolder/index.cts === -// cjs format file -const x = () => (void 0); ->x : Symbol(x, Decl(index.cts, 1, 5)) ->T : Symbol(T, Decl(index.cts, 1, 11)) ->T : Symbol(T, Decl(index.cts, 1, 11)) - -export {x}; ->x : Symbol(x, Decl(index.cts, 2, 8)) - -=== tests/cases/conformance/node/subfolder/index.mts === -// esm format file -const x = () => (void 0); ->x : Symbol(x, Decl(index.mts, 1, 5)) ->T : Symbol(T, Decl(index.mts, 1, 11)) ->T : Symbol(T, Decl(index.mts, 1, 11)) - -export {x}; ->x : Symbol(x, Decl(index.mts, 2, 8)) - -=== tests/cases/conformance/node/subfolder2/index.ts === -// cjs format file -const x = () => (void 0); ->x : Symbol(x, Decl(index.ts, 1, 5)) ->T : Symbol(T, Decl(index.ts, 1, 11)) ->T : Symbol(T, Decl(index.ts, 1, 11)) - -export {x}; ->x : Symbol(x, Decl(index.ts, 2, 8)) - -=== tests/cases/conformance/node/subfolder2/index.cts === -// cjs format file -const x = () => (void 0); ->x : Symbol(x, Decl(index.cts, 1, 5)) ->T : Symbol(T, Decl(index.cts, 1, 11)) ->T : Symbol(T, Decl(index.cts, 1, 11)) - -export {x}; ->x : Symbol(x, Decl(index.cts, 2, 8)) - -=== tests/cases/conformance/node/subfolder2/index.mts === -// esm format file -const x = () => (void 0); ->x : Symbol(x, Decl(index.mts, 1, 5)) ->T : Symbol(T, Decl(index.mts, 1, 11)) ->T : Symbol(T, Decl(index.mts, 1, 11)) - -export {x}; ->x : Symbol(x, Decl(index.mts, 2, 8)) - -=== tests/cases/conformance/node/subfolder2/another/index.ts === -// esm format file -const x = () => (void 0); ->x : Symbol(x, Decl(index.ts, 1, 5)) ->T : Symbol(T, Decl(index.ts, 1, 11)) ->T : Symbol(T, Decl(index.ts, 1, 11)) - -export {x}; ->x : Symbol(x, Decl(index.ts, 2, 8)) - -=== tests/cases/conformance/node/subfolder2/another/index.mts === -// esm format file -const x = () => (void 0); ->x : Symbol(x, Decl(index.mts, 1, 5)) ->T : Symbol(T, Decl(index.mts, 1, 11)) ->T : Symbol(T, Decl(index.mts, 1, 11)) - -export {x}; ->x : Symbol(x, Decl(index.mts, 2, 8)) - -=== tests/cases/conformance/node/subfolder2/another/index.cts === -// cjs format file -const x = () => (void 0); ->x : Symbol(x, Decl(index.cts, 1, 5)) ->T : Symbol(T, Decl(index.cts, 1, 11)) ->T : Symbol(T, Decl(index.cts, 1, 11)) - -export {x}; ->x : Symbol(x, Decl(index.cts, 2, 8)) - -=== tests/cases/conformance/node/index.mts === -// esm format file -const x = () => (void 0); ->x : Symbol(x, Decl(index.mts, 1, 5)) ->T : Symbol(T, Decl(index.mts, 1, 11)) ->T : Symbol(T, Decl(index.mts, 1, 11)) - -export {x}; ->x : Symbol(x, Decl(index.mts, 2, 8)) - -=== tests/cases/conformance/node/index.cts === -// cjs format file -const x = () => (void 0); ->x : Symbol(x, Decl(index.cts, 1, 5)) ->T : Symbol(T, Decl(index.cts, 1, 11)) ->T : Symbol(T, Decl(index.cts, 1, 11)) - -export {x}; ->x : Symbol(x, Decl(index.cts, 2, 8)) - -=== tests/cases/conformance/node/index.ts === -// esm format file -const x = () => (void 0); ->x : Symbol(x, Decl(index.ts, 1, 5)) ->T : Symbol(T, Decl(index.ts, 1, 11)) ->T : Symbol(T, Decl(index.ts, 1, 11)) - -export {x}; ->x : Symbol(x, Decl(index.ts, 2, 8)) - diff --git a/tests/baselines/reference/nodeModulesForbidenSyntax(module=node12).types b/tests/baselines/reference/nodeModulesForbidenSyntax(module=node12).types deleted file mode 100644 index 016af4314d1..00000000000 --- a/tests/baselines/reference/nodeModulesForbidenSyntax(module=node12).types +++ /dev/null @@ -1,168 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -const x = () => (void 0); ->x : () => T ->() => (void 0) : () => T ->(void 0) : T ->(void 0) : any ->(void 0) : undefined ->void 0 : undefined ->0 : 0 - -export {x}; ->x : () => T - -=== tests/cases/conformance/node/subfolder/index.cts === -// cjs format file -const x = () => (void 0); ->x : () => T ->() => (void 0) : () => T ->(void 0) : T ->(void 0) : any ->(void 0) : undefined ->void 0 : undefined ->0 : 0 - -export {x}; ->x : () => T - -=== tests/cases/conformance/node/subfolder/index.mts === -// esm format file -const x = () => (void 0); ->x : () => T ->() => (void 0) : () => T ->(void 0) : T ->(void 0) : any ->(void 0) : undefined ->void 0 : undefined ->0 : 0 - -export {x}; ->x : () => T - -=== tests/cases/conformance/node/subfolder2/index.ts === -// cjs format file -const x = () => (void 0); ->x : () => T ->() => (void 0) : () => T ->(void 0) : T ->(void 0) : any ->(void 0) : undefined ->void 0 : undefined ->0 : 0 - -export {x}; ->x : () => T - -=== tests/cases/conformance/node/subfolder2/index.cts === -// cjs format file -const x = () => (void 0); ->x : () => T ->() => (void 0) : () => T ->(void 0) : T ->(void 0) : any ->(void 0) : undefined ->void 0 : undefined ->0 : 0 - -export {x}; ->x : () => T - -=== tests/cases/conformance/node/subfolder2/index.mts === -// esm format file -const x = () => (void 0); ->x : () => T ->() => (void 0) : () => T ->(void 0) : T ->(void 0) : any ->(void 0) : undefined ->void 0 : undefined ->0 : 0 - -export {x}; ->x : () => T - -=== tests/cases/conformance/node/subfolder2/another/index.ts === -// esm format file -const x = () => (void 0); ->x : () => T ->() => (void 0) : () => T ->(void 0) : T ->(void 0) : any ->(void 0) : undefined ->void 0 : undefined ->0 : 0 - -export {x}; ->x : () => T - -=== tests/cases/conformance/node/subfolder2/another/index.mts === -// esm format file -const x = () => (void 0); ->x : () => T ->() => (void 0) : () => T ->(void 0) : T ->(void 0) : any ->(void 0) : undefined ->void 0 : undefined ->0 : 0 - -export {x}; ->x : () => T - -=== tests/cases/conformance/node/subfolder2/another/index.cts === -// cjs format file -const x = () => (void 0); ->x : () => T ->() => (void 0) : () => T ->(void 0) : T ->(void 0) : any ->(void 0) : undefined ->void 0 : undefined ->0 : 0 - -export {x}; ->x : () => T - -=== tests/cases/conformance/node/index.mts === -// esm format file -const x = () => (void 0); ->x : () => T ->() => (void 0) : () => T ->(void 0) : T ->(void 0) : any ->(void 0) : undefined ->void 0 : undefined ->0 : 0 - -export {x}; ->x : () => T - -=== tests/cases/conformance/node/index.cts === -// cjs format file -const x = () => (void 0); ->x : () => T ->() => (void 0) : () => T ->(void 0) : T ->(void 0) : any ->(void 0) : undefined ->void 0 : undefined ->0 : 0 - -export {x}; ->x : () => T - -=== tests/cases/conformance/node/index.ts === -// esm format file -const x = () => (void 0); ->x : () => T ->() => (void 0) : () => T ->(void 0) : T ->(void 0) : any ->(void 0) : undefined ->void 0 : undefined ->0 : 0 - -export {x}; ->x : () => T - diff --git a/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node12).errors.txt b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node12).errors.txt deleted file mode 100644 index bcf0d1d592c..00000000000 --- a/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node12).errors.txt +++ /dev/null @@ -1,38 +0,0 @@ -tests/cases/conformance/node/subfolder/index.ts(2,10): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. -tests/cases/conformance/node/subfolder/index.ts(3,7): error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. -tests/cases/conformance/node/subfolder/index.ts(4,7): error TS2725: Class name cannot be 'Object' when targeting ES5 with module Node12. -tests/cases/conformance/node/subfolder/index.ts(5,14): error TS1216: Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules. - - -==== tests/cases/conformance/node/subfolder/index.ts (4 errors) ==== - // cjs format file - function require() {} - ~~~~~~~ -!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. - const exports = {}; - ~~~~~~~ -!!! error TS2441: Duplicate identifier 'exports'. Compiler reserves name 'exports' in top level scope of a module. - class Object {} - ~~~~~~ -!!! error TS2725: Class name cannot be 'Object' when targeting ES5 with module Node12. - export const __esModule = false; - ~~~~~~~~~~ -!!! error TS1216: Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules. - export {require, exports, Object}; -==== tests/cases/conformance/node/index.ts (0 errors) ==== - // esm format file - function require() {} - const exports = {}; - class Object {} - export const __esModule = false; - export {require, exports, Object}; -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module" - } -==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== - { - "type": "commonjs" - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node12).js b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node12).js deleted file mode 100644 index 064128d216e..00000000000 --- a/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node12).js +++ /dev/null @@ -1,64 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesGeneratedNameCollisions.ts] //// - -//// [index.ts] -// cjs format file -function require() {} -const exports = {}; -class Object {} -export const __esModule = false; -export {require, exports, Object}; -//// [index.ts] -// esm format file -function require() {} -const exports = {}; -class Object {} -export const __esModule = false; -export {require, exports, Object}; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Object = exports.exports = exports.require = exports.__esModule = void 0; -// cjs format file -function require() { } -exports.require = require; -const exports = {}; -exports.exports = exports; -class Object { -} -exports.Object = Object; -exports.__esModule = false; -//// [index.js] -// esm format file -function require() { } -const exports = {}; -class Object { -} -export const __esModule = false; -export { require, exports, Object }; - - -//// [index.d.ts] -declare function require(): void; -declare const exports: {}; -declare class Object { -} -export declare const __esModule = false; -export { require, exports, Object }; -//// [index.d.ts] -declare function require(): void; -declare const exports: {}; -declare class Object { -} -export declare const __esModule = false; -export { require, exports, Object }; diff --git a/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node12).symbols b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node12).symbols deleted file mode 100644 index 9e967fe93b7..00000000000 --- a/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node12).symbols +++ /dev/null @@ -1,38 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -function require() {} ->require : Symbol(require, Decl(index.ts, 0, 0)) - -const exports = {}; ->exports : Symbol(exports, Decl(index.ts, 2, 5)) - -class Object {} ->Object : Symbol(Object, Decl(index.ts, 2, 19)) - -export const __esModule = false; ->__esModule : Symbol(__esModule, Decl(index.ts, 4, 12)) - -export {require, exports, Object}; ->require : Symbol(require, Decl(index.ts, 5, 8)) ->exports : Symbol(exports, Decl(index.ts, 5, 16)) ->Object : Symbol(Object, Decl(index.ts, 5, 25)) - -=== tests/cases/conformance/node/index.ts === -// esm format file -function require() {} ->require : Symbol(require, Decl(index.ts, 0, 0)) - -const exports = {}; ->exports : Symbol(exports, Decl(index.ts, 2, 5)) - -class Object {} ->Object : Symbol(Object, Decl(index.ts, 2, 19)) - -export const __esModule = false; ->__esModule : Symbol(__esModule, Decl(index.ts, 4, 12)) - -export {require, exports, Object}; ->require : Symbol(require, Decl(index.ts, 5, 8)) ->exports : Symbol(exports, Decl(index.ts, 5, 16)) ->Object : Symbol(Object, Decl(index.ts, 5, 25)) - diff --git a/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node12).types b/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node12).types deleted file mode 100644 index 094de6c8692..00000000000 --- a/tests/baselines/reference/nodeModulesGeneratedNameCollisions(module=node12).types +++ /dev/null @@ -1,42 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -function require() {} ->require : () => void - -const exports = {}; ->exports : {} ->{} : {} - -class Object {} ->Object : Object - -export const __esModule = false; ->__esModule : false ->false : false - -export {require, exports, Object}; ->require : () => void ->exports : {} ->Object : typeof Object - -=== tests/cases/conformance/node/index.ts === -// esm format file -function require() {} ->require : () => void - -const exports = {}; ->exports : {} ->{} : {} - -class Object {} ->Object : Object - -export const __esModule = false; ->__esModule : false ->false : false - -export {require, exports, Object}; ->require : () => void ->exports : {} ->Object : typeof Object - diff --git a/tests/baselines/reference/nodeModulesImportAssertions(module=node12).errors.txt b/tests/baselines/reference/nodeModulesImportAssertions(module=node12).errors.txt deleted file mode 100644 index e1c723d1dec..00000000000 --- a/tests/baselines/reference/nodeModulesImportAssertions(module=node12).errors.txt +++ /dev/null @@ -1,28 +0,0 @@ -tests/cases/conformance/node/index.ts(1,18): error TS7062: JSON imports are experimental in ES module mode imports. -tests/cases/conformance/node/index.ts(1,35): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. -tests/cases/conformance/node/otherc.cts(1,35): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. -tests/cases/conformance/node/otherc.cts(2,22): error TS7062: JSON imports are experimental in ES module mode imports. -tests/cases/conformance/node/otherc.cts(2,40): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'. - - -==== tests/cases/conformance/node/index.ts (2 errors) ==== - import json from "./package.json" assert { type: "json" }; - ~~~~~~~~~~~~~~~~ -!!! error TS7062: JSON imports are experimental in ES module mode imports. - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. -==== tests/cases/conformance/node/otherc.cts (3 errors) ==== - import json from "./package.json" assert { type: "json" }; // should error, cjs mode imports don't support assertions - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. - const json2 = import("./package.json", { assert: { type: "json" } }); // should be fine - ~~~~~~~~~~~~~~~~ -!!! error TS7062: JSON imports are experimental in ES module mode imports. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'. -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "pkg", - "private": true, - "type": "module" - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportAssertions(module=node12).js b/tests/baselines/reference/nodeModulesImportAssertions(module=node12).js deleted file mode 100644 index 091166d523c..00000000000 --- a/tests/baselines/reference/nodeModulesImportAssertions(module=node12).js +++ /dev/null @@ -1,20 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesImportAssertions.ts] //// - -//// [index.ts] -import json from "./package.json" assert { type: "json" }; -//// [otherc.cts] -import json from "./package.json" assert { type: "json" }; // should error, cjs mode imports don't support assertions -const json2 = import("./package.json", { assert: { type: "json" } }); // should be fine -//// [package.json] -{ - "name": "pkg", - "private": true, - "type": "module" -} - -//// [index.js] -export {}; -//// [otherc.cjs] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const json2 = import("./package.json", { assert: { type: "json" } }); // should be fine diff --git a/tests/baselines/reference/nodeModulesImportAssertions(module=node12).symbols b/tests/baselines/reference/nodeModulesImportAssertions(module=node12).symbols deleted file mode 100644 index 3bacb3cfabe..00000000000 --- a/tests/baselines/reference/nodeModulesImportAssertions(module=node12).symbols +++ /dev/null @@ -1,25 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -import json from "./package.json" assert { type: "json" }; ->json : Symbol(json, Decl(index.ts, 0, 6)) - -=== tests/cases/conformance/node/otherc.cts === -import json from "./package.json" assert { type: "json" }; // should error, cjs mode imports don't support assertions ->json : Symbol(json, Decl(otherc.cts, 0, 6)) - -const json2 = import("./package.json", { assert: { type: "json" } }); // should be fine ->json2 : Symbol(json2, Decl(otherc.cts, 1, 5)) ->"./package.json" : Symbol("tests/cases/conformance/node/package", Decl(package.json, 0, 0)) ->assert : Symbol(assert, Decl(otherc.cts, 1, 40)) ->type : Symbol(type, Decl(otherc.cts, 1, 50)) - -=== tests/cases/conformance/node/package.json === -{ - "name": "pkg", ->"name" : Symbol("name", Decl(package.json, 0, 1)) - - "private": true, ->"private" : Symbol("private", Decl(package.json, 1, 18)) - - "type": "module" ->"type" : Symbol("type", Decl(package.json, 2, 20)) -} diff --git a/tests/baselines/reference/nodeModulesImportAssertions(module=node12).types b/tests/baselines/reference/nodeModulesImportAssertions(module=node12).types deleted file mode 100644 index 36c03c4d926..00000000000 --- a/tests/baselines/reference/nodeModulesImportAssertions(module=node12).types +++ /dev/null @@ -1,36 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -import json from "./package.json" assert { type: "json" }; ->json : { name: string; private: boolean; type: string; } ->type : any - -=== tests/cases/conformance/node/otherc.cts === -import json from "./package.json" assert { type: "json" }; // should error, cjs mode imports don't support assertions ->json : { name: string; private: boolean; type: string; } ->type : any - -const json2 = import("./package.json", { assert: { type: "json" } }); // should be fine ->json2 : Promise<{ default: { name: string; private: boolean; type: string; }; }> ->import("./package.json", { assert: { type: "json" } }) : Promise<{ default: { name: string; private: boolean; type: string; }; }> ->"./package.json" : "./package.json" ->{ assert: { type: "json" } } : { assert: { type: string; }; } ->assert : { type: string; } ->{ type: "json" } : { type: string; } ->type : string ->"json" : "json" - -=== tests/cases/conformance/node/package.json === -{ ->{ "name": "pkg", "private": true, "type": "module"} : { name: string; private: boolean; type: string; } - - "name": "pkg", ->"name" : string ->"pkg" : "pkg" - - "private": true, ->"private" : boolean ->true : true - - "type": "module" ->"type" : string ->"module" : "module" -} diff --git a/tests/baselines/reference/nodeModulesImportAssignments(module=node12).js b/tests/baselines/reference/nodeModulesImportAssignments(module=node12).js deleted file mode 100644 index c73ff1177a5..00000000000 --- a/tests/baselines/reference/nodeModulesImportAssignments(module=node12).js +++ /dev/null @@ -1,65 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesImportAssignments.ts] //// - -//// [index.ts] -// cjs format file -import fs = require("fs"); -fs.readFile; -export import fs2 = require("fs"); -//// [index.ts] -// esm format file -import fs = require("fs"); -fs.readFile; -export import fs2 = require("fs"); -//// [file.ts] -// esm format file -const __require = null; -const _createRequire = null; -import fs = require("fs"); -fs.readFile; -export import fs2 = require("fs"); -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} -//// [types.d.ts] -declare module "fs"; - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -// cjs format file -const fs = require("fs"); -fs.readFile; -exports.fs2 = require("fs"); -//// [index.js] -import { createRequire as _createRequire } from "module"; -const __require = _createRequire(import.meta.url); -// esm format file -const fs = __require("fs"); -fs.readFile; -const fs2 = __require("fs"); -export { fs2 }; -//// [file.js] -import { createRequire as _createRequire_1 } from "module"; -const __require_1 = _createRequire_1(import.meta.url); -// esm format file -const __require = null; -const _createRequire = null; -const fs = __require_1("fs"); -fs.readFile; -const fs2 = __require_1("fs"); -export { fs2 }; - - -//// [index.d.ts] -export import fs2 = require("fs"); -//// [index.d.ts] -export import fs2 = require("fs"); -//// [file.d.ts] -export import fs2 = require("fs"); diff --git a/tests/baselines/reference/nodeModulesImportAssignments(module=node12).symbols b/tests/baselines/reference/nodeModulesImportAssignments(module=node12).symbols deleted file mode 100644 index ae7fbc666da..00000000000 --- a/tests/baselines/reference/nodeModulesImportAssignments(module=node12).symbols +++ /dev/null @@ -1,43 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -import fs = require("fs"); ->fs : Symbol(fs, Decl(index.ts, 0, 0)) - -fs.readFile; ->fs : Symbol(fs, Decl(index.ts, 0, 0)) - -export import fs2 = require("fs"); ->fs2 : Symbol(fs2, Decl(index.ts, 2, 12)) - -=== tests/cases/conformance/node/index.ts === -// esm format file -import fs = require("fs"); ->fs : Symbol(fs, Decl(index.ts, 0, 0)) - -fs.readFile; ->fs : Symbol(fs, Decl(index.ts, 0, 0)) - -export import fs2 = require("fs"); ->fs2 : Symbol(fs2, Decl(index.ts, 2, 12)) - -=== tests/cases/conformance/node/file.ts === -// esm format file -const __require = null; ->__require : Symbol(__require, Decl(file.ts, 1, 5)) - -const _createRequire = null; ->_createRequire : Symbol(_createRequire, Decl(file.ts, 2, 5)) - -import fs = require("fs"); ->fs : Symbol(fs, Decl(file.ts, 2, 28)) - -fs.readFile; ->fs : Symbol(fs, Decl(file.ts, 2, 28)) - -export import fs2 = require("fs"); ->fs2 : Symbol(fs2, Decl(file.ts, 4, 12)) - -=== tests/cases/conformance/node/types.d.ts === -declare module "fs"; ->"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) - diff --git a/tests/baselines/reference/nodeModulesImportAssignments(module=node12).types b/tests/baselines/reference/nodeModulesImportAssignments(module=node12).types deleted file mode 100644 index 21af2cd798f..00000000000 --- a/tests/baselines/reference/nodeModulesImportAssignments(module=node12).types +++ /dev/null @@ -1,51 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -import fs = require("fs"); ->fs : any - -fs.readFile; ->fs.readFile : any ->fs : any ->readFile : any - -export import fs2 = require("fs"); ->fs2 : any - -=== tests/cases/conformance/node/index.ts === -// esm format file -import fs = require("fs"); ->fs : any - -fs.readFile; ->fs.readFile : any ->fs : any ->readFile : any - -export import fs2 = require("fs"); ->fs2 : any - -=== tests/cases/conformance/node/file.ts === -// esm format file -const __require = null; ->__require : any ->null : null - -const _createRequire = null; ->_createRequire : any ->null : null - -import fs = require("fs"); ->fs : any - -fs.readFile; ->fs.readFile : any ->fs : any ->readFile : any - -export import fs2 = require("fs"); ->fs2 : any - -=== tests/cases/conformance/node/types.d.ts === -declare module "fs"; ->"fs" : any - diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node12).errors.txt b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node12).errors.txt deleted file mode 100644 index b4ae0ff6fb0..00000000000 --- a/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node12).errors.txt +++ /dev/null @@ -1,36 +0,0 @@ -tests/cases/conformance/node/subfolder/index.ts(2,9): error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. -tests/cases/conformance/node/subfolder/index.ts(4,1): error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. - - -==== tests/cases/conformance/node/subfolder/index.ts (2 errors) ==== - // cjs format file - import {default as _fs} from "fs"; - ~~~~~~~~~~~~~~ -!!! error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. - _fs.readFile; - import * as fs from "fs"; - ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. - fs.readFile; -==== tests/cases/conformance/node/index.ts (0 errors) ==== - // esm format file - import {default as _fs} from "fs"; - _fs.readFile; - import * as fs from "fs"; - fs.readFile; -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module" - } -==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== - { - "type": "commonjs" - } -==== tests/cases/conformance/node/types.d.ts (0 errors) ==== - declare module "fs"; - declare module "tslib" { - export {}; - // intentionally missing all helpers - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node12).js b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node12).js deleted file mode 100644 index 4712d65a099..00000000000 --- a/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node12).js +++ /dev/null @@ -1,52 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesImportHelpersCollisions.ts] //// - -//// [index.ts] -// cjs format file -import {default as _fs} from "fs"; -_fs.readFile; -import * as fs from "fs"; -fs.readFile; -//// [index.ts] -// esm format file -import {default as _fs} from "fs"; -_fs.readFile; -import * as fs from "fs"; -fs.readFile; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} -//// [types.d.ts] -declare module "fs"; -declare module "tslib" { - export {}; - // intentionally missing all helpers -} - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = require("tslib"); -// cjs format file -const fs_1 = tslib_1.__importDefault(require("fs")); -fs_1.default.readFile; -const fs = tslib_1.__importStar(require("fs")); -fs.readFile; -//// [index.js] -// esm format file -import { default as _fs } from "fs"; -_fs.readFile; -import * as fs from "fs"; -fs.readFile; - - -//// [index.d.ts] -export {}; -//// [index.d.ts] -export {}; diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node12).symbols b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node12).symbols deleted file mode 100644 index 996840abd4e..00000000000 --- a/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node12).symbols +++ /dev/null @@ -1,40 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -import {default as _fs} from "fs"; ->default : Symbol(_fs, Decl(types.d.ts, 0, 0)) ->_fs : Symbol(_fs, Decl(index.ts, 1, 8)) - -_fs.readFile; ->_fs : Symbol(_fs, Decl(index.ts, 1, 8)) - -import * as fs from "fs"; ->fs : Symbol(fs, Decl(index.ts, 3, 6)) - -fs.readFile; ->fs : Symbol(fs, Decl(index.ts, 3, 6)) - -=== tests/cases/conformance/node/index.ts === -// esm format file -import {default as _fs} from "fs"; ->default : Symbol(_fs, Decl(types.d.ts, 0, 0)) ->_fs : Symbol(_fs, Decl(index.ts, 1, 8)) - -_fs.readFile; ->_fs : Symbol(_fs, Decl(index.ts, 1, 8)) - -import * as fs from "fs"; ->fs : Symbol(fs, Decl(index.ts, 3, 6)) - -fs.readFile; ->fs : Symbol(fs, Decl(index.ts, 3, 6)) - -=== tests/cases/conformance/node/types.d.ts === -declare module "fs"; ->"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) - -declare module "tslib" { ->"tslib" : Symbol("tslib", Decl(types.d.ts, 0, 20)) - - export {}; - // intentionally missing all helpers -} diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node12).types b/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node12).types deleted file mode 100644 index e08e9456be9..00000000000 --- a/tests/baselines/reference/nodeModulesImportHelpersCollisions(module=node12).types +++ /dev/null @@ -1,48 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -import {default as _fs} from "fs"; ->default : any ->_fs : any - -_fs.readFile; ->_fs.readFile : any ->_fs : any ->readFile : any - -import * as fs from "fs"; ->fs : any - -fs.readFile; ->fs.readFile : any ->fs : any ->readFile : any - -=== tests/cases/conformance/node/index.ts === -// esm format file -import {default as _fs} from "fs"; ->default : any ->_fs : any - -_fs.readFile; ->_fs.readFile : any ->_fs : any ->readFile : any - -import * as fs from "fs"; ->fs : any - -fs.readFile; ->fs.readFile : any ->fs : any ->readFile : any - -=== tests/cases/conformance/node/types.d.ts === -declare module "fs"; ->"fs" : any - -declare module "tslib" { ->"tslib" : typeof import("tslib") - - export {}; - // intentionally missing all helpers -} diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node12).errors.txt b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node12).errors.txt deleted file mode 100644 index d2f62391af2..00000000000 --- a/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node12).errors.txt +++ /dev/null @@ -1,32 +0,0 @@ -tests/cases/conformance/node/subfolder/index.ts(2,1): error TS2343: This syntax requires an imported helper named '__exportStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. -tests/cases/conformance/node/subfolder/index.ts(3,1): error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. - - -==== tests/cases/conformance/node/subfolder/index.ts (2 errors) ==== - // cjs format file - export * from "fs"; - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2343: This syntax requires an imported helper named '__exportStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. - export * as fs from "fs"; - ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2343: This syntax requires an imported helper named '__importStar' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. -==== tests/cases/conformance/node/index.ts (0 errors) ==== - // esm format file - export * from "fs"; - export * as fs from "fs"; -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module" - } -==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== - { - "type": "commonjs" - } -==== tests/cases/conformance/node/types.d.ts (0 errors) ==== - declare module "fs"; - declare module "tslib" { - export {}; - // intentionally missing all helpers - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node12).js b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node12).js deleted file mode 100644 index c058d00e216..00000000000 --- a/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node12).js +++ /dev/null @@ -1,47 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesImportHelpersCollisions2.ts] //// - -//// [index.ts] -// cjs format file -export * from "fs"; -export * as fs from "fs"; -//// [index.ts] -// esm format file -export * from "fs"; -export * as fs from "fs"; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} -//// [types.d.ts] -declare module "fs"; -declare module "tslib" { - export {}; - // intentionally missing all helpers -} - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.fs = void 0; -const tslib_1 = require("tslib"); -// cjs format file -tslib_1.__exportStar(require("fs"), exports); -exports.fs = tslib_1.__importStar(require("fs")); -//// [index.js] -// esm format file -export * from "fs"; -export * as fs from "fs"; - - -//// [index.d.ts] -export * from "fs"; -export * as fs from "fs"; -//// [index.d.ts] -export * from "fs"; -export * as fs from "fs"; diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node12).symbols b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node12).symbols deleted file mode 100644 index 367ba59adf0..00000000000 --- a/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node12).symbols +++ /dev/null @@ -1,22 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -export * from "fs"; -export * as fs from "fs"; ->fs : Symbol(fs, Decl(index.ts, 2, 6)) - -=== tests/cases/conformance/node/index.ts === -// esm format file -export * from "fs"; -export * as fs from "fs"; ->fs : Symbol(fs, Decl(index.ts, 2, 6)) - -=== tests/cases/conformance/node/types.d.ts === -declare module "fs"; ->"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) - -declare module "tslib" { ->"tslib" : Symbol("tslib", Decl(types.d.ts, 0, 20)) - - export {}; - // intentionally missing all helpers -} diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node12).types b/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node12).types deleted file mode 100644 index 6a468baefa7..00000000000 --- a/tests/baselines/reference/nodeModulesImportHelpersCollisions2(module=node12).types +++ /dev/null @@ -1,22 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -export * from "fs"; -export * as fs from "fs"; ->fs : any - -=== tests/cases/conformance/node/index.ts === -// esm format file -export * from "fs"; -export * as fs from "fs"; ->fs : any - -=== tests/cases/conformance/node/types.d.ts === -declare module "fs"; ->"fs" : any - -declare module "tslib" { ->"tslib" : typeof import("tslib") - - export {}; - // intentionally missing all helpers -} diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node12).errors.txt b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node12).errors.txt deleted file mode 100644 index d511944f393..00000000000 --- a/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node12).errors.txt +++ /dev/null @@ -1,27 +0,0 @@ -tests/cases/conformance/node/subfolder/index.ts(2,9): error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. - - -==== tests/cases/conformance/node/subfolder/index.ts (1 errors) ==== - // cjs format file - export {default} from "fs"; - ~~~~~~~ -!!! error TS2343: This syntax requires an imported helper named '__importDefault' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'. -==== tests/cases/conformance/node/index.ts (0 errors) ==== - // esm format file - export {default} from "fs"; -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module" - } -==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== - { - "type": "commonjs" - } -==== tests/cases/conformance/node/types.d.ts (0 errors) ==== - declare module "fs"; - declare module "tslib" { - export {}; - // intentionally missing all helpers - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node12).js b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node12).js deleted file mode 100644 index 8abf8ba9ada..00000000000 --- a/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node12).js +++ /dev/null @@ -1,44 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesImportHelpersCollisions3.ts] //// - -//// [index.ts] -// cjs format file -export {default} from "fs"; -//// [index.ts] -// esm format file -export {default} from "fs"; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} -//// [types.d.ts] -declare module "fs"; -declare module "tslib" { - export {}; - // intentionally missing all helpers -} - -//// [index.js] -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = void 0; -// cjs format file -var fs_1 = require("fs"); -Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(fs_1).default; } }); -//// [index.js] -// esm format file -export { default } from "fs"; - - -//// [index.d.ts] -export { default } from "fs"; -//// [index.d.ts] -export { default } from "fs"; diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node12).symbols b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node12).symbols deleted file mode 100644 index aec1d32dab1..00000000000 --- a/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node12).symbols +++ /dev/null @@ -1,20 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -export {default} from "fs"; ->default : Symbol(default, Decl(index.ts, 1, 8)) - -=== tests/cases/conformance/node/index.ts === -// esm format file -export {default} from "fs"; ->default : Symbol(default, Decl(index.ts, 1, 8)) - -=== tests/cases/conformance/node/types.d.ts === -declare module "fs"; ->"fs" : Symbol("fs", Decl(types.d.ts, 0, 0)) - -declare module "tslib" { ->"tslib" : Symbol("tslib", Decl(types.d.ts, 0, 20)) - - export {}; - // intentionally missing all helpers -} diff --git a/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node12).types b/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node12).types deleted file mode 100644 index eef93356ac7..00000000000 --- a/tests/baselines/reference/nodeModulesImportHelpersCollisions3(module=node12).types +++ /dev/null @@ -1,20 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -export {default} from "fs"; ->default : any - -=== tests/cases/conformance/node/index.ts === -// esm format file -export {default} from "fs"; ->default : any - -=== tests/cases/conformance/node/types.d.ts === -declare module "fs"; ->"fs" : any - -declare module "tslib" { ->"tslib" : typeof import("tslib") - - export {}; - // intentionally missing all helpers -} diff --git a/tests/baselines/reference/nodeModulesImportMeta(module=node12).errors.txt b/tests/baselines/reference/nodeModulesImportMeta(module=node12).errors.txt deleted file mode 100644 index 27f6e3c9e28..00000000000 --- a/tests/baselines/reference/nodeModulesImportMeta(module=node12).errors.txt +++ /dev/null @@ -1,23 +0,0 @@ -tests/cases/conformance/node/subfolder/index.ts(2,11): error TS1470: The 'import.meta' meta-property is not allowed in files which will build into CommonJS output. - - -==== tests/cases/conformance/node/subfolder/index.ts (1 errors) ==== - // cjs format file - const x = import.meta.url; - ~~~~~~~~~~~ -!!! error TS1470: The 'import.meta' meta-property is not allowed in files which will build into CommonJS output. - export {x}; -==== tests/cases/conformance/node/index.ts (0 errors) ==== - // esm format file - const x = import.meta.url; - export {x}; -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module" - } -==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== - { - "type": "commonjs" - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportMeta(module=node12).js b/tests/baselines/reference/nodeModulesImportMeta(module=node12).js deleted file mode 100644 index aa962a90bd3..00000000000 --- a/tests/baselines/reference/nodeModulesImportMeta(module=node12).js +++ /dev/null @@ -1,40 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesImportMeta.ts] //// - -//// [index.ts] -// cjs format file -const x = import.meta.url; -export {x}; -//// [index.ts] -// esm format file -const x = import.meta.url; -export {x}; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.x = void 0; -// cjs format file -const x = import.meta.url; -exports.x = x; -//// [index.js] -// esm format file -const x = import.meta.url; -export { x }; - - -//// [index.d.ts] -declare const x: string; -export { x }; -//// [index.d.ts] -declare const x: string; -export { x }; diff --git a/tests/baselines/reference/nodeModulesImportMeta(module=node12).symbols b/tests/baselines/reference/nodeModulesImportMeta(module=node12).symbols deleted file mode 100644 index 4a9cda0f125..00000000000 --- a/tests/baselines/reference/nodeModulesImportMeta(module=node12).symbols +++ /dev/null @@ -1,24 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -const x = import.meta.url; ->x : Symbol(x, Decl(index.ts, 1, 5)) ->import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) ->import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) ->meta : Symbol(ImportMetaExpression.meta) ->url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) - -export {x}; ->x : Symbol(x, Decl(index.ts, 2, 8)) - -=== tests/cases/conformance/node/index.ts === -// esm format file -const x = import.meta.url; ->x : Symbol(x, Decl(index.ts, 1, 5)) ->import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) ->import.meta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) ->meta : Symbol(ImportMetaExpression.meta) ->url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --)) - -export {x}; ->x : Symbol(x, Decl(index.ts, 2, 8)) - diff --git a/tests/baselines/reference/nodeModulesImportMeta(module=node12).types b/tests/baselines/reference/nodeModulesImportMeta(module=node12).types deleted file mode 100644 index 6f64dc2b5fa..00000000000 --- a/tests/baselines/reference/nodeModulesImportMeta(module=node12).types +++ /dev/null @@ -1,24 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -const x = import.meta.url; ->x : string ->import.meta.url : string ->import.meta : ImportMeta ->meta : any ->url : string - -export {x}; ->x : string - -=== tests/cases/conformance/node/index.ts === -// esm format file -const x = import.meta.url; ->x : string ->import.meta.url : string ->import.meta : ImportMeta ->meta : any ->url : string - -export {x}; ->x : string - diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node12).errors.txt b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node12).errors.txt deleted file mode 100644 index a8a76a05152..00000000000 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node12).errors.txt +++ /dev/null @@ -1,37 +0,0 @@ -/index.ts(6,50): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. -/index.ts(7,14): error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. -/index.ts(7,49): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. - - -==== /index.ts (3 errors) ==== - import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; - import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; - - export interface LocalInterface extends RequireInterface, ImportInterface {} - - import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. - import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; - ~~~~~~~~~~~~~~~ -!!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. - export interface Loc extends Req, Imp {} - - export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; - export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; - -==== /node_modules/pkg/package.json (0 errors) ==== - { - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } - } -==== /node_modules/pkg/import.d.ts (0 errors) ==== - export interface ImportInterface {} -==== /node_modules/pkg/require.d.ts (0 errors) ==== - export interface RequireInterface {} \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node12).js b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node12).js deleted file mode 100644 index 1b8bc65976e..00000000000 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node12).js +++ /dev/null @@ -1,45 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit1.ts] //// - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } -} -//// [import.d.ts] -export interface ImportInterface {} -//// [require.d.ts] -export interface RequireInterface {} -//// [index.ts] -import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; -import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; - -export interface LocalInterface extends RequireInterface, ImportInterface {} - -import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; -import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; -export interface Loc extends Req, Imp {} - -export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; -export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; - - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); - - -//// [index.d.ts] -import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; -import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; -export interface LocalInterface extends RequireInterface, ImportInterface { -} -import { type RequireInterface as Req } from "pkg" assert { "resolution-mode": "require" }; -import { type ImportInterface as Imp } from "pkg" assert { "resolution-mode": "import" }; -export interface Loc extends Req, Imp { -} -export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; -export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node12).symbols b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node12).symbols deleted file mode 100644 index e9a80972b95..00000000000 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node12).symbols +++ /dev/null @@ -1,38 +0,0 @@ -=== /index.ts === -import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; ->RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) - -import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; ->ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) - -export interface LocalInterface extends RequireInterface, ImportInterface {} ->LocalInterface : Symbol(LocalInterface, Decl(index.ts, 1, 82)) ->RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) ->ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) - -import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) ->Req : Symbol(Req, Decl(index.ts, 5, 8)) - -import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; ->Imp : Symbol(Imp, Decl(index.ts, 6, 8)) - -export interface Loc extends Req, Imp {} ->Loc : Symbol(Loc, Decl(index.ts, 6, 87)) ->Req : Symbol(Req, Decl(index.ts, 5, 8)) ->Imp : Symbol(Imp, Decl(index.ts, 6, 8)) - -export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; ->RequireInterface : Symbol(RequireInterface, Decl(index.ts, 9, 13)) - -export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; ->ImportInterface : Symbol(ImportInterface, Decl(index.ts, 10, 13)) - -=== /node_modules/pkg/import.d.ts === -export interface ImportInterface {} ->ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) - -=== /node_modules/pkg/require.d.ts === -export interface RequireInterface {} ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) - diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node12).types b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node12).types deleted file mode 100644 index 61190a772be..00000000000 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node12).types +++ /dev/null @@ -1,30 +0,0 @@ -=== /index.ts === -import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; ->RequireInterface : RequireInterface - -import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; ->ImportInterface : ImportInterface - -export interface LocalInterface extends RequireInterface, ImportInterface {} - -import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; ->RequireInterface : any ->Req : any - -import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; ->ImportInterface : any ->Imp : any - -export interface Loc extends Req, Imp {} - -export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; ->RequireInterface : RequireInterface - -export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; ->ImportInterface : ImportInterface - -=== /node_modules/pkg/import.d.ts === -export interface ImportInterface {} -No type information for this code.=== /node_modules/pkg/require.d.ts === -export interface RequireInterface {} -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node12).errors.txt b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node12).errors.txt deleted file mode 100644 index 0403a6e026f..00000000000 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node12).errors.txt +++ /dev/null @@ -1,42 +0,0 @@ -/index.ts(6,14): error TS2305: Module '"pkg"' has no exported member 'RequireInterface'. -/index.ts(6,50): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. -/index.ts(7,49): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. - - -==== /index.ts (3 errors) ==== - import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; - import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; - - export interface LocalInterface extends RequireInterface, ImportInterface {} - - import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; - ~~~~~~~~~~~~~~~~ -!!! error TS2305: Module '"pkg"' has no exported member 'RequireInterface'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. - import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. - export interface Loc extends Req, Imp {} - - export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; - export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; - -==== /node_modules/pkg/package.json (0 errors) ==== - { - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } - } -==== /node_modules/pkg/import.d.ts (0 errors) ==== - export interface ImportInterface {} -==== /node_modules/pkg/require.d.ts (0 errors) ==== - export interface RequireInterface {} -==== /package.json (0 errors) ==== - { - "private": true, - "type": "module" - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node12).js b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node12).js deleted file mode 100644 index fad19d466a6..00000000000 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node12).js +++ /dev/null @@ -1,49 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesImportModeDeclarationEmit2.ts] //// - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } -} -//// [import.d.ts] -export interface ImportInterface {} -//// [require.d.ts] -export interface RequireInterface {} -//// [package.json] -{ - "private": true, - "type": "module" -} -//// [index.ts] -import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; -import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; - -export interface LocalInterface extends RequireInterface, ImportInterface {} - -import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; -import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; -export interface Loc extends Req, Imp {} - -export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; -export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; - - -//// [index.js] -export {}; - - -//// [index.d.ts] -import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; -import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; -export interface LocalInterface extends RequireInterface, ImportInterface { -} -import { type RequireInterface as Req } from "pkg" assert { "resolution-mode": "require" }; -import { type ImportInterface as Imp } from "pkg" assert { "resolution-mode": "import" }; -export interface Loc extends Req, Imp { -} -export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; -export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node12).symbols b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node12).symbols deleted file mode 100644 index fe172a1586e..00000000000 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node12).symbols +++ /dev/null @@ -1,38 +0,0 @@ -=== /index.ts === -import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; ->RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) - -import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; ->ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) - -export interface LocalInterface extends RequireInterface, ImportInterface {} ->LocalInterface : Symbol(LocalInterface, Decl(index.ts, 1, 82)) ->RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) ->ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) - -import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; ->Req : Symbol(Req, Decl(index.ts, 5, 8)) - -import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; ->ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) ->Imp : Symbol(Imp, Decl(index.ts, 6, 8)) - -export interface Loc extends Req, Imp {} ->Loc : Symbol(Loc, Decl(index.ts, 6, 87)) ->Req : Symbol(Req, Decl(index.ts, 5, 8)) ->Imp : Symbol(Imp, Decl(index.ts, 6, 8)) - -export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; ->RequireInterface : Symbol(RequireInterface, Decl(index.ts, 9, 13)) - -export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; ->ImportInterface : Symbol(ImportInterface, Decl(index.ts, 10, 13)) - -=== /node_modules/pkg/import.d.ts === -export interface ImportInterface {} ->ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) - -=== /node_modules/pkg/require.d.ts === -export interface RequireInterface {} ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) - diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node12).types b/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node12).types deleted file mode 100644 index 61190a772be..00000000000 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node12).types +++ /dev/null @@ -1,30 +0,0 @@ -=== /index.ts === -import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; ->RequireInterface : RequireInterface - -import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; ->ImportInterface : ImportInterface - -export interface LocalInterface extends RequireInterface, ImportInterface {} - -import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" }; ->RequireInterface : any ->Req : any - -import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" }; ->ImportInterface : any ->Imp : any - -export interface Loc extends Req, Imp {} - -export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" }; ->RequireInterface : RequireInterface - -export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; ->ImportInterface : ImportInterface - -=== /node_modules/pkg/import.d.ts === -export interface ImportInterface {} -No type information for this code.=== /node_modules/pkg/require.d.ts === -export interface RequireInterface {} -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node12).errors.txt b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node12).errors.txt deleted file mode 100644 index bc3eb30565c..00000000000 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node12).errors.txt +++ /dev/null @@ -1,43 +0,0 @@ -/index.ts(2,45): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. -/index.ts(2,73): error TS1453: `resolution-mode` should be either `require` or `import`. -/index.ts(4,10): error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. -/index.ts(4,39): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. -/index.ts(6,76): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. - - -==== /index.ts (5 errors) ==== - // incorrect mode - import type { RequireInterface } from "pkg" assert { "resolution-mode": "foobar" }; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. - ~~~~~~~~ -!!! error TS1453: `resolution-mode` should be either `require` or `import`. - // not type-only - import { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; - ~~~~~~~~~~~~~~~ -!!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. - // not exclusively type-only - import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" assert { "resolution-mode": "require" }; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'. - - export interface LocalInterface extends RequireInterface, ImportInterface {} - - - - -==== /node_modules/pkg/package.json (0 errors) ==== - { - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } - } -==== /node_modules/pkg/import.d.ts (0 errors) ==== - export interface ImportInterface {} -==== /node_modules/pkg/require.d.ts (0 errors) ==== - export interface RequireInterface {} \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node12).js b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node12).js deleted file mode 100644 index 3b2af2656d0..00000000000 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node12).js +++ /dev/null @@ -1,39 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesImportModeDeclarationEmitErrors1.ts] //// - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } -} -//// [import.d.ts] -export interface ImportInterface {} -//// [require.d.ts] -export interface RequireInterface {} -//// [index.ts] -// incorrect mode -import type { RequireInterface } from "pkg" assert { "resolution-mode": "foobar" }; -// not type-only -import { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; -// not exclusively type-only -import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" assert { "resolution-mode": "require" }; - -export interface LocalInterface extends RequireInterface, ImportInterface {} - - - - - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); - - -//// [index.d.ts] -import type { RequireInterface } from "pkg"; -import { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; -export interface LocalInterface extends RequireInterface, ImportInterface { -} diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node12).symbols b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node12).symbols deleted file mode 100644 index fd145783183..00000000000 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node12).symbols +++ /dev/null @@ -1,28 +0,0 @@ -=== /index.ts === -// incorrect mode -import type { RequireInterface } from "pkg" assert { "resolution-mode": "foobar" }; ->RequireInterface : Symbol(RequireInterface, Decl(index.ts, 1, 13)) - -// not type-only -import { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; ->ImportInterface : Symbol(ImportInterface, Decl(index.ts, 3, 8)) - -// not exclusively type-only -import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" assert { "resolution-mode": "require" }; ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) ->Req : Symbol(Req, Decl(index.ts, 5, 8)) ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) ->Req2 : Symbol(Req2, Decl(index.ts, 5, 37)) - -export interface LocalInterface extends RequireInterface, ImportInterface {} ->LocalInterface : Symbol(LocalInterface, Decl(index.ts, 5, 115)) ->RequireInterface : Symbol(RequireInterface, Decl(index.ts, 1, 13)) ->ImportInterface : Symbol(ImportInterface, Decl(index.ts, 3, 8)) - - - - -=== /node_modules/pkg/require.d.ts === -export interface RequireInterface {} ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) - diff --git a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node12).types b/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node12).types deleted file mode 100644 index 07bda5323db..00000000000 --- a/tests/baselines/reference/nodeModulesImportModeDeclarationEmitErrors1(module=node12).types +++ /dev/null @@ -1,24 +0,0 @@ -=== /index.ts === -// incorrect mode -import type { RequireInterface } from "pkg" assert { "resolution-mode": "foobar" }; ->RequireInterface : RequireInterface - -// not type-only -import { ImportInterface } from "pkg" assert { "resolution-mode": "import" }; ->ImportInterface : any - -// not exclusively type-only -import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" assert { "resolution-mode": "require" }; ->RequireInterface : any ->Req : any ->RequireInterface : any ->Req2 : any - -export interface LocalInterface extends RequireInterface, ImportInterface {} - - - - -=== /node_modules/pkg/require.d.ts === -export interface RequireInterface {} -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node12).js b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node12).js deleted file mode 100644 index d9c0ba1a429..00000000000 --- a/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node12).js +++ /dev/null @@ -1,70 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesImportResolutionIntoExport.ts] //// - -//// [index.ts] -// esm format file -import * as type from "#type"; -type; -//// [index.mts] -// esm format file -import * as type from "#type"; -type; -//// [index.cts] -// esm format file -import * as type from "#type"; -type; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module", - "exports": "./index.cjs", - "imports": { - "#type": "package" - } -} - -//// [index.cjs] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// esm format file -const type = __importStar(require("#type")); -type; -//// [index.js] -// esm format file -import * as type from "#type"; -type; -//// [index.mjs] -// esm format file -import * as type from "#type"; -type; - - -//// [index.d.cts] -export {}; -//// [index.d.ts] -export {}; -//// [index.d.mts] -export {}; diff --git a/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node12).symbols b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node12).symbols deleted file mode 100644 index 1a0ad59fc81..00000000000 --- a/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node12).symbols +++ /dev/null @@ -1,24 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import * as type from "#type"; ->type : Symbol(type, Decl(index.ts, 1, 6)) - -type; ->type : Symbol(type, Decl(index.ts, 1, 6)) - -=== tests/cases/conformance/node/index.mts === -// esm format file -import * as type from "#type"; ->type : Symbol(type, Decl(index.mts, 1, 6)) - -type; ->type : Symbol(type, Decl(index.mts, 1, 6)) - -=== tests/cases/conformance/node/index.cts === -// esm format file -import * as type from "#type"; ->type : Symbol(type, Decl(index.cts, 1, 6)) - -type; ->type : Symbol(type, Decl(index.cts, 1, 6)) - diff --git a/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node12).types b/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node12).types deleted file mode 100644 index cb05ede987e..00000000000 --- a/tests/baselines/reference/nodeModulesImportResolutionIntoExport(module=node12).types +++ /dev/null @@ -1,24 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import * as type from "#type"; ->type : typeof type - -type; ->type : typeof type - -=== tests/cases/conformance/node/index.mts === -// esm format file -import * as type from "#type"; ->type : typeof type - -type; ->type : typeof type - -=== tests/cases/conformance/node/index.cts === -// esm format file -import * as type from "#type"; ->type : typeof type - -type; ->type : typeof type - diff --git a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node12).errors.txt b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node12).errors.txt deleted file mode 100644 index c73a7a7885f..00000000000 --- a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node12).errors.txt +++ /dev/null @@ -1,33 +0,0 @@ -tests/cases/conformance/node/index.cts(2,23): error TS2307: Cannot find module '#type' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(2,23): error TS2307: Cannot find module '#type' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(2,23): error TS2307: Cannot find module '#type' or its corresponding type declarations. - - -==== tests/cases/conformance/node/index.ts (1 errors) ==== - // esm format file - import * as type from "#type"; - ~~~~~~~ -!!! error TS2307: Cannot find module '#type' or its corresponding type declarations. - type; -==== tests/cases/conformance/node/index.mts (1 errors) ==== - // esm format file - import * as type from "#type"; - ~~~~~~~ -!!! error TS2307: Cannot find module '#type' or its corresponding type declarations. - type; -==== tests/cases/conformance/node/index.cts (1 errors) ==== - // esm format file - import * as type from "#type"; - ~~~~~~~ -!!! error TS2307: Cannot find module '#type' or its corresponding type declarations. - type; -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module", - "exports": "package", - "imports": { - "#type": "package" - } - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node12).js b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node12).js deleted file mode 100644 index a5ed511f6f5..00000000000 --- a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node12).js +++ /dev/null @@ -1,70 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesImportResolutionNoCycle.ts] //// - -//// [index.ts] -// esm format file -import * as type from "#type"; -type; -//// [index.mts] -// esm format file -import * as type from "#type"; -type; -//// [index.cts] -// esm format file -import * as type from "#type"; -type; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module", - "exports": "package", - "imports": { - "#type": "package" - } -} - -//// [index.js] -// esm format file -import * as type from "#type"; -type; -//// [index.mjs] -// esm format file -import * as type from "#type"; -type; -//// [index.cjs] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// esm format file -const type = __importStar(require("#type")); -type; - - -//// [index.d.ts] -export {}; -//// [index.d.mts] -export {}; -//// [index.d.cts] -export {}; diff --git a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node12).symbols b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node12).symbols deleted file mode 100644 index 1a0ad59fc81..00000000000 --- a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node12).symbols +++ /dev/null @@ -1,24 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import * as type from "#type"; ->type : Symbol(type, Decl(index.ts, 1, 6)) - -type; ->type : Symbol(type, Decl(index.ts, 1, 6)) - -=== tests/cases/conformance/node/index.mts === -// esm format file -import * as type from "#type"; ->type : Symbol(type, Decl(index.mts, 1, 6)) - -type; ->type : Symbol(type, Decl(index.mts, 1, 6)) - -=== tests/cases/conformance/node/index.cts === -// esm format file -import * as type from "#type"; ->type : Symbol(type, Decl(index.cts, 1, 6)) - -type; ->type : Symbol(type, Decl(index.cts, 1, 6)) - diff --git a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node12).types b/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node12).types deleted file mode 100644 index 8bfd3afd06e..00000000000 --- a/tests/baselines/reference/nodeModulesImportResolutionNoCycle(module=node12).types +++ /dev/null @@ -1,24 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import * as type from "#type"; ->type : any - -type; ->type : any - -=== tests/cases/conformance/node/index.mts === -// esm format file -import * as type from "#type"; ->type : any - -type; ->type : any - -=== tests/cases/conformance/node/index.cts === -// esm format file -import * as type from "#type"; ->type : any - -type; ->type : any - diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node12).js b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node12).js deleted file mode 100644 index 4a65e05cdd9..00000000000 --- a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node12).js +++ /dev/null @@ -1,36 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmit1.ts] //// - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } -} -//// [import.d.ts] -export interface ImportInterface {} -//// [require.d.ts] -export interface RequireInterface {} -//// [index.ts] -export type LocalInterface = - & import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface - & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; - -export const a = (null as any as import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface); -export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); - - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.b = exports.a = void 0; -exports.a = null; -exports.b = null; - - -//// [index.d.ts] -export declare type LocalInterface = import("pkg", { assert: { "resolution-mode": "require" } }).RequireInterface & import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; -export declare const a: import("pkg").RequireInterface; -export declare const b: import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node12).symbols b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node12).symbols deleted file mode 100644 index dd5d4527772..00000000000 --- a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node12).symbols +++ /dev/null @@ -1,26 +0,0 @@ -=== /index.ts === -export type LocalInterface = ->LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) - - & import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) - - & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; ->ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) - -export const a = (null as any as import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface); ->a : Symbol(a, Decl(index.ts, 4, 12)) ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) - -export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); ->b : Symbol(b, Decl(index.ts, 5, 12)) ->ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) - -=== /node_modules/pkg/import.d.ts === -export interface ImportInterface {} ->ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) - -=== /node_modules/pkg/require.d.ts === -export interface RequireInterface {} ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) - diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node12).types b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node12).types deleted file mode 100644 index 520761d1b0a..00000000000 --- a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node12).types +++ /dev/null @@ -1,26 +0,0 @@ -=== /index.ts === -export type LocalInterface = ->LocalInterface : import("/node_modules/pkg/require").RequireInterface & import("/node_modules/pkg/import").ImportInterface - - & import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface - & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; - -export const a = (null as any as import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface); ->a : import("/node_modules/pkg/require").RequireInterface ->(null as any as import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface ->null as any as import("pkg", { assert: {"resolution-mode": "require"} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface ->null as any : any ->null : null - -export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); ->b : import("/node_modules/pkg/import").ImportInterface ->(null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface) : import("/node_modules/pkg/import").ImportInterface ->null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface : import("/node_modules/pkg/import").ImportInterface ->null as any : any ->null : null - -=== /node_modules/pkg/import.d.ts === -export interface ImportInterface {} -No type information for this code.=== /node_modules/pkg/require.d.ts === -export interface RequireInterface {} -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node12).errors.txt b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node12).errors.txt deleted file mode 100644 index b8b88af5ded..00000000000 --- a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node12).errors.txt +++ /dev/null @@ -1,304 +0,0 @@ -/index.ts(2,51): error TS1453: `resolution-mode` should be either `require` or `import`. -/index.ts(5,78): error TS1453: `resolution-mode` should be either `require` or `import`. -/other.ts(3,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? -/other.ts(3,22): error TS1005: 'assert' expected. -/other.ts(3,39): error TS1005: ';' expected. -/other.ts(3,50): error TS1128: Declaration or statement expected. -/other.ts(3,51): error TS1128: Declaration or statement expected. -/other.ts(3,52): error TS1128: Declaration or statement expected. -/other.ts(3,53): error TS2304: Cannot find name 'RequireInterface'. -/other.ts(4,22): error TS2322: Type '{ "resolution-mode": string; }' is not assignable to type 'ImportCallOptions'. - Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'. -/other.ts(4,52): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. -/other.ts(6,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? -/other.ts(6,49): error TS1005: 'assert' expected. -/other.ts(6,66): error TS1005: ';' expected. -/other.ts(6,77): error TS1128: Declaration or statement expected. -/other.ts(6,78): error TS1128: Declaration or statement expected. -/other.ts(6,79): error TS1128: Declaration or statement expected. -/other.ts(6,80): error TS1434: Unexpected keyword or identifier. -/other.ts(6,80): error TS2304: Cannot find name 'RequireInterface'. -/other.ts(6,96): error TS1128: Declaration or statement expected. -/other.ts(7,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? -/other.ts(7,49): error TS1005: 'assert' expected. -/other.ts(7,66): error TS1005: ';' expected. -/other.ts(7,76): error TS1128: Declaration or statement expected. -/other.ts(7,77): error TS1128: Declaration or statement expected. -/other.ts(7,78): error TS1128: Declaration or statement expected. -/other.ts(7,79): error TS1434: Unexpected keyword or identifier. -/other.ts(7,79): error TS2304: Cannot find name 'ImportInterface'. -/other.ts(7,94): error TS1128: Declaration or statement expected. -/other2.ts(3,32): error TS1455: `resolution-mode` is the only valid key for type import assertions. -/other2.ts(4,32): error TS1455: `resolution-mode` is the only valid key for type import assertions. -/other2.ts(4,52): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. -/other2.ts(6,59): error TS1455: `resolution-mode` is the only valid key for type import assertions. -/other2.ts(7,59): error TS1455: `resolution-mode` is the only valid key for type import assertions. -/other2.ts(7,79): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. -/other3.ts(3,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? -/other3.ts(3,21): error TS1005: '{' expected. -/other3.ts(3,23): error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. -/other3.ts(3,55): error TS1005: ';' expected. -/other3.ts(3,56): error TS1128: Declaration or statement expected. -/other3.ts(3,57): error TS2304: Cannot find name 'RequireInterface'. -/other3.ts(4,21): error TS2559: Type '{ "resolution-mode": string; }[]' has no properties in common with type 'ImportCallOptions'. -/other3.ts(4,56): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. -/other3.ts(6,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? -/other3.ts(6,48): error TS1005: '{' expected. -/other3.ts(6,50): error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. -/other3.ts(6,100): error TS1005: ',' expected. -/other3.ts(7,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? -/other3.ts(7,48): error TS1005: '{' expected. -/other3.ts(7,50): error TS2538: Type '{ "resolution-mode": "import"; }' cannot be used as an index type. -/other3.ts(7,98): error TS1005: ',' expected. -/other4.ts(6,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? -/other4.ts(6,21): error TS1005: '{' expected. -/other4.ts(6,21): error TS2448: Block-scoped variable 'Asserts1' used before its declaration. -/other4.ts(6,29): error TS1128: Declaration or statement expected. -/other4.ts(6,30): error TS1128: Declaration or statement expected. -/other4.ts(6,31): error TS2448: Block-scoped variable 'RequireInterface' used before its declaration. -/other4.ts(7,21): error TS2448: Block-scoped variable 'Asserts2' used before its declaration. -/other4.ts(7,31): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. -/other4.ts(9,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? -/other4.ts(9,48): error TS1005: '{' expected. -/other4.ts(9,56): error TS1005: ',' expected. -/other4.ts(9,57): error TS1134: Variable declaration expected. -/other4.ts(9,74): error TS1005: ',' expected. -/other4.ts(10,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? -/other4.ts(10,48): error TS1005: '{' expected. -/other4.ts(10,56): error TS1005: ',' expected. -/other4.ts(10,57): error TS1134: Variable declaration expected. -/other4.ts(10,73): error TS1005: ',' expected. -/other5.ts(2,31): error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. -/other5.ts(3,31): error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. -/other5.ts(3,37): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. -/other5.ts(5,58): error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. -/other5.ts(6,58): error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. -/other5.ts(6,64): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. - - -==== /node_modules/pkg/package.json (0 errors) ==== - { - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } - } -==== /node_modules/pkg/import.d.ts (0 errors) ==== - export interface ImportInterface {} -==== /node_modules/pkg/require.d.ts (0 errors) ==== - export interface RequireInterface {} -==== /index.ts (2 errors) ==== - export type LocalInterface = - & import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface - ~~~~~~~~ -!!! error TS1453: `resolution-mode` should be either `require` or `import`. - & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; - - export const a = (null as any as import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface); - ~~~~~~~~ -!!! error TS1453: `resolution-mode` should be either `require` or `import`. - export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); -==== /other.ts (27 errors) ==== - // missing assert: - export type LocalInterface = - & import("pkg", {"resolution-mode": "require"}).RequireInterface - ~~~~~~~~~~~~~~~ -!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? - ~~~~~~~~~~~~~~~~~ -!!! error TS1005: 'assert' expected. -!!! related TS1007 /other.ts:3:21: The parser expected to find a '}' to match the '{' token here. - ~ -!!! error TS1005: ';' expected. - ~ -!!! error TS1128: Declaration or statement expected. - ~ -!!! error TS1128: Declaration or statement expected. - ~ -!!! error TS1128: Declaration or statement expected. - ~~~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'RequireInterface'. - & import("pkg", {"resolution-mode": "import"}).ImportInterface; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ "resolution-mode": string; }' is not assignable to type 'ImportCallOptions'. -!!! error TS2322: Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'. - ~~~~~~~~~~~~~~~ -!!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. - - export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); - ~~~~~~~~~~~~~~~ -!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? - ~~~~~~~~~~~~~~~~~ -!!! error TS1005: 'assert' expected. -!!! related TS1007 /other.ts:6:48: The parser expected to find a '}' to match the '{' token here. - ~ -!!! error TS1005: ';' expected. - ~ -!!! error TS1128: Declaration or statement expected. - ~ -!!! error TS1128: Declaration or statement expected. - ~ -!!! error TS1128: Declaration or statement expected. - ~~~~~~~~~~~~~~~~ -!!! error TS1434: Unexpected keyword or identifier. - ~~~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'RequireInterface'. - ~ -!!! error TS1128: Declaration or statement expected. - export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); - ~~~~~~~~~~~~~~~ -!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? - ~~~~~~~~~~~~~~~~~ -!!! error TS1005: 'assert' expected. -!!! related TS1007 /other.ts:7:48: The parser expected to find a '}' to match the '{' token here. - ~ -!!! error TS1005: ';' expected. - ~ -!!! error TS1128: Declaration or statement expected. - ~ -!!! error TS1128: Declaration or statement expected. - ~ -!!! error TS1128: Declaration or statement expected. - ~~~~~~~~~~~~~~~ -!!! error TS1434: Unexpected keyword or identifier. - ~~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'ImportInterface'. - ~ -!!! error TS1128: Declaration or statement expected. -==== /other2.ts (6 errors) ==== - // wrong assertion key - export type LocalInterface = - & import("pkg", { assert: {"bad": "require"} }).RequireInterface - ~~~~~ -!!! error TS1455: `resolution-mode` is the only valid key for type import assertions. - & import("pkg", { assert: {"bad": "import"} }).ImportInterface; - ~~~~~ -!!! error TS1455: `resolution-mode` is the only valid key for type import assertions. - ~~~~~~~~~~~~~~~ -!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. - - export const a = (null as any as import("pkg", { assert: {"bad": "require"} }).RequireInterface); - ~~~~~ -!!! error TS1455: `resolution-mode` is the only valid key for type import assertions. - export const b = (null as any as import("pkg", { assert: {"bad": "import"} }).ImportInterface); - ~~~~~ -!!! error TS1455: `resolution-mode` is the only valid key for type import assertions. - ~~~~~~~~~~~~~~~ -!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. -==== /other3.ts (16 errors) ==== - // Array instead of object-y thing - export type LocalInterface = - & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface - ~~~~~~~~~~~~~ -!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? - ~ -!!! error TS1005: '{' expected. -!!! related TS1007 /other3.ts:3:21: The parser expected to find a '}' to match the '{' token here. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. - ~ -!!! error TS1005: ';' expected. - ~ -!!! error TS1128: Declaration or statement expected. - ~~~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'RequireInterface'. - & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2559: Type '{ "resolution-mode": string; }[]' has no properties in common with type 'ImportCallOptions'. - ~~~~~~~~~~~~~~~ -!!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. - - export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); - ~~~~~~~~~~~~~ -!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? - ~ -!!! error TS1005: '{' expected. -!!! related TS1007 /other3.ts:6:48: The parser expected to find a '}' to match the '{' token here. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. - ~ -!!! error TS1005: ',' expected. - export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); - ~~~~~~~~~~~~~ -!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? - ~ -!!! error TS1005: '{' expected. -!!! related TS1007 /other3.ts:7:48: The parser expected to find a '}' to match the '{' token here. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2538: Type '{ "resolution-mode": "import"; }' cannot be used as an index type. - ~ -!!! error TS1005: ',' expected. -==== /other4.ts (18 errors) ==== - // Indirected assertion objecty-thing - not allowed - type Asserts1 = { assert: {"resolution-mode": "require"} }; - type Asserts2 = { assert: {"resolution-mode": "import"} }; - - export type LocalInterface = - & import("pkg", Asserts1).RequireInterface - ~~~~~~~~~~~~~ -!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? - ~~~~~~~~ -!!! error TS1005: '{' expected. -!!! related TS1007 /other4.ts:6:21: The parser expected to find a '}' to match the '{' token here. - ~~~~~~~~ -!!! error TS2448: Block-scoped variable 'Asserts1' used before its declaration. -!!! related TS2728 /other4.ts:9:48: 'Asserts1' is declared here. - ~ -!!! error TS1128: Declaration or statement expected. - ~ -!!! error TS1128: Declaration or statement expected. - ~~~~~~~~~~~~~~~~ -!!! error TS2448: Block-scoped variable 'RequireInterface' used before its declaration. -!!! related TS2728 /other4.ts:9:58: 'RequireInterface' is declared here. - & import("pkg", Asserts2).ImportInterface; - ~~~~~~~~ -!!! error TS2448: Block-scoped variable 'Asserts2' used before its declaration. -!!! related TS2728 /other4.ts:10:48: 'Asserts2' is declared here. - ~~~~~~~~~~~~~~~ -!!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. - - export const a = (null as any as import("pkg", Asserts1).RequireInterface); - ~~~~~~~~~~~~~ -!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? - ~~~~~~~~ -!!! error TS1005: '{' expected. -!!! related TS1007 /other4.ts:9:48: The parser expected to find a '}' to match the '{' token here. - ~ -!!! error TS1005: ',' expected. - ~ -!!! error TS1134: Variable declaration expected. - ~ -!!! error TS1005: ',' expected. - export const b = (null as any as import("pkg", Asserts2).ImportInterface); - ~~~~~~~~~~~~~ -!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? - ~~~~~~~~ -!!! error TS1005: '{' expected. -!!! related TS1007 /other4.ts:10:48: The parser expected to find a '}' to match the '{' token here. - ~ -!!! error TS1005: ',' expected. - ~ -!!! error TS1134: Variable declaration expected. - ~ -!!! error TS1005: ',' expected. -==== /other5.ts (6 errors) ==== - export type LocalInterface = - & import("pkg", { assert: {} }).RequireInterface - ~~ -!!! error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. - & import("pkg", { assert: {} }).ImportInterface; - ~~ -!!! error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. - ~~~~~~~~~~~~~~~ -!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. - - export const a = (null as any as import("pkg", { assert: {} }).RequireInterface); - ~~ -!!! error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. - export const b = (null as any as import("pkg", { assert: {} }).ImportInterface); - ~~ -!!! error TS1456: Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`. - ~~~~~~~~~~~~~~~ -!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. - \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node12).js b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node12).js deleted file mode 100644 index 7fd0aff8e8f..00000000000 --- a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node12).js +++ /dev/null @@ -1,147 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesImportTypeModeDeclarationEmitErrors1.ts] //// - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } -} -//// [import.d.ts] -export interface ImportInterface {} -//// [require.d.ts] -export interface RequireInterface {} -//// [index.ts] -export type LocalInterface = - & import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface - & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; - -export const a = (null as any as import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface); -export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); -//// [other.ts] -// missing assert: -export type LocalInterface = - & import("pkg", {"resolution-mode": "require"}).RequireInterface - & import("pkg", {"resolution-mode": "import"}).ImportInterface; - -export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); -export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); -//// [other2.ts] -// wrong assertion key -export type LocalInterface = - & import("pkg", { assert: {"bad": "require"} }).RequireInterface - & import("pkg", { assert: {"bad": "import"} }).ImportInterface; - -export const a = (null as any as import("pkg", { assert: {"bad": "require"} }).RequireInterface); -export const b = (null as any as import("pkg", { assert: {"bad": "import"} }).ImportInterface); -//// [other3.ts] -// Array instead of object-y thing -export type LocalInterface = - & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface - & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; - -export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); -export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); -//// [other4.ts] -// Indirected assertion objecty-thing - not allowed -type Asserts1 = { assert: {"resolution-mode": "require"} }; -type Asserts2 = { assert: {"resolution-mode": "import"} }; - -export type LocalInterface = - & import("pkg", Asserts1).RequireInterface - & import("pkg", Asserts2).ImportInterface; - -export const a = (null as any as import("pkg", Asserts1).RequireInterface); -export const b = (null as any as import("pkg", Asserts2).ImportInterface); -//// [other5.ts] -export type LocalInterface = - & import("pkg", { assert: {} }).RequireInterface - & import("pkg", { assert: {} }).ImportInterface; - -export const a = (null as any as import("pkg", { assert: {} }).RequireInterface); -export const b = (null as any as import("pkg", { assert: {} }).ImportInterface); - - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.b = exports.a = void 0; -exports.a = null; -exports.b = null; -//// [other.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.b = exports.a = void 0; -"resolution-mode"; -"require"; -RequireInterface - & import("pkg", { "resolution-mode": "import" }).ImportInterface; -exports.a = null; -"resolution-mode"; -"require"; -RequireInterface; -; -exports.b = null; -"resolution-mode"; -"import"; -ImportInterface; -; -//// [other2.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.b = exports.a = void 0; -exports.a = null; -exports.b = null; -//// [other3.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.b = exports.a = void 0; -RequireInterface - & import("pkg", [{ "resolution-mode": "import" }]).ImportInterface; -exports.a = null.RequireInterface; -exports.b = null.ImportInterface; -//// [other4.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ImportInterface = exports.Asserts2 = exports.b = exports.RequireInterface = exports.Asserts1 = exports.a = void 0; -exports.Asserts1; -exports.RequireInterface - & import("pkg", exports.Asserts2).ImportInterface; -exports.a = null; -exports.b = null; -//// [other5.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.b = exports.a = void 0; -exports.a = null; -exports.b = null; - - -//// [index.d.ts] -export declare type LocalInterface = import("pkg", { assert: { "resolution-mode": "foobar" } }).RequireInterface & import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; -export declare const a: import("pkg").RequireInterface; -export declare const b: import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; -//// [other.d.ts] -export declare type LocalInterface = import("pkg", { assert: {} }); -export declare const a: any; -export declare const b: any; -//// [other2.d.ts] -export declare type LocalInterface = import("pkg", { assert: { "bad": "require" } }).RequireInterface & import("pkg", { assert: { "bad": "import" } }).ImportInterface; -export declare const a: import("pkg").RequireInterface; -export declare const b: any; -//// [other3.d.ts] -export declare type LocalInterface = import("pkg", { assert: {} })[{ - "resolution-mode": "require"; -}]; -export declare const a: any; -export declare const b: any; -//// [other4.d.ts] -export declare type LocalInterface = import("pkg", { assert: {} }); -export declare const a: any, Asserts1: any, RequireInterface: any; -export declare const b: any, Asserts2: any, ImportInterface: any; -//// [other5.d.ts] -export declare type LocalInterface = import("pkg", { assert: {} }).RequireInterface & import("pkg", { assert: {} }).ImportInterface; -export declare const a: import("pkg").RequireInterface; -export declare const b: any; diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node12).symbols b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node12).symbols deleted file mode 100644 index 71b67ec81d6..00000000000 --- a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node12).symbols +++ /dev/null @@ -1,128 +0,0 @@ -=== /node_modules/pkg/import.d.ts === -export interface ImportInterface {} ->ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) - -=== /node_modules/pkg/require.d.ts === -export interface RequireInterface {} ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) - -=== /index.ts === -export type LocalInterface = ->LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) - - & import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) - - & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; ->ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) - -export const a = (null as any as import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface); ->a : Symbol(a, Decl(index.ts, 4, 12)) ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) - -export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); ->b : Symbol(b, Decl(index.ts, 5, 12)) ->ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) - -=== /other.ts === -// missing assert: -export type LocalInterface = ->LocalInterface : Symbol(LocalInterface, Decl(other.ts, 0, 0)) - - & import("pkg", {"resolution-mode": "require"}).RequireInterface - & import("pkg", {"resolution-mode": "import"}).ImportInterface; ->"pkg" : Symbol("/node_modules/pkg/import", Decl(import.d.ts, 0, 0)) ->"resolution-mode" : Symbol("resolution-mode", Decl(other.ts, 3, 21)) - -export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); ->a : Symbol(a, Decl(other.ts, 5, 12)) - -export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); ->b : Symbol(b, Decl(other.ts, 6, 12)) - -=== /other2.ts === -// wrong assertion key -export type LocalInterface = ->LocalInterface : Symbol(LocalInterface, Decl(other2.ts, 0, 0)) - - & import("pkg", { assert: {"bad": "require"} }).RequireInterface ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) - - & import("pkg", { assert: {"bad": "import"} }).ImportInterface; - -export const a = (null as any as import("pkg", { assert: {"bad": "require"} }).RequireInterface); ->a : Symbol(a, Decl(other2.ts, 5, 12)) ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) - -export const b = (null as any as import("pkg", { assert: {"bad": "import"} }).ImportInterface); ->b : Symbol(b, Decl(other2.ts, 6, 12)) - -=== /other3.ts === -// Array instead of object-y thing -export type LocalInterface = ->LocalInterface : Symbol(LocalInterface, Decl(other3.ts, 0, 0)) - - & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface ->"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 2, 23)) - - & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; ->"pkg" : Symbol("/node_modules/pkg/import", Decl(import.d.ts, 0, 0)) ->"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 3, 23)) - -export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); ->a : Symbol(a, Decl(other3.ts, 5, 12)) ->"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 5, 50)) - -export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); ->b : Symbol(b, Decl(other3.ts, 6, 12)) ->"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 6, 50)) - -=== /other4.ts === -// Indirected assertion objecty-thing - not allowed -type Asserts1 = { assert: {"resolution-mode": "require"} }; ->Asserts1 : Symbol(Asserts1, Decl(other4.ts, 0, 0), Decl(other4.ts, 8, 46)) ->assert : Symbol(assert, Decl(other4.ts, 1, 17)) ->"resolution-mode" : Symbol("resolution-mode", Decl(other4.ts, 1, 27)) - -type Asserts2 = { assert: {"resolution-mode": "import"} }; ->Asserts2 : Symbol(Asserts2, Decl(other4.ts, 1, 59), Decl(other4.ts, 9, 46)) ->assert : Symbol(assert, Decl(other4.ts, 2, 17)) ->"resolution-mode" : Symbol("resolution-mode", Decl(other4.ts, 2, 27)) - -export type LocalInterface = ->LocalInterface : Symbol(LocalInterface, Decl(other4.ts, 2, 58)) - - & import("pkg", Asserts1).RequireInterface ->Asserts1 : Symbol(Asserts1, Decl(other4.ts, 8, 46)) ->RequireInterface : Symbol(RequireInterface, Decl(other4.ts, 8, 57)) - - & import("pkg", Asserts2).ImportInterface; ->"pkg" : Symbol("/node_modules/pkg/import", Decl(import.d.ts, 0, 0)) ->Asserts2 : Symbol(Asserts2, Decl(other4.ts, 9, 46)) - -export const a = (null as any as import("pkg", Asserts1).RequireInterface); ->a : Symbol(a, Decl(other4.ts, 8, 12)) ->Asserts1 : Symbol(Asserts1, Decl(other4.ts, 8, 46)) ->RequireInterface : Symbol(RequireInterface, Decl(other4.ts, 8, 57)) - -export const b = (null as any as import("pkg", Asserts2).ImportInterface); ->b : Symbol(b, Decl(other4.ts, 9, 12)) ->Asserts2 : Symbol(Asserts2, Decl(other4.ts, 9, 46)) ->ImportInterface : Symbol(ImportInterface, Decl(other4.ts, 9, 57)) - -=== /other5.ts === -export type LocalInterface = ->LocalInterface : Symbol(LocalInterface, Decl(other5.ts, 0, 0)) - - & import("pkg", { assert: {} }).RequireInterface ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) - - & import("pkg", { assert: {} }).ImportInterface; - -export const a = (null as any as import("pkg", { assert: {} }).RequireInterface); ->a : Symbol(a, Decl(other5.ts, 4, 12)) ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) - -export const b = (null as any as import("pkg", { assert: {} }).ImportInterface); ->b : Symbol(b, Decl(other5.ts, 5, 12)) - diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node12).types b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node12).types deleted file mode 100644 index 1b75c0fff24..00000000000 --- a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node12).types +++ /dev/null @@ -1,193 +0,0 @@ -=== /node_modules/pkg/import.d.ts === -export interface ImportInterface {} -No type information for this code.=== /node_modules/pkg/require.d.ts === -export interface RequireInterface {} -No type information for this code.=== /index.ts === -export type LocalInterface = ->LocalInterface : import("/node_modules/pkg/require").RequireInterface & import("/node_modules/pkg/import").ImportInterface - - & import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface - & import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface; - -export const a = (null as any as import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface); ->a : import("/node_modules/pkg/require").RequireInterface ->(null as any as import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface ->null as any as import("pkg", { assert: {"resolution-mode": "foobar"} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface ->null as any : any ->null : null - -export const b = (null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface); ->b : import("/node_modules/pkg/import").ImportInterface ->(null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface) : import("/node_modules/pkg/import").ImportInterface ->null as any as import("pkg", { assert: {"resolution-mode": "import"} }).ImportInterface : import("/node_modules/pkg/import").ImportInterface ->null as any : any ->null : null - -=== /other.ts === -// missing assert: -export type LocalInterface = ->LocalInterface : any - - & import("pkg", {"resolution-mode": "require"}).RequireInterface ->"resolution-mode" : "resolution-mode" ->"require" : "require" ->RequireInterface & import("pkg", {"resolution-mode": "import"}).ImportInterface : number ->RequireInterface : any - - & import("pkg", {"resolution-mode": "import"}).ImportInterface; ->import("pkg", {"resolution-mode": "import"}).ImportInterface : any ->import("pkg", {"resolution-mode": "import"}) : Promise<{ default: typeof import("/node_modules/pkg/import"); }> ->"pkg" : "pkg" ->{"resolution-mode": "import"} : { "resolution-mode": string; } ->"resolution-mode" : string ->"import" : "import" ->ImportInterface : any - -export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); ->a : any ->(null as any as import("pkg", { : any ->null as any as import("pkg", { : any ->null as any : any ->null : null ->"resolution-mode" : "resolution-mode" ->"require" : "require" ->RequireInterface : any - -export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); ->b : any ->(null as any as import("pkg", { : any ->null as any as import("pkg", { : any ->null as any : any ->null : null ->"resolution-mode" : "resolution-mode" ->"import" : "import" ->ImportInterface : any - -=== /other2.ts === -// wrong assertion key -export type LocalInterface = ->LocalInterface : any - - & import("pkg", { assert: {"bad": "require"} }).RequireInterface - & import("pkg", { assert: {"bad": "import"} }).ImportInterface; - -export const a = (null as any as import("pkg", { assert: {"bad": "require"} }).RequireInterface); ->a : import("/node_modules/pkg/require").RequireInterface ->(null as any as import("pkg", { assert: {"bad": "require"} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface ->null as any as import("pkg", { assert: {"bad": "require"} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface ->null as any : any ->null : null - -export const b = (null as any as import("pkg", { assert: {"bad": "import"} }).ImportInterface); ->b : any ->(null as any as import("pkg", { assert: {"bad": "import"} }).ImportInterface) : any ->null as any as import("pkg", { assert: {"bad": "import"} }).ImportInterface : any ->null as any : any ->null : null - -=== /other3.ts === -// Array instead of object-y thing -export type LocalInterface = ->LocalInterface : any - - & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface ->"resolution-mode" : "require" ->RequireInterface & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface : number ->RequireInterface : any - - & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; ->import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface : any ->import("pkg", [ {"resolution-mode": "import"} ]) : Promise<{ default: typeof import("/node_modules/pkg/import"); }> ->"pkg" : "pkg" ->[ {"resolution-mode": "import"} ] : { "resolution-mode": string; }[] ->{"resolution-mode": "import"} : { "resolution-mode": string; } ->"resolution-mode" : string ->"import" : "import" ->ImportInterface : any - -export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); ->a : any ->(null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface : any ->(null as any as import("pkg", [ {"resolution-mode": "require"} ]) : any ->null as any as import("pkg", [ {"resolution-mode": "require"} ] : any ->null as any : any ->null : null ->"resolution-mode" : "require" ->RequireInterface : any - -export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); ->b : any ->(null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface : any ->(null as any as import("pkg", [ {"resolution-mode": "import"} ]) : any ->null as any as import("pkg", [ {"resolution-mode": "import"} ] : any ->null as any : any ->null : null ->"resolution-mode" : "import" ->ImportInterface : any - -=== /other4.ts === -// Indirected assertion objecty-thing - not allowed -type Asserts1 = { assert: {"resolution-mode": "require"} }; ->Asserts1 : { assert: { "resolution-mode": "require";}; } ->assert : { "resolution-mode": "require"; } ->"resolution-mode" : "require" - -type Asserts2 = { assert: {"resolution-mode": "import"} }; ->Asserts2 : { assert: { "resolution-mode": "import";}; } ->assert : { "resolution-mode": "import"; } ->"resolution-mode" : "import" - -export type LocalInterface = ->LocalInterface : any - - & import("pkg", Asserts1).RequireInterface ->Asserts1 : any ->RequireInterface & import("pkg", Asserts2).ImportInterface : number ->RequireInterface : any - - & import("pkg", Asserts2).ImportInterface; ->import("pkg", Asserts2).ImportInterface : any ->import("pkg", Asserts2) : Promise<{ default: typeof import("/node_modules/pkg/import"); }> ->"pkg" : "pkg" ->Asserts2 : any ->ImportInterface : any - -export const a = (null as any as import("pkg", Asserts1).RequireInterface); ->a : any ->(null as any as import("pkg", : any ->null as any as import("pkg", : any ->null as any : any ->null : null ->Asserts1 : any ->RequireInterface : any - -export const b = (null as any as import("pkg", Asserts2).ImportInterface); ->b : any ->(null as any as import("pkg", : any ->null as any as import("pkg", : any ->null as any : any ->null : null ->Asserts2 : any ->ImportInterface : any - -=== /other5.ts === -export type LocalInterface = ->LocalInterface : any - - & import("pkg", { assert: {} }).RequireInterface - & import("pkg", { assert: {} }).ImportInterface; - -export const a = (null as any as import("pkg", { assert: {} }).RequireInterface); ->a : import("/node_modules/pkg/require").RequireInterface ->(null as any as import("pkg", { assert: {} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface ->null as any as import("pkg", { assert: {} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface ->null as any : any ->null : null - -export const b = (null as any as import("pkg", { assert: {} }).ImportInterface); ->b : any ->(null as any as import("pkg", { assert: {} }).ImportInterface) : any ->null as any as import("pkg", { assert: {} }).ImportInterface : any ->null as any : any ->null : null - diff --git a/tests/baselines/reference/nodeModulesPackageExports(module=node12).errors.txt b/tests/baselines/reference/nodeModulesPackageExports(module=node12).errors.txt deleted file mode 100644 index 464db33f319..00000000000 --- a/tests/baselines/reference/nodeModulesPackageExports(module=node12).errors.txt +++ /dev/null @@ -1,107 +0,0 @@ -tests/cases/conformance/node/index.cts(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.cts(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.cts(9,23): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/node_modules/inner/index.d.cts(3,22): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. -tests/cases/conformance/node/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - - -==== tests/cases/conformance/node/index.ts (0 errors) ==== - // esm format file - import * as cjs from "package/cjs"; - import * as mjs from "package/mjs"; - import * as type from "package"; - cjs; - mjs; - type; - import * as cjsi from "inner/cjs"; - import * as mjsi from "inner/mjs"; - import * as typei from "inner"; - cjsi; - mjsi; - typei; -==== tests/cases/conformance/node/index.mts (0 errors) ==== - // esm format file - import * as cjs from "package/cjs"; - import * as mjs from "package/mjs"; - import * as type from "package"; - cjs; - mjs; - type; - import * as cjsi from "inner/cjs"; - import * as mjsi from "inner/mjs"; - import * as typei from "inner"; - cjsi; - mjsi; - typei; -==== tests/cases/conformance/node/index.cts (3 errors) ==== - // cjs format file - import * as cjs from "package/cjs"; - import * as mjs from "package/mjs"; - ~~~~~~~~~~~~~ -!!! error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as type from "package"; - ~~~~~~~~~ -!!! error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - cjs; - mjs; - type; - import * as cjsi from "inner/cjs"; - import * as mjsi from "inner/mjs"; - ~~~~~~~~~~~ -!!! error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as typei from "inner"; - cjsi; - mjsi; - typei; -==== tests/cases/conformance/node/node_modules/inner/index.d.ts (2 errors) ==== - // cjs format file - import * as cjs from "inner/cjs"; - ~~~ -!!! error TS2303: Circular definition of import alias 'cjs'. - import * as mjs from "inner/mjs"; - ~~~~~~~~~~~ -!!! error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as type from "inner"; - export { cjs }; - export { mjs }; - export { type }; -==== tests/cases/conformance/node/node_modules/inner/index.d.mts (0 errors) ==== - // esm format file - import * as cjs from "inner/cjs"; - import * as mjs from "inner/mjs"; - import * as type from "inner"; - export { cjs }; - export { mjs }; - export { type }; -==== tests/cases/conformance/node/node_modules/inner/index.d.cts (1 errors) ==== - // cjs format file - import * as cjs from "inner/cjs"; - import * as mjs from "inner/mjs"; - ~~~~~~~~~~~ -!!! error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as type from "inner"; - export { cjs }; - export { mjs }; - export { type }; -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module", - "exports": { - "./cjs": "./index.cjs", - "./mjs": "./index.mjs", - ".": "./index.js" - } - } -==== tests/cases/conformance/node/node_modules/inner/package.json (0 errors) ==== - { - "name": "inner", - "private": true, - "exports": { - "./cjs": "./index.cjs", - "./mjs": "./index.mjs", - ".": "./index.js" - } - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesPackageExports(module=node12).js b/tests/baselines/reference/nodeModulesPackageExports(module=node12).js deleted file mode 100644 index d974207d7b4..00000000000 --- a/tests/baselines/reference/nodeModulesPackageExports(module=node12).js +++ /dev/null @@ -1,165 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesPackageExports.ts] //// - -//// [index.ts] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/cjs"; -import * as mjsi from "inner/mjs"; -import * as typei from "inner"; -cjsi; -mjsi; -typei; -//// [index.mts] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/cjs"; -import * as mjsi from "inner/mjs"; -import * as typei from "inner"; -cjsi; -mjsi; -typei; -//// [index.cts] -// cjs format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/cjs"; -import * as mjsi from "inner/mjs"; -import * as typei from "inner"; -cjsi; -mjsi; -typei; -//// [index.d.ts] -// cjs format file -import * as cjs from "inner/cjs"; -import * as mjs from "inner/mjs"; -import * as type from "inner"; -export { cjs }; -export { mjs }; -export { type }; -//// [index.d.mts] -// esm format file -import * as cjs from "inner/cjs"; -import * as mjs from "inner/mjs"; -import * as type from "inner"; -export { cjs }; -export { mjs }; -export { type }; -//// [index.d.cts] -// cjs format file -import * as cjs from "inner/cjs"; -import * as mjs from "inner/mjs"; -import * as type from "inner"; -export { cjs }; -export { mjs }; -export { type }; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module", - "exports": { - "./cjs": "./index.cjs", - "./mjs": "./index.mjs", - ".": "./index.js" - } -} -//// [package.json] -{ - "name": "inner", - "private": true, - "exports": { - "./cjs": "./index.cjs", - "./mjs": "./index.mjs", - ".": "./index.js" - } -} - -//// [index.mjs] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/cjs"; -import * as mjsi from "inner/mjs"; -import * as typei from "inner"; -cjsi; -mjsi; -typei; -//// [index.cjs] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// cjs format file -const cjs = __importStar(require("package/cjs")); -const mjs = __importStar(require("package/mjs")); -const type = __importStar(require("package")); -cjs; -mjs; -type; -const cjsi = __importStar(require("inner/cjs")); -const mjsi = __importStar(require("inner/mjs")); -const typei = __importStar(require("inner")); -cjsi; -mjsi; -typei; -//// [index.js] -// esm format file -import * as cjs from "package/cjs"; -import * as mjs from "package/mjs"; -import * as type from "package"; -cjs; -mjs; -type; -import * as cjsi from "inner/cjs"; -import * as mjsi from "inner/mjs"; -import * as typei from "inner"; -cjsi; -mjsi; -typei; - - -//// [index.d.mts] -export {}; -//// [index.d.cts] -export {}; -//// [index.d.ts] -export {}; diff --git a/tests/baselines/reference/nodeModulesPackageExports(module=node12).symbols b/tests/baselines/reference/nodeModulesPackageExports(module=node12).symbols deleted file mode 100644 index 0a2a74496f4..00000000000 --- a/tests/baselines/reference/nodeModulesPackageExports(module=node12).symbols +++ /dev/null @@ -1,174 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import * as cjs from "package/cjs"; ->cjs : Symbol(cjs, Decl(index.ts, 1, 6)) - -import * as mjs from "package/mjs"; ->mjs : Symbol(mjs, Decl(index.ts, 2, 6)) - -import * as type from "package"; ->type : Symbol(type, Decl(index.ts, 3, 6)) - -cjs; ->cjs : Symbol(cjs, Decl(index.ts, 1, 6)) - -mjs; ->mjs : Symbol(mjs, Decl(index.ts, 2, 6)) - -type; ->type : Symbol(type, Decl(index.ts, 3, 6)) - -import * as cjsi from "inner/cjs"; ->cjsi : Symbol(cjsi, Decl(index.ts, 7, 6)) - -import * as mjsi from "inner/mjs"; ->mjsi : Symbol(mjsi, Decl(index.ts, 8, 6)) - -import * as typei from "inner"; ->typei : Symbol(typei, Decl(index.ts, 9, 6)) - -cjsi; ->cjsi : Symbol(cjsi, Decl(index.ts, 7, 6)) - -mjsi; ->mjsi : Symbol(mjsi, Decl(index.ts, 8, 6)) - -typei; ->typei : Symbol(typei, Decl(index.ts, 9, 6)) - -=== tests/cases/conformance/node/index.mts === -// esm format file -import * as cjs from "package/cjs"; ->cjs : Symbol(cjs, Decl(index.mts, 1, 6)) - -import * as mjs from "package/mjs"; ->mjs : Symbol(mjs, Decl(index.mts, 2, 6)) - -import * as type from "package"; ->type : Symbol(type, Decl(index.mts, 3, 6)) - -cjs; ->cjs : Symbol(cjs, Decl(index.mts, 1, 6)) - -mjs; ->mjs : Symbol(mjs, Decl(index.mts, 2, 6)) - -type; ->type : Symbol(type, Decl(index.mts, 3, 6)) - -import * as cjsi from "inner/cjs"; ->cjsi : Symbol(cjsi, Decl(index.mts, 7, 6)) - -import * as mjsi from "inner/mjs"; ->mjsi : Symbol(mjsi, Decl(index.mts, 8, 6)) - -import * as typei from "inner"; ->typei : Symbol(typei, Decl(index.mts, 9, 6)) - -cjsi; ->cjsi : Symbol(cjsi, Decl(index.mts, 7, 6)) - -mjsi; ->mjsi : Symbol(mjsi, Decl(index.mts, 8, 6)) - -typei; ->typei : Symbol(typei, Decl(index.mts, 9, 6)) - -=== tests/cases/conformance/node/index.cts === -// cjs format file -import * as cjs from "package/cjs"; ->cjs : Symbol(cjs, Decl(index.cts, 1, 6)) - -import * as mjs from "package/mjs"; ->mjs : Symbol(mjs, Decl(index.cts, 2, 6)) - -import * as type from "package"; ->type : Symbol(type, Decl(index.cts, 3, 6)) - -cjs; ->cjs : Symbol(cjs, Decl(index.cts, 1, 6)) - -mjs; ->mjs : Symbol(mjs, Decl(index.cts, 2, 6)) - -type; ->type : Symbol(type, Decl(index.cts, 3, 6)) - -import * as cjsi from "inner/cjs"; ->cjsi : Symbol(cjsi, Decl(index.cts, 7, 6)) - -import * as mjsi from "inner/mjs"; ->mjsi : Symbol(mjsi, Decl(index.cts, 8, 6)) - -import * as typei from "inner"; ->typei : Symbol(typei, Decl(index.cts, 9, 6)) - -cjsi; ->cjsi : Symbol(cjsi, Decl(index.cts, 7, 6)) - -mjsi; ->mjsi : Symbol(mjsi, Decl(index.cts, 8, 6)) - -typei; ->typei : Symbol(typei, Decl(index.cts, 9, 6)) - -=== tests/cases/conformance/node/node_modules/inner/index.d.ts === -// cjs format file -import * as cjs from "inner/cjs"; ->cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) - -import * as mjs from "inner/mjs"; ->mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) - -import * as type from "inner"; ->type : Symbol(type, Decl(index.d.ts, 3, 6)) - -export { cjs }; ->cjs : Symbol(mjs.cjs.cjs.type.cjs, Decl(index.d.ts, 4, 8)) - -export { mjs }; ->mjs : Symbol(mjs.cjs.cjs.type.mjs, Decl(index.d.ts, 5, 8)) - -export { type }; ->type : Symbol(mjs.cjs.cjs.type.type, Decl(index.d.ts, 6, 8)) - -=== tests/cases/conformance/node/node_modules/inner/index.d.mts === -// esm format file -import * as cjs from "inner/cjs"; ->cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) - -import * as mjs from "inner/mjs"; ->mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) - -import * as type from "inner"; ->type : Symbol(type, Decl(index.d.mts, 3, 6)) - -export { cjs }; ->cjs : Symbol(cjs.cjs.mjs.cjs, Decl(index.d.mts, 4, 8)) - -export { mjs }; ->mjs : Symbol(cjs.cjs.mjs.mjs, Decl(index.d.mts, 5, 8)) - -export { type }; ->type : Symbol(cjs.cjs.mjs.type, Decl(index.d.mts, 6, 8)) - -=== tests/cases/conformance/node/node_modules/inner/index.d.cts === -// cjs format file -import * as cjs from "inner/cjs"; ->cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) - -import * as mjs from "inner/mjs"; ->mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) - -import * as type from "inner"; ->type : Symbol(type, Decl(index.d.cts, 3, 6)) - -export { cjs }; ->cjs : Symbol(cjs.cjs, Decl(index.d.cts, 4, 8)) - -export { mjs }; ->mjs : Symbol(cjs.mjs, Decl(index.d.cts, 5, 8)) - -export { type }; ->type : Symbol(cjs.type, Decl(index.d.cts, 6, 8)) - diff --git a/tests/baselines/reference/nodeModulesPackageExports(module=node12).types b/tests/baselines/reference/nodeModulesPackageExports(module=node12).types deleted file mode 100644 index 8d3dcec7235..00000000000 --- a/tests/baselines/reference/nodeModulesPackageExports(module=node12).types +++ /dev/null @@ -1,174 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import * as cjs from "package/cjs"; ->cjs : typeof cjs - -import * as mjs from "package/mjs"; ->mjs : typeof mjs - -import * as type from "package"; ->type : typeof type - -cjs; ->cjs : typeof cjs - -mjs; ->mjs : typeof mjs - -type; ->type : typeof type - -import * as cjsi from "inner/cjs"; ->cjsi : typeof cjsi - -import * as mjsi from "inner/mjs"; ->mjsi : typeof cjsi.cjs.mjs - -import * as typei from "inner"; ->typei : typeof typei - -cjsi; ->cjsi : typeof cjsi - -mjsi; ->mjsi : typeof cjsi.cjs.mjs - -typei; ->typei : typeof typei - -=== tests/cases/conformance/node/index.mts === -// esm format file -import * as cjs from "package/cjs"; ->cjs : typeof cjs - -import * as mjs from "package/mjs"; ->mjs : typeof mjs - -import * as type from "package"; ->type : typeof type - -cjs; ->cjs : typeof cjs - -mjs; ->mjs : typeof mjs - -type; ->type : typeof type - -import * as cjsi from "inner/cjs"; ->cjsi : typeof cjsi - -import * as mjsi from "inner/mjs"; ->mjsi : typeof cjsi.cjs.mjs - -import * as typei from "inner"; ->typei : typeof typei - -cjsi; ->cjsi : typeof cjsi - -mjsi; ->mjsi : typeof cjsi.cjs.mjs - -typei; ->typei : typeof typei - -=== tests/cases/conformance/node/index.cts === -// cjs format file -import * as cjs from "package/cjs"; ->cjs : typeof cjs - -import * as mjs from "package/mjs"; ->mjs : typeof mjs - -import * as type from "package"; ->type : typeof type - -cjs; ->cjs : typeof cjs - -mjs; ->mjs : typeof mjs - -type; ->type : typeof type - -import * as cjsi from "inner/cjs"; ->cjsi : typeof cjsi - -import * as mjsi from "inner/mjs"; ->mjsi : typeof cjsi.mjs - -import * as typei from "inner"; ->typei : typeof cjsi.mjs.cjs.type - -cjsi; ->cjsi : typeof cjsi - -mjsi; ->mjsi : typeof cjsi.mjs - -typei; ->typei : typeof cjsi.mjs.cjs.type - -=== tests/cases/conformance/node/node_modules/inner/index.d.ts === -// cjs format file -import * as cjs from "inner/cjs"; ->cjs : any - -import * as mjs from "inner/mjs"; ->mjs : typeof mjs - -import * as type from "inner"; ->type : typeof mjs.cjs.cjs.type - -export { cjs }; ->cjs : any - -export { mjs }; ->mjs : typeof mjs - -export { type }; ->type : typeof mjs.cjs.cjs.type - -=== tests/cases/conformance/node/node_modules/inner/index.d.mts === -// esm format file -import * as cjs from "inner/cjs"; ->cjs : typeof cjs - -import * as mjs from "inner/mjs"; ->mjs : typeof cjs.cjs.mjs - -import * as type from "inner"; ->type : typeof cjs.cjs.mjs.type - -export { cjs }; ->cjs : typeof cjs - -export { mjs }; ->mjs : typeof cjs.cjs.mjs - -export { type }; ->type : typeof cjs.cjs.mjs.type - -=== tests/cases/conformance/node/node_modules/inner/index.d.cts === -// cjs format file -import * as cjs from "inner/cjs"; ->cjs : typeof cjs - -import * as mjs from "inner/mjs"; ->mjs : typeof cjs.mjs - -import * as type from "inner"; ->type : typeof cjs.mjs.cjs.type - -export { cjs }; ->cjs : typeof cjs - -export { mjs }; ->mjs : typeof cjs.mjs - -export { type }; ->type : typeof cjs.mjs.cjs.type - diff --git a/tests/baselines/reference/nodeModulesPackageImports(module=node12).errors.txt b/tests/baselines/reference/nodeModulesPackageImports(module=node12).errors.txt deleted file mode 100644 index cc174f1eb7e..00000000000 --- a/tests/baselines/reference/nodeModulesPackageImports(module=node12).errors.txt +++ /dev/null @@ -1,44 +0,0 @@ -tests/cases/conformance/node/index.cts(3,22): error TS1471: Module '#mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/index.cts(4,23): error TS1471: Module '#type' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - - -==== tests/cases/conformance/node/index.ts (0 errors) ==== - // esm format file - import * as cjs from "#cjs"; - import * as mjs from "#mjs"; - import * as type from "#type"; - cjs; - mjs; - type; -==== tests/cases/conformance/node/index.mts (0 errors) ==== - // esm format file - import * as cjs from "#cjs"; - import * as mjs from "#mjs"; - import * as type from "#type"; - cjs; - mjs; - type; -==== tests/cases/conformance/node/index.cts (2 errors) ==== - // esm format file - import * as cjs from "#cjs"; - import * as mjs from "#mjs"; - ~~~~~~ -!!! error TS1471: Module '#mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as type from "#type"; - ~~~~~~~ -!!! error TS1471: Module '#type' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - cjs; - mjs; - type; -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module", - "exports": "./index.js", - "imports": { - "#cjs": "./index.cjs", - "#mjs": "./index.mjs", - "#type": "./index.js" - } - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesPackageImports(module=node12).js b/tests/baselines/reference/nodeModulesPackageImports(module=node12).js deleted file mode 100644 index fb612b6c2fd..00000000000 --- a/tests/baselines/reference/nodeModulesPackageImports(module=node12).js +++ /dev/null @@ -1,96 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesPackageImports.ts] //// - -//// [index.ts] -// esm format file -import * as cjs from "#cjs"; -import * as mjs from "#mjs"; -import * as type from "#type"; -cjs; -mjs; -type; -//// [index.mts] -// esm format file -import * as cjs from "#cjs"; -import * as mjs from "#mjs"; -import * as type from "#type"; -cjs; -mjs; -type; -//// [index.cts] -// esm format file -import * as cjs from "#cjs"; -import * as mjs from "#mjs"; -import * as type from "#type"; -cjs; -mjs; -type; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module", - "exports": "./index.js", - "imports": { - "#cjs": "./index.cjs", - "#mjs": "./index.mjs", - "#type": "./index.js" - } -} - -//// [index.mjs] -// esm format file -import * as cjs from "#cjs"; -import * as mjs from "#mjs"; -import * as type from "#type"; -cjs; -mjs; -type; -//// [index.cjs] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// esm format file -const cjs = __importStar(require("#cjs")); -const mjs = __importStar(require("#mjs")); -const type = __importStar(require("#type")); -cjs; -mjs; -type; -//// [index.js] -// esm format file -import * as cjs from "#cjs"; -import * as mjs from "#mjs"; -import * as type from "#type"; -cjs; -mjs; -type; - - -//// [index.d.mts] -export {}; -//// [index.d.cts] -export {}; -//// [index.d.ts] -export {}; diff --git a/tests/baselines/reference/nodeModulesPackageImports(module=node12).symbols b/tests/baselines/reference/nodeModulesPackageImports(module=node12).symbols deleted file mode 100644 index 2a0fece7237..00000000000 --- a/tests/baselines/reference/nodeModulesPackageImports(module=node12).symbols +++ /dev/null @@ -1,60 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import * as cjs from "#cjs"; ->cjs : Symbol(cjs, Decl(index.ts, 1, 6)) - -import * as mjs from "#mjs"; ->mjs : Symbol(mjs, Decl(index.ts, 2, 6)) - -import * as type from "#type"; ->type : Symbol(type, Decl(index.ts, 3, 6)) - -cjs; ->cjs : Symbol(cjs, Decl(index.ts, 1, 6)) - -mjs; ->mjs : Symbol(mjs, Decl(index.ts, 2, 6)) - -type; ->type : Symbol(type, Decl(index.ts, 3, 6)) - -=== tests/cases/conformance/node/index.mts === -// esm format file -import * as cjs from "#cjs"; ->cjs : Symbol(cjs, Decl(index.mts, 1, 6)) - -import * as mjs from "#mjs"; ->mjs : Symbol(mjs, Decl(index.mts, 2, 6)) - -import * as type from "#type"; ->type : Symbol(type, Decl(index.mts, 3, 6)) - -cjs; ->cjs : Symbol(cjs, Decl(index.mts, 1, 6)) - -mjs; ->mjs : Symbol(mjs, Decl(index.mts, 2, 6)) - -type; ->type : Symbol(type, Decl(index.mts, 3, 6)) - -=== tests/cases/conformance/node/index.cts === -// esm format file -import * as cjs from "#cjs"; ->cjs : Symbol(cjs, Decl(index.cts, 1, 6)) - -import * as mjs from "#mjs"; ->mjs : Symbol(mjs, Decl(index.cts, 2, 6)) - -import * as type from "#type"; ->type : Symbol(type, Decl(index.cts, 3, 6)) - -cjs; ->cjs : Symbol(cjs, Decl(index.cts, 1, 6)) - -mjs; ->mjs : Symbol(mjs, Decl(index.cts, 2, 6)) - -type; ->type : Symbol(type, Decl(index.cts, 3, 6)) - diff --git a/tests/baselines/reference/nodeModulesPackageImports(module=node12).types b/tests/baselines/reference/nodeModulesPackageImports(module=node12).types deleted file mode 100644 index b4ade055923..00000000000 --- a/tests/baselines/reference/nodeModulesPackageImports(module=node12).types +++ /dev/null @@ -1,60 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import * as cjs from "#cjs"; ->cjs : typeof cjs - -import * as mjs from "#mjs"; ->mjs : typeof mjs - -import * as type from "#type"; ->type : typeof type - -cjs; ->cjs : typeof cjs - -mjs; ->mjs : typeof mjs - -type; ->type : typeof type - -=== tests/cases/conformance/node/index.mts === -// esm format file -import * as cjs from "#cjs"; ->cjs : typeof cjs - -import * as mjs from "#mjs"; ->mjs : typeof mjs - -import * as type from "#type"; ->type : typeof type - -cjs; ->cjs : typeof cjs - -mjs; ->mjs : typeof mjs - -type; ->type : typeof type - -=== tests/cases/conformance/node/index.cts === -// esm format file -import * as cjs from "#cjs"; ->cjs : typeof cjs - -import * as mjs from "#mjs"; ->mjs : typeof mjs - -import * as type from "#type"; ->type : typeof type - -cjs; ->cjs : typeof cjs - -mjs; ->mjs : typeof mjs - -type; ->type : typeof type - diff --git a/tests/baselines/reference/nodeModulesPackagePatternExports(module=node12).errors.txt b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node12).errors.txt deleted file mode 100644 index 0dc3774d5ef..00000000000 --- a/tests/baselines/reference/nodeModulesPackagePatternExports(module=node12).errors.txt +++ /dev/null @@ -1,78 +0,0 @@ -tests/cases/conformance/node/index.cts(3,23): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/node_modules/inner/index.d.cts(3,22): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. -tests/cases/conformance/node/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - - -==== tests/cases/conformance/node/index.ts (0 errors) ==== - // esm format file - import * as cjsi from "inner/cjs/index"; - import * as mjsi from "inner/mjs/index"; - import * as typei from "inner/js/index"; - cjsi; - mjsi; - typei; -==== tests/cases/conformance/node/index.mts (0 errors) ==== - // esm format file - import * as cjsi from "inner/cjs/index"; - import * as mjsi from "inner/mjs/index"; - import * as typei from "inner/js/index"; - cjsi; - mjsi; - typei; -==== tests/cases/conformance/node/index.cts (1 errors) ==== - // cjs format file - import * as cjsi from "inner/cjs/index"; - import * as mjsi from "inner/mjs/index"; - ~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as typei from "inner/js/index"; - cjsi; - mjsi; - typei; -==== tests/cases/conformance/node/node_modules/inner/index.d.ts (2 errors) ==== - // cjs format file - import * as cjs from "inner/cjs/index"; - ~~~ -!!! error TS2303: Circular definition of import alias 'cjs'. - import * as mjs from "inner/mjs/index"; - ~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as type from "inner/js/index"; - export { cjs }; - export { mjs }; - export { type }; -==== tests/cases/conformance/node/node_modules/inner/index.d.mts (0 errors) ==== - // esm format file - import * as cjs from "inner/cjs/index"; - import * as mjs from "inner/mjs/index"; - import * as type from "inner/js/index"; - export { cjs }; - export { mjs }; - export { type }; -==== tests/cases/conformance/node/node_modules/inner/index.d.cts (1 errors) ==== - // cjs format file - import * as cjs from "inner/cjs/index"; - import * as mjs from "inner/mjs/index"; - ~~~~~~~~~~~~~~~~~ -!!! error TS1471: Module 'inner/mjs/index' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import * as type from "inner/js/index"; - export { cjs }; - export { mjs }; - export { type }; -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module", - } -==== tests/cases/conformance/node/node_modules/inner/package.json (0 errors) ==== - { - "name": "inner", - "private": true, - "exports": { - "./cjs/*": "./*.cjs", - "./mjs/*": "./*.mjs", - "./js/*": "./*.js" - } - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesPackagePatternExports(module=node12).js b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node12).js deleted file mode 100644 index cef593a4246..00000000000 --- a/tests/baselines/reference/nodeModulesPackagePatternExports(module=node12).js +++ /dev/null @@ -1,124 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesPackagePatternExports.ts] //// - -//// [index.ts] -// esm format file -import * as cjsi from "inner/cjs/index"; -import * as mjsi from "inner/mjs/index"; -import * as typei from "inner/js/index"; -cjsi; -mjsi; -typei; -//// [index.mts] -// esm format file -import * as cjsi from "inner/cjs/index"; -import * as mjsi from "inner/mjs/index"; -import * as typei from "inner/js/index"; -cjsi; -mjsi; -typei; -//// [index.cts] -// cjs format file -import * as cjsi from "inner/cjs/index"; -import * as mjsi from "inner/mjs/index"; -import * as typei from "inner/js/index"; -cjsi; -mjsi; -typei; -//// [index.d.ts] -// cjs format file -import * as cjs from "inner/cjs/index"; -import * as mjs from "inner/mjs/index"; -import * as type from "inner/js/index"; -export { cjs }; -export { mjs }; -export { type }; -//// [index.d.mts] -// esm format file -import * as cjs from "inner/cjs/index"; -import * as mjs from "inner/mjs/index"; -import * as type from "inner/js/index"; -export { cjs }; -export { mjs }; -export { type }; -//// [index.d.cts] -// cjs format file -import * as cjs from "inner/cjs/index"; -import * as mjs from "inner/mjs/index"; -import * as type from "inner/js/index"; -export { cjs }; -export { mjs }; -export { type }; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module", -} -//// [package.json] -{ - "name": "inner", - "private": true, - "exports": { - "./cjs/*": "./*.cjs", - "./mjs/*": "./*.mjs", - "./js/*": "./*.js" - } -} - -//// [index.js] -// esm format file -import * as cjsi from "inner/cjs/index"; -import * as mjsi from "inner/mjs/index"; -import * as typei from "inner/js/index"; -cjsi; -mjsi; -typei; -//// [index.mjs] -// esm format file -import * as cjsi from "inner/cjs/index"; -import * as mjsi from "inner/mjs/index"; -import * as typei from "inner/js/index"; -cjsi; -mjsi; -typei; -//// [index.cjs] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// cjs format file -const cjsi = __importStar(require("inner/cjs/index")); -const mjsi = __importStar(require("inner/mjs/index")); -const typei = __importStar(require("inner/js/index")); -cjsi; -mjsi; -typei; - - -//// [index.d.ts] -export {}; -//// [index.d.mts] -export {}; -//// [index.d.cts] -export {}; diff --git a/tests/baselines/reference/nodeModulesPackagePatternExports(module=node12).symbols b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node12).symbols deleted file mode 100644 index c9823ad5c6c..00000000000 --- a/tests/baselines/reference/nodeModulesPackagePatternExports(module=node12).symbols +++ /dev/null @@ -1,120 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import * as cjsi from "inner/cjs/index"; ->cjsi : Symbol(cjsi, Decl(index.ts, 1, 6)) - -import * as mjsi from "inner/mjs/index"; ->mjsi : Symbol(mjsi, Decl(index.ts, 2, 6)) - -import * as typei from "inner/js/index"; ->typei : Symbol(typei, Decl(index.ts, 3, 6)) - -cjsi; ->cjsi : Symbol(cjsi, Decl(index.ts, 1, 6)) - -mjsi; ->mjsi : Symbol(mjsi, Decl(index.ts, 2, 6)) - -typei; ->typei : Symbol(typei, Decl(index.ts, 3, 6)) - -=== tests/cases/conformance/node/index.mts === -// esm format file -import * as cjsi from "inner/cjs/index"; ->cjsi : Symbol(cjsi, Decl(index.mts, 1, 6)) - -import * as mjsi from "inner/mjs/index"; ->mjsi : Symbol(mjsi, Decl(index.mts, 2, 6)) - -import * as typei from "inner/js/index"; ->typei : Symbol(typei, Decl(index.mts, 3, 6)) - -cjsi; ->cjsi : Symbol(cjsi, Decl(index.mts, 1, 6)) - -mjsi; ->mjsi : Symbol(mjsi, Decl(index.mts, 2, 6)) - -typei; ->typei : Symbol(typei, Decl(index.mts, 3, 6)) - -=== tests/cases/conformance/node/index.cts === -// cjs format file -import * as cjsi from "inner/cjs/index"; ->cjsi : Symbol(cjsi, Decl(index.cts, 1, 6)) - -import * as mjsi from "inner/mjs/index"; ->mjsi : Symbol(mjsi, Decl(index.cts, 2, 6)) - -import * as typei from "inner/js/index"; ->typei : Symbol(typei, Decl(index.cts, 3, 6)) - -cjsi; ->cjsi : Symbol(cjsi, Decl(index.cts, 1, 6)) - -mjsi; ->mjsi : Symbol(mjsi, Decl(index.cts, 2, 6)) - -typei; ->typei : Symbol(typei, Decl(index.cts, 3, 6)) - -=== tests/cases/conformance/node/node_modules/inner/index.d.ts === -// cjs format file -import * as cjs from "inner/cjs/index"; ->cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) - -import * as mjs from "inner/mjs/index"; ->mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) - -import * as type from "inner/js/index"; ->type : Symbol(type, Decl(index.d.ts, 3, 6)) - -export { cjs }; ->cjs : Symbol(mjs.cjs.cjs.type.cjs, Decl(index.d.ts, 4, 8)) - -export { mjs }; ->mjs : Symbol(mjs.cjs.cjs.type.mjs, Decl(index.d.ts, 5, 8)) - -export { type }; ->type : Symbol(mjs.cjs.cjs.type.type, Decl(index.d.ts, 6, 8)) - -=== tests/cases/conformance/node/node_modules/inner/index.d.mts === -// esm format file -import * as cjs from "inner/cjs/index"; ->cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) - -import * as mjs from "inner/mjs/index"; ->mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) - -import * as type from "inner/js/index"; ->type : Symbol(type, Decl(index.d.mts, 3, 6)) - -export { cjs }; ->cjs : Symbol(cjs.cjs.mjs.cjs, Decl(index.d.mts, 4, 8)) - -export { mjs }; ->mjs : Symbol(cjs.cjs.mjs.mjs, Decl(index.d.mts, 5, 8)) - -export { type }; ->type : Symbol(cjs.cjs.mjs.type, Decl(index.d.mts, 6, 8)) - -=== tests/cases/conformance/node/node_modules/inner/index.d.cts === -// cjs format file -import * as cjs from "inner/cjs/index"; ->cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) - -import * as mjs from "inner/mjs/index"; ->mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) - -import * as type from "inner/js/index"; ->type : Symbol(type, Decl(index.d.cts, 3, 6)) - -export { cjs }; ->cjs : Symbol(cjs.cjs, Decl(index.d.cts, 4, 8)) - -export { mjs }; ->mjs : Symbol(cjs.mjs, Decl(index.d.cts, 5, 8)) - -export { type }; ->type : Symbol(cjs.type, Decl(index.d.cts, 6, 8)) - diff --git a/tests/baselines/reference/nodeModulesPackagePatternExports(module=node12).types b/tests/baselines/reference/nodeModulesPackagePatternExports(module=node12).types deleted file mode 100644 index 3ebdb118fd9..00000000000 --- a/tests/baselines/reference/nodeModulesPackagePatternExports(module=node12).types +++ /dev/null @@ -1,120 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import * as cjsi from "inner/cjs/index"; ->cjsi : typeof cjsi - -import * as mjsi from "inner/mjs/index"; ->mjsi : typeof cjsi.cjs.mjs - -import * as typei from "inner/js/index"; ->typei : typeof typei - -cjsi; ->cjsi : typeof cjsi - -mjsi; ->mjsi : typeof cjsi.cjs.mjs - -typei; ->typei : typeof typei - -=== tests/cases/conformance/node/index.mts === -// esm format file -import * as cjsi from "inner/cjs/index"; ->cjsi : typeof cjsi - -import * as mjsi from "inner/mjs/index"; ->mjsi : typeof cjsi.cjs.mjs - -import * as typei from "inner/js/index"; ->typei : typeof typei - -cjsi; ->cjsi : typeof cjsi - -mjsi; ->mjsi : typeof cjsi.cjs.mjs - -typei; ->typei : typeof typei - -=== tests/cases/conformance/node/index.cts === -// cjs format file -import * as cjsi from "inner/cjs/index"; ->cjsi : typeof cjsi - -import * as mjsi from "inner/mjs/index"; ->mjsi : typeof cjsi.mjs - -import * as typei from "inner/js/index"; ->typei : typeof cjsi.mjs.cjs.type - -cjsi; ->cjsi : typeof cjsi - -mjsi; ->mjsi : typeof cjsi.mjs - -typei; ->typei : typeof cjsi.mjs.cjs.type - -=== tests/cases/conformance/node/node_modules/inner/index.d.ts === -// cjs format file -import * as cjs from "inner/cjs/index"; ->cjs : any - -import * as mjs from "inner/mjs/index"; ->mjs : typeof mjs - -import * as type from "inner/js/index"; ->type : typeof mjs.cjs.cjs.type - -export { cjs }; ->cjs : any - -export { mjs }; ->mjs : typeof mjs - -export { type }; ->type : typeof mjs.cjs.cjs.type - -=== tests/cases/conformance/node/node_modules/inner/index.d.mts === -// esm format file -import * as cjs from "inner/cjs/index"; ->cjs : typeof cjs - -import * as mjs from "inner/mjs/index"; ->mjs : typeof cjs.cjs.mjs - -import * as type from "inner/js/index"; ->type : typeof cjs.cjs.mjs.type - -export { cjs }; ->cjs : typeof cjs - -export { mjs }; ->mjs : typeof cjs.cjs.mjs - -export { type }; ->type : typeof cjs.cjs.mjs.type - -=== tests/cases/conformance/node/node_modules/inner/index.d.cts === -// cjs format file -import * as cjs from "inner/cjs/index"; ->cjs : typeof cjs - -import * as mjs from "inner/mjs/index"; ->mjs : typeof cjs.mjs - -import * as type from "inner/js/index"; ->type : typeof cjs.mjs.cjs.type - -export { cjs }; ->cjs : typeof cjs - -export { mjs }; ->mjs : typeof cjs.mjs - -export { type }; ->type : typeof cjs.mjs.cjs.type - diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node12).errors.txt b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node12).errors.txt deleted file mode 100644 index 6c400a3f69c..00000000000 --- a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node12).errors.txt +++ /dev/null @@ -1,120 +0,0 @@ -tests/cases/conformance/node/index.cts(2,23): error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(3,23): error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. -tests/cases/conformance/node/index.cts(4,24): error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(2,23): error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(3,23): error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. -tests/cases/conformance/node/index.mts(4,24): error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(2,23): error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(3,23): error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. -tests/cases/conformance/node/index.ts(4,24): error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. -tests/cases/conformance/node/node_modules/inner/index.d.cts(2,22): error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. -tests/cases/conformance/node/node_modules/inner/index.d.cts(3,22): error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. -tests/cases/conformance/node/node_modules/inner/index.d.cts(4,23): error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. -tests/cases/conformance/node/node_modules/inner/index.d.mts(2,22): error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. -tests/cases/conformance/node/node_modules/inner/index.d.mts(3,22): error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. -tests/cases/conformance/node/node_modules/inner/index.d.mts(4,23): error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. -tests/cases/conformance/node/node_modules/inner/index.d.ts(2,22): error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. -tests/cases/conformance/node/node_modules/inner/index.d.ts(3,22): error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. -tests/cases/conformance/node/node_modules/inner/index.d.ts(4,23): error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. - - -==== tests/cases/conformance/node/index.ts (3 errors) ==== - // esm format file - import * as cjsi from "inner/cjs/index.cjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. - import * as mjsi from "inner/mjs/index.mjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. - import * as typei from "inner/js/index.js"; - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. - cjsi; - mjsi; - typei; -==== tests/cases/conformance/node/index.mts (3 errors) ==== - // esm format file - import * as cjsi from "inner/cjs/index.cjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. - import * as mjsi from "inner/mjs/index.mjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. - import * as typei from "inner/js/index.js"; - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. - cjsi; - mjsi; - typei; -==== tests/cases/conformance/node/index.cts (3 errors) ==== - // cjs format file - import * as cjsi from "inner/cjs/index.cjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. - import * as mjsi from "inner/mjs/index.mjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. - import * as typei from "inner/js/index.js"; - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. - cjsi; - mjsi; - typei; -==== tests/cases/conformance/node/node_modules/inner/index.d.ts (3 errors) ==== - // cjs format file - import * as cjs from "inner/cjs/index.cjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. - import * as mjs from "inner/mjs/index.mjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. - import * as type from "inner/js/index.js"; - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. - export { cjs }; - export { mjs }; - export { type }; -==== tests/cases/conformance/node/node_modules/inner/index.d.mts (3 errors) ==== - // esm format file - import * as cjs from "inner/cjs/index.cjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. - import * as mjs from "inner/mjs/index.mjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. - import * as type from "inner/js/index.js"; - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. - export { cjs }; - export { mjs }; - export { type }; -==== tests/cases/conformance/node/node_modules/inner/index.d.cts (3 errors) ==== - // cjs format file - import * as cjs from "inner/cjs/index.cjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/cjs/index.cjs' or its corresponding type declarations. - import * as mjs from "inner/mjs/index.mjs"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/mjs/index.mjs' or its corresponding type declarations. - import * as type from "inner/js/index.js"; - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'inner/js/index.js' or its corresponding type declarations. - export { cjs }; - export { mjs }; - export { type }; -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module", - } -==== tests/cases/conformance/node/node_modules/inner/package.json (0 errors) ==== - { - "name": "inner", - "private": true, - "exports": { - "./cjs/*.cjs": "./*.cjs", - "./mjs/*.mjs": "./*.mjs", - "./js/*.js": "./*.js" - } - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node12).js b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node12).js deleted file mode 100644 index 62c5b115698..00000000000 --- a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node12).js +++ /dev/null @@ -1,124 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesPackagePatternExportsTrailers.ts] //// - -//// [index.ts] -// esm format file -import * as cjsi from "inner/cjs/index.cjs"; -import * as mjsi from "inner/mjs/index.mjs"; -import * as typei from "inner/js/index.js"; -cjsi; -mjsi; -typei; -//// [index.mts] -// esm format file -import * as cjsi from "inner/cjs/index.cjs"; -import * as mjsi from "inner/mjs/index.mjs"; -import * as typei from "inner/js/index.js"; -cjsi; -mjsi; -typei; -//// [index.cts] -// cjs format file -import * as cjsi from "inner/cjs/index.cjs"; -import * as mjsi from "inner/mjs/index.mjs"; -import * as typei from "inner/js/index.js"; -cjsi; -mjsi; -typei; -//// [index.d.ts] -// cjs format file -import * as cjs from "inner/cjs/index.cjs"; -import * as mjs from "inner/mjs/index.mjs"; -import * as type from "inner/js/index.js"; -export { cjs }; -export { mjs }; -export { type }; -//// [index.d.mts] -// esm format file -import * as cjs from "inner/cjs/index.cjs"; -import * as mjs from "inner/mjs/index.mjs"; -import * as type from "inner/js/index.js"; -export { cjs }; -export { mjs }; -export { type }; -//// [index.d.cts] -// cjs format file -import * as cjs from "inner/cjs/index.cjs"; -import * as mjs from "inner/mjs/index.mjs"; -import * as type from "inner/js/index.js"; -export { cjs }; -export { mjs }; -export { type }; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module", -} -//// [package.json] -{ - "name": "inner", - "private": true, - "exports": { - "./cjs/*.cjs": "./*.cjs", - "./mjs/*.mjs": "./*.mjs", - "./js/*.js": "./*.js" - } -} - -//// [index.js] -// esm format file -import * as cjsi from "inner/cjs/index.cjs"; -import * as mjsi from "inner/mjs/index.mjs"; -import * as typei from "inner/js/index.js"; -cjsi; -mjsi; -typei; -//// [index.mjs] -// esm format file -import * as cjsi from "inner/cjs/index.cjs"; -import * as mjsi from "inner/mjs/index.mjs"; -import * as typei from "inner/js/index.js"; -cjsi; -mjsi; -typei; -//// [index.cjs] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// cjs format file -const cjsi = __importStar(require("inner/cjs/index.cjs")); -const mjsi = __importStar(require("inner/mjs/index.mjs")); -const typei = __importStar(require("inner/js/index.js")); -cjsi; -mjsi; -typei; - - -//// [index.d.ts] -export {}; -//// [index.d.mts] -export {}; -//// [index.d.cts] -export {}; diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node12).symbols b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node12).symbols deleted file mode 100644 index 0a9b4ceb3a0..00000000000 --- a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node12).symbols +++ /dev/null @@ -1,120 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import * as cjsi from "inner/cjs/index.cjs"; ->cjsi : Symbol(cjsi, Decl(index.ts, 1, 6)) - -import * as mjsi from "inner/mjs/index.mjs"; ->mjsi : Symbol(mjsi, Decl(index.ts, 2, 6)) - -import * as typei from "inner/js/index.js"; ->typei : Symbol(typei, Decl(index.ts, 3, 6)) - -cjsi; ->cjsi : Symbol(cjsi, Decl(index.ts, 1, 6)) - -mjsi; ->mjsi : Symbol(mjsi, Decl(index.ts, 2, 6)) - -typei; ->typei : Symbol(typei, Decl(index.ts, 3, 6)) - -=== tests/cases/conformance/node/index.mts === -// esm format file -import * as cjsi from "inner/cjs/index.cjs"; ->cjsi : Symbol(cjsi, Decl(index.mts, 1, 6)) - -import * as mjsi from "inner/mjs/index.mjs"; ->mjsi : Symbol(mjsi, Decl(index.mts, 2, 6)) - -import * as typei from "inner/js/index.js"; ->typei : Symbol(typei, Decl(index.mts, 3, 6)) - -cjsi; ->cjsi : Symbol(cjsi, Decl(index.mts, 1, 6)) - -mjsi; ->mjsi : Symbol(mjsi, Decl(index.mts, 2, 6)) - -typei; ->typei : Symbol(typei, Decl(index.mts, 3, 6)) - -=== tests/cases/conformance/node/index.cts === -// cjs format file -import * as cjsi from "inner/cjs/index.cjs"; ->cjsi : Symbol(cjsi, Decl(index.cts, 1, 6)) - -import * as mjsi from "inner/mjs/index.mjs"; ->mjsi : Symbol(mjsi, Decl(index.cts, 2, 6)) - -import * as typei from "inner/js/index.js"; ->typei : Symbol(typei, Decl(index.cts, 3, 6)) - -cjsi; ->cjsi : Symbol(cjsi, Decl(index.cts, 1, 6)) - -mjsi; ->mjsi : Symbol(mjsi, Decl(index.cts, 2, 6)) - -typei; ->typei : Symbol(typei, Decl(index.cts, 3, 6)) - -=== tests/cases/conformance/node/node_modules/inner/index.d.ts === -// cjs format file -import * as cjs from "inner/cjs/index.cjs"; ->cjs : Symbol(cjs, Decl(index.d.ts, 1, 6)) - -import * as mjs from "inner/mjs/index.mjs"; ->mjs : Symbol(mjs, Decl(index.d.ts, 2, 6)) - -import * as type from "inner/js/index.js"; ->type : Symbol(type, Decl(index.d.ts, 3, 6)) - -export { cjs }; ->cjs : Symbol(cjs, Decl(index.d.ts, 4, 8)) - -export { mjs }; ->mjs : Symbol(mjs, Decl(index.d.ts, 5, 8)) - -export { type }; ->type : Symbol(type, Decl(index.d.ts, 6, 8)) - -=== tests/cases/conformance/node/node_modules/inner/index.d.mts === -// esm format file -import * as cjs from "inner/cjs/index.cjs"; ->cjs : Symbol(cjs, Decl(index.d.mts, 1, 6)) - -import * as mjs from "inner/mjs/index.mjs"; ->mjs : Symbol(mjs, Decl(index.d.mts, 2, 6)) - -import * as type from "inner/js/index.js"; ->type : Symbol(type, Decl(index.d.mts, 3, 6)) - -export { cjs }; ->cjs : Symbol(cjs, Decl(index.d.mts, 4, 8)) - -export { mjs }; ->mjs : Symbol(mjs, Decl(index.d.mts, 5, 8)) - -export { type }; ->type : Symbol(type, Decl(index.d.mts, 6, 8)) - -=== tests/cases/conformance/node/node_modules/inner/index.d.cts === -// cjs format file -import * as cjs from "inner/cjs/index.cjs"; ->cjs : Symbol(cjs, Decl(index.d.cts, 1, 6)) - -import * as mjs from "inner/mjs/index.mjs"; ->mjs : Symbol(mjs, Decl(index.d.cts, 2, 6)) - -import * as type from "inner/js/index.js"; ->type : Symbol(type, Decl(index.d.cts, 3, 6)) - -export { cjs }; ->cjs : Symbol(cjs, Decl(index.d.cts, 4, 8)) - -export { mjs }; ->mjs : Symbol(mjs, Decl(index.d.cts, 5, 8)) - -export { type }; ->type : Symbol(type, Decl(index.d.cts, 6, 8)) - diff --git a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node12).types b/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node12).types deleted file mode 100644 index c7f76095969..00000000000 --- a/tests/baselines/reference/nodeModulesPackagePatternExportsTrailers(module=node12).types +++ /dev/null @@ -1,120 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import * as cjsi from "inner/cjs/index.cjs"; ->cjsi : any - -import * as mjsi from "inner/mjs/index.mjs"; ->mjsi : any - -import * as typei from "inner/js/index.js"; ->typei : any - -cjsi; ->cjsi : any - -mjsi; ->mjsi : any - -typei; ->typei : any - -=== tests/cases/conformance/node/index.mts === -// esm format file -import * as cjsi from "inner/cjs/index.cjs"; ->cjsi : any - -import * as mjsi from "inner/mjs/index.mjs"; ->mjsi : any - -import * as typei from "inner/js/index.js"; ->typei : any - -cjsi; ->cjsi : any - -mjsi; ->mjsi : any - -typei; ->typei : any - -=== tests/cases/conformance/node/index.cts === -// cjs format file -import * as cjsi from "inner/cjs/index.cjs"; ->cjsi : any - -import * as mjsi from "inner/mjs/index.mjs"; ->mjsi : any - -import * as typei from "inner/js/index.js"; ->typei : any - -cjsi; ->cjsi : any - -mjsi; ->mjsi : any - -typei; ->typei : any - -=== tests/cases/conformance/node/node_modules/inner/index.d.ts === -// cjs format file -import * as cjs from "inner/cjs/index.cjs"; ->cjs : any - -import * as mjs from "inner/mjs/index.mjs"; ->mjs : any - -import * as type from "inner/js/index.js"; ->type : any - -export { cjs }; ->cjs : any - -export { mjs }; ->mjs : any - -export { type }; ->type : any - -=== tests/cases/conformance/node/node_modules/inner/index.d.mts === -// esm format file -import * as cjs from "inner/cjs/index.cjs"; ->cjs : any - -import * as mjs from "inner/mjs/index.mjs"; ->mjs : any - -import * as type from "inner/js/index.js"; ->type : any - -export { cjs }; ->cjs : any - -export { mjs }; ->mjs : any - -export { type }; ->type : any - -=== tests/cases/conformance/node/node_modules/inner/index.d.cts === -// cjs format file -import * as cjs from "inner/cjs/index.cjs"; ->cjs : any - -import * as mjs from "inner/mjs/index.mjs"; ->mjs : any - -import * as type from "inner/js/index.js"; ->type : any - -export { cjs }; ->cjs : any - -export { mjs }; ->mjs : any - -export { type }; ->type : any - diff --git a/tests/baselines/reference/nodeModulesResolveJsonModule(module=node12).errors.txt b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node12).errors.txt deleted file mode 100644 index 4200a11e7ba..00000000000 --- a/tests/baselines/reference/nodeModulesResolveJsonModule(module=node12).errors.txt +++ /dev/null @@ -1,39 +0,0 @@ -tests/cases/conformance/node/index.mts(1,17): error TS7062: JSON imports are experimental in ES module mode imports. -tests/cases/conformance/node/index.mts(3,21): error TS7062: JSON imports are experimental in ES module mode imports. -tests/cases/conformance/node/index.ts(1,17): error TS7062: JSON imports are experimental in ES module mode imports. -tests/cases/conformance/node/index.ts(3,21): error TS7062: JSON imports are experimental in ES module mode imports. - - -==== tests/cases/conformance/node/index.ts (2 errors) ==== - import pkg from "./package.json" - ~~~~~~~~~~~~~~~~ -!!! error TS7062: JSON imports are experimental in ES module mode imports. - export const name = pkg.name; - import * as ns from "./package.json"; - ~~~~~~~~~~~~~~~~ -!!! error TS7062: JSON imports are experimental in ES module mode imports. - export const thing = ns; - export const name2 = ns.default.name; -==== tests/cases/conformance/node/index.cts (0 errors) ==== - import pkg from "./package.json" - export const name = pkg.name; - import * as ns from "./package.json"; - export const thing = ns; - export const name2 = ns.default.name; -==== tests/cases/conformance/node/index.mts (2 errors) ==== - import pkg from "./package.json" - ~~~~~~~~~~~~~~~~ -!!! error TS7062: JSON imports are experimental in ES module mode imports. - export const name = pkg.name; - import * as ns from "./package.json"; - ~~~~~~~~~~~~~~~~ -!!! error TS7062: JSON imports are experimental in ES module mode imports. - export const thing = ns; - export const name2 = ns.default.name; -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "pkg", - "version": "0.0.1", - "type": "module", - "default": "misedirection" - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesResolveJsonModule(module=node12).js b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node12).js deleted file mode 100644 index c349cb78a0f..00000000000 --- a/tests/baselines/reference/nodeModulesResolveJsonModule(module=node12).js +++ /dev/null @@ -1,120 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesResolveJsonModule.ts] //// - -//// [index.ts] -import pkg from "./package.json" -export const name = pkg.name; -import * as ns from "./package.json"; -export const thing = ns; -export const name2 = ns.default.name; -//// [index.cts] -import pkg from "./package.json" -export const name = pkg.name; -import * as ns from "./package.json"; -export const thing = ns; -export const name2 = ns.default.name; -//// [index.mts] -import pkg from "./package.json" -export const name = pkg.name; -import * as ns from "./package.json"; -export const thing = ns; -export const name2 = ns.default.name; -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "type": "module", - "default": "misedirection" -} - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "type": "module", - "default": "misedirection" -} -//// [index.js] -import pkg from "./package.json"; -export const name = pkg.name; -import * as ns from "./package.json"; -export const thing = ns; -export const name2 = ns.default.name; -//// [index.cjs] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.name2 = exports.thing = exports.name = void 0; -const package_json_1 = __importDefault(require("./package.json")); -exports.name = package_json_1.default.name; -const ns = __importStar(require("./package.json")); -exports.thing = ns; -exports.name2 = ns.default.name; -//// [index.mjs] -import pkg from "./package.json"; -export const name = pkg.name; -import * as ns from "./package.json"; -export const thing = ns; -export const name2 = ns.default.name; - - -//// [index.d.ts] -export declare const name: string; -export declare const thing: { - default: { - name: string; - version: string; - type: string; - default: string; - }; -}; -export declare const name2: string; -//// [index.d.cts] -export declare const name: string; -export declare const thing: { - default: { - name: string; - version: string; - type: string; - default: string; - }; - name: string; - version: string; - type: string; -}; -export declare const name2: string; -//// [index.d.mts] -export declare const name: string; -export declare const thing: { - default: { - name: string; - version: string; - type: string; - default: string; - }; -}; -export declare const name2: string; diff --git a/tests/baselines/reference/nodeModulesResolveJsonModule(module=node12).symbols b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node12).symbols deleted file mode 100644 index f1927c68996..00000000000 --- a/tests/baselines/reference/nodeModulesResolveJsonModule(module=node12).symbols +++ /dev/null @@ -1,89 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -import pkg from "./package.json" ->pkg : Symbol(pkg, Decl(index.ts, 0, 6)) - -export const name = pkg.name; ->name : Symbol(name, Decl(index.ts, 1, 12)) ->pkg.name : Symbol("name", Decl(package.json, 0, 1)) ->pkg : Symbol(pkg, Decl(index.ts, 0, 6)) ->name : Symbol("name", Decl(package.json, 0, 1)) - -import * as ns from "./package.json"; ->ns : Symbol(ns, Decl(index.ts, 2, 6)) - -export const thing = ns; ->thing : Symbol(thing, Decl(index.ts, 3, 12)) ->ns : Symbol(ns, Decl(index.ts, 2, 6)) - -export const name2 = ns.default.name; ->name2 : Symbol(name2, Decl(index.ts, 4, 12)) ->ns.default.name : Symbol("name", Decl(package.json, 0, 1)) ->ns.default : Symbol("tests/cases/conformance/node/package") ->ns : Symbol(ns, Decl(index.ts, 2, 6)) ->default : Symbol("tests/cases/conformance/node/package") ->name : Symbol("name", Decl(package.json, 0, 1)) - -=== tests/cases/conformance/node/index.cts === -import pkg from "./package.json" ->pkg : Symbol(pkg, Decl(index.cts, 0, 6)) - -export const name = pkg.name; ->name : Symbol(name, Decl(index.cts, 1, 12)) ->pkg.name : Symbol("name", Decl(package.json, 0, 1)) ->pkg : Symbol(pkg, Decl(index.cts, 0, 6)) ->name : Symbol("name", Decl(package.json, 0, 1)) - -import * as ns from "./package.json"; ->ns : Symbol(ns, Decl(index.cts, 2, 6)) - -export const thing = ns; ->thing : Symbol(thing, Decl(index.cts, 3, 12)) ->ns : Symbol(ns, Decl(index.cts, 2, 6)) - -export const name2 = ns.default.name; ->name2 : Symbol(name2, Decl(index.cts, 4, 12)) ->ns.default.name : Symbol("name", Decl(package.json, 0, 1)) ->ns.default : Symbol("tests/cases/conformance/node/package") ->ns : Symbol(ns, Decl(index.cts, 2, 6)) ->default : Symbol("tests/cases/conformance/node/package") ->name : Symbol("name", Decl(package.json, 0, 1)) - -=== tests/cases/conformance/node/index.mts === -import pkg from "./package.json" ->pkg : Symbol(pkg, Decl(index.mts, 0, 6)) - -export const name = pkg.name; ->name : Symbol(name, Decl(index.mts, 1, 12)) ->pkg.name : Symbol("name", Decl(package.json, 0, 1)) ->pkg : Symbol(pkg, Decl(index.mts, 0, 6)) ->name : Symbol("name", Decl(package.json, 0, 1)) - -import * as ns from "./package.json"; ->ns : Symbol(ns, Decl(index.mts, 2, 6)) - -export const thing = ns; ->thing : Symbol(thing, Decl(index.mts, 3, 12)) ->ns : Symbol(ns, Decl(index.mts, 2, 6)) - -export const name2 = ns.default.name; ->name2 : Symbol(name2, Decl(index.mts, 4, 12)) ->ns.default.name : Symbol("name", Decl(package.json, 0, 1)) ->ns.default : Symbol("tests/cases/conformance/node/package") ->ns : Symbol(ns, Decl(index.mts, 2, 6)) ->default : Symbol("tests/cases/conformance/node/package") ->name : Symbol("name", Decl(package.json, 0, 1)) - -=== tests/cases/conformance/node/package.json === -{ - "name": "pkg", ->"name" : Symbol("name", Decl(package.json, 0, 1)) - - "version": "0.0.1", ->"version" : Symbol("version", Decl(package.json, 1, 18)) - - "type": "module", ->"type" : Symbol("type", Decl(package.json, 2, 23)) - - "default": "misedirection" ->"default" : Symbol("default", Decl(package.json, 3, 21)) -} diff --git a/tests/baselines/reference/nodeModulesResolveJsonModule(module=node12).types b/tests/baselines/reference/nodeModulesResolveJsonModule(module=node12).types deleted file mode 100644 index f6ad83e1754..00000000000 --- a/tests/baselines/reference/nodeModulesResolveJsonModule(module=node12).types +++ /dev/null @@ -1,95 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -import pkg from "./package.json" ->pkg : { name: string; version: string; type: string; default: string; } - -export const name = pkg.name; ->name : string ->pkg.name : string ->pkg : { name: string; version: string; type: string; default: string; } ->name : string - -import * as ns from "./package.json"; ->ns : { default: { name: string; version: string; type: string; default: string; }; } - -export const thing = ns; ->thing : { default: { name: string; version: string; type: string; default: string; }; } ->ns : { default: { name: string; version: string; type: string; default: string; }; } - -export const name2 = ns.default.name; ->name2 : string ->ns.default.name : string ->ns.default : { name: string; version: string; type: string; default: string; } ->ns : { default: { name: string; version: string; type: string; default: string; }; } ->default : { name: string; version: string; type: string; default: string; } ->name : string - -=== tests/cases/conformance/node/index.cts === -import pkg from "./package.json" ->pkg : { name: string; version: string; type: string; default: string; } - -export const name = pkg.name; ->name : string ->pkg.name : string ->pkg : { name: string; version: string; type: string; default: string; } ->name : string - -import * as ns from "./package.json"; ->ns : { default: { name: string; version: string; type: string; default: string; }; name: string; version: string; type: string; } - -export const thing = ns; ->thing : { default: { name: string; version: string; type: string; default: string; }; name: string; version: string; type: string; } ->ns : { default: { name: string; version: string; type: string; default: string; }; name: string; version: string; type: string; } - -export const name2 = ns.default.name; ->name2 : string ->ns.default.name : string ->ns.default : { name: string; version: string; type: string; default: string; } ->ns : { default: { name: string; version: string; type: string; default: string; }; name: string; version: string; type: string; } ->default : { name: string; version: string; type: string; default: string; } ->name : string - -=== tests/cases/conformance/node/index.mts === -import pkg from "./package.json" ->pkg : { name: string; version: string; type: string; default: string; } - -export const name = pkg.name; ->name : string ->pkg.name : string ->pkg : { name: string; version: string; type: string; default: string; } ->name : string - -import * as ns from "./package.json"; ->ns : { default: { name: string; version: string; type: string; default: string; }; } - -export const thing = ns; ->thing : { default: { name: string; version: string; type: string; default: string; }; } ->ns : { default: { name: string; version: string; type: string; default: string; }; } - -export const name2 = ns.default.name; ->name2 : string ->ns.default.name : string ->ns.default : { name: string; version: string; type: string; default: string; } ->ns : { default: { name: string; version: string; type: string; default: string; }; } ->default : { name: string; version: string; type: string; default: string; } ->name : string - -=== tests/cases/conformance/node/package.json === -{ ->{ "name": "pkg", "version": "0.0.1", "type": "module", "default": "misedirection"} : { name: string; version: string; type: string; default: string; } - - "name": "pkg", ->"name" : string ->"pkg" : "pkg" - - "version": "0.0.1", ->"version" : string ->"0.0.1" : "0.0.1" - - "type": "module", ->"type" : string ->"module" : "module" - - "default": "misedirection" ->"default" : string ->"misedirection" : "misedirection" -} diff --git a/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node12).errors.txt b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node12).errors.txt deleted file mode 100644 index 012ef390621..00000000000 --- a/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node12).errors.txt +++ /dev/null @@ -1,43 +0,0 @@ -tests/cases/conformance/node/index.ts(3,22): error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/subfolder/index.ts(2,17): error TS1471: Module '../index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. -tests/cases/conformance/node/subfolder/index.ts(3,22): error TS1471: Module '../index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - - -==== tests/cases/conformance/node/subfolder/index.ts (2 errors) ==== - // cjs format file - import {h} from "../index.js"; - ~~~~~~~~~~~~~ -!!! error TS1471: Module '../index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import mod = require("../index.js"); - ~~~~~~~~~~~~~ -!!! error TS1471: Module '../index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import {f as _f} from "./index.js"; - import mod2 = require("./index.js"); - export async function f() { - const mod3 = await import ("../index.js"); - const mod4 = await import ("./index.js"); - h(); - } -==== tests/cases/conformance/node/index.ts (1 errors) ==== - // esm format file - import {h as _h} from "./index.js"; - import mod = require("./index.js"); - ~~~~~~~~~~~~ -!!! error TS1471: Module './index.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - import {f} from "./subfolder/index.js"; - import mod2 = require("./subfolder/index.js"); - export async function h() { - const mod3 = await import ("./index.js"); - const mod4 = await import ("./subfolder/index.js"); - f(); - } -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module" - } -==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== - { - "type": "commonjs" - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node12).js b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node12).js deleted file mode 100644 index 7ac63da5914..00000000000 --- a/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node12).js +++ /dev/null @@ -1,60 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesSynchronousCallErrors.ts] //// - -//// [index.ts] -// cjs format file -import {h} from "../index.js"; -import mod = require("../index.js"); -import {f as _f} from "./index.js"; -import mod2 = require("./index.js"); -export async function f() { - const mod3 = await import ("../index.js"); - const mod4 = await import ("./index.js"); - h(); -} -//// [index.ts] -// esm format file -import {h as _h} from "./index.js"; -import mod = require("./index.js"); -import {f} from "./subfolder/index.js"; -import mod2 = require("./subfolder/index.js"); -export async function h() { - const mod3 = await import ("./index.js"); - const mod4 = await import ("./subfolder/index.js"); - f(); -} -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} - -//// [index.js] -import { f } from "./subfolder/index.js"; -export async function h() { - const mod3 = await import("./index.js"); - const mod4 = await import("./subfolder/index.js"); - f(); -} -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.f = void 0; -// cjs format file -const index_js_1 = require("../index.js"); -async function f() { - const mod3 = await import("../index.js"); - const mod4 = await import("./index.js"); - (0, index_js_1.h)(); -} -exports.f = f; - - -//// [index.d.ts] -export declare function h(): Promise; -//// [index.d.ts] -export declare function f(): Promise; diff --git a/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node12).symbols b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node12).symbols deleted file mode 100644 index 8b03ab0af9f..00000000000 --- a/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node12).symbols +++ /dev/null @@ -1,58 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -import {h} from "../index.js"; ->h : Symbol(h, Decl(index.ts, 1, 8)) - -import mod = require("../index.js"); ->mod : Symbol(mod, Decl(index.ts, 1, 30)) - -import {f as _f} from "./index.js"; ->f : Symbol(f, Decl(index.ts, 4, 36)) ->_f : Symbol(_f, Decl(index.ts, 3, 8)) - -import mod2 = require("./index.js"); ->mod2 : Symbol(mod2, Decl(index.ts, 3, 35)) - -export async function f() { ->f : Symbol(f, Decl(index.ts, 4, 36)) - - const mod3 = await import ("../index.js"); ->mod3 : Symbol(mod3, Decl(index.ts, 6, 9)) ->"../index.js" : Symbol(mod, Decl(index.ts, 0, 0)) - - const mod4 = await import ("./index.js"); ->mod4 : Symbol(mod4, Decl(index.ts, 7, 9)) ->"./index.js" : Symbol(mod2, Decl(index.ts, 0, 0)) - - h(); ->h : Symbol(h, Decl(index.ts, 1, 8)) -} -=== tests/cases/conformance/node/index.ts === -// esm format file -import {h as _h} from "./index.js"; ->h : Symbol(h, Decl(index.ts, 4, 46)) ->_h : Symbol(_h, Decl(index.ts, 1, 8)) - -import mod = require("./index.js"); ->mod : Symbol(mod, Decl(index.ts, 1, 35)) - -import {f} from "./subfolder/index.js"; ->f : Symbol(f, Decl(index.ts, 3, 8)) - -import mod2 = require("./subfolder/index.js"); ->mod2 : Symbol(mod2, Decl(index.ts, 3, 39)) - -export async function h() { ->h : Symbol(h, Decl(index.ts, 4, 46)) - - const mod3 = await import ("./index.js"); ->mod3 : Symbol(mod3, Decl(index.ts, 6, 9)) ->"./index.js" : Symbol(mod, Decl(index.ts, 0, 0)) - - const mod4 = await import ("./subfolder/index.js"); ->mod4 : Symbol(mod4, Decl(index.ts, 7, 9)) ->"./subfolder/index.js" : Symbol(mod2, Decl(index.ts, 0, 0)) - - f(); ->f : Symbol(f, Decl(index.ts, 3, 8)) -} diff --git a/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node12).types b/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node12).types deleted file mode 100644 index 0ded6fc1b88..00000000000 --- a/tests/baselines/reference/nodeModulesSynchronousCallErrors(module=node12).types +++ /dev/null @@ -1,68 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -import {h} from "../index.js"; ->h : () => Promise - -import mod = require("../index.js"); ->mod : typeof mod - -import {f as _f} from "./index.js"; ->f : () => Promise ->_f : () => Promise - -import mod2 = require("./index.js"); ->mod2 : typeof mod2 - -export async function f() { ->f : () => Promise - - const mod3 = await import ("../index.js"); ->mod3 : typeof mod ->await import ("../index.js") : typeof mod ->import ("../index.js") : Promise ->"../index.js" : "../index.js" - - const mod4 = await import ("./index.js"); ->mod4 : { default: typeof mod2; f(): Promise; } ->await import ("./index.js") : { default: typeof mod2; f(): Promise; } ->import ("./index.js") : Promise<{ default: typeof mod2; f(): Promise; }> ->"./index.js" : "./index.js" - - h(); ->h() : Promise ->h : () => Promise -} -=== tests/cases/conformance/node/index.ts === -// esm format file -import {h as _h} from "./index.js"; ->h : () => Promise ->_h : () => Promise - -import mod = require("./index.js"); ->mod : typeof mod - -import {f} from "./subfolder/index.js"; ->f : () => Promise - -import mod2 = require("./subfolder/index.js"); ->mod2 : typeof mod2 - -export async function h() { ->h : () => Promise - - const mod3 = await import ("./index.js"); ->mod3 : typeof mod ->await import ("./index.js") : typeof mod ->import ("./index.js") : Promise ->"./index.js" : "./index.js" - - const mod4 = await import ("./subfolder/index.js"); ->mod4 : { default: typeof mod2; f(): Promise; } ->await import ("./subfolder/index.js") : { default: typeof mod2; f(): Promise; } ->import ("./subfolder/index.js") : Promise<{ default: typeof mod2; f(): Promise; }> ->"./subfolder/index.js" : "./subfolder/index.js" - - f(); ->f() : Promise ->f : () => Promise -} diff --git a/tests/baselines/reference/nodeModulesTopLevelAwait(module=node12).errors.txt b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node12).errors.txt deleted file mode 100644 index 12596b85ab2..00000000000 --- a/tests/baselines/reference/nodeModulesTopLevelAwait(module=node12).errors.txt +++ /dev/null @@ -1,34 +0,0 @@ -tests/cases/conformance/node/index.ts(2,11): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. -tests/cases/conformance/node/index.ts(4,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. -tests/cases/conformance/node/subfolder/index.ts(2,11): error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. -tests/cases/conformance/node/subfolder/index.ts(4,5): error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. - - -==== tests/cases/conformance/node/subfolder/index.ts (2 errors) ==== - // cjs format file - const x = await 1; - ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. - export {x}; - for await (const y of []) {} - ~~~~~ -!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. -==== tests/cases/conformance/node/index.ts (2 errors) ==== - // esm format file - const x = await 1; - ~~~~~ -!!! error TS1378: Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. - export {x}; - for await (const y of []) {} - ~~~~~ -!!! error TS1432: Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher. -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module" - } -==== tests/cases/conformance/node/subfolder/package.json (0 errors) ==== - { - "type": "commonjs" - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesTopLevelAwait(module=node12).js b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node12).js deleted file mode 100644 index 8d33777f0c4..00000000000 --- a/tests/baselines/reference/nodeModulesTopLevelAwait(module=node12).js +++ /dev/null @@ -1,44 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesTopLevelAwait.ts] //// - -//// [index.ts] -// cjs format file -const x = await 1; -export {x}; -for await (const y of []) {} -//// [index.ts] -// esm format file -const x = await 1; -export {x}; -for await (const y of []) {} -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module" -} -//// [package.json] -{ - "type": "commonjs" -} - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.x = void 0; -// cjs format file -const x = await 1; -exports.x = x; -for await (const y of []) { } -//// [index.js] -// esm format file -const x = await 1; -export { x }; -for await (const y of []) { } - - -//// [index.d.ts] -declare const x = 1; -export { x }; -//// [index.d.ts] -declare const x = 1; -export { x }; diff --git a/tests/baselines/reference/nodeModulesTopLevelAwait(module=node12).symbols b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node12).symbols deleted file mode 100644 index 624f09cb773..00000000000 --- a/tests/baselines/reference/nodeModulesTopLevelAwait(module=node12).symbols +++ /dev/null @@ -1,22 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -const x = await 1; ->x : Symbol(x, Decl(index.ts, 1, 5)) - -export {x}; ->x : Symbol(x, Decl(index.ts, 2, 8)) - -for await (const y of []) {} ->y : Symbol(y, Decl(index.ts, 3, 16)) - -=== tests/cases/conformance/node/index.ts === -// esm format file -const x = await 1; ->x : Symbol(x, Decl(index.ts, 1, 5)) - -export {x}; ->x : Symbol(x, Decl(index.ts, 2, 8)) - -for await (const y of []) {} ->y : Symbol(y, Decl(index.ts, 3, 16)) - diff --git a/tests/baselines/reference/nodeModulesTopLevelAwait(module=node12).types b/tests/baselines/reference/nodeModulesTopLevelAwait(module=node12).types deleted file mode 100644 index ae8108f4020..00000000000 --- a/tests/baselines/reference/nodeModulesTopLevelAwait(module=node12).types +++ /dev/null @@ -1,28 +0,0 @@ -=== tests/cases/conformance/node/subfolder/index.ts === -// cjs format file -const x = await 1; ->x : 1 ->await 1 : 1 ->1 : 1 - -export {x}; ->x : 1 - -for await (const y of []) {} ->y : any ->[] : undefined[] - -=== tests/cases/conformance/node/index.ts === -// esm format file -const x = await 1; ->x : 1 ->await 1 : 1 ->1 : 1 - -export {x}; ->x : 1 - -for await (const y of []) {} ->y : any ->[] : undefined[] - diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node12).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node12).js deleted file mode 100644 index 422ed137b0f..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node12).js +++ /dev/null @@ -1,35 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit1.ts] //// - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } -} -//// [import.d.ts] -export {}; -declare global { - interface ImportInterface {} -} -//// [require.d.ts] -export {}; -declare global { - interface RequireInterface {} -} -//// [index.ts] -/// -export interface LocalInterface extends RequireInterface {} - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/// - - -//// [index.d.ts] -/// -export interface LocalInterface extends RequireInterface { -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node12).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node12).symbols deleted file mode 100644 index b3bd9d822f3..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node12).symbols +++ /dev/null @@ -1,14 +0,0 @@ -=== /index.ts === -/// -export interface LocalInterface extends RequireInterface {} ->LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) - -=== /node_modules/pkg/require.d.ts === -export {}; -declare global { ->global : Symbol(global, Decl(require.d.ts, 0, 10)) - - interface RequireInterface {} ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node12).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node12).types deleted file mode 100644 index 5309ca6f8bc..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit1(module=node12).types +++ /dev/null @@ -1,10 +0,0 @@ -=== /index.ts === -/// -No type information for this code.export interface LocalInterface extends RequireInterface {} -No type information for this code.=== /node_modules/pkg/require.d.ts === -export {}; -declare global { ->global : any - - interface RequireInterface {} -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node12).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node12).js deleted file mode 100644 index 19f87244dba..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node12).js +++ /dev/null @@ -1,39 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit2.ts] //// - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } -} -//// [import.d.ts] -export {}; -declare global { - interface ImportInterface {} -} -//// [require.d.ts] -export {}; -declare global { - interface RequireInterface {} -} -//// [package.json] -{ - "private": true, - "type": "module" -} -//// [index.ts] -/// -export interface LocalInterface extends ImportInterface {} - -//// [index.js] -/// -export {}; - - -//// [index.d.ts] -/// -export interface LocalInterface extends ImportInterface { -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node12).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node12).symbols deleted file mode 100644 index e21bf153066..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node12).symbols +++ /dev/null @@ -1,14 +0,0 @@ -=== /index.ts === -/// -export interface LocalInterface extends ImportInterface {} ->LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) ->ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) - -=== /node_modules/pkg/import.d.ts === -export {}; -declare global { ->global : Symbol(global, Decl(import.d.ts, 0, 10)) - - interface ImportInterface {} ->ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node12).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node12).types deleted file mode 100644 index e6e97a84b46..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit2(module=node12).types +++ /dev/null @@ -1,10 +0,0 @@ -=== /index.ts === -/// -No type information for this code.export interface LocalInterface extends ImportInterface {} -No type information for this code.=== /node_modules/pkg/import.d.ts === -export {}; -declare global { ->global : any - - interface ImportInterface {} -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node12).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node12).js deleted file mode 100644 index 78d1f72c4b1..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node12).js +++ /dev/null @@ -1,39 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit3.ts] //// - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } -} -//// [import.d.ts] -export {}; -declare global { - interface ImportInterface {} -} -//// [require.d.ts] -export {}; -declare global { - interface RequireInterface {} -} -//// [package.json] -{ - "private": true, - "type": "module" -} -//// [index.ts] -/// -export interface LocalInterface extends RequireInterface {} - -//// [index.js] -/// -export {}; - - -//// [index.d.ts] -/// -export interface LocalInterface extends RequireInterface { -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node12).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node12).symbols deleted file mode 100644 index da1b6a81fbb..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node12).symbols +++ /dev/null @@ -1,14 +0,0 @@ -=== /index.ts === -/// -export interface LocalInterface extends RequireInterface {} ->LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) - -=== /node_modules/pkg/require.d.ts === -export {}; -declare global { ->global : Symbol(global, Decl(require.d.ts, 0, 10)) - - interface RequireInterface {} ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node12).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node12).types deleted file mode 100644 index abc205f8742..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit3(module=node12).types +++ /dev/null @@ -1,10 +0,0 @@ -=== /index.ts === -/// -No type information for this code.export interface LocalInterface extends RequireInterface {} -No type information for this code.=== /node_modules/pkg/require.d.ts === -export {}; -declare global { ->global : any - - interface RequireInterface {} -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node12).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node12).js deleted file mode 100644 index 9f2493f030a..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node12).js +++ /dev/null @@ -1,35 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit4.ts] //// - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } -} -//// [import.d.ts] -export {}; -declare global { - interface ImportInterface {} -} -//// [require.d.ts] -export {}; -declare global { - interface RequireInterface {} -} -//// [index.ts] -/// -export interface LocalInterface extends ImportInterface {} - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/// - - -//// [index.d.ts] -/// -export interface LocalInterface extends ImportInterface { -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node12).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node12).symbols deleted file mode 100644 index dcaf8d70169..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node12).symbols +++ /dev/null @@ -1,14 +0,0 @@ -=== /index.ts === -/// -export interface LocalInterface extends ImportInterface {} ->LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) ->ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) - -=== /node_modules/pkg/import.d.ts === -export {}; -declare global { ->global : Symbol(global, Decl(import.d.ts, 0, 10)) - - interface ImportInterface {} ->ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node12).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node12).types deleted file mode 100644 index 62e354e99b1..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit4(module=node12).types +++ /dev/null @@ -1,10 +0,0 @@ -=== /index.ts === -/// -No type information for this code.export interface LocalInterface extends ImportInterface {} -No type information for this code.=== /node_modules/pkg/import.d.ts === -export {}; -declare global { ->global : any - - interface ImportInterface {} -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node12).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node12).js deleted file mode 100644 index 63ad10a1141..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node12).js +++ /dev/null @@ -1,38 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit5.ts] //// - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } -} -//// [import.d.ts] -export {}; -declare global { - interface ImportInterface {} -} -//// [require.d.ts] -export {}; -declare global { - interface RequireInterface {} -} -//// [index.ts] -/// -/// -export interface LocalInterface extends ImportInterface, RequireInterface {} - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/// -/// - - -//// [index.d.ts] -/// -/// -export interface LocalInterface extends ImportInterface, RequireInterface { -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node12).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node12).symbols deleted file mode 100644 index 6602737d542..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node12).symbols +++ /dev/null @@ -1,24 +0,0 @@ -=== /index.ts === -/// -/// -export interface LocalInterface extends ImportInterface, RequireInterface {} ->LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) ->ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) - -=== /node_modules/pkg/import.d.ts === -export {}; -declare global { ->global : Symbol(global, Decl(import.d.ts, 0, 10)) - - interface ImportInterface {} ->ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) -} -=== /node_modules/pkg/require.d.ts === -export {}; -declare global { ->global : Symbol(global, Decl(require.d.ts, 0, 10)) - - interface RequireInterface {} ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node12).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node12).types deleted file mode 100644 index 1e3690c89f0..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit5(module=node12).types +++ /dev/null @@ -1,18 +0,0 @@ -=== /index.ts === -/// -No type information for this code./// -No type information for this code.export interface LocalInterface extends ImportInterface, RequireInterface {} -No type information for this code.=== /node_modules/pkg/import.d.ts === -export {}; -declare global { ->global : any - - interface ImportInterface {} -} -=== /node_modules/pkg/require.d.ts === -export {}; -declare global { ->global : any - - interface RequireInterface {} -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node12).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node12).js deleted file mode 100644 index 34117c328c5..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node12).js +++ /dev/null @@ -1,53 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit6.ts] //// - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } -} -//// [import.d.ts] -export {}; -declare global { - interface ImportInterface {} - function getInterI(): ImportInterface; -} -//// [require.d.ts] -export {}; -declare global { - interface RequireInterface {} - function getInterR(): RequireInterface; -} -//// [uses.ts] -/// -export default getInterR(); -//// [index.ts] -import obj from "./uses.js" -export default (obj as typeof obj); - -//// [uses.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/// -exports.default = getInterR(); -//// [index.js] -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const uses_js_1 = __importDefault(require("./uses.js")); -exports.default = uses_js_1.default; - - -//// [uses.d.ts] -/// -declare const _default: RequireInterface; -export default _default; -//// [index.d.ts] -/// -declare const _default: RequireInterface; -export default _default; diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node12).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node12).symbols deleted file mode 100644 index 5aa8fccc15d..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node12).symbols +++ /dev/null @@ -1,25 +0,0 @@ -=== /index.ts === -import obj from "./uses.js" ->obj : Symbol(obj, Decl(index.ts, 0, 6)) - -export default (obj as typeof obj); ->obj : Symbol(obj, Decl(index.ts, 0, 6)) ->obj : Symbol(obj, Decl(index.ts, 0, 6)) - -=== /node_modules/pkg/require.d.ts === -export {}; -declare global { ->global : Symbol(global, Decl(require.d.ts, 0, 10)) - - interface RequireInterface {} ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) - - function getInterR(): RequireInterface; ->getInterR : Symbol(getInterR, Decl(require.d.ts, 2, 33)) ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) -} -=== /uses.ts === -/// -export default getInterR(); ->getInterR : Symbol(getInterR, Decl(require.d.ts, 2, 33)) - diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node12).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node12).types deleted file mode 100644 index 8b46fbb9f54..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit6(module=node12).types +++ /dev/null @@ -1,25 +0,0 @@ -=== /index.ts === -import obj from "./uses.js" ->obj : RequireInterface - -export default (obj as typeof obj); ->(obj as typeof obj) : RequireInterface ->obj as typeof obj : RequireInterface ->obj : RequireInterface ->obj : RequireInterface - -=== /node_modules/pkg/require.d.ts === -export {}; -declare global { ->global : typeof global - - interface RequireInterface {} - function getInterR(): RequireInterface; ->getInterR : () => RequireInterface -} -=== /uses.ts === -/// -export default getInterR(); ->getInterR() : RequireInterface ->getInterR : () => RequireInterface - diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node12).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node12).js deleted file mode 100644 index 2426cb28b25..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node12).js +++ /dev/null @@ -1,78 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeDeclarationEmit7.ts] //// - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } -} -//// [import.d.ts] -export {}; -declare global { - interface ImportInterface { _i: any; } - function getInterI(): ImportInterface; -} -//// [require.d.ts] -export {}; -declare global { - interface RequireInterface { _r: any; } - function getInterR(): RequireInterface; -} -//// [uses.ts] -/// -export default getInterI(); -//// [package.json] -{ - "private": true, - "type": "module" -} -//// [uses.ts] -/// -export default getInterR(); -//// [package.json] -{ - "private": true, - "type": "commonjs" -} -//// [package.json] -{ - "private": true, - "type": "module" -} -//// [index.ts] -// only an esm file can `import` both kinds of files -import obj1 from "./sub1/uses.js" -import obj2 from "./sub2/uses.js" -export default [obj1, obj2.default] as const; - -//// [uses.js] -/// -export default getInterI(); -//// [uses.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/// -exports.default = getInterR(); -//// [index.js] -// only an esm file can `import` both kinds of files -import obj1 from "./sub1/uses.js"; -import obj2 from "./sub2/uses.js"; -export default [obj1, obj2.default]; - - -//// [uses.d.ts] -/// -declare const _default: ImportInterface; -export default _default; -//// [uses.d.ts] -/// -declare const _default: RequireInterface; -export default _default; -//// [index.d.ts] -/// -/// -declare const _default: readonly [ImportInterface, RequireInterface]; -export default _default; diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node12).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node12).symbols deleted file mode 100644 index 8f29793a362..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node12).symbols +++ /dev/null @@ -1,51 +0,0 @@ -=== /index.ts === -// only an esm file can `import` both kinds of files -import obj1 from "./sub1/uses.js" ->obj1 : Symbol(obj1, Decl(index.ts, 1, 6)) - -import obj2 from "./sub2/uses.js" ->obj2 : Symbol(obj2, Decl(index.ts, 2, 6)) - -export default [obj1, obj2.default] as const; ->obj1 : Symbol(obj1, Decl(index.ts, 1, 6)) ->obj2.default : Symbol(obj2.default, Decl(uses.ts, 0, 0)) ->obj2 : Symbol(obj2, Decl(index.ts, 2, 6)) ->default : Symbol(obj2.default, Decl(uses.ts, 0, 0)) ->const : Symbol(const) - -=== /node_modules/pkg/import.d.ts === -export {}; -declare global { ->global : Symbol(global, Decl(import.d.ts, 0, 10)) - - interface ImportInterface { _i: any; } ->ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) ->_i : Symbol(ImportInterface._i, Decl(import.d.ts, 2, 31)) - - function getInterI(): ImportInterface; ->getInterI : Symbol(getInterI, Decl(import.d.ts, 2, 42)) ->ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 1, 16)) -} -=== /node_modules/pkg/require.d.ts === -export {}; -declare global { ->global : Symbol(global, Decl(require.d.ts, 0, 10)) - - interface RequireInterface { _r: any; } ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) ->_r : Symbol(RequireInterface._r, Decl(require.d.ts, 2, 32)) - - function getInterR(): RequireInterface; ->getInterR : Symbol(getInterR, Decl(require.d.ts, 2, 43)) ->RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 1, 16)) -} -=== /sub1/uses.ts === -/// -export default getInterI(); ->getInterI : Symbol(getInterI, Decl(import.d.ts, 2, 42)) - -=== /sub2/uses.ts === -/// -export default getInterR(); ->getInterR : Symbol(getInterR, Decl(require.d.ts, 2, 43)) - diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node12).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node12).types deleted file mode 100644 index 20edd715aea..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeDeclarationEmit7(module=node12).types +++ /dev/null @@ -1,50 +0,0 @@ -=== /index.ts === -// only an esm file can `import` both kinds of files -import obj1 from "./sub1/uses.js" ->obj1 : ImportInterface - -import obj2 from "./sub2/uses.js" ->obj2 : typeof obj2 - -export default [obj1, obj2.default] as const; ->[obj1, obj2.default] as const : readonly [ImportInterface, RequireInterface] ->[obj1, obj2.default] : readonly [ImportInterface, RequireInterface] ->obj1 : ImportInterface ->obj2.default : RequireInterface ->obj2 : typeof obj2 ->default : RequireInterface - -=== /node_modules/pkg/import.d.ts === -export {}; -declare global { ->global : typeof global - - interface ImportInterface { _i: any; } ->_i : any - - function getInterI(): ImportInterface; ->getInterI : () => ImportInterface -} -=== /node_modules/pkg/require.d.ts === -export {}; -declare global { ->global : typeof global - - interface RequireInterface { _r: any; } ->_r : any - - function getInterR(): RequireInterface; ->getInterR : () => RequireInterface -} -=== /sub1/uses.ts === -/// -export default getInterI(); ->getInterI() : ImportInterface ->getInterI : () => ImportInterface - -=== /sub2/uses.ts === -/// -export default getInterR(); ->getInterR() : RequireInterface ->getInterR : () => RequireInterface - diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node12).errors.txt b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node12).errors.txt deleted file mode 100644 index c9a6ac79317..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node12).errors.txt +++ /dev/null @@ -1,29 +0,0 @@ -/index.ts(2,1): error TS2304: Cannot find name 'foo'. - - -==== /index.ts (1 errors) ==== - /// - foo; - ~~~ -!!! error TS2304: Cannot find name 'foo'. - bar; // bar should resolve while foo should not, since index.js is cjs - export {}; -==== /node_modules/pkg/package.json (0 errors) ==== - { - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } - } -==== /node_modules/pkg/import.d.ts (0 errors) ==== - export {}; - declare global { - var foo: number; - } -==== /node_modules/pkg/require.d.ts (0 errors) ==== - export {}; - declare global { - var bar: number; - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node12).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node12).js deleted file mode 100644 index df6436da900..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node12).js +++ /dev/null @@ -1,33 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride1.ts] //// - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } -} -//// [import.d.ts] -export {}; -declare global { - var foo: number; -} -//// [require.d.ts] -export {}; -declare global { - var bar: number; -} -//// [index.ts] -/// -foo; -bar; // bar should resolve while foo should not, since index.js is cjs -export {}; - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/// -foo; -bar; // bar should resolve while foo should not, since index.js is cjs diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node12).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node12).symbols deleted file mode 100644 index 734168a97f3..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node12).symbols +++ /dev/null @@ -1,15 +0,0 @@ -=== /index.ts === -/// -foo; -bar; // bar should resolve while foo should not, since index.js is cjs ->bar : Symbol(bar, Decl(require.d.ts, 2, 7)) - -export {}; -=== /node_modules/pkg/require.d.ts === -export {}; -declare global { ->global : Symbol(global, Decl(require.d.ts, 0, 10)) - - var bar: number; ->bar : Symbol(bar, Decl(require.d.ts, 2, 7)) -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node12).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node12).types deleted file mode 100644 index 992f05b1805..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride1(module=node12).types +++ /dev/null @@ -1,17 +0,0 @@ -=== /index.ts === -/// -foo; ->foo : any - -bar; // bar should resolve while foo should not, since index.js is cjs ->bar : number - -export {}; -=== /node_modules/pkg/require.d.ts === -export {}; -declare global { ->global : typeof global - - var bar: number; ->bar : number -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node12).errors.txt b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node12).errors.txt deleted file mode 100644 index 13991aa1353..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node12).errors.txt +++ /dev/null @@ -1,34 +0,0 @@ -/index.ts(3,1): error TS2304: Cannot find name 'bar'. - - -==== /index.ts (1 errors) ==== - /// - foo; // foo should resolve while bar should not, since index.js is esm - bar; - ~~~ -!!! error TS2304: Cannot find name 'bar'. - export {}; -==== /node_modules/pkg/package.json (0 errors) ==== - { - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } - } -==== /node_modules/pkg/import.d.ts (0 errors) ==== - export {}; - declare global { - var foo: number; - } -==== /node_modules/pkg/require.d.ts (0 errors) ==== - export {}; - declare global { - var bar: number; - } -==== /package.json (0 errors) ==== - { - "private": true, - "type": "module" - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node12).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node12).js deleted file mode 100644 index aee176689b2..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node12).js +++ /dev/null @@ -1,37 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride2.ts] //// - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } -} -//// [import.d.ts] -export {}; -declare global { - var foo: number; -} -//// [require.d.ts] -export {}; -declare global { - var bar: number; -} -//// [package.json] -{ - "private": true, - "type": "module" -} -//// [index.ts] -/// -foo; // foo should resolve while bar should not, since index.js is esm -bar; -export {}; - -//// [index.js] -/// -foo; // foo should resolve while bar should not, since index.js is esm -bar; -export {}; diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node12).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node12).symbols deleted file mode 100644 index babba09bdf8..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node12).symbols +++ /dev/null @@ -1,15 +0,0 @@ -=== /index.ts === -/// -foo; // foo should resolve while bar should not, since index.js is esm ->foo : Symbol(foo, Decl(import.d.ts, 2, 7)) - -bar; -export {}; -=== /node_modules/pkg/import.d.ts === -export {}; -declare global { ->global : Symbol(global, Decl(import.d.ts, 0, 10)) - - var foo: number; ->foo : Symbol(foo, Decl(import.d.ts, 2, 7)) -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node12).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node12).types deleted file mode 100644 index baabb036278..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride2(module=node12).types +++ /dev/null @@ -1,17 +0,0 @@ -=== /index.ts === -/// -foo; // foo should resolve while bar should not, since index.js is esm ->foo : number - -bar; ->bar : any - -export {}; -=== /node_modules/pkg/import.d.ts === -export {}; -declare global { ->global : typeof global - - var foo: number; ->foo : number -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node12).errors.txt b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node12).errors.txt deleted file mode 100644 index 477d247984d..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node12).errors.txt +++ /dev/null @@ -1,34 +0,0 @@ -/index.ts(2,1): error TS2304: Cannot find name 'foo'. - - -==== /index.ts (1 errors) ==== - /// - foo; - ~~~ -!!! error TS2304: Cannot find name 'foo'. - bar; // bar should resolve while foo should not, since even though index.js is esm, the reference is cjs - export {}; -==== /node_modules/pkg/package.json (0 errors) ==== - { - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } - } -==== /node_modules/pkg/import.d.ts (0 errors) ==== - export {}; - declare global { - var foo: number; - } -==== /node_modules/pkg/require.d.ts (0 errors) ==== - export {}; - declare global { - var bar: number; - } -==== /package.json (0 errors) ==== - { - "private": true, - "type": "module" - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node12).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node12).js deleted file mode 100644 index c6806f897de..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node12).js +++ /dev/null @@ -1,37 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride3.ts] //// - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } -} -//// [import.d.ts] -export {}; -declare global { - var foo: number; -} -//// [require.d.ts] -export {}; -declare global { - var bar: number; -} -//// [package.json] -{ - "private": true, - "type": "module" -} -//// [index.ts] -/// -foo; -bar; // bar should resolve while foo should not, since even though index.js is esm, the reference is cjs -export {}; - -//// [index.js] -/// -foo; -bar; // bar should resolve while foo should not, since even though index.js is esm, the reference is cjs -export {}; diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node12).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node12).symbols deleted file mode 100644 index dd4f1ee4370..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node12).symbols +++ /dev/null @@ -1,15 +0,0 @@ -=== /index.ts === -/// -foo; -bar; // bar should resolve while foo should not, since even though index.js is esm, the reference is cjs ->bar : Symbol(bar, Decl(require.d.ts, 2, 7)) - -export {}; -=== /node_modules/pkg/require.d.ts === -export {}; -declare global { ->global : Symbol(global, Decl(require.d.ts, 0, 10)) - - var bar: number; ->bar : Symbol(bar, Decl(require.d.ts, 2, 7)) -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node12).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node12).types deleted file mode 100644 index 296d29ee050..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride3(module=node12).types +++ /dev/null @@ -1,17 +0,0 @@ -=== /index.ts === -/// -foo; ->foo : any - -bar; // bar should resolve while foo should not, since even though index.js is esm, the reference is cjs ->bar : number - -export {}; -=== /node_modules/pkg/require.d.ts === -export {}; -declare global { ->global : typeof global - - var bar: number; ->bar : number -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node12).errors.txt b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node12).errors.txt deleted file mode 100644 index 3d7f07f2775..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node12).errors.txt +++ /dev/null @@ -1,29 +0,0 @@ -/index.ts(3,1): error TS2304: Cannot find name 'bar'. - - -==== /index.ts (1 errors) ==== - /// - foo; // foo should resolve while bar should not, since even though index.js is cjs, the refernce is esm - bar; - ~~~ -!!! error TS2304: Cannot find name 'bar'. - export {}; -==== /node_modules/pkg/package.json (0 errors) ==== - { - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } - } -==== /node_modules/pkg/import.d.ts (0 errors) ==== - export {}; - declare global { - var foo: number; - } -==== /node_modules/pkg/require.d.ts (0 errors) ==== - export {}; - declare global { - var bar: number; - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node12).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node12).js deleted file mode 100644 index 74346916b26..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node12).js +++ /dev/null @@ -1,33 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride4.ts] //// - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } -} -//// [import.d.ts] -export {}; -declare global { - var foo: number; -} -//// [require.d.ts] -export {}; -declare global { - var bar: number; -} -//// [index.ts] -/// -foo; // foo should resolve while bar should not, since even though index.js is cjs, the refernce is esm -bar; -export {}; - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/// -foo; // foo should resolve while bar should not, since even though index.js is cjs, the refernce is esm -bar; diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node12).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node12).symbols deleted file mode 100644 index c6420dbbea7..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node12).symbols +++ /dev/null @@ -1,15 +0,0 @@ -=== /index.ts === -/// -foo; // foo should resolve while bar should not, since even though index.js is cjs, the refernce is esm ->foo : Symbol(foo, Decl(import.d.ts, 2, 7)) - -bar; -export {}; -=== /node_modules/pkg/import.d.ts === -export {}; -declare global { ->global : Symbol(global, Decl(import.d.ts, 0, 10)) - - var foo: number; ->foo : Symbol(foo, Decl(import.d.ts, 2, 7)) -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node12).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node12).types deleted file mode 100644 index eb9b906744a..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride4(module=node12).types +++ /dev/null @@ -1,17 +0,0 @@ -=== /index.ts === -/// -foo; // foo should resolve while bar should not, since even though index.js is cjs, the refernce is esm ->foo : number - -bar; ->bar : any - -export {}; -=== /node_modules/pkg/import.d.ts === -export {}; -declare global { ->global : typeof global - - var foo: number; ->foo : number -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node12).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node12).js deleted file mode 100644 index 0c37dc00e4d..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node12).js +++ /dev/null @@ -1,39 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride5.ts] //// - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } -} -//// [import.d.ts] -export {}; -declare global { - var foo: number; -} -//// [require.d.ts] -export {}; -declare global { - var bar: number; -} -//// [index.ts] -/// -/// -// Both `foo` and `bar` should resolve, as _both_ entrypoints are included by the two -// references above. -foo; -bar; -export {}; - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/// -/// -// Both `foo` and `bar` should resolve, as _both_ entrypoints are included by the two -// references above. -foo; -bar; diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node12).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node12).symbols deleted file mode 100644 index 0dc4119ca97..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node12).symbols +++ /dev/null @@ -1,28 +0,0 @@ -=== /index.ts === -/// -/// -// Both `foo` and `bar` should resolve, as _both_ entrypoints are included by the two -// references above. -foo; ->foo : Symbol(foo, Decl(import.d.ts, 2, 7)) - -bar; ->bar : Symbol(bar, Decl(require.d.ts, 2, 7)) - -export {}; -=== /node_modules/pkg/import.d.ts === -export {}; -declare global { ->global : Symbol(global, Decl(import.d.ts, 0, 10)) - - var foo: number; ->foo : Symbol(foo, Decl(import.d.ts, 2, 7)) -} -=== /node_modules/pkg/require.d.ts === -export {}; -declare global { ->global : Symbol(global, Decl(require.d.ts, 0, 10)) - - var bar: number; ->bar : Symbol(bar, Decl(require.d.ts, 2, 7)) -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node12).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node12).types deleted file mode 100644 index 047cef77a49..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverride5(module=node12).types +++ /dev/null @@ -1,28 +0,0 @@ -=== /index.ts === -/// -/// -// Both `foo` and `bar` should resolve, as _both_ entrypoints are included by the two -// references above. -foo; ->foo : number - -bar; ->bar : number - -export {}; -=== /node_modules/pkg/import.d.ts === -export {}; -declare global { ->global : typeof global - - var foo: number; ->foo : number -} -=== /node_modules/pkg/require.d.ts === -export {}; -declare global { ->global : typeof global - - var bar: number; ->bar : number -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node12).errors.txt b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node12).errors.txt deleted file mode 100644 index 68be0baf515..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node12).errors.txt +++ /dev/null @@ -1,32 +0,0 @@ -/index.ts(1,23): error TS1453: `resolution-mode` should be either `require` or `import`. -/index.ts(2,1): error TS2304: Cannot find name 'foo'. - - -==== /index.ts (2 errors) ==== - /// - ~~~ -!!! error TS1453: `resolution-mode` should be either `require` or `import`. - foo; // bad resolution mode, which resolves is arbitrary - ~~~ -!!! error TS2304: Cannot find name 'foo'. - bar; - export {}; -==== /node_modules/pkg/package.json (0 errors) ==== - { - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } - } -==== /node_modules/pkg/import.d.ts (0 errors) ==== - export {}; - declare global { - var foo: number; - } -==== /node_modules/pkg/require.d.ts (0 errors) ==== - export {}; - declare global { - var bar: number; - } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node12).js b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node12).js deleted file mode 100644 index 09540ae8aba..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node12).js +++ /dev/null @@ -1,33 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverrideModeError.ts] //// - -//// [package.json] -{ - "name": "pkg", - "version": "0.0.1", - "exports": { - "import": "./import.js", - "require": "./require.js" - } -} -//// [import.d.ts] -export {}; -declare global { - var foo: number; -} -//// [require.d.ts] -export {}; -declare global { - var bar: number; -} -//// [index.ts] -/// -foo; // bad resolution mode, which resolves is arbitrary -bar; -export {}; - -//// [index.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/// -foo; // bad resolution mode, which resolves is arbitrary -bar; diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node12).symbols b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node12).symbols deleted file mode 100644 index 0b19a6c5440..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node12).symbols +++ /dev/null @@ -1,15 +0,0 @@ -=== /index.ts === -/// -foo; // bad resolution mode, which resolves is arbitrary -bar; ->bar : Symbol(bar, Decl(require.d.ts, 2, 7)) - -export {}; -=== /node_modules/pkg/require.d.ts === -export {}; -declare global { ->global : Symbol(global, Decl(require.d.ts, 0, 10)) - - var bar: number; ->bar : Symbol(bar, Decl(require.d.ts, 2, 7)) -} diff --git a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node12).types b/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node12).types deleted file mode 100644 index 4f97b44ffc8..00000000000 --- a/tests/baselines/reference/nodeModulesTripleSlashReferenceModeOverrideModeError(module=node12).types +++ /dev/null @@ -1,17 +0,0 @@ -=== /index.ts === -/// -foo; // bad resolution mode, which resolves is arbitrary ->foo : any - -bar; ->bar : number - -export {}; -=== /node_modules/pkg/require.d.ts === -export {}; -declare global { ->global : typeof global - - var bar: number; ->bar : number -} diff --git a/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node12).js b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node12).js deleted file mode 100644 index 1553828a6ae..00000000000 --- a/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node12).js +++ /dev/null @@ -1,98 +0,0 @@ -//// [tests/cases/conformance/node/nodeModulesTypesVersionPackageExports.ts] //// - -//// [index.ts] -// esm format file -import * as mod from "inner"; -mod.correctVersionApplied; - -//// [index.mts] -// esm format file -import * as mod from "inner"; -mod.correctVersionApplied; - -//// [index.cts] -// cjs format file -import * as mod from "inner"; -mod.correctVersionApplied; - -//// [index.d.ts] -// cjs format file -export const noConditionsApplied = true; -//// [index.d.mts] -// esm format file -export const importConditionApplied = true; -//// [index.d.cts] -// cjs format file -export const wrongConditionApplied = true; -//// [old-types.d.ts] -export const noVersionApplied = true; -//// [new-types.d.ts] -export const correctVersionApplied = true; -//// [future-types.d.ts] -export const futureVersionApplied = true; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module", -} -//// [package.json] -{ - "name": "inner", - "private": true, - "exports": { - ".": { - "types@>=10000": "./future-types.d.ts", - "types@>=1": "./new-types.d.ts", - "types": "./old-types.d.ts", - "import": "./index.mjs", - "node": "./index.js" - }, - } -} - -//// [index.js] -// esm format file -import * as mod from "inner"; -mod.correctVersionApplied; -//// [index.mjs] -// esm format file -import * as mod from "inner"; -mod.correctVersionApplied; -//// [index.cjs] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// cjs format file -const mod = __importStar(require("inner")); -mod.correctVersionApplied; - - -//// [index.d.ts] -export {}; -//// [index.d.mts] -export {}; -//// [index.d.cts] -export {}; diff --git a/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node12).symbols b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node12).symbols deleted file mode 100644 index 19b9d0e40d9..00000000000 --- a/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node12).symbols +++ /dev/null @@ -1,57 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import * as mod from "inner"; ->mod : Symbol(mod, Decl(index.ts, 1, 6)) - -mod.correctVersionApplied; ->mod.correctVersionApplied : Symbol(correctVersionApplied, Decl(new-types.d.ts, 0, 12)) ->mod : Symbol(mod, Decl(index.ts, 1, 6)) ->correctVersionApplied : Symbol(correctVersionApplied, Decl(new-types.d.ts, 0, 12)) - -=== tests/cases/conformance/node/index.mts === -// esm format file -import * as mod from "inner"; ->mod : Symbol(mod, Decl(index.mts, 1, 6)) - -mod.correctVersionApplied; ->mod.correctVersionApplied : Symbol(correctVersionApplied, Decl(new-types.d.ts, 0, 12)) ->mod : Symbol(mod, Decl(index.mts, 1, 6)) ->correctVersionApplied : Symbol(correctVersionApplied, Decl(new-types.d.ts, 0, 12)) - -=== tests/cases/conformance/node/index.cts === -// cjs format file -import * as mod from "inner"; ->mod : Symbol(mod, Decl(index.cts, 1, 6)) - -mod.correctVersionApplied; ->mod.correctVersionApplied : Symbol(mod.correctVersionApplied, Decl(new-types.d.ts, 0, 12)) ->mod : Symbol(mod, Decl(index.cts, 1, 6)) ->correctVersionApplied : Symbol(mod.correctVersionApplied, Decl(new-types.d.ts, 0, 12)) - -=== tests/cases/conformance/node/node_modules/inner/index.d.ts === -// cjs format file -export const noConditionsApplied = true; ->noConditionsApplied : Symbol(noConditionsApplied, Decl(index.d.ts, 1, 12)) - -=== tests/cases/conformance/node/node_modules/inner/index.d.mts === -// esm format file -export const importConditionApplied = true; ->importConditionApplied : Symbol(importConditionApplied, Decl(index.d.mts, 1, 12)) - -=== tests/cases/conformance/node/node_modules/inner/index.d.cts === -// cjs format file -export const wrongConditionApplied = true; ->wrongConditionApplied : Symbol(wrongConditionApplied, Decl(index.d.cts, 1, 12)) - -=== tests/cases/conformance/node/node_modules/inner/old-types.d.ts === -export const noVersionApplied = true; ->noVersionApplied : Symbol(noVersionApplied, Decl(old-types.d.ts, 0, 12)) - -=== tests/cases/conformance/node/node_modules/inner/new-types.d.ts === -export const correctVersionApplied = true; ->correctVersionApplied : Symbol(correctVersionApplied, Decl(new-types.d.ts, 0, 12)) - -=== tests/cases/conformance/node/node_modules/inner/future-types.d.ts === -export const futureVersionApplied = true; ->futureVersionApplied : Symbol(futureVersionApplied, Decl(future-types.d.ts, 0, 12)) - diff --git a/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node12).types b/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node12).types deleted file mode 100644 index fe286fd6674..00000000000 --- a/tests/baselines/reference/nodeModulesTypesVersionPackageExports(module=node12).types +++ /dev/null @@ -1,63 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import * as mod from "inner"; ->mod : typeof mod - -mod.correctVersionApplied; ->mod.correctVersionApplied : true ->mod : typeof mod ->correctVersionApplied : true - -=== tests/cases/conformance/node/index.mts === -// esm format file -import * as mod from "inner"; ->mod : typeof mod - -mod.correctVersionApplied; ->mod.correctVersionApplied : true ->mod : typeof mod ->correctVersionApplied : true - -=== tests/cases/conformance/node/index.cts === -// cjs format file -import * as mod from "inner"; ->mod : typeof mod - -mod.correctVersionApplied; ->mod.correctVersionApplied : true ->mod : typeof mod ->correctVersionApplied : true - -=== tests/cases/conformance/node/node_modules/inner/index.d.ts === -// cjs format file -export const noConditionsApplied = true; ->noConditionsApplied : true ->true : true - -=== tests/cases/conformance/node/node_modules/inner/index.d.mts === -// esm format file -export const importConditionApplied = true; ->importConditionApplied : true ->true : true - -=== tests/cases/conformance/node/node_modules/inner/index.d.cts === -// cjs format file -export const wrongConditionApplied = true; ->wrongConditionApplied : true ->true : true - -=== tests/cases/conformance/node/node_modules/inner/old-types.d.ts === -export const noVersionApplied = true; ->noVersionApplied : true ->true : true - -=== tests/cases/conformance/node/node_modules/inner/new-types.d.ts === -export const correctVersionApplied = true; ->correctVersionApplied : true ->true : true - -=== tests/cases/conformance/node/node_modules/inner/future-types.d.ts === -export const futureVersionApplied = true; ->futureVersionApplied : true ->true : true - diff --git a/tests/baselines/reference/nodePackageSelfName(module=node12).errors.txt b/tests/baselines/reference/nodePackageSelfName(module=node12).errors.txt deleted file mode 100644 index c1573b8f51d..00000000000 --- a/tests/baselines/reference/nodePackageSelfName(module=node12).errors.txt +++ /dev/null @@ -1,24 +0,0 @@ -tests/cases/conformance/node/index.cts(2,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - - -==== tests/cases/conformance/node/index.ts (0 errors) ==== - // esm format file - import * as self from "package"; - self; -==== tests/cases/conformance/node/index.mts (0 errors) ==== - // esm format file - import * as self from "package"; - self; -==== tests/cases/conformance/node/index.cts (1 errors) ==== - // esm format file - import * as self from "package"; - ~~~~~~~~~ -!!! error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - self; -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "package", - "private": true, - "type": "module", - "exports": "./index.js" - } \ No newline at end of file diff --git a/tests/baselines/reference/nodePackageSelfName(module=node12).js b/tests/baselines/reference/nodePackageSelfName(module=node12).js deleted file mode 100644 index 7061f58c6bb..00000000000 --- a/tests/baselines/reference/nodePackageSelfName(module=node12).js +++ /dev/null @@ -1,67 +0,0 @@ -//// [tests/cases/conformance/node/nodePackageSelfName.ts] //// - -//// [index.ts] -// esm format file -import * as self from "package"; -self; -//// [index.mts] -// esm format file -import * as self from "package"; -self; -//// [index.cts] -// esm format file -import * as self from "package"; -self; -//// [package.json] -{ - "name": "package", - "private": true, - "type": "module", - "exports": "./index.js" -} - -//// [index.js] -// esm format file -import * as self from "package"; -self; -//// [index.mjs] -// esm format file -import * as self from "package"; -self; -//// [index.cjs] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// esm format file -const self = __importStar(require("package")); -self; - - -//// [index.d.ts] -export {}; -//// [index.d.mts] -export {}; -//// [index.d.cts] -export {}; diff --git a/tests/baselines/reference/nodePackageSelfName(module=node12).symbols b/tests/baselines/reference/nodePackageSelfName(module=node12).symbols deleted file mode 100644 index 44b9566b90c..00000000000 --- a/tests/baselines/reference/nodePackageSelfName(module=node12).symbols +++ /dev/null @@ -1,24 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import * as self from "package"; ->self : Symbol(self, Decl(index.ts, 1, 6)) - -self; ->self : Symbol(self, Decl(index.ts, 1, 6)) - -=== tests/cases/conformance/node/index.mts === -// esm format file -import * as self from "package"; ->self : Symbol(self, Decl(index.mts, 1, 6)) - -self; ->self : Symbol(self, Decl(index.mts, 1, 6)) - -=== tests/cases/conformance/node/index.cts === -// esm format file -import * as self from "package"; ->self : Symbol(self, Decl(index.cts, 1, 6)) - -self; ->self : Symbol(self, Decl(index.cts, 1, 6)) - diff --git a/tests/baselines/reference/nodePackageSelfName(module=node12).types b/tests/baselines/reference/nodePackageSelfName(module=node12).types deleted file mode 100644 index b41eef255ab..00000000000 --- a/tests/baselines/reference/nodePackageSelfName(module=node12).types +++ /dev/null @@ -1,24 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import * as self from "package"; ->self : typeof self - -self; ->self : typeof self - -=== tests/cases/conformance/node/index.mts === -// esm format file -import * as self from "package"; ->self : typeof self - -self; ->self : typeof self - -=== tests/cases/conformance/node/index.cts === -// esm format file -import * as self from "package"; ->self : typeof self - -self; ->self : typeof self - diff --git a/tests/baselines/reference/nodePackageSelfNameScoped(module=node12).errors.txt b/tests/baselines/reference/nodePackageSelfNameScoped(module=node12).errors.txt deleted file mode 100644 index b2a9f313de7..00000000000 --- a/tests/baselines/reference/nodePackageSelfNameScoped(module=node12).errors.txt +++ /dev/null @@ -1,24 +0,0 @@ -tests/cases/conformance/node/index.cts(2,23): error TS1471: Module '@scope/package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - - -==== tests/cases/conformance/node/index.ts (0 errors) ==== - // esm format file - import * as self from "@scope/package"; - self; -==== tests/cases/conformance/node/index.mts (0 errors) ==== - // esm format file - import * as self from "@scope/package"; - self; -==== tests/cases/conformance/node/index.cts (1 errors) ==== - // cjs format file - import * as self from "@scope/package"; - ~~~~~~~~~~~~~~~~ -!!! error TS1471: Module '@scope/package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. - self; -==== tests/cases/conformance/node/package.json (0 errors) ==== - { - "name": "@scope/package", - "private": true, - "type": "module", - "exports": "./index.js" - } \ No newline at end of file diff --git a/tests/baselines/reference/nodePackageSelfNameScoped(module=node12).js b/tests/baselines/reference/nodePackageSelfNameScoped(module=node12).js deleted file mode 100644 index 8738c8041a9..00000000000 --- a/tests/baselines/reference/nodePackageSelfNameScoped(module=node12).js +++ /dev/null @@ -1,67 +0,0 @@ -//// [tests/cases/conformance/node/nodePackageSelfNameScoped.ts] //// - -//// [index.ts] -// esm format file -import * as self from "@scope/package"; -self; -//// [index.mts] -// esm format file -import * as self from "@scope/package"; -self; -//// [index.cts] -// cjs format file -import * as self from "@scope/package"; -self; -//// [package.json] -{ - "name": "@scope/package", - "private": true, - "type": "module", - "exports": "./index.js" -} - -//// [index.js] -// esm format file -import * as self from "@scope/package"; -self; -//// [index.mjs] -// esm format file -import * as self from "@scope/package"; -self; -//// [index.cjs] -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// cjs format file -const self = __importStar(require("@scope/package")); -self; - - -//// [index.d.ts] -export {}; -//// [index.d.mts] -export {}; -//// [index.d.cts] -export {}; diff --git a/tests/baselines/reference/nodePackageSelfNameScoped(module=node12).symbols b/tests/baselines/reference/nodePackageSelfNameScoped(module=node12).symbols deleted file mode 100644 index e54b0cb667a..00000000000 --- a/tests/baselines/reference/nodePackageSelfNameScoped(module=node12).symbols +++ /dev/null @@ -1,24 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import * as self from "@scope/package"; ->self : Symbol(self, Decl(index.ts, 1, 6)) - -self; ->self : Symbol(self, Decl(index.ts, 1, 6)) - -=== tests/cases/conformance/node/index.mts === -// esm format file -import * as self from "@scope/package"; ->self : Symbol(self, Decl(index.mts, 1, 6)) - -self; ->self : Symbol(self, Decl(index.mts, 1, 6)) - -=== tests/cases/conformance/node/index.cts === -// cjs format file -import * as self from "@scope/package"; ->self : Symbol(self, Decl(index.cts, 1, 6)) - -self; ->self : Symbol(self, Decl(index.cts, 1, 6)) - diff --git a/tests/baselines/reference/nodePackageSelfNameScoped(module=node12).types b/tests/baselines/reference/nodePackageSelfNameScoped(module=node12).types deleted file mode 100644 index 3e5c141f63f..00000000000 --- a/tests/baselines/reference/nodePackageSelfNameScoped(module=node12).types +++ /dev/null @@ -1,24 +0,0 @@ -=== tests/cases/conformance/node/index.ts === -// esm format file -import * as self from "@scope/package"; ->self : typeof self - -self; ->self : typeof self - -=== tests/cases/conformance/node/index.mts === -// esm format file -import * as self from "@scope/package"; ->self : typeof self - -self; ->self : typeof self - -=== tests/cases/conformance/node/index.cts === -// cjs format file -import * as self from "@scope/package"; ->self : typeof self - -self; ->self : typeof self - diff --git a/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).errors.txt b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).errors.txt deleted file mode 100644 index 179a40218dc..00000000000 --- a/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).errors.txt +++ /dev/null @@ -1,17 +0,0 @@ -tests/cases/compiler/usage.ts(1,23): error TS2688: Cannot find type definition file for 'pkg'. - - -==== tests/cases/compiler/node_modules/pkg/index.d.ts (0 errors) ==== - interface GlobalThing { a: number } -==== tests/cases/compiler/node_modules/pkg/package.json (0 errors) ==== - { - "name": "pkg", - "types": "index.d.ts", - "exports": "some-other-thing.js" - } -==== tests/cases/compiler/usage.ts (1 errors) ==== - /// - ~~~ -!!! error TS2688: Cannot find type definition file for 'pkg'. - - const a: GlobalThing = { a: 0 }; \ No newline at end of file diff --git a/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).js b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).js deleted file mode 100644 index 89dd2c7541a..00000000000 --- a/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).js +++ /dev/null @@ -1,18 +0,0 @@ -//// [tests/cases/compiler/tripleSlashTypesReferenceWithMissingExports.ts] //// - -//// [index.d.ts] -interface GlobalThing { a: number } -//// [package.json] -{ - "name": "pkg", - "types": "index.d.ts", - "exports": "some-other-thing.js" -} -//// [usage.ts] -/// - -const a: GlobalThing = { a: 0 }; - -//// [usage.js] -/// -const a = { a: 0 }; diff --git a/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).symbols b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).symbols deleted file mode 100644 index b97c41025fe..00000000000 --- a/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).symbols +++ /dev/null @@ -1,13 +0,0 @@ -=== tests/cases/compiler/node_modules/pkg/index.d.ts === -interface GlobalThing { a: number } ->GlobalThing : Symbol(GlobalThing, Decl(index.d.ts, 0, 0)) ->a : Symbol(GlobalThing.a, Decl(index.d.ts, 0, 23)) - -=== tests/cases/compiler/usage.ts === -/// - -const a: GlobalThing = { a: 0 }; ->a : Symbol(a, Decl(usage.ts, 2, 5)) ->GlobalThing : Symbol(GlobalThing, Decl(index.d.ts, 0, 0)) ->a : Symbol(a, Decl(usage.ts, 2, 24)) - diff --git a/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).types b/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).types deleted file mode 100644 index b107f91dcb2..00000000000 --- a/tests/baselines/reference/tripleSlashTypesReferenceWithMissingExports(module=node12).types +++ /dev/null @@ -1,13 +0,0 @@ -=== tests/cases/compiler/node_modules/pkg/index.d.ts === -interface GlobalThing { a: number } ->a : number - -=== tests/cases/compiler/usage.ts === -/// - -const a: GlobalThing = { a: 0 }; ->a : GlobalThing ->{ a: 0 } : { a: number; } ->a : number ->0 : 0 - From 1e157ef1b21e47a7b13ac0437cd034e428f1e2aa Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 5 May 2022 11:45:05 -0700 Subject: [PATCH 59/63] Fix node16 tests (#48974) --- .../unittests/tsbuild/moduleResolution.ts | 2 +- .../unittests/tsbuild/moduleSpecifiers.ts | 2 +- ...fiers-across-projects-resolve-correctly.js | 317 ++++++++++- ...t-correctly-with-cts-and-mts-extensions.js | 526 ++++++++++++++++-- 4 files changed, 766 insertions(+), 81 deletions(-) diff --git a/src/testRunner/unittests/tsbuild/moduleResolution.ts b/src/testRunner/unittests/tsbuild/moduleResolution.ts index 1a6a72fcb23..10508b92404 100644 --- a/src/testRunner/unittests/tsbuild/moduleResolution.ts +++ b/src/testRunner/unittests/tsbuild/moduleResolution.ts @@ -126,7 +126,7 @@ namespace ts.tscWatch { path: `${projectRoot}/node_modules/pkg2`, symLink: `${projectRoot}/packages/pkg2`, }, - { ...libFile, path: `/a/lib/lib.es2020.full.d.ts` } + { ...libFile, path: `/a/lib/lib.es2022.full.d.ts` } ], { currentDirectory: projectRoot }), commandLineArgs: ["-b", "packages/pkg1", "-w", "--verbose", "--traceResolution"], changes: [ diff --git a/src/testRunner/unittests/tsbuild/moduleSpecifiers.ts b/src/testRunner/unittests/tsbuild/moduleSpecifiers.ts index 19b47f2eb83..d8caa8997e7 100644 --- a/src/testRunner/unittests/tsbuild/moduleSpecifiers.ts +++ b/src/testRunner/unittests/tsbuild/moduleSpecifiers.ts @@ -178,7 +178,7 @@ namespace ts { }`, }, ""), modifyFs: fs => { - fs.writeFileSync("/lib/lib.es2020.full.d.ts", tscWatch.libFile.content); + fs.writeFileSync("/lib/lib.es2022.full.d.ts", tscWatch.libFile.content); fs.symlinkSync("/src", "/src/src-types/node_modules"); fs.symlinkSync("/src", "/src/src-dogs/node_modules"); }, diff --git a/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-across-projects-resolve-correctly.js b/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-across-projects-resolve-correctly.js index fad710005a0..0f60bb939b0 100644 --- a/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-across-projects-resolve-correctly.js +++ b/tests/baselines/reference/tsbuild/moduleSpecifiers/synthesized-module-specifiers-across-projects-resolve-correctly.js @@ -14,7 +14,7 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/lib/lib.es2020.full.d.ts] +//// [/lib/lib.es2022.full.d.ts] /// interface Boolean {} interface Function {} @@ -134,33 +134,296 @@ Output:: [12:00:26 AM] Building project '/src/src-types/tsconfig.json'... -error TS6053: File '/lib/lib.es2022.full.d.ts' not found. - The file is in the program because: - Default library for target 'es2022' +[12:00:33 AM] Project 'src/src-dogs/tsconfig.json' is out of date because output file 'src/src-dogs/dog.js' does not exist -error TS2318: Cannot find global type 'Array'. +[12:00:34 AM] Building project '/src/src-dogs/tsconfig.json'... -error TS2318: Cannot find global type 'Boolean'. - -error TS2318: Cannot find global type 'Function'. - -error TS2318: Cannot find global type 'IArguments'. - -error TS2318: Cannot find global type 'Number'. - -error TS2318: Cannot find global type 'Object'. - -error TS2318: Cannot find global type 'RegExp'. - -error TS2318: Cannot find global type 'String'. - -[12:00:27 AM] Project 'src/src-dogs/tsconfig.json' can't be built because its dependency 'src/src-types' has errors - -[12:00:28 AM] Skipping build of project '/src/src-dogs/tsconfig.json' because its dependency '/src/src-types' has errors - - -Found 9 errors. - -exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +exitCode:: ExitStatus.Success +//// [/src/src-dogs/dog.d.ts] +import { DogConfig } from 'src-types'; +export declare abstract class Dog { + static getCapabilities(): DogConfig; +} + + +//// [/src/src-dogs/dog.js] +import { DOG_CONFIG } from './dogconfig.js'; +export class Dog { + static getCapabilities() { + return DOG_CONFIG; + } +} + + +//// [/src/src-dogs/dogconfig.d.ts] +import { DogConfig } from 'src-types'; +export declare const DOG_CONFIG: DogConfig; + + +//// [/src/src-dogs/dogconfig.js] +export const DOG_CONFIG = { + name: 'Default dog', +}; + + +//// [/src/src-dogs/index.d.ts] +export * from 'src-types'; +export * from './lassie/lassiedog.js'; + + +//// [/src/src-dogs/index.js] +export * from 'src-types'; +export * from './lassie/lassiedog.js'; + + +//// [/src/src-dogs/lassie/lassieconfig.d.ts] +import { DogConfig } from 'src-types'; +export declare const LASSIE_CONFIG: DogConfig; + + +//// [/src/src-dogs/lassie/lassieconfig.js] +export const LASSIE_CONFIG = { name: 'Lassie' }; + + +//// [/src/src-dogs/lassie/lassiedog.d.ts] +import { Dog } from '../dog.js'; +export declare class LassieDog extends Dog { + protected static getDogConfig: () => import("../index.js").DogConfig; +} + + +//// [/src/src-dogs/lassie/lassiedog.js] +import { Dog } from '../dog.js'; +import { LASSIE_CONFIG } from './lassieconfig.js'; +export class LassieDog extends Dog { + static getDogConfig = () => LASSIE_CONFIG; +} + + +//// [/src/src-dogs/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.es2022.full.d.ts","../src-types/dogconfig.d.ts","../src-types/index.d.ts","./dogconfig.ts","./dog.ts","./lassie/lassieconfig.ts","./lassie/lassiedog.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true,"impliedFormat":1},{"version":"-2632060142-export interface DogConfig {\r\n name: string;\r\n}\r\n","impliedFormat":99},{"version":"-5608794531-export * from './dogconfig.js';\r\n","impliedFormat":99},{"version":"1966273863-import { DogConfig } from 'src-types';\n\nexport const DOG_CONFIG: DogConfig = {\n name: 'Default dog',\n};\n","signature":"17588480778-import { DogConfig } from 'src-types';\r\nexport declare const DOG_CONFIG: DogConfig;\r\n","impliedFormat":99},{"version":"6091345804-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}\n","signature":"22128633249-import { DogConfig } from 'src-types';\r\nexport declare abstract class Dog {\r\n static getCapabilities(): DogConfig;\r\n}\r\n","impliedFormat":99},{"version":"4440579024-import { DogConfig } from 'src-types';\n\nexport const LASSIE_CONFIG: DogConfig = { name: 'Lassie' };\n","signature":"8131483665-import { DogConfig } from 'src-types';\r\nexport declare const LASSIE_CONFIG: DogConfig;\r\n","impliedFormat":99},{"version":"-32303727812-import { Dog } from '../dog.js';\nimport { LASSIE_CONFIG } from './lassieconfig.js';\n\nexport class LassieDog extends Dog {\n protected static getDogConfig = () => LASSIE_CONFIG;\n}\n","signature":"-20244062422-import { Dog } from '../dog.js';\r\nexport declare class LassieDog extends Dog {\r\n protected static getDogConfig: () => import(\"../index.js\").DogConfig;\r\n}\r\n","impliedFormat":99},{"version":"-15974991320-export * from 'src-types';\nexport * from './lassie/lassiedog.js';\n","signature":"-16783836862-export * from 'src-types';\r\nexport * from './lassie/lassiedog.js';\r\n","impliedFormat":99}],"options":{"composite":true,"declaration":true,"module":100},"fileIdsList":[[3,4],[3],[3,7],[5,6],[2],[5,8]],"referencedMap":[[5,1],[4,2],[8,3],[6,2],[7,4],[3,5]],"exportedModulesMap":[[5,2],[4,2],[8,3],[6,2],[7,6],[3,5]],"semanticDiagnosticsPerFile":[1,5,4,8,6,7,2,3]},"version":"FakeTSVersion"} + +//// [/src/src-dogs/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.es2022.full.d.ts", + "../src-types/dogconfig.d.ts", + "../src-types/index.d.ts", + "./dogconfig.ts", + "./dog.ts", + "./lassie/lassieconfig.ts", + "./lassie/lassiedog.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "../src-types/index.d.ts", + "./dogconfig.ts" + ], + [ + "../src-types/index.d.ts" + ], + [ + "../src-types/index.d.ts", + "./lassie/lassiedog.ts" + ], + [ + "./dog.ts", + "./lassie/lassieconfig.ts" + ], + [ + "../src-types/dogconfig.d.ts" + ], + [ + "./dog.ts", + "./index.ts" + ] + ], + "fileInfos": { + "../../lib/lib.es2022.full.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true, + "impliedFormat": 1 + }, + "../src-types/dogconfig.d.ts": { + "version": "-2632060142-export interface DogConfig {\r\n name: string;\r\n}\r\n", + "signature": "-2632060142-export interface DogConfig {\r\n name: string;\r\n}\r\n", + "impliedFormat": 99 + }, + "../src-types/index.d.ts": { + "version": "-5608794531-export * from './dogconfig.js';\r\n", + "signature": "-5608794531-export * from './dogconfig.js';\r\n", + "impliedFormat": 99 + }, + "./dogconfig.ts": { + "version": "1966273863-import { DogConfig } from 'src-types';\n\nexport const DOG_CONFIG: DogConfig = {\n name: 'Default dog',\n};\n", + "signature": "17588480778-import { DogConfig } from 'src-types';\r\nexport declare const DOG_CONFIG: DogConfig;\r\n", + "impliedFormat": 99 + }, + "./dog.ts": { + "version": "6091345804-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}\n", + "signature": "22128633249-import { DogConfig } from 'src-types';\r\nexport declare abstract class Dog {\r\n static getCapabilities(): DogConfig;\r\n}\r\n", + "impliedFormat": 99 + }, + "./lassie/lassieconfig.ts": { + "version": "4440579024-import { DogConfig } from 'src-types';\n\nexport const LASSIE_CONFIG: DogConfig = { name: 'Lassie' };\n", + "signature": "8131483665-import { DogConfig } from 'src-types';\r\nexport declare const LASSIE_CONFIG: DogConfig;\r\n", + "impliedFormat": 99 + }, + "./lassie/lassiedog.ts": { + "version": "-32303727812-import { Dog } from '../dog.js';\nimport { LASSIE_CONFIG } from './lassieconfig.js';\n\nexport class LassieDog extends Dog {\n protected static getDogConfig = () => LASSIE_CONFIG;\n}\n", + "signature": "-20244062422-import { Dog } from '../dog.js';\r\nexport declare class LassieDog extends Dog {\r\n protected static getDogConfig: () => import(\"../index.js\").DogConfig;\r\n}\r\n", + "impliedFormat": 99 + }, + "./index.ts": { + "version": "-15974991320-export * from 'src-types';\nexport * from './lassie/lassiedog.js';\n", + "signature": "-16783836862-export * from 'src-types';\r\nexport * from './lassie/lassiedog.js';\r\n", + "impliedFormat": 99 + } + }, + "options": { + "composite": true, + "declaration": true, + "module": 100 + }, + "referencedMap": { + "./dog.ts": [ + "../src-types/index.d.ts", + "./dogconfig.ts" + ], + "./dogconfig.ts": [ + "../src-types/index.d.ts" + ], + "./index.ts": [ + "../src-types/index.d.ts", + "./lassie/lassiedog.ts" + ], + "./lassie/lassieconfig.ts": [ + "../src-types/index.d.ts" + ], + "./lassie/lassiedog.ts": [ + "./dog.ts", + "./lassie/lassieconfig.ts" + ], + "../src-types/index.d.ts": [ + "../src-types/dogconfig.d.ts" + ] + }, + "exportedModulesMap": { + "./dog.ts": [ + "../src-types/index.d.ts" + ], + "./dogconfig.ts": [ + "../src-types/index.d.ts" + ], + "./index.ts": [ + "../src-types/index.d.ts", + "./lassie/lassiedog.ts" + ], + "./lassie/lassieconfig.ts": [ + "../src-types/index.d.ts" + ], + "./lassie/lassiedog.ts": [ + "./dog.ts", + "./index.ts" + ], + "../src-types/index.d.ts": [ + "../src-types/dogconfig.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.es2022.full.d.ts", + "./dog.ts", + "./dogconfig.ts", + "./index.ts", + "./lassie/lassieconfig.ts", + "./lassie/lassiedog.ts", + "../src-types/dogconfig.d.ts", + "../src-types/index.d.ts" + ] + }, + "version": "FakeTSVersion", + "size": 2712 +} + +//// [/src/src-types/dogconfig.d.ts] +export interface DogConfig { + name: string; +} + + +//// [/src/src-types/dogconfig.js] +export {}; + + +//// [/src/src-types/index.d.ts] +export * from './dogconfig.js'; + + +//// [/src/src-types/index.js] +export * from './dogconfig.js'; + + +//// [/src/src-types/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../lib/lib.es2022.full.d.ts","./dogconfig.ts","./index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true,"impliedFormat":1},{"version":"-5575793279-export interface DogConfig {\n name: string;\n}","signature":"-2632060142-export interface DogConfig {\r\n name: string;\r\n}\r\n","impliedFormat":99},{"version":"-6189272282-export * from './dogconfig.js';","signature":"-5608794531-export * from './dogconfig.js';\r\n","impliedFormat":99}],"options":{"composite":true,"declaration":true,"module":100},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} + +//// [/src/src-types/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../lib/lib.es2022.full.d.ts", + "./dogconfig.ts", + "./index.ts" + ], + "fileNamesList": [ + [ + "./dogconfig.ts" + ] + ], + "fileInfos": { + "../../lib/lib.es2022.full.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true, + "impliedFormat": 1 + }, + "./dogconfig.ts": { + "version": "-5575793279-export interface DogConfig {\n name: string;\n}", + "signature": "-2632060142-export interface DogConfig {\r\n name: string;\r\n}\r\n", + "impliedFormat": 99 + }, + "./index.ts": { + "version": "-6189272282-export * from './dogconfig.js';", + "signature": "-5608794531-export * from './dogconfig.js';\r\n", + "impliedFormat": 99 + } + }, + "options": { + "composite": true, + "declaration": true, + "module": 100 + }, + "referencedMap": { + "./index.ts": [ + "./dogconfig.ts" + ] + }, + "exportedModulesMap": { + "./index.ts": [ + "./dogconfig.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../lib/lib.es2022.full.d.ts", + "./dogconfig.ts", + "./index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1038 +} + diff --git a/tests/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js b/tests/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js index bc78d10564f..69047ec74b8 100644 --- a/tests/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js +++ b/tests/baselines/reference/tsbuildWatch/moduleResolution/resolves-specifier-in-output-declaration-file-from-referenced-project-correctly-with-cts-and-mts-extensions.js @@ -22,7 +22,7 @@ export type { TheNum } from './const.cjs'; {"name":"pkg2","version":"1.0.0","main":"build/index.js","type":"module"} //// [/user/username/projects/myproject/node_modules/pkg2] symlink(/user/username/projects/myproject/packages/pkg2) -//// [/a/lib/lib.es2020.full.d.ts] +//// [/a/lib/lib.es2022.full.d.ts] /// interface Boolean {} interface Function {} @@ -60,31 +60,46 @@ File '/user/username/projects/myproject/packages/pkg2/const.cts' exist - use it File '/a/lib/package.json' does not exist. File '/a/package.json' does not exist. File '/package.json' does not exist. -error TS6053: File '/a/lib/lib.es2022.full.d.ts' not found. - The file is in the program because: - Default library for target 'es2022' +[12:01:00 AM] Project 'packages/pkg1/tsconfig.json' is out of date because output file 'packages/pkg1/build/index.js' does not exist -error TS2318: Cannot find global type 'Array'. +[12:01:01 AM] Building project '/user/username/projects/myproject/packages/pkg1/tsconfig.json'... -error TS2318: Cannot find global type 'Boolean'. - -error TS2318: Cannot find global type 'Function'. - -error TS2318: Cannot find global type 'IArguments'. - -error TS2318: Cannot find global type 'Number'. - -error TS2318: Cannot find global type 'Object'. - -error TS2318: Cannot find global type 'RegExp'. - -error TS2318: Cannot find global type 'String'. - -[12:00:45 AM] Project 'packages/pkg1/tsconfig.json' can't be built because its dependency 'packages/pkg2' has errors - -[12:00:46 AM] Skipping build of project '/user/username/projects/myproject/packages/pkg1/tsconfig.json' because its dependency '/user/username/projects/myproject/packages/pkg2' has errors - -[12:00:47 AM] Found 9 errors. Watching for file changes. +Found 'package.json' at '/user/username/projects/myproject/packages/pkg1/package.json'. +'package.json' does not have a 'typesVersions' field. +======== Resolving module 'pkg2' from '/user/username/projects/myproject/packages/pkg1/index.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +File '/user/username/projects/myproject/packages/pkg1/package.json' exists according to earlier cached lookups. +Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. +Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. +Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. +Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' exist - use it as a name resolution result. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has an unsupported extension, so skipping it. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file type 'TypeScript'. +File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts' exist - use it as a name resolution result. +Resolving real path for '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts', result '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. +======== Module name 'pkg2' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/index.d.ts' with Package ID 'pkg2/build/index.d.ts@1.0.0'. ======== +File '/user/username/projects/myproject/packages/pkg2/build/package.json' does not exist. +File '/user/username/projects/myproject/packages/pkg2/package.json' exists according to earlier cached lookups. +======== Resolving module './const.cjs' from '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. ======== +Using compiler options of project reference redirect '/user/username/projects/myproject/packages/pkg2/tsconfig.json'. +Module resolution kind is not specified, using 'Node16'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.cjs', target file type 'TypeScript'. +File name '/user/username/projects/myproject/packages/pkg2/build/const.cjs' has a '.cjs' extension - stripping it. +File '/user/username/projects/myproject/packages/pkg2/build/const.cts' does not exist. +File '/user/username/projects/myproject/packages/pkg2/build/const.d.cts' exist - use it as a name resolution result. +======== Module name './const.cjs' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/const.d.cts'. ======== +File '/a/lib/package.json' does not exist according to earlier cached lookups. +File '/a/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +[12:01:07 AM] Found 0 errors. Watching for file changes. @@ -92,12 +107,40 @@ Program root files: ["/user/username/projects/myproject/packages/pkg2/const.cts" Program options: {"composite":true,"outDir":"/user/username/projects/myproject/packages/pkg2/build","module":100,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/packages/pkg2/tsconfig.json"} Program structureReused: Not Program files:: +/a/lib/lib.es2022.full.d.ts /user/username/projects/myproject/packages/pkg2/const.cts /user/username/projects/myproject/packages/pkg2/index.ts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.es2022.full.d.ts +/user/username/projects/myproject/packages/pkg2/const.cts +/user/username/projects/myproject/packages/pkg2/index.ts -No shapes updated in the builder:: +Shape signatures in builder refreshed for:: +/a/lib/lib.es2022.full.d.ts (used version) +/user/username/projects/myproject/packages/pkg2/const.cts (computed .d.ts during emit) +/user/username/projects/myproject/packages/pkg2/index.ts (computed .d.ts during emit) + +Program root files: ["/user/username/projects/myproject/packages/pkg1/index.ts"] +Program options: {"outDir":"/user/username/projects/myproject/packages/pkg1/build","module":100,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/packages/pkg1/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.es2022.full.d.ts +/user/username/projects/myproject/packages/pkg2/build/const.d.cts +/user/username/projects/myproject/packages/pkg2/build/index.d.ts +/user/username/projects/myproject/packages/pkg1/index.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.es2022.full.d.ts +/user/username/projects/myproject/packages/pkg2/build/const.d.cts +/user/username/projects/myproject/packages/pkg2/build/index.d.ts +/user/username/projects/myproject/packages/pkg1/index.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.es2022.full.d.ts (used version) +/user/username/projects/myproject/packages/pkg2/build/const.d.cts (used version) +/user/username/projects/myproject/packages/pkg2/build/index.d.ts (used version) +/user/username/projects/myproject/packages/pkg1/index.ts (used version) WatchedFiles:: /user/username/projects/myproject/packages/pkg2/tsconfig.json: @@ -108,16 +151,24 @@ WatchedFiles:: {"fileName":"/user/username/projects/myproject/packages/pkg2/index.ts","pollingInterval":250} /user/username/projects/myproject/packages/pkg2/package.json: {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} + {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} /a/lib/package.json: {"fileName":"/a/lib/package.json","pollingInterval":250} + {"fileName":"/a/lib/package.json","pollingInterval":250} /a/package.json: {"fileName":"/a/package.json","pollingInterval":250} + {"fileName":"/a/package.json","pollingInterval":250} /package.json: {"fileName":"/package.json","pollingInterval":250} + {"fileName":"/package.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/tsconfig.json: {"fileName":"/user/username/projects/myproject/packages/pkg1/tsconfig.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/index.ts: {"fileName":"/user/username/projects/myproject/packages/pkg1/index.ts","pollingInterval":250} +/user/username/projects/myproject/packages/pkg1/package.json: + {"fileName":"/user/username/projects/myproject/packages/pkg1/package.json","pollingInterval":250} +/user/username/projects/myproject/packages/pkg2/build/package.json: + {"fileName":"/user/username/projects/myproject/packages/pkg2/build/package.json","pollingInterval":250} FsWatches:: @@ -129,6 +180,86 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/packages/pkg2/build/const.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/user/username/projects/myproject/packages/pkg2/build/const.d.cts] +export declare type TheNum = 42; + + +//// [/user/username/projects/myproject/packages/pkg2/build/index.js] +export {}; + + +//// [/user/username/projects/myproject/packages/pkg2/build/index.d.ts] +export type { TheNum } from './const.cjs'; + + +//// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../../../../../../a/lib/lib.es2022.full.d.ts","../const.cts","../index.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true,"impliedFormat":1},{"version":"-11202312776-export type TheNum = 42;","signature":"-9649133742-export declare type TheNum = 42;\n","impliedFormat":1},{"version":"-9668872159-export type { TheNum } from './const.cjs';","signature":"-9835135925-export type { TheNum } from './const.cjs';\n","impliedFormat":99}],"options":{"composite":true,"module":100,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} + +//// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../../../a/lib/lib.es2022.full.d.ts", + "../const.cts", + "../index.ts" + ], + "fileNamesList": [ + [ + "../const.cts" + ] + ], + "fileInfos": { + "../../../../../../../a/lib/lib.es2022.full.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true, + "impliedFormat": 1 + }, + "../const.cts": { + "version": "-11202312776-export type TheNum = 42;", + "signature": "-9649133742-export declare type TheNum = 42;\n", + "impliedFormat": 1 + }, + "../index.ts": { + "version": "-9668872159-export type { TheNum } from './const.cjs';", + "signature": "-9835135925-export type { TheNum } from './const.cjs';\n", + "impliedFormat": 99 + } + }, + "options": { + "composite": true, + "module": 100, + "outDir": "./" + }, + "referencedMap": { + "../index.ts": [ + "../const.cts" + ] + }, + "exportedModulesMap": { + "../index.ts": [ + "../const.cts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../../../a/lib/lib.es2022.full.d.ts", + "../const.cts", + "../index.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1019 +} + +//// [/user/username/projects/myproject/packages/pkg1/build/index.js] +export const theNum = 42; + + Change:: reports import errors after change to package file @@ -138,6 +269,78 @@ Input:: Output:: +>> Screen clear +[12:01:11 AM] File change detected. Starting incremental compilation... + +[12:01:12 AM] Project 'packages/pkg1/tsconfig.json' is out of date because oldest output 'packages/pkg1/build/index.js' is older than newest input 'packages/pkg2' + +[12:01:13 AM] Building project '/user/username/projects/myproject/packages/pkg1/tsconfig.json'... + +Found 'package.json' at '/user/username/projects/myproject/packages/pkg1/package.json'. +'package.json' does not have a 'typesVersions' field. +======== Resolving module 'pkg2' from '/user/username/projects/myproject/packages/pkg1/index.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +File '/user/username/projects/myproject/packages/pkg1/package.json' exists according to earlier cached lookups. +Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. +Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. +Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. +Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. +'package.json' does not have a 'typesVersions' field. +File '/user/username/projects/myproject/node_modules/pkg2.ts' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2.tsx' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' exist - use it as a name resolution result. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has an unsupported extension, so skipping it. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file type 'TypeScript'. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.ts' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.tsx' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.d.ts' does not exist. +File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts' exist - use it as a name resolution result. +Resolving real path for '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts', result '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. +======== Module name 'pkg2' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/index.d.ts' with Package ID 'pkg2/build/index.d.ts@1.0.0'. ======== +File '/user/username/projects/myproject/packages/pkg2/build/package.json' does not exist. +Found 'package.json' at '/user/username/projects/myproject/packages/pkg2/package.json'. +'package.json' does not have a 'typesVersions' field. +======== Resolving module './const.cjs' from '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. ======== +Using compiler options of project reference redirect '/user/username/projects/myproject/packages/pkg2/tsconfig.json'. +Module resolution kind is not specified, using 'Node16'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.cjs', target file type 'TypeScript'. +File name '/user/username/projects/myproject/packages/pkg2/build/const.cjs' has a '.cjs' extension - stripping it. +File '/user/username/projects/myproject/packages/pkg2/build/const.cts' does not exist. +File '/user/username/projects/myproject/packages/pkg2/build/const.d.cts' exist - use it as a name resolution result. +======== Module name './const.cjs' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/const.d.cts'. ======== +File '/a/lib/package.json' does not exist. +File '/a/package.json' does not exist. +File '/package.json' does not exist. +packages/pkg1/index.ts:1:29 - error TS1471: Module 'pkg2' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + +1 import type { TheNum } from 'pkg2' +   ~~~~~~ + +[12:01:14 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/packages/pkg1/index.ts"] +Program options: {"outDir":"/user/username/projects/myproject/packages/pkg1/build","module":100,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/packages/pkg1/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.es2022.full.d.ts +/user/username/projects/myproject/packages/pkg2/build/const.d.cts +/user/username/projects/myproject/packages/pkg2/build/index.d.ts +/user/username/projects/myproject/packages/pkg1/index.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/myproject/packages/pkg1/index.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/myproject/packages/pkg1/index.ts (computed .d.ts) WatchedFiles:: /user/username/projects/myproject/packages/pkg2/tsconfig.json: @@ -148,16 +351,24 @@ WatchedFiles:: {"fileName":"/user/username/projects/myproject/packages/pkg2/index.ts","pollingInterval":250} /user/username/projects/myproject/packages/pkg2/package.json: {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} + {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} /a/lib/package.json: {"fileName":"/a/lib/package.json","pollingInterval":250} + {"fileName":"/a/lib/package.json","pollingInterval":250} /a/package.json: {"fileName":"/a/package.json","pollingInterval":250} + {"fileName":"/a/package.json","pollingInterval":250} /package.json: {"fileName":"/package.json","pollingInterval":250} + {"fileName":"/package.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/tsconfig.json: {"fileName":"/user/username/projects/myproject/packages/pkg1/tsconfig.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/index.ts: {"fileName":"/user/username/projects/myproject/packages/pkg1/index.ts","pollingInterval":250} +/user/username/projects/myproject/packages/pkg1/package.json: + {"fileName":"/user/username/projects/myproject/packages/pkg1/package.json","pollingInterval":250} +/user/username/projects/myproject/packages/pkg2/build/package.json: + {"fileName":"/user/username/projects/myproject/packages/pkg2/build/package.json","pollingInterval":250} FsWatches:: @@ -178,6 +389,67 @@ Input:: Output:: +>> Screen clear +[12:01:18 AM] File change detected. Starting incremental compilation... + +[12:01:19 AM] Project 'packages/pkg1/tsconfig.json' is out of date because oldest output 'packages/pkg1/build/index.js' is older than newest input 'packages/pkg2' + +[12:01:20 AM] Building project '/user/username/projects/myproject/packages/pkg1/tsconfig.json'... + +Found 'package.json' at '/user/username/projects/myproject/packages/pkg1/package.json'. +'package.json' does not have a 'typesVersions' field. +======== Resolving module 'pkg2' from '/user/username/projects/myproject/packages/pkg1/index.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +File '/user/username/projects/myproject/packages/pkg1/package.json' exists according to earlier cached lookups. +Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. +Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. +Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. +Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. +'package.json' does not have a 'typesVersions' field. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' exist - use it as a name resolution result. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has an unsupported extension, so skipping it. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file type 'TypeScript'. +File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts' exist - use it as a name resolution result. +Resolving real path for '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts', result '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. +======== Module name 'pkg2' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/index.d.ts' with Package ID 'pkg2/build/index.d.ts@1.0.0'. ======== +File '/user/username/projects/myproject/packages/pkg2/build/package.json' does not exist. +Found 'package.json' at '/user/username/projects/myproject/packages/pkg2/package.json'. +'package.json' does not have a 'typesVersions' field. +======== Resolving module './const.cjs' from '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. ======== +Using compiler options of project reference redirect '/user/username/projects/myproject/packages/pkg2/tsconfig.json'. +Module resolution kind is not specified, using 'Node16'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.cjs', target file type 'TypeScript'. +File name '/user/username/projects/myproject/packages/pkg2/build/const.cjs' has a '.cjs' extension - stripping it. +File '/user/username/projects/myproject/packages/pkg2/build/const.cts' does not exist. +File '/user/username/projects/myproject/packages/pkg2/build/const.d.cts' exist - use it as a name resolution result. +======== Module name './const.cjs' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/const.d.cts'. ======== +File '/a/lib/package.json' does not exist. +File '/a/package.json' does not exist. +File '/package.json' does not exist. +[12:01:24 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/packages/pkg1/index.ts"] +Program options: {"outDir":"/user/username/projects/myproject/packages/pkg1/build","module":100,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/packages/pkg1/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.es2022.full.d.ts +/user/username/projects/myproject/packages/pkg2/build/const.d.cts +/user/username/projects/myproject/packages/pkg2/build/index.d.ts +/user/username/projects/myproject/packages/pkg1/index.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/myproject/packages/pkg1/index.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/myproject/packages/pkg1/index.ts (computed .d.ts) WatchedFiles:: /user/username/projects/myproject/packages/pkg2/tsconfig.json: @@ -188,16 +460,24 @@ WatchedFiles:: {"fileName":"/user/username/projects/myproject/packages/pkg2/index.ts","pollingInterval":250} /user/username/projects/myproject/packages/pkg2/package.json: {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} + {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} /a/lib/package.json: {"fileName":"/a/lib/package.json","pollingInterval":250} + {"fileName":"/a/lib/package.json","pollingInterval":250} /a/package.json: {"fileName":"/a/package.json","pollingInterval":250} + {"fileName":"/a/package.json","pollingInterval":250} /package.json: {"fileName":"/package.json","pollingInterval":250} + {"fileName":"/package.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/tsconfig.json: {"fileName":"/user/username/projects/myproject/packages/pkg1/tsconfig.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/index.ts: {"fileName":"/user/username/projects/myproject/packages/pkg1/index.ts","pollingInterval":250} +/user/username/projects/myproject/packages/pkg1/package.json: + {"fileName":"/user/username/projects/myproject/packages/pkg1/package.json","pollingInterval":250} +/user/username/projects/myproject/packages/pkg2/build/package.json: + {"fileName":"/user/username/projects/myproject/packages/pkg2/build/package.json","pollingInterval":250} FsWatches:: @@ -209,6 +489,7 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/packages/pkg1/build/index.js] file written with same contents Change:: reports import errors after change to package file @@ -218,6 +499,78 @@ Input:: Output:: +>> Screen clear +[12:01:28 AM] File change detected. Starting incremental compilation... + +[12:01:29 AM] Project 'packages/pkg1/tsconfig.json' is out of date because oldest output 'packages/pkg1/build/index.js' is older than newest input 'packages/pkg2' + +[12:01:30 AM] Building project '/user/username/projects/myproject/packages/pkg1/tsconfig.json'... + +Found 'package.json' at '/user/username/projects/myproject/packages/pkg1/package.json'. +'package.json' does not have a 'typesVersions' field. +======== Resolving module 'pkg2' from '/user/username/projects/myproject/packages/pkg1/index.ts'. ======== +Module resolution kind is not specified, using 'Node16'. +File '/user/username/projects/myproject/packages/pkg1/package.json' exists according to earlier cached lookups. +Loading module 'pkg2' from 'node_modules' folder, target file type 'TypeScript'. +Directory '/user/username/projects/myproject/packages/pkg1/node_modules' does not exist, skipping all lookups in it. +Directory '/user/username/projects/myproject/packages/node_modules' does not exist, skipping all lookups in it. +Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg2/package.json'. +'package.json' does not have a 'typesVersions' field. +File '/user/username/projects/myproject/node_modules/pkg2.ts' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2.tsx' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2.d.ts' does not exist. +'package.json' does not have a 'typings' field. +'package.json' does not have a 'types' field. +'package.json' has 'main' field 'build/index.js' that references '/user/username/projects/myproject/node_modules/pkg2/build/index.js'. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' exist - use it as a name resolution result. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has an unsupported extension, so skipping it. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/node_modules/pkg2/build/index.js', target file type 'TypeScript'. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.ts' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.tsx' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.js.d.ts' does not exist. +File name '/user/username/projects/myproject/node_modules/pkg2/build/index.js' has a '.js' extension - stripping it. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.ts' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.tsx' does not exist. +File '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts' exist - use it as a name resolution result. +Resolving real path for '/user/username/projects/myproject/node_modules/pkg2/build/index.d.ts', result '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. +======== Module name 'pkg2' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/index.d.ts' with Package ID 'pkg2/build/index.d.ts@1.0.0'. ======== +File '/user/username/projects/myproject/packages/pkg2/build/package.json' does not exist. +Found 'package.json' at '/user/username/projects/myproject/packages/pkg2/package.json'. +'package.json' does not have a 'typesVersions' field. +======== Resolving module './const.cjs' from '/user/username/projects/myproject/packages/pkg2/build/index.d.ts'. ======== +Using compiler options of project reference redirect '/user/username/projects/myproject/packages/pkg2/tsconfig.json'. +Module resolution kind is not specified, using 'Node16'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/packages/pkg2/build/const.cjs', target file type 'TypeScript'. +File name '/user/username/projects/myproject/packages/pkg2/build/const.cjs' has a '.cjs' extension - stripping it. +File '/user/username/projects/myproject/packages/pkg2/build/const.cts' does not exist. +File '/user/username/projects/myproject/packages/pkg2/build/const.d.cts' exist - use it as a name resolution result. +======== Module name './const.cjs' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/const.d.cts'. ======== +File '/a/lib/package.json' does not exist. +File '/a/package.json' does not exist. +File '/package.json' does not exist. +packages/pkg1/index.ts:1:29 - error TS1471: Module 'pkg2' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. + +1 import type { TheNum } from 'pkg2' +   ~~~~~~ + +[12:01:31 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/packages/pkg1/index.ts"] +Program options: {"outDir":"/user/username/projects/myproject/packages/pkg1/build","module":100,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/packages/pkg1/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.es2022.full.d.ts +/user/username/projects/myproject/packages/pkg2/build/const.d.cts +/user/username/projects/myproject/packages/pkg2/build/index.d.ts +/user/username/projects/myproject/packages/pkg1/index.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/myproject/packages/pkg1/index.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/myproject/packages/pkg1/index.ts (computed .d.ts) WatchedFiles:: /user/username/projects/myproject/packages/pkg2/tsconfig.json: @@ -228,16 +581,24 @@ WatchedFiles:: {"fileName":"/user/username/projects/myproject/packages/pkg2/index.ts","pollingInterval":250} /user/username/projects/myproject/packages/pkg2/package.json: {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} + {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} /a/lib/package.json: {"fileName":"/a/lib/package.json","pollingInterval":250} + {"fileName":"/a/lib/package.json","pollingInterval":250} /a/package.json: {"fileName":"/a/package.json","pollingInterval":250} + {"fileName":"/a/package.json","pollingInterval":250} /package.json: {"fileName":"/package.json","pollingInterval":250} + {"fileName":"/package.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/tsconfig.json: {"fileName":"/user/username/projects/myproject/packages/pkg1/tsconfig.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/index.ts: {"fileName":"/user/username/projects/myproject/packages/pkg1/index.ts","pollingInterval":250} +/user/username/projects/myproject/packages/pkg1/package.json: + {"fileName":"/user/username/projects/myproject/packages/pkg1/package.json","pollingInterval":250} +/user/username/projects/myproject/packages/pkg2/build/package.json: + {"fileName":"/user/username/projects/myproject/packages/pkg2/build/package.json","pollingInterval":250} FsWatches:: @@ -263,11 +624,11 @@ export type { TheNum } from './const.cjs'; Output:: >> Screen clear -[12:01:03 AM] File change detected. Starting incremental compilation... +[12:01:38 AM] File change detected. Starting incremental compilation... -[12:01:04 AM] Project 'packages/pkg2/tsconfig.json' is out of date because output file 'packages/pkg2/build/const.cjs' does not exist +[12:01:39 AM] Project 'packages/pkg2/tsconfig.json' is out of date because oldest output 'packages/pkg2/build/const.cjs' is older than newest input 'packages/pkg2/index.cts' -[12:01:05 AM] Building project '/user/username/projects/myproject/packages/pkg2/tsconfig.json'... +[12:01:40 AM] Building project '/user/username/projects/myproject/packages/pkg2/tsconfig.json'... ======== Resolving module './const.cjs' from '/user/username/projects/myproject/packages/pkg2/index.cts'. ======== Module resolution kind is not specified, using 'Node16'. @@ -281,27 +642,7 @@ File '/user/username/projects/myproject/packages/pkg2/const.cts' exist - use it File '/a/lib/package.json' does not exist. File '/a/package.json' does not exist. File '/package.json' does not exist. -error TS6053: File '/a/lib/lib.es2022.full.d.ts' not found. - The file is in the program because: - Default library for target 'es2022' - -error TS2318: Cannot find global type 'Array'. - -error TS2318: Cannot find global type 'Boolean'. - -error TS2318: Cannot find global type 'Function'. - -error TS2318: Cannot find global type 'IArguments'. - -error TS2318: Cannot find global type 'Number'. - -error TS2318: Cannot find global type 'Object'. - -error TS2318: Cannot find global type 'RegExp'. - -error TS2318: Cannot find global type 'String'. - -[12:01:06 AM] Found 9 errors. Watching for file changes. +[12:01:49 AM] Updating unchanged output timestamps of project '/user/username/projects/myproject/packages/pkg2/tsconfig.json'... @@ -309,12 +650,15 @@ Program root files: ["/user/username/projects/myproject/packages/pkg2/const.cts" Program options: {"composite":true,"outDir":"/user/username/projects/myproject/packages/pkg2/build","module":100,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/packages/pkg2/tsconfig.json"} Program structureReused: Not Program files:: +/a/lib/lib.es2022.full.d.ts /user/username/projects/myproject/packages/pkg2/const.cts /user/username/projects/myproject/packages/pkg2/index.cts -No cached semantic diagnostics in the builder:: +Semantic diagnostics in builder refreshed for:: +/user/username/projects/myproject/packages/pkg2/index.cts -No shapes updated in the builder:: +Shape signatures in builder refreshed for:: +/user/username/projects/myproject/packages/pkg2/index.cts (computed .d.ts) WatchedFiles:: /user/username/projects/myproject/packages/pkg2/tsconfig.json: @@ -323,16 +667,24 @@ WatchedFiles:: {"fileName":"/user/username/projects/myproject/packages/pkg2/const.cts","pollingInterval":250} /user/username/projects/myproject/packages/pkg2/package.json: {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} + {"fileName":"/user/username/projects/myproject/packages/pkg2/package.json","pollingInterval":250} /a/lib/package.json: {"fileName":"/a/lib/package.json","pollingInterval":250} + {"fileName":"/a/lib/package.json","pollingInterval":250} /a/package.json: {"fileName":"/a/package.json","pollingInterval":250} + {"fileName":"/a/package.json","pollingInterval":250} /package.json: {"fileName":"/package.json","pollingInterval":250} + {"fileName":"/package.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/tsconfig.json: {"fileName":"/user/username/projects/myproject/packages/pkg1/tsconfig.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg1/index.ts: {"fileName":"/user/username/projects/myproject/packages/pkg1/index.ts","pollingInterval":250} +/user/username/projects/myproject/packages/pkg1/package.json: + {"fileName":"/user/username/projects/myproject/packages/pkg1/package.json","pollingInterval":250} +/user/username/projects/myproject/packages/pkg2/build/package.json: + {"fileName":"/user/username/projects/myproject/packages/pkg2/build/package.json","pollingInterval":250} /user/username/projects/myproject/packages/pkg2/index.cts: {"fileName":"/user/username/projects/myproject/packages/pkg2/index.cts","pollingInterval":250} @@ -346,3 +698,73 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined +//// [/user/username/projects/myproject/packages/pkg2/build/const.cjs] file changed its modified time +//// [/user/username/projects/myproject/packages/pkg2/build/const.d.cts] file changed its modified time +//// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo] +{"program":{"fileNames":["../../../../../../../a/lib/lib.es2022.full.d.ts","../const.cts","../index.cts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true,"impliedFormat":1},{"version":"-11202312776-export type TheNum = 42;","signature":"-9649133742-export declare type TheNum = 42;\n","impliedFormat":1},{"version":"-9668872159-export type { TheNum } from './const.cjs';","signature":"-9835135925-export type { TheNum } from './const.cjs';\n","impliedFormat":1}],"options":{"composite":true,"module":100,"outDir":"./"},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[[3,1]],"semanticDiagnosticsPerFile":[1,2,3]},"version":"FakeTSVersion"} + +//// [/user/username/projects/myproject/packages/pkg2/build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "program": { + "fileNames": [ + "../../../../../../../a/lib/lib.es2022.full.d.ts", + "../const.cts", + "../index.cts" + ], + "fileNamesList": [ + [ + "../const.cts" + ] + ], + "fileInfos": { + "../../../../../../../a/lib/lib.es2022.full.d.ts": { + "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", + "affectsGlobalScope": true, + "impliedFormat": 1 + }, + "../const.cts": { + "version": "-11202312776-export type TheNum = 42;", + "signature": "-9649133742-export declare type TheNum = 42;\n", + "impliedFormat": 1 + }, + "../index.cts": { + "version": "-9668872159-export type { TheNum } from './const.cjs';", + "signature": "-9835135925-export type { TheNum } from './const.cjs';\n", + "impliedFormat": 1 + } + }, + "options": { + "composite": true, + "module": 100, + "outDir": "./" + }, + "referencedMap": { + "../index.cts": [ + "../const.cts" + ] + }, + "exportedModulesMap": { + "../index.cts": [ + "../const.cts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../../../../../../../a/lib/lib.es2022.full.d.ts", + "../const.cts", + "../index.cts" + ] + }, + "version": "FakeTSVersion", + "size": 1019 +} + +//// [/user/username/projects/myproject/packages/pkg2/build/index.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/user/username/projects/myproject/packages/pkg2/build/index.d.cts] +export type { TheNum } from './const.cjs'; + + From 8e433cda3dcdcd337eab0030942728536780ea8e Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 5 May 2022 12:53:56 -0700 Subject: [PATCH 60/63] Allow export map entries to remap back to input files for a program (#47925) * Allow export map entries to remap back to input files for a program * Fix file casing issues on windows * Implement abiguity error, doesnt quite work * Refine selection logic in error case to use getCommonSourceDirectory, add more tests --- src/compiler/diagnosticMessages.json | 9 + src/compiler/moduleNameResolver.ts | 182 ++++++++++++++++-- src/compiler/program.ts | 31 +++ src/compiler/types.ts | 4 + src/compiler/utilities.ts | 10 + src/testRunner/unittests/moduleResolution.ts | 6 + ...sPackageSelfName(module=node16).errors.txt | 2 + ...ackageSelfName(module=nodenext).errors.txt | 2 + ...alPackageExports(module=node16).errors.txt | 2 + ...PackageExports(module=nodenext).errors.txt | 2 + ...JsPackageExports(module=node16).errors.txt | 2 + ...PackageExports(module=nodenext).errors.txt | 2 + ...JsPackageImports(module=node16).errors.txt | 2 + ...PackageImports(module=nodenext).errors.txt | 2 + ...alPackageExports(module=node16).errors.txt | 2 + ...PackageExports(module=nodenext).errors.txt | 2 + ...thPackageExports(module=node16).errors.txt | 2 + ...PackageExports(module=nodenext).errors.txt | 2 + ...esPackageExports(module=node16).errors.txt | 2 + ...PackageExports(module=nodenext).errors.txt | 2 + .../nodeNextPackageImportMapRootDir.js | 25 +++ .../nodeNextPackageImportMapRootDir.symbols | 12 ++ .../nodeNextPackageImportMapRootDir.types | 13 ++ ...deNextPackageSelfNameWithOutDir.errors.txt | 19 ++ .../nodeNextPackageSelfNameWithOutDir.js | 22 +++ .../nodeNextPackageSelfNameWithOutDir.symbols | 12 ++ .../nodeNextPackageSelfNameWithOutDir.types | 13 ++ ...ackageSelfNameWithOutDirDeclDir.errors.txt | 22 +++ ...odeNextPackageSelfNameWithOutDirDeclDir.js | 29 +++ ...xtPackageSelfNameWithOutDirDeclDir.symbols | 12 ++ ...NextPackageSelfNameWithOutDirDeclDir.types | 13 ++ ...ckageSelfNameWithOutDirDeclDirComposite.js | 29 +++ ...SelfNameWithOutDirDeclDirComposite.symbols | 12 ++ ...geSelfNameWithOutDirDeclDirComposite.types | 13 ++ ...ameWithOutDirDeclDirCompositeNestedDirs.js | 46 +++++ ...thOutDirDeclDirCompositeNestedDirs.symbols | 25 +++ ...WithOutDirDeclDirCompositeNestedDirs.types | 26 +++ ...NameWithOutDirDeclDirNestedDirs.errors.txt | 41 ++++ ...kageSelfNameWithOutDirDeclDirNestedDirs.js | 46 +++++ ...elfNameWithOutDirDeclDirNestedDirs.symbols | 25 +++ ...eSelfNameWithOutDirDeclDirNestedDirs.types | 26 +++ ...PackageSelfNameWithOutDirDeclDirRootDir.js | 29 +++ ...geSelfNameWithOutDirDeclDirRootDir.symbols | 12 ++ ...kageSelfNameWithOutDirDeclDirRootDir.types | 13 ++ ...odeNextPackageSelfNameWithOutDirRootDir.js | 22 +++ ...xtPackageSelfNameWithOutDirRootDir.symbols | 12 ++ ...NextPackageSelfNameWithOutDirRootDir.types | 13 ++ .../nodeNextPackageImportMapRootDir.ts | 20 ++ .../nodeNextPackageSelfNameWithOutDir.ts | 16 ++ ...odeNextPackageSelfNameWithOutDirDeclDir.ts | 21 ++ ...ckageSelfNameWithOutDirDeclDirComposite.ts | 26 +++ ...ameWithOutDirDeclDirCompositeNestedDirs.ts | 37 ++++ ...kageSelfNameWithOutDirDeclDirNestedDirs.ts | 37 ++++ ...PackageSelfNameWithOutDirDeclDirRootDir.ts | 22 +++ ...odeNextPackageSelfNameWithOutDirRootDir.ts | 17 ++ 55 files changed, 1035 insertions(+), 13 deletions(-) create mode 100644 tests/baselines/reference/nodeNextPackageImportMapRootDir.js create mode 100644 tests/baselines/reference/nodeNextPackageImportMapRootDir.symbols create mode 100644 tests/baselines/reference/nodeNextPackageImportMapRootDir.types create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDir.errors.txt create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDir.js create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDir.symbols create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDir.types create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDir.errors.txt create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDir.js create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDir.symbols create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDir.types create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirComposite.js create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirComposite.symbols create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirComposite.types create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.js create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.symbols create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.types create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.errors.txt create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.js create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.symbols create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.types create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.js create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.symbols create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.types create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDirRootDir.js create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDirRootDir.symbols create mode 100644 tests/baselines/reference/nodeNextPackageSelfNameWithOutDirRootDir.types create mode 100644 tests/cases/compiler/nodeNextPackageImportMapRootDir.ts create mode 100644 tests/cases/compiler/nodeNextPackageSelfNameWithOutDir.ts create mode 100644 tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.ts create mode 100644 tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.ts create mode 100644 tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.ts create mode 100644 tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.ts create mode 100644 tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.ts create mode 100644 tests/cases/compiler/nodeNextPackageSelfNameWithOutDirRootDir.ts diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 3e1b4a3ad2d..2382a16cf1d 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1511,6 +1511,15 @@ "code": 2207 }, + "The project root is ambiguous, but is required to resolve export map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate.": { + "category": "Error", + "code": 2209 + }, + "The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate.": { + "category": "Error", + "code": 2210 + }, + "Duplicate identifier '{0}'.": { "category": "Error", "code": 2300 diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts index 6b0664b835c..8f466c0495a 100644 --- a/src/compiler/moduleNameResolver.ts +++ b/src/compiler/moduleNameResolver.ts @@ -86,14 +86,15 @@ namespace ts { return { fileName: resolved.path, packageId: resolved.packageId }; } - function createResolvedModuleWithFailedLookupLocations(resolved: Resolved | undefined, isExternalLibraryImport: boolean | undefined, failedLookupLocations: string[], resultFromCache: ResolvedModuleWithFailedLookupLocations | undefined): ResolvedModuleWithFailedLookupLocations { + function createResolvedModuleWithFailedLookupLocations(resolved: Resolved | undefined, isExternalLibraryImport: boolean | undefined, failedLookupLocations: string[], diagnostics: Diagnostic[], resultFromCache: ResolvedModuleWithFailedLookupLocations | undefined): ResolvedModuleWithFailedLookupLocations { if (resultFromCache) { resultFromCache.failedLookupLocations.push(...failedLookupLocations); return resultFromCache; } return { resolvedModule: resolved && { resolvedFileName: resolved.path, originalPath: resolved.originalPath === true ? undefined : resolved.originalPath, extension: resolved.extension, isExternalLibraryImport, packageId: resolved.packageId }, - failedLookupLocations + failedLookupLocations, + resolutionDiagnostics: diagnostics }; } @@ -107,6 +108,8 @@ namespace ts { packageJsonInfoCache: PackageJsonInfoCache | undefined; features: NodeResolutionFeatures; conditions: string[]; + requestContainingDirectory: string | undefined; + reportDiagnostic: DiagnosticReporter; } /** Just the fields that we use for module resolution. */ @@ -354,7 +357,18 @@ namespace ts { features |= NodeResolutionFeatures.EsmMode; } const conditions = features & NodeResolutionFeatures.Exports ? features & NodeResolutionFeatures.EsmMode ? ["node", "import", "types"] : ["node", "require", "types"] : []; - const moduleResolutionState: ModuleResolutionState = { compilerOptions: options, host, traceEnabled, failedLookupLocations, packageJsonInfoCache: cache, features, conditions }; + const diagnostics: Diagnostic[] = []; + const moduleResolutionState: ModuleResolutionState = { + compilerOptions: options, + host, + traceEnabled, + failedLookupLocations, + packageJsonInfoCache: cache, + features, + conditions, + requestContainingDirectory: containingDirectory, + reportDiagnostic: diag => void diagnostics.push(diag), + }; let resolved = primaryLookup(); let primary = true; if (!resolved) { @@ -374,7 +388,7 @@ namespace ts { isExternalLibraryImport: pathContainsNodeModules(fileName), }; } - result = { resolvedTypeReferenceDirective, failedLookupLocations }; + result = { resolvedTypeReferenceDirective, failedLookupLocations, resolutionDiagnostics: diagnostics }; perFolderCache?.set(typeReferenceDirectiveName, /*mode*/ resolutionMode, result); if (traceEnabled) traceResult(result); return result; @@ -468,6 +482,8 @@ namespace ts { packageJsonInfoCache: cache?.getPackageJsonInfoCache(), conditions: emptyArray, features: NodeResolutionFeatures.None, + requestContainingDirectory: containingDirectory, + reportDiagnostic: noop }; return forEachAncestorDirectory(containingDirectory, ancestorDirectory => { @@ -1317,6 +1333,7 @@ namespace ts { conditions.pop(); } + const diagnostics: Diagnostic[] = []; const state: ModuleResolutionState = { compilerOptions, host, @@ -1325,10 +1342,12 @@ namespace ts { packageJsonInfoCache: cache, features, conditions, + requestContainingDirectory: containingDirectory, + reportDiagnostic: diag => void diagnostics.push(diag), }; const result = forEach(extensions, ext => tryResolve(ext)); - return createResolvedModuleWithFailedLookupLocations(result?.value?.resolved, result?.value?.isExternalLibraryImport, failedLookupLocations, state.resultFromCache); + return createResolvedModuleWithFailedLookupLocations(result?.value?.resolved, result?.value?.isExternalLibraryImport, failedLookupLocations, diagnostics, state.resultFromCache); function tryResolve(extensions: Extensions): SearchResult<{ resolved: Resolved, isExternalLibraryImport: boolean }> { const loader: ResolutionKindSpecificLoader = (extensions, candidate, onlyRecordFailures, state) => nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, /*considerPackageJson*/ true); @@ -1516,9 +1535,9 @@ namespace ts { } function loadJSOrExactTSFileName(extensions: Extensions, candidate: string, onlyRecordFailures: boolean, state: ModuleResolutionState): PathAndExtension | undefined { - if ((extensions === Extensions.TypeScript || extensions === Extensions.DtsOnly) && isDeclarationFileName(candidate)) { + if ((extensions === Extensions.TypeScript || extensions === Extensions.DtsOnly) && fileExtensionIsOneOf(candidate, supportedTSExtensionsFlat)) { const result = tryFile(candidate, onlyRecordFailures, state); - return result !== undefined ? { path: candidate, ext: forEach(supportedDeclarationExtensions, e => fileExtensionIs(candidate, e) ? e : undefined)! } : undefined; + return result !== undefined ? { path: candidate, ext: tryExtractTSExtension(candidate) as Extension } : undefined; } return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state); @@ -1655,6 +1674,8 @@ namespace ts { packageJsonInfoCache: cache?.getPackageJsonInfoCache(), conditions: ["node", "require", "types"], features, + requestContainingDirectory: packageJsonInfo.packageDirectory, + reportDiagnostic: noop }; const requireResolution = loadNodeModuleFromDirectoryWorker( extensions, @@ -1764,6 +1785,8 @@ namespace ts { packageJsonInfoCache: PackageJsonInfoCache | undefined; features: number; conditions: never[]; + requestContainingDirectory: string | undefined; + reportDiagnostic: DiagnosticReporter } = { host, compilerOptions: options, @@ -1772,6 +1795,8 @@ namespace ts { packageJsonInfoCache, features: 0, conditions: [], + requestContainingDirectory: undefined, + reportDiagnostic: noop }; const parts = getPathComponents(fileName); parts.pop(); @@ -2112,8 +2137,9 @@ namespace ts { } return toSearchResult(/*value*/ undefined); } - const finalPath = getNormalizedAbsolutePath(pattern ? resolvedTarget.replace(/\*/g, subpath) : resolvedTarget + subpath, state.host.getCurrentDirectory?.()); - + const finalPath = toAbsolutePath(pattern ? resolvedTarget.replace(/\*/g, subpath) : resolvedTarget + subpath); + const inputLink = tryLoadInputFileForPath(finalPath, subpath, combinePaths(scope.packageDirectory, "package.json"), isImports); + if (inputLink) return inputLink; return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, finalPath, /*onlyRecordFailures*/ false, state))); } else if (typeof target === "object" && target !== null) { // eslint-disable-line no-null/no-null @@ -2154,6 +2180,134 @@ namespace ts { trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName); } return toSearchResult(/*value*/ undefined); + + function toAbsolutePath(path: string): string; + function toAbsolutePath(path: string | undefined): string | undefined; + function toAbsolutePath(path: string | undefined): string | undefined { + if (path === undefined) return path; + return hostGetCanonicalFileName({ useCaseSensitiveFileNames })(getNormalizedAbsolutePath(path, state.host.getCurrentDirectory?.())); + } + + function combineDirectoryPath(root: string, dir: string) { + return ensureTrailingDirectorySeparator(combinePaths(root, dir)); + } + + function useCaseSensitiveFileNames() { + return !state.host.useCaseSensitiveFileNames ? true : + typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames : + state.host.useCaseSensitiveFileNames(); + } + + function tryLoadInputFileForPath(finalPath: string, entry: string, packagePath: string, isImports: boolean) { + // Replace any references to outputs for files in the program with the input files to support package self-names used with outDir + // PROBLEM: We don't know how to calculate the output paths yet, because the "common source directory" we use as the base of the file structure + // we reproduce into the output directory is based on the set of input files, which we're still in the process of traversing and resolving! + // _Given that_, we have to guess what the base of the output directory is (obviously the user wrote the export map, so has some idea what it is!). + // We are going to probe _so many_ possible paths. We limit where we'll do this to try to reduce the possibilities of false positive lookups. + if ((extensions === Extensions.TypeScript || extensions === Extensions.JavaScript || extensions === Extensions.Json) + && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) + && finalPath.indexOf("/node_modules/") === -1 + && (state.compilerOptions.configFile ? startsWith(toAbsolutePath(state.compilerOptions.configFile.fileName), scope.packageDirectory) : true) + ) { + // So that all means we'll only try these guesses for files outside `node_modules` in a directory where the `package.json` and `tsconfig.json` are siblings. + // Even with all that, we still don't know if the root of the output file structure will be (relative to the package file) + // `.`, `./src` or any other deeper directory structure. (If project references are used, it's definitely `.` by fiat, so that should be pretty common.) + + const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames }); + const commonSourceDirGuesses: string[] = []; + // A `rootDir` compiler option strongly indicates the root location + // A `composite` project is using project references and has it's common src dir set to `.`, so it shouldn't need to check any other locations + if (state.compilerOptions.rootDir || (state.compilerOptions.composite && state.compilerOptions.configFilePath)) { + const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], state.host.getCurrentDirectory?.() || "", getCanonicalFileName)); + commonSourceDirGuesses.push(commonDir); + } + else if (state.requestContainingDirectory) { + // However without either of those set we're in the dark. Let's say you have + // + // ./tools/index.ts + // ./src/index.ts + // ./dist/index.js + // ./package.json <-- references ./dist/index.js + // ./tsconfig.json <-- loads ./src/index.ts + // + // How do we know `./src` is the common src dir, and not `./tools`, given only the `./dist` out dir and `./dist/index.js` filename? + // Answer: We... don't. We know we're looking for an `index.ts` input file, but we have _no clue_ which subfolder it's supposed to be loaded from + // without more context. + // But we do have more context! Just a tiny bit more! We're resolving an import _for some other input file_! And that input file, too + // must be inside the common source directory! So we propagate that tidbit of info all the way to here via state.requestContainingDirectory + + const requestingFile = toAbsolutePath(combinePaths(state.requestContainingDirectory, "index.ts")); + // And we can try every folder above the common folder for the request folder and the config/package base directory + // This technically can be wrong - we may load ./src/index.ts when ./src/sub/index.ts was right because we don't + // know if only `./src/sub` files were loaded by the program; but this has the best chance to be right of just about anything + // else we have. And, given that we're about to load `./src/index.ts` because we choose it as likely correct, there will then + // be a file outside of `./src/sub` in the program (the file we resolved to), making us de-facto right. So this fallback lookup + // logic may influence what files are pulled in by self-names, which in turn influences the output path shape, but it's all + // internally consistent so the paths should be stable so long as we prefer the "most general" (meaning: top-most-level directory) possible results first. + const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [requestingFile, toAbsolutePath(packagePath)], state.host.getCurrentDirectory?.() || "", getCanonicalFileName)); + commonSourceDirGuesses.push(commonDir); + + let fragment = ensureTrailingDirectorySeparator(commonDir); + while (fragment && fragment.length > 1) { + const parts = getPathComponents(fragment); + parts.pop(); // remove a directory + const commonDir = getPathFromPathComponents(parts); + commonSourceDirGuesses.unshift(commonDir); + fragment = ensureTrailingDirectorySeparator(commonDir); + } + } + if (commonSourceDirGuesses.length > 1) { + state.reportDiagnostic(createCompilerDiagnostic( + isImports + ? Diagnostics.The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate + : Diagnostics.The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate, + entry === "" ? "." : entry, // replace empty string with `.` - the reverse of the operation done when entries are built - so main entrypoint errors don't look weird + packagePath + )); + } + for (const commonSourceDirGuess of commonSourceDirGuesses) { + const candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess); + for (const candidateDir of candidateDirectories) { + if (startsWith(finalPath, candidateDir)) { + // The matched export is looking up something in either the out declaration or js dir, now map the written path back into the source dir and source extension + const pathFragment = finalPath.slice(candidateDir.length + 1); // +1 to also remove directory seperator + const possibleInputBase = combinePaths(commonSourceDirGuess, pathFragment); + const jsAndDtsExtensions = [Extension.Mjs, Extension.Cjs, Extension.Js, Extension.Json, Extension.Dmts, Extension.Dcts, Extension.Dts]; + for (const ext of jsAndDtsExtensions) { + if (fileExtensionIs(possibleInputBase, ext)) { + const inputExts = getPossibleOriginalInputExtensionForExtension(possibleInputBase); + for (const possibleExt of inputExts) { + const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames()); + if ((extensions === Extensions.TypeScript && hasJSFileExtension(possibleInputWithInputExtension)) || + (extensions === Extensions.JavaScript && hasTSFileExtension(possibleInputWithInputExtension))) { + continue; + } + if (state.host.fileExists(possibleInputWithInputExtension)) { + return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, possibleInputWithInputExtension, /*onlyRecordFailures*/ false, state))); + } + } + } + } + } + } + } + } + return undefined; + + function getOutputDirectoriesForBaseDirectory(commonSourceDirGuess: string) { + // Config file ouput paths are processed to be relative to the host's current directory, while + // otherwise the paths are resolved relative to the common source dir the compiler puts together + const currentDir = state.compilerOptions.configFile ? state.host.getCurrentDirectory?.() || "" : commonSourceDirGuess; + const candidateDirectories = []; + if (state.compilerOptions.declarationDir) { + candidateDirectories.push(toAbsolutePath(combineDirectoryPath(currentDir, state.compilerOptions.declarationDir))); + } + if (state.compilerOptions.outDir && state.compilerOptions.outDir !== state.compilerOptions.declarationDir) { + candidateDirectories.push(toAbsolutePath(combineDirectoryPath(currentDir, state.compilerOptions.outDir))); + } + return candidateDirectories; + } + } } } @@ -2374,12 +2528,13 @@ namespace ts { export function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations { const traceEnabled = isTraceEnabled(compilerOptions, host); const failedLookupLocations: string[] = []; - const state: ModuleResolutionState = { compilerOptions, host, traceEnabled, failedLookupLocations, packageJsonInfoCache: cache, features: NodeResolutionFeatures.None, conditions: [] }; const containingDirectory = getDirectoryPath(containingFile); + const diagnostics: Diagnostic[] = []; + const state: ModuleResolutionState = { compilerOptions, host, traceEnabled, failedLookupLocations, packageJsonInfoCache: cache, features: NodeResolutionFeatures.None, conditions: [], requestContainingDirectory: containingDirectory, reportDiagnostic: diag => void diagnostics.push(diag) }; const resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); // No originalPath because classic resolution doesn't resolve realPath - return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations, state.resultFromCache); + return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations, diagnostics, state.resultFromCache); function tryResolve(extensions: Extensions): SearchResult { const resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, state); @@ -2424,9 +2579,10 @@ namespace ts { trace(host, Diagnostics.Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2, projectName, moduleName, globalCache); } const failedLookupLocations: string[] = []; - const state: ModuleResolutionState = { compilerOptions, host, traceEnabled, failedLookupLocations, packageJsonInfoCache, features: NodeResolutionFeatures.None, conditions: [] }; + const diagnostics: Diagnostic[] = []; + const state: ModuleResolutionState = { compilerOptions, host, traceEnabled, failedLookupLocations, packageJsonInfoCache, features: NodeResolutionFeatures.None, conditions: [], requestContainingDirectory: undefined, reportDiagnostic: diag => void diagnostics.push(diag) }; const resolved = loadModuleFromImmediateNodeModulesDirectory(Extensions.DtsOnly, moduleName, globalCache, state, /*typesScopeOnly*/ false, /*cache*/ undefined, /*redirectedReference*/ undefined); - return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations, state.resultFromCache); + return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations, diagnostics, state.resultFromCache); } /** diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 2caa36f1425..2d7777e7631 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -1364,6 +1364,36 @@ namespace ts { return program; + function addResolutionDiagnostics(list: Diagnostic[] | undefined) { + if (!list) return; + for (const elem of list) { + programDiagnostics.add(elem); + } + } + + function pullDiagnosticsFromCache(names: string[] | readonly FileReference[], containingFile: SourceFile) { + if (!moduleResolutionCache) return; + const containingFileName = getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory); + const containingFileMode = !isString(containingFile) ? containingFile.impliedNodeFormat : undefined; + const containingDir = getDirectoryPath(containingFileName); + const redirectedReference = getRedirectReferenceForResolution(containingFile); + let i = 0; + for (const n of names) { + // mimics logic done in the resolution cache, should be resilient to upgrading it to use `FileReference`s for non-type-reference modal lookups to make it rely on the index in the list less + const mode = typeof n === "string" ? getModeForResolutionAtIndex(containingFile, i) : getModeForFileReference(n, containingFileMode); + const name = typeof n === "string" ? n : n.fileName; + i++; + // only nonrelative names hit the cache, and, at least as of right now, only nonrelative names can issue diagnostics + // (Since diagnostics are only issued via import or export map lookup) + // This may totally change if/when the issue of output paths not mapping to input files is fixed in a broader context + // When it is, how we extract diagnostics from the module name resolver will have the be refined - the current cache + // APIs wrapping the underlying resolver make it almost impossible to smuggle the diagnostics out in a generalized way + if (isExternalModuleNameRelative(name)) continue; + const diags = moduleResolutionCache.getOrCreateCacheForModuleName(name, mode, redirectedReference).get(containingDir)?.resolutionDiagnostics; + addResolutionDiagnostics(diags); + } + } + function resolveModuleNamesWorker(moduleNames: string[], containingFile: SourceFile, reusedNames: string[] | undefined): readonly ResolvedModuleFull[] { if (!moduleNames.length) return emptyArray; const containingFileName = getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory); @@ -1374,6 +1404,7 @@ namespace ts { performance.mark("afterResolveModule"); performance.measure("ResolveModule", "beforeResolveModule", "afterResolveModule"); tracing?.pop(); + pullDiagnosticsFromCache(moduleNames, containingFile); return result; } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index c3a2f8f72b2..6becb6813ea 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -6717,6 +6717,8 @@ namespace ts { readonly resolvedModule: ResolvedModuleFull | undefined; /* @internal */ readonly failedLookupLocations: string[]; + /* @internal */ + readonly resolutionDiagnostics: Diagnostic[] } export interface ResolvedTypeReferenceDirective { @@ -6738,6 +6740,8 @@ namespace ts { export interface ResolvedTypeReferenceDirectiveWithFailedLookupLocations { readonly resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective | undefined; readonly failedLookupLocations: string[]; + /* @internal */ + resolutionDiagnostics: Diagnostic[] } /* @internal */ diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index b4a22b298fe..3c38df36b44 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -4387,6 +4387,16 @@ namespace ts { Extension.Dts; } + /** + * This function is an inverse of `getDeclarationEmitExtensionForPath`. + */ + export function getPossibleOriginalInputExtensionForExtension(path: string) { + return fileExtensionIsOneOf(path, [Extension.Dmts, Extension.Mjs, Extension.Mts]) ? [Extension.Mts, Extension.Mjs] : + fileExtensionIsOneOf(path, [Extension.Dcts, Extension.Cjs, Extension.Cts]) ? [Extension.Cts, Extension.Cjs]: + fileExtensionIsOneOf(path, [`.json.d.ts`]) ? [Extension.Json] : + [Extension.Tsx, Extension.Ts, Extension.Jsx, Extension.Js]; + } + export function outFile(options: CompilerOptions) { return options.outFile || options.out; } diff --git a/src/testRunner/unittests/moduleResolution.ts b/src/testRunner/unittests/moduleResolution.ts index 87c3587ec2f..872e9e8b17f 100644 --- a/src/testRunner/unittests/moduleResolution.ts +++ b/src/testRunner/unittests/moduleResolution.ts @@ -215,6 +215,7 @@ namespace ts { extension: Extension.Ts, }, failedLookupLocations: [], + resolutionDiagnostics: [], }); assert.isDefined(cache.get("/sub")); assert.isUndefined(cache.get("/")); @@ -228,6 +229,7 @@ namespace ts { extension: Extension.Ts, }, failedLookupLocations: [], + resolutionDiagnostics: [], }); assert.isDefined(cache.get("/sub/dir/foo")); assert.isDefined(cache.get("/sub/dir")); @@ -243,6 +245,7 @@ namespace ts { extension: Extension.Ts, }, failedLookupLocations: [], + resolutionDiagnostics: [], }); assert.isDefined(cache.get("/foo/bar")); assert.isDefined(cache.get("/foo")); @@ -257,6 +260,7 @@ namespace ts { extension: Extension.Ts, }, failedLookupLocations: [], + resolutionDiagnostics: [], }); assert.isDefined(cache.get("/foo")); assert.isUndefined(cache.get("/")); @@ -270,6 +274,7 @@ namespace ts { extension: Extension.Ts, }, failedLookupLocations: [], + resolutionDiagnostics: [], }); assert.isDefined(cache.get("c:/foo")); assert.isDefined(cache.get("c:/")); @@ -279,6 +284,7 @@ namespace ts { cache.set("/foo/bar/baz", { resolvedModule: undefined, failedLookupLocations: [], + resolutionDiagnostics: [], }); assert.isDefined(cache.get("/foo/bar/baz")); assert.isDefined(cache.get("/foo/bar")); diff --git a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).errors.txt b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).errors.txt index bdf6aba250c..42a324dadf6 100644 --- a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).errors.txt +++ b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=node16).errors.txt @@ -1,6 +1,8 @@ +error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/allowJs/package.json'. Supply the `rootDir` compiler option to disambiguate. tests/cases/conformance/node/allowJs/index.cjs(2,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/allowJs/package.json'. Supply the `rootDir` compiler option to disambiguate. ==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== // esm format file import * as self from "package"; diff --git a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=nodenext).errors.txt b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=nodenext).errors.txt index bdf6aba250c..42a324dadf6 100644 --- a/tests/baselines/reference/nodeAllowJsPackageSelfName(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeAllowJsPackageSelfName(module=nodenext).errors.txt @@ -1,6 +1,8 @@ +error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/allowJs/package.json'. Supply the `rootDir` compiler option to disambiguate. tests/cases/conformance/node/allowJs/index.cjs(2,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/allowJs/package.json'. Supply the `rootDir` compiler option to disambiguate. ==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== // esm format file import * as self from "package"; diff --git a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).errors.txt b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).errors.txt index 83e50c001e7..904a4714318 100644 --- a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=node16).errors.txt @@ -1,9 +1,11 @@ +error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/allowJs/package.json'. Supply the `rootDir` compiler option to disambiguate. tests/cases/conformance/node/allowJs/index.cjs(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts(2,13): error TS2303: Circular definition of import alias 'cjs'. tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. +!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/allowJs/package.json'. Supply the `rootDir` compiler option to disambiguate. ==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== // esm format file import * as cjs from "package/cjs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=nodenext).errors.txt index 83e50c001e7..904a4714318 100644 --- a/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsConditionalPackageExports(module=nodenext).errors.txt @@ -1,9 +1,11 @@ +error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/allowJs/package.json'. Supply the `rootDir` compiler option to disambiguate. tests/cases/conformance/node/allowJs/index.cjs(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/node_modules/inner/index.d.mts(2,13): error TS2303: Circular definition of import alias 'cjs'. tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. +!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/allowJs/package.json'. Supply the `rootDir` compiler option to disambiguate. ==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== // esm format file import * as cjs from "package/cjs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).errors.txt index e6f4b3ce2eb..63e7af6ada0 100644 --- a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=node16).errors.txt @@ -1,3 +1,4 @@ +error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/allowJs/package.json'. Supply the `rootDir` compiler option to disambiguate. tests/cases/conformance/node/allowJs/index.cjs(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(9,23): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. @@ -6,6 +7,7 @@ tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(2,13): error tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/allowJs/package.json'. Supply the `rootDir` compiler option to disambiguate. ==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== // esm format file import * as cjs from "package/cjs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=nodenext).errors.txt index e6f4b3ce2eb..63e7af6ada0 100644 --- a/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsPackageExports(module=nodenext).errors.txt @@ -1,3 +1,4 @@ +error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/allowJs/package.json'. Supply the `rootDir` compiler option to disambiguate. tests/cases/conformance/node/allowJs/index.cjs(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(9,23): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. @@ -6,6 +7,7 @@ tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(2,13): error tests/cases/conformance/node/allowJs/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/allowJs/package.json'. Supply the `rootDir` compiler option to disambiguate. ==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== // esm format file import * as cjs from "package/cjs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).errors.txt index 261be58f1a2..ffbcbe24e99 100644 --- a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=node16).errors.txt @@ -1,7 +1,9 @@ +error TS2210: The project root is ambiguous, but is required to resolve import map entry '.' in file 'tests/cases/conformance/node/allowJs/package.json'. Supply the `rootDir` compiler option to disambiguate. tests/cases/conformance/node/allowJs/index.cjs(3,22): error TS1471: Module '#mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(4,23): error TS1471: Module '#type' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS2210: The project root is ambiguous, but is required to resolve import map entry '.' in file 'tests/cases/conformance/node/allowJs/package.json'. Supply the `rootDir` compiler option to disambiguate. ==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== // esm format file import * as cjs from "#cjs"; diff --git a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=nodenext).errors.txt index 261be58f1a2..ffbcbe24e99 100644 --- a/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesAllowJsPackageImports(module=nodenext).errors.txt @@ -1,7 +1,9 @@ +error TS2210: The project root is ambiguous, but is required to resolve import map entry '.' in file 'tests/cases/conformance/node/allowJs/package.json'. Supply the `rootDir` compiler option to disambiguate. tests/cases/conformance/node/allowJs/index.cjs(3,22): error TS1471: Module '#mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/allowJs/index.cjs(4,23): error TS1471: Module '#type' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS2210: The project root is ambiguous, but is required to resolve import map entry '.' in file 'tests/cases/conformance/node/allowJs/package.json'. Supply the `rootDir` compiler option to disambiguate. ==== tests/cases/conformance/node/allowJs/index.js (0 errors) ==== // esm format file import * as cjs from "#cjs"; diff --git a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).errors.txt b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).errors.txt index 7397e1e1dbd..793f3f03da2 100644 --- a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).errors.txt +++ b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=node16).errors.txt @@ -1,9 +1,11 @@ +error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/package.json'. Supply the `rootDir` compiler option to disambiguate. tests/cases/conformance/node/index.cts(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/node_modules/inner/index.d.mts(2,13): error TS2303: Circular definition of import alias 'cjs'. tests/cases/conformance/node/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. +!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/package.json'. Supply the `rootDir` compiler option to disambiguate. ==== tests/cases/conformance/node/index.ts (0 errors) ==== // esm format file import * as cjs from "package/cjs"; diff --git a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=nodenext).errors.txt index 7397e1e1dbd..793f3f03da2 100644 --- a/tests/baselines/reference/nodeModulesConditionalPackageExports(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesConditionalPackageExports(module=nodenext).errors.txt @@ -1,9 +1,11 @@ +error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/package.json'. Supply the `rootDir` compiler option to disambiguate. tests/cases/conformance/node/index.cts(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/node_modules/inner/index.d.mts(2,13): error TS2303: Circular definition of import alias 'cjs'. tests/cases/conformance/node/node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import alias 'cjs'. +!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/package.json'. Supply the `rootDir` compiler option to disambiguate. ==== tests/cases/conformance/node/index.ts (0 errors) ==== // esm format file import * as cjs from "package/cjs"; diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).errors.txt b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).errors.txt index 11f39b9dd93..4ee7f3c4cef 100644 --- a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).errors.txt +++ b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=node16).errors.txt @@ -1,3 +1,4 @@ +error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/package.json'. Supply the `rootDir` compiler option to disambiguate. tests/cases/conformance/node/index.cts(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(9,23): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. @@ -8,6 +9,7 @@ tests/cases/conformance/node/node_modules/inner/index.d.ts(3,22): error TS1471: tests/cases/conformance/node/node_modules/inner/index.d.ts(5,1): error TS1036: Statements are not allowed in ambient contexts. +!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/package.json'. Supply the `rootDir` compiler option to disambiguate. ==== tests/cases/conformance/node/index.ts (0 errors) ==== // esm format file import * as cjs from "package/cjs"; diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=nodenext).errors.txt index 11f39b9dd93..4ee7f3c4cef 100644 --- a/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesDeclarationEmitWithPackageExports(module=nodenext).errors.txt @@ -1,3 +1,4 @@ +error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/package.json'. Supply the `rootDir` compiler option to disambiguate. tests/cases/conformance/node/index.cts(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(9,23): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. @@ -8,6 +9,7 @@ tests/cases/conformance/node/node_modules/inner/index.d.ts(3,22): error TS1471: tests/cases/conformance/node/node_modules/inner/index.d.ts(5,1): error TS1036: Statements are not allowed in ambient contexts. +!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/package.json'. Supply the `rootDir` compiler option to disambiguate. ==== tests/cases/conformance/node/index.ts (0 errors) ==== // esm format file import * as cjs from "package/cjs"; diff --git a/tests/baselines/reference/nodeModulesPackageExports(module=node16).errors.txt b/tests/baselines/reference/nodeModulesPackageExports(module=node16).errors.txt index 464db33f319..8f7452ffa72 100644 --- a/tests/baselines/reference/nodeModulesPackageExports(module=node16).errors.txt +++ b/tests/baselines/reference/nodeModulesPackageExports(module=node16).errors.txt @@ -1,3 +1,4 @@ +error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/package.json'. Supply the `rootDir` compiler option to disambiguate. tests/cases/conformance/node/index.cts(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(9,23): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. @@ -6,6 +7,7 @@ tests/cases/conformance/node/node_modules/inner/index.d.ts(2,13): error TS2303: tests/cases/conformance/node/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/package.json'. Supply the `rootDir` compiler option to disambiguate. ==== tests/cases/conformance/node/index.ts (0 errors) ==== // esm format file import * as cjs from "package/cjs"; diff --git a/tests/baselines/reference/nodeModulesPackageExports(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesPackageExports(module=nodenext).errors.txt index 464db33f319..8f7452ffa72 100644 --- a/tests/baselines/reference/nodeModulesPackageExports(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesPackageExports(module=nodenext).errors.txt @@ -1,3 +1,4 @@ +error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/package.json'. Supply the `rootDir` compiler option to disambiguate. tests/cases/conformance/node/index.cts(3,22): error TS1471: Module 'package/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(4,23): error TS1471: Module 'package' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. tests/cases/conformance/node/index.cts(9,23): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. @@ -6,6 +7,7 @@ tests/cases/conformance/node/node_modules/inner/index.d.ts(2,13): error TS2303: tests/cases/conformance/node/node_modules/inner/index.d.ts(3,22): error TS1471: Module 'inner/mjs' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead. +!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/conformance/node/package.json'. Supply the `rootDir` compiler option to disambiguate. ==== tests/cases/conformance/node/index.ts (0 errors) ==== // esm format file import * as cjs from "package/cjs"; diff --git a/tests/baselines/reference/nodeNextPackageImportMapRootDir.js b/tests/baselines/reference/nodeNextPackageImportMapRootDir.js new file mode 100644 index 00000000000..df6506fa35c --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageImportMapRootDir.js @@ -0,0 +1,25 @@ +//// [tests/cases/compiler/nodeNextPackageImportMapRootDir.ts] //// + +//// [package.json] +{ + "name": "@this/package", + "type": "module", + "exports": { + ".": "./dist/index.js" + }, + "imports": { + "#dep": "./dist/index.js" + } +} +//// [index.ts] +import * as me from "#dep"; + +me.thing(); + +export function thing(): void {} + + +//// [index.js] +import * as me from "#dep"; +me.thing(); +export function thing() { } diff --git a/tests/baselines/reference/nodeNextPackageImportMapRootDir.symbols b/tests/baselines/reference/nodeNextPackageImportMapRootDir.symbols new file mode 100644 index 00000000000..f03b685e938 --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageImportMapRootDir.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/index.ts === +import * as me from "#dep"; +>me : Symbol(me, Decl(index.ts, 0, 6)) + +me.thing(); +>me.thing : Symbol(thing, Decl(index.ts, 2, 11)) +>me : Symbol(me, Decl(index.ts, 0, 6)) +>thing : Symbol(thing, Decl(index.ts, 2, 11)) + +export function thing(): void {} +>thing : Symbol(thing, Decl(index.ts, 2, 11)) + diff --git a/tests/baselines/reference/nodeNextPackageImportMapRootDir.types b/tests/baselines/reference/nodeNextPackageImportMapRootDir.types new file mode 100644 index 00000000000..445dd91324a --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageImportMapRootDir.types @@ -0,0 +1,13 @@ +=== tests/cases/compiler/index.ts === +import * as me from "#dep"; +>me : typeof me + +me.thing(); +>me.thing() : void +>me.thing : () => void +>me : typeof me +>thing : () => void + +export function thing(): void {} +>thing : () => void + diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDir.errors.txt b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDir.errors.txt new file mode 100644 index 00000000000..6577aed8336 --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDir.errors.txt @@ -0,0 +1,19 @@ +error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/compiler/package.json'. Supply the `rootDir` compiler option to disambiguate. + + +!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/compiler/package.json'. Supply the `rootDir` compiler option to disambiguate. +==== tests/cases/compiler/package.json (0 errors) ==== + { + "name": "@this/package", + "type": "module", + "exports": { + ".": "./dist/index.js" + } + } +==== tests/cases/compiler/index.ts (0 errors) ==== + import * as me from "@this/package"; + + me.thing(); + + export function thing(): void {} + \ No newline at end of file diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDir.js b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDir.js new file mode 100644 index 00000000000..d4451ed91fc --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDir.js @@ -0,0 +1,22 @@ +//// [tests/cases/compiler/nodeNextPackageSelfNameWithOutDir.ts] //// + +//// [package.json] +{ + "name": "@this/package", + "type": "module", + "exports": { + ".": "./dist/index.js" + } +} +//// [index.ts] +import * as me from "@this/package"; + +me.thing(); + +export function thing(): void {} + + +//// [index.js] +import * as me from "@this/package"; +me.thing(); +export function thing() { } diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDir.symbols b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDir.symbols new file mode 100644 index 00000000000..8bcf39cdd7a --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDir.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/index.ts === +import * as me from "@this/package"; +>me : Symbol(me, Decl(index.ts, 0, 6)) + +me.thing(); +>me.thing : Symbol(thing, Decl(index.ts, 2, 11)) +>me : Symbol(me, Decl(index.ts, 0, 6)) +>thing : Symbol(thing, Decl(index.ts, 2, 11)) + +export function thing(): void {} +>thing : Symbol(thing, Decl(index.ts, 2, 11)) + diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDir.types b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDir.types new file mode 100644 index 00000000000..a22456ef499 --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDir.types @@ -0,0 +1,13 @@ +=== tests/cases/compiler/index.ts === +import * as me from "@this/package"; +>me : typeof me + +me.thing(); +>me.thing() : void +>me.thing : () => void +>me : typeof me +>thing : () => void + +export function thing(): void {} +>thing : () => void + diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDir.errors.txt b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDir.errors.txt new file mode 100644 index 00000000000..6ccce9cf141 --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDir.errors.txt @@ -0,0 +1,22 @@ +error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/compiler/package.json'. Supply the `rootDir` compiler option to disambiguate. + + +!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/compiler/package.json'. Supply the `rootDir` compiler option to disambiguate. +==== tests/cases/compiler/package.json (0 errors) ==== + { + "name": "@this/package", + "type": "module", + "exports": { + ".": { + "default": "./dist/index.js", + "types": "./types/index.d.ts" + } + } + } +==== tests/cases/compiler/index.ts (0 errors) ==== + import * as me from "@this/package"; + + me.thing(); + + export function thing(): void {} + \ No newline at end of file diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDir.js b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDir.js new file mode 100644 index 00000000000..d035a43f7c0 --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDir.js @@ -0,0 +1,29 @@ +//// [tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.ts] //// + +//// [package.json] +{ + "name": "@this/package", + "type": "module", + "exports": { + ".": { + "default": "./dist/index.js", + "types": "./types/index.d.ts" + } + } +} +//// [index.ts] +import * as me from "@this/package"; + +me.thing(); + +export function thing(): void {} + + +//// [index.js] +import * as me from "@this/package"; +me.thing(); +export function thing() { } + + +//// [index.d.ts] +export declare function thing(): void; diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDir.symbols b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDir.symbols new file mode 100644 index 00000000000..8bcf39cdd7a --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDir.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/index.ts === +import * as me from "@this/package"; +>me : Symbol(me, Decl(index.ts, 0, 6)) + +me.thing(); +>me.thing : Symbol(thing, Decl(index.ts, 2, 11)) +>me : Symbol(me, Decl(index.ts, 0, 6)) +>thing : Symbol(thing, Decl(index.ts, 2, 11)) + +export function thing(): void {} +>thing : Symbol(thing, Decl(index.ts, 2, 11)) + diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDir.types b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDir.types new file mode 100644 index 00000000000..a22456ef499 --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDir.types @@ -0,0 +1,13 @@ +=== tests/cases/compiler/index.ts === +import * as me from "@this/package"; +>me : typeof me + +me.thing(); +>me.thing() : void +>me.thing : () => void +>me : typeof me +>thing : () => void + +export function thing(): void {} +>thing : () => void + diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirComposite.js b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirComposite.js new file mode 100644 index 00000000000..0406bf88612 --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirComposite.js @@ -0,0 +1,29 @@ +//// [tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.ts] //// + +//// [package.json] +{ + "name": "@this/package", + "type": "module", + "exports": { + ".": { + "default": "./dist/index.js", + "types": "./types/index.d.ts" + } + } +} +//// [index.ts] +import * as me from "@this/package"; + +me.thing(); + +export function thing(): void {} + + +//// [index.js] +import * as me from "@this/package"; +me.thing(); +export function thing() { } + + +//// [index.d.ts] +export declare function thing(): void; diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirComposite.symbols b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirComposite.symbols new file mode 100644 index 00000000000..8bcf39cdd7a --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirComposite.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/index.ts === +import * as me from "@this/package"; +>me : Symbol(me, Decl(index.ts, 0, 6)) + +me.thing(); +>me.thing : Symbol(thing, Decl(index.ts, 2, 11)) +>me : Symbol(me, Decl(index.ts, 0, 6)) +>thing : Symbol(thing, Decl(index.ts, 2, 11)) + +export function thing(): void {} +>thing : Symbol(thing, Decl(index.ts, 2, 11)) + diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirComposite.types b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirComposite.types new file mode 100644 index 00000000000..a22456ef499 --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirComposite.types @@ -0,0 +1,13 @@ +=== tests/cases/compiler/index.ts === +import * as me from "@this/package"; +>me : typeof me + +me.thing(); +>me.thing() : void +>me.thing : () => void +>me : typeof me +>thing : () => void + +export function thing(): void {} +>thing : () => void + diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.js b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.js new file mode 100644 index 00000000000..21197f9881e --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.js @@ -0,0 +1,46 @@ +//// [tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.ts] //// + +//// [package.json] +{ + "name": "@this/package", + "type": "module", + "exports": { + ".": { + "default": "./dist/index.js", + "types": "./types/index.d.ts" + } + } +} +//// [index.ts] +export {srcthing as thing} from "./src/thing.js"; +//// [thing.ts] +// The following import should cause `index.ts` +// to be included in the build, which will, +// in turn, cause the common src directory to not be `src` +// (the harness is wierd here in that noImplicitReferences makes only +// this file get loaded as an entrypoint and emitted, while on the +// real command-line we'll crawl the imports for that set - a limitation +// of the harness, I suppose) +import * as me from "@this/package"; + +me.thing(); + +export function srcthing(): void {} + + + +//// [thing.js] +// The following import should cause `index.ts` +// to be included in the build, which will, +// in turn, cause the common src directory to not be `src` +// (the harness is wierd here in that noImplicitReferences makes only +// this file get loaded as an entrypoint and emitted, while on the +// real command-line we'll crawl the imports for that set - a limitation +// of the harness, I suppose) +import * as me from "@this/package"; +me.thing(); +export function srcthing() { } + + +//// [thing.d.ts] +export declare function srcthing(): void; diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.symbols b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.symbols new file mode 100644 index 00000000000..38fc4efe336 --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/src/thing.ts === +// The following import should cause `index.ts` +// to be included in the build, which will, +// in turn, cause the common src directory to not be `src` +// (the harness is wierd here in that noImplicitReferences makes only +// this file get loaded as an entrypoint and emitted, while on the +// real command-line we'll crawl the imports for that set - a limitation +// of the harness, I suppose) +import * as me from "@this/package"; +>me : Symbol(me, Decl(thing.ts, 7, 6)) + +me.thing(); +>me.thing : Symbol(me.thing, Decl(index.ts, 0, 8)) +>me : Symbol(me, Decl(thing.ts, 7, 6)) +>thing : Symbol(me.thing, Decl(index.ts, 0, 8)) + +export function srcthing(): void {} +>srcthing : Symbol(srcthing, Decl(thing.ts, 9, 11)) + + +=== tests/cases/compiler/index.ts === +export {srcthing as thing} from "./src/thing.js"; +>srcthing : Symbol(srcthing, Decl(thing.ts, 9, 11)) +>thing : Symbol(thing, Decl(index.ts, 0, 8)) + diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.types b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.types new file mode 100644 index 00000000000..2d4d2bcd994 --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.types @@ -0,0 +1,26 @@ +=== tests/cases/compiler/src/thing.ts === +// The following import should cause `index.ts` +// to be included in the build, which will, +// in turn, cause the common src directory to not be `src` +// (the harness is wierd here in that noImplicitReferences makes only +// this file get loaded as an entrypoint and emitted, while on the +// real command-line we'll crawl the imports for that set - a limitation +// of the harness, I suppose) +import * as me from "@this/package"; +>me : typeof me + +me.thing(); +>me.thing() : void +>me.thing : () => void +>me : typeof me +>thing : () => void + +export function srcthing(): void {} +>srcthing : () => void + + +=== tests/cases/compiler/index.ts === +export {srcthing as thing} from "./src/thing.js"; +>srcthing : () => void +>thing : () => void + diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.errors.txt b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.errors.txt new file mode 100644 index 00000000000..14365276c31 --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.errors.txt @@ -0,0 +1,41 @@ +error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/compiler/package.json'. Supply the `rootDir` compiler option to disambiguate. + + +!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'tests/cases/compiler/package.json'. Supply the `rootDir` compiler option to disambiguate. +==== tests/cases/compiler/tsconfig.json (0 errors) ==== + { + "compilerOptions": { + "module": "nodenext", + "outDir": "./dist", + "declarationDir": "./types", + "declaration": true + } + } +==== tests/cases/compiler/src/thing.ts (0 errors) ==== + // The following import should cause `index.ts` + // to be included in the build, which will, + // in turn, cause the common src directory to not be `src` + // (the harness is wierd here in that noImplicitReferences makes only + // this file get loaded as an entrypoint and emitted, while on the + // real command-line we'll crawl the imports for that set - a limitation + // of the harness, I suppose) + import * as me from "@this/package"; + + me.thing(); + + export function srcthing(): void {} + + +==== tests/cases/compiler/package.json (0 errors) ==== + { + "name": "@this/package", + "type": "module", + "exports": { + ".": { + "default": "./dist/index.js", + "types": "./types/index.d.ts" + } + } + } +==== tests/cases/compiler/index.ts (0 errors) ==== + export {srcthing as thing} from "./src/thing.js"; \ No newline at end of file diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.js b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.js new file mode 100644 index 00000000000..433a7dfc989 --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.js @@ -0,0 +1,46 @@ +//// [tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.ts] //// + +//// [package.json] +{ + "name": "@this/package", + "type": "module", + "exports": { + ".": { + "default": "./dist/index.js", + "types": "./types/index.d.ts" + } + } +} +//// [index.ts] +export {srcthing as thing} from "./src/thing.js"; +//// [thing.ts] +// The following import should cause `index.ts` +// to be included in the build, which will, +// in turn, cause the common src directory to not be `src` +// (the harness is wierd here in that noImplicitReferences makes only +// this file get loaded as an entrypoint and emitted, while on the +// real command-line we'll crawl the imports for that set - a limitation +// of the harness, I suppose) +import * as me from "@this/package"; + +me.thing(); + +export function srcthing(): void {} + + + +//// [thing.js] +// The following import should cause `index.ts` +// to be included in the build, which will, +// in turn, cause the common src directory to not be `src` +// (the harness is wierd here in that noImplicitReferences makes only +// this file get loaded as an entrypoint and emitted, while on the +// real command-line we'll crawl the imports for that set - a limitation +// of the harness, I suppose) +import * as me from "@this/package"; +me.thing(); +export function srcthing() { } + + +//// [thing.d.ts] +export declare function srcthing(): void; diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.symbols b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.symbols new file mode 100644 index 00000000000..38fc4efe336 --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/src/thing.ts === +// The following import should cause `index.ts` +// to be included in the build, which will, +// in turn, cause the common src directory to not be `src` +// (the harness is wierd here in that noImplicitReferences makes only +// this file get loaded as an entrypoint and emitted, while on the +// real command-line we'll crawl the imports for that set - a limitation +// of the harness, I suppose) +import * as me from "@this/package"; +>me : Symbol(me, Decl(thing.ts, 7, 6)) + +me.thing(); +>me.thing : Symbol(me.thing, Decl(index.ts, 0, 8)) +>me : Symbol(me, Decl(thing.ts, 7, 6)) +>thing : Symbol(me.thing, Decl(index.ts, 0, 8)) + +export function srcthing(): void {} +>srcthing : Symbol(srcthing, Decl(thing.ts, 9, 11)) + + +=== tests/cases/compiler/index.ts === +export {srcthing as thing} from "./src/thing.js"; +>srcthing : Symbol(srcthing, Decl(thing.ts, 9, 11)) +>thing : Symbol(thing, Decl(index.ts, 0, 8)) + diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.types b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.types new file mode 100644 index 00000000000..2d4d2bcd994 --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.types @@ -0,0 +1,26 @@ +=== tests/cases/compiler/src/thing.ts === +// The following import should cause `index.ts` +// to be included in the build, which will, +// in turn, cause the common src directory to not be `src` +// (the harness is wierd here in that noImplicitReferences makes only +// this file get loaded as an entrypoint and emitted, while on the +// real command-line we'll crawl the imports for that set - a limitation +// of the harness, I suppose) +import * as me from "@this/package"; +>me : typeof me + +me.thing(); +>me.thing() : void +>me.thing : () => void +>me : typeof me +>thing : () => void + +export function srcthing(): void {} +>srcthing : () => void + + +=== tests/cases/compiler/index.ts === +export {srcthing as thing} from "./src/thing.js"; +>srcthing : () => void +>thing : () => void + diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.js b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.js new file mode 100644 index 00000000000..683dad9fb12 --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.js @@ -0,0 +1,29 @@ +//// [tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.ts] //// + +//// [package.json] +{ + "name": "@this/package", + "type": "module", + "exports": { + ".": { + "default": "./dist/index.js", + "types": "./types/index.d.ts" + } + } +} +//// [index.ts] +import * as me from "@this/package"; + +me.thing(); + +export function thing(): void {} + + +//// [index.js] +import * as me from "@this/package"; +me.thing(); +export function thing() { } + + +//// [index.d.ts] +export declare function thing(): void; diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.symbols b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.symbols new file mode 100644 index 00000000000..beb1169cc73 --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.symbols @@ -0,0 +1,12 @@ +=== /pkg/src/index.ts === +import * as me from "@this/package"; +>me : Symbol(me, Decl(index.ts, 0, 6)) + +me.thing(); +>me.thing : Symbol(thing, Decl(index.ts, 2, 11)) +>me : Symbol(me, Decl(index.ts, 0, 6)) +>thing : Symbol(thing, Decl(index.ts, 2, 11)) + +export function thing(): void {} +>thing : Symbol(thing, Decl(index.ts, 2, 11)) + diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.types b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.types new file mode 100644 index 00000000000..17098101fce --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.types @@ -0,0 +1,13 @@ +=== /pkg/src/index.ts === +import * as me from "@this/package"; +>me : typeof me + +me.thing(); +>me.thing() : void +>me.thing : () => void +>me : typeof me +>thing : () => void + +export function thing(): void {} +>thing : () => void + diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirRootDir.js b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirRootDir.js new file mode 100644 index 00000000000..7dad992a946 --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirRootDir.js @@ -0,0 +1,22 @@ +//// [tests/cases/compiler/nodeNextPackageSelfNameWithOutDirRootDir.ts] //// + +//// [package.json] +{ + "name": "@this/package", + "type": "module", + "exports": { + ".": "./dist/index.js" + } +} +//// [index.ts] +import * as me from "@this/package"; + +me.thing(); + +export function thing(): void {} + + +//// [index.js] +import * as me from "@this/package"; +me.thing(); +export function thing() { } diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirRootDir.symbols b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirRootDir.symbols new file mode 100644 index 00000000000..8bcf39cdd7a --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirRootDir.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/index.ts === +import * as me from "@this/package"; +>me : Symbol(me, Decl(index.ts, 0, 6)) + +me.thing(); +>me.thing : Symbol(thing, Decl(index.ts, 2, 11)) +>me : Symbol(me, Decl(index.ts, 0, 6)) +>thing : Symbol(thing, Decl(index.ts, 2, 11)) + +export function thing(): void {} +>thing : Symbol(thing, Decl(index.ts, 2, 11)) + diff --git a/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirRootDir.types b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirRootDir.types new file mode 100644 index 00000000000..a22456ef499 --- /dev/null +++ b/tests/baselines/reference/nodeNextPackageSelfNameWithOutDirRootDir.types @@ -0,0 +1,13 @@ +=== tests/cases/compiler/index.ts === +import * as me from "@this/package"; +>me : typeof me + +me.thing(); +>me.thing() : void +>me.thing : () => void +>me : typeof me +>thing : () => void + +export function thing(): void {} +>thing : () => void + diff --git a/tests/cases/compiler/nodeNextPackageImportMapRootDir.ts b/tests/cases/compiler/nodeNextPackageImportMapRootDir.ts new file mode 100644 index 00000000000..a0a8dfb8e7b --- /dev/null +++ b/tests/cases/compiler/nodeNextPackageImportMapRootDir.ts @@ -0,0 +1,20 @@ +// @module: nodenext +// @outDir: ./dist +// @rootDir: tests/cases/compiler +// @filename: package.json +{ + "name": "@this/package", + "type": "module", + "exports": { + ".": "./dist/index.js" + }, + "imports": { + "#dep": "./dist/index.js" + } +} +// @filename: index.ts +import * as me from "#dep"; + +me.thing(); + +export function thing(): void {} diff --git a/tests/cases/compiler/nodeNextPackageSelfNameWithOutDir.ts b/tests/cases/compiler/nodeNextPackageSelfNameWithOutDir.ts new file mode 100644 index 00000000000..71c1494aafb --- /dev/null +++ b/tests/cases/compiler/nodeNextPackageSelfNameWithOutDir.ts @@ -0,0 +1,16 @@ +// @module: nodenext +// @outDir: ./dist +// @filename: package.json +{ + "name": "@this/package", + "type": "module", + "exports": { + ".": "./dist/index.js" + } +} +// @filename: index.ts +import * as me from "@this/package"; + +me.thing(); + +export function thing(): void {} diff --git a/tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.ts b/tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.ts new file mode 100644 index 00000000000..f495002c9e4 --- /dev/null +++ b/tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDir.ts @@ -0,0 +1,21 @@ +// @module: nodenext +// @outDir: ./dist +// @declarationDir: ./types +// @declaration: true +// @filename: package.json +{ + "name": "@this/package", + "type": "module", + "exports": { + ".": { + "default": "./dist/index.js", + "types": "./types/index.d.ts" + } + } +} +// @filename: index.ts +import * as me from "@this/package"; + +me.thing(); + +export function thing(): void {} diff --git a/tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.ts b/tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.ts new file mode 100644 index 00000000000..c8efa7f7677 --- /dev/null +++ b/tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDirComposite.ts @@ -0,0 +1,26 @@ +// @filename: tsconfig.json +{ + "compilerOptions": { + "module": "nodenext", + "outDir": "./dist", + "declarationDir": "./types", + "composite": true + } +} +// @filename: package.json +{ + "name": "@this/package", + "type": "module", + "exports": { + ".": { + "default": "./dist/index.js", + "types": "./types/index.d.ts" + } + } +} +// @filename: index.ts +import * as me from "@this/package"; + +me.thing(); + +export function thing(): void {} diff --git a/tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.ts b/tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.ts new file mode 100644 index 00000000000..df09199ced6 --- /dev/null +++ b/tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDirCompositeNestedDirs.ts @@ -0,0 +1,37 @@ +// @noImplicitReferences: true +// @filename: tsconfig.json +{ + "compilerOptions": { + "module": "nodenext", + "outDir": "./dist", + "declarationDir": "./types", + "composite": true + } +} +// @filename: package.json +{ + "name": "@this/package", + "type": "module", + "exports": { + ".": { + "default": "./dist/index.js", + "types": "./types/index.d.ts" + } + } +} +// @filename: index.ts +export {srcthing as thing} from "./src/thing.js"; +// @filename: src/thing.ts +// The following import should cause `index.ts` +// to be included in the build, which will, +// in turn, cause the common src directory to not be `src` +// (the harness is wierd here in that noImplicitReferences makes only +// this file get loaded as an entrypoint and emitted, while on the +// real command-line we'll crawl the imports for that set - a limitation +// of the harness, I suppose) +import * as me from "@this/package"; + +me.thing(); + +export function srcthing(): void {} + diff --git a/tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.ts b/tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.ts new file mode 100644 index 00000000000..f8e28e05f7c --- /dev/null +++ b/tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDirNestedDirs.ts @@ -0,0 +1,37 @@ +// @noImplicitReferences: true +// @filename: tsconfig.json +{ + "compilerOptions": { + "module": "nodenext", + "outDir": "./dist", + "declarationDir": "./types", + "declaration": true + } +} +// @filename: package.json +{ + "name": "@this/package", + "type": "module", + "exports": { + ".": { + "default": "./dist/index.js", + "types": "./types/index.d.ts" + } + } +} +// @filename: index.ts +export {srcthing as thing} from "./src/thing.js"; +// @filename: src/thing.ts +// The following import should cause `index.ts` +// to be included in the build, which will, +// in turn, cause the common src directory to not be `src` +// (the harness is wierd here in that noImplicitReferences makes only +// this file get loaded as an entrypoint and emitted, while on the +// real command-line we'll crawl the imports for that set - a limitation +// of the harness, I suppose) +import * as me from "@this/package"; + +me.thing(); + +export function srcthing(): void {} + diff --git a/tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.ts b/tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.ts new file mode 100644 index 00000000000..5857765749f --- /dev/null +++ b/tests/cases/compiler/nodeNextPackageSelfNameWithOutDirDeclDirRootDir.ts @@ -0,0 +1,22 @@ +// @module: nodenext +// @outDir: /pkg/dist +// @declarationDir: /pkg/types +// @declaration: true +// @rootDir: /pkg/src +// @filename: /pkg/package.json +{ + "name": "@this/package", + "type": "module", + "exports": { + ".": { + "default": "./dist/index.js", + "types": "./types/index.d.ts" + } + } +} +// @filename: /pkg/src/index.ts +import * as me from "@this/package"; + +me.thing(); + +export function thing(): void {} diff --git a/tests/cases/compiler/nodeNextPackageSelfNameWithOutDirRootDir.ts b/tests/cases/compiler/nodeNextPackageSelfNameWithOutDirRootDir.ts new file mode 100644 index 00000000000..1e32c30e683 --- /dev/null +++ b/tests/cases/compiler/nodeNextPackageSelfNameWithOutDirRootDir.ts @@ -0,0 +1,17 @@ +// @module: nodenext +// @outDir: ./dist +// @rootDir: tests/cases/compiler +// @filename: package.json +{ + "name": "@this/package", + "type": "module", + "exports": { + ".": "./dist/index.js" + } +} +// @filename: index.ts +import * as me from "@this/package"; + +me.thing(); + +export function thing(): void {} From f8a09bee6fa4489a15b3817b682ef0234e74f409 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Thu, 5 May 2022 23:07:32 +0300 Subject: [PATCH 61/63] fix(48878): return errorType on invalid nodes in getTypeAtLocation (#48967) --- src/compiler/checker.ts | 2 +- src/testRunner/unittests/publicApi.ts | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 504cdf669c7..ae1ded9d0d8 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -42198,7 +42198,7 @@ namespace ts { if (isDeclaration(node)) { // In this case, we call getSymbolOfNode instead of getSymbolAtLocation because it is a declaration const symbol = getSymbolOfNode(node); - return getTypeOfSymbol(symbol); + return symbol ? getTypeOfSymbol(symbol) : errorType; } if (isDeclarationNameOrImportPropertyName(node)) { diff --git a/src/testRunner/unittests/publicApi.ts b/src/testRunner/unittests/publicApi.ts index 2a5581bc93e..a1e43e7c371 100644 --- a/src/testRunner/unittests/publicApi.ts +++ b/src/testRunner/unittests/publicApi.ts @@ -130,6 +130,26 @@ describe("unittests:: Public APIs:: getTypeAtLocation", () => { const type = checker.getTypeAtLocation(file); assert.equal(type.flags, ts.TypeFlags.Any); }); + + it("returns an errorType for VariableDeclaration with BindingPattern name", () => { + const content = "const foo = [1];\n" + "const [a] = foo;"; + + const host = new fakes.CompilerHost(vfs.createFromFileSystem( + Harness.IO, + /*ignoreCase*/ true, + { documents: [new documents.TextDocument("/file.ts", content)], cwd: "/" })); + + const program = ts.createProgram({ + host, + rootNames: ["/file.ts"], + options: { noLib: true } + }); + + const checker = program.getTypeChecker(); + const file = program.getSourceFile("/file.ts")!; + const [declaration] = (ts.findLast(file.statements, ts.isVariableStatement) as ts.VariableStatement).declarationList.declarations; + assert.equal(checker.getTypeAtLocation(declaration).flags, ts.TypeFlags.Any); + }); }); describe("unittests:: Public APIs:: validateLocaleAndSetLanguage", () => { From 4680b5461676e4ae7c526c2c9c69e242ea2885ac Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Thu, 5 May 2022 13:42:30 -0700 Subject: [PATCH 62/63] Clear ExportMapCache on cancellation requested (#48979) --- src/services/exportInfoMap.ts | 55 ++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/src/services/exportInfoMap.ts b/src/services/exportInfoMap.ts index 875511fdeff..e8b52d48122 100644 --- a/src/services/exportInfoMap.ts +++ b/src/services/exportInfoMap.ts @@ -381,38 +381,45 @@ namespace ts { host.log?.("getExportInfoMap: cache miss or empty; calculating new results"); const compilerOptions = program.getCompilerOptions(); let moduleCount = 0; - forEachExternalModuleToImportFrom(program, host, /*useAutoImportProvider*/ true, (moduleSymbol, moduleFile, program, isFromPackageJson) => { - if (++moduleCount % 100 === 0) cancellationToken?.throwIfCancellationRequested(); - const seenExports = new Map<__String, true>(); - const checker = program.getTypeChecker(); - const defaultInfo = getDefaultLikeExportInfo(moduleSymbol, checker, compilerOptions); - // Note: I think we shouldn't actually see resolved module symbols here, but weird merges - // can cause it to happen: see 'completionsImport_mergedReExport.ts' - if (defaultInfo && isImportableSymbol(defaultInfo.symbol, checker)) { - cache.add( - importingFile.path, - defaultInfo.symbol, - defaultInfo.exportKind === ExportKind.Default ? InternalSymbolName.Default : InternalSymbolName.ExportEquals, - moduleSymbol, - moduleFile, - defaultInfo.exportKind, - isFromPackageJson, - checker); - } - checker.forEachExportAndPropertyOfModule(moduleSymbol, (exported, key) => { - if (exported !== defaultInfo?.symbol && isImportableSymbol(exported, checker) && addToSeen(seenExports, key)) { + try { + forEachExternalModuleToImportFrom(program, host, /*useAutoImportProvider*/ true, (moduleSymbol, moduleFile, program, isFromPackageJson) => { + if (++moduleCount % 100 === 0) cancellationToken?.throwIfCancellationRequested(); + const seenExports = new Map<__String, true>(); + const checker = program.getTypeChecker(); + const defaultInfo = getDefaultLikeExportInfo(moduleSymbol, checker, compilerOptions); + // Note: I think we shouldn't actually see resolved module symbols here, but weird merges + // can cause it to happen: see 'completionsImport_mergedReExport.ts' + if (defaultInfo && isImportableSymbol(defaultInfo.symbol, checker)) { cache.add( importingFile.path, - exported, - key, + defaultInfo.symbol, + defaultInfo.exportKind === ExportKind.Default ? InternalSymbolName.Default : InternalSymbolName.ExportEquals, moduleSymbol, moduleFile, - ExportKind.Named, + defaultInfo.exportKind, isFromPackageJson, checker); } + checker.forEachExportAndPropertyOfModule(moduleSymbol, (exported, key) => { + if (exported !== defaultInfo?.symbol && isImportableSymbol(exported, checker) && addToSeen(seenExports, key)) { + cache.add( + importingFile.path, + exported, + key, + moduleSymbol, + moduleFile, + ExportKind.Named, + isFromPackageJson, + checker); + } + }); }); - }); + } + catch (err) { + // Ensure cache is reset if operation is cancelled + cache.clear(); + throw err; + } host.log?.(`getExportInfoMap: done in ${timestamp() - start} ms`); return cache; From 58114cf387d455192e96bae2ddddd988dc20c506 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Thu, 5 May 2022 13:52:34 -0700 Subject: [PATCH 63/63] Harden combineProjectOutputForReferences against empty results (#48978) Getting an empty result doesn't seem expected, but a deeper fix doesn't make sense until #48619 is merged. Fixes #48963 --- src/server/session.ts | 2 +- .../referencesToNonPropertyNameStringLiteral.baseline.jsonc | 1 + .../server/referencesToNonPropertyNameStringLiteral.ts | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/referencesToNonPropertyNameStringLiteral.baseline.jsonc create mode 100644 tests/cases/fourslash/server/referencesToNonPropertyNameStringLiteral.ts diff --git a/src/server/session.ts b/src/server/session.ts index 8c92d71db1b..ecd5b76ac46 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -356,7 +356,7 @@ namespace ts.server { logger.info(`Finding references to ${location.fileName} position ${location.pos} in project ${project.getProjectName()}`); const projectOutputs = project.getLanguageService().findReferences(location.fileName, location.pos); if (projectOutputs) { - const clearIsDefinition = projectOutputs[0].references[0].isDefinition === undefined; + const clearIsDefinition = projectOutputs[0]?.references[0]?.isDefinition === undefined; for (const referencedSymbol of projectOutputs) { const mappedDefinitionFile = getMappedLocation(project, documentSpanLocation(referencedSymbol.definition)); const definition: ReferencedSymbolDefinitionInfo = mappedDefinitionFile === undefined ? diff --git a/tests/baselines/reference/referencesToNonPropertyNameStringLiteral.baseline.jsonc b/tests/baselines/reference/referencesToNonPropertyNameStringLiteral.baseline.jsonc new file mode 100644 index 00000000000..0637a088a01 --- /dev/null +++ b/tests/baselines/reference/referencesToNonPropertyNameStringLiteral.baseline.jsonc @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/cases/fourslash/server/referencesToNonPropertyNameStringLiteral.ts b/tests/cases/fourslash/server/referencesToNonPropertyNameStringLiteral.ts new file mode 100644 index 00000000000..cf21c74c2d5 --- /dev/null +++ b/tests/cases/fourslash/server/referencesToNonPropertyNameStringLiteral.ts @@ -0,0 +1,5 @@ +/// + +////const str: string = "hello/*1*/"; + +verify.baselineFindAllReferences('1')