Skip to content

Commit 12b6606

Browse files
authored
chore: bump autocomplete, @types/node (#2492)
* bump autocomplete, @types/node * version is readonly * better fix * another node types fix * and a test in shell-api
1 parent aefc78c commit 12b6606

File tree

12 files changed

+51
-31
lines changed

12 files changed

+51
-31
lines changed

package-lock.json

Lines changed: 27 additions & 18 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
@@ -103,7 +103,7 @@
103103
"@pkgjs/nv": "^0.2.2",
104104
"@types/chai": "^4.2.5",
105105
"@types/mocha": "^5.2.7",
106-
"@types/node": "^14.14.6",
106+
"@types/node": "^22.15.30",
107107
"@types/rimraf": "^3.0.0",
108108
"@types/semver": "^7.3.4",
109109
"@types/sinon-chai": "^3.2.4",

packages/autocomplete/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"dependencies": {
4646
"@mongodb-js/mongodb-constants": "^0.10.1",
4747
"@mongosh/shell-api": "^3.16.2",
48-
"@mongodb-js/mongodb-ts-autocomplete": "^0.4.0",
48+
"@mongodb-js/mongodb-ts-autocomplete": "^0.4.1",
4949
"semver": "^7.5.4"
5050
}
5151
}

packages/browser-runtime-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"@mongodb-js/eslint-config-mongosh": "^1.0.0",
4242
"@mongodb-js/prettier-config-devtools": "^1.0.1",
4343
"@mongodb-js/tsconfig-mongosh": "^1.0.0",
44-
"@mongodb-js/mongodb-ts-autocomplete": "^0.4.0",
44+
"@mongodb-js/mongodb-ts-autocomplete": "^0.4.1",
4545
"@mongosh/types": "3.8.2",
4646
"bson": "^6.10.3",
4747
"depcheck": "^1.4.7",

packages/cli-repl/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"@mongodb-js/tsconfig-mongosh": "^1.0.0",
103103
"@types/ansi-escape-sequences": "^4.0.0",
104104
"@types/js-yaml": "^4.0.5",
105-
"@types/node": "^14.14.6",
105+
"@types/node": "^22.15.30",
106106
"@types/numeral": "^2.0.2",
107107
"@types/text-table": "^0.2.1",
108108
"@types/yargs-parser": "^15.0.0",

packages/cli-repl/src/cli-repl.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,8 @@ describe('CliRepl', function () {
498498
process.env.MONGOSH_SKIP_NODE_VERSION_CHECK;
499499
delete process.env.MONGOSH_SKIP_NODE_VERSION_CHECK;
500500
delete (process as any).version;
501+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
502+
// @ts-ignore version is readonly
501503
process.version = 'v8.0.0';
502504

503505
try {
@@ -512,6 +514,8 @@ describe('CliRepl', function () {
512514
expect(e.name).to.equal('MongoshWarning');
513515
expect((e as any).code).to.equal(CliReplErrors.NodeVersionMismatch);
514516
} finally {
517+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
518+
// @ts-ignore version is readonly
515519
process.version = `v${process.versions.node}`;
516520
process.env.MONGOSH_SKIP_NODE_VERSION_CHECK =
517521
origVersionCheckEnvVar || '';
@@ -2861,6 +2865,8 @@ describe('CliRepl', function () {
28612865

28622866
it('does not print any deprecation warning when CLI is ran with --quiet flag', async function () {
28632867
// Setting all the possible situation for a deprecation warning
2868+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
2869+
// @ts-ignore version is readonly
28642870
process.version = '18.20.0';
28652871
process.versions.openssl = '1.1.11';
28662872
cliRepl.getGlibcVersion = () => '1.27';

packages/cli-repl/src/crypt-library-paths.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,14 @@ async function ensureMatchingPermissions(
112112
// the mongosh binary to begin with) and they are not writable by other
113113
// users.
114114
if (
115-
(stat.uid !== execPathStat.uid && stat.uid !== process.getuid()) ||
116-
(stat.gid !== execPathStat.gid && stat.gid !== process.getgid()) ||
115+
(stat.uid !== execPathStat.uid && stat.uid !== process.getuid?.()) ||
116+
(stat.gid !== execPathStat.gid && stat.gid !== process.getgid?.()) ||
117117
stat.mode & 0o002 /* world-writable */
118118
) {
119119
return {
120120
libraryStat: { uid: stat.uid, gid: stat.gid, mode: stat.mode },
121121
mongoshStat: { uid: execPathStat.uid, gid: stat.gid },
122-
currentUser: { uid: process.getuid(), gid: process.getgid() },
122+
currentUser: { uid: process.getuid?.(), gid: process.getgid?.() },
123123
};
124124
}
125125
return null;

packages/cli-repl/src/mongosh-repl.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,9 @@ class MongoshNodeRepl implements EvaluationListener {
923923
// this is an async interrupt - the evaluation is still running in the background
924924
// we wait until it finally completes (which should happen immediately)
925925
await Promise.race([
926-
once(this.bus, 'mongosh:eval-interrupted'),
926+
new Promise<void>((resolve) =>
927+
this.bus.once('mongosh:eval-interrupted', resolve)
928+
),
927929
new Promise(setImmediate),
928930
]);
929931

packages/e2e-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"@mongodb-js/prettier-config-devtools": "^1.0.1",
4040
"@mongodb-js/tsconfig-mongosh": "^1.0.0",
4141
"@types/chai-as-promised": "^7.1.3",
42-
"@types/node": "^14.14.6",
42+
"@types/node": "^22.15.30",
4343
"@types/rimraf": "^3.0.0",
4444
"bson": "^6.10.3",
4545
"chai-as-promised": "^7.1.1",

packages/e2e-tests/test/e2e.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2329,8 +2329,8 @@ describe('e2e', function () {
23292329
it('keeps working when the config file is present but not writable', async function () {
23302330
if (
23312331
process.platform === 'win32' ||
2332-
process.getuid() === 0 ||
2333-
process.geteuid() === 0
2332+
process.getuid?.() === 0 ||
2333+
process.geteuid?.() === 0
23342334
) {
23352335
return this.skip(); // There is no meaningful chmod on Windows, and root can ignore permissions.
23362336
}

packages/shell-api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"devDependencies": {
6565
"@microsoft/api-extractor": "^7.39.3",
6666
"@mongodb-js/eslint-config-mongosh": "^1.0.0",
67-
"@mongodb-js/mongodb-ts-autocomplete": "^0.4.0",
67+
"@mongodb-js/mongodb-ts-autocomplete": "^0.4.1",
6868
"@mongodb-js/prettier-config-devtools": "^1.0.1",
6969
"@mongodb-js/tsconfig-mongosh": "^1.0.0",
7070
"@mongosh/types": "3.8.2",

packages/shell-api/src/integration.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3076,7 +3076,10 @@ describe('Shell API (integration)', function () {
30763076

30773077
describe('method tracking', function () {
30783078
it('emits an event when a deprecated method is called', async function () {
3079-
const deprecatedCall = once(instanceState.messageBus, 'mongosh:api-call');
3079+
const deprecatedCall = once(
3080+
instanceState.messageBus as any,
3081+
'mongosh:api-call'
3082+
);
30803083
try {
30813084
mongo.setSlaveOk();
30823085
expect.fail('Expected error');

0 commit comments

Comments
 (0)