Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bazel): correct regexp test for self-references in metadata #29346

wants to merge 1 commit into from
Changes from all commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.


Just for now

@@ -415,7 +415,7 @@ export * from '${srcDirRelative(inputPath, typingsFile.replace(/\.d\.tsx?$/, '')
if (metadata.exports) {
// Strip re-exports which are now self-references
metadata.exports =
metadata.exports.filter((e: {from: string}) => !relativePathRegex.test(e.from));
metadata.exports.filter((e: {from: string}) => !e.from.match(relativePathRegex));

This comment has been minimized.

Copy link

gkalpak Mar 16, 2019


Might be worth adding a comment here, because .test() seems like the right thing to do and is easy to miss the implications of the g flag.

return JSON.stringify(metadata).replace(relativePathRegex, typingsRelativePath);
@@ -89,6 +89,8 @@ describe('@angular/core ng_package', () => {
.describe('angular metadata', () => {
it('should have metadata.json files',
() => { expect('core.metadata.json')).toContain(`"__symbolic":"module"`); });
it('should not have self-references in metadata.json',
() => { expect('core.metadata.json')).not.toContain(`"from":"./core"`); });

describe('fesm2015', () => {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.