From 6b9693157654bc148955f5b8eba29db2d829aabc Mon Sep 17 00:00:00 2001 From: Alex Rickabaugh Date: Thu, 13 Dec 2018 09:07:26 -0800 Subject: [PATCH] fix(ivy): enable flat module index production in Bazel (#27655) ngtsc now produces flat module index files when that option is enabled in tsconfig, but Bazel still needs the output declared in order for them to be passed through. This fixes some tests which verify this behavior on Bazel. FW-738 #resolve PR Close #27655 --- packages/bazel/src/ng_module.bzl | 5 +++-- packages/bazel/test/ng_package/core_package.spec.ts | 6 ++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/bazel/src/ng_module.bzl b/packages/bazel/src/ng_module.bzl index d2455d45b9..c429a0e978 100644 --- a/packages/bazel/src/ng_module.bzl +++ b/packages/bazel/src/ng_module.bzl @@ -201,13 +201,14 @@ def _expected_outs(ctx): metadata_files += [ctx.actions.declare_file(basename + ext) for ext in metadata] # We do this just when producing a flat module index for a publishable ng_module - if is_legacy_ngc and _should_produce_flat_module_outs(ctx): + if _should_produce_flat_module_outs(ctx): flat_module_out = _flat_module_out_file(ctx) devmode_js_files.append(ctx.actions.declare_file("%s.js" % flat_module_out)) closure_js_files.append(ctx.actions.declare_file("%s.closure.js" % flat_module_out)) bundle_index_typings = ctx.actions.declare_file("%s.d.ts" % flat_module_out) declaration_files.append(bundle_index_typings) - metadata_files.append(ctx.actions.declare_file("%s.metadata.json" % flat_module_out)) + if is_legacy_ngc: + metadata_files.append(ctx.actions.declare_file("%s.metadata.json" % flat_module_out)) else: bundle_index_typings = None diff --git a/packages/bazel/test/ng_package/core_package.spec.ts b/packages/bazel/test/ng_package/core_package.spec.ts index fe30af67d8..f5f349f57b 100644 --- a/packages/bazel/test/ng_package/core_package.spec.ts +++ b/packages/bazel/test/ng_package/core_package.spec.ts @@ -73,10 +73,8 @@ describe('@angular/core ng_package', () => { describe('typescript support', () => { - - fixmeIvy('FW-738: ngtsc doesn\'t generate flat index files') - .it('should have an index d.ts file', - () => { expect(shx.cat('core.d.ts')).toContain(`export *`); }); + it('should have an index d.ts file', + () => { expect(shx.cat('core.d.ts')).toContain(`export *`); }); it('should not have amd module names', () => { expect(shx.cat('public_api.d.ts')).not.toContain('