revert: feat(compiler-cli): support metadata file aliases (#15331)

This reverts commit 0ab49d4cec.

PR Close #15331
This commit is contained in:
Chuck Jazdzewski 2017-03-20 19:43:39 -07:00 committed by Miško Hevery
parent c2ffb6bfcd
commit 16e0423085
2 changed files with 1 additions and 14 deletions

View File

@ -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]) :
[];

View File

@ -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';