build: update to rules_nodejs 1.2.0 (#34961)

This brings in a fix so that yarn_install picks up the yarn-path attribute of the .yarnrc file.

PR Close #34961
This commit is contained in:
Greg Magolan
2020-01-24 13:08:55 -08:00
committed by Misko Hevery
parent 8dce6b4463
commit 3ec64f92fd
11 changed files with 108 additions and 78 deletions

View File

@ -15,8 +15,8 @@ workspace(
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
RULES_NODEJS_VERSION = "1.1.0"
RULES_NODEJS_SHA256 = "c97bf38546c220fa250ff2cc052c1a9eac977c662c1fc23eda797b0ce8e70a43"
RULES_NODEJS_VERSION = "1.2.0"
RULES_NODEJS_SHA256 = "591d2945b09ecc89fde53e56dd54cfac93322df3bc9d4747cb897ce67ba8cdbf"
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = RULES_NODEJS_SHA256,

View File

@ -8,6 +8,8 @@
This is used to find all files that will be copied into a "ng_package".
"""
load("@build_bazel_rules_nodejs//:providers.bzl", "DeclarationInfo")
def _filter_typing_files(files):
return [file for file in files if file.path.endswith(".d.ts")]
@ -35,7 +37,7 @@ def collect_type_definitions(ctx):
# Collect all TypeScript definition files from the specified dependencies.
for dep in ctx.attr.deps:
if hasattr(dep, "typescript"):
collected_files += dep.typescript.transitive_declarations.to_list()
if DeclarationInfo in dep:
collected_files += dep[DeclarationInfo].transitive_declarations.to_list()
return collected_files

View File

@ -40,11 +40,11 @@ function addDevDependenciesToPackageJson(options: Schema) {
['@angular/bazel', angularCore.version],
['@bazel/bazel', '2.0.0'],
['@bazel/ibazel', '0.10.3'],
['@bazel/karma', '1.1.0'],
['@bazel/protractor', '1.1.0'],
['@bazel/rollup', '1.1.0'],
['@bazel/terser', '1.1.0'],
['@bazel/typescript', '1.1.0'],
['@bazel/karma', '1.2.0'],
['@bazel/protractor', '1.2.0'],
['@bazel/rollup', '1.2.0'],
['@bazel/terser', '1.2.0'],
['@bazel/typescript', '1.2.0'],
['history-server', '1.3.1'],
['html-insert-assets', '0.2.0'],
['karma', '4.4.1'],

View File

@ -5,7 +5,7 @@ package(default_visibility = ["//packages/bazel/test:__subpackages__"])
ts_library(
name = "example",
srcs = glob(["*.ts"]),
module_name = "example",
module_name = "example-with-ts-library",
deps = [],
)

View File

@ -62,6 +62,9 @@ utils
utils/package.json
utils/testing.d.ts
utils.d.ts
with-ts-library
with-ts-library/package.json
with-ts-library.d.ts
--- README.md ---
Angular
@ -437,8 +440,8 @@ e.dispatchFakeEvent=function t(e,n){e.dispatchEvent(n)},Object.defineProperty(e,
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define('example', ['exports'], factory) :
(global = global || self, factory(global.example = {}));
typeof define === 'function' && define.amd ? define('example-with-ts-library', ['exports'], factory) :
(global = global || self, factory(global.exampleWithTsLibrary = {}));
}(this, (function (exports) { 'use strict';
/**
@ -465,7 +468,7 @@ e.dispatchFakeEvent=function t(e,n){e.dispatchEvent(n)},Object.defineProperty(e,
* (c) 2010-2020 Google LLC. https://angular.io/
* License: MIT
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define("example",["exports"],t):t((e=e||self).example={})}(this,(function(e){"use strict";
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define("example-with-ts-library",["exports"],t):t((e=e||self).exampleWithTsLibrary={})}(this,(function(e){"use strict";
/**
* @license
* Copyright Google Inc. All Rights Reserved.
@ -989,3 +992,28 @@ export declare function dispatchFakeEvent(el: HTMLElement, ev: Event): void;
export * from './utils/index';
--- with-ts-library/package.json ---
{
"name": "example-with-ts-library",
"main": "./bundles/example-with-ts-library.umd.js",
"fesm5": "./fesm5/example-with-ts-library.js",
"fesm2015": "./fesm2015/example-with-ts-library.js",
"esm5": "../esm5/index.js",
"esm2015": "../esm2015/index.js",
"typings": "../index.d.ts",
"module": "./fesm5/example-with-ts-library.js",
"es2015": "./fesm2015/example-with-ts-library.js"
}
--- with-ts-library.d.ts ---
/**
* @license Angular v0.0.0
* (c) 2010-2020 Google LLC. https://angular.io/
* License: MIT
*/
export * from './index';