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

[WORKSPACE] Monorepo packages/apps dependencies managements #8816

Closed
MatthD opened this issue Apr 23, 2024 · 3 comments
Closed

[WORKSPACE] Monorepo packages/apps dependencies managements #8816

MatthD opened this issue Apr 23, 2024 · 3 comments

Comments

@MatthD
Copy link

MatthD commented Apr 23, 2024

Description

So I have a project, we did used typescript path aliases in the past so that our apps can load our packages.
We would go with Bit be able to have a link between our packages-apps

When doing bit install via pnpm behind , it add my local packages into the node-modules;

BUT it appears that it create symlink PER every files (not on the directory)

So that if I had to add new file/rename one/remove one I need to bit install so that I can saw the new file.

BUT ! It keep the file removed from my packages, and it also keep the renamed file + the new renamed.

That's not a good dev experience, so I may be wrong in term of usage, could you help?

Specifications

  • Bit version: 1.6.126
  • Node version: 20.11.0
  • npm / yarn version: 10.2.4
  • Platform: Mac0s 14.4.1
  • Bit compiler (include version): pnpm
@itaymendel
Copy link
Contributor

for generating the local module links you can simply run bit start or bit watch and bit will refresh the node-module links.
essentially this runs bit link && bit compile, which only care about the module link generation.

as for removed files and their links or dists, at the moment we don't have a good solution for this.

@MatthD
Copy link
Author

MatthD commented Apr 23, 2024

Thanks for your answer. ! But why Bit is creating a per file symlink ? I mean a symlink that point to folder will prevent this kind of thing no ?
Is it related to pnpm ?

@itaymendel
Copy link
Contributor

the node-module link is there to mimic the component as if it was an external dependency, and as such, has additional generated files that are not just the source code (like the dist directory or even the auto-generated package.json).
if bit would have symlink the entire directory, and it would then try to generate files, these files would appear as part of your source code. and that is something we don't want.

the goal is for a component to have all the APIs for others to use from your index file, not for you to directly import internal implementation details from your components.

you only need to have bit watch (or even bit start) run in the background, and on every change you get the compiled outputs to your dist (which is pointed to from the package.json). so other services/components can safely depend on your component.

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

No branches or pull requests

2 participants