11ty / eleventy

A simpler site generator. Transforms a directory of templates (of varying types) into HTML.
https://www.11ty.dev/
MIT License
17.19k stars 494 forks source link

Bundle official plugins with eleventy #97

Closed zachleat closed 6 years ago

zachleat commented 6 years ago

Ideally we’d be able to run eleventy-base-blog with just a global eleventy and not require an npm install in the project itself.

chrisdmacrae commented 6 years ago

IMHO this is probably a good opportunity to switch to a monorepo, to make development easier.

zachleat commented 6 years ago

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/

chrisdmacrae commented 6 years ago

I've set up a few monorepos for work using Lerna and really enjoy the workflow.

What are the benefits there?

There's quite a few benefits, provided one detail: you're working with multiple packages that are directly related, or that may be related.

Development standards are much cleaner

In a multi-repo approach, you either:

In a monorepo approach, you:

Example

|- 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.

Development workflow is much cleaner

When working with interrelated packages across multiple repos, you have to deal with:

When working with a monorepo:

Testing

Testing is much easier, as you can write tests that are:

Collaboration

The same issues that apply to the development standards apply to collaboration standards:

Publishing

Lerna will automatically handle (if you so choose):

chrisdmacrae commented 6 years ago

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.

zachleat commented 6 years ago

Wow—what a reply—thank you! So many benefits here to solve pain points I’m having—I think this is great.

zachleat commented 6 years ago

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+

binyamin commented 4 years ago

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.