Skip to content

[Comunity Goal 2026] [S1] Migrate @asyncapi/diff into the CLI #2303

Closed

Description

@princerajpoot20

Description

We have approval from the codeowners of diff and cli.
More details here:
asyncapi/diff#226
#2251

We are proceeding with the merger.

Migrate @asyncapi/diff into asyncapi/cli as packages/diff/.

We will assess whether any changes are needed so the library fits the CLI repo. If a breaking change is needed, we will bump the major version. We did this for @asyncapi/optimizer when it moved into CLI, so it could align with how the CLI works.

Action items

  • Move code into cli (packages/diff/)
  • Update turbo.json / monorepo wiring for the new package
  • Point root CLI dependency at the workspace package (today "@asyncapi/diff": "^0.5.0")
  • Update repo-related details in the diff package.json (repository URL and other related fields as needed)
  • Merge CODEOWNERS into cli
  • Add a spec for diff (see below)
  • Update other relevant files as needed, such as the README and architecture docs
  • Sanity check the diff repo and its code. Explore it and note anything else we should be aware of before/during the move
  • Assess and identify any changes needed so diff aligns with the CLI repo. If a breaking change is needed, bump the major version (same as optimizer)
  • Update the CLI diff command and server-api /diff so they use the workspace package after the move
  • Update the test pipeline so the diff package tests run in cli, and check that existing CLI diff and server-api tests still pass
  • Sort out releases so @asyncapi/diff publishes from cli (update the release pipeline so it can release diff)
  • Make the npm changes: update relevant fields, add/update the trusted publisher in NPM, and check NPM portal settings
  • Test the release

Out of scope: Archiving the diff repo.

Spec

The reason we are consolidating these repos and the broader community goal of auditing, is to improve repo health and maintainability, bring on more maintainers, and eventually reduce maintainer burnout.

As part of that, we are adding specs in these repos. Specs act as a source of truth for contributors, and more importantly give AI context about the package. That should help anyone developing here, whatever approach they follow: pure vibe coding, pure spec-driven, or a mix of both.

Notes on references inside cli

What does need updating: root package.json currently has "@asyncapi/diff": "^0.5.0" (npm). After migration it should use the local workspace package, so builds/tests resolve to packages/diff instead of registry.npmjs.org.

The CLI diff command currently imports from @asyncapi/diff/lib/asyncapidiff. After the move, use the normal package export instead.

cli/openapi.yaml is the API spec for the CLI's server-api (it documents a /diff endpoint). It currently links to the standalone asyncapi/diff GitHub repo. Update that link, and other docs/README links, to the monorepo path.

Check Docker and the GitHub Action image. If they need changes for diff.

The CLI has a shared output / error-code convention. Assess how diff (the library and the asyncapi diff command) should follow that, same as we did for optimizer.

References

Activity

  1. princerajpoot20 commented on Sep 20, 2026

    @princerajpoot20
    MemberAuthor

    I will be working on this.

  2. princerajpoot20 commented on Sep 20, 2026

    @princerajpoot20
    MemberAuthor

    Reason for the Advanced Classification

    The Advanced Classification is required because of the following list of work that needs to be completed in order to resolve this issue:

    • Move the entire codebase with changes. Check action item list for more details on this.
    • Assess and identify any changes needed so the library aligns with CLI. If a breaking change is needed, bump the major version (same as optimizer).
    • Make sure the migrated code follows the CLI shared output / error-code convention where needed (same as optimizer).
    • Wire the package into the existing CLI monorepo (Turbo / workspaces).
    • Update the test pipeline so the diff package tests run in cli, and check that existing CLI diff and server-api tests still pass.
    • Sort out the release from cli (update the release pipeline so it can release diff), and make the NPM changes (trusted publisher and portal settings).
    • Test the release.
    • Update the documentation and other references, such as package.json.
    • Add specs for diff.
  3. aeworxet commented on Sep 21, 2026

    @aeworxet
    Contributor

    This GitHub issue has been submitted for participation in the Microgrant Program with the Advanced Complexity Level.

    To carry out the community pre-moderation, please independently assess whether this issue has been classified correctly according to the reasoning outlined in #2303 (comment).

    @AceTheCreator

  4. added
    microgrant
    on Sep 21, 2026
  5. aeworxet commented on Sep 21, 2026

    @aeworxet
    Contributor

    Microgrant Issue's service comment

    Text labels: microgrant/2026-10, microgrant/advanced, microgrant/coding
    Assignment to regular contributors after: 2026-09-25 00:00:00 UTC+12:00
    End Of Life after: 2026-10-31 23:59:59 UTC-12:00

    @asyncapi/microgrant_team

    The Microgrant Program is not a Mentorship Program. The accepted level of Microgrant Program Participants is Middle/Senior.
    Regular contributors should explain in clear terms how they will approach the resolution process when expressing interest in working on this Microgrant Issue.
    References: Microgrant Program 101, Microgrant Program Rules
  6. aeworxet commented on Sep 21, 2026

    @aeworxet
    Contributor
  7. Shurtu-gal commented on Sep 22, 2026

    @Shurtu-gal
    Collaborator

    Before we start migration of diff. Some stuff would need to be addressed first:

    1. Who will maintain the diff codebase?
    2. [AMP-2026] Issue to track progress of work under AMP'26 #2252 still pending some items. @neoandmatrix maybe you would need to pitch in here. Major point being the logging standardisation.
  8. princerajpoot20 commented on Sep 22, 2026

    @princerajpoot20
    MemberAuthor

    Who will maintain the diff codebase?

    • Code owners will be the same as what we currently have in Diff: @aayushmau5, @magicmatatjahu, and @derberg, as this is a change in where the code resides, not in the responsibility. I am also willing to help as a code owner if that helps.

    #2252 still pending some items. @neoandmatrix maybe you would need to pitch in here. Major point being the logging standardisation.

    • Okay. @neoandmatrix, can you share the logging standardization Ashish is referring to, so that when migrating the code, I can make those changes accordingly?
  9. neoandmatrix commented on Sep 27, 2026

    @neoandmatrix
    Contributor

    Okay. @neoandmatrix, can you share the logging standardization Ashish is referring to, so that when migrating the code, I can make those changes accordingly?

    Sorry for the delayed response. Here are the proposed codes.

    INTERNAL_ERROR: 1,
    ASYNCAPI_DOCUMENT_INVALID: 10,
    DOCUMENT_PARSE_FAILED: 10,
    DOCUMENT_SYNTAX_INVALID: 10,
    SCHEMA_VALIDATION_FAILED: 11,
    GOVERNANCE_VALIDATION_FAILED: 11,
    REFERENCE_RESOLUTION_FAILED: 12,
    REMOTE_REFERENCE_INVALID: 12,
    DOCUMENT_FORMAT_UNSUPPORTED: 13,
    DOCUMENT_ALREADY_IN_TARGET_FORMAT: 13,
    DOCUMENT_VERSION_UNSUPPORTED: 14,
    CONVERSION_DOWNGRADE_UNSUPPORTED: 14,
    DIFF_VERSION_MISMATCH: 14,
    DIAGNOSTICS_FORMAT_INVALID: 15,
    DIAGNOSTICS_EXTENSION_MISMATCH: 15,
    DIFF_OVERRIDE_INVALID: 16,
    BREAKING_CHANGES_DETECTED: 17,
    TEMPLATE_NOT_FOUND: 20,
    GENERATION_FAILED: 21,
    MODEL_GENERATION_FAILED: 21,
    TEMPLATE_COPY_FAILED: 21,
    GENERATION_LANGUAGE_UNSUPPORTED: 22,
    TEMPLATE_DOCUMENT_VERSION_UNSUPPORTED: 23,
    GENERATOR_PARAMETER_INVALID: 24,
    GENERATOR_HOOK_INVALID: 24,
    GENERATOR_BASE_URL_MAPPING_INVALID: 24,
    GENERATION_OUTPUT_UNSAFE: 25,
    GENERATOR_REGISTRY_INVALID: 26,
    GENERATED_REFERENCE_READ_FAILED: 27,
    FILE_NOT_FOUND: 30,
    SPEC_FILE_NOT_FOUND: 30,
    OVERRIDE_FILE_NOT_FOUND: 30,
    FILE_PERMISSION_DENIED: 31,
    FILE_ALREADY_EXISTS: 32,
    DIRECTORY_ALREADY_EXISTS: 32,
    CONTEXT_ALREADY_EXISTS: 32,
    FILE_EXTENSION_UNSUPPORTED: 33,
    FILE_READ_FAILED: 34,
    FILE_WRITE_FAILED: 35,
    DIRECTORY_CREATE_FAILED: 35,
    FILE_SERIALIZATION_FAILED: 36,
    TEMP_DIRECTORY_FAILED: 37,
    CONNECTION_FAILED: 40,
    URL_FETCH_FAILED: 40,
    REGISTRY_UNREACHABLE: 40,
    NETWORK_TIMEOUT: 41,
    REGISTRY_TIMEOUT: 41,
    PROXY_ERROR: 42,
    PROXY_CONFIGURATION_INVALID: 42,
    HTTP_RESPONSE_ERROR: 43,
    REMOTE_REFERENCE_FETCH_FAILED: 44,
    GITHUB_DOWNLOAD_URL_MISSING: 44,
    REGISTRY_AUTH_REQUIRED: 45,
    REGISTRY_AUTH_FAILED: 45,
    STUDIO_INSTALL_DOWNLOAD_FAILED: 46,
    CLI_ARGUMENT_REQUIRED: 50,
    CLI_INPUT_REQUIRED: 50,
    CLI_FLAG_INVALID: 51,
    CLI_FLAG_VALUE_INVALID: 51,
    CLI_INTEGER_INVALID: 51,
    CLI_OPTIONS_CONFLICT: 52,
    CONTEXT_FILE_NOT_FOUND: 53,
    CONFIG_FILE_NOT_FOUND: 53,
    CONTEXT_FILE_INVALID: 54,
    CONTEXT_FILE_EMPTY: 54,
    CONFIG_FILE_INVALID: 54,
    CONTEXT_NOT_FOUND: 55,
    CURRENT_CONTEXT_NOT_SET: 56,
    CONFIG_READ_FAILED: 57,
    CONFIG_WRITE_FAILED: 58,
    STUDIO_INSTALL_DECLINED: 59,
    SERVER_PORT_IN_USE: 60,
    SERVER_START_FAILED: 61,
    STUDIO_RUNTIME_UNAVAILABLE: 62,
    STUDIO_NOT_INSTALLED: 62,
    PREVIEW_BUNDLE_FAILED: 63,
    WATCH_SOURCE_REMOVED: 64,
    WATCH_REGENERATION_FAILED: 64,
    WEBSOCKET_PROTOCOL_ERROR: 65,
    DEPENDENCY_ERROR: 90,
    INTERNAL_STATE_ERROR: 91,
    INTERNAL_CONFIGURATION_ERROR: 92,
    COMMAND_NOT_FOUND: 127,
    INTERRUPTED: 130

    I also have raised a PR it still needs some cleanup. Will be done soon.

  10. aeworxet commented on Oct 2, 2026

    @aeworxet
    Contributor

    Microgrant Issue's Assigned Timeline

    Complexity Level Assignment Date (by GitHub) Start Date (by MP Rules) End Date (by MP Rules) Draft PR Submission Final PR Merge Start Final PR Merge End
    Advanced 2026-09-20 2026-10-05 2026-11-29 2026-10-25 2026-11-15 2026-11-29
    Please note that the dates given represent deadlines, not specific dates; so if the goal is reached sooner, it's better.
    Keep in mind the responsibility for violations of the Timeline.

    Assignee: @princerajpoot20 (githubID: 44585452)

  11. princerajpoot20 commented on Oct 4, 2026

    @princerajpoot20
    MemberAuthor

    PR ready for review: #2310

  12. princerajpoot20 commented on Oct 14, 2026

    @princerajpoot20
    MemberAuthor

    The npm release workflow failed earlier, it’s green now: https://github.com/asyncapi/cli/actions/runs/38197559549/job/115875266136.

    Upon analyzing the issue, I found that it was related to the trusted publisher settings. I had already made the required changes, but the reason the release failed was that npm’s trusted publisher settings have a time interval within which you need to make a new release from the new source.

    I updated those settings well before the release, so the trusted publisher configuration expired. I re-added it, and now it’s working fine.

    For reference, this is the time interval in the npm settings I’m referring to.

    Image
  13. princerajpoot20 commented on Oct 14, 2026

    @princerajpoot20
    MemberAuthor

    Verification

    New versions of diff (0.6.0) have been successfully published to npm.
    https://www.npmjs.com/package/@asyncapi/diff

    Image
  14. princerajpoot20 commented on Oct 14, 2026

    @princerajpoot20
    MemberAuthor

    @aeworxet This microgrant issue has been completed.

  15. aeworxet commented on Oct 15, 2026

    @aeworxet
    Contributor

    Microgrant Issue Is Completed 🎉

    @princerajpoot20 (githubID: 44585452), please go to the dedicated AsyncAPI Microgrant Program 2026-10 page on Open Collective and submit an invoice for USD 400.00 (button 'ACTIONS', dropdown option 'Submit expense') with the full URL of this Microgrant Issue as the item description, the invoice title Microgrant cli#2303, and the tag microgrant.

    After submitting the invoice, please post the link to it in this Microgrant Issue as a separate comment to verify the invoice's authorship.

  16. aeworxet commented on Nov 2, 2026

    @aeworxet
    Contributor

    princerajpoot20
    https://opencollective.com/asyncapi/projects/asyncapi-microgrant-program/expenses/352895

    ✅
    The invoice https://opencollective.com/asyncapi/projects/asyncapi-microgrant-program/expenses/352895 was submitted by @princerajpoot20 (githubID: 44585452), who was the AsyncAPI Microgrant Program 2026-10 Participant and completed the Microgrant Issue cli#2303.

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

Metadata

Metadata

Labels

microgrant

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions