Skip to content

Commit 36b321f

Browse files
committed
Unify how @internal CompilerOptions are treated with respect to buildinfo
1 parent e6ba82b commit 36b321f

File tree

961 files changed

+3738
-1521
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

961 files changed

+3738
-1521
lines changed

src/compiler/commandLineParser.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1587,6 +1587,24 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [
15871587
type: "string",
15881588
defaultValueDescription: undefined,
15891589
},
1590+
{
1591+
name: "allowNonTsExtensions",
1592+
type: "boolean",
1593+
defaultValueDescription: undefined,
1594+
internal: true,
1595+
extraValidation() {
1596+
return [Diagnostics.Unknown_compiler_option_0, "allowNonTsExtensions"];
1597+
},
1598+
},
1599+
{
1600+
name: "suppressOutputPathCheck",
1601+
type: "boolean",
1602+
defaultValueDescription: undefined,
1603+
internal: true,
1604+
extraValidation() {
1605+
return [Diagnostics.Unknown_compiler_option_0, "suppressOutputPathCheck"];
1606+
},
1607+
},
15901608
];
15911609

15921610
/** @internal */
@@ -1613,6 +1631,9 @@ export const sourceFileAffectingCompilerOptions: readonly CommandLineOption[] =
16131631
/** @internal */
16141632
export const optionsAffectingProgramStructure: readonly CommandLineOption[] = optionDeclarations.filter(option => !!option.affectsProgramStructure);
16151633

1634+
/** @internal */
1635+
export const internalOptionDeclarations: readonly CommandLineOption[] = optionDeclarations.filter(option => !!option.internal);
1636+
16161637
/** @internal */
16171638
export const transpileOptionValueCompilerOptions: readonly CommandLineOption[] = optionDeclarations.filter(option => hasProperty(option, "transpileOptionValue"));
16181639

src/compiler/program.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ import {
171171
ImportOrExportSpecifier,
172172
importSyntaxAffectsModuleResolution,
173173
InternalEmitFlags,
174+
internalOptionDeclarations,
174175
inverseJsxOptionMap,
175176
isAmbientModule,
176177
isAnyImportOrReExport,
@@ -4795,7 +4796,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
47954796
}
47964797

47974798
function verifyProjectReferences() {
4798-
const buildInfoPath = !options.suppressOutputPathCheck ? getTsBuildInfoEmitOutputFilePath(options) : undefined;
4799+
const buildInfoPath = some(internalOptionDeclarations, d => hasProperty(options, d.name)) ? getTsBuildInfoEmitOutputFilePath(options) : undefined;
47994800
forEachProjectReference(projectReferences, resolvedProjectReferences, (resolvedRef, parent, index) => {
48004801
const ref = (parent ? parent.commandLine.projectReferences : projectReferences)![index];
48014802
const parentFile = parent && parent.sourceFile as JsonSourceFile;

src/compiler/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7551,6 +7551,7 @@ export interface CommandLineOptionBase {
75517551
extraValidation?: (value: CompilerOptionsValue) => [DiagnosticMessage, ...string[]] | undefined; // Additional validation to be performed for the value to be valid
75527552
disallowNullOrUndefined?: true; // If set option does not allow setting null
75537553
allowConfigDirTemplateSubstitution?: true; // If set option allows substitution of `${configDir}` in the value
7554+
internal?: boolean; // If this option is marked for @internal use only
75547555
}
75557556

75567557
/** @internal */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"compilerOptions": {}
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"compilerOptions": {}
3+
}

tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file-because-no-rootDir-in-the-base.js

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,36 @@ Output::
7373

7474
[12:00:26 AM] Building project '/src/src/main/tsconfig.json'...
7575

76-
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'
77-
78-
4 {
79-
   ~
80-
5 "path": "../other"
81-
  ~~~~~~~~~~~~~~~~~~~~~~~~
82-
6 }
83-
  ~~~~~
76+
error TS5033: Could not write file '/src/dist/tsconfig.tsbuildinfo': Debug Failure. False expression..
8477

8578

8679
Found 1 error.
8780

8881
exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated
8982

9083

84+
//// [/src/dist/a.d.ts]
85+
export {};
86+
87+
88+
//// [/src/dist/a.js]
89+
"use strict";
90+
Object.defineProperty(exports, "__esModule", { value: true });
91+
var b_1 = require("./b");
92+
var a = b_1.b;
93+
94+
95+
//// [/src/dist/b.d.ts]
96+
export declare const b = 0;
97+
98+
99+
//// [/src/dist/b.js]
100+
"use strict";
101+
Object.defineProperty(exports, "__esModule", { value: true });
102+
exports.b = void 0;
103+
exports.b = 0;
104+
105+
91106
//// [/src/dist/other.d.ts]
92107
export declare const Other = 0;
93108

tests/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file.js

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,36 @@ Output::
7979

8080
[12:00:27 AM] Building project '/src/src/main/tsconfig.json'...
8181

82-
src/src/main/tsconfig.json:7:5 - error TS6377: Cannot write file '/src/dist/tsconfig.tsbuildinfo' because it will overwrite '.tsbuildinfo' file generated by referenced project '/src/src/other'
83-
84-
7 {
85-
   ~
86-
8 "path": "../other"
87-
  ~~~~~~~~~~~~~~~~~~~~~~~~
88-
9 }
89-
  ~~~~~
82+
error TS5033: Could not write file '/src/dist/tsconfig.tsbuildinfo': Debug Failure. False expression..
9083

9184

9285
Found 1 error.
9386

9487
exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated
9588

9689

90+
//// [/src/dist/a.d.ts]
91+
export {};
92+
93+
94+
//// [/src/dist/a.js]
95+
"use strict";
96+
Object.defineProperty(exports, "__esModule", { value: true });
97+
var b_1 = require("./b");
98+
var a = b_1.b;
99+
100+
101+
//// [/src/dist/b.d.ts]
102+
export declare const b = 0;
103+
104+
105+
//// [/src/dist/b.js]
106+
"use strict";
107+
Object.defineProperty(exports, "__esModule", { value: true });
108+
exports.b = void 0;
109+
exports.b = 0;
110+
111+
97112
//// [/src/dist/other.d.ts]
98113
export declare const Other = 0;
99114

tests/baselines/reference/tsserver/applyChangesToOpenFiles/with-applyChangedToOpenFiles-request.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ Info seq [hh:mm:ss:mss] event:
124124
"deferred": 0,
125125
"deferredSize": 0
126126
},
127-
"compilerOptions": {},
127+
"compilerOptions": {
128+
"allowNonTsExtensions": true
129+
},
128130
"typeAcquisition": {
129131
"enable": false,
130132
"include": false,

tests/baselines/reference/tsserver/applyChangesToOpenFiles/with-updateOpen-request.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ Info seq [hh:mm:ss:mss] event:
124124
"deferred": 0,
125125
"deferredSize": 0
126126
},
127-
"compilerOptions": {},
127+
"compilerOptions": {
128+
"allowNonTsExtensions": true
129+
},
128130
"typeAcquisition": {
129131
"enable": false,
130132
"include": false,

tests/baselines/reference/tsserver/autoImportProvider/Auto-importable-file-is-in-inferred-project-until-imported.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@ Info seq [hh:mm:ss:mss] event:
329329
"deferredSize": 0
330330
},
331331
"compilerOptions": {
332-
"module": "commonjs"
332+
"module": "commonjs",
333+
"allowNonTsExtensions": true
333334
},
334335
"typeAcquisition": {
335336
"enable": false,

tests/baselines/reference/tsserver/autoImportProvider/Closes-AutoImportProviderProject-when-host-project-closes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ Info seq [hh:mm:ss:mss] event:
139139
"deferredSize": 0
140140
},
141141
"compilerOptions": {
142-
"module": "commonjs"
142+
"module": "commonjs",
143+
"allowNonTsExtensions": true
143144
},
144145
"typeAcquisition": {
145146
"enable": false,

tests/baselines/reference/tsserver/autoImportProvider/Does-not-close-when-root-files-are-redirects-that-dont-actually-exist.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ Info seq [hh:mm:ss:mss] event:
161161
"deferredSize": 0
162162
},
163163
"compilerOptions": {
164-
"composite": true
164+
"composite": true,
165+
"allowNonTsExtensions": true
165166
},
166167
"typeAcquisition": {
167168
"enable": false,

tests/baselines/reference/tsserver/autoImportProvider/Does-not-create-an-auto-import-provider-if-there-are-too-many-dependencies.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ Info seq [hh:mm:ss:mss] event:
196196
"deferredSize": 0
197197
},
198198
"compilerOptions": {
199-
"module": "commonjs"
199+
"module": "commonjs",
200+
"allowNonTsExtensions": true
200201
},
201202
"typeAcquisition": {
202203
"enable": false,

tests/baselines/reference/tsserver/autoImportProvider/Does-not-create-auto-import-providers-upon-opening-projects-for-find-all-references.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ Info seq [hh:mm:ss:mss] event:
155155
"deferredSize": 0
156156
},
157157
"compilerOptions": {
158-
"composite": true
158+
"composite": true,
159+
"allowNonTsExtensions": true
159160
},
160161
"typeAcquisition": {
161162
"enable": false,
@@ -414,7 +415,9 @@ Info seq [hh:mm:ss:mss] event:
414415
"deferred": 0,
415416
"deferredSize": 0
416417
},
417-
"compilerOptions": {},
418+
"compilerOptions": {
419+
"allowNonTsExtensions": true
420+
},
418421
"typeAcquisition": {
419422
"enable": false,
420423
"include": false,
@@ -548,7 +551,8 @@ Info seq [hh:mm:ss:mss] event:
548551
"deferredSize": 0
549552
},
550553
"compilerOptions": {
551-
"composite": true
554+
"composite": true,
555+
"allowNonTsExtensions": true
552556
},
553557
"typeAcquisition": {
554558
"enable": false,

tests/baselines/reference/tsserver/autoImportProvider/Does-not-schedule-ensureProjectForOpenFiles-on-AutoImportProviderProject-creation.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ Info seq [hh:mm:ss:mss] event:
120120
"deferredSize": 0
121121
},
122122
"compilerOptions": {
123-
"module": "commonjs"
123+
"module": "commonjs",
124+
"allowNonTsExtensions": true
124125
},
125126
"typeAcquisition": {
126127
"enable": false,

tests/baselines/reference/tsserver/autoImportProvider/Recovers-from-an-unparseable-package_json.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ Info seq [hh:mm:ss:mss] event:
124124
"deferredSize": 0
125125
},
126126
"compilerOptions": {
127-
"module": "commonjs"
127+
"module": "commonjs",
128+
"allowNonTsExtensions": true
128129
},
129130
"typeAcquisition": {
130131
"enable": false,

tests/baselines/reference/tsserver/autoImportProvider/Responds-to-automatic-changes-in-node_modules.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ Info seq [hh:mm:ss:mss] event:
148148
"deferredSize": 0
149149
},
150150
"compilerOptions": {
151-
"module": "commonjs"
151+
"module": "commonjs",
152+
"allowNonTsExtensions": true
152153
},
153154
"typeAcquisition": {
154155
"enable": false,

tests/baselines/reference/tsserver/autoImportProvider/Responds-to-manual-changes-in-node_modules.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ Info seq [hh:mm:ss:mss] event:
148148
"deferredSize": 0
149149
},
150150
"compilerOptions": {
151-
"module": "commonjs"
151+
"module": "commonjs",
152+
"allowNonTsExtensions": true
152153
},
153154
"typeAcquisition": {
154155
"enable": false,

tests/baselines/reference/tsserver/autoImportProvider/Responds-to-package_json-changes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ Info seq [hh:mm:ss:mss] event:
124124
"deferredSize": 0
125125
},
126126
"compilerOptions": {
127-
"module": "commonjs"
127+
"module": "commonjs",
128+
"allowNonTsExtensions": true
128129
},
129130
"typeAcquisition": {
130131
"enable": false,

tests/baselines/reference/tsserver/autoImportProvider/Reuses-autoImportProvider-when-program-structure-is-unchanged.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ Info seq [hh:mm:ss:mss] event:
139139
"deferredSize": 0
140140
},
141141
"compilerOptions": {
142-
"module": "commonjs"
142+
"module": "commonjs",
143+
"allowNonTsExtensions": true
143144
},
144145
"typeAcquisition": {
145146
"enable": false,

tests/baselines/reference/tsserver/autoImportProvider/Shared-source-files-between-AutoImportProvider-and-main-program.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ Info seq [hh:mm:ss:mss] event:
165165
"compilerOptions": {
166166
"types": [
167167
""
168-
]
168+
],
169+
"allowNonTsExtensions": true
169170
},
170171
"typeAcquisition": {
171172
"enable": false,

tests/baselines/reference/tsserver/autoImportProvider/dependencies-are-already-in-main-program.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ Info seq [hh:mm:ss:mss] event:
130130
"deferredSize": 0
131131
},
132132
"compilerOptions": {
133-
"module": "commonjs"
133+
"module": "commonjs",
134+
"allowNonTsExtensions": true
134135
},
135136
"typeAcquisition": {
136137
"enable": false,

tests/baselines/reference/tsserver/autoImportProvider/without-dependencies-listed.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ Info seq [hh:mm:ss:mss] event:
124124
"deferredSize": 0
125125
},
126126
"compilerOptions": {
127-
"module": "commonjs"
127+
"module": "commonjs",
128+
"allowNonTsExtensions": true
128129
},
129130
"typeAcquisition": {
130131
"enable": false,

tests/baselines/reference/tsserver/cachingFileSystemInformation/includes-the-parent-folder-FLLs-in-Classic-module-resolution-mode.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ Info seq [hh:mm:ss:mss] event:
127127
"deferred": 0,
128128
"deferredSize": 0
129129
},
130-
"compilerOptions": {},
130+
"compilerOptions": {
131+
"allowNonTsExtensions": true
132+
},
131133
"typeAcquisition": {
132134
"enable": false,
133135
"include": false,

tests/baselines/reference/tsserver/cachingFileSystemInformation/includes-the-parent-folder-FLLs-in-Node-module-resolution-mode.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ Info seq [hh:mm:ss:mss] event:
127127
"deferred": 0,
128128
"deferredSize": 0
129129
},
130-
"compilerOptions": {},
130+
"compilerOptions": {
131+
"allowNonTsExtensions": true
132+
},
131133
"typeAcquisition": {
132134
"enable": false,
133135
"include": false,

tests/baselines/reference/tsserver/cachingFileSystemInformation/npm-install-works-when-timeout-occurs-after-installation.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ Info seq [hh:mm:ss:mss] event:
168168
"deferred": 0,
169169
"deferredSize": 0
170170
},
171-
"compilerOptions": {},
171+
"compilerOptions": {
172+
"allowNonTsExtensions": true
173+
},
172174
"typeAcquisition": {
173175
"enable": false,
174176
"include": false,

tests/baselines/reference/tsserver/cachingFileSystemInformation/npm-install-works-when-timeout-occurs-inbetween-installation.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ Info seq [hh:mm:ss:mss] event:
168168
"deferred": 0,
169169
"deferredSize": 0
170170
},
171-
"compilerOptions": {},
171+
"compilerOptions": {
172+
"allowNonTsExtensions": true
173+
},
172174
"typeAcquisition": {
173175
"enable": false,
174176
"include": false,

tests/baselines/reference/tsserver/cachingFileSystemInformation/watchDirectories-for-config-file-with-case-insensitive-file-system.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ Info seq [hh:mm:ss:mss] event:
201201
""
202202
],
203203
"baseUrl": "",
204-
"paths": ""
204+
"paths": "",
205+
"allowNonTsExtensions": true
205206
},
206207
"typeAcquisition": {
207208
"enable": false,

0 commit comments

Comments
 (0)