@mongosh/cli-repl 1.10.1 → 1.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.depcheckrc +15 -1
- package/.eslintrc.js +18 -1
- package/.prettierignore +6 -0
- package/.prettierrc.json +1 -0
- package/README.md +57 -22
- package/lib/arg-parser.d.ts +2 -2
- package/lib/arg-parser.js +10 -16
- package/lib/arg-parser.js.map +1 -1
- package/lib/async-repl.d.ts +7 -6
- package/lib/async-repl.js +20 -6
- package/lib/async-repl.js.map +1 -1
- package/lib/build-info.d.ts +7 -9
- package/lib/build-info.js +5 -17
- package/lib/build-info.js.map +1 -1
- package/lib/build-info.json +1 -1
- package/lib/cli-repl.d.ts +13 -9
- package/lib/cli-repl.js +85 -41
- package/lib/cli-repl.js.map +1 -1
- package/lib/clr.d.ts +2 -2
- package/lib/clr.js +2 -2
- package/lib/clr.js.map +1 -1
- package/lib/config-directory.d.ts +1 -1
- package/lib/config-directory.js +9 -3
- package/lib/config-directory.js.map +1 -1
- package/lib/constants.js +3 -1
- package/lib/constants.js.map +1 -1
- package/lib/crypt-library-paths.js +17 -11
- package/lib/crypt-library-paths.js.map +1 -1
- package/lib/error-codes.js +1 -2
- package/lib/error-codes.js.map +1 -1
- package/lib/format-json.js +2 -2
- package/lib/format-json.js.map +1 -1
- package/lib/format-output.d.ts +2 -2
- package/lib/format-output.js +41 -20
- package/lib/format-output.js.map +1 -1
- package/lib/get-os-info.js +3 -3
- package/lib/line-by-line-input.d.ts +2 -0
- package/lib/line-by-line-input.js +22 -13
- package/lib/line-by-line-input.js.map +1 -1
- package/lib/mongosh-repl.d.ts +16 -11
- package/lib/mongosh-repl.js +68 -56
- package/lib/mongosh-repl.js.map +1 -1
- package/lib/run.js +12 -10
- package/lib/run.js.map +1 -1
- package/lib/smoke-tests-fle.js.map +1 -1
- package/lib/smoke-tests.js +60 -36
- package/lib/smoke-tests.js.map +1 -1
- package/lib/tls-certificate-selector.js +6 -3
- package/lib/tls-certificate-selector.js.map +1 -1
- package/package.json +47 -32
- package/tsconfig-lint.json +5 -0
- package/webpack.config.js +9 -5
- package/tsconfig.lint.json +0 -8
package/lib/smoke-tests.js
CHANGED
|
@@ -15,42 +15,51 @@ async function runSmokeTests(smokeTestServer, executable, ...args) {
|
|
|
15
15
|
if (process.env.IS_CI) {
|
|
16
16
|
(0, assert_1.default)(!!smokeTestServer, 'Make sure MONGOSH_SMOKE_TEST_SERVER is set in CI');
|
|
17
17
|
}
|
|
18
|
-
const expectFipsSupport = !!process.env.MONGOSH_SMOKE_TEST_OS_HAS_FIPS_SUPPORT &&
|
|
18
|
+
const expectFipsSupport = !!process.env.MONGOSH_SMOKE_TEST_OS_HAS_FIPS_SUPPORT &&
|
|
19
|
+
(await (0, build_info_1.buildInfo)()).sharedOpenssl;
|
|
19
20
|
console.log('FIPS support required to pass?', { expectFipsSupport });
|
|
20
|
-
for (const { input, output, testArgs, includeStderr, exitCode } of [
|
|
21
|
+
for (const { input, output, testArgs, includeStderr, exitCode } of [
|
|
22
|
+
{
|
|
21
23
|
input: 'print("He" + "llo" + " Wor" + "ld!")',
|
|
22
24
|
output: /Hello World!/,
|
|
23
25
|
includeStderr: false,
|
|
24
26
|
testArgs: ['--nodb'],
|
|
25
|
-
exitCode: 0
|
|
26
|
-
},
|
|
27
|
+
exitCode: 0,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
27
30
|
input: '',
|
|
28
31
|
output: /ReferenceError/,
|
|
29
32
|
includeStderr: true,
|
|
30
33
|
testArgs: ['--nodb', '--eval', 'foo.bar()'],
|
|
31
|
-
exitCode: 1
|
|
32
|
-
},
|
|
34
|
+
exitCode: 1,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
33
37
|
input: '',
|
|
34
38
|
output: /Hello World!/,
|
|
35
39
|
includeStderr: false,
|
|
36
40
|
testArgs: ['--nodb', '--eval', 'print("He" + "llo" + " Wor" + "ld!")'],
|
|
37
41
|
exitCode: 0,
|
|
38
|
-
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
39
44
|
input: 'crypto.createHash("md5").update("hello").digest("hex")',
|
|
40
|
-
output: expectFipsSupport
|
|
41
|
-
/disabled for FIPS|digital envelope routines::unsupported/i
|
|
42
|
-
/disabled for FIPS|digital envelope routines::unsupported|Could not enable FIPS mode/i,
|
|
45
|
+
output: expectFipsSupport
|
|
46
|
+
? /disabled for FIPS|digital envelope routines::unsupported/i
|
|
47
|
+
: /disabled for FIPS|digital envelope routines::unsupported|Could not enable FIPS mode/i,
|
|
43
48
|
includeStderr: true,
|
|
44
|
-
testArgs: ['--tlsFIPSMode', '--nodb']
|
|
45
|
-
},
|
|
49
|
+
testArgs: ['--tlsFIPSMode', '--nodb'],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
46
52
|
input: 'crypto.createHash("sha256").update("hello").digest("hex")',
|
|
47
|
-
output: expectFipsSupport
|
|
48
|
-
/2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824/i
|
|
49
|
-
/2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824|digital envelope routines::unsupported|Could not enable FIPS mode/i,
|
|
53
|
+
output: expectFipsSupport
|
|
54
|
+
? /2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824/i
|
|
55
|
+
: /2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824|digital envelope routines::unsupported|Could not enable FIPS mode/i,
|
|
50
56
|
includeStderr: true,
|
|
51
|
-
testArgs: ['--tlsFIPSMode', '--nodb']
|
|
52
|
-
}
|
|
53
|
-
|
|
57
|
+
testArgs: ['--tlsFIPSMode', '--nodb'],
|
|
58
|
+
},
|
|
59
|
+
].concat(smokeTestServer
|
|
60
|
+
? [
|
|
61
|
+
{
|
|
62
|
+
input: `
|
|
54
63
|
const dbname = "testdb_simplesmoke" + new Date().getTime();
|
|
55
64
|
use(dbname);
|
|
56
65
|
db.testcoll.insertOne({ d: new Date() });
|
|
@@ -58,45 +67,60 @@ async function runSmokeTests(smokeTestServer, executable, ...args) {
|
|
|
58
67
|
print('Test succeeded');
|
|
59
68
|
}
|
|
60
69
|
db.dropDatabase();`,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
output: /Test succeeded/,
|
|
71
|
+
includeStderr: false,
|
|
72
|
+
exitCode: 0,
|
|
73
|
+
testArgs: [smokeTestServer],
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
input: smoke_tests_fle_1.default,
|
|
77
|
+
output: /Test succeeded|Test skipped/,
|
|
78
|
+
includeStderr: false,
|
|
79
|
+
exitCode: 0,
|
|
80
|
+
testArgs: [smokeTestServer],
|
|
81
|
+
},
|
|
82
|
+
]
|
|
83
|
+
: [])) {
|
|
72
84
|
await runSmokeTest({
|
|
73
85
|
executable,
|
|
74
86
|
args: [...args, ...testArgs],
|
|
75
87
|
input,
|
|
76
88
|
output,
|
|
77
89
|
includeStderr,
|
|
78
|
-
exitCode
|
|
90
|
+
exitCode,
|
|
79
91
|
});
|
|
80
92
|
}
|
|
81
93
|
console.log('all tests passed');
|
|
82
94
|
}
|
|
83
95
|
exports.runSmokeTests = runSmokeTests;
|
|
84
|
-
async function runSmokeTest({ executable, args, input, output, exitCode, includeStderr }) {
|
|
96
|
+
async function runSmokeTest({ executable, args, input, output, exitCode, includeStderr, }) {
|
|
85
97
|
var _a;
|
|
86
98
|
const proc = (0, child_process_1.spawn)(executable, [...args], {
|
|
87
|
-
stdio: ['pipe', 'pipe', includeStderr ? 'pipe' : 'inherit']
|
|
99
|
+
stdio: ['pipe', 'pipe', includeStderr ? 'pipe' : 'inherit'],
|
|
88
100
|
});
|
|
89
101
|
let stdout = '';
|
|
90
102
|
let stderr = '';
|
|
91
|
-
proc.stdout.setEncoding('utf8').on('data', (chunk) => {
|
|
92
|
-
|
|
103
|
+
proc.stdout.setEncoding('utf8').on('data', (chunk) => {
|
|
104
|
+
stdout += chunk;
|
|
105
|
+
});
|
|
106
|
+
(_a = proc.stderr) === null || _a === void 0 ? void 0 : _a.setEncoding('utf8').on('data', (chunk) => {
|
|
107
|
+
stderr += chunk;
|
|
108
|
+
});
|
|
93
109
|
proc.stdin.end(input);
|
|
94
110
|
const [[actualExitCode]] = await Promise.all([
|
|
95
111
|
(0, events_1.once)(proc, 'exit'),
|
|
96
112
|
(0, events_1.once)(proc.stdout, 'end'),
|
|
97
|
-
proc.stderr && (0, events_1.once)(proc.stderr, 'end')
|
|
113
|
+
proc.stderr && (0, events_1.once)(proc.stderr, 'end'),
|
|
98
114
|
]);
|
|
99
|
-
const metadata = {
|
|
115
|
+
const metadata = {
|
|
116
|
+
input,
|
|
117
|
+
output,
|
|
118
|
+
stdout,
|
|
119
|
+
stderr,
|
|
120
|
+
executable,
|
|
121
|
+
actualExitCode,
|
|
122
|
+
args: args.map((arg) => (0, history_1.redactURICredentials)(arg)),
|
|
123
|
+
};
|
|
100
124
|
try {
|
|
101
125
|
assert_1.default.match(includeStderr ? `${stdout}\n${stderr}` : stdout, output);
|
|
102
126
|
if (exitCode !== undefined) {
|
package/lib/smoke-tests.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smoke-tests.js","sourceRoot":"","sources":["../src/smoke-tests.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"smoke-tests.js","sourceRoot":"","sources":["../src/smoke-tests.ts"],"names":[],"mappings":";;;;;;AAAA,iDAAsC;AACtC,oDAA4B;AAC5B,mCAA8B;AAC9B,8CAAwD;AACxD,wEAAmD;AACnD,6CAAyC;AAWlC,KAAK,UAAU,aAAa,CACjC,eAAmC,EACnC,UAAkB,EAClB,GAAG,IAAc;IAEjB,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAAE,CAAC,CAA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AAC,CAAC;QAClD,MAAM,GAAG,CAAC;KACX;AACH,CAAC"}
|
|
@@ -11,12 +11,14 @@ function getTlsCertificateSelector(selector) {
|
|
|
11
11
|
if (!exportCertificateAndPrivateKey) {
|
|
12
12
|
throw new errors_1.MongoshUnimplementedError('--tlsCertificateSelector is not supported on this platform');
|
|
13
13
|
}
|
|
14
|
-
const match =
|
|
14
|
+
const match = /^(?<key>\w+)=(?<value>.+)/.exec(selector);
|
|
15
15
|
if (!match || !['subject', 'thumbprint'].includes((_b = (_a = match.groups) === null || _a === void 0 ? void 0 : _a.key) !== null && _b !== void 0 ? _b : '')) {
|
|
16
16
|
throw new errors_1.MongoshInvalidInputError('--tlsCertificateSelector needs to include subject or thumbprint');
|
|
17
17
|
}
|
|
18
18
|
const { key, value } = (_c = match.groups) !== null && _c !== void 0 ? _c : {};
|
|
19
|
-
const search = key === 'subject'
|
|
19
|
+
const search = key === 'subject'
|
|
20
|
+
? { subject: value }
|
|
21
|
+
: { thumbprint: Buffer.from(value, 'hex') };
|
|
20
22
|
try {
|
|
21
23
|
const { passphrase, pfx } = exportCertificateAndPrivateKey(search);
|
|
22
24
|
return { passphrase, pfx };
|
|
@@ -43,7 +45,8 @@ function getCertificateExporter() {
|
|
|
43
45
|
return undefined;
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
|
-
catch (_a) {
|
|
48
|
+
catch (_a) {
|
|
49
|
+
}
|
|
47
50
|
return undefined;
|
|
48
51
|
}
|
|
49
52
|
//# sourceMappingURL=tls-certificate-selector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tls-certificate-selector.js","sourceRoot":"","sources":["../src/tls-certificate-selector.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"tls-certificate-selector.js","sourceRoot":"","sources":["../src/tls-certificate-selector.ts"],"names":[],"mappings":";;;AAAA,4CAGyB;AAKzB,SAAgB,yBAAyB,CACvC,QAA4B;;IAE5B,IAAI,CAAC,QAA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H;QACD,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;KACrE;IAED,IAAI;QACF,QAAQ,OAAO,CAAC,QAAQ,EAAE;YACxB,KAAK,OAAO;gBACV,OAAO,OAAO,CAAC,gCAAgC,CAAC,CAAC;YACnD,KAAK,QAAQ;gBACX,OAAO,OAAO,CAAC,kCAAkC,CAAC,CAAC;YACrD;gBACE,OAAO,SAAS,CAAC;SACpB;KACF;IAAC,WAAM;KAEP;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mongosh/cli-repl",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.3",
|
|
4
4
|
"description": "MongoDB Shell CLI REPL Package",
|
|
5
5
|
"homepage": "https://github.com/mongodb-js/mongosh",
|
|
6
6
|
"author": "Compass Team <compass@mongodb.com>",
|
|
@@ -18,20 +18,24 @@
|
|
|
18
18
|
"url": "git://github.com/mongodb-js/mongosh.git"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
|
-
"compile
|
|
21
|
+
"compile": "tsc -p tsconfig.json",
|
|
22
22
|
"start": "node bin/mongosh.js",
|
|
23
|
-
"pretest": "npm run compile
|
|
24
|
-
"test": "cross-env TS_NODE_PROJECT=../../
|
|
23
|
+
"pretest": "npm run compile",
|
|
24
|
+
"test": "cross-env TS_NODE_PROJECT=../../configs/tsconfig-mongosh/tsconfig.test.json mocha -r \"../../scripts/import-expansions.js\" --timeout 60000 -r ts-node/register \"./{src,test}/**/*.spec.ts\"",
|
|
25
25
|
"test-ci": "node ../../scripts/run-if-package-requested.js npm test",
|
|
26
26
|
"test-apistrict-ci": "cross-env MONGOSH_TEST_FORCE_API_STRICT=1 npm run test-ci",
|
|
27
|
-
"pretest-e2e": "npm run compile
|
|
28
|
-
"test-e2e": "cross-env TS_NODE_PROJECT=../../
|
|
29
|
-
"test-e2e-ci": "cross-env TS_NODE_PROJECT=../../
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
27
|
+
"pretest-e2e": "npm run compile",
|
|
28
|
+
"test-e2e": "cross-env TS_NODE_PROJECT=../../configs/tsconfig-mongosh/tsconfig.test.json mocha -r \"../../scripts/import-expansions.js\" --timeout 15000 --colors -r ts-node/register \"./test/e2e*.spec.ts\"",
|
|
29
|
+
"test-e2e-ci": "cross-env TS_NODE_PROJECT=../../configs/tsconfig-mongosh/tsconfig.test.json mocha -r \"../../scripts/import-expansions.js\" --timeout 15000 --colors -r ts-node/register \"./test/e2e*.spec.ts\"",
|
|
30
|
+
"eslint": "eslint",
|
|
31
|
+
"lint": "npm run eslint . && npm run prettier -- --check .",
|
|
32
|
+
"check": "npm run lint && npm run depcheck",
|
|
33
|
+
"depcheck": "depcheck",
|
|
34
|
+
"prepublish": "npm run compile",
|
|
35
|
+
"webpack-build": "npm run compile && webpack --mode production",
|
|
36
|
+
"webpack-build-dev": "npm run compile && webpack --mode development",
|
|
37
|
+
"prettier": "prettier",
|
|
38
|
+
"reformat": "npm run prettier -- --write . && npm run eslint --fix"
|
|
35
39
|
},
|
|
36
40
|
"license": "Apache-2.0",
|
|
37
41
|
"publishConfig": {
|
|
@@ -54,20 +58,20 @@
|
|
|
54
58
|
}
|
|
55
59
|
},
|
|
56
60
|
"dependencies": {
|
|
57
|
-
"@mongosh/arg-parser": "1.10.
|
|
58
|
-
"@mongosh/autocomplete": "1.10.
|
|
59
|
-
"@mongosh/editor": "1.10.
|
|
60
|
-
"@mongosh/errors": "1.10.
|
|
61
|
-
"@mongosh/history": "1.10.
|
|
62
|
-
"@mongosh/i18n": "1.10.
|
|
63
|
-
"@mongosh/js-multiline-to-singleline": "1.10.
|
|
64
|
-
"@mongosh/logging": "1.10.
|
|
65
|
-
"@mongosh/service-provider-core": "1.10.
|
|
66
|
-
"@mongosh/service-provider-server": "1.10.
|
|
67
|
-
"@mongosh/shell-api": "1.10.
|
|
68
|
-
"@mongosh/shell-evaluator": "1.10.
|
|
69
|
-
"@mongosh/snippet-manager": "1.10.
|
|
70
|
-
"@mongosh/types": "1.10.
|
|
61
|
+
"@mongosh/arg-parser": "1.10.3",
|
|
62
|
+
"@mongosh/autocomplete": "1.10.3",
|
|
63
|
+
"@mongosh/editor": "1.10.3",
|
|
64
|
+
"@mongosh/errors": "1.10.3",
|
|
65
|
+
"@mongosh/history": "1.10.3",
|
|
66
|
+
"@mongosh/i18n": "1.10.3",
|
|
67
|
+
"@mongosh/js-multiline-to-singleline": "1.10.3",
|
|
68
|
+
"@mongosh/logging": "1.10.3",
|
|
69
|
+
"@mongosh/service-provider-core": "1.10.3",
|
|
70
|
+
"@mongosh/service-provider-server": "1.10.3",
|
|
71
|
+
"@mongosh/shell-api": "1.10.3",
|
|
72
|
+
"@mongosh/shell-evaluator": "1.10.3",
|
|
73
|
+
"@mongosh/snippet-manager": "1.10.3",
|
|
74
|
+
"@mongosh/types": "1.10.3",
|
|
71
75
|
"analytics-node": "^5.1.2",
|
|
72
76
|
"ansi-escape-sequences": "^5.1.2",
|
|
73
77
|
"askcharacter": "^1.0.0",
|
|
@@ -75,29 +79,40 @@
|
|
|
75
79
|
"is-recoverable-error": "^1.0.3",
|
|
76
80
|
"js-yaml": "^4.1.0",
|
|
77
81
|
"mongodb-connection-string-url": "^2.6.0",
|
|
78
|
-
"mongodb-log-writer": "^1.
|
|
82
|
+
"mongodb-log-writer": "^1.3.0",
|
|
79
83
|
"numeral": "^2.0.6",
|
|
80
84
|
"pretty-repl": "^4.0.0",
|
|
81
|
-
"semver": "^7.
|
|
85
|
+
"semver": "^7.5.4",
|
|
82
86
|
"strip-ansi": "^6.0.0",
|
|
83
87
|
"text-table": "^0.2.0",
|
|
84
88
|
"yargs-parser": "^20.2.4"
|
|
85
89
|
},
|
|
86
90
|
"devDependencies": {
|
|
91
|
+
"@mongodb-js/eslint-config-mongosh": "1.10.3",
|
|
87
92
|
"@mongodb-js/oidc-mock-provider": "^0.3.0",
|
|
88
|
-
"@mongodb-js/
|
|
93
|
+
"@mongodb-js/prettier-config-devtools": "^1.0.1",
|
|
94
|
+
"@mongodb-js/sbom-tools": "^0.5.2",
|
|
95
|
+
"@mongodb-js/tsconfig-mongosh": "1.10.3",
|
|
89
96
|
"@types/analytics-node": "^3.1.3",
|
|
90
97
|
"@types/ansi-escape-sequences": "^4.0.0",
|
|
91
98
|
"@types/chai-as-promised": "^7.1.3",
|
|
92
99
|
"@types/js-yaml": "^4.0.5",
|
|
93
|
-
"@types/node": "^14.14.
|
|
100
|
+
"@types/node": "^14.14.6",
|
|
94
101
|
"@types/numeral": "^2.0.2",
|
|
102
|
+
"@types/rimraf": "^3.0.0",
|
|
95
103
|
"@types/text-table": "^0.2.1",
|
|
96
104
|
"@types/yargs-parser": "^15.0.0",
|
|
97
105
|
"chai-as-promised": "^7.1.1",
|
|
106
|
+
"depcheck": "^1.4.3",
|
|
107
|
+
"eslint": "^7.25.0",
|
|
98
108
|
"lodash": "^4.17.21",
|
|
99
109
|
"moment": "^2.29.1",
|
|
100
|
-
"mongodb
|
|
110
|
+
"mongodb": "^5.7.0",
|
|
111
|
+
"mongodb-crypt-library-dummy": "^1.0.2",
|
|
112
|
+
"node-fetch": "^2.6.1",
|
|
113
|
+
"prettier": "^2.8.8",
|
|
114
|
+
"rimraf": "^3.0.2",
|
|
115
|
+
"webpack-merge": "^5.8.0"
|
|
101
116
|
},
|
|
102
117
|
"optionalDependencies": {
|
|
103
118
|
"get-console-process-list": "^1.0.4",
|
|
@@ -105,5 +120,5 @@
|
|
|
105
120
|
"mongodb-crypt-library-version": "^1.0.3",
|
|
106
121
|
"win-export-certificate-and-key": "^1.1.1"
|
|
107
122
|
},
|
|
108
|
-
"gitHead": "
|
|
123
|
+
"gitHead": "5df718faed3916fc5ce637f953eef2f913b14303"
|
|
109
124
|
}
|
package/webpack.config.js
CHANGED
|
@@ -6,7 +6,13 @@ const { WebpackDependenciesPlugin } = require('@mongodb-js/sbom-tools');
|
|
|
6
6
|
const baseWebpackConfig = require('../../config/webpack.base.config');
|
|
7
7
|
|
|
8
8
|
const webpackDependenciesPlugin = new WebpackDependenciesPlugin({
|
|
9
|
-
outputFilename: path.resolve(
|
|
9
|
+
outputFilename: path.resolve(
|
|
10
|
+
__dirname,
|
|
11
|
+
'..',
|
|
12
|
+
'..',
|
|
13
|
+
'.sbom',
|
|
14
|
+
'dependencies.json'
|
|
15
|
+
),
|
|
10
16
|
includeExternalProductionDependencies: true,
|
|
11
17
|
});
|
|
12
18
|
|
|
@@ -15,11 +21,9 @@ const config = {
|
|
|
15
21
|
output: {
|
|
16
22
|
path: path.resolve(__dirname, 'dist'),
|
|
17
23
|
filename: 'mongosh.js',
|
|
18
|
-
libraryTarget: 'commonjs2'
|
|
24
|
+
libraryTarget: 'commonjs2',
|
|
19
25
|
},
|
|
20
|
-
plugins: [
|
|
21
|
-
webpackDependenciesPlugin
|
|
22
|
-
],
|
|
26
|
+
plugins: [webpackDependenciesPlugin],
|
|
23
27
|
entry: './lib/run.js',
|
|
24
28
|
};
|
|
25
29
|
|