Skip to content

Commit e44cc52

Browse files
devversionvivian-hu-zz
authored andcommitted
build: update typescript bazel rules (#14465)
* build: update typescript bazel rules * Updates the TypeScript bazel rules to the latest version that includes a hotfix for emit diagnostics not being reported. Also it includes bazelbuild/rules_typescript@f9d6edb which is necessary to build the `src:module-typings` on Windows w/ ng_package. * Update to Angular 7.1.3
1 parent f59c1ee commit e44cc52

8 files changed

+113
-112
lines changed

WORKSPACE

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ http_archive(
1515
# Add TypeScript rules
1616
http_archive(
1717
name = "build_bazel_rules_typescript",
18-
url = "https://github.com/bazelbuild/rules_typescript/archive/0.21.0.zip",
19-
strip_prefix = "rules_typescript-0.21.0",
18+
url = "https://github.com/bazelbuild/rules_typescript/archive/0.22.0.zip",
19+
strip_prefix = "rules_typescript-0.22.0",
2020
)
2121

2222
# Add Angular source and Bazel rules.
2323
http_archive(
2424
name = "angular",
25-
url = "https://github.com/angular/angular/archive/7.1.2.zip",
26-
strip_prefix = "angular-7.1.2",
25+
url = "https://github.com/angular/angular/archive/7.1.3.zip",
26+
strip_prefix = "angular-7.1.3",
2727
)
2828

2929
# Add RxJS as repository because those are needed in order to build Angular from source.

package.json

+15-15
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@
2929
"version": "7.1.1",
3030
"requiredAngularVersion": ">=7.0.0",
3131
"dependencies": {
32-
"@angular/animations": "^7.1.2",
33-
"@angular/common": "^7.1.2",
34-
"@angular/compiler": "^7.1.2",
35-
"@angular/core": "^7.1.2",
36-
"@angular/elements": "^7.1.2",
37-
"@angular/forms": "^7.1.2",
38-
"@angular/platform-browser": "^7.1.2",
32+
"@angular/animations": "^7.1.3",
33+
"@angular/common": "^7.1.3",
34+
"@angular/compiler": "^7.1.3",
35+
"@angular/core": "^7.1.3",
36+
"@angular/elements": "^7.1.3",
37+
"@angular/forms": "^7.1.3",
38+
"@angular/platform-browser": "^7.1.3",
3939
"@webcomponents/custom-elements": "^1.1.0",
4040
"core-js": "^2.6.0",
4141
"rxjs": "^6.3.3",
@@ -47,15 +47,15 @@
4747
"devDependencies": {
4848
"@angular-devkit/core": "^7.1.2",
4949
"@angular-devkit/schematics": "^7.1.2",
50-
"@angular/bazel": "^7.1.2",
51-
"@angular/compiler-cli": "^7.1.2",
52-
"@angular/http": "^7.1.2",
53-
"@angular/platform-browser-dynamic": "^7.1.2",
54-
"@angular/platform-server": "^7.1.2",
55-
"@angular/router": "^7.1.2",
50+
"@angular/bazel": "^7.1.3",
51+
"@angular/compiler-cli": "^7.1.3",
52+
"@angular/http": "^7.1.3",
53+
"@angular/platform-browser-dynamic": "^7.1.3",
54+
"@angular/platform-server": "^7.1.3",
55+
"@angular/router": "^7.1.3",
5656
"@bazel/ibazel": "^0.9.0",
57-
"@bazel/karma": "0.21.0",
58-
"@bazel/typescript": "0.21.0",
57+
"@bazel/karma": "0.22.0",
58+
"@bazel/typescript": "0.22.0",
5959
"@firebase/app-types": "^0.3.2",
6060
"@octokit/rest": "^15.9.4",
6161
"@schematics/angular": "^7.1.2",

src/lib/input/BUILD.bazel

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ ng_test_library(
3535
"@angular//packages/forms",
3636
"@angular//packages/platform-browser",
3737
"@angular//packages/platform-browser/animations",
38+
"@rxjs",
3839
"//src/cdk/bidi",
3940
"//src/cdk/platform",
4041
"//src/cdk/testing",

tools/dgeni/BUILD.bazel

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ ts_library(
1919
srcs = glob(["**/*.ts"]),
2020
deps = [
2121
"@matdeps//@types/node",
22+
"@matdeps//@types/glob",
23+
"@matdeps//dgeni",
24+
"@matdeps//dgeni-packages",
2225
"//tools/highlight-files:sources",
2326
],
2427
tsconfig = ":tsconfig.json",

tools/dgeni/common/decorators.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import {ApiDoc} from 'dgeni-packages/typescript/api-doc-types/ApiDoc';
12
import {ClassExportDoc} from 'dgeni-packages/typescript/api-doc-types/ClassExportDoc';
2-
import {PropertyMemberDoc} from 'dgeni-packages/typescript/api-doc-types/PropertyMemberDoc';
33
import {MemberDoc} from 'dgeni-packages/typescript/api-doc-types/MemberDoc';
4-
import {CategorizedClassDoc, DeprecationDoc, HasDecoratorsDoc} from './dgeni-definitions';
4+
import {PropertyMemberDoc} from 'dgeni-packages/typescript/api-doc-types/PropertyMemberDoc';
5+
import {CategorizedClassDoc, DeprecationInfo, HasDecoratorsDoc} from './dgeni-definitions';
56

67
export function isMethod(doc: MemberDoc) {
78
return doc.hasOwnProperty('parameters') && !doc.isGetAccessor && !doc.isSetAccessor;
@@ -80,7 +81,7 @@ export function getBreakingChange(doc: any): string | null {
8081
* Decorates public exposed docs. Creates a property on the doc that indicates whether
8182
* the item is deprecated or not.
8283
*/
83-
export function decorateDeprecatedDoc(doc: DeprecationDoc) {
84+
export function decorateDeprecatedDoc(doc: ApiDoc & DeprecationInfo) {
8485
doc.isDeprecated = isDeprecatedDoc(doc);
8586
doc.breakingChange = getBreakingChange(doc);
8687

tools/dgeni/common/dgeni-definitions.ts

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import {ApiDoc} from 'dgeni-packages/typescript/api-doc-types/ApiDoc';
21
import {ClassExportDoc} from 'dgeni-packages/typescript/api-doc-types/ClassExportDoc';
32
import {ClassLikeExportDoc} from 'dgeni-packages/typescript/api-doc-types/ClassLikeExportDoc';
43
import {ConstExportDoc} from 'dgeni-packages/typescript/api-doc-types/ConstExportDoc';
@@ -7,10 +6,10 @@ import {TypeAliasExportDoc} from 'dgeni-packages/typescript/api-doc-types/TypeAl
76
import {ParsedDecorator} from 'dgeni-packages/typescript/services/TsParser/getDecorators';
87
import {FunctionExportDoc} from 'dgeni-packages/typescript/api-doc-types/FunctionExportDoc';
98
import {MethodMemberDoc} from 'dgeni-packages/typescript/api-doc-types/MethodMemberDoc';
10-
import {NormalizedFunctionDoc} from './normalize-function-parameters';
9+
import {NormalizedFunctionParameters} from './normalize-function-parameters';
1110

1211
/** Interface that describes categorized docs that can be deprecated. */
13-
export interface DeprecationDoc extends ApiDoc {
12+
export interface DeprecationInfo {
1413
isDeprecated: boolean;
1514
breakingChange: string | null;
1615
}
@@ -21,7 +20,7 @@ export interface HasDecoratorsDoc {
2120
}
2221

2322
/** Extended Dgeni class-like document that includes separated class members. */
24-
export interface CategorizedClassLikeDoc extends ClassLikeExportDoc, DeprecationDoc {
23+
export interface CategorizedClassLikeDoc extends ClassLikeExportDoc, DeprecationInfo {
2524
methods: CategorizedMethodMemberDoc[];
2625
properties: CategorizedPropertyMemberDoc[];
2726
}
@@ -38,7 +37,7 @@ export interface CategorizedClassDoc extends ClassExportDoc, CategorizedClassLik
3837
}
3938

4039
/** Extended Dgeni property-member document that includes extracted Angular metadata. */
41-
export interface CategorizedPropertyMemberDoc extends PropertyMemberDoc, DeprecationDoc {
40+
export interface CategorizedPropertyMemberDoc extends PropertyMemberDoc, DeprecationInfo {
4241
description: string;
4342
isDirectiveInput: boolean;
4443
isDirectiveOutput: boolean;
@@ -48,14 +47,14 @@ export interface CategorizedPropertyMemberDoc extends PropertyMemberDoc, Depreca
4847

4948
/** Extended Dgeni method-member document that simplifies logic for the Dgeni template. */
5049
export interface CategorizedMethodMemberDoc
51-
extends NormalizedFunctionDoc, MethodMemberDoc, DeprecationDoc {}
50+
extends NormalizedFunctionParameters, MethodMemberDoc, DeprecationInfo {}
5251

5352
/** Extended Dgeni function export document that simplifies logic for the Dgeni template. */
5453
export interface CategorizedFunctionExportDoc
55-
extends NormalizedFunctionDoc, FunctionExportDoc, DeprecationDoc {}
54+
extends NormalizedFunctionParameters, FunctionExportDoc, DeprecationInfo {}
5655

5756
/** Extended Dgeni const export document that simplifies logic for the Dgeni template. */
58-
export interface CategorizedConstExportDoc extends ConstExportDoc, DeprecationDoc {}
57+
export interface CategorizedConstExportDoc extends ConstExportDoc, DeprecationInfo {}
5958

6059
/** Extended Dgeni type alias document that includes more information when rendering. */
61-
export interface CategorizedTypeAliasExportDoc extends TypeAliasExportDoc, DeprecationDoc {}
60+
export interface CategorizedTypeAliasExportDoc extends TypeAliasExportDoc, DeprecationInfo {}

tools/dgeni/common/normalize-function-parameters.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
} from 'dgeni-packages/typescript/api-doc-types/ParameterContainer';
55
import {ApiDoc} from 'dgeni-packages/typescript/api-doc-types/ApiDoc';
66

7-
export interface NormalizedFunctionDoc extends ParameterContainer, ApiDoc {
7+
export interface NormalizedFunctionParameters {
88
params?: FunctionParameterInfo[];
99
}
1010

@@ -13,6 +13,12 @@ export interface FunctionParameterInfo extends ParamTag {
1313
isOptional: boolean;
1414
}
1515

16+
/**
17+
* Generic type that represents Dgeni method members and standalone functions. Also it the type
18+
* combines the normalized function document so that we can update the doc with type checking.
19+
*/
20+
export type DefaultFunctionDoc = NormalizedFunctionParameters & ParameterContainer & ApiDoc;
21+
1622
/**
1723
* The `parameters` property are the parameters extracted from TypeScript and are strings
1824
* of the form "propertyName: propertyType" (literally what's written in the source).
@@ -23,7 +29,7 @@ export interface FunctionParameterInfo extends ParamTag {
2329
* We will use the `params` property to store the final normalized form since it is already
2430
* an object.
2531
*/
26-
export function normalizeFunctionParameters(doc: NormalizedFunctionDoc) {
32+
export function normalizeFunctionParameters(doc: DefaultFunctionDoc) {
2733
if (doc.parameters) {
2834
doc.parameters.forEach(parameter => {
2935
let [parameterName, parameterType] = parameter.split(':');

0 commit comments

Comments
 (0)