From 3bb3d6d3e622a7e39adddfb257ea08607cd89f0f Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Thu, 7 Feb 2019 19:02:21 +0100 Subject: [PATCH] test: update ng_package tests to use bundle_dts (#28588) PR Close #28588 --- .../bazel/test/ng_package/example/BUILD.bazel | 1 + .../ng_package/example/secondary/BUILD.bazel | 1 + .../test/ng_package/example_package.golden | 85 ++++++------------- 3 files changed, 26 insertions(+), 61 deletions(-) diff --git a/packages/bazel/test/ng_package/example/BUILD.bazel b/packages/bazel/test/ng_package/example/BUILD.bazel index 11797674c5..6bf8a00242 100644 --- a/packages/bazel/test/ng_package/example/BUILD.bazel +++ b/packages/bazel/test/ng_package/example/BUILD.bazel @@ -5,6 +5,7 @@ load("//tools:defaults.bzl", "ng_module", "ng_package", "npm_package") ng_module( name = "example", srcs = glob(["*.ts"]), + bundle_dts = True, module_name = "example", deps = [ "//packages/bazel/test/ng_package/example/secondary", diff --git a/packages/bazel/test/ng_package/example/secondary/BUILD.bazel b/packages/bazel/test/ng_package/example/secondary/BUILD.bazel index 6fdcbc67b1..e223cd26f2 100644 --- a/packages/bazel/test/ng_package/example/secondary/BUILD.bazel +++ b/packages/bazel/test/ng_package/example/secondary/BUILD.bazel @@ -5,6 +5,7 @@ load("//tools:defaults.bzl", "ng_module") ng_module( name = "secondary", srcs = glob(["*.ts"]), + bundle_dts = True, module_name = "example/secondary", deps = [ "//packages/core", diff --git a/packages/bazel/test/ng_package/example_package.golden b/packages/bazel/test/ng_package/example_package.golden index eece9c982c..b84bb36108 100644 --- a/packages/bazel/test/ng_package/example_package.golden +++ b/packages/bazel/test/ng_package/example_package.golden @@ -42,15 +42,11 @@ fesm5 fesm5/secondary.js.map fesm5/waffels.js fesm5/waffels.js.map -index.d.ts -mymodule.d.ts package.json secondary - secondary/index.d.ts secondary/package.json secondary/secondary.d.ts secondary/secondary.metadata.json - secondary/secondarymodule.d.ts secondary.d.ts secondary.metadata.json some-file.txt @@ -482,14 +478,22 @@ export var a = 1; --- example.d.ts --- /** - * Generated bundle index. Do not edit. + * @license Angular v0.0.0 + * (c) 2010-2019 Google LLC. https://angular.io/ + * License: MIT */ -export * from './index'; + + + +export declare class MyModule { +} + +export { } --- example.metadata.json --- -{"__symbolic":"module","version":4,"metadata":{"MyModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":11,"character":1},"arguments":[{}]}],"members":{}}},"origins":{"MyModule":"./mymodule"},"importAs":"example"} +{"__symbolic":"module","version":4,"metadata":{"MyModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":11,"character":1},"arguments":[{}]}],"members":{}}},"origins":{"MyModule":"./example"},"importAs":"example"} --- extra-styles.css --- @@ -653,31 +657,6 @@ export { MyModule }; //# sourceMappingURL=waffels.js.map ---- index.d.ts --- - -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -export * from './mymodule'; - - ---- mymodule.d.ts --- - -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -export declare class MyModule { -} - - --- package.json --- { @@ -693,18 +672,6 @@ export declare class MyModule { "es2015": "./fesm2015/example.js" } ---- secondary/index.d.ts --- - -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -export * from './secondarymodule'; - - --- secondary/package.json --- { @@ -722,28 +689,24 @@ export * from './secondarymodule'; --- secondary/secondary.d.ts --- /** - * Generated bundle index. Do not edit. + * @license Angular v0.0.0 + * (c) 2010-2019 Google LLC. https://angular.io/ + * License: MIT */ -export * from './index'; + + +export declare const a = 1; + + +export declare class SecondaryModule { +} + +export { } --- secondary/secondary.metadata.json --- -{"__symbolic":"module","version":4,"metadata":{"SecondaryModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":10,"character":1},"arguments":[{}]}],"members":{}},"a":1},"origins":{"SecondaryModule":"./secondarymodule","a":"./secondarymodule"},"importAs":"example/secondary"} - ---- secondary/secondarymodule.d.ts --- - -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -export declare class SecondaryModule { -} -export declare const a = 1; - +{"__symbolic":"module","version":4,"metadata":{"SecondaryModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":10,"character":1},"arguments":[{}]}],"members":{}},"a":1},"origins":{"SecondaryModule":"./secondary","a":"./secondary"},"importAs":"example/secondary"} --- secondary.d.ts ---