Support (or document) projects that use lerna
See original GitHub issueLerna is awesome and allows us to create reusable components across a suite of angular applications without all the overhead of repository and version management.
It would be great if this generator could be updated to support the patterns supported by lerna, specifically linking at the root package level.
Currently I think this involves either modifications to the root package.json
to reference the src
or dist
folder or the addition of an index.ts
in the root folder so that you can link the root folder instead of needing to link either the dist
or src
folders depending on your use case.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Lerna: Documentation
Lerna is a fast modern build system for managing and publishing multiple JavaScript/TypeScript packages from the same repository.
Read more >How To Manage Monorepos With Lerna
Lerna is a tool for managing JavaScript projects with multiple packages. Lerna manages monorepos, which can hold projects containing multiple ...
Read more >Setting up a monorepo with Lerna for a TypeScript project
Lerna is a popular and widely used tool written in JavaScript for setting and managing multi-package repositories for Node.js projects with npm ...
Read more >JavaScript Monorepos with Lerna
Lerna is a monorepo manager for JavaScript projects. It helps you take a large codebase and split it into independently deployable packages.
Read more >Lerna is a fast, modern build system for managing and ...
Lerna is a fast modern build system for managing and publishing multiple JavaScript/TypeScript packages from the same repository.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @mattnathan for this research! I never heard of Lerna before, now I am diving into it 💪
Do we need two package.json after all? 🤔 🤔
@jvandemo now that @mattnathan mentions it, do we have a strong reason to have two
package.json
? Technically we could use just one, it would force our users to installdevDependencies
even when they just want to use the library (not develop over it), but that wouldn’t be much of a problem since it would still be local. In general terms onepackage.json
is simpler than two. What do you think?What is each package.json? FYI: @mattnathan
root/package.json
: Used for development, has the devDependencies needed to develop the library.dist/package.json
: Used for publishing. It has the dependencies for production.src/package.json
: This is just the package that is copied and pasted to thedist
folder@jvandemo After a few hours trying different combinations of settings for the
package.json
I was unable to come up with a solution to this that solved the issue without a fairly major workaround.Effectively Lerna assumes that if it finds a
package.json
then that is the project and location where publishing/versioning/running/linking should happen. Unfortunately this is incompatible with the way this generator works where these concerns are expected to be run from different locations within the project. My understanding is thatdist/package.json
package.json
src/package.json
ordist/package.json
src/package.json
For my case (and because this is the best generator I’ve found for ng libs so far) I’ve configured Lerna to do all operations on the
src/package.json
(using"packages": ["components/**/src"]
inlerna.json
) and will have to add tooling to support publishing/etc that is more aware of this generators structure.If I come up with a better solution that satisfies more of the use-cases than just linking then I’d be happy to write a guide if that’s still something you want me to do.