Skip to content

Commit 2b03591

Browse files
authored
chore(ci): include sbom in the node-runtime-worker-thread package MONGOSH-1856 (#2430)
Adds appending a purls file to the prepublishing step of the node-runtime-worker-thread.
1 parent a082e2d commit 2b03591

File tree

6 files changed

+21
-8
lines changed

6 files changed

+21
-8
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
"devDependencies": {
101101
"@babel/compat-data": "^7.26.8",
102102
"@mongodb-js/monorepo-tools": "^1.1.10",
103-
"@mongodb-js/sbom-tools": "^0.7.0",
103+
"@mongodb-js/sbom-tools": "^0.7.2",
104104
"@pkgjs/nv": "^0.2.2",
105105
"@types/chai": "^4.2.5",
106106
"@types/mocha": "^5.2.7",

packages/cli-repl/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"mongodb": "^6.14.2",
9999
"@mongodb-js/eslint-config-mongosh": "^1.0.0",
100100
"@mongodb-js/prettier-config-devtools": "^1.0.1",
101-
"@mongodb-js/sbom-tools": "^0.7.0",
101+
"@mongodb-js/sbom-tools": "^0.7.2",
102102
"@mongodb-js/tsconfig-mongosh": "^1.0.0",
103103
"@types/ansi-escape-sequences": "^4.0.0",
104104
"@types/js-yaml": "^4.0.5",

packages/node-runtime-worker-thread/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
**/test/fixtures
55
**/*.nocov*
66
**/*.wxs
7+
**/.sbom

packages/node-runtime-worker-thread/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,16 @@
2929
"webpack-build": "npm run compile && webpack --mode production",
3030
"webpack-build-dev": "npm run compile && webpack --mode development",
3131
"compile": "tsc -p tsconfig.json",
32-
"prepublish": "npm run webpack-build",
32+
"prepublish": "npm run webpack-build && npm run create-purls-file",
3333
"prettier": "prettier",
34-
"reformat": "npm run prettier -- --write . && npm run eslint --fix"
34+
"reformat": "npm run prettier -- --write . && npm run eslint --fix",
35+
"create-purls-file": "npm run write-node-js-dep && node ../../scripts/create-purls.js .sbom/dependencies.json .sbom/node-js-dep.json > dist/purls.txt",
36+
"write-node-js-dep": "mkdir -p .sbom && node ../../scripts/write-nodejs-dep > .sbom/node-js-dep.json"
3537
},
3638
"devDependencies": {
3739
"@mongodb-js/eslint-config-mongosh": "^1.0.0",
3840
"@mongodb-js/prettier-config-devtools": "^1.0.1",
41+
"@mongodb-js/sbom-tools": "^0.7.2",
3942
"@mongodb-js/tsconfig-mongosh": "^1.0.0",
4043
"@mongosh/browser-runtime-core": "3.8.0",
4144
"@mongosh/browser-runtime-electron": "3.8.0",

packages/node-runtime-worker-thread/webpack.config.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@
22
const { merge } = require('webpack-merge');
33
const path = require('path');
44

5+
const { WebpackDependenciesPlugin } = require('@mongodb-js/sbom-tools');
56
const baseWebpackConfig = require('../../config/webpack.base.config');
67

8+
const webpackDependenciesPlugin = new WebpackDependenciesPlugin({
9+
outputFilename: path.resolve(__dirname, '.sbom', 'dependencies.json'),
10+
includeExternalProductionDependencies: true,
11+
});
12+
713
/** @type import('webpack').Configuration */
814
const config = {
915
output: {
1016
path: path.resolve(__dirname, 'dist'),
1117
filename: '[name].js',
1218
libraryTarget: 'umd',
1319
},
14-
20+
plugins: [webpackDependenciesPlugin],
1521
externals: {
1622
'mongodb-client-encryption': 'commonjs2 mongodb-client-encryption',
1723
kerberos: 'commonjs2 kerberos',

0 commit comments

Comments
 (0)