@cyclonedx/cdxgen 11.0.6 → 11.0.7
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/lib/cli/index.js
CHANGED
|
@@ -2366,6 +2366,19 @@ export async function createNodejsBom(path, options) {
|
|
|
2366
2366
|
installArgs = installArgs.concat(addArgs);
|
|
2367
2367
|
}
|
|
2368
2368
|
const basePath = dirname(apkgJson);
|
|
2369
|
+
// juice-shop mode
|
|
2370
|
+
// Projects such as juice-shop prevent lockfile creations using .npmrc files
|
|
2371
|
+
// Plus, they might require specific npm install args such as --legacy-peer-deps that could lead to strange node_modules structure
|
|
2372
|
+
// To keep life simple, let's look for any .npmrc file that has package-lock=false to toggle before npm install
|
|
2373
|
+
if (pkgMgr === "npm" && existsSync(join(basePath, ".npmrc"))) {
|
|
2374
|
+
const npmrcData = readFileSync(join(basePath, ".npmrc"));
|
|
2375
|
+
if (
|
|
2376
|
+
npmrcData?.includes("package-lock=false") &&
|
|
2377
|
+
!installArgs.includes("--package-lock")
|
|
2378
|
+
) {
|
|
2379
|
+
installArgs.push("--package-lock");
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2369
2382
|
console.log(
|
|
2370
2383
|
`Executing '${pkgMgr} ${installArgs.join(" ")}' in`,
|
|
2371
2384
|
basePath,
|
|
@@ -2384,6 +2397,16 @@ export async function createNodejsBom(path, options) {
|
|
|
2384
2397
|
console.log(result.stdout);
|
|
2385
2398
|
}
|
|
2386
2399
|
if (result.stderr) {
|
|
2400
|
+
if (result.stderr.includes("--legacy-peer-deps")) {
|
|
2401
|
+
console.log(
|
|
2402
|
+
"Set the environment variable `NPM_INSTALL_ARGS=--legacy-peer-deps` to resolve the dependency resolution issue reported.",
|
|
2403
|
+
);
|
|
2404
|
+
}
|
|
2405
|
+
if (result.stderr.includes("EBADENGINE Unsupported engine")) {
|
|
2406
|
+
console.log(
|
|
2407
|
+
"Try using the custom `ghcr.io/cyclonedx/cdxgen-node20:v11` container image, which bundles node.js 20.",
|
|
2408
|
+
);
|
|
2409
|
+
}
|
|
2387
2410
|
console.log(result.stderr);
|
|
2388
2411
|
}
|
|
2389
2412
|
options.failOnError && process.exit(1);
|
|
@@ -2678,9 +2701,10 @@ export async function createNodejsBom(path, options) {
|
|
|
2678
2701
|
// We might reach here if the project has no lock files
|
|
2679
2702
|
// Eg: juice-shop
|
|
2680
2703
|
if (!pkgList.length && existsSync(join(path, "node_modules"))) {
|
|
2704
|
+
// Collect all package.json files from all node_modules directory
|
|
2681
2705
|
const pkgJsonFiles = getAllFiles(
|
|
2682
|
-
|
|
2683
|
-
"**/package.json",
|
|
2706
|
+
path,
|
|
2707
|
+
"**/node_modules/**/package.json",
|
|
2684
2708
|
options,
|
|
2685
2709
|
);
|
|
2686
2710
|
manifestFiles = manifestFiles.concat(pkgJsonFiles);
|
|
@@ -3298,8 +3298,8 @@ test("parsePnpmLock", async () => {
|
|
|
3298
3298
|
expect(parsedList.dependenciesList).toHaveLength(462);
|
|
3299
3299
|
expect(parsedList.pkgList.filter((pkg) => !pkg.scope)).toHaveLength(3);
|
|
3300
3300
|
parsedList = await parsePnpmLock("./pnpm-lock.yaml");
|
|
3301
|
-
expect(parsedList.pkgList.length).toEqual(
|
|
3302
|
-
expect(parsedList.dependenciesList.length).toEqual(
|
|
3301
|
+
expect(parsedList.pkgList.length).toEqual(627);
|
|
3302
|
+
expect(parsedList.dependenciesList.length).toEqual(627);
|
|
3303
3303
|
expect(parsedList.pkgList[0]).toEqual({
|
|
3304
3304
|
group: "@ampproject",
|
|
3305
3305
|
name: "remapping",
|
|
@@ -3326,7 +3326,7 @@ test("parsePnpmLock", async () => {
|
|
|
3326
3326
|
expect(parsedList.dependenciesList[0]).toEqual({
|
|
3327
3327
|
ref: "pkg:npm/@ampproject/remapping@2.3.0",
|
|
3328
3328
|
dependsOn: [
|
|
3329
|
-
"pkg:npm/@jridgewell/gen-mapping@0.3.
|
|
3329
|
+
"pkg:npm/@jridgewell/gen-mapping@0.3.8",
|
|
3330
3330
|
"pkg:npm/@jridgewell/trace-mapping@0.3.25",
|
|
3331
3331
|
],
|
|
3332
3332
|
});
|
|
@@ -78,29 +78,28 @@ export function preparePythonEnv(_filePath, options) {
|
|
|
78
78
|
);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
for (const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
break;
|
|
81
|
+
for (const pyversion of [
|
|
82
|
+
"python36",
|
|
83
|
+
"python38",
|
|
84
|
+
"python39",
|
|
85
|
+
"python310",
|
|
86
|
+
"python311",
|
|
87
|
+
"python312",
|
|
88
|
+
"python313",
|
|
89
|
+
]) {
|
|
90
|
+
if (
|
|
91
|
+
options.projectType.includes(pyversion) &&
|
|
92
|
+
!process.env.PIP_INSTALL_ARGS
|
|
93
|
+
) {
|
|
94
|
+
const tempDir = mkdtempSync(join(tmpdir(), "cdxgen-pip-"));
|
|
95
|
+
const py_version_number = pyversion.replace("python3", "3.");
|
|
96
|
+
process.env.PIP_INSTALL_ARGS = `--python-version ${py_version_number} --ignore-requires-python --no-warn-conflicts --only-binary=:all:`;
|
|
97
|
+
process.env.PIP_TARGET = tempDir;
|
|
98
|
+
if (DEBUG_MODE) {
|
|
99
|
+
console.log("PIP_INSTALL_ARGS set to", process.env.PIP_INSTALL_ARGS);
|
|
100
|
+
console.log("PIP_TARGET set to", process.env.PIP_TARGET);
|
|
103
101
|
}
|
|
102
|
+
break;
|
|
104
103
|
}
|
|
105
104
|
}
|
|
106
105
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyclonedx/cdxgen",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.7",
|
|
4
4
|
"description": "Creates CycloneDX Software Bill of Materials (SBOM) from source or container image",
|
|
5
5
|
"homepage": "http://github.com/cyclonedx/cdxgen",
|
|
6
6
|
"author": "Prabhu Subramanian <prabhu@appthreat.com>",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"*": "biome check --fix --no-errors-on-unmatched"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@babel/parser": "^7.26.
|
|
65
|
-
"@babel/traverse": "^7.
|
|
64
|
+
"@babel/parser": "^7.26.3",
|
|
65
|
+
"@babel/traverse": "^7.26.4",
|
|
66
66
|
"@npmcli/arborist": "8.0.0",
|
|
67
67
|
"ajv": "^8.17.1",
|
|
68
68
|
"ajv-formats": "^3.0.1",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"properties-reader": "^2.3.0",
|
|
82
82
|
"semver": "^7.6.3",
|
|
83
83
|
"ssri": "^12.0.0",
|
|
84
|
-
"table": "^6.
|
|
84
|
+
"table": "^6.9.0",
|
|
85
85
|
"tar": "^7.4.3",
|
|
86
86
|
"uuid": "^11.0.2",
|
|
87
87
|
"validate-iri": "^1.0.1",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/cli/index.js"],"names":[],"mappings":"AA4wBA;;;;;;;;GAQG;AACH,gFAFW,MAAM,SAchB;AA8WD;;;;;;;GAOG;AACH,mCALW,MAAM,qBAiEhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM;;;;EAKhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM;;;;EAkBhB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,8BAs7BhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/cli/index.js"],"names":[],"mappings":"AA4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ED;;;;;GAKG;AACH,0CAHW,MAAM,EAAE,8BAqdlB;AAED;;;;;GAKG;AACH,iCAHW,MAAM,8BAgUhB;AAED;;;;;GAKG;AACH,gCAHW,MAAM,qBAqOhB;AAED;;;;;;GAMG;AACH,wDAFY,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,SAAS,CAAC,CAwHxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pregen.d.ts","sourceRoot":"","sources":["../../../../lib/stages/pregen/pregen.js"],"names":[],"mappings":"AAoBA;;;;;GAKG;AACH,iEAiBC;AAED;;;;GAIG;AACH,iEASC;AAED;;;;;GAKG;AACH,
|
|
1
|
+
{"version":3,"file":"pregen.d.ts","sourceRoot":"","sources":["../../../../lib/stages/pregen/pregen.js"],"names":[],"mappings":"AAoBA;;;;;GAKG;AACH,iEAiBC;AAED;;;;GAIG;AACH,iEASC;AAED;;;;;GAKG;AACH,wEAqCC;AAED;;;;;GAKG;AACH,qEAyDC;AAED;;;;;;;;GAQG;AACH,uEAmBC;AAED;;;;;GAKG;AACH,0EAqCC;AAED;;;;;GAKG;AACH,sEA4EC"}
|