@cyclonedx/cdxgen 11.4.3 → 11.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,11 +13,11 @@ import {
13
13
  GO_CMD,
14
14
  getJavaCommand,
15
15
  getPythonCommand,
16
+ getRuntimeInformation,
16
17
  getTmpDir,
17
18
  isMac,
18
19
  isWin,
19
20
  MAX_BUFFER,
20
- NODE_CMD,
21
21
  NPM_CMD,
22
22
  RUBY_CMD,
23
23
  RUSTC_CMD,
@@ -216,26 +216,24 @@ export function collectPythonInfo(dir) {
216
216
  }
217
217
 
218
218
  /**
219
- * Collect node version
219
+ * Collect node runtime version
220
220
  *
221
221
  * @param {string} dir Working directory
222
- * @returns Object containing node details
222
+ * @returns {Object} Object containing node details
223
223
  */
224
224
  export function collectNodeInfo(dir) {
225
- const versionDesc = getCommandOutput(NODE_CMD, dir, ["--version"]);
226
- let moduleDesc = getCommandOutput(NPM_CMD, dir, ["--version"]);
225
+ const runtimeInfo = getRuntimeInformation();
226
+ const nodeInfo = {
227
+ type: "platform",
228
+ name: runtimeInfo.runtime,
229
+ version: runtimeInfo.version,
230
+ components: runtimeInfo.components,
231
+ };
232
+ const moduleDesc = getCommandOutput(NPM_CMD, dir, ["--version"]);
227
233
  if (moduleDesc) {
228
- moduleDesc = `npm: ${moduleDesc}`;
234
+ nodeInfo.description = `npm: ${moduleDesc}`;
229
235
  }
230
- if (versionDesc) {
231
- return {
232
- type: "platform",
233
- name: "node",
234
- version: versionDesc.trim(),
235
- description: moduleDesc,
236
- };
237
- }
238
- return undefined;
236
+ return nodeInfo;
239
237
  }
240
238
 
241
239
  /**
@@ -399,7 +397,11 @@ const getCommandOutput = (cmd, dir, args) => {
399
397
  }
400
398
  }
401
399
  if (DEBUG_MODE) {
402
- console.log(`Executing ${commandToUse} ${args.join(" ")} in ${dir}`);
400
+ if (dir) {
401
+ console.log(`Executing ${commandToUse} in ${dir}`);
402
+ } else {
403
+ console.log(`Executing ${commandToUse}`);
404
+ }
403
405
  }
404
406
  const result = safeSpawnSync(commandToUse, args, {
405
407
  cwd: dir,
@@ -733,7 +735,7 @@ export function bundleInstallWithDocker(rubyVersion, cdxgenGemHome, filePath) {
733
735
  "bundle",
734
736
  "install",
735
737
  ];
736
- console.log(`Performing bundle install with: ${ociCmd} ${ociArgs.join(" ")}`);
738
+ console.log(`Performing bundle install with: ${ociCmd}`);
737
739
  const result = safeSpawnSync(ociCmd, ociArgs, {
738
740
  encoding: "utf-8",
739
741
  shell: isWin,
@@ -1004,7 +1006,7 @@ export function performBundleInstall(
1004
1006
  process.env.BUNDLE_UPDATE_ARGS.split(" "),
1005
1007
  );
1006
1008
  }
1007
- console.log(`${bundleCommand} ${updateArgs.join(" ")}`);
1009
+ console.log(`${bundleCommand}`);
1008
1010
  result = safeSpawnSync(bundleCommand, updateArgs, {
1009
1011
  encoding: "utf-8",
1010
1012
  shell: isWin,
@@ -77,7 +77,6 @@ function colorizeText(s) {
77
77
  * Log trace messages
78
78
  *
79
79
  * @param {String} traceType Trace type
80
- * @param {String} messageStr Message string
81
80
  * @param {Object} args Additional arguments
82
81
  */
83
82
  export function traceLog(traceType, args) {
@@ -96,7 +95,6 @@ export function traceLog(traceType, args) {
96
95
  if (args) {
97
96
  for (const k of [
98
97
  "command",
99
- "args",
100
98
  "cwd",
101
99
  "protocol",
102
100
  "host",