Skip to content

Commit a0487d9

Browse files
committed
refactor(@schematics/angular): migrate typescript third-party dependency to node_modules
Relocates the typescript third-party dependency from `third_party/github.com/Microsoft/TypeScript` to `third_party/typescript`. This update changes the implementation to source the required TypeScript files directly from `node_modules` via a Bazel `genrule` instead of keeping them checked into the repository.
1 parent 0f2342c commit a0487d9

35 files changed

+75
-212578
lines changed

packages/schematics/angular/BUILD.bazel

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ ts_project(
108108
":node_modules/@angular-devkit/schematics",
109109
":node_modules/jsonc-parser",
110110
"//:node_modules/@types/node",
111-
"//packages/schematics/angular/third_party/github.com/Microsoft/TypeScript",
111+
"//packages/schematics/angular/third_party/typescript",
112112
],
113113
)
114114

@@ -142,7 +142,7 @@ ts_project(
142142
"//:node_modules/@types/jasmine",
143143
"//:node_modules/@types/node",
144144
"//:node_modules/prettier",
145-
"//packages/schematics/angular/third_party/github.com/Microsoft/TypeScript",
145+
"//packages/schematics/angular/third_party/typescript",
146146
],
147147
)
148148

@@ -173,8 +173,6 @@ npm_package(
173173
":README.md",
174174
":angular",
175175
":license",
176-
"//packages/schematics/angular/third_party/github.com/Microsoft/TypeScript:LICENSE",
177-
# Force typescript library to be included.
178-
"//packages/schematics/angular/third_party/github.com/Microsoft/TypeScript:lib/typescript.js",
176+
"//packages/schematics/angular/third_party/typescript",
179177
],
180178
)

packages/schematics/angular/app-shell/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
schematic,
1616
} from '@angular-devkit/schematics';
1717
import { dirname, join } from 'node:path/posix';
18-
import ts from '../third_party/github.com/Microsoft/TypeScript/lib/typescript';
18+
import ts from '../third_party/typescript';
1919
import {
2020
findNode,
2121
findNodes,

packages/schematics/angular/migrations/karma/karma-config-analyzer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.dev/license
77
*/
88

9-
import ts from '../../third_party/github.com/Microsoft/TypeScript/lib/typescript';
9+
import ts from '../../third_party/typescript';
1010

1111
export interface RequireInfo {
1212
module: string;

packages/schematics/angular/module/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
} from '@angular-devkit/schematics';
2424
import { join } from 'node:path/posix';
2525
import { Schema as ComponentOptions } from '../component/schema';
26-
import * as ts from '../third_party/github.com/Microsoft/TypeScript/lib/typescript';
26+
import * as ts from '../third_party/typescript';
2727
import { addImportToModule, addRouteDeclarationToModule } from '../utility/ast-utils';
2828
import { InsertChange } from '../utility/change';
2929
import {

packages/schematics/angular/refactor/jasmine-vitest/test-file-transformer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* blank line preservation, and reporting of transformation details.
1414
*/
1515

16-
import ts from '../../third_party/github.com/Microsoft/TypeScript/lib/typescript';
16+
import ts from '../../third_party/typescript';
1717
import {
1818
transformDoneCallback,
1919
transformFocusedAndSkippedTests,

packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-lifecycle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* operations that use the `done` callback.
1414
*/
1515

16-
import ts from '../../../third_party/github.com/Microsoft/TypeScript/lib/typescript';
16+
import ts from '../../../third_party/typescript';
1717
import { createPropertyAccess } from '../utils/ast-helpers';
1818
import { addTodoComment } from '../utils/comment-helpers';
1919
import { RefactorContext } from '../utils/refactor-context';

packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-matcher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* `toHaveBeenCalledOnceWith` and `arrayWithExactContents`.
1515
*/
1616

17-
import ts from '../../../third_party/github.com/Microsoft/TypeScript/lib/typescript';
17+
import ts from '../../../third_party/typescript';
1818
import {
1919
addVitestValueImport,
2020
createExpectCallExpression,

packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-misc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* includes logic to identify and add TODO comments for unsupported Jasmine features.
1414
*/
1515

16-
import ts from '../../../third_party/github.com/Microsoft/TypeScript/lib/typescript';
16+
import ts from '../../../third_party/typescript';
1717
import { addVitestValueImport, createViCallExpression } from '../utils/ast-helpers';
1818
import { getJasmineMethodName, isJasmineCallExpression } from '../utils/ast-validation';
1919
import { addTodoComment } from '../utils/comment-helpers';

packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-spy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* and the inspection of spy calls (`spy.calls.reset`, `spy.calls.mostRecent`).
1414
*/
1515

16-
import ts from '../../../third_party/github.com/Microsoft/TypeScript/lib/typescript';
16+
import ts from '../../../third_party/typescript';
1717
import {
1818
addVitestValueImport,
1919
createPropertyAccess,

packages/schematics/angular/refactor/jasmine-vitest/transformers/jasmine-type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* necessary `vitest` imports are added to the file.
1414
*/
1515

16-
import ts from '../../../third_party/github.com/Microsoft/TypeScript/lib/typescript';
16+
import ts from '../../../third_party/typescript';
1717
import { addVitestTypeImport } from '../utils/ast-helpers';
1818
import { RefactorContext } from '../utils/refactor-context';
1919

0 commit comments

Comments
 (0)