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

feat(misc): prepend cwd to directory in project generators when using as-provided format #19227

Merged

Conversation

leosvelperez
Copy link
Member

@leosvelperez leosvelperez commented Sep 19, 2023

Current Behavior

When generating a new project using the as-provided project name and root format, the current working directory is ignored.

Expected Behavior

When generating a new project using the as-provided project name and root format, it should consider the current working directory.

# cwd=.
nx g app app1
# directory: app1

# cwd=apps
nx g app app1
# directory: apps/app1

# cwd=apps
nx g app app1 --directory nested/app1
# directory: apps/nested/app1

# cwd=apps/nested
nx g app app1 --directory apps/nested/app1
# directory: apps/nested/app1 (the directory starts with the cwd, it's used as is)

Related Issue(s)

Fixes #

@leosvelperez leosvelperez self-assigned this Sep 19, 2023
@vercel
Copy link

vercel bot commented Sep 19, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Sep 22, 2023 8:34am

@leosvelperez leosvelperez marked this pull request as ready for review September 19, 2023 13:07
@leosvelperez leosvelperez requested review from a team as code owners September 19, 2023 13:07
@leosvelperez leosvelperez force-pushed the misc/project-generators-cwd-support branch from a53c4fd to 31ac2fe Compare September 20, 2023 14:36
@leosvelperez leosvelperez changed the title feat(misc): use cwd/<project name> as a default for the directory option in project generators feat(misc): prepend cwd to directory in project generators when using as-provided format Sep 20, 2023
@leosvelperez leosvelperez force-pushed the misc/project-generators-cwd-support branch from 31ac2fe to 285ebdc Compare September 21, 2023 07:45
@leosvelperez leosvelperez force-pushed the misc/project-generators-cwd-support branch from 4bcafcc to ad34bf2 Compare September 21, 2023 15:59
@leosvelperez leosvelperez force-pushed the misc/project-generators-cwd-support branch from 8a4af18 to a8a6852 Compare September 22, 2023 08:33
@FrozenPandaz FrozenPandaz merged commit c18c0b2 into nrwl:master Sep 22, 2023
6 checks passed
@leosvelperez leosvelperez deleted the misc/project-generators-cwd-support branch September 22, 2023 12:40
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants