Skip to content
This repository was archived by the owner on Apr 9, 2022. It is now read-only.

fix(@schematics/angular): fix import path for generated flat modules #354

Closed
wants to merge 1 commit into from

Conversation

dkuerner
Copy link

@dkuerner dkuerner commented Jan 3, 2018

If the target modulePath and the importModulePath are equal,
do not add a path seperator to the resulting module import path.

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

@googlebot
Copy link

CLAs look good, thanks!

@googlebot googlebot added cla: yes and removed cla: no labels Jan 3, 2018
@dkuerner
Copy link
Author

dkuerner commented Jan 3, 2018

Fix for #355

Copy link
Contributor

@Brocco Brocco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor change.

expect(files.indexOf('/src/app/app.module.ts')).toBeGreaterThanOrEqual(0);
expect(files.indexOf('/src/app/foo.module.ts')).toBeGreaterThanOrEqual(0);
const moduleContent = getFileContent(tree, '/src/app/app.module.ts');
expect(moduleContent).toMatch(/import { FooModule } from '.\/foo.module'/);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update regex to this:

/import { FooModule } from '\.\/foo.module'/

This way it checks for a period and not any character.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely.. added and squashed the requested change

@dkuerner dkuerner force-pushed the fix_flat_module_import branch from 3c53c84 to 679a361 Compare January 5, 2018 07:27
Brocco
Brocco previously approved these changes Jan 8, 2018
@filipesilva
Copy link
Contributor

@dkuerner can you rebase please? I'm not sure how the CI error relates to your changes and suspect it will go away on a rebase.

@dkuerner dkuerner force-pushed the fix_flat_module_import branch from 679a361 to 98182be Compare January 26, 2018 11:44
@hansl hansl assigned Brocco and unassigned Brocco Feb 22, 2018
@dkuerner dkuerner force-pushed the fix_flat_module_import branch 2 times, most recently from e099560 to cc12bce Compare March 30, 2018 20:37
If the target modulePath and the importModulePath are equal,
do not add a path seperator to the resulting module import path.
@dkuerner dkuerner force-pushed the fix_flat_module_import branch from cc12bce to 30f3fa4 Compare March 30, 2018 20:50
@alexeagle
Copy link
Contributor

Sorry @dkuerner - this got lost when we moved back to the angular/angular-cli repo. If you still think this pull request is relevant, could you please re-base on that repo and open a new PR there? Thanks and sorry for the extra churn.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants