From 57d677f2adf944c31f2d598fd1c59fbd9a997f9a Mon Sep 17 00:00:00 2001 From: Jan Kowalleck Date: Tue, 21 May 2024 19:14:34 +0200 Subject: [PATCH] fix: use nodeSpecific `PackageUrlFactory` Signed-off-by: Jan Kowalleck --- src/builders.ts | 2 +- src/commands.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/builders.ts b/src/builders.ts index b87de440..f099373c 100644 --- a/src/builders.ts +++ b/src/builders.ts @@ -44,7 +44,7 @@ interface BomBuilderOptions { export class BomBuilder { toolBuilder: Builders.FromNodePackageJson.ToolBuilder componentBuilder: Builders.FromNodePackageJson.ComponentBuilder - purlFactory: Factories.PackageUrlFactory + purlFactory: Factories.FromNodePackageJson.PackageUrlFactory omitDevDependencies: boolean metaComponentType: ComponentType diff --git a/src/commands.ts b/src/commands.ts index ade3b230..9655a434 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -20,7 +20,7 @@ Copyright (c) OWASP Foundation. All Rights Reserved. // import sub-modules so to prevent load of unused not-tree-shakable dependencies - like 'AJV' import { FromNodePackageJson as PJB } from '@cyclonedx/cyclonedx-library/Builders' import { ComponentType } from '@cyclonedx/cyclonedx-library/Enums' -import { FromNodePackageJson as PJF, LicenseFactory, PackageUrlFactory } from '@cyclonedx/cyclonedx-library/Factories' +import { FromNodePackageJson as PJF, LicenseFactory } from '@cyclonedx/cyclonedx-library/Factories' import * as Serialize from '@cyclonedx/cyclonedx-library/Serialize' import { SpecVersionDict, Version as SpecVersion } from '@cyclonedx/cyclonedx-library/Spec' import { type CommandContext, Configuration, Project } from '@yarnpkg/core' @@ -160,7 +160,7 @@ export class MakeSbomCommand extends Command { extRefFactory, new LicenseFactory() ), - new PackageUrlFactory('npm'), + new PJF.PackageUrlFactory('npm'), { omitDevDependencies: this.production, metaComponentType: this.mcType,