Skip to content

Conversation

@abhi-03-kh
Copy link

Problem

The CLI currently bundles @asyncapi/studio (~1GB+) as a hard dependency. This forces CI/CD users and automation pipelines to download a full React/Next.js web application that they never use.

Solution

  • Moved @asyncapi/studio from dependencies to optionalDependencies in package.json.
  • Refactored src/domains/models/Studio.ts and Preview.ts to use dynamic import() logic.
  • Added graceful error handling: if a user runs start studio without the package, they receive a helpful prompt to install it instead of a crash.

Results

Scenario Install Size Notes
Before (Hard Dep) ~1.6 GB All users pay the cost
After (Lite) 698 MB ~57% Reduction 📉
After (With Studio) ~1.6 GB Only users who need it pay the cost

Verification

  • npm install --omit=optional results in a 698MB install size.
  • asyncapi validate runs successfully without Studio installed.
  • asyncapi start studio fails gracefully with a helpful error message when missing.
  • asyncapi start studio works correctly (launches v1.1.0) when the package is manually installed.
  • Applied fixes for WebSocket handling and Preview command stability.

Breaking Change

Users who rely on asyncapi start studio without explicitly installing @asyncapi/studio will now see an error message instructing them to install it, rather than a crash.

Closes #1752

@changeset-bot
Copy link

changeset-bot bot commented Jan 29, 2026

🦋 Changeset detected

Latest commit: 7bf7788

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@asyncapi/cli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Triage

Development

Successfully merging this pull request may close these issues.

[FEATURE] Reduce number of dependencies and install size (v2.17 needs 1700 dependencies, takes 1.7Gb of space)

1 participant