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

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

Always

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

gkalpak Mar 16, 2019

Member

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(shx.cat('core.metadata.json')).toContain(`"__symbolic":"module"`); });
it('should not have self-references in metadata.json',
() => { expect(shx.cat('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.