Skip to content

Commit

Permalink
build: update to TypeScript 5.5 stable
Browse files Browse the repository at this point in the history
Updates the repo to the stable version of TypeScript 5.5. I'm holding off on updating the new projects to it due to angular/angular#56358.
  • Loading branch information
crisbeto authored and alan-agius4 committed Jun 21, 2024
1 parent eb3827a commit d1c65a2
Show file tree
Hide file tree
Showing 6 changed files with 237 additions and 419 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
"tree-kill": "1.2.2",
"ts-node": "^10.9.1",
"tslib": "2.6.3",
"typescript": "5.5.1-rc",
"typescript": "5.5.2",
"undici": "6.19.2",
"verdaccio": "5.31.1",
"verdaccio-auth-memory": "^10.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/ngtools/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
"@angular/compiler": "18.1.0-next.3",
"@angular/compiler-cli": "18.1.0-next.3",
"typescript": "5.5.1-rc",
"typescript": "5.5.2",
"webpack": "5.92.1"
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
load("//tools:defaults.bzl", "ts_library")

# files fetched on 2024-06-11 from
# https://github.com/microsoft/TypeScript/releases/tag/v5.5-rc
# files fetched on 2024-07-02 from
# https://github.com/microsoft/TypeScript/releases/tag/v5.5.2

# Commands to download:
# curl https://raw.githubusercontent.com/microsoft/TypeScript/v5.5-rc/lib/typescript.d.ts -o packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts
# curl https://raw.githubusercontent.com/microsoft/TypeScript/v5.5-rc/lib/typescript.js -o packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js
# curl https://raw.githubusercontent.com/microsoft/TypeScript/v5.5.2/lib/typescript.d.ts -o packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts
# curl https://raw.githubusercontent.com/microsoft/TypeScript/v5.5.2/lib/typescript.js -o packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript.js

licenses(["notice"]) # Apache 2.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6014,67 +6014,19 @@ declare namespace ts {
isSourceFileFromExternalLibrary(file: SourceFile): boolean;
isSourceFileDefaultLibrary(file: SourceFile): boolean;
/**
* Calculates the final resolution mode for a given module reference node. This function only returns a result when module resolution
* settings allow differing resolution between ESM imports and CJS requires, or when a mode is explicitly provided via import attributes,
* which cause an `import` or `require` condition to be used during resolution regardless of module resolution settings. In absence of
* overriding attributes, and in modes that support differing resolution, the result indicates the syntax the usage would emit to JavaScript.
* Some examples:
*
* ```ts
* // tsc foo.mts --module nodenext
* import {} from "mod";
* // Result: ESNext - the import emits as ESM due to `impliedNodeFormat` set by .mts file extension
*
* // tsc foo.cts --module nodenext
* import {} from "mod";
* // Result: CommonJS - the import emits as CJS due to `impliedNodeFormat` set by .cts file extension
*
* // tsc foo.ts --module preserve --moduleResolution bundler
* import {} from "mod";
* // Result: ESNext - the import emits as ESM due to `--module preserve` and `--moduleResolution bundler`
* // supports conditional imports/exports
*
* // tsc foo.ts --module preserve --moduleResolution node10
* import {} from "mod";
* // Result: undefined - the import emits as ESM due to `--module preserve`, but `--moduleResolution node10`
* // does not support conditional imports/exports
*
* // tsc foo.ts --module commonjs --moduleResolution node10
* import type {} from "mod" with { "resolution-mode": "import" };
* // Result: ESNext - conditional imports/exports always supported with "resolution-mode" attribute
* ```
* Calculates the final resolution mode for a given module reference node. This is the resolution mode explicitly provided via import
* attributes, if present, or the syntax the usage would have if emitted to JavaScript. In `--module node16` or `nodenext`, this may
* depend on the file's `impliedNodeFormat`. In `--module preserve`, it depends only on the input syntax of the reference. In other
* `module` modes, when overriding import attributes are not provided, this function returns `undefined`, as the result would have no
* impact on module resolution, emit, or type checking.
*/
getModeForUsageLocation(file: SourceFile, usage: StringLiteralLike): ResolutionMode;
/**
* Calculates the final resolution mode for an import at some index within a file's `imports` list. This function only returns a result
* when module resolution settings allow differing resolution between ESM imports and CJS requires, or when a mode is explicitly provided
* via import attributes, which cause an `import` or `require` condition to be used during resolution regardless of module resolution
* settings. In absence of overriding attributes, and in modes that support differing resolution, the result indicates the syntax the
* usage would emit to JavaScript. Some examples:
*
* ```ts
* // tsc foo.mts --module nodenext
* import {} from "mod";
* // Result: ESNext - the import emits as ESM due to `impliedNodeFormat` set by .mts file extension
*
* // tsc foo.cts --module nodenext
* import {} from "mod";
* // Result: CommonJS - the import emits as CJS due to `impliedNodeFormat` set by .cts file extension
*
* // tsc foo.ts --module preserve --moduleResolution bundler
* import {} from "mod";
* // Result: ESNext - the import emits as ESM due to `--module preserve` and `--moduleResolution bundler`
* // supports conditional imports/exports
*
* // tsc foo.ts --module preserve --moduleResolution node10
* import {} from "mod";
* // Result: undefined - the import emits as ESM due to `--module preserve`, but `--moduleResolution node10`
* // does not support conditional imports/exports
*
* // tsc foo.ts --module commonjs --moduleResolution node10
* import type {} from "mod" with { "resolution-mode": "import" };
* // Result: ESNext - conditional imports/exports always supported with "resolution-mode" attribute
* ```
* Calculates the final resolution mode for an import at some index within a file's `imports` list. This is the resolution mode
* explicitly provided via import attributes, if present, or the syntax the usage would have if emitted to JavaScript. In
* `--module node16` or `nodenext`, this may depend on the file's `impliedNodeFormat`. In `--module preserve`, it depends only on the
* input syntax of the reference. In other `module` modes, when overriding import attributes are not provided, this function returns
* `undefined`, as the result would have no impact on module resolution, emit, or type checking.
*/
getModeForResolutionAtIndex(file: SourceFile, index: number): ResolutionMode;
getProjectReferences(): readonly ProjectReference[] | undefined;
Expand Down Expand Up @@ -9427,43 +9379,24 @@ declare namespace ts {
function getModeForResolutionAtIndex(file: SourceFile, index: number, compilerOptions: CompilerOptions): ResolutionMode;
/**
* Use `program.getModeForUsageLocation`, which retrieves the correct `compilerOptions`, instead of this function whenever possible.
* Calculates the final resolution mode for a given module reference node. This function only returns a result when module resolution
* settings allow differing resolution between ESM imports and CJS requires, or when a mode is explicitly provided via import attributes,
* which cause an `import` or `require` condition to be used during resolution regardless of module resolution settings. In absence of
* overriding attributes, and in modes that support differing resolution, the result indicates the syntax the usage would emit to JavaScript.
* Some examples:
*
* ```ts
* // tsc foo.mts --module nodenext
* import {} from "mod";
* // Result: ESNext - the import emits as ESM due to `impliedNodeFormat` set by .mts file extension
*
* // tsc foo.cts --module nodenext
* import {} from "mod";
* // Result: CommonJS - the import emits as CJS due to `impliedNodeFormat` set by .cts file extension
*
* // tsc foo.ts --module preserve --moduleResolution bundler
* import {} from "mod";
* // Result: ESNext - the import emits as ESM due to `--module preserve` and `--moduleResolution bundler`
* // supports conditional imports/exports
*
* // tsc foo.ts --module preserve --moduleResolution node10
* import {} from "mod";
* // Result: undefined - the import emits as ESM due to `--module preserve`, but `--moduleResolution node10`
* // does not support conditional imports/exports
*
* // tsc foo.ts --module commonjs --moduleResolution node10
* import type {} from "mod" with { "resolution-mode": "import" };
* // Result: ESNext - conditional imports/exports always supported with "resolution-mode" attribute
* ```
*
* Calculates the final resolution mode for a given module reference node. This is the resolution mode explicitly provided via import
* attributes, if present, or the syntax the usage would have if emitted to JavaScript. In `--module node16` or `nodenext`, this may
* depend on the file's `impliedNodeFormat`. In `--module preserve`, it depends only on the input syntax of the reference. In other
* `module` modes, when overriding import attributes are not provided, this function returns `undefined`, as the result would have no
* impact on module resolution, emit, or type checking.
* @param file The file the import or import-like reference is contained within
* @param usage The module reference string
* @param compilerOptions The compiler options for the program that owns the file. If the file belongs to a referenced project, the compiler options
* should be the options of the referenced project, not the referencing project.
* @returns The final resolution mode of the import
*/
function getModeForUsageLocation(file: SourceFile, usage: StringLiteralLike, compilerOptions: CompilerOptions): ResolutionMode;
function getModeForUsageLocation(
file: {
impliedNodeFormat?: ResolutionMode;
},
usage: StringLiteralLike,
compilerOptions: CompilerOptions,
): ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): readonly Diagnostic[];
/**
* A function for determining if a given file is esm or cjs format, assuming modern node module resolution rules, as configured by the
Expand Down
Loading

0 comments on commit d1c65a2

Please sign in to comment.