TypeScript/tests/baselines/reference/tsbuild/outFile/initial-build/verify-buildInfo-absence-results-in-new-build.js
Sheetal Nandi 9933c8ac7d
Build info baseline improvements (#43200)
* Use ids as 1 based so we can specialize `0` to be some special meaning

* Baseline tsbuildinfo size in the readable baseline

* Baseline fileName and fileNames list as well in readable tsbuildinfo so that new additions are easy to recognize
2021-03-11 13:30:06 -08:00

470 lines
14 KiB
TypeScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Input::
//// [/lib/lib.d.ts]
/// <reference no-default-lib="true"/>
interface Boolean {}
interface Function {}
interface CallableFunction {}
interface NewableFunction {}
interface IArguments {}
interface Number { toExponential: any; }
interface Object {}
interface RegExp {}
interface String { charAt: any; }
interface Array<T> { length: number; [n: number]: T; }
interface ReadonlyArray<T> {}
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/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]
//// [/src/first/bin/first-output.js]
//// [/src/first/bin/first-output.js.map]
//// [/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]
{
"compilerOptions": {
"target": "es5",
"composite": true,
"removeComments": true,
"strict": false,
"sourceMap": true,
"declarationMap": true,
"outFile": "./bin/first-output.js",
"skipDefaultLibCheck": true,
},
"files": [
"first_PART1.ts",
"first_part2.ts",
"first_part3.ts"
],
"references": [
]
}
//// [/src/second/second_part1.ts]
//// [/src/second/second_part2.ts]
//// [/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/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/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
----------------------------------------------------------------------
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
}