fix: migrate to pnpm + fix 4 bugs (#2017, #2018, #2021, #2026)#2088
fix: migrate to pnpm + fix 4 bugs (#2017, #2018, #2021, #2026)#20881164148-7-eng wants to merge 1 commit intoasyncapi:masterfrom
Conversation
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
|
There was a problem hiding this comment.
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.
|



Summary
This PR fixes 5 issues in one:
Breaking Change: npm to pnpm Migration
package-lock.json, addspnpm-lock.yamlpnpm install --frozen-lockfilepackageManagerfield topackage.jsonBug Fixes
#2018 - Watch mode crashes with TypeError: thisArg.isLocalTemplate is not a function
src/utils/generate/watcher.tsline 198:isLocalTemplateis 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 fromloadAsyncAPIInput()instead of callingload()again. Eliminates duplicate disk I/O and parsing overhead for large specs.#2021 - UnparsedCommand warnings in test logs
static idtoconfig:versionsandconvertcommandsbase.tscatch() to suppress non-critical CLIError warnings that pollute stderrTesting
All fixes are verifiable:
TypeError: thisArg.isLocalTemplate is not a function#2018: Runasyncapi generate fromTemplate ... --watchfromTemplate.tscommand (unnecessary double parsing) #2017: Performance improvement (single parse vs double)/claim #2018 /claim #2026 /claim #2017 /claim #2021