Skip to content

[FEATURE] Migrate CLI runtime to pnpm for improved install performance #2023

@DevaanshKathuria

Description

@DevaanshKathuria

Why do we need this improvement?

The current npm installation process for the CLI is significantly slow, taking approximately 4m 13s on a fresh install (local benchmark). This creates friction for new contributors and slows down CI/CD pipelines where fresh installs occur frequently.

Furthermore, npm's hoisting mechanism is currently masking several missing peer dependencies (e.g., ajv, tslib, spectral). This results in a "fragile" dependency graph where the project relies on packages that aren't explicitly declared in package.json.

How will this change help?

  • Performance: Migrating to pnpm reduces fresh installation time to ~1m 19s. This is a ~3.2x speed improvement.

  • Stability: pnpm uses a strict dependency resolution strategy. This forces us to explicitly declare all used dependencies, preventing "phantom dependency" bugs and ensuring the build is deterministic across all environments.

Screenshots

No response

How could it be implemented/designed?

  • Remove package-lock.json.

  • Generate pnpm-lock.yaml.

  • Update package.json to include the missing dependencies identified during the migration (specifically: tslib, ajv, ajv-formats, @stoplight/spectral-core, @stoplight/spectral-formatters, @apidevtools/json-schema-ref-parser).

  • Update CI workflows to use pnpm install instead of npm install.

🚧 Breaking changes

Yes

👀 Have you checked for similar open issues?

  • I checked and didn't find a similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue?

Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    To Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions