Skip to content

Commit ad6f527

Browse files
committed
feat(preflight): add @cyclonedx/cdxgen to background downloads
Include cdxgen in preflight downloads alongside coana and cli-ai to ensure it's cached on first CLI run for faster manifest generation.
1 parent 7a7f67c commit ad6f527

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

packages/cli/src/utils/preflight/downloads.mts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
* Background preflight downloads for optional dependencies.
33
*
4-
* Silently downloads @coana-tech/cli and @socketbin/cli-ai in the background
5-
* on first CLI run to ensure they're cached for future use.
4+
* Silently downloads @coana-tech/cli, @cyclonedx/cdxgen, and @socketbin/cli-ai
5+
* in the background on first CLI run to ensure they're cached for future use.
66
*
77
* This runs asynchronously and never blocks the main CLI execution.
88
*/
@@ -54,6 +54,15 @@ export function runPreflightDownloads(): void {
5454
}
5555
}
5656

57+
// @cyclonedx/cdxgen preflight.
58+
const cdxgenVersion = ENV.INLINED_SOCKET_CLI_CYCLONEDX_CDXGEN_VERSION
59+
if (cdxgenVersion) {
60+
const cdxgenSpec = `@cyclonedx/cdxgen@~${cdxgenVersion}`
61+
if (!isPackageCached(cdxgenSpec)) {
62+
downloads.push({ packageSpec: cdxgenSpec, binaryName: 'cdxgen' })
63+
}
64+
}
65+
5766
// @socketbin/cli-ai preflight.
5867
const cliAiVersion = ENV.INLINED_SOCKET_CLI_AI_VERSION
5968
if (cliAiVersion) {

0 commit comments

Comments
 (0)