Skip to content

Commit 422eb14

Browse files
alexeaglematsko
authored andcommitted
build: remove vendored Babel typings (angular#33226)
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#33226
1 parent 7b64680 commit 422eb14

File tree

20 files changed

+96
-1897
lines changed

20 files changed

+96
-1897
lines changed

integration/language_service_plugin/tsconfig.json

+1-1
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

+3-10
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

+2-1
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/compiler-cli/integrationtest/flat_module/tsconfig-build.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"noImplicitAny": true,
1616
"outDir": "../node_modules/flat_module",
1717
"rootDir": "",
18-
"target": "es5"
18+
"target": "es5",
19+
"typeRoots": ["../node_modules/@types"]
1920
},
2021

2122
"files": ["public-api.ts"]

packages/compiler-cli/integrationtest/third_party_src/tsconfig-build.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"noImplicitAny": true,
1414
"outDir": "../node_modules/third_party",
1515
"rootDir": "",
16-
"target": "es5"
16+
"target": "es5",
17+
"typeRoots": ["../node_modules/@types"]
1718
}
1819
}

packages/compiler-cli/integrationtest/tsconfig-build.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
// compatible with the option. Disabled until the integration test support the strict flag.
2424
// TODO(devversion): this has been enabled without the integration test code being
2525
"strictPropertyInitialization": false,
26-
"target": "es5"
26+
"target": "es5",
27+
"typeRoots": ["node_modules/@types"]
2728
},
2829

2930
"files": [

packages/compiler-cli/integrationtest/tsconfig-xi18n.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"outDir": "./xi18n-out",
1616
"rootDir": "",
1717
"skipLibCheck": true,
18-
"target": "es5"
18+
"target": "es5",
19+
"typeRoots": ["node_modules/@types"]
1920
},
2021

2122
"files": [

packages/localize/src/tools/BUILD.bazel

+2
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

+2-2
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

+3
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

-21
This file was deleted.

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

-11
This file was deleted.

0 commit comments

Comments
 (0)