Skip to content

fix(@schematics/angular): default newProjectRoot to current directory #13754

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

Merged
merged 1 commit into from
Feb 26, 2019

Conversation

clydin
Copy link
Member

@clydin clydin commented Feb 25, 2019

Fixes #13704

@clydin clydin added the target: patch This PR is targeted for the next patch release label Feb 25, 2019
@clydin clydin requested a review from kyliau February 25, 2019 01:24
@FrozenPandaz
Copy link
Contributor

@clydin FYI, this does not fix the breaking change which we discussed. There is still logic which expects newProjectRoot to be (or not to be) undefined.

@clydin clydin force-pushed the fix-projectroot-default branch from 61834dd to dad48c3 Compare February 26, 2019 01:13
@clydin
Copy link
Member Author

clydin commented Feb 26, 2019

newProjectRoot is only in a conditional which checks if it is truthy in the application schematic:

projectRoot: newProjectRoot ? `${newProjectRoot}/${options.name}-e2e` : 'e2e',

I updated the PR to maintain the existing behavior for that case. Even though there is an argument to be made that it is actually a defect. As is, the 'e2e' directory would overlap an existing 'e2e' folder at the workspace root and the schematic would fail in the case of the workspace's newProjectRoot being falsy.

@FrozenPandaz
Copy link
Contributor

Awesome! Those changes fix the breaking change.

Thank you so much!

@mgechev mgechev merged commit b96e7bf into angular:master Feb 26, 2019
@clydin clydin deleted the fix-projectroot-default branch February 26, 2019 16:55
@@ -326,7 +326,7 @@ export default function (options: ApplicationOptions): Rule {
};

const workspace = getWorkspace(host);
let newProjectRoot = workspace.newProjectRoot || 'projects';
let newProjectRoot = workspace.newProjectRoot || '';
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't that a breaking change? This seems to be 2 changes; a fix and a feature...

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants