Skip to content

Commit 4c63e6b

Browse files
alexeaglematsko
authored andcommitted
build: remove vendored Babel typings (angular#33176)
These were getting included in the @angular/localize package. Instead, patch the upstream files to work with TS typeRoots option See bazel-contrib/rules_nodejs#1033 PR Close angular#33176
1 parent 4659cc2 commit 4c63e6b

File tree

16 files changed

+88
-1893
lines changed

16 files changed

+88
-1893
lines changed

integration/language_service_plugin/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
4141
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
4242
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
43-
// "typeRoots": [], /* List of folders to include type definitions from. */
43+
"typeRoots": ["node_modules/@types"], /* List of folders to include type definitions from. */
4444
// "types": [], /* Type declaration files to be included in compilation. */
4545
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
4646
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */

integration/language_service_plugin/yarn.lock

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33

44

55
"@angular/core@file:../../dist/packages-dist/core":
6-
version "8.0.0-beta.13"
7-
dependencies:
8-
tslib "^1.9.0"
6+
version "9.0.0-next.10"
97

108
"@angular/language-service@file:../../dist/packages-dist/language-service":
11-
version "8.0.0-beta.13"
9+
version "9.0.0-next.10"
1210

1311
"@types/node@file:../../node_modules/@types/node":
1412
version "10.9.4"
@@ -91,13 +89,8 @@ path-is-absolute@^1.0.0:
9189
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
9290
integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
9391

94-
tslib@^1.9.0:
95-
version "1.9.3"
96-
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
97-
integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==
98-
9992
"typescript@file:../../node_modules/typescript":
100-
version "3.4.2"
93+
version "3.5.3"
10194

10295
wrappy@1:
10396
version "1.0.2"

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,15 @@
3939
"@angular-devkit/core": "^8.0.0-beta.15",
4040
"@angular-devkit/schematics": "^8.0.0-beta.15",
4141
"@angular/bazel": "file:./tools/npm/@angular_bazel",
42-
"@babel/core": "^7.5.5",
42+
"@babel/core": "^7.6.4",
4343
"@bazel/jasmine": "0.38.3",
4444
"@bazel/karma": "0.38.3",
4545
"@bazel/protractor": "0.38.3",
4646
"@bazel/typescript": "0.38.3",
4747
"@microsoft/api-extractor": "^7.3.9",
4848
"@schematics/angular": "^8.0.0-beta.15",
4949
"@types/angular": "^1.6.47",
50+
"@types/babel__core": "^7.1.3",
5051
"@types/base64-js": "1.2.5",
5152
"@types/bluebird": "^3.5.27",
5253
"@types/chai": "^4.1.2",

packages/localize/src/tools/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ ts_library(
2222
"//packages/localize",
2323
"@npm//@babel/core",
2424
"@npm//@babel/types",
25+
"@npm//@types/babel__core",
26+
"@npm//@types/babel__traverse",
2527
"@npm//@types/glob",
2628
"@npm//@types/node",
2729
"@npm//@types/yargs",

packages/localize/src/tools/src/translate/source_files/source_file_utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {Diagnostics} from '../../diagnostics';
1515
* @param expression The expression to check.
1616
*/
1717
export function isNamedIdentifier(
18-
expression: NodePath<t.Expression>, name: string): expression is NodePath<t.Identifier> {
18+
expression: NodePath, name: string): expression is NodePath<t.Identifier> {
1919
return expression.isIdentifier() && expression.node.name === name;
2020
}
2121

@@ -309,7 +309,7 @@ export function translate(
309309

310310
export class BabelParseError extends Error {
311311
private readonly type = 'BabelParseError';
312-
constructor(public node: t.BaseNode, message: string) { super(message); }
312+
constructor(public node: t.Node, message: string) { super(message); }
313313
}
314314

315315
export function isBabelParseError(e: any): e is BabelParseError {

packages/localize/src/tools/test/BUILD.bazel

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ ts_library(
1212
"//packages/localize",
1313
"//packages/localize/src/tools",
1414
"@npm//@babel/types",
15+
"@npm//@types/babel__core",
16+
"@npm//@types/babel__generator",
17+
"@npm//@types/babel__template",
1518
"@npm//@types/glob",
1619
],
1720
)

packages/localize/src/tools/types/babel/LICENSE

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

packages/localize/src/tools/types/babel/README.md

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

0 commit comments

Comments
 (0)