Closed zachleat closed 6 years ago
IMHO this is probably a good opportunity to switch to a monorepo, to make development easier.
I’ve been reading about monorepos a bit and I love the idea.
I’m not really sure why someone would have a monorepo and then publish a bunch of NPM packages from that? What are the benefits there? Cleaner imports? Looking at lerna
specifically https://lernajs.io/
I've set up a few monorepos for work using Lerna and really enjoy the workflow.
There's quite a few benefits, provided one detail: you're working with multiple packages that are directly related, or that may be related.
In a multi-repo approach, you either:
In a monorepo approach, you:
|- node_modules/
|- packages/
|--- eleventy/
|--- eleventy-plugin-rss/
|- .babelrc
|- .prettierrc
|- .eslintrc
|- package.json
In this scenario, the eslint
, prettier
, and babel
config can be applied to both the eleventy/
and eleventy-plugin-rss/
package.
When working with interrelated packages across multiple repos, you have to deal with:
npm link
to interrelate and test packages, making it easy to muddle your environment.npm link
when you want to test/use your published packages in other projects.When working with a monorepo:
Testing is much easier, as you can write tests that are:
The same issues that apply to the development standards apply to collaboration standards:
Lerna will automatically handle (if you so choose):
An aside, I also generally setup yarn workspaces with Lerna, because it dramatically reduces project size by hosting all dependencies to the root node_modules/
folder, except for bin executables.
This generally has no negatives, because anyone using NPM will just get the regular, non-optimized workflow.
Wow—what a reply—thank you! So many benefits here to solve pain points I’m having—I think this is great.
This repository is now using lodash style issue management for enhancements (see https://twitter.com/samselikoff/status/991395669016436736)
This means enhancement issues will now be closed instead of leaving them open. The enhancement backlog can be found here: https://github.com/11ty/eleventy/issues?utf8=%E2%9C%93&q=label%3Aneeds-votes+sort%3Areactions-%2B1-desc+
See #1103, where many plugins which currently come bundled, may stop coming with 11ty in v1.0.0. The consensus seems to be that this is a bad idea.
Ideally we’d be able to run
eleventy-base-blog
with just a global eleventy and not require annpm install
in the project itself.