Skip to content

Commit 452d572

Browse files
authored
Merge branch 'CycloneDX:main' into replace-libxmljs2-with-libxml2-wasm
2 parents c5f922f + f07fd40 commit 452d572

File tree

15 files changed

+107
-22
lines changed

15 files changed

+107
-22
lines changed

.github/workflows/nodejs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ jobs:
183183
NODE_VERSION: '${{ matrix.node-version }}'
184184
run:
185185
case "$NODE_VERSION" in
186+
'23' | '22')
187+
npm i -g npm@^11
188+
;;
186189
'20' | '18')
187190
npm i -g npm@^10
188191
;;

HISTORY.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,45 @@ All notable changes to this project will be documented in this file.
88
* Dependencies
99
* Support `libxml2-wasm@^0.41` as an alternative for `libxmljs2` (via [#1184])
1010

11+
* Build
12+
* Use _TypeScript_ `v5.7.3` now, was `v5.7.2` (via [#1204])
13+
14+
[#1204]: https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1204
15+
16+
## 7.1.0 -- 2025-01-09
17+
18+
* Added
19+
* New type `Models.Copyright` and class `Models.CopyrightRepository` (via [#1202])
20+
* New type `Models.AttachmentContent` (via [#1202])
21+
* Changed
22+
* Replace usage of internals `Stringable` & `SortableStringables` with public API ([#1192] via [#1202])
23+
This is considered a non-breaking change, as the types are not changed, but made publicly available.
24+
* Style
25+
* Apply latest code style guide (via [#1201])
26+
* Misc
27+
* Support `npm11` ([#1191] via [#1203])
28+
29+
[#1191]: https://github.com/CycloneDX/cyclonedx-javascript-library/issues/1191
30+
[#1192]: https://github.com/CycloneDX/cyclonedx-javascript-library/issues/1192
31+
[#1201]: https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1201
32+
[#1202]: https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1202
33+
[#1203]: https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1203
34+
1135
## 7.0.0 -- 2024-11-26
1236

1337
* BREAKING changes
1438
* Property `Models.Bom.tools` is an instance of `Models.Tools` now ([#1152] via [#1163])
1539
Before, it was an instance of `Models.ToolRepository`.
40+
* Property `Models.Vulnerability.tools` is an instance of `Models.Tools` now (via [#1163])
41+
Before, it was an instance of `Models.ToolRepository`.
1642
* Added
1743
* Static function `Models.Tool.fromComponent()` (via [#1163])
1844
* Static function `Models.Tool.fromService()` (via [#1163])
1945
* New class `Models.Tools` ([#1152] via [#1163])
2046
* New serialization/normalization for `Models.Tools` ([#1152] via [#1163], [#1180])
2147
* Changed
2248
* Serializers and `Bom`-Normalizers will take changed `Models.Bom.tools` into account ([#1152] via [#1163])
49+
* Serializers and `Vulnerability`-Normalizers will take changed `Models.Vulnerability.tools` into account (via [#1163])
2350
* Style
2451
* Apply latest code style guide (via [#1170], [#1181])
2552
* Dependencies
@@ -37,6 +64,13 @@ All notable changes to this project will be documented in this file.
3764
[#1181]: https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1181
3865
[#1182]: https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1182
3966

67+
## 6.13.1 -- 2024-12-22
68+
69+
* Dependencies
70+
* Support `libxmljs2@^0.35` (via [#1196])
71+
72+
[#1196]: https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1196
73+
4074
## 6.13.0 -- 2024-11-18
4175

4276
* Added

eslint.config.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ const __dirname = path.dirname(__filename)
3333
*/
3434
export default [
3535
...baseCfg,
36+
{
37+
name: 'project-specific',
38+
rules: {
39+
"complexity": ["error", { "max": 15 }]
40+
}
41+
},
3642
{
3743
files: ['**/*.js'],
3844
languageOptions: { sourceType: 'commonjs' }

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cyclonedx/cyclonedx-library",
3-
"version": "7.0.0",
3+
"version": "7.1.0",
44
"description": "Core functionality of CycloneDX for JavaScript (Node.js or WebBrowser).",
55
"license": "Apache-2.0",
66
"keywords": [
@@ -98,13 +98,13 @@
9898
"c8": "^8||^9||^10",
9999
"deepmerge": "^4.2.2",
100100
"fast-glob": "^3.3.1",
101-
"mocha": "10.8.2",
101+
"mocha": "10.8.2||11.1.0",
102102
"npm-run-all2": "^5||^6",
103103
"rimraf": "^4||^5",
104104
"ts-loader": "9.5.1",
105-
"typescript": "5.7.2",
106-
"webpack": "5.96.1",
107-
"webpack-cli": "5.1.4",
105+
"typescript": "5.7.3",
106+
"webpack": "5.97.1",
107+
"webpack-cli": "5.1.4||6.0.1",
108108
"webpack-node-externals": "3.0.0"
109109
},
110110
"browser": "./dist.web/lib.js",

src/models/attachment.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ export interface OptionalAttachmentProperties {
2525
encoding?: Attachment['encoding']
2626
}
2727

28+
export type AttachmentContent = Stringable
29+
2830
export class Attachment {
2931
contentType?: string
30-
content: Stringable
32+
content: AttachmentContent
3133
encoding?: AttachmentEncoding
3234

3335
constructor (content: Attachment['content'], op: OptionalAttachmentProperties = {}) {

src/models/bomLink.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ abstract class BomLinkBase implements Stringable, Comparable<Stringable> {
3434
this.value = value
3535
}
3636

37+
get value (): string {
38+
return this.#value
39+
}
40+
3741
/**
3842
* @throws {@link RangeError} if value is invalid
3943
*/
@@ -44,10 +48,6 @@ abstract class BomLinkBase implements Stringable, Comparable<Stringable> {
4448
this.#value = value
4549
}
4650

47-
get value (): string {
48-
return this.#value
49-
}
50-
5151
compare (other: Stringable): number {
5252
return this.toString().localeCompare(other.toString())
5353
}

src/models/component.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ Copyright (c) OWASP Foundation. All Rights Reserved.
2020
import type { PackageURL } from 'packageurl-js'
2121

2222
import type { Comparable } from '../_helpers/sortable'
23-
import { SortableComparables, SortableStringables } from '../_helpers/sortable'
24-
import type { Stringable } from '../_helpers/stringable'
23+
import { SortableComparables } from '../_helpers/sortable'
2524
import { treeIteratorSymbol } from '../_helpers/tree'
2625
import type { ComponentScope, ComponentType } from '../enums'
2726
import type { CPE } from '../types/cpe'
2827
import { isCPE } from '../types/cpe'
2928
import { BomRef, BomRefRepository } from './bomRef'
29+
import type { Copyright } from './copyright'
30+
import { CopyrightRepository} from './copyright'
3031
import { ExternalReferenceRepository } from './externalReference'
3132
import { HashDictionary } from './hash'
3233
import { LicenseRepository } from './license'
@@ -61,7 +62,7 @@ export class Component implements Comparable<Component> {
6162
type: ComponentType
6263
name: string
6364
author?: string
64-
copyright?: Stringable
65+
copyright?: Copyright
6566
description?: string
6667
externalReferences: ExternalReferenceRepository
6768
group?: string
@@ -167,10 +168,10 @@ export interface OptionalComponentEvidenceProperties {
167168

168169
export class ComponentEvidence {
169170
licenses: LicenseRepository
170-
copyright: SortableStringables
171+
copyright: CopyrightRepository
171172

172173
constructor (op: OptionalComponentEvidenceProperties = {}) {
173174
this.licenses = op.licenses ?? new LicenseRepository()
174-
this.copyright = op.copyright ?? new SortableStringables()
175+
this.copyright = op.copyright ?? new CopyrightRepository()
175176
}
176177
}

src/models/copyright.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*!
2+
This file is part of CycloneDX JavaScript Library.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
16+
SPDX-License-Identifier: Apache-2.0
17+
Copyright (c) OWASP Foundation. All Rights Reserved.
18+
*/
19+
20+
import { SortableStringables } from '../_helpers/sortable'
21+
import type { Stringable } from '../_helpers/stringable'
22+
23+
export type Copyright = Stringable
24+
25+
/* eslint-disable-next-line @typescript-eslint/no-unnecessary-type-arguments -- for docs reasons */
26+
export class CopyrightRepository extends SortableStringables<Copyright> {}

src/models/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export * from './bom'
2222
export * from './bomLink'
2323
export * from './bomRef'
2424
export * from './component'
25+
export * from './copyright'
2526
export * from './externalReference'
2627
export * from './hash'
2728
export * from './license'

src/models/vulnerability/rating.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export class Rating implements Comparable<Rating> {
4848
this.justification = op.justification
4949
}
5050

51+
/* eslint complexity: ["error", 50] -- acknowledged */
5152
compare (other: Rating): number {
5253
/* eslint-disable @typescript-eslint/strict-boolean-expressions -- run compares in weighted order */
5354
return ((this.score ?? 0) - (other.score ?? 0)) ||

0 commit comments

Comments
 (0)