Skip to content

Reduce installation size #11

@tuler

Description

@tuler

📚 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions