Angelmmiguel / svgi

🔎 The SVG inspection tool
http://svgi.angelmm.rocks
Apache License 2.0
578 stars 20 forks source link

Split the project into core and CLI packages #39

Open Angelmmiguel opened 2 years ago

Angelmmiguel commented 2 years ago

The main reasoning behind this change is to avoid injecting CLI libraries to projects that only want to use the SVGI core library. Currently, 6 of 7 libraries are only required for the CLI usage:

"dependencies": {
    "ascii-tree": "^0.3.0",
    "cli-table": "^0.3.11",
    "colors": "^1.4.0",
    "commander": "8.3.0",
    "filesize": "^8.0.7",
    "js-yaml": "^4.1.0",
    "xml2js": "^0.4.23"
  },

For this reason, I plan to split the project into two packages: core and CLI. To simplify the management, the code for both packages will be available in this project as a monorepo.

Part of this task is to evaluate the tooling to manage this monorepo. I have in mind to check 3 different tools, but feel free to suggest any other you may consider for monorepos.

As part of this, I would like to investigate Typescript configurations for monorepos (related to #37).

Angelmmiguel commented 2 years ago

Another option I didn't consider at the beginning that seems promising is pnpm. This tool combines an efficient package manager for node and built-in support for monorepos. Since pnpm is growing in adoption and it's a project I wanted to check, I'll go for this option.

The only limitation I found is when releasing new versions. This feature is still not supported on pnpm, although this repo will contain only 2 packages, so it won't be a big issue. In addition to that, they provide you documentation about how to integrate rush or changesets to cover this missing use case.

Here you have some interesting articles and docs: