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 · 0 comments
Open
5 tasks

Reduce installation size #11

tuler opened this issue May 1, 2024 · 0 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.14.0 is currently at ~54Mb.

npx howfat -r table @cartesi/cli
@cartesi/cli@0.14.0 (443 deps, 53.98mb, 12543 files, ©Apache-2.0)


╭──────────────────────────────┬──────────────┬──────────┬───────┬───────────┬──────────────┬───────────╮
│ Name                         │ Dependencies │     Size │ Files │ Native    │ License      │ Deprec    │
├──────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ @inquirer/confirm@3.1.6      │           27 │   2.58mb │   385 │           │ MIT          │           │
├──────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ @inquirer/core@8.1.0         │           26 │   2.58mb │   377 │           │ MIT          │           │
├──────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ @inquirer/input@2.1.6        │           27 │   2.59mb │   385 │           │ MIT          │           │
├──────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ @inquirer/select@2.3.2       │           32 │   2.83mb │   455 │           │ MIT          │           │
├──────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ @inquirer/type@1.3.1         │              │   5.61kb │     7 │           │ MIT          │           │
├──────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ @oclif/core@3.26.5           │           94 │   6.45mb │  1327 │           │ MIT          │           │
├──────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ @oclif/plugin-help@6.0.21    │           95 │   6.83mb │  1336 │           │ MIT          │           │
├──────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ @oclif/plugin-plugins@5.0.17 │          347 │  34.81mb │  6126 │           │ MIT          │           │
├──────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ bytes@3.1.2                  │              │  11.98kb │     5 │           │ MIT          │           │
├──────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ chalk@5.3.0                  │              │  42.71kb │    12 │           │ MIT          │           │
├──────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ execa@8.0.1                  │           16 │ 293.75kb │   132 │           │ MIT          │           │
├──────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ fs-extra@11.2.0              │            3 │ 109.24kb │    48 │           │ MIT          │           │
├──────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ giget@1.2.3                  │           34 │   1.93mb │   341 │           │ MIT          │           │
├──────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ lookpath@1.2.2               │              │     16kb │     7 │           │ MIT          │           │
├──────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ open@10.1.0                  │            8 │  84.63kb │    47 │           │ MIT          │           │
├──────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ ora@8.0.1                    │           17 │  210.4kb │   101 │           │ MIT          │           │
├──────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ progress-stream@2.0.0        │           11 │ 181.27kb │    83 │           │ BSD-2-Clause │           │
├──────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ semver@7.6.0                 │            2 │ 121.72kb │    60 │           │ ISC          │           │
├──────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ tmp@0.2.3                    │              │  53.08kb │     5 │           │ MIT          │           │
├──────────────────────────────┼──────────────┼──────────┼───────┼───────────┼──────────────┼───────────┤
│ viem@2.9.29                  │           10 │  15.72mb │  5542 │           │ MIT          │           │
╰──────────────────────────────┴──────────────┴──────────┴───────┴───────────┴──────────────┴───────────╯

✔️ Solution

oclif alternatives
https://www.npmjs.com/package/clipanion
https://www.npmjs.com/package/commander
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
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

1 participant