You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wasn't around when the "core" deps were chosen. So I might be missing something on this.
gunshi is effectively only used to route 2 subcommands and call renderUsage; a whole framework looks like an overkill. if we want to change this there are 2 options:
Option A: Replace with mri + a tiny manual dispatcher with lazy imports - smallest footprint and full control, but help/usage must be maintained manually
Option B: Replace with a lightweight CLI library (e.g. sade) - keeps auto help and per‑command option parsing with only a small increase in dependency size (in the sade example, it weighs ~2.3 times less than gunshi)
module-replacements
I might be crazy, but.. We can host those three JSON manifests on "a registry" (like shadcn’s /r/.json concept, for example - https://ui.shadcn.com/r) and have the CLI fetch and cache them, so we avoid installing the whole package into node_modules as a result. This should be a lighter process, than a regular npm installation
module-replacements-codemods
Probably should open an issue upstream to track this. This is the biggest size eater rn. module-replacements-codemods currently pulls @ast-grep/napi, which brings prebuilt native bindings and adds a large install footprint (~80MB observed). Given that the repository only uses the ast-grep API in fewer than 10 places and a lot of the existing codemod base is jscodeshift-based, shipping those binaries by default feels disproportionate. Can we settle on one option or find a workaround there?
Since this is a dev dependency, it has the lowest priority. However, given that the test script already uses FORCE_COLOR=1 (which doesn't work properly on Windows without the tweaks), we could consider replacing premove with native rm -rf to eliminate this dependency entirely.
gunshiNote
I wasn't around when the "core" deps were chosen. So I might be missing something on this.
gunshi is effectively only used to route 2 subcommands and call renderUsage; a whole framework looks like an overkill. if we want to change this there are 2 options:
mri+ a tiny manual dispatcher with lazy imports - smallest footprint and full control, but help/usage must be maintained manuallysade) - keeps auto help and per‑command option parsing with only a small increase in dependency size (in thesadeexample, it weighs ~2.3 times less than gunshi)module-replacementsI might be crazy, but.. We can host those three JSON manifests on "a registry" (like shadcn’s /r/.json concept, for example - https://ui.shadcn.com/r) and have the CLI fetch and cache them, so we avoid installing the whole package into node_modules as a result. This should be a lighter process, than a regular npm installation
module-replacements-codemodsProbably should open an issue upstream to track this. This is the biggest size eater rn.
module-replacements-codemodscurrently pulls@ast-grep/napi, which brings prebuilt native bindings and adds a large install footprint (~80MB observed). Given that the repository only uses theast-grepAPI in fewer than 10 places and a lot of the existing codemod base isjscodeshift-based, shipping those binaries by default feels disproportionate. Can we settle on one option or find a workaround there?package-manager-detectorCheck around
process.env.npm_config_user_agentshould be sufficient for our use case. It's not a lot of code to implement: https://github.com/antfu-collective/package-manager-detector/blob/main/src/detect.tspremoveSince this is a dev dependency, it has the lowest priority. However, given that the test script already uses
FORCE_COLOR=1(which doesn't work properly on Windows without the tweaks), we could consider replacingpremovewith nativerm -rfto eliminate this dependency entirely.Branch - https://github.com/e18e/cli/compare/main...outslept:cli:replace-premove?expand=1