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

Unexpected lib directory #12801

Closed
ri8ika opened this issue Oct 25, 2022 · 2 comments
Closed

Unexpected lib directory #12801

ri8ika opened this issue Oct 25, 2022 · 2 comments

Comments

@ri8ika
Copy link

ri8ika commented Oct 25, 2022

Previously, I was able to have separate directories apps and libs. But today, I tried to create a workspace with the latest version and it generates the libraries inside the packages folder itself. I want it to be in the root folder.

I also tried:

nx g move --project mylib shared/mylib

But it still creates folder inside the packages. I am afraid to move them manually because, I'll need to fix many things if I do it manually.

I also tried:

nx g @nrwl/js:lib mylib --directory=../shared/

Now, this time it has the expected directory structure. But it creates weird file name: ../mylib.tsx. This seems to be a bug.

I have checked this PR fix but I think that fix is really unnecessary and weird. It should be reverted. Otherwise, we could not get expected directory structure. In that PR case, they can use --directory to have folder in the same package, but getting folder generated in the root workspace, it's weird. So, it must be fixed please.

@AgentEnder
Copy link
Member

The placement of your projects depends on workspaceLayout inside nx.json. If you wish them to be relative to root, you'd want a configuration similar to that on this repo:

{
   "workspaceLayout": {
    "libsDir": "",
    "appsDir": ""
  },
}

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

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

No branches or pull requests

2 participants