@rushstack/heft-typescript-plugin 0.7.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +20 -0
- package/CHANGELOG.md +8 -1
- package/dist/heft-typescript-plugin.d.ts +132 -3
- package/lib/TypeScriptBuilder.d.ts +11 -9
- package/lib/TypeScriptBuilder.d.ts.map +1 -1
- package/lib/TypeScriptBuilder.js +28 -76
- package/lib/TypeScriptBuilder.js.map +1 -1
- package/lib/TypeScriptPlugin.d.ts.map +1 -1
- package/lib/TypeScriptPlugin.js +4 -9
- package/lib/TypeScriptPlugin.js.map +1 -1
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +6 -1
- package/lib/index.js.map +1 -1
- package/lib/internalTypings/TypeScriptInternals.d.ts +6 -0
- package/lib/internalTypings/TypeScriptInternals.d.ts.map +1 -1
- package/lib/internalTypings/TypeScriptInternals.js.map +1 -1
- package/lib/loadTypeScriptTool.d.ts +42 -0
- package/lib/loadTypeScriptTool.d.ts.map +1 -0
- package/lib/loadTypeScriptTool.js +78 -0
- package/lib/loadTypeScriptTool.js.map +1 -0
- package/lib/tsconfigLoader.d.ts +20 -0
- package/lib/tsconfigLoader.d.ts.map +1 -0
- package/lib/tsconfigLoader.js +40 -0
- package/lib/tsconfigLoader.js.map +1 -0
- package/package.json +3 -3
|
@@ -3,6 +3,9 @@ export interface IExtendedSolutionBuilder extends TTypescript.SolutionBuilder<TT
|
|
|
3
3
|
getBuildOrder(): readonly string[];
|
|
4
4
|
invalidateProject(configFilePath: string, mode: 0 | 1 | 2): void;
|
|
5
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
6
9
|
export interface ITypeScriptNodeSystem extends TTypescript.System {
|
|
7
10
|
/**
|
|
8
11
|
* https://github.com/microsoft/TypeScript/blob/d85767abfd83880cea17cea70f9913e9c4496dcc/src/compiler/sys.ts#L1438
|
|
@@ -12,6 +15,9 @@ export interface ITypeScriptNodeSystem extends TTypescript.System {
|
|
|
12
15
|
directories: string[];
|
|
13
16
|
};
|
|
14
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
15
21
|
export interface IExtendedTypeScript {
|
|
16
22
|
/**
|
|
17
23
|
* https://github.com/microsoft/TypeScript/blob/5f597e69b2e3b48d788cb548df40bcb703c8adb1/src/compiler/performance.ts#L3
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeScriptInternals.d.ts","sourceRoot":"","sources":["../../src/internalTypings/TypeScriptInternals.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,WAAW,MAAM,YAAY,CAAC;AAE/C,MAAM,WAAW,wBACf,SAAQ,WAAW,CAAC,eAAe,CAAC,WAAW,CAAC,wCAAwC,CAAC;IACzF,aAAa,IAAI,SAAS,MAAM,EAAE,CAAC;IACnC,iBAAiB,CAAC,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;CAClE;AAED,MAAM,WAAW,qBAAsB,SAAQ,WAAW,CAAC,MAAM;IAC/D;;OAEG;IACH,8BAA8B,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK;QACvD,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,WAAW,EAAE,MAAM,EAAE,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,WAAW,EAAE;QACX;;WAEG;QACH,OAAO,IAAI,IAAI,CAAC;QAEhB;;WAEG;QACH,MAAM,IAAI,IAAI,CAAC;QAEf;;WAEG;QACH,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;QAErC;;WAEG;QACH,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,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EAAE,MAAM,EACxB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,oBAAoB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK;QACtC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;QACtC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;KAC7C,EACD,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EAClC,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GACzC,MAAM,EAAE,CAAC;IAEZ,WAAW,EAAE;QAGX,uCAAuC,EAAE,WAAW,CAAC,iBAAiB,CAAC;QAIvE,wCAAwC,EAAE,WAAW,CAAC,iBAAiB,CAAC;QAIxE,+EAA+E,EAAE,WAAW,CAAC,iBAAiB,CAAC;QAI/G,6FAA6F,EAAE,WAAW,CAAC,iBAAiB,CAAC;KAC9H,CAAC;CACH;AAED,MAAM,MAAM,kBAAkB,GAAG,OAAO,WAAW,GAAG,mBAAmB,CAAC;AAE1E,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC,cAAc,GAAG;IAChE;;OAEG;IACH,KAAK,CAAC,EAAE;QAAE,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;KAAE,CAAC;IACzC;;OAEG;IACH,QAAQ,IAAI;QAAE,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;KAAE,CAAC;CAC9C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeScriptInternals.js","sourceRoot":"","sources":["../../src/internalTypings/TypeScriptInternals.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type * as TTypescript from 'typescript';\n\nexport interface IExtendedSolutionBuilder\n extends TTypescript.SolutionBuilder<TTypescript.EmitAndSemanticDiagnosticsBuilderProgram> {\n getBuildOrder(): readonly string[];\n invalidateProject(configFilePath: string, mode: 0 | 1 | 2): void;\n}\n\nexport interface ITypeScriptNodeSystem extends TTypescript.System {\n /**\n * https://github.com/microsoft/TypeScript/blob/d85767abfd83880cea17cea70f9913e9c4496dcc/src/compiler/sys.ts#L1438\n */\n getAccessibleFileSystemEntries?: (folderPath: string) => {\n files: string[];\n directories: string[];\n };\n}\n\nexport interface IExtendedTypeScript {\n /**\n * https://github.com/microsoft/TypeScript/blob/5f597e69b2e3b48d788cb548df40bcb703c8adb1/src/compiler/performance.ts#L3\n */\n performance: {\n /**\n * https://github.com/microsoft/TypeScript/blob/5f597e69b2e3b48d788cb548df40bcb703c8adb1/src/compiler/performance.ts#L119-L121\n */\n disable(): void;\n\n /**\n * https://github.com/microsoft/TypeScript/blob/5f597e69b2e3b48d788cb548df40bcb703c8adb1/src/compiler/performance.ts#L110-L116\n */\n enable(): void;\n\n /**\n * https://github.com/microsoft/TypeScript/blob/5f597e69b2e3b48d788cb548df40bcb703c8adb1/src/compiler/performance.ts#L55-L61\n */\n mark(performanceMaker: string): void;\n\n /**\n * https://github.com/microsoft/TypeScript/blob/5f597e69b2e3b48d788cb548df40bcb703c8adb1/src/compiler/performance.ts#L72-L78\n */\n measure(measureName: string, startMarkName?: string, endMarkName?: string): void;\n\n /**\n * https://github.com/microsoft/TypeScript/blob/5f597e69b2e3b48d788cb548df40bcb703c8adb1/src/compiler/performance.ts#L94-L96\n */\n getDuration(measureName: string): number;\n\n /**\n * https://github.com/microsoft/TypeScript/blob/5f597e69b2e3b48d788cb548df40bcb703c8adb1/src/compiler/performance.ts#L85-L87\n */\n getCount(measureName: string): number;\n };\n\n transpileOptionValueCompilerOptions: {\n name: keyof TTypescript.CompilerOptions;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n transpileOptionValue: any;\n }[];\n\n getNewLineCharacter(compilerOptions: TTypescript.CompilerOptions): string;\n\n createCompilerHost(\n options: TTypescript.CompilerOptions,\n setParentNodes?: boolean,\n system?: TTypescript.System\n ): TTypescript.CompilerHost;\n\n createCompilerHostWorker(\n options: TTypescript.CompilerOptions,\n setParentNodes?: boolean,\n system?: TTypescript.System\n ): TTypescript.CompilerHost;\n\n /**\n * https://github.com/microsoft/TypeScript/blob/782c09d783e006a697b4ba6d1e7ec2f718ce8393/src/compiler/utilities.ts#L6540\n */\n matchFiles(\n path: string,\n extensions: ReadonlyArray<string> | undefined,\n excludes: ReadonlyArray<string> | undefined,\n includes: ReadonlyArray<string> | undefined,\n useCaseSensitiveFileNames: boolean,\n currentDirectory: string,\n depth: number | undefined,\n getFileSystemEntries: (path: string) => {\n readonly files: ReadonlyArray<string>;\n readonly directories: ReadonlyArray<string>;\n },\n realpath: (path: string) => string,\n directoryExists: (path: string) => boolean\n ): string[];\n\n Diagnostics: {\n // https://github.com/microsoft/TypeScript/blob/5f597e69b2e3b48d788cb548df40bcb703c8adb1/src/compiler/diagnosticMessages.json#L4252-L4255\n // eslint-disable-next-line @typescript-eslint/naming-convention\n Found_1_error_Watching_for_file_changes: TTypescript.DiagnosticMessage;\n\n // https://github.com/microsoft/TypeScript/blob/5f597e69b2e3b48d788cb548df40bcb703c8adb1/src/compiler/diagnosticMessages.json#L4256-L4259\n // eslint-disable-next-line @typescript-eslint/naming-convention\n Found_0_errors_Watching_for_file_changes: TTypescript.DiagnosticMessage;\n\n // https://github.com/microsoft/TypeScript/blob/2428ade1a91248e847f3e1561e31a9426650efee/src/compiler/diagnosticMessages.json#L2252\n // eslint-disable-next-line @typescript-eslint/naming-convention\n Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor: TTypescript.DiagnosticMessage;\n\n // https://github.com/microsoft/TypeScript/blob/2428ade1a91248e847f3e1561e31a9426650efee/src/compiler/diagnosticMessages.json#L4920\n // eslint-disable-next-line @typescript-eslint/naming-convention\n Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1: TTypescript.DiagnosticMessage;\n };\n}\n\nexport type ExtendedTypeScript = typeof TTypescript & IExtendedTypeScript;\n\nexport type ExtendedBuilderProgram = TTypescript.BuilderProgram & {\n /**\n * Typescript 5.6+\n */\n state?: { changedFilesSet: Set<string> };\n /**\n * Typescript < 5.6\n */\n getState(): { changedFilesSet: Set<string> };\n};\n"]}
|
|
1
|
+
{"version":3,"file":"TypeScriptInternals.js","sourceRoot":"","sources":["../../src/internalTypings/TypeScriptInternals.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type * as TTypescript from 'typescript';\n\nexport interface IExtendedSolutionBuilder\n extends TTypescript.SolutionBuilder<TTypescript.EmitAndSemanticDiagnosticsBuilderProgram> {\n getBuildOrder(): readonly string[];\n invalidateProject(configFilePath: string, mode: 0 | 1 | 2): void;\n}\n\n/**\n * @internal\n */\nexport interface ITypeScriptNodeSystem extends TTypescript.System {\n /**\n * https://github.com/microsoft/TypeScript/blob/d85767abfd83880cea17cea70f9913e9c4496dcc/src/compiler/sys.ts#L1438\n */\n getAccessibleFileSystemEntries?: (folderPath: string) => {\n files: string[];\n directories: string[];\n };\n}\n\n/**\n * @internal\n */\nexport interface IExtendedTypeScript {\n /**\n * https://github.com/microsoft/TypeScript/blob/5f597e69b2e3b48d788cb548df40bcb703c8adb1/src/compiler/performance.ts#L3\n */\n performance: {\n /**\n * https://github.com/microsoft/TypeScript/blob/5f597e69b2e3b48d788cb548df40bcb703c8adb1/src/compiler/performance.ts#L119-L121\n */\n disable(): void;\n\n /**\n * https://github.com/microsoft/TypeScript/blob/5f597e69b2e3b48d788cb548df40bcb703c8adb1/src/compiler/performance.ts#L110-L116\n */\n enable(): void;\n\n /**\n * https://github.com/microsoft/TypeScript/blob/5f597e69b2e3b48d788cb548df40bcb703c8adb1/src/compiler/performance.ts#L55-L61\n */\n mark(performanceMaker: string): void;\n\n /**\n * https://github.com/microsoft/TypeScript/blob/5f597e69b2e3b48d788cb548df40bcb703c8adb1/src/compiler/performance.ts#L72-L78\n */\n measure(measureName: string, startMarkName?: string, endMarkName?: string): void;\n\n /**\n * https://github.com/microsoft/TypeScript/blob/5f597e69b2e3b48d788cb548df40bcb703c8adb1/src/compiler/performance.ts#L94-L96\n */\n getDuration(measureName: string): number;\n\n /**\n * https://github.com/microsoft/TypeScript/blob/5f597e69b2e3b48d788cb548df40bcb703c8adb1/src/compiler/performance.ts#L85-L87\n */\n getCount(measureName: string): number;\n };\n\n transpileOptionValueCompilerOptions: {\n name: keyof TTypescript.CompilerOptions;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n transpileOptionValue: any;\n }[];\n\n getNewLineCharacter(compilerOptions: TTypescript.CompilerOptions): string;\n\n createCompilerHost(\n options: TTypescript.CompilerOptions,\n setParentNodes?: boolean,\n system?: TTypescript.System\n ): TTypescript.CompilerHost;\n\n createCompilerHostWorker(\n options: TTypescript.CompilerOptions,\n setParentNodes?: boolean,\n system?: TTypescript.System\n ): TTypescript.CompilerHost;\n\n /**\n * https://github.com/microsoft/TypeScript/blob/782c09d783e006a697b4ba6d1e7ec2f718ce8393/src/compiler/utilities.ts#L6540\n */\n matchFiles(\n path: string,\n extensions: ReadonlyArray<string> | undefined,\n excludes: ReadonlyArray<string> | undefined,\n includes: ReadonlyArray<string> | undefined,\n useCaseSensitiveFileNames: boolean,\n currentDirectory: string,\n depth: number | undefined,\n getFileSystemEntries: (path: string) => {\n readonly files: ReadonlyArray<string>;\n readonly directories: ReadonlyArray<string>;\n },\n realpath: (path: string) => string,\n directoryExists: (path: string) => boolean\n ): string[];\n\n Diagnostics: {\n // https://github.com/microsoft/TypeScript/blob/5f597e69b2e3b48d788cb548df40bcb703c8adb1/src/compiler/diagnosticMessages.json#L4252-L4255\n // eslint-disable-next-line @typescript-eslint/naming-convention\n Found_1_error_Watching_for_file_changes: TTypescript.DiagnosticMessage;\n\n // https://github.com/microsoft/TypeScript/blob/5f597e69b2e3b48d788cb548df40bcb703c8adb1/src/compiler/diagnosticMessages.json#L4256-L4259\n // eslint-disable-next-line @typescript-eslint/naming-convention\n Found_0_errors_Watching_for_file_changes: TTypescript.DiagnosticMessage;\n\n // https://github.com/microsoft/TypeScript/blob/2428ade1a91248e847f3e1561e31a9426650efee/src/compiler/diagnosticMessages.json#L2252\n // eslint-disable-next-line @typescript-eslint/naming-convention\n Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor: TTypescript.DiagnosticMessage;\n\n // https://github.com/microsoft/TypeScript/blob/2428ade1a91248e847f3e1561e31a9426650efee/src/compiler/diagnosticMessages.json#L4920\n // eslint-disable-next-line @typescript-eslint/naming-convention\n Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1: TTypescript.DiagnosticMessage;\n };\n}\n\nexport type ExtendedTypeScript = typeof TTypescript & IExtendedTypeScript;\n\nexport type ExtendedBuilderProgram = TTypescript.BuilderProgram & {\n /**\n * Typescript 5.6+\n */\n state?: { changedFilesSet: Set<string> };\n /**\n * Typescript < 5.6\n */\n getState(): { changedFilesSet: Set<string> };\n};\n"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import semver from 'semver';
|
|
2
|
+
import type { HeftConfiguration } from '@rushstack/heft';
|
|
3
|
+
import type { ITerminal } from '@rushstack/terminal';
|
|
4
|
+
import type { IBaseTypeScriptTool } from './TypeScriptBuilder';
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export interface ILoadedTypeScriptTool {
|
|
9
|
+
tool: IBaseTypeScriptTool;
|
|
10
|
+
typescriptVersion: string;
|
|
11
|
+
typescriptParsedVersion: semver.SemVer;
|
|
12
|
+
capabilities: ICompilerCapabilities;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export interface ICompilerCapabilities {
|
|
18
|
+
/**
|
|
19
|
+
* Support for incremental compilation via `ts.createIncrementalProgram()`.
|
|
20
|
+
* Introduced with TypeScript 3.6.
|
|
21
|
+
*/
|
|
22
|
+
incrementalProgram: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Support for composite projects via `ts.createSolutionBuilder()`.
|
|
25
|
+
* Introduced with TypeScript 3.0.
|
|
26
|
+
*/
|
|
27
|
+
solutionBuilder: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
export interface ILoadTypeScriptToolOptions {
|
|
33
|
+
terminal: ITerminal;
|
|
34
|
+
heftConfiguration: HeftConfiguration;
|
|
35
|
+
onlyResolveSymlinksInNodeModules?: boolean;
|
|
36
|
+
buildProjectReferences?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export declare function loadTypeScriptToolAsync(options: ILoadTypeScriptToolOptions): Promise<ILoadedTypeScriptTool>;
|
|
42
|
+
//# sourceMappingURL=loadTypeScriptTool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadTypeScriptTool.d.ts","sourceRoot":"","sources":["../src/loadTypeScriptTool.ts"],"names":[],"mappings":"AAGA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAQ/D;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,uBAAuB,EAAE,MAAM,CAAC,MAAM,CAAC;IACvC,YAAY,EAAE,qBAAqB,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,kBAAkB,EAAE,OAAO,CAAC;IAE5B;;;OAGG;IACH,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,SAAS,CAAC;IACpB,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,gCAAgC,CAAC,EAAE,OAAO,CAAC;IAC3C,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,qBAAqB,CAAC,CAuFhC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
3
|
+
// See LICENSE in the project root for license information.
|
|
4
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
|
+
};
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.loadTypeScriptToolAsync = loadTypeScriptToolAsync;
|
|
9
|
+
const semver_1 = __importDefault(require("semver"));
|
|
10
|
+
const node_core_library_1 = require("@rushstack/node-core-library");
|
|
11
|
+
const OLDEST_SUPPORTED_TS_MAJOR_VERSION = 2;
|
|
12
|
+
const OLDEST_SUPPORTED_TS_MINOR_VERSION = 9;
|
|
13
|
+
const NEWEST_SUPPORTED_TS_MAJOR_VERSION = 5;
|
|
14
|
+
const NEWEST_SUPPORTED_TS_MINOR_VERSION = 8;
|
|
15
|
+
/**
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
async function loadTypeScriptToolAsync(options) {
|
|
19
|
+
const { terminal, heftConfiguration, buildProjectReferences, onlyResolveSymlinksInNodeModules } = options;
|
|
20
|
+
const typeScriptToolPath = await heftConfiguration.rigPackageResolver.resolvePackageAsync('typescript', terminal);
|
|
21
|
+
// Determine the compiler version
|
|
22
|
+
const compilerPackageJsonFilename = `${typeScriptToolPath}/package.json`;
|
|
23
|
+
const packageJson = await node_core_library_1.JsonFile.loadAsync(compilerPackageJsonFilename);
|
|
24
|
+
const typescriptVersion = packageJson.version;
|
|
25
|
+
const typescriptParsedVersion = semver_1.default.parse(typescriptVersion);
|
|
26
|
+
if (!typescriptParsedVersion) {
|
|
27
|
+
throw new Error(`Unable to parse version "${typescriptVersion}" for TypeScript compiler package in: ` +
|
|
28
|
+
compilerPackageJsonFilename);
|
|
29
|
+
}
|
|
30
|
+
// Detect what features this compiler supports. Note that manually comparing major/minor numbers
|
|
31
|
+
// loosens the matching to accept prereleases such as "3.6.0-dev.20190530"
|
|
32
|
+
const capabilities = {
|
|
33
|
+
incrementalProgram: false,
|
|
34
|
+
solutionBuilder: typescriptParsedVersion.major >= 3
|
|
35
|
+
};
|
|
36
|
+
if (typescriptParsedVersion.major > 3 ||
|
|
37
|
+
(typescriptParsedVersion.major === 3 && typescriptParsedVersion.minor >= 6)) {
|
|
38
|
+
capabilities.incrementalProgram = true;
|
|
39
|
+
}
|
|
40
|
+
if (buildProjectReferences && !capabilities.solutionBuilder) {
|
|
41
|
+
throw new Error(`Building project references requires TypeScript@>=3.0, but the current version is ${typescriptVersion}`);
|
|
42
|
+
}
|
|
43
|
+
// Report a warning if the TypeScript version is too old/new. The current oldest supported version is
|
|
44
|
+
// TypeScript 2.9. Prior to that the "ts.getConfigFileParsingDiagnostics()" API is missing; more fixups
|
|
45
|
+
// would be required to deal with that. We won't do that work unless someone requests it.
|
|
46
|
+
if (typescriptParsedVersion.major < OLDEST_SUPPORTED_TS_MAJOR_VERSION ||
|
|
47
|
+
(typescriptParsedVersion.major === OLDEST_SUPPORTED_TS_MAJOR_VERSION &&
|
|
48
|
+
typescriptParsedVersion.minor < OLDEST_SUPPORTED_TS_MINOR_VERSION)) {
|
|
49
|
+
// We don't use writeWarningLine() here because, if the person wants to take their chances with
|
|
50
|
+
// a seemingly unsupported compiler, their build should be allowed to succeed.
|
|
51
|
+
terminal.writeLine(`The TypeScript compiler version ${typescriptVersion} is very old` +
|
|
52
|
+
` and has not been tested with Heft; it may not work correctly.`);
|
|
53
|
+
}
|
|
54
|
+
else if (typescriptParsedVersion.major > NEWEST_SUPPORTED_TS_MAJOR_VERSION ||
|
|
55
|
+
(typescriptParsedVersion.major === NEWEST_SUPPORTED_TS_MAJOR_VERSION &&
|
|
56
|
+
typescriptParsedVersion.minor > NEWEST_SUPPORTED_TS_MINOR_VERSION)) {
|
|
57
|
+
terminal.writeLine(`The TypeScript compiler version ${typescriptVersion} is newer` +
|
|
58
|
+
' than the latest version that was tested with Heft ' +
|
|
59
|
+
`(${NEWEST_SUPPORTED_TS_MAJOR_VERSION}.${NEWEST_SUPPORTED_TS_MINOR_VERSION}); it may not work correctly.`);
|
|
60
|
+
}
|
|
61
|
+
const ts = require(typeScriptToolPath);
|
|
62
|
+
let realpath = ts.sys.realpath;
|
|
63
|
+
if (onlyResolveSymlinksInNodeModules) {
|
|
64
|
+
const resolver = new node_core_library_1.RealNodeModulePathResolver();
|
|
65
|
+
realpath = resolver.realNodeModulePath;
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
tool: {
|
|
69
|
+
ts,
|
|
70
|
+
system: Object.assign(Object.assign({}, ts.sys), { realpath }),
|
|
71
|
+
typeScriptToolPath
|
|
72
|
+
},
|
|
73
|
+
typescriptVersion,
|
|
74
|
+
typescriptParsedVersion,
|
|
75
|
+
capabilities
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=loadTypeScriptTool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadTypeScriptTool.js","sourceRoot":"","sources":["../src/loadTypeScriptTool.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;AAwD3D,0DAyFC;AA/ID,oDAA4B;AAG5B,oEAAuG;AAKvG,MAAM,iCAAiC,GAAW,CAAC,CAAC;AACpD,MAAM,iCAAiC,GA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CAAC;IAED,sGAAsG;IACtG,uGAAuG;IACvG,0FAA0F;IAC1F,IACE,uBAAuB,CAAC,KAAK,GAAG,iCAAiC;QACjE,CAAC,uBAAuB,CAAC,KAAK,KAAK,iCAAiC;YAClE,uBAAuB,CAAC,KAAK,GAAG,iCAAiC,CAAC,EACpE,CAAC;QACD,+FAA+F;QAC/F,8EAA8E;QAC9E,QAAQ,CAAC,SAAS,CAChB,mCAAmC,iBAAiB,cAAc;YAChE,gEAAgE,CACnE,CAAC;IACJ,CAAC;SAAM,IACL,uBAAuB,CAAC,KAAK,GAAG,iCAAiC;QACjE,CAAC,uBAAuB,CAAC,KAAK,KAAK,iCAAiC;YAClE,uBAAuB,CAAC,KAAK,GAAG,iCAAiC,CAAC,EACpE,CAAC;QACD,QAAQ,CAAC,SAAS,CAChB,mCAAmC,iBAAiB,WAAW;YAC7D,qDAAqD;YACrD,IAAI,iCAAiC,IAAI,iCAAiC,+BAA+B,CAC5G,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,GAAuB,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAE3D,IAAI,QAAQ,GAA2B,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC;IACvD,IAAI,gCAAgC,EAAE,CAAC;QACrC,MAAM,QAAQ,GAA+B,IAAI,8CAA0B,EAAE,CAAC;QAC9E,QAAQ,GAAG,QAAQ,CAAC,kBAAkB,CAAC;IACzC,CAAC;IAED,OAAO;QACL,IAAI,EAAE;YACJ,EAAE;YACF,MAAM,kCACD,EAAE,CAAC,GAAG,KACT,QAAQ,GACT;YACD,kBAAkB;SACnB;QACD,iBAAiB;QACjB,uBAAuB;QACvB,YAAY;KACb,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport semver from 'semver';\nimport type { HeftConfiguration } from '@rushstack/heft';\nimport type { ITerminal } from '@rushstack/terminal';\nimport { type IPackageJson, JsonFile, RealNodeModulePathResolver } from '@rushstack/node-core-library';\n\nimport type { ExtendedTypeScript } from './internalTypings/TypeScriptInternals';\nimport type { IBaseTypeScriptTool } from './TypeScriptBuilder';\n\nconst OLDEST_SUPPORTED_TS_MAJOR_VERSION: number = 2;\nconst OLDEST_SUPPORTED_TS_MINOR_VERSION: number = 9;\n\nconst NEWEST_SUPPORTED_TS_MAJOR_VERSION: number = 5;\nconst NEWEST_SUPPORTED_TS_MINOR_VERSION: number = 8;\n\n/**\n * @internal\n */\nexport interface ILoadedTypeScriptTool {\n tool: IBaseTypeScriptTool;\n typescriptVersion: string;\n typescriptParsedVersion: semver.SemVer;\n capabilities: ICompilerCapabilities;\n}\n\n/**\n * @internal\n */\nexport interface ICompilerCapabilities {\n /**\n * Support for incremental compilation via `ts.createIncrementalProgram()`.\n * Introduced with TypeScript 3.6.\n */\n incrementalProgram: boolean;\n\n /**\n * Support for composite projects via `ts.createSolutionBuilder()`.\n * Introduced with TypeScript 3.0.\n */\n solutionBuilder: boolean;\n}\n\n/**\n * @internal\n */\nexport interface ILoadTypeScriptToolOptions {\n terminal: ITerminal;\n heftConfiguration: HeftConfiguration;\n onlyResolveSymlinksInNodeModules?: boolean;\n buildProjectReferences?: boolean;\n}\n\n/**\n * @internal\n */\nexport async function loadTypeScriptToolAsync(\n options: ILoadTypeScriptToolOptions\n): Promise<ILoadedTypeScriptTool> {\n const { terminal, heftConfiguration, buildProjectReferences, onlyResolveSymlinksInNodeModules } = options;\n\n const typeScriptToolPath: string = await heftConfiguration.rigPackageResolver.resolvePackageAsync(\n 'typescript',\n terminal\n );\n\n // Determine the compiler version\n const compilerPackageJsonFilename: string = `${typeScriptToolPath}/package.json`;\n const packageJson: IPackageJson = await JsonFile.loadAsync(compilerPackageJsonFilename);\n const typescriptVersion: string = packageJson.version;\n const typescriptParsedVersion: semver.SemVer | null = semver.parse(typescriptVersion);\n if (!typescriptParsedVersion) {\n throw new Error(\n `Unable to parse version \"${typescriptVersion}\" for TypeScript compiler package in: ` +\n compilerPackageJsonFilename\n );\n }\n\n // Detect what features this compiler supports. Note that manually comparing major/minor numbers\n // loosens the matching to accept prereleases such as \"3.6.0-dev.20190530\"\n const capabilities: ICompilerCapabilities = {\n incrementalProgram: false,\n solutionBuilder: typescriptParsedVersion.major >= 3\n };\n\n if (\n typescriptParsedVersion.major > 3 ||\n (typescriptParsedVersion.major === 3 && typescriptParsedVersion.minor >= 6)\n ) {\n capabilities.incrementalProgram = true;\n }\n\n if (buildProjectReferences && !capabilities.solutionBuilder) {\n throw new Error(\n `Building project references requires TypeScript@>=3.0, but the current version is ${typescriptVersion}`\n );\n }\n\n // Report a warning if the TypeScript version is too old/new. The current oldest supported version is\n // TypeScript 2.9. Prior to that the \"ts.getConfigFileParsingDiagnostics()\" API is missing; more fixups\n // would be required to deal with that. We won't do that work unless someone requests it.\n if (\n typescriptParsedVersion.major < OLDEST_SUPPORTED_TS_MAJOR_VERSION ||\n (typescriptParsedVersion.major === OLDEST_SUPPORTED_TS_MAJOR_VERSION &&\n typescriptParsedVersion.minor < OLDEST_SUPPORTED_TS_MINOR_VERSION)\n ) {\n // We don't use writeWarningLine() here because, if the person wants to take their chances with\n // a seemingly unsupported compiler, their build should be allowed to succeed.\n terminal.writeLine(\n `The TypeScript compiler version ${typescriptVersion} is very old` +\n ` and has not been tested with Heft; it may not work correctly.`\n );\n } else if (\n typescriptParsedVersion.major > NEWEST_SUPPORTED_TS_MAJOR_VERSION ||\n (typescriptParsedVersion.major === NEWEST_SUPPORTED_TS_MAJOR_VERSION &&\n typescriptParsedVersion.minor > NEWEST_SUPPORTED_TS_MINOR_VERSION)\n ) {\n terminal.writeLine(\n `The TypeScript compiler version ${typescriptVersion} is newer` +\n ' than the latest version that was tested with Heft ' +\n `(${NEWEST_SUPPORTED_TS_MAJOR_VERSION}.${NEWEST_SUPPORTED_TS_MINOR_VERSION}); it may not work correctly.`\n );\n }\n\n const ts: ExtendedTypeScript = require(typeScriptToolPath);\n\n let realpath: typeof ts.sys.realpath = ts.sys.realpath;\n if (onlyResolveSymlinksInNodeModules) {\n const resolver: RealNodeModulePathResolver = new RealNodeModulePathResolver();\n realpath = resolver.realNodeModulePath;\n }\n\n return {\n tool: {\n ts,\n system: {\n ...ts.sys,\n realpath\n },\n typeScriptToolPath\n },\n typescriptVersion,\n typescriptParsedVersion,\n capabilities\n };\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type * as TTypescript from 'typescript';
|
|
2
|
+
import type { HeftConfiguration } from '@rushstack/heft';
|
|
3
|
+
import type { IBaseTypeScriptTool } from './TypeScriptBuilder';
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export interface ILoadTsconfigOptions {
|
|
8
|
+
tool: IBaseTypeScriptTool;
|
|
9
|
+
tsconfigPath: string;
|
|
10
|
+
tsCacheFilePath?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare function getTsconfigFilePath(heftConfiguration: HeftConfiguration, tsconfigRelativePath: string | undefined): string;
|
|
16
|
+
/**
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare function loadTsconfig(options: ILoadTsconfigOptions): TTypescript.ParsedCommandLine;
|
|
20
|
+
//# sourceMappingURL=tsconfigLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsconfigLoader.d.ts","sourceRoot":"","sources":["../src/tsconfigLoader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,WAAW,MAAM,YAAY,CAAC;AAE/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,iBAAiB,EAAE,iBAAiB,EACpC,oBAAoB,EAAE,MAAM,GAAG,SAAS,GACvC,MAAM,CAKR;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,oBAAoB,GAAG,WAAW,CAAC,iBAAiB,CA+BzF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
3
|
+
// See LICENSE in the project root for license information.
|
|
4
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
|
+
};
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.getTsconfigFilePath = getTsconfigFilePath;
|
|
9
|
+
exports.loadTsconfig = loadTsconfig;
|
|
10
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
11
|
+
const node_core_library_1 = require("@rushstack/node-core-library");
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
function getTsconfigFilePath(heftConfiguration, tsconfigRelativePath) {
|
|
16
|
+
return node_core_library_1.Path.convertToSlashes(
|
|
17
|
+
// Use path.resolve because the path can start with `./` or `../`
|
|
18
|
+
node_path_1.default.resolve(heftConfiguration.buildFolderPath, tsconfigRelativePath !== null && tsconfigRelativePath !== void 0 ? tsconfigRelativePath : './tsconfig.json'));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
function loadTsconfig(options) {
|
|
24
|
+
const { tool: { ts, system }, tsconfigPath, tsCacheFilePath } = options;
|
|
25
|
+
const parsedConfigFile = ts.readConfigFile(tsconfigPath, system.readFile);
|
|
26
|
+
const currentFolder = node_path_1.default.dirname(tsconfigPath);
|
|
27
|
+
const tsconfig = ts.parseJsonConfigFileContent(parsedConfigFile.config, {
|
|
28
|
+
fileExists: system.fileExists,
|
|
29
|
+
readFile: system.readFile,
|
|
30
|
+
readDirectory: system.readDirectory,
|
|
31
|
+
realpath: system.realpath,
|
|
32
|
+
useCaseSensitiveFileNames: true
|
|
33
|
+
}, currentFolder,
|
|
34
|
+
/*existingOptions:*/ undefined, tsconfigPath);
|
|
35
|
+
if (tsconfig.options.incremental) {
|
|
36
|
+
tsconfig.options.tsBuildInfoFile = tsCacheFilePath;
|
|
37
|
+
}
|
|
38
|
+
return tsconfig;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=tsconfigLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsconfigLoader.js","sourceRoot":"","sources":["../src/tsconfigLoader.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;AAqB3D,kDAQC;AAKD,oCA+BC;AA/DD,0DAA6B;AAE7B,oEAAoD;AAcpD;;GAEG;AACH,SAAgB,mBAAmB,CACjC,iBAAoC,EACpC,oBAAwC;IAExC,OAAO,wBAAI,CAAC,gBAAgB;IAC1B,iEAAiE;IACjE,mBAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,eAAe,EAAE,oBAAoB,aAApB,oBAAoB,cAApB,oBAAoB,GAAI,iBAAiB,CAAC,CAC3F,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,YAAY,CAAC,OAA6B;IACxD,MAAM,EACJ,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EACpB,YAAY,EACZ,eAAe,EAChB,GAAG,OAAO,CAAC;IACZ,MAAM,gBAAgB,GAAyC,EAAE,CAAC,cAAc,CAC9E,YAAY,EACZ,MAAM,CAAC,QAAQ,CAChB,CAAC;IAEF,MAAM,aAAa,GAAW,mBAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACzD,MAAM,QAAQ,GAAkC,EAAE,CAAC,0BAA0B,CAC3E,gBAAgB,CAAC,MAAM,EACvB;QACE,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,yBAAyB,EAAE,IAAI;KAChC,EACD,aAAa;IACb,oBAAoB,CAAC,SAAS,EAC9B,YAAY,CACb,CAAC;IAEF,IAAI,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QACjC,QAAQ,CAAC,OAAO,CAAC,eAAe,GAAG,eAAe,CAAC;IACrD,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport path from 'node:path';\nimport type * as TTypescript from 'typescript';\nimport { Path } from '@rushstack/node-core-library';\nimport type { HeftConfiguration } from '@rushstack/heft';\n\nimport type { IBaseTypeScriptTool } from './TypeScriptBuilder';\n\n/**\n * @internal\n */\nexport interface ILoadTsconfigOptions {\n tool: IBaseTypeScriptTool;\n tsconfigPath: string;\n tsCacheFilePath?: string;\n}\n\n/**\n * @internal\n */\nexport function getTsconfigFilePath(\n heftConfiguration: HeftConfiguration,\n tsconfigRelativePath: string | undefined\n): string {\n return Path.convertToSlashes(\n // Use path.resolve because the path can start with `./` or `../`\n path.resolve(heftConfiguration.buildFolderPath, tsconfigRelativePath ?? './tsconfig.json')\n );\n}\n\n/**\n * @internal\n */\nexport function loadTsconfig(options: ILoadTsconfigOptions): TTypescript.ParsedCommandLine {\n const {\n tool: { ts, system },\n tsconfigPath,\n tsCacheFilePath\n } = options;\n const parsedConfigFile: ReturnType<typeof ts.readConfigFile> = ts.readConfigFile(\n tsconfigPath,\n system.readFile\n );\n\n const currentFolder: string = path.dirname(tsconfigPath);\n const tsconfig: TTypescript.ParsedCommandLine = ts.parseJsonConfigFileContent(\n parsedConfigFile.config,\n {\n fileExists: system.fileExists,\n readFile: system.readFile,\n readDirectory: system.readDirectory,\n realpath: system.realpath,\n useCaseSensitiveFileNames: true\n },\n currentFolder,\n /*existingOptions:*/ undefined,\n tsconfigPath\n );\n\n if (tsconfig.options.incremental) {\n tsconfig.options.tsBuildInfoFile = tsCacheFilePath;\n }\n\n return tsconfig;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rushstack/heft-typescript-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Heft plugin for TypeScript",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"types": "dist/heft-typescript-plugin.d.ts",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@rushstack/heft": "0.
|
|
15
|
+
"@rushstack/heft": "0.71.0"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@types/tapable": "1.0.6",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@types/semver": "7.5.0",
|
|
28
28
|
"typescript": "~5.8.2",
|
|
29
29
|
"local-eslint-config": "1.0.0",
|
|
30
|
-
"@rushstack/heft": "0.
|
|
30
|
+
"@rushstack/heft": "0.71.0",
|
|
31
31
|
"@rushstack/terminal": "0.15.1"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|