Skip to content

Commit

Permalink
fix(camel): getCamelVersions() to return correct camel model versions
Browse files Browse the repository at this point in the history
  • Loading branch information
tadayosi committed Apr 25, 2024
1 parent 8010d78 commit f7c0698
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions packages/hawtio/src/plugins/camel/camel-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,10 @@ export function hasProperties(node: MBeanNode): boolean {
return isRouteNode(node) || isRouteXmlNode(node)
}

export function getCamelVersions(): string[] {
// TODO: Should be generated from yarn.lock
return ['4.0.4', '4.4.0']
export async function getCamelVersions(): Promise<string[]> {
const { version: camel4_0Version } = await import('@hawtio/camel-model-v4_0/package.json')
const { version: camel4_4Version } = await import('@hawtio/camel-model-v4_4/package.json')
return [camel4_0Version, camel4_4Version]
}

/**
Expand Down
4 changes: 3 additions & 1 deletion packages/hawtio/src/plugins/camel/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ export const camel: HawtioPlugin = () => {
helpRegistry.add('camel', 'Camel', help, order)
preferencesRegistry.add('camel', 'Camel', CamelPreferences, order)

log.info('Using Camel versions:', getCamelVersions())
getCamelVersions().then(versions => {
log.info('Using Camel versions:', versions)
})
}

0 comments on commit f7c0698

Please sign in to comment.