Skip to content

Commit 544578d

Browse files
committed
migrate node20.18
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
1 parent 48c3ff4 commit 544578d

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

src/extractor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Copyright (c) OWASP Foundation. All Rights Reserved.
1919

2020
import * as CDX from '@cyclonedx/cyclonedx-library'
2121
import { readdirSync, readFileSync } from 'fs'
22-
import * as normalizePackageJson from 'normalize-package-data'
22+
import normalizePackageJson from 'normalize-package-data'
2323
import { dirname, join } from 'path'
2424
import type { Compilation, Module } from 'webpack'
2525

src/plugin.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Copyright (c) OWASP Foundation. All Rights Reserved.
1919

2020
import * as CDX from '@cyclonedx/cyclonedx-library'
2121
import { existsSync } from 'fs'
22-
import * as normalizePackageJson from 'normalize-package-data'
22+
import normalizePackageJson from 'normalize-package-data'
2323
import { join as joinPath, resolve } from 'path'
2424
import { Compilation, type Compiler, sources, version as WEBPACK_VERSION } from 'webpack'
2525

@@ -368,7 +368,10 @@ export class CycloneDxWebpackPlugin {
368368
? getPackageDescription(path)?.packageJson
369369
: { name: this.rootComponentName, version: this.rootComponentVersion }
370370
if (thisPackageJson === undefined) { return undefined }
371-
normalizePackageJson(thisPackageJson, w => { logger.debug('normalizePackageJson from PkgPath', path, 'caused:', w) })
371+
normalizePackageJson(
372+
thisPackageJson,
373+
function (w:string):void { logger.debug('normalizePackageJson from PkgPath', path, 'caused:', w) }
374+
)
372375
return builder.makeComponent(thisPackageJson)
373376
}
374377

@@ -428,7 +431,10 @@ export class CycloneDxWebpackPlugin {
428431
for (const [packageJsonPath, cType] of packageJsonPaths) {
429432
logger.log('try to build new Tool from PkgPath', packageJsonPath)
430433
const packageJson: object = loadJsonFile(packageJsonPath) ?? {}
431-
normalizePackageJson(packageJson, w => { logger.debug('normalizePackageJson from PkgPath', packageJsonPath, 'caused:', w) })
434+
normalizePackageJson(
435+
packageJson,
436+
function (w: string):void { logger.debug('normalizePackageJson from PkgPath', packageJsonPath, 'caused:', w) }
437+
)
432438
const tool = builder.makeComponent(packageJson, cType)
433439
if (tool !== undefined) {
434440
yield tool

tsconfig.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/* Language and Environment */
1515
/* check compat: https://node.green/ */
1616
/* see: https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping */
17-
"target": "ES2020", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
17+
"target": "ES2023", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
1818
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
1919
// "jsx": "preserve", /* Specify what JSX code is generated. */
2020
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
@@ -28,9 +28,10 @@
2828

2929
/* Modules */
3030
/* check compat: https://node.green/ */
31-
"module": "CommonJS", /* Specify what module code is generated. */
31+
/* see: https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping */
32+
"module": "node16", /* Specify what module code is generated. */
3233
"rootDir": "src", /* Specify the root folder within your source files. */
33-
"moduleResolution": "Node", /* Specify how TypeScript looks up a file from a given module specifier. */
34+
// "moduleResolution": "Node", /* Specify how TypeScript looks up a file from a given module specifier. */
3435
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
3536
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
3637
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */

0 commit comments

Comments
 (0)