Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce installation size #11

Open
5 tasks
tuler opened this issue May 1, 2024 · 2 comments
Open
5 tasks

Reduce installation size #11

tuler opened this issue May 1, 2024 · 2 comments

Comments

@tuler
Copy link
Member

tuler commented May 1, 2024

📚 Context

Installing @cartesi/cli, either through npm install or brew install download the npm package all install all its dependencies.
The total size of the package installation for cartesi 0.16.1 is currently at ~55Mb.

npx howfat -r table @cartesi/cli
@cartesi/cli@0.16.1 (408 deps, 55.15mb, 13669 files, ©Apache-2.0)
╭─────────────────────────────┬──────────────┬──────────┬───────┬───────────┬──────────────┬───────────╮
│ Name                        │ Dependencies │     Size │ Files │ Native    │ License      │ Deprec    │
├─────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ @inquirer/confirm@3.2.0     │           24 │    2.8mb │   399 │           │ MIT          │           │
├─────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ @inquirer/core@9.1.0        │           23 │   2.79mb │   391 │           │ MIT          │           │
├─────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ @inquirer/input@2.3.0       │           24 │   2.81mb │   399 │           │ MIT          │           │
├─────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ @inquirer/select@2.5.0      │           28 │   3.02mb │   462 │           │ MIT          │           │
├─────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ @inquirer/type@1.5.3        │            1 │  69.21kb │    21 │           │ MIT          │           │
├─────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ @oclif/core@4.0.19          │           69 │   3.14mb │   918 │           │ MIT          │           │
├─────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ @oclif/plugin-help@6.2.10   │           70 │   3.15mb │   926 │           │ MIT          │           │
├─────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ @oclif/plugin-plugins@5.4.6 │          295 │  31.58mb │  5458 │           │ MIT          │           │
├─────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ bytes@3.1.2                 │              │  11.98kb │     5 │           │ MIT          │           │
├─────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ chalk@5.3.0                 │              │  42.71kb │    12 │           │ MIT          │           │
├─────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ cli-table3@0.6.5            │            6 │ 150.13kb │    59 │           │ MIT          │           │
├─────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ execa@9.3.1                 │           21 │ 616.98kb │   311 │           │ MIT          │           │
├─────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ fs-extra@11.2.0             │            3 │ 109.24kb │    48 │           │ MIT          │           │
├─────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ giget@1.2.3                 │           38 │      3mb │   406 │           │ MIT          │           │
├─────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ lookpath@1.2.2              │              │     16kb │     7 │           │ MIT          │           │
├─────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ open@10.1.0                 │            8 │  84.63kb │    47 │           │ MIT          │           │
├─────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ ora@8.1.0                   │           17 │ 280.12kb │   125 │           │ MIT          │           │
├─────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ progress-stream@2.0.0       │           11 │ 181.27kb │    83 │           │ BSD-2-Clause │           │
├─────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ semver@7.6.3                │              │  93.58kb │    52 │           │ ISC          │           │
├─────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ tmp@0.2.3                   │              │  53.08kb │     5 │           │ MIT          │           │
├─────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ viem@2.21.1                 │           11 │  16.68mb │  6901 │           │ MIT          │           │
╰─────────────────────────────┴──────────────┴──────────┴───────┴───────────┴──────────────┴───────────╯

✔️ Solution

oclif alternatives
https://www.npmjs.com/package/commander
https://www.npmjs.com/package/clipanion
https://www.npmjs.com/package/cleye
https://github.com/adbayb/termost (includes enquirer)

Inquirer
Discussion about size here
There are several alternatives.
One that deserves more research is @clack/prompts

Giget
This library is being used in create command to download code from the templates repository.
Need to research why it's a little large, why, and if we need it.

Viem
There is an issue with how it is structured discussed here

📈 Subtasks

  • discuss solution for oclif
  • discuss solution for inquirer
  • discuss solution for giget
  • discuss solution for viem

🎯 Definition of Done

  • size reduced
@tuler tuler changed the title Reduce CLI installation size Reduce installation size May 1, 2024
@endersonmaia
Copy link
Contributor

execa is not that big, but if we need an alternative, let's keep an eye on nano-spawn

@tuler
Copy link
Member Author

tuler commented Sep 17, 2024

execa is not that big, but if we need an alternative, let's keep an eye on nano-spawn

Interesting. Even though it's immature, it's maintained by the same people of execa. And I don't really care about most of the extra features of execa compared to nano-spawn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants