event-catalog / generator-asyncapi

AsyncAPI generator for EventCatalog
https://www.eventcatalog.dev/docs/development/integrations/async-api/intro
Other
9 stars 4 forks source link

feat(plugin): added support to specify custom service ids #31

Closed boyney123 closed 1 month ago

boyney123 commented 1 month ago

Breaking changes

To make the plugin more flexible, I have changed the API.

From

...
generators: [
    [
      '@eventcatalog/generator-asyncapi',
      {
        path: [path.join(__dirname, 'asyncapi-files', 'orders-service.yml'),
        domain: { id: 'orders', name: 'Orders', version: '0.0.1' },
      },
    ],
  ],
...

To

...
generators: [
    [
      '@eventcatalog/generator-asyncapi',
      {
        services: [{path: path.join(__dirname, 'asyncapi-files', 'orders-service.yml')}]
        domain: { id: 'orders', name: 'Orders', version: '0.0.1' },
      },
    ],
  ],
...

This allows us to add optional fields to the services and configure them more with EventCatalog.

This pull request allows you to specify a custom id if you don't want the generator to make one for you.

...
generators: [
    [
      '@eventcatalog/generator-asyncapi',
      {
        services: [{path: path.join(__dirname, 'asyncapi-files', 'orders-service.yml'), id: 'my-custom-id'}]
        domain: { id: 'orders', name: 'Orders', version: '0.0.1' },
      },
    ],
  ],
...

This gives us more flexible as we move forward.

changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: adea394bfec4c2103c306a1baeacd2067f8bcd08

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

This PR includes changesets to release 1 package | Name | Type | | -------------------------------- | ----- | | @eventcatalog/generator-asyncapi | Major |

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