@@ -21,10 +21,15 @@ import { existsSync } from 'node:fs'
2121import { join as joinPath , resolve } from 'node:path'
2222
2323import * as CDX from '@cyclonedx/cyclonedx-library'
24- import normalizePackageJson from 'normalize-package-data'
2524import { Compilation , type Compiler , sources , version as WEBPACK_VERSION } from 'webpack'
2625
27- import { getPackageDescription , iterableSome , loadJsonFile , type PackageDescription } from './_helpers'
26+ import {
27+ getPackageDescription ,
28+ iterableSome ,
29+ loadJsonFile ,
30+ normalizePackageManifest ,
31+ type PackageDescription
32+ } from './_helpers'
2833import { Extractor } from './extractor'
2934
3035type WebpackLogger = Compilation [ 'logger' ]
@@ -381,13 +386,13 @@ export class CycloneDxWebpackPlugin {
381386 ? getPackageDescription ( path ) ?. packageJson
382387 : { name : this . rootComponentName , version : this . rootComponentVersion }
383388 if ( thisPackageJson === undefined ) { return undefined }
384- normalizePackageJson (
385- /* eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- hint hint */
386- thisPackageJson as normalizePackageJson . Input ,
389+ normalizePackageManifest (
390+
391+ thisPackageJson ,
387392 w => { logger . debug ( 'normalizePackageJson from PkgPath' , path , 'caused:' , w ) }
388393 )
389- /* eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- hint hint */
390- return builder . makeComponent ( thisPackageJson as normalizePackageJson . Package )
394+
395+ return builder . makeComponent ( thisPackageJson )
391396 }
392397
393398 #finalizeBom (
@@ -447,15 +452,11 @@ export class CycloneDxWebpackPlugin {
447452 logger . log ( 'try to build new Tool from PkgPath' , packageJsonPath )
448453 /* eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- expected */
449454 const packageJson : PackageDescription [ 'packageJson' ] = loadJsonFile ( packageJsonPath ) ?? { }
450- normalizePackageJson (
451- /* eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- hint hint */
452- packageJson as normalizePackageJson . Input ,
455+ normalizePackageManifest (
456+ packageJson ,
453457 w => { logger . debug ( 'normalizePackageJson from PkgPath' , packageJsonPath , 'caused:' , w ) }
454458 )
455- const tool = builder . makeComponent (
456- /* eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- hint hint */
457- packageJson as normalizePackageJson . Package ,
458- cType )
459+ const tool = builder . makeComponent ( packageJson , cType )
459460 if ( tool !== undefined ) {
460461 yield tool
461462 }
0 commit comments