Skip to content

Commit 6e7ad35

Browse files
authored
feat: support CycloneDX 1.7 (#1451)
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent fdbfc48 commit 6e7ad35

File tree

28 files changed

+851
-8886
lines changed

28 files changed

+851
-8886
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ new CycloneDxWebpackPlugin(options?: object)
4747

4848
| Name | Type | Default | Description |
4949
|:-----|:----:|:-------:|:------------|
50-
| **`specVersion`** | `{string}`<br/> one of: `"1.2"`, `"1.3"`, `"1.4"`, `"1.5"`, `"1.6"` | `"1.6"` | Which version of [CycloneDX-spec] to use.<br/> Supported values depend on the installed dependency [CycloneDX-javascript-library]. |
50+
| **`specVersion`** | `{string}`<br/> one of: `"1.2"`, `"1.3"`, `"1.4"`, `"1.5"`, `"1.6"`, `"1.7"` | `"1.6"` | Which version of [CycloneDX-spec] to use.<br/> Supported values depend on the installed dependency [CycloneDX-javascript-library]. |
5151
| **`reproducibleResults`** | `{boolean}` | `false` | Whether to go the extra mile and make the output reproducible.<br/> Reproducibility might result in loss of time- and random-based-values. |
5252
| **`validateResults`** | `{boolean}` | `true` | Whether to validate the BOM result.<br/> Validation is skipped, if requirements not met. Requires [transitive optional dependencies](https://github.com/CycloneDX/cyclonedx-javascript-library#optional-dependencies). |
5353
| **`outputLocation`** | `{string}` | `"./cyclonedx"` | Path to write the output to. The path is relative to _webpack_'s overall output path. |
5454
| **`includeWellknown`** | `{boolean}` | `true` | Whether to write the Wellknowns. |
5555
| **`wellknownLocation`** | `{string}` | `"./.well-known"` | Path to write the Wellknowns to. The path is relative to _webpack_'s overall output path. |
5656
| **`rootComponentAutodetect`** | `{boolean}` | `true` | Whether to try auto-detection of the RootComponent.<br/> Tries to find the nearest `package.json` and build a CycloneDX component from it, so it can be assigned to `bom.metadata.component`. |
57-
| **`rootComponentType`** | `{string}` | `"application"` | Set the RootComponent's type.<br/> See [the list of valid values](https://cyclonedx.org/docs/1.6/json/#metadata_component_type). Supported values depend on [CycloneDX-javascript-library]'s enum `ComponentType`. |
57+
| **`rootComponentType`** | `{string}` | `"application"` | Set the RootComponent's type.<br/> See [the list of valid values](https://cyclonedx.org/docs/1.7/json/#metadata_component_type). Supported values depend on [CycloneDX-javascript-library]'s enum `ComponentType`. |
5858
| **`rootComponentName`** | optional `{string}` | `undefined` | If `rootComponentAutodetect` is disabled, then this value is assumed as the "name" of the `package.json`. |
5959
| **`rootComponentVersion`** | optional `{string}` | `undefined` | If `rootComponentAutodetect` is disabled, then this value is assumed as the "version" of the `package.json`. |
6060
| **`rootComponentVCS`** | optional `{string}` | `undefined` | If `rootComponentAutodetect` is disabled or the Version Control System is not declared in the `package.json`, then this value is used as the URL for [RootComponent's External References'][docs_cdx_metadata_component_externalReferences] of type "vcs". |
@@ -70,7 +70,7 @@ const { CycloneDxWebpackPlugin } = require('@cyclonedx/webpack-plugin');
7070

7171
/** @type {import('@cyclonedx/webpack-plugin').CycloneDxWebpackPluginOptions} */
7272
const cycloneDxWebpackPluginOptions = {
73-
specVersion: '1.6',
73+
specVersion: '1.7',
7474
outputLocation: './bom'
7575
}
7676

@@ -170,4 +170,4 @@ See the [LICENSE][license_file] file for the full license.
170170
[link_discussion]: https://groups.io/g/CycloneDX
171171
[link_twitter]: https://twitter.com/CycloneDX_Spec
172172

173-
[docs_cdx_metadata_component_externalReferences]: https://cyclonedx.org/docs/1.6/json/#metadata_component_externalReferences
173+
[docs_cdx_metadata_component_externalReferences]: https://cyclonedx.org/docs/1.7/json/#metadata_component_externalReferences

examples/simple/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const { CycloneDxWebpackPlugin } = require('@cyclonedx/webpack-plugin')
2525

2626
/** @type {import('@cyclonedx/webpack-plugin').CycloneDxWebpackPluginOptions} */
2727
const cycloneDxWebpackPluginOptions = {
28-
specVersion: '1.6',
28+
specVersion: '1.7',
2929
reproducibleResults: false,
3030
outputLocation: './sbom',
3131
includeWellknown: true,

src/plugin.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export interface CycloneDxWebpackPluginOptions {
9191
rootComponentAutodetect?: CycloneDxWebpackPlugin['rootComponentAutodetect']
9292
/**
9393
* Set the RootComponent's type.
94-
* See {@link https://cyclonedx.org/docs/1.6/json/#metadata_component_type | the list of valid values}.
94+
* See {@link https://cyclonedx.org/docs/1.7/json/#metadata_component_type | the list of valid values}.
9595
*
9696
* @defaultValue `'application'`
9797
*/
@@ -113,12 +113,12 @@ export interface CycloneDxWebpackPluginOptions {
113113

114114
/**
115115
* Set the externalReference URL for the build-system for the RootComponent.
116-
* See {@link https://cyclonedx.org/docs/1.6/json/#metadata_component_externalReferences}.
116+
* See {@link https://cyclonedx.org/docs/1.7/json/#metadata_component_externalReferences}.
117117
*/
118118
rootComponentBuildSystem?: CycloneDxWebpackPlugin['rootComponentBuildSystem']
119119
/**
120120
* Set the externalReference URL for the version control system for the RootComponent.
121-
* See {@link https://cyclonedx.org/docs/1.6/json/#metadata_component_externalReferences}.
121+
* See {@link https://cyclonedx.org/docs/1.7/json/#metadata_component_externalReferences}.
122122
*/
123123
rootComponentVCS?: CycloneDxWebpackPlugin['rootComponentVCS']
124124

tests/integration/__snapshots__/index.test.js.snap

Lines changed: 45 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)