Skip to content

Commit 95c9871

Browse files
committed
chore!: replace optional deps with peer deps
Signed-off-by: Gautier Ben Aïm <[email protected]>
1 parent 74c6e7c commit 95c9871

File tree

1 file changed

+82
-60
lines changed

1 file changed

+82
-60
lines changed

package.json

Lines changed: 82 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "@cyclonedx/cyclonedx-library",
33
"version": "8.6.0",
44
"description": "Core functionality of CycloneDX for JavaScript (Node.js or WebBrowser).",
5-
"license": "Apache-2.0",
65
"keywords": [
76
"CycloneDX",
87
"models",
@@ -26,19 +25,20 @@
2625
"dependency"
2726
],
2827
"homepage": "https://github.com/CycloneDX/cyclonedx-javascript-library#readme",
28+
"bugs": {
29+
"url": "https://github.com/CycloneDX/cyclonedx-javascript-library/issues"
30+
},
2931
"repository": {
3032
"type": "git",
3133
"url": "git+https://github.com/CycloneDX/cyclonedx-javascript-library.git"
3234
},
33-
"bugs": {
34-
"url": "https://github.com/CycloneDX/cyclonedx-javascript-library/issues"
35-
},
3635
"funding": [
3736
{
3837
"type": "individual",
3938
"url": "https://owasp.org/donate/?reponame=www-project-cyclonedx&title=OWASP+CycloneDX"
4039
}
4140
],
41+
"license": "Apache-2.0",
4242
"author": {
4343
"name": "Jan Kowalleck",
4444
"url": "https://github.com/jkowalleck"
@@ -75,41 +75,8 @@
7575
"url": "https://github.com/AugustusKling"
7676
}
7777
],
78+
"sideEffects": false,
7879
"type": "commonjs",
79-
"engines": {
80-
"node": ">=20.18.0"
81-
},
82-
"dependencies": {
83-
"packageurl-js": "^2.0.1",
84-
"spdx-expression-parse": "^3.0.1 || ^4"
85-
},
86-
"optionalDependencies": {
87-
"ajv": "^8.12.0",
88-
"ajv-formats": "^3.0.1",
89-
"ajv-formats-draft2019": "^1.6.1",
90-
"libxmljs2": "^0.35||^0.37",
91-
"xmlbuilder2": "^3.0.2"
92-
},
93-
"devDependencies": {
94-
"@types/mocha": "^10",
95-
"@types/node": "ts5.7",
96-
"@types/spdx-expression-parse": "^3",
97-
"c8": "^10",
98-
"deepmerge": "^4.2.2",
99-
"fast-glob": "^3.3.1",
100-
"memfs": "4.38.2",
101-
"mocha": "11.7.2",
102-
"npm-run-all2": "^8",
103-
"rimraf": "^6",
104-
"ts-loader": "9.5.4",
105-
"typescript": "5.9.2",
106-
"webpack": "5.101.3",
107-
"webpack-cli": "6.0.1",
108-
"webpack-node-externals": "3.0.0"
109-
},
110-
"types": "./dist.d/index.node.d.ts",
111-
"browser": "./dist.web/lib.js",
112-
"main": "./dist.node/index.node.js",
11380
"exports": {
11481
".": {
11582
"types": {
@@ -161,41 +128,96 @@
161128
"default": "./dist.node/validation/index.node.js"
162129
}
163130
},
131+
"main": "./dist.node/index.node.js",
132+
"browser": "./dist.web/lib.js",
133+
"types": "./dist.d/index.node.d.ts",
164134
"directories": {
165-
"doc": "./docs",
166-
"src": "./src",
167135
"lib": "./dist.node",
136+
"doc": "./docs",
137+
"example": "./examples",
168138
"test": "./tests",
169-
"example": "./examples"
139+
"src": "./src"
170140
},
141+
"files": [
142+
"dist*/**",
143+
"res"
144+
],
171145
"scripts": {
146+
"api-doc": "run-p --aggregate-output -lc api-doc:\\*",
147+
"api-doc:node": "npm --prefix tools/docs-gen exec -- typedoc --options ./typedoc.node.json",
148+
"api-doc:web": "npm --prefix tools/docs-gen exec -- typedoc --options ./typedoc.web.json",
149+
"build": "run-p --aggregate-output -l build:\\*",
150+
"prebuild:d": "rimraf dist.d",
151+
"build:d": "tsc -b ./tsconfig.d.json",
152+
"prebuild:node": "rimraf dist.node",
153+
"build:node": "tsc -b ./tsconfig.node.json",
154+
"prebuild:web": "rimraf dist.web",
155+
"build:web": "webpack build",
156+
"cs-fix": "npm --prefix tools/code-style exec -- eslint --fix .",
172157
"dev-setup": "npm i && run-p --aggregate-output -lc dev-setup:\\*",
173-
"dev-setup:tools": "run-p --aggregate-output -lc dev-setup:tools:\\*",
174-
"dev-setup:tools:docs-gen": "npm --prefix tools/docs-gen install",
175-
"dev-setup:tools:code-style": "npm --prefix tools/code-style install",
176-
"dev-setup:tools:test-dependencies": "npm --prefix tools/test-dependencies install",
177158
"dev-setup:examples": "run-p --aggregate-output -lc dev-setup:examples:\\*",
178159
"dev-setup:examples:js": "npm --prefix examples/node/javascript i --ignore-scripts",
179160
"dev-setup:examples:ts-cjs": "npm --prefix examples/node/typescript/example.cjs i --ignore-scripts",
180161
"dev-setup:examples:ts-mjs": "npm --prefix examples/node/typescript/example.mjs i --ignore-scripts",
181-
"prepublish": "npm run build",
162+
"dev-setup:tools": "run-p --aggregate-output -lc dev-setup:tools:\\*",
163+
"dev-setup:tools:code-style": "npm --prefix tools/code-style install",
164+
"dev-setup:tools:docs-gen": "npm --prefix tools/docs-gen install",
165+
"dev-setup:tools:test-dependencies": "npm --prefix tools/test-dependencies install",
182166
"prepublishOnly": "run-s -lc build test",
183-
"build": "run-p --aggregate-output -l build:\\*",
184-
"prebuild:node": "rimraf dist.node",
185-
"build:node": "tsc -b ./tsconfig.node.json",
186-
"prebuild:web": "rimraf dist.web",
187-
"build:web": "webpack build",
188-
"prebuild:d": "rimraf dist.d",
189-
"build:d": "tsc -b ./tsconfig.d.json",
167+
"prepublish": "npm run build",
190168
"test": "run-p --aggregate-output -lc test:\\*",
191-
"test:node": "c8 mocha -p",
192-
"test:web": "node -e 'console.log(\"TODO: write web test\")'",
169+
"test:dependencies": "npm --prefix tools/test-dependencies exec -- knip --include dependencies,unlisted,unresolved --production",
193170
"test:lint": "tsc --noEmit",
171+
"test:node": "c8 mocha -p",
194172
"test:standard": "npm --prefix tools/code-style exec -- eslint .",
195-
"test:dependencies": "npm --prefix tools/test-dependencies exec -- knip --include dependencies,unlisted,unresolved --production",
196-
"cs-fix": "npm --prefix tools/code-style exec -- eslint --fix .",
197-
"api-doc": "run-p --aggregate-output -lc api-doc:\\*",
198-
"api-doc:node": "npm --prefix tools/docs-gen exec -- typedoc --options ./typedoc.node.json",
199-
"api-doc:web": "npm --prefix tools/docs-gen exec -- typedoc --options ./typedoc.web.json"
173+
"test:web": "node -e 'console.log(\"TODO: write web test\")'"
174+
},
175+
"dependencies": {
176+
"packageurl-js": "^2.0.1",
177+
"spdx-expression-parse": "^3.0.1 || ^4"
178+
},
179+
"devDependencies": {
180+
"@types/mocha": "^10",
181+
"@types/node": "ts5.7",
182+
"@types/spdx-expression-parse": "^3",
183+
"c8": "^10",
184+
"deepmerge": "^4.2.2",
185+
"fast-glob": "^3.3.1",
186+
"memfs": "4.38.2",
187+
"mocha": "11.7.2",
188+
"npm-run-all2": "^8",
189+
"rimraf": "^6",
190+
"ts-loader": "9.5.4",
191+
"typescript": "5.9.2",
192+
"webpack": "5.101.3",
193+
"webpack-cli": "6.0.1",
194+
"webpack-node-externals": "3.0.0"
195+
},
196+
"peerDependencies": {
197+
"ajv": "^8.12.0",
198+
"ajv-formats": "^3.0.1",
199+
"ajv-formats-draft2019": "^1.6.1",
200+
"libxmljs2": "^0.35||^0.37",
201+
"xmlbuilder2": "^3.0.2"
202+
},
203+
"peerDependenciesMeta": {
204+
"ajv": {
205+
"optional": true
206+
},
207+
"ajv-formats": {
208+
"optional": true
209+
},
210+
"ajv-formats-draft2019": {
211+
"optional": true
212+
},
213+
"libxmljs2": {
214+
"optional": true
215+
},
216+
"xmlbuilder2": {
217+
"optional": true
218+
}
219+
},
220+
"engines": {
221+
"node": ">=20.18.0"
200222
}
201223
}

0 commit comments

Comments
 (0)