Skip to content

Commit

Permalink
build: remove vendored Babel typings
Browse files Browse the repository at this point in the history
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
  • Loading branch information
alexeagle authored and petebacondarwin committed Oct 17, 2019
1 parent d192a7b commit b52cc2e
Show file tree
Hide file tree
Showing 19 changed files with 94 additions and 1,896 deletions.
2 changes: 1 addition & 1 deletion integration/language_service_plugin/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
"typeRoots": ["node_modules/@types"], /* List of folders to include type definitions from. */
// "types": [], /* Type declaration files to be included in compilation. */
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
Expand Down
13 changes: 3 additions & 10 deletions integration/language_service_plugin/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@


"@angular/core@file:../../dist/packages-dist/core":
version "8.0.0-beta.13"
dependencies:
tslib "^1.9.0"
version "9.0.0-next.10"

"@angular/language-service@file:../../dist/packages-dist/language-service":
version "8.0.0-beta.13"
version "9.0.0-next.10"

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

tslib@^1.9.0:
version "1.9.3"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==

"typescript@file:../../node_modules/typescript":
version "3.4.2"
version "3.5.3"

wrappy@1:
version "1.0.2"
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@
"@angular-devkit/core": "^8.0.0-beta.15",
"@angular-devkit/schematics": "^8.0.0-beta.15",
"@angular/bazel": "file:./tools/npm/@angular_bazel",
"@babel/core": "^7.5.5",
"@babel/core": "^7.6.4",
"@bazel/jasmine": "0.38.3",
"@bazel/karma": "0.38.3",
"@bazel/protractor": "0.38.3",
"@bazel/typescript": "0.38.3",
"@microsoft/api-extractor": "^7.3.9",
"@schematics/angular": "^8.0.0-beta.15",
"@types/angular": "^1.6.47",
"@types/babel__core": "^7.1.3",
"@types/base64-js": "1.2.5",
"@types/bluebird": "^3.5.27",
"@types/chai": "^4.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"noImplicitAny": true,
"outDir": "../node_modules/flat_module",
"rootDir": "",
"target": "es5"
"target": "es5",
"typeRoots": ["../node_modules/@types"]
},

"files": ["public-api.ts"]
Expand Down
3 changes: 2 additions & 1 deletion packages/compiler-cli/integrationtest/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
// compatible with the option. Disabled until the integration test support the strict flag.
// TODO(devversion): this has been enabled without the integration test code being
"strictPropertyInitialization": false,
"target": "es5"
"target": "es5",
"typeRoots": ["node_modules/@types"]
},

"files": [
Expand Down
3 changes: 2 additions & 1 deletion packages/compiler-cli/integrationtest/tsconfig-xi18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"outDir": "./xi18n-out",
"rootDir": "",
"skipLibCheck": true,
"target": "es5"
"target": "es5",
"typeRoots": ["node_modules/@types"]
},

"files": [
Expand Down
2 changes: 2 additions & 0 deletions packages/localize/src/tools/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ ts_library(
"//packages/localize",
"@npm//@babel/core",
"@npm//@babel/types",
"@npm//@types/babel__core",
"@npm//@types/babel__traverse",
"@npm//@types/glob",
"@npm//@types/node",
"@npm//@types/yargs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {Diagnostics} from '../../diagnostics';
* @param expression The expression to check.
*/
export function isNamedIdentifier(
expression: NodePath<t.Expression>, name: string): expression is NodePath<t.Identifier> {
expression: NodePath, name: string): expression is NodePath<t.Identifier> {
return expression.isIdentifier() && expression.node.name === name;
}

Expand Down Expand Up @@ -309,7 +309,7 @@ export function translate(

export class BabelParseError extends Error {
private readonly type = 'BabelParseError';
constructor(public node: t.BaseNode, message: string) { super(message); }
constructor(public node: t.Node, message: string) { super(message); }
}

export function isBabelParseError(e: any): e is BabelParseError {
Expand Down
3 changes: 3 additions & 0 deletions packages/localize/src/tools/test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ ts_library(
"//packages/localize",
"//packages/localize/src/tools",
"@npm//@babel/types",
"@npm//@types/babel__core",
"@npm//@types/babel__generator",
"@npm//@types/babel__template",
"@npm//@types/glob",
],
)
Expand Down
21 changes: 0 additions & 21 deletions packages/localize/src/tools/types/babel/LICENSE

This file was deleted.

11 changes: 0 additions & 11 deletions packages/localize/src/tools/types/babel/README.md

This file was deleted.

Loading

0 comments on commit b52cc2e

Please sign in to comment.