@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.
- package/README.md +63 -63
- package/bin/cdxgen.js +32 -9
- package/lib/cli/index.js +341 -98
- package/lib/helpers/envcontext.js +20 -18
- package/lib/helpers/logger.js +0 -2
- package/lib/helpers/utils.js +763 -63
- package/lib/helpers/utils.test.js +448 -27
- package/lib/helpers/validator.js +10 -0
- package/lib/managers/binary.js +89 -11
- package/lib/managers/docker.js +47 -37
- package/lib/server/server.js +120 -6
- package/lib/server/server.test.js +235 -0
- package/package.json +33 -14
- package/types/lib/cli/index.d.ts +8 -1
- package/types/lib/cli/index.d.ts.map +1 -1
- package/types/lib/helpers/envcontext.d.ts +3 -8
- package/types/lib/helpers/envcontext.d.ts.map +1 -1
- package/types/lib/helpers/logger.d.ts +0 -1
- package/types/lib/helpers/logger.d.ts.map +1 -1
- package/types/lib/helpers/utils.d.ts +67 -66
- package/types/lib/helpers/utils.d.ts.map +1 -1
- package/types/lib/helpers/validator.d.ts.map +1 -1
- package/types/lib/managers/binary.d.ts.map +1 -1
- package/types/lib/managers/docker.d.ts.map +1 -1
- package/types/lib/server/server.d.ts +22 -2
- package/types/lib/server/server.d.ts.map +1 -1
|
@@ -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
|
|
226
|
-
|
|
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
|
-
|
|
234
|
+
nodeInfo.description = `npm: ${moduleDesc}`;
|
|
229
235
|
}
|
|
230
|
-
|
|
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
|
-
|
|
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}
|
|
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}
|
|
1009
|
+
console.log(`${bundleCommand}`);
|
|
1008
1010
|
result = safeSpawnSync(bundleCommand, updateArgs, {
|
|
1009
1011
|
encoding: "utf-8",
|
|
1010
1012
|
shell: isWin,
|
package/lib/helpers/logger.js
CHANGED
|
@@ -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",
|