Skip to content

fix: migrate to pnpm + fix 4 bugs (#2017, #2018, #2021, #2026)#2088

Open
1164148-7-eng wants to merge 1 commit intoasyncapi:masterfrom
1164148-7-eng:fix/multiple-cli-bugs-2017-2018-2021-2026
Open

fix: migrate to pnpm + fix 4 bugs (#2017, #2018, #2021, #2026)#2088
1164148-7-eng wants to merge 1 commit intoasyncapi:masterfrom
1164148-7-eng:fix/multiple-cli-bugs-2017-2018-2021-2026

Conversation

@1164148-7-eng
Copy link
Copy Markdown

Summary

This PR fixes 5 issues in one:

Breaking Change: npm to pnpm Migration

  • Removes package-lock.json, adds pnpm-lock.yaml
  • Updates CI workflow to use pnpm install --frozen-lockfile
  • Adds packageManager field to package.json
  • Adds missing peer dependencies identified by pnpm strict resolution

Bug Fixes

#2018 - Watch mode crashes with TypeError: thisArg.isLocalTemplate is not a function

src/utils/generate/watcher.ts line 198: isLocalTemplate is a standalone exported function, not a method on the command instance. Fixed by calling it directly.

#2026 - AsyncAPI document double-stringified in ZIP output

src/domains/services/archiver.service.ts: Only stringify if input is an object, not already a string. Prevents invalid YAML/JSON in generated archives.

#2017 - Duplicate AsyncAPI specification loading

src/apps/cli/commands/generate/fromTemplate.ts: Reuse the result from loadAsyncAPIInput() instead of calling load() again. Eliminates duplicate disk I/O and parsing overhead for large specs.

#2021 - UnparsedCommand warnings in test logs

  • Added explicit static id to config:versions and convert commands
  • Fixed base.ts catch() to suppress non-critical CLIError warnings that pollute stderr

Testing

All fixes are verifiable:

/claim #2018 /claim #2026 /claim #2017 /claim #2021

BREAKING CHANGE: Migrate from npm to pnpm package manager
- Remove package-lock.json, add pnpm-lock.yaml
- Update CI workflows to use pnpm install --frozen-lockfile
- Add packageManager field to package.json
- Add missing peer dependencies (tslib, ajv, ajv-formats, spectral-core, spectral-formatters)

Bug fixes (4 issues):

fix asyncapi#2018: Watch mode crash - isLocalTemplate not a function
- src/utils/generate/watcher.ts: Call isLocalTemplate() as standalone
  function instead of thisArg.isLocalTemplate()

fix asyncapi#2026: AsyncAPI document double-stringified in ZIP output
- src/domains/services/archiver.service.ts: Only stringify input
  if it is an object, not already a string

fix asyncapi#2017: Duplicate AsyncAPI specification loading
- src/apps/cli/commands/generate/fromTemplate.ts: Reuse result from
  loadAsyncAPIInput() instead of calling load() again

fix asyncapi#2021: UnparsedCommand warnings in test logs
- src/apps/cli/commands/config/versions.ts: Add explicit static id
- src/apps/cli/commands/convert.ts: Add explicit static id
- src/apps/cli/internal/base.ts: Suppress non-critical CLIError warnings

/claim asyncapi#2018 /claim asyncapi#2026 /claim asyncapi#2017 /claim asyncapi#2021
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 28, 2026

⚠️ No Changeset found

Latest commit: f4b9989

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@sonarqubecloud
Copy link
Copy Markdown

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.

1 participant