Skip to content

Commit c6dd57a

Browse files
committed
refactor(@schematics/angular): remove third-party typescript copy
The typescript package is now smaller and the tsserver file no longer bundles typescript but imports it directly, which makes the 3rd party copy redundant.
1 parent 7c1eede commit c6dd57a

34 files changed

Lines changed: 87 additions & 133 deletions

packages/schematics/angular/BUILD.bazel

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,8 @@ ts_project(
107107
":node_modules/@angular-devkit/core",
108108
":node_modules/@angular-devkit/schematics",
109109
":node_modules/jsonc-parser",
110+
":node_modules/typescript",
110111
"//:node_modules/@types/node",
111-
"//packages/schematics/angular/third_party/typescript",
112-
],
113-
)
114-
115-
jasmine_test(
116-
name = "no_typescript_runtime_dep_test",
117-
data = [
118-
"no_typescript_runtime_dep_spec.js",
119-
":angular",
120-
"//:node_modules/@types/jasmine",
121112
],
122113
)
123114

@@ -139,10 +130,10 @@ ts_project(
139130
":node_modules/@angular-devkit/core",
140131
":node_modules/@angular-devkit/schematics",
141132
":node_modules/jsonc-parser",
133+
":node_modules/typescript",
142134
"//:node_modules/@types/jasmine",
143135
"//:node_modules/@types/node",
144136
"//:node_modules/prettier",
145-
"//packages/schematics/angular/third_party/typescript",
146137
],
147138
)
148139

@@ -173,6 +164,5 @@ npm_package(
173164
":README.md",
174165
":angular",
175166
":license",
176-
"//packages/schematics/angular/third_party/typescript",
177167
],
178168
)

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/typescript';
18+
import ts from 'typescript';
1919
import {
2020
findNode,
2121
findNodes,

packages/schematics/angular/migrations/migrate-karma-to-vitest/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/typescript';
9+
import ts from '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
@@ -22,8 +22,8 @@ import {
2222
url,
2323
} from '@angular-devkit/schematics';
2424
import { join } from 'node:path/posix';
25+
import ts from 'typescript';
2526
import { Schema as ComponentOptions } from '../component/schema';
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/no_typescript_runtime_dep_spec.js

Lines changed: 0 additions & 38 deletions
This file was deleted.

packages/schematics/angular/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"dependencies": {
2020
"@angular-devkit/core": "workspace:0.0.0-PLACEHOLDER",
2121
"@angular-devkit/schematics": "workspace:0.0.0-PLACEHOLDER",
22-
"jsonc-parser": "3.3.1"
22+
"jsonc-parser": "3.3.1",
23+
"typescript": "6.0.3"
2324
}
2425
}

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/typescript';
16+
import ts from '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/typescript';
16+
import ts from '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/typescript';
17+
import ts from '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/typescript';
16+
import ts from 'typescript';
1717
import { addVitestValueImport, createViCallExpression } from '../utils/ast-helpers';
1818
import { getJasmineMethodName, isJasmineCallExpression } from '../utils/ast-validation';
1919
import { addTodoComment } from '../utils/comment-helpers';

0 commit comments

Comments
 (0)