Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions RFC-by-stage/1-approved/monorepo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
Status: `Proposal` # Please do not change this.
Implementer: # It will be changed upon merging and as it moves through the RFC stages
---

# Simplify the monorepo

## The issue to be solved

The tool [lerna](https://lerna.js.org/) we have been using to power the monorepo has become incredibly slow and difficult to deal with.
We need to simplify the structure to allow us to fix things faster.

## A short description of the solution

I propose we remove lerna, move to [npm workspaces](https://docs.npmjs.com/cli/v8/using-npm/workspaces)
and de-tangle the reasons the `bootstrap` process is currently so dependent on a very specific order
at which what dependency has to be installed.

## Technical details

This RFC depends on [Remove pancake #1](https://github.com/designsystemau/RFCs/pull/1).

Once we have done away with the build of pancake we can de-tangle the install process and since there won't
be any more `postinstall` scripts per component we will be able to install the dependencies per component
without having to worry about the order of what is installed when.

We will still have the test sites we have now running as those do not require any changes and don't depend on anything.
That means we can leave the testing infrastructure in place which is good.

It does however also include the inclusion of the below tools:

- [prettier](https://prettier.io/)
- [manypkgs](https://github.com/Thinkmill/manypkg)
- [preconstruct](https://preconstruct.tools/)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turborepo could replace npm + preconstruct, or Parcel 2 which might be a lighter touch here.

- The docs website

The docs website will be included into this monorepo so that docs are drawn from the readme of each component.
That way we won't have to deal duplicating docs in two places.

This depends on [Docs site improvements #4](https://github.com/designsystemau/RFCs/pull/4).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think #4 comes after this, so #4 depends on #2. Can remove this line.


The structure of the monorepo would look like this then:

```sh
.
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── DEVELOPING.md
├── LICENSE
├── README.md
├── SUPPORT.md
├── auds.json
├── docs
│ └── ... (the docs site published at https://gold.designsystemau.org)
├── package-lock.json
├── package.json
└── packages
└── ... (a directory per component)
```