Skip to content

chore: bump autocomplete, @types/node - #2492

Merged
lerouxb merged 5 commits into
mainfrom
bump-ts-autocomplete
Jun 30, 2025
Merged

chore: bump autocomplete, @types/node#2492
lerouxb merged 5 commits into
mainfrom
bump-ts-autocomplete

Conversation

@lerouxb

@lerouxb lerouxb commented Jun 30, 2025

Copy link
Copy Markdown
Member

This should fix the autocomplete debug output so it is more useful and hopefully make sure Typescript is seeing newer node types.

@lerouxb
lerouxb requested a review from a team as a code owner June 30, 2025 10:51
@lerouxb lerouxb added the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label Jun 30, 2025
Comment thread packages/cli-repl/src/mongosh-repl.ts Outdated
// we wait until it finally completes (which should happen immediately)
await Promise.race([
once(this.bus, 'mongosh:eval-interrupted'),
once(this.bus as any, 'mongosh:eval-interrupted'),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

                                                     ~~~~~~~~~~~~~~

src/mongosh-repl.ts:926:12 - error TS2769: No overload matches this call.
  Overload 1 of 2, '(emitter: EventEmitter<DefaultEventMap>, eventName: string | symbol, options?: StaticEventEmitterOptions | undefined): Promise<...>', gave the following error.
    Argument of type 'MongoshBus' is not assignable to parameter of type 'EventEmitter<DefaultEventMap>'.
      Type 'MongoshBus' is missing the following properties from type 'EventEmitter<DefaultEventMap>': addListener, removeListener, off, removeAllListeners, and 8 more.
  Overload 2 of 2, '(emitter: EventTarget, eventName: string, options?: StaticEventEmitterOptions | undefined): Promise<any[]>', gave the following error.
    Argument of type 'MongoshBus' is not assignable to parameter of type 'EventTarget'.
      Type 'MongoshBus' is missing the following properties from type 'EventTarget': addEventListener, dispatchEvent, removeEventListener

926       once(this.bus, 'mongosh:eval-interrupted'),
               ~~~~~~~~

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I know this is not ideal, just trying to get a build so I can test if I'm making progress towards autocomplete working.)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just go with

Suggested change
once(this.bus as any, 'mongosh:eval-interrupted'),
new Promise<void>((resolve) =>
this.bus.once('mongosh:eval-interrupted', resolve)
),

in this case, although it's a bit annoying that once() is typed this restrictively

if (
(stat.uid !== execPathStat.uid && stat.uid !== process.getuid()) ||
(stat.gid !== execPathStat.gid && stat.gid !== process.getgid()) ||
(stat.uid !== execPathStat.uid && stat.uid !== process.getuid?.()) ||

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


115     (stat.uid !== execPathStat.uid && stat.uid !== process.getuid()) ||
                                                       ~~~~~~~~~~~~~~

src/crypt-library-paths.ts:115:52 - error TS18048: 'process.getuid' is possibly 'undefined'.

115     (stat.uid !== execPathStat.uid && stat.uid !== process.getuid()) ||
                                                       ~~~~~~~~~~~~~~

src/crypt-library-paths.ts:116:52 - error TS2722: Cannot invoke an object which is possibly 'undefined'.

116     (stat.gid !== execPathStat.gid && stat.gid !== process.getgid()) ||
                                                       ~~~~~~~~~~~~~~

src/crypt-library-paths.ts:122:27 - error TS2722: Cannot invoke an object which is possibly 'undefined'.

122       currentUser: { uid: process.getuid(), gid: process.getgid() },
                              ~~~~~~~~~~~~~~

src/crypt-library-paths.ts:122:50 - error TS2722: Cannot invoke an object which is possibly 'undefined'.

122       currentUser: { uid: process.getuid(), gid: process.getgid() },

@addaleax addaleax left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One suggestion but otherwise LGTM

@lerouxb
lerouxb merged commit 12b6606 into main Jun 30, 2025
1 check passed
@lerouxb
lerouxb deleted the bump-ts-autocomplete branch June 30, 2025 14:23
@lerouxb
lerouxb restored the bump-ts-autocomplete branch July 1, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants