Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions configs/mocha-config-devtools/register/tsnode-register.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ require('ts-node').register({
},
});

// The require()-based register above only patches CommonJS module loading.
// For "type": "module" packages, Mocha loads spec files via dynamic import(),
// which goes through Node's own ESM loader. Newer Node versions natively
// strip TypeScript types but don't resolve `.js` specifiers to `.ts` files,
// so we also register ts-node's ESM loader hook to get NodeNext-style
// extension resolution for those packages.
{
const { register } = require('node:module');
const { pathToFileURL } = require('node:url');
register('ts-node/esm', pathToFileURL('./'));
}

// XXX: @cspotcode/source-map-support library used by ts-node internally causes
// issues when running tests in electron renderer environment due to webassembly
// module registering that it's trying to run going out of allowed size boundary
Expand Down
1,571 changes: 786 additions & 785 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions packages/mql-typescript/src/driverSchema/docs-crawler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class DocsCrawler {

private virtualConsole: VirtualConsole;

private fuzzyParse(json: string): unknown[] | undefined {
private async fuzzyParse(json: string): Promise<unknown[] | undefined> {
// Sometimes the snippet will end with ellipsis instead of json
json = json.replace(/\.\.\.$/g, '');

Expand All @@ -38,7 +38,7 @@ export class DocsCrawler {
);

try {
let result = parse(json, { mode: ParseMode.Loose });
let result = await parse(json, { mode: ParseMode.Loose });

if (!Array.isArray(result)) {
result = [result];
Expand Down Expand Up @@ -70,10 +70,10 @@ export class DocsCrawler {
}
}

private getInsertionCode(
private async getInsertionCode(
element: Element | null | undefined,
extendedSearch = false,
): { collectionName: string; documents: unknown[] } | undefined {
): Promise<{ collectionName: string; documents: unknown[] } | undefined> {
if (!element) {
return undefined;
}
Expand Down Expand Up @@ -112,7 +112,7 @@ export class DocsCrawler {
}
}

const documents = this.fuzzyParse(codeSnippet);
const documents = await this.fuzzyParse(codeSnippet);
if (documents) {
collectionName ??=
Array.from(element?.querySelectorAll('p') || [])
Expand All @@ -133,7 +133,7 @@ export class DocsCrawler {
element?.querySelector("a[href='#examples']") ??
element?.querySelector("a[href='#example']");
if (examples) {
return this.getInsertionCode(element, true);
return await this.getInsertionCode(element, true);
}
}

Expand All @@ -156,7 +156,7 @@ export class DocsCrawler {
.querySelector(`a[href='${fragment}']:not([target])`)
?.closest('section');

const insertionCode = this.getInsertionCode(exampleSection);
const insertionCode = await this.getInsertionCode(exampleSection);

if (!insertionCode) {
return;
Expand Down
2 changes: 1 addition & 1 deletion packages/oidc-http-server-pages/.depcheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ ignores:
- '@types/chai'
- 'sinon'
# this is required due to the compass-components package
Comment thread
mabaasit marked this conversation as resolved.
- 'mongodb-query-parser'
- '@mongodb-js/shell-bson-parser'
ignore-patterns:
- 'dist'
4 changes: 2 additions & 2 deletions packages/oidc-http-server-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,11 @@
},
"devDependencies": {
"@leafygreen-ui/emotion": "^5.2.0",
"@mongodb-js/compass-components": "^1.69.0",
"@mongodb-js/compass-components": "^1.70.1",
"@mongodb-js/eslint-config-devtools": "^0.11.13",
"@mongodb-js/mocha-config-devtools": "^2.0.2",
"@mongodb-js/prettier-config-devtools": "^1.0.6",
"@mongodb-js/shell-bson-parser": "1.6.3",
"@mongodb-js/tsconfig-devtools": "^1.1.5",
"@types/chai": "^4.2.21",
"@types/mocha": "^9.1.1",
Expand All @@ -67,7 +68,6 @@
"eslint": "^7.25.0 || ^8.0.0",
"gen-esm-wrapper": "^1.1.3",
"mocha": "^8.4.0",
"mongodb-query-parser": "^5.1.3",
"nyc": "^15.1.0",
"prettier": "^3.8.1",
"react": "^18.3.1",
Expand Down
7 changes: 0 additions & 7 deletions packages/query-parser/.depcheckrc

This file was deleted.

2 changes: 0 additions & 2 deletions packages/query-parser/.eslintignore

This file was deleted.

8 changes: 0 additions & 8 deletions packages/query-parser/.eslintrc.js

This file was deleted.

3 changes: 0 additions & 3 deletions packages/query-parser/.prettierignore

This file was deleted.

1 change: 0 additions & 1 deletion packages/query-parser/.prettierrc.json

This file was deleted.

201 changes: 0 additions & 201 deletions packages/query-parser/LICENSE

This file was deleted.

Loading
Loading