From eee823841aa5d8990e95877e5fdcd50ecec7295f Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 16 Jan 2025 10:59:01 +0000 Subject: [PATCH 1/2] fix dart where no project is specified Signed-off-by: Paul --- lib/cli/index.js | 2 +- lib/helpers/utils.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cli/index.js b/lib/cli/index.js index 826a744b3..9ddaefc13 100644 --- a/lib/cli/index.js +++ b/lib/cli/index.js @@ -3959,7 +3959,7 @@ export async function createDartBom(path, options) { ); let dependencies = []; let pkgList = []; - const parentComponent = determineParentComponent(options); + const parentComponent = createDefaultParentComponent(path, "pub", options); if (pubFiles.length) { for (const f of pubFiles) { if (DEBUG_MODE) { diff --git a/lib/helpers/utils.js b/lib/helpers/utils.js index 592d4ad68..28bb358ee 100644 --- a/lib/helpers/utils.js +++ b/lib/helpers/utils.js @@ -7442,7 +7442,7 @@ export async function parsePubLockData(pubLockData) { pkg._integrity = `sha256-${packageData.description?.sha256}`; } - const purlString = new PackageURL("dart", "", pkg.name, pkg.version) + const purlString = new PackageURL("pub", "", pkg.name, pkg.version) .toString() .replace(/%2F/g, "/"); pkg["bom-ref"] = decodeURIComponent(purlString); From eb2116a513638c0f133005d7a315026a358c5b9f Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 16 Jan 2025 11:30:32 +0000 Subject: [PATCH 2/2] fix bom ref in test Signed-off-by: Paul --- lib/helpers/utils.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/helpers/utils.test.js b/lib/helpers/utils.test.js index 307ab7d33..a40aa1a0c 100644 --- a/lib/helpers/utils.test.js +++ b/lib/helpers/utils.test.js @@ -2086,7 +2086,7 @@ test("parse pub lock", async () => { version: "2.11.0", _integrity: "sha256-947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c", - "bom-ref": "pkg:dart/async@2.11.0", + "bom-ref": "pkg:pub/async@2.11.0", scope: "required", }); expect(root_list.length).toEqual(3); @@ -2095,7 +2095,7 @@ test("parse pub lock", async () => { version: "3.0.2", _integrity: "sha256-99d63c60f00fac81249ce6410ee015d7b125c63d8278a30da81edf3317a1f6a0", - "bom-ref": "pkg:dart/flare_flutter@3.0.2", + "bom-ref": "pkg:pub/flare_flutter@3.0.2", scope: "required", }); dep_list = parsePubYamlData(