nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.29k stars 2.32k forks source link

What are required workspace/cli updates, if libs are in separate repository #147

Closed netwobble closed 5 years ago

netwobble commented 6 years ago

We would like to have libs in separate repositories with different owners and then projects clone the lib to each project.

The question is ... Once doing this, what configurations are necessary in the workspace to wire things up.

Example Workspace 1

Workspace 2 (maintained by separate team)

Really just a question or documentation.

cheers, AJ

tommyc38 commented 6 years ago

@netwobble I apologize for my attempt to try and answer this question earlier. I reread my answer and deleted it...I hadn't slept in awhile when I wrote that and would like to take a second attempt to help answer your question.

Hopefully the comments below help answer this question:

  1. When you create a lib, Nx registers the new lib as an app in angular-cli.json. If someone creates a new lib in a shared lib-rep, in another workspace, you would need some way to ensure it gets registered in all workspace/angular-cli.json files using the lib-repo.
  2. If you create a lib in one workspace that has dependencies, how do you tell your other workspaces about the new dependency?
  3. If you have lazy loading enabled for any libs, you need to include them in the tsconfig.app.json file in each app (e.g. open this file in one of your apps and look at the commented line at the bottom). You need to manually add this regardless if you use the option for --lazy when creating a lib to your apps.

Hopefully this helps.

netwobble commented 6 years ago

A great post by Victor describing the exact usecase https://blog.nrwl.io/dev-workflow-using-git-submodules-and-yarn-workspaces-14fd06c07964

thanks, AJ

vsavkin commented 5 years ago

^^ my post talks about how it can be done.

github-actions[bot] commented 1 year ago

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.