Skip to content

Commit 077eb53

Browse files
authored
[WIP] feat!: 5.0 (#1365)
* BREAKING Changes * Dropped support for `node<20.18.0` ([#1362] via [#1365]) * Documentation * Fixed docs of default values (via [#1369]) * Dependencies * Upgraded runtime-dependency `@cyclonedx/cyclonedx-library@^8.0.0`, was `@^7.0.0` (via [#1367]) * Upgraded runtime-dependency `normalize-package-data@^7.0.0`, was `@^3||^4||^5||^6` (via [#1368]) [#1362]: #1362 [#1365]: #1365 [#1367]: #1367 [#1368]: #1368 [#1369]: #1369 --------- Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 8dc54dd commit 077eb53

File tree

53 files changed

+757
-33143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+757
-33143
lines changed

.eslintignore

Lines changed: 0 additions & 11 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 76 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
version: 2
44
updates:
55
- package-ecosystem: 'npm'
6-
directory: '/'
6+
directories:
7+
- '/.'
8+
- '/tools/code-style'
79
schedule:
810
interval: 'weekly'
911
day: 'saturday'
@@ -44,11 +46,13 @@ updates:
4446
patterns:
4547
- 'eslint'
4648
- '@eslint/*'
49+
- '*-eslint'
4750
- 'eslint-*'
51+
- '@types/eslint'
52+
- '@types/eslint-*'
53+
- '@types/*-eslint'
4854
- '@eslint-community/*'
4955
- '@typescript-eslint/*'
50-
- '@types/eslint'
51-
- '@types/eslint*'
5256
webpack:
5357
patterns:
5458
- 'webpack'

.github/workflows/nodejs.yml

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ concurrency:
2020

2121
env:
2222
REPORTS_DIR: CI_reports
23-
NODE_ACTIVE_LTS: "20" # https://nodejs.org/en/about/releases/
23+
NODE_ACTIVE_LTS: "22" # https://nodejs.org/en/about/releases/
2424
TESTS_REPORTS_ARTIFACT: tests-reports
2525

2626
jobs:
@@ -54,7 +54,7 @@ jobs:
5454
test-standard:
5555
name: test standard
5656
runs-on: ubuntu-latest
57-
timeout-minutes: 30
57+
timeout-minutes: 10
5858
steps:
5959
- name: Checkout
6060
# see https://github.com/actions/checkout
@@ -67,9 +67,34 @@ jobs:
6767
# cache: "npm"
6868
# cache-dependency-path: "**/package-lock.json"
6969
- name: setup project
70-
run: npm i --ignore-scripts
70+
run: |
71+
npm install --ignore-scripts --loglevel=silly
72+
- name: setup tools
73+
run: |
74+
echo "::group::install code-style deps"
75+
npm run -- dev-setup:code-style --ignore-scripts --loglevel=silly
76+
echo "::endgroup::"
77+
- name: make reports dir
78+
run: mkdir -p "$REPORTS_DIR"
7179
- name: test
72-
run: npm run test:standard
80+
run: >
81+
npm run -- test:standard
82+
--format json
83+
--output-file "$PWD/$REPORTS_DIR/eslint.json"
84+
- name: Annotate Code
85+
if: ${{ failure() || success() }}
86+
# see https://github.com/DerLev/eslint-annotations
87+
uses: DerLev/eslint-annotations@v2
88+
with:
89+
eslint-report: ${{ env.REPORTS_DIR }}/eslint.json
90+
- name: artifact eslint result
91+
# see https://github.com/actions/upload-artifact
92+
uses: actions/upload-artifact@v4
93+
if: ${{ failure() }}
94+
with:
95+
name: ${{ env.STANDARD_REPORTS_ARTIFACT }}
96+
path: ${{ env.REPORTS_DIR }}
97+
if-no-files-found: error
7398

7499
test-jest:
75100
needs: [ 'build' ]
@@ -83,12 +108,10 @@ jobs:
83108
node-version:
84109
# action based on https://github.com/actions/node-versions/releases
85110
# see also: https://nodejs.org/en/about/previous-releases
86-
- "22.4" # current -- pinned for https://github.com/npm/cli/issues/7666
87-
- "20" # active LTS
88-
- "18"
89-
- '16'
90-
- "14"
91-
- "14.0.0" # lowest supported
111+
- "23" # current
112+
- "22" # active LTS
113+
- "20"
114+
- "20.18.0" # lowest supported
92115
steps:
93116
- name: Checkout
94117
# see https://github.com/actions/checkout
@@ -114,25 +137,7 @@ jobs:
114137
shell: bash
115138
run: |
116139
set -ex
117-
dep_constraints=''
118140
dev_requirements='c8 jest jest-junit imurmurhash fast-glob'
119-
# as long as npm cannot auto-resolve engine-constraints, we need to help here
120-
case '${{ matrix.node-version }}' in
121-
'14')
122-
dep_constraints='normalize-package-data@^5'
123-
;;
124-
'14.0.0')
125-
dep_constraints='normalize-package-data@^3'
126-
dev_requirements='c8@^8 jest@^26 jest-junit imurmurhash fast-glob'
127-
# cannot run snapshot-compare with old versions ...
128-
rm -rf tests/integration/__snapshots__/
129-
;;
130-
esac
131-
## !! dont install all the dev-packages, especially since some are not runnable on node 14.0.0
132-
if [[ -n "$dep_constraints" ]]
133-
then
134-
npm add --ignore-scripts --omit=peer --omit=dev --only=prod --production --loglevel=silly --save $dep_constraints
135-
fi
136141
npm i --ignore-scripts --omit=peer --omit=dev --only=prod --production --loglevel=silly
137142
## rebuild deps for which scripts were ignored, or partially installed - since "ignore-scripts" was used
138143
npm rebuild --loglevel=silly libxmljs2 || npm uninstall --no-save libxmljs2 || true

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ env:
3434
REPORTS_DIR: CI_reports
3535
PACKED_DIR: CI_packed
3636
PACKED_ARTIFACT: packed
37-
NODE_ACTIVE_LTS: "20"
37+
NODE_ACTIVE_LTS: "22"
3838

3939
jobs:
4040
bump:

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ But please read the
55
[CycloneDX contributing guidelines](https://github.com/CycloneDX/.github/blob/master/CONTRIBUTING.md)
66
first.
77

8-
## Setup
8+
## Set up the project
99

10-
To start developing simply run to install dev-dependencies and tools:
10+
Install dependencies:
1111

1212
```shell
13-
npm ci
13+
npm run dev-setup
1414
```
1515

1616
This will install process automatically build the project from source.

HISTORY.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ All notable changes to this project will be documented in this file.
66

77
<!-- unreleased changes go here -->
88

9+
* BREAKING Changes
10+
* Dropped support for `node<20.18.0` ([#1362] via [#1365])
11+
* Documentation
12+
* Fixed docs of default values (via [#1369])
13+
* Dependencies
14+
* Upgraded runtime-dependency `@cyclonedx/cyclonedx-library@^8.0.0`, was `@^7.0.0` (via [#1367])
15+
* Upgraded runtime-dependency `normalize-package-data@^7.0.0`, was `@^3||^4||^5||^6` (via [#1368])
16+
17+
[#1362]: https://github.com/CycloneDX/cyclonedx-webpack-plugin/issues/1362
18+
[#1365]: https://github.com/CycloneDX/cyclonedx-webpack-plugin/pull/1365
19+
[#1367]: https://github.com/CycloneDX/cyclonedx-webpack-plugin/pull/1367
20+
[#1368]: https://github.com/CycloneDX/cyclonedx-webpack-plugin/pull/1368
21+
[#1369]: https://github.com/CycloneDX/cyclonedx-webpack-plugin/pull/1369
22+
923
## 4.0.1 - 2025-01-29
1024

1125
* Fixed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ that are actually used (after [tree-shaking](https://webpack.js.org/guides/tree-
1919

2020
## Requirements
2121

22-
* _Node.js_ `>= 14`
22+
* _Node.js_ `>= 20.18`
2323
* _webpack_ `^5`
2424

2525
However, there are older versions of this plugin, that support

eslint.config.mjs

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
/*!
2+
This file is part of CycloneDX Webpack plugin.
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 path from 'node:path'
21+
import { fileURLToPath } from 'node:url'
22+
23+
import { default as baseCfg, globals } from './tools/code-style/eslint.config.mjs'
24+
25+
const __filename = fileURLToPath(import.meta.url)
26+
const __dirname = path.dirname(__filename)
27+
28+
/* eslint-disable jsdoc/valid-types */
29+
30+
/**
31+
* @type {import('tools/code-style/node_modules/eslint').Linter.Config[]}
32+
* @see https://eslint.org
33+
*/
34+
export default [
35+
...baseCfg,
36+
{
37+
name: 'project-specific',
38+
rules: {
39+
"complexity": ["error", { "max": 15 }]
40+
}
41+
},
42+
{
43+
name: 'project-specific',
44+
files: ['src/*.ts'],
45+
rules: {
46+
'@typescript-eslint/no-unsafe-assignment': 'warn',
47+
'@typescript-eslint/no-unsafe-member-access': 'warn',
48+
}
49+
},
50+
{
51+
files: ['**/*.js'],
52+
languageOptions: { sourceType: 'commonjs' }
53+
},
54+
{
55+
files: ['{src,tests}/**/*!(.{node,web}).{js,mjs,cjs.ts}'],
56+
languageOptions: {
57+
globals: {
58+
...globals.browser,
59+
...globals.node
60+
}
61+
}
62+
},
63+
{
64+
files: [
65+
'**/*.{test,spec}.{js,mjs,cjs,ts}',
66+
'tests/**.{js,mjs,cjs,ts}'
67+
],
68+
languageOptions: {
69+
globals: {
70+
...globals.node,
71+
...globals.jest,
72+
}
73+
}
74+
},
75+
{
76+
files: ['src/**/*.ts'],
77+
languageOptions: {
78+
parserOptions: {
79+
project: path.join(__dirname, 'tsconfig.json'),
80+
},
81+
},
82+
},
83+
{
84+
files: ['examples/**/*.{js,mjs,cjs,ts}'],
85+
rules: {
86+
'no-console': 'off'
87+
},
88+
languageOptions: {
89+
globals: globals.browser
90+
}
91+
},
92+
{
93+
// global ignores must have nothing but a "ignores" property!
94+
// see https://github.com/eslint/eslint/discussions/17429#discussioncomment-6579229
95+
ignores: [
96+
'reports/',
97+
'dist/',
98+
'docs/api/',
99+
'docs/_build/',
100+
'docs/.venv/',
101+
'examples/**/dist/',
102+
'tools/',
103+
'tests/integration/'
104+
],
105+
},
106+
]

examples/simple/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ SPDX-License-Identifier: Apache-2.0
1717
Copyright (c) OWASP Foundation. All Rights Reserved.
1818
*/
1919

20-
const { Tooltip, Toast, Popover } = require('bootstrap')
20+
const { Popover, Toast, Tooltip } = require('bootstrap')
2121

2222
// no real world use, but showcase
2323

0 commit comments

Comments
 (0)