From 16e042308594d53f437a44e01d29c7b39906011a Mon Sep 17 00:00:00 2001 From: Chuck Jazdzewski Date: Mon, 20 Mar 2017 19:43:39 -0700 Subject: [PATCH] revert: feat(compiler-cli): support metadata file aliases (#15331) This reverts commit 0ab49d4cec23e2957fd7e8dad55d15fc539c69ed. PR Close #15331 --- packages/compiler-cli/src/compiler_host.ts | 6 +----- packages/compiler-cli/test/aot_host_spec.ts | 9 --------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/packages/compiler-cli/src/compiler_host.ts b/packages/compiler-cli/src/compiler_host.ts index 904b53c818..b3def2a01a 100644 --- a/packages/compiler-cli/src/compiler_host.ts +++ b/packages/compiler-cli/src/compiler_host.ts @@ -207,11 +207,7 @@ export class CompilerHost implements AotCompilerHost { return metadatas; } try { - let metadataOrMetadatas = JSON.parse(this.context.readFile(filePath)); - while (metadataOrMetadatas && metadataOrMetadatas.alias) { - filePath = path.join(path.dirname(filePath), metadataOrMetadatas.alias); - metadataOrMetadatas = JSON.parse(this.context.readFile(filePath)); - } + const metadataOrMetadatas = JSON.parse(this.context.readFile(filePath)); const metadatas: ModuleMetadata[] = metadataOrMetadatas ? (Array.isArray(metadataOrMetadatas) ? metadataOrMetadatas : [metadataOrMetadatas]) : []; diff --git a/packages/compiler-cli/test/aot_host_spec.ts b/packages/compiler-cli/test/aot_host_spec.ts index f88480ac97..aad08036c3 100644 --- a/packages/compiler-cli/test/aot_host_spec.ts +++ b/packages/compiler-cli/test/aot_host_spec.ts @@ -202,10 +202,6 @@ describe('CompilerHost', () => { {__symbolic: 'module', version: 3, metadata: {}, exports: [{from: './lib/utils'}]} ]); }); - - it('should follow metadata aliases', () => { - expect(hostNestedGenDir.getMetadataFor('alias/file.d.ts')).toEqual([dummyMetadata]); - }); }); const dummyModule = 'export let foo: any[];'; @@ -241,11 +237,6 @@ const FILES: Entry = { 'empty.metadata.json': '[]', } }, - 'alias': { - 'file.d.ts': dummyModule, - 'file.metadata.json': '{ "alias": "sub/index.metadata.json"}', - 'sub': {'index.metadata.json': JSON.stringify(dummyMetadata)} - }, 'metadata_versions': { 'v1.d.ts': ` import {ReExport} from './lib/utils2';