Skip to content

Instantly share code, notes, and snippets.

@gossi
Created July 4, 2022 09:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gossi/73e9428c96a5b138406a11c1732c5b06 to your computer and use it in GitHub Desktop.
Save gossi/73e9428c96a5b138406a11c1732c5b06 to your computer and use it in GitHub Desktop.
Ember monorepo with many addons in v2

Ember Monorepo with many Addons in v2

With ember addons v2, dummy and addon code are separated. Which allow us to have a package for each and additionally one more packge for documentation, etc.

Simon Ihmig wrote how to migrate a repo for a single addon to a monorepo.

But how organize your projects if this is already a monorepo and many addons are in there? Where to put the test-apps for each such addon?

Idea 1: Addon Project folder, $addon package

packages/
- addon1/
  - addon1/
    - src/
  - testing/
    - test-app/
- addon2/
  - addon2/
    - src/
  - testing/
    - test-app/
- ...

My issues with this format would be describe this format in workspaces, ie. pnpm-workspace.yaml file.

Idea 2: Addon Project folder, addon package

packages/
- addon1/
  - addon/
    - src/
  - testing/
    - test-app/
- addon2/
  - addon/
    - src/
  - testing/
    - test-app/
- ...

Give clear folder names within each project. Which then can be configured in pnpm-workspaces.yaml.

Idea 3: Extract Testing

packages/
- addon1/
  - src/
- addon2/
  - src/
- testing/
  - test-all-addons/
  - addon1-test-app/
  - addon2-test-app/

This might look "clean" for the addons itself, but when applying embers convention for file organization on that, it feels like the de-podified version.

It may even work, if the whole monorepo is for "one product". But still it splits up context of a certain project. Kinda nah!

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