Skip to content

Commit e9ee685

Browse files
committed
revert: build: remove vendored Babel typings (angular#33176) (angular#33215)
This reverts commit 4c63e6b. PR Close angular#33215
1 parent a67df65 commit e9ee685

File tree

16 files changed

+1893
-88
lines changed

16 files changed

+1893
-88
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": ["node_modules/@types"], /* List of folders to include type definitions from. */
43+
// "typeRoots": [], /* 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

+10-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33

44

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

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

1113
"@types/node@file:../../node_modules/@types/node":
1214
version "10.9.4"
@@ -89,8 +91,13 @@ path-is-absolute@^1.0.0:
8991
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
9092
integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
9193

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+
9299
"typescript@file:../../node_modules/typescript":
93-
version "3.5.3"
100+
version "3.4.2"
94101

95102
wrappy@1:
96103
version "1.0.2"

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,14 @@
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.6.4",
42+
"@babel/core": "^7.5.5",
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",
5150
"@types/base64-js": "1.2.5",
5251
"@types/bluebird": "^3.5.27",
5352
"@types/chai": "^4.1.2",

packages/localize/src/tools/BUILD.bazel

-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ ts_library(
2222
"//packages/localize",
2323
"@npm//@babel/core",
2424
"@npm//@babel/types",
25-
"@npm//@types/babel__core",
26-
"@npm//@types/babel__traverse",
2725
"@npm//@types/glob",
2826
"@npm//@types/node",
2927
"@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, name: string): expression is NodePath<t.Identifier> {
18+
expression: NodePath<t.Expression>, 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.Node, message: string) { super(message); }
312+
constructor(public node: t.BaseNode, 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,9 +12,6 @@ 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",
1815
"@npm//@types/glob",
1916
],
2017
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Microsoft Corporation. All rights reserved.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# @babel/... external types
2+
3+
The Bazel `ts_library` rule does not understand how to map imports of the form `@babel/core` to
4+
external typings of the form `@types/babel__core`. Note the double underscore to account for the
5+
namespaced package.
6+
7+
See https://github.com/bazelbuild/rules_nodejs/issues/1033.
8+
9+
This folder is a workaround to this by copying the typings directly into the project. Once the
10+
issue with `ts_library` is resolved we can remove this folder and add appropriate npm dependencies
11+
for the typings

0 commit comments

Comments
 (0)