From 3de56119481d33c2623c6b577a17a9fd250b21f1 Mon Sep 17 00:00:00 2001 From: gagik Date: Thu, 13 Nov 2025 16:19:33 +0100 Subject: [PATCH 01/32] chore: turn the testing folder into a package --- package-lock.json | 38 +++++++++++++++++ packages/cli-repl/package.json | 3 +- packages/cli-repl/src/cli-repl.spec.ts | 6 +-- packages/cli-repl/src/smoke-tests.spec.ts | 2 +- .../scripts}/disable-dns-srv.js | 0 packages/connectivity-tests/test/atlas.sh | 2 +- packages/e2e-tests/package.json | 3 +- packages/e2e-tests/test/e2e-analytics.spec.ts | 3 +- packages/e2e-tests/test/e2e-auth.spec.ts | 6 +-- packages/e2e-tests/test/e2e-banners.spec.ts | 5 +-- packages/e2e-tests/test/e2e-bson.spec.ts | 2 +- packages/e2e-tests/test/e2e-direct.spec.ts | 4 +- packages/e2e-tests/test/e2e-editor.spec.ts | 2 +- packages/e2e-tests/test/e2e-fle.spec.ts | 7 ++-- packages/e2e-tests/test/e2e-oidc.spec.ts | 2 +- packages/e2e-tests/test/e2e-proxy.spec.ts | 2 +- packages/e2e-tests/test/e2e-snapshot.spec.ts | 5 +-- packages/e2e-tests/test/e2e-snippet.spec.ts | 2 +- packages/e2e-tests/test/e2e-streams.spec.ts | 2 +- packages/e2e-tests/test/e2e-tls.spec.ts | 2 +- packages/e2e-tests/test/e2e.spec.ts | 8 ++-- packages/e2e-tests/test/repl-helpers.ts | 2 +- packages/e2e-tests/test/test-shell.ts | 2 +- packages/java-shell/src/test/js/run-tests.ts | 2 +- .../node-runtime-worker-thread/package.json | 1 + .../src/index.spec.ts | 2 +- .../src/worker-runtime.spec.ts | 2 +- .../service-provider-node-driver/package.json | 3 +- .../node-driver-provider.integration.spec.ts | 5 +-- packages/shell-api/package.json | 1 + .../src/change-stream-cursor.spec.ts | 2 +- .../src/field-level-encryption.spec.ts | 5 +-- packages/shell-api/src/helpers.spec.ts | 2 +- packages/shell-api/src/integration.spec.ts | 2 +- packages/shell-api/src/mongo.spec.ts | 5 +-- packages/shell-api/src/replica-set.spec.ts | 6 +-- packages/shell-api/src/session.spec.ts | 2 +- packages/shell-api/src/shard.spec.ts | 2 +- packages/snippet-manager/package.json | 3 +- .../src/snippet-manager.spec.ts | 2 +- testing/.eslintrc.json | 9 ++++ testing/.gitignore | 2 + testing/.prettierrc | 1 + testing/README.md | 24 +++++++++++ testing/package.json | 41 ++++++++++++++++++- testing/{ => src}/eventually.ts | 0 testing/{ => src}/fake-kms.ts | 0 testing/src/index.ts | 3 ++ .../{ => src}/integration-testing-hooks.ts | 2 +- testing/tsconfig-lint.json | 4 ++ testing/tsconfig.json | 8 ++-- 51 files changed, 182 insertions(+), 69 deletions(-) rename {testing => packages/connectivity-tests/scripts}/disable-dns-srv.js (100%) create mode 100644 testing/.eslintrc.json create mode 100644 testing/.gitignore create mode 100644 testing/.prettierrc create mode 100644 testing/README.md rename testing/{ => src}/eventually.ts (100%) rename testing/{ => src}/fake-kms.ts (100%) create mode 100644 testing/src/index.ts rename testing/{ => src}/integration-testing-hooks.ts (99%) create mode 100644 testing/tsconfig-lint.json diff --git a/package-lock.json b/package-lock.json index c1a943708c..197f0fee94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7633,6 +7633,10 @@ "resolved": "packages/snippet-manager", "link": true }, + "node_modules/@mongosh/testing": { + "resolved": "testing", + "link": true + }, "node_modules/@mongosh/types": { "resolved": "packages/types", "link": true @@ -35771,6 +35775,7 @@ "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/sbom-tools": "^0.8.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongosh/testing": "0.0.0-dev.0", "@types/ansi-escape-sequences": "^4.0.0", "@types/chai-as-promised": "^7.1.3", "@types/js-yaml": "^4.0.5", @@ -35838,6 +35843,7 @@ "@mongodb-js/oidc-mock-provider": "^0.11.3", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongosh/testing": "0.0.0-dev.0", "@types/chai-as-promised": "^7.1.3", "@types/node": "^22.15.30", "@types/rimraf": "^3.0.0", @@ -36238,6 +36244,7 @@ "@mongosh/browser-runtime-electron": "^3.26.2", "@mongosh/service-provider-core": "3.6.3", "@mongosh/service-provider-node-driver": "^3.17.5", + "@mongosh/testing": "0.0.0-dev.0", "@mongosh/types": "^3.14.0", "bson": "^6.10.4", "depcheck": "^1.4.7", @@ -36295,6 +36302,7 @@ "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongosh/testing": "0.0.0-dev.0", "@types/sinon-chai": "^3.2.4", "depcheck": "^1.4.7", "eslint": "^7.25.0", @@ -36330,6 +36338,7 @@ "@mongodb-js/mongodb-ts-autocomplete": "^0.4.7", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongosh/testing": "0.0.0-dev.0", "@mongosh/types": "^3.14.0", "bson": "^6.10.4", "depcheck": "^1.4.7", @@ -36413,6 +36422,7 @@ "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongosh/testing": "0.0.0-dev.0", "@types/cross-spawn": "^6.0.6", "@types/tar": "^4.0.4", "depcheck": "^1.4.7", @@ -36464,6 +36474,34 @@ "engines": { "node": ">=12.4.0" } + }, + "testing": { + "name": "@mongosh/testing", + "version": "0.0.0-dev.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@mongosh/build": "3.7.8", + "duplexpair": "^1.0.2", + "mongodb": "^6.19.0", + "mongodb-connection-string-url": "^3.0.1", + "mongodb-runner": "^6.0.0", + "semver": "^7.3.4", + "which": "^2.0.2" + }, + "devDependencies": { + "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/prettier-config-devtools": "^1.0.1", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@types/semver": "^7.3.4", + "@types/which": "^1.3.2", + "eslint": "^7.25.0", + "prettier": "^2.8.8", + "typescript": "^5.3.3" + }, + "engines": { + "node": ">=14.15.1" + } } } } diff --git a/packages/cli-repl/package.json b/packages/cli-repl/package.json index 2bad45ae67..55e8b220f4 100644 --- a/packages/cli-repl/package.json +++ b/packages/cli-repl/package.json @@ -113,7 +113,8 @@ "eslint": "^7.25.0", "mongodb-crypt-library-dummy": "^1.0.2", "prettier": "^2.8.8", - "webpack-merge": "^5.8.0" + "webpack-merge": "^5.8.0", + "@mongosh/testing": "0.0.0-dev.0" }, "optionalDependencies": { "get-console-process-list": "^1.0.5", diff --git a/packages/cli-repl/src/cli-repl.spec.ts b/packages/cli-repl/src/cli-repl.spec.ts index 71321df7b9..0076fb0d00 100644 --- a/packages/cli-repl/src/cli-repl.spec.ts +++ b/packages/cli-repl/src/cli-repl.spec.ts @@ -8,13 +8,13 @@ import path from 'path'; import type { Duplex } from 'stream'; import { PassThrough } from 'stream'; import { promisify } from 'util'; -import { eventually } from '../../../testing/eventually'; -import type { MongodSetup } from '../../../testing/integration-testing-hooks'; import { + eventually, + type MongodSetup, skipIfServerVersion, startSharedTestServer, startTestServer, -} from '../../../testing/integration-testing-hooks'; +} from '@mongosh/testing'; import { expect, fakeTTYProps, diff --git a/packages/cli-repl/src/smoke-tests.spec.ts b/packages/cli-repl/src/smoke-tests.spec.ts index 68402b6251..08bc619b30 100644 --- a/packages/cli-repl/src/smoke-tests.spec.ts +++ b/packages/cli-repl/src/smoke-tests.spec.ts @@ -3,7 +3,7 @@ import path from 'path'; import { downloadCurrentCryptSharedLibrary, startSharedTestServer, -} from '../../../testing/integration-testing-hooks'; +} from '@mongosh/testing'; describe('smoke tests', function () { const testServer = startSharedTestServer(); diff --git a/testing/disable-dns-srv.js b/packages/connectivity-tests/scripts/disable-dns-srv.js similarity index 100% rename from testing/disable-dns-srv.js rename to packages/connectivity-tests/scripts/disable-dns-srv.js diff --git a/packages/connectivity-tests/test/atlas.sh b/packages/connectivity-tests/test/atlas.sh index 9a5387cfcc..d4f33ca1c4 100755 --- a/packages/connectivity-tests/test/atlas.sh +++ b/packages/connectivity-tests/test/atlas.sh @@ -136,7 +136,7 @@ function test_srv_without_nodejs_dns() { CONNECTION_STRING="mongodb+srv://${ATLAS_USERNAME}:${ATLAS_PASSWORD}@${ATLAS_HOSTNAME}/admin" - echo "${CONNECTION_STATUS_COMMAND}" | NODE_OPTIONS="-r ${MONGOSH_ROOT_DIR}/testing/disable-dns-srv.js" "${MONGOSH}" "${CONNECTION_STRING}" | + echo "${CONNECTION_STATUS_COMMAND}" | NODE_OPTIONS="-r ${MONGOSH_ROOT_DIR}/packages/connectivity-tests/scripts/disable-dns-srv.js" "${MONGOSH}" "${CONNECTION_STRING}" | grep -Fq "${CONNECTION_STATUS_CHECK_STRING}" || FAILED="Can't connect to Atlas using connection string without Node.js SRV/TXT DNS support" diff --git a/packages/e2e-tests/package.json b/packages/e2e-tests/package.json index 3ed31ae17c..b3b31d8719 100644 --- a/packages/e2e-tests/package.json +++ b/packages/e2e-tests/package.json @@ -50,6 +50,7 @@ "mongodb": "^6.19.0", "node-fetch": "^3.3.2", "prettier": "^2.8.8", - "rimraf": "^3.0.2" + "rimraf": "^3.0.2", + "@mongosh/testing": "0.0.0-dev.0" } } diff --git a/packages/e2e-tests/test/e2e-analytics.spec.ts b/packages/e2e-tests/test/e2e-analytics.spec.ts index e32bf15117..9ec901793b 100644 --- a/packages/e2e-tests/test/e2e-analytics.spec.ts +++ b/packages/e2e-tests/test/e2e-analytics.spec.ts @@ -1,6 +1,5 @@ import { expect } from 'chai'; -import { startTestCluster } from '../../../testing/integration-testing-hooks'; -import { eventually } from '../../../testing/eventually'; +import { startTestCluster, eventually } from '@mongosh/testing'; describe('e2e Analytics Node', function () { const replSetName = 'replicaSet'; diff --git a/packages/e2e-tests/test/e2e-auth.spec.ts b/packages/e2e-tests/test/e2e-auth.spec.ts index 12773ed134..1394c1849c 100644 --- a/packages/e2e-tests/test/e2e-auth.spec.ts +++ b/packages/e2e-tests/test/e2e-auth.spec.ts @@ -1,12 +1,12 @@ import { expect } from 'chai'; import type { Db, Document, MongoClientOptions } from 'mongodb'; import { MongoClient } from 'mongodb'; -import { eventually } from '../../../testing/eventually'; -import type { TestShell } from './test-shell'; import { + eventually, skipIfApiStrict, startSharedTestServer, -} from '../../../testing/integration-testing-hooks'; +} from '@mongosh/testing'; +import type { TestShell } from './test-shell'; type AssertUserExists = (opts?: Document, username?: string) => Promise; function createAssertUserExists(db: Db, dbName: string): AssertUserExists { diff --git a/packages/e2e-tests/test/e2e-banners.spec.ts b/packages/e2e-tests/test/e2e-banners.spec.ts index 14929f1bff..c9f6412e7c 100644 --- a/packages/e2e-tests/test/e2e-banners.spec.ts +++ b/packages/e2e-tests/test/e2e-banners.spec.ts @@ -1,7 +1,4 @@ -import { - skipIfApiStrict, - startSharedTestServer, -} from '../../../testing/integration-testing-hooks'; +import { skipIfApiStrict, startSharedTestServer } from '@mongosh/testing'; import type { TestShell } from './test-shell'; describe('e2e startup banners', function () { diff --git a/packages/e2e-tests/test/e2e-bson.spec.ts b/packages/e2e-tests/test/e2e-bson.spec.ts index 2299bc4683..822b638c98 100644 --- a/packages/e2e-tests/test/e2e-bson.spec.ts +++ b/packages/e2e-tests/test/e2e-bson.spec.ts @@ -3,7 +3,7 @@ import type { Db } from 'mongodb'; import { MongoClient } from 'mongodb'; import * as bson from 'bson'; import type { TestShell } from './test-shell'; -import { startSharedTestServer } from '../../../testing/integration-testing-hooks'; +import { startSharedTestServer } from '@mongosh/testing'; describe('BSON e2e', function () { const testServer = startSharedTestServer(); diff --git a/packages/e2e-tests/test/e2e-direct.spec.ts b/packages/e2e-tests/test/e2e-direct.spec.ts index 46a0306607..c7d652dbf3 100644 --- a/packages/e2e-tests/test/e2e-direct.spec.ts +++ b/packages/e2e-tests/test/e2e-direct.spec.ts @@ -2,8 +2,8 @@ import { startTestCluster, skipIfServerVersion, skipIfApiStrict, -} from '../../../testing/integration-testing-hooks'; -import { eventually } from '../../../testing/eventually'; + eventually, +} from '@mongosh/testing'; import { expect } from 'chai'; import type { TestShell } from './test-shell'; diff --git a/packages/e2e-tests/test/e2e-editor.spec.ts b/packages/e2e-tests/test/e2e-editor.spec.ts index ac6abb2fb9..a11239bb7f 100644 --- a/packages/e2e-tests/test/e2e-editor.spec.ts +++ b/packages/e2e-tests/test/e2e-editor.spec.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; import path from 'path'; import { promises as fs } from 'fs'; -import { eventually } from '../../../testing/eventually'; +import { eventually } from '@mongosh/testing'; import { TestShell } from './test-shell'; import { ensureTestShellAfterHook } from './test-shell-context'; import { diff --git a/packages/e2e-tests/test/e2e-fle.spec.ts b/packages/e2e-tests/test/e2e-fle.spec.ts index ae86e55d3f..6666b7014d 100644 --- a/packages/e2e-tests/test/e2e-fle.spec.ts +++ b/packages/e2e-tests/test/e2e-fle.spec.ts @@ -1,16 +1,17 @@ import { expect } from 'chai'; import { MongoClient } from 'mongodb'; import type { TestShell } from './test-shell'; -import { eventually } from '../../../testing/eventually'; import { + eventually, startTestServer, skipIfApiStrict, skipIfServerVersion, skipIfCommunityServer, downloadCurrentCryptSharedLibrary, sortObjectArray, -} from '../../../testing/integration-testing-hooks'; -import { makeFakeHTTPServer, fakeAWSHandlers } from '../../../testing/fake-kms'; + makeFakeHTTPServer, + fakeAWSHandlers, +} from '@mongosh/testing'; import { once } from 'events'; import { serialize } from 'v8'; import { inspect } from 'util'; diff --git a/packages/e2e-tests/test/e2e-oidc.spec.ts b/packages/e2e-tests/test/e2e-oidc.spec.ts index 08935926ca..673f6955eb 100644 --- a/packages/e2e-tests/test/e2e-oidc.spec.ts +++ b/packages/e2e-tests/test/e2e-oidc.spec.ts @@ -2,7 +2,7 @@ import { MongoRunnerSetup, skipIfApiStrict, skipIfEnvServerVersion, -} from '../../../testing/integration-testing-hooks'; +} from '@mongosh/testing'; import { promises as fs } from 'fs'; import type { OIDCMockProviderConfig } from '@mongodb-js/oidc-mock-provider'; import { OIDCMockProvider } from '@mongodb-js/oidc-mock-provider'; diff --git a/packages/e2e-tests/test/e2e-proxy.spec.ts b/packages/e2e-tests/test/e2e-proxy.spec.ts index b9afc836d7..f827307984 100644 --- a/packages/e2e-tests/test/e2e-proxy.spec.ts +++ b/packages/e2e-tests/test/e2e-proxy.spec.ts @@ -10,7 +10,7 @@ import { skipIfEnvServerVersion, startSharedTestServer, startTestServer, -} from '../../../testing/integration-testing-hooks'; +} from '@mongosh/testing'; import type { Server as HTTPSServer } from 'https'; import { createServer as createHTTPSServer } from 'https'; import { diff --git a/packages/e2e-tests/test/e2e-snapshot.spec.ts b/packages/e2e-tests/test/e2e-snapshot.spec.ts index fb57cc798c..201fa26a97 100644 --- a/packages/e2e-tests/test/e2e-snapshot.spec.ts +++ b/packages/e2e-tests/test/e2e-snapshot.spec.ts @@ -1,7 +1,4 @@ -import { - skipIfApiStrict, - startSharedTestServer, -} from '../../../testing/integration-testing-hooks'; +import { skipIfApiStrict, startSharedTestServer } from '@mongosh/testing'; import { expect } from 'chai'; const setDifference = (a: T[], b: T[]) => a.filter((e) => !b.includes(e)); diff --git a/packages/e2e-tests/test/e2e-snippet.spec.ts b/packages/e2e-tests/test/e2e-snippet.spec.ts index bf4a843073..58a7427568 100644 --- a/packages/e2e-tests/test/e2e-snippet.spec.ts +++ b/packages/e2e-tests/test/e2e-snippet.spec.ts @@ -3,7 +3,7 @@ import path from 'path'; import { expect } from 'chai'; import type { TestShell } from './test-shell'; import { useTmpdir } from './repl-helpers'; -import { eventually } from '../../../testing/eventually'; +import { eventually } from '@mongosh/testing'; describe('snippet integration tests', function () { this.timeout(120_000); diff --git a/packages/e2e-tests/test/e2e-streams.spec.ts b/packages/e2e-tests/test/e2e-streams.spec.ts index 9f6efd8dbb..1ec70cb269 100644 --- a/packages/e2e-tests/test/e2e-streams.spec.ts +++ b/packages/e2e-tests/test/e2e-streams.spec.ts @@ -4,7 +4,7 @@ import { MongoClient } from 'mongodb'; import { expect } from 'chai'; import type { TestShell } from './test-shell'; import { sleep } from './util-helpers'; -import { eventually } from '../../../testing/eventually'; +import { eventually } from '@mongosh/testing'; const { STREAMS_E2E_SPI_CONNECTION_STRING = '', diff --git a/packages/e2e-tests/test/e2e-tls.spec.ts b/packages/e2e-tests/test/e2e-tls.spec.ts index da68f80cc0..351fea3ddd 100644 --- a/packages/e2e-tests/test/e2e-tls.spec.ts +++ b/packages/e2e-tests/test/e2e-tls.spec.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { promises as fs } from 'fs'; import path from 'path'; -import { startTestServer } from '../../../testing/integration-testing-hooks'; +import { startTestServer } from '@mongosh/testing'; import { useTmpdir, setTemporaryHomeDirectory, diff --git a/packages/e2e-tests/test/e2e.spec.ts b/packages/e2e-tests/test/e2e.spec.ts index c6029f2480..b83bb0a70b 100644 --- a/packages/e2e-tests/test/e2e.spec.ts +++ b/packages/e2e-tests/test/e2e.spec.ts @@ -3,13 +3,13 @@ import { expect } from 'chai'; import type { Db } from 'mongodb'; import { MongoClient, ObjectId } from 'mongodb'; -import { eventually } from '../../../testing/eventually'; -import { TestShell } from './test-shell'; -import { ensureTestShellAfterHook } from './test-shell-context'; import { + eventually, skipIfServerVersion, startSharedTestServer, -} from '../../../testing/integration-testing-hooks'; +} from '@mongosh/testing'; +import { TestShell } from './test-shell'; +import { ensureTestShellAfterHook } from './test-shell-context'; import { promises as fs, createReadStream } from 'fs'; import { promisify } from 'util'; import path from 'path'; diff --git a/packages/e2e-tests/test/repl-helpers.ts b/packages/e2e-tests/test/repl-helpers.ts index 46c67371d7..0035465bf7 100644 --- a/packages/e2e-tests/test/repl-helpers.ts +++ b/packages/e2e-tests/test/repl-helpers.ts @@ -5,7 +5,7 @@ import rimraf from 'rimraf'; import chai from 'chai'; import sinonChai from 'sinon-chai'; import chaiAsPromised from 'chai-as-promised'; -import type { MongodSetup } from '../../../testing/integration-testing-hooks'; +import type { MongodSetup } from '@mongosh/testing'; import type { MongoLogEntry } from 'mongodb-log-writer'; chai.use(sinonChai); diff --git a/packages/e2e-tests/test/test-shell.ts b/packages/e2e-tests/test/test-shell.ts index f3a310ae2e..7613c5d713 100644 --- a/packages/e2e-tests/test/test-shell.ts +++ b/packages/e2e-tests/test/test-shell.ts @@ -9,7 +9,7 @@ import { inspect } from 'util'; import path from 'path'; import stripAnsi from 'strip-ansi'; import { EJSON } from 'bson'; -import { eventually } from '../../../testing/eventually'; +import { eventually } from '@mongosh/testing'; /* eslint-disable mocha/no-exports -- This file export hooks wrapping Mocha's Hooks APIs */ diff --git a/packages/java-shell/src/test/js/run-tests.ts b/packages/java-shell/src/test/js/run-tests.ts index ccbfa02a03..6de0f39278 100644 --- a/packages/java-shell/src/test/js/run-tests.ts +++ b/packages/java-shell/src/test/js/run-tests.ts @@ -1,7 +1,7 @@ import { spawn } from 'child_process'; import path from 'path'; import { once } from 'events'; -import { startSharedTestServer } from '../../../../../testing/integration-testing-hooks'; +import { startSharedTestServer } from '@mongosh/testing'; describe('java-shell tests', function() { this.timeout(1_000_000); diff --git a/packages/node-runtime-worker-thread/package.json b/packages/node-runtime-worker-thread/package.json index 35991756f5..8533f051e6 100644 --- a/packages/node-runtime-worker-thread/package.json +++ b/packages/node-runtime-worker-thread/package.json @@ -39,6 +39,7 @@ "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/sbom-tools": "^0.8.1", + "@mongosh/testing": "0.0.0-dev.0", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/browser-runtime-core": "^3.26.2", "@mongosh/browser-runtime-electron": "^3.26.2", diff --git a/packages/node-runtime-worker-thread/src/index.spec.ts b/packages/node-runtime-worker-thread/src/index.spec.ts index 88b626c03f..d4593f3e7f 100644 --- a/packages/node-runtime-worker-thread/src/index.spec.ts +++ b/packages/node-runtime-worker-thread/src/index.spec.ts @@ -2,7 +2,7 @@ import chai, { expect } from 'chai'; import sinon from 'sinon'; import sinonChai from 'sinon-chai'; import type { MongoshBus } from '@mongosh/types'; -import { startSharedTestServer } from '../../../testing/integration-testing-hooks'; +import { startSharedTestServer } from '@mongosh/testing'; import { WorkerRuntime } from '../dist/index'; import type { DevtoolsConnectOptions } from '@mongosh/service-provider-node-driver'; diff --git a/packages/node-runtime-worker-thread/src/worker-runtime.spec.ts b/packages/node-runtime-worker-thread/src/worker-runtime.spec.ts index 261a4fcff1..24df3a596e 100644 --- a/packages/node-runtime-worker-thread/src/worker-runtime.spec.ts +++ b/packages/node-runtime-worker-thread/src/worker-runtime.spec.ts @@ -5,7 +5,7 @@ import chai, { expect } from 'chai'; import sinonChai from 'sinon-chai'; import sinon from 'sinon'; import { EJSON, ObjectId } from 'bson'; -import { startSharedTestServer } from '../../../testing/integration-testing-hooks'; +import { startSharedTestServer } from '@mongosh/testing'; import type { Caller, Exposed } from './rpc'; import { cancel, close, createCaller, exposeAll } from './rpc'; import { deserializeEvaluationResult } from './serializer'; diff --git a/packages/service-provider-node-driver/package.json b/packages/service-provider-node-driver/package.json index 04d16118fd..63c3f29947 100644 --- a/packages/service-provider-node-driver/package.json +++ b/packages/service-provider-node-driver/package.json @@ -71,6 +71,7 @@ "@types/sinon-chai": "^3.2.4", "depcheck": "^1.4.7", "eslint": "^7.25.0", - "prettier": "^2.8.8" + "prettier": "^2.8.8", + "@mongosh/testing": "0.0.0-dev.0" } } diff --git a/packages/service-provider-node-driver/src/node-driver-provider.integration.spec.ts b/packages/service-provider-node-driver/src/node-driver-provider.integration.spec.ts index 327f776ef7..27925ec4b8 100644 --- a/packages/service-provider-node-driver/src/node-driver-provider.integration.spec.ts +++ b/packages/service-provider-node-driver/src/node-driver-provider.integration.spec.ts @@ -15,10 +15,7 @@ import type { InsertOneResult, UpdateResult, } from 'mongodb'; -import { - skipIfServerVersion, - startSharedTestServer, -} from '../../../testing/integration-testing-hooks'; +import { skipIfServerVersion, startSharedTestServer } from '@mongosh/testing'; import type { DbOptions, MongoClientOptions, diff --git a/packages/shell-api/package.json b/packages/shell-api/package.json index 87c787e028..56c2830a55 100644 --- a/packages/shell-api/package.json +++ b/packages/shell-api/package.json @@ -64,6 +64,7 @@ }, "devDependencies": { "@microsoft/api-extractor": "^7.39.3", + "@mongosh/testing": "0.0.0-dev.0", "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/mongodb-ts-autocomplete": "^0.4.7", "@mongodb-js/prettier-config-devtools": "^1.0.1", diff --git a/packages/shell-api/src/change-stream-cursor.spec.ts b/packages/shell-api/src/change-stream-cursor.spec.ts index 329ff9ec78..0a992da1eb 100644 --- a/packages/shell-api/src/change-stream-cursor.spec.ts +++ b/packages/shell-api/src/change-stream-cursor.spec.ts @@ -12,7 +12,7 @@ import { ALL_API_VERSIONS, } from './enums'; import type { ChangeStream, Document } from '@mongosh/service-provider-core'; -import { startTestCluster } from '../../../testing/integration-testing-hooks'; +import { startTestCluster } from '@mongosh/testing'; import { NodeDriverServiceProvider } from '../../service-provider-node-driver'; import ShellInstanceState from './shell-instance-state'; import Mongo from './mongo'; diff --git a/packages/shell-api/src/field-level-encryption.spec.ts b/packages/shell-api/src/field-level-encryption.spec.ts index f892dee6fd..f47073a7db 100644 --- a/packages/shell-api/src/field-level-encryption.spec.ts +++ b/packages/shell-api/src/field-level-encryption.spec.ts @@ -29,11 +29,11 @@ import { ClientEncryption, KeyVault } from './field-level-encryption'; import Mongo from './mongo'; import ShellInstanceState from './shell-instance-state'; import { NodeDriverServiceProvider } from '../../service-provider-node-driver'; -import { startSharedTestServer } from '../../../testing/integration-testing-hooks'; import { + startSharedTestServer, makeFakeHTTPConnection, fakeAWSHandlers, -} from '../../../testing/fake-kms'; +} from '@mongosh/testing'; import { Collection } from './collection'; import { dummyOptions } from './helpers.spec'; import type { IncomingMessage } from 'http'; @@ -962,7 +962,6 @@ srDVjIT3LsvTqw==`, return; } expect.fail('missed exception'); - break; default: throw new Error(`unreachable ${kmsName}`); } diff --git a/packages/shell-api/src/helpers.spec.ts b/packages/shell-api/src/helpers.spec.ts index 533056e125..eecb36b76c 100644 --- a/packages/shell-api/src/helpers.spec.ts +++ b/packages/shell-api/src/helpers.spec.ts @@ -14,7 +14,7 @@ import type { ServiceProvider } from '@mongosh/service-provider-core'; import * as bson from 'bson'; import type { DevtoolsConnectOptions } from '../../service-provider-node-driver'; import { NodeDriverServiceProvider } from '../../service-provider-node-driver'; // avoid cyclic dep just for test -import { startSharedTestServer } from '../../../testing/integration-testing-hooks'; +import { startSharedTestServer } from '@mongosh/testing'; import { makeFakeConfigDatabase } from '../test/shard-test-fake-data'; import sinon from 'ts-sinon'; import chai, { expect } from 'chai'; diff --git a/packages/shell-api/src/integration.spec.ts b/packages/shell-api/src/integration.spec.ts index 2b6e50a1bf..6ef995c8e7 100644 --- a/packages/shell-api/src/integration.spec.ts +++ b/packages/shell-api/src/integration.spec.ts @@ -9,7 +9,7 @@ import { skipIfServerVersion, skipIfApiStrict, startSharedTestServer, -} from '../../../testing/integration-testing-hooks'; +} from '@mongosh/testing'; import type { ShellApi, Mongo } from './index'; import { toShellResult, Topologies } from './index'; import type { diff --git a/packages/shell-api/src/mongo.spec.ts b/packages/shell-api/src/mongo.spec.ts index 01cbb9fd8e..26bfa75e8b 100644 --- a/packages/shell-api/src/mongo.spec.ts +++ b/packages/shell-api/src/mongo.spec.ts @@ -30,10 +30,7 @@ import { MongoshUnimplementedError, } from '@mongosh/errors'; import { NodeDriverServiceProvider } from '../../service-provider-node-driver'; -import { - skipIfServerVersion, - startSharedTestServer, -} from '../../../testing/integration-testing-hooks'; +import { skipIfServerVersion, startSharedTestServer } from '@mongosh/testing'; import { dummyOptions } from './helpers.spec'; import { ClientBulkWriteResult } from './result'; diff --git a/packages/shell-api/src/replica-set.spec.ts b/packages/shell-api/src/replica-set.spec.ts index c50a98f462..99603add48 100644 --- a/packages/shell-api/src/replica-set.spec.ts +++ b/packages/shell-api/src/replica-set.spec.ts @@ -16,12 +16,13 @@ import sinonChai from 'sinon-chai'; import type { StubbedInstance } from 'ts-sinon'; import { stubInterface } from 'ts-sinon'; import { createRetriableMethod, ensureMaster } from '../test/helpers'; -import type { MongodSetup } from '../../../testing/integration-testing-hooks'; import { + type MongodSetup, skipIfServerVersion, startTestCluster, skipIfApiStrict, -} from '../../../testing/integration-testing-hooks'; + eventually, +} from '@mongosh/testing'; import { NodeDriverServiceProvider } from '../../service-provider-node-driver'; import { Database } from './database'; import { @@ -38,7 +39,6 @@ import type { ReplSetConfig, ReplSetMemberConfig } from './replica-set'; import ReplicaSet from './replica-set'; import type { EvaluationListener } from './shell-instance-state'; import ShellInstanceState from './shell-instance-state'; -import { eventually } from '../../../testing/eventually'; chai.use(sinonChai); function deepClone(value: T): T { diff --git a/packages/shell-api/src/session.spec.ts b/packages/shell-api/src/session.spec.ts index d1846dc237..68c4478c8f 100644 --- a/packages/shell-api/src/session.spec.ts +++ b/packages/shell-api/src/session.spec.ts @@ -23,7 +23,7 @@ import { startTestCluster, skipIfServerVersion, skipIfApiStrict, -} from '../../../testing/integration-testing-hooks'; +} from '@mongosh/testing'; import { ensureMaster, ensureSessionExists } from '../test/helpers'; import { Database } from './database'; import { CommonErrors, MongoshInvalidInputError } from '@mongosh/errors'; diff --git a/packages/shell-api/src/shard.spec.ts b/packages/shell-api/src/shard.spec.ts index c52edc91df..b63a03797d 100644 --- a/packages/shell-api/src/shard.spec.ts +++ b/packages/shell-api/src/shard.spec.ts @@ -28,7 +28,7 @@ import { startTestCluster, skipIfServerVersion, skipIfApiStrict, -} from '../../../testing/integration-testing-hooks'; +} from '@mongosh/testing'; import type { DatabaseWithSchema } from './database'; import { Database } from './database'; import { inspect } from 'util'; diff --git a/packages/snippet-manager/package.json b/packages/snippet-manager/package.json index 616438af34..bc57e60ed5 100644 --- a/packages/snippet-manager/package.json +++ b/packages/snippet-manager/package.json @@ -54,6 +54,7 @@ "depcheck": "^1.4.7", "eslint": "^7.25.0", "nanobus": "^4.5.0", - "prettier": "^2.8.8" + "prettier": "^2.8.8", + "@mongosh/testing": "0.0.0-dev.0" } } diff --git a/packages/snippet-manager/src/snippet-manager.spec.ts b/packages/snippet-manager/src/snippet-manager.spec.ts index 03a8d85a42..53e69b518c 100644 --- a/packages/snippet-manager/src/snippet-manager.spec.ts +++ b/packages/snippet-manager/src/snippet-manager.spec.ts @@ -13,7 +13,7 @@ import bson from 'bson'; import path from 'path'; import { promises as fs, createReadStream } from 'fs'; import Nanobus from 'nanobus'; -import { eventually } from '../../../testing/eventually'; +import { eventually } from '@mongosh/testing'; chai.use(sinonChai); describe('SnippetManager', function () { diff --git a/testing/.eslintrc.json b/testing/.eslintrc.json new file mode 100644 index 0000000000..e548c12df1 --- /dev/null +++ b/testing/.eslintrc.json @@ -0,0 +1,9 @@ +{ + "extends": "@mongodb-js/eslint-config-mongosh", + "parserOptions": { + "project": ["./tsconfig-lint.json"] + }, + "rules": { + "mocha/no-exports": "off" + } +} diff --git a/testing/.gitignore b/testing/.gitignore new file mode 100644 index 0000000000..59a1892526 --- /dev/null +++ b/testing/.gitignore @@ -0,0 +1,2 @@ +lib/ + diff --git a/testing/.prettierrc b/testing/.prettierrc new file mode 100644 index 0000000000..dfae21d047 --- /dev/null +++ b/testing/.prettierrc @@ -0,0 +1 @@ +"@mongodb-js/prettier-config-devtools" diff --git a/testing/README.md b/testing/README.md new file mode 100644 index 0000000000..164e1bc172 --- /dev/null +++ b/testing/README.md @@ -0,0 +1,24 @@ +# @mongosh/testing + +Internal testing utilities for mongosh packages. This package is only used for testing purposes within the mongosh monorepo. + +## Contents + +- **integration-testing-hooks.ts** - Test server setup and helpers for integration tests +- **eventually.ts** - Retry helper for asynchronous tests +- **fake-kms.ts** - Mock KMS server for field-level encryption tests + +## Usage + +```typescript +import { + startSharedTestServer, + startTestServer, + eventually, + makeFakeHTTPServer, +} from '@mongosh/testing'; +``` + +## Note + +This package is marked as private and will not be published to npm. diff --git a/testing/package.json b/testing/package.json index bf20e826b5..2450280cf1 100644 --- a/testing/package.json +++ b/testing/package.json @@ -1,6 +1,43 @@ { + "name": "@mongosh/testing", + "version": "0.0.0-dev.0", + "description": "MongoDB Shell Testing Utilities (internal use only)", + "homepage": "https://github.com/mongodb-js/mongosh", + "license": "Apache-2.0", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "private": true, + "repository": { + "type": "git", + "url": "https://github.com/mongodb-js/mongosh" + }, + "engines": { + "node": ">=14.15.1" + }, "scripts": { - "lint": "prettier --check .", - "reformat": "prettier --write ." + "compile": "tsc -p tsconfig.json", + "eslint": "eslint", + "lint": "npm run eslint . && npm run prettier -- --check .", + "prettier": "prettier", + "reformat": "npm run prettier -- --write . && npm run eslint -- --fix" + }, + "dependencies": { + "@mongosh/build": "3.7.8", + "duplexpair": "^1.0.2", + "mongodb": "^6.19.0", + "mongodb-connection-string-url": "^3.0.1", + "mongodb-runner": "^6.0.0", + "semver": "^7.3.4", + "which": "^2.0.2" + }, + "devDependencies": { + "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/prettier-config-devtools": "^1.0.1", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@types/semver": "^7.3.4", + "@types/which": "^1.3.2", + "eslint": "^7.25.0", + "prettier": "^2.8.8", + "typescript": "^5.3.3" } } diff --git a/testing/eventually.ts b/testing/src/eventually.ts similarity index 100% rename from testing/eventually.ts rename to testing/src/eventually.ts diff --git a/testing/fake-kms.ts b/testing/src/fake-kms.ts similarity index 100% rename from testing/fake-kms.ts rename to testing/src/fake-kms.ts diff --git a/testing/src/index.ts b/testing/src/index.ts new file mode 100644 index 0000000000..012b9fe339 --- /dev/null +++ b/testing/src/index.ts @@ -0,0 +1,3 @@ +export * from './integration-testing-hooks'; +export * from './eventually'; +export * from './fake-kms'; diff --git a/testing/integration-testing-hooks.ts b/testing/src/integration-testing-hooks.ts similarity index 99% rename from testing/integration-testing-hooks.ts rename to testing/src/integration-testing-hooks.ts index 7f229cdf18..ad6186fc21 100644 --- a/testing/integration-testing-hooks.ts +++ b/testing/src/integration-testing-hooks.ts @@ -14,7 +14,7 @@ const execFile = promisify(child_process.execFile); // Return the path to the temporary directory and ensure that it exists. async function getTmpdir(): Promise { - const tmpdir = path.resolve(__dirname, '..', 'tmp'); + const tmpdir = path.resolve(__dirname, '..', '..', 'tmp'); await fs.mkdir(tmpdir, { recursive: true }); return tmpdir; } diff --git a/testing/tsconfig-lint.json b/testing/tsconfig-lint.json new file mode 100644 index 0000000000..49467c9152 --- /dev/null +++ b/testing/tsconfig-lint.json @@ -0,0 +1,4 @@ +{ + "extends": "@mongodb-js/tsconfig-mongosh/tsconfig.lint.json", + "include": ["src/**/*"] +} diff --git a/testing/tsconfig.json b/testing/tsconfig.json index c76dbd55aa..53bf421d6c 100644 --- a/testing/tsconfig.json +++ b/testing/tsconfig.json @@ -2,8 +2,10 @@ "extends": "@mongodb-js/tsconfig-mongosh/tsconfig.common.json", "compilerOptions": { "allowJs": true, - "outDir": "./dist" + "outDir": "./lib", + "declaration": true, + "declarationMap": true }, - "include": ["**/*"], - "exclude": ["certificates"] + "include": ["src/**/*"], + "exclude": ["certificates", "lib"] } From c22d196b666d85a3e7c612556856203e85ec19ac Mon Sep 17 00:00:00 2001 From: gagik Date: Thu, 13 Nov 2025 20:20:53 +0100 Subject: [PATCH 02/32] chore: move testing folder to packages --- package.json | 1 + {testing => packages/testing}/.eslintrc.js | 0 {testing => packages/testing}/.eslintrc.json | 0 {testing => packages/testing}/.gitignore | 0 {testing => packages/testing}/.prettierrc | 0 {testing => packages/testing}/.prettierrc.json | 0 {testing => packages/testing}/README.md | 0 .../testing}/certificates/README.md | 0 .../testing}/certificates/ca-server.crl | 0 {testing => packages/testing}/certificates/ca.cnf | 0 {testing => packages/testing}/certificates/ca.crt | 0 {testing => packages/testing}/certificates/ca.db | 0 .../testing}/certificates/ca.db.attr | 0 {testing => packages/testing}/certificates/ca.key | 0 .../testing}/certificates/ca.serial | 0 .../certificates/client.bundle.encrypted.pem | 0 .../testing}/certificates/client.bundle.pem | 0 .../testing}/certificates/client.bundle.pfx | Bin .../testing}/certificates/client.encrypted.key | 0 .../testing}/certificates/client.key | 0 .../testing}/certificates/client.pem | 0 .../testing}/certificates/invalid-client.bundle.pem | 0 .../testing}/certificates/invalid-client.key | 0 .../testing}/certificates/non-ca.crt | 0 .../testing}/certificates/non-ca.key | 0 .../certificates/partial-trust-chain/ca.pem | 0 .../certificates/partial-trust-chain/cert.pem | 0 .../partial-trust-chain/key-and-cert.pem | 0 .../certificates/partial-trust-chain/key.pem | 0 .../certificates/server-invalidhost.bundle.pem | 0 .../testing}/certificates/server-invalidhost.key | 0 .../testing}/certificates/server.bundle.pem | 0 .../testing}/certificates/server.key | 0 {testing => packages/testing}/package.json | 0 {testing => packages/testing}/src/eventually.ts | 0 {testing => packages/testing}/src/fake-kms.ts | 0 {testing => packages/testing}/src/index.ts | 0 .../testing}/src/integration-testing-hooks.ts | 0 {testing => packages/testing}/test-vscode.sh | 0 .../testing}/tests-globalconfig.conf | 0 {testing => packages/testing}/tsconfig-lint.json | 0 {testing => packages/testing}/tsconfig.json | 0 42 files changed, 1 insertion(+) rename {testing => packages/testing}/.eslintrc.js (100%) rename {testing => packages/testing}/.eslintrc.json (100%) rename {testing => packages/testing}/.gitignore (100%) rename {testing => packages/testing}/.prettierrc (100%) rename {testing => packages/testing}/.prettierrc.json (100%) rename {testing => packages/testing}/README.md (100%) rename {testing => packages/testing}/certificates/README.md (100%) rename {testing => packages/testing}/certificates/ca-server.crl (100%) rename {testing => packages/testing}/certificates/ca.cnf (100%) rename {testing => packages/testing}/certificates/ca.crt (100%) rename {testing => packages/testing}/certificates/ca.db (100%) rename {testing => packages/testing}/certificates/ca.db.attr (100%) rename {testing => packages/testing}/certificates/ca.key (100%) rename {testing => packages/testing}/certificates/ca.serial (100%) rename {testing => packages/testing}/certificates/client.bundle.encrypted.pem (100%) rename {testing => packages/testing}/certificates/client.bundle.pem (100%) rename {testing => packages/testing}/certificates/client.bundle.pfx (100%) rename {testing => packages/testing}/certificates/client.encrypted.key (100%) rename {testing => packages/testing}/certificates/client.key (100%) rename {testing => packages/testing}/certificates/client.pem (100%) rename {testing => packages/testing}/certificates/invalid-client.bundle.pem (100%) rename {testing => packages/testing}/certificates/invalid-client.key (100%) rename {testing => packages/testing}/certificates/non-ca.crt (100%) rename {testing => packages/testing}/certificates/non-ca.key (100%) rename {testing => packages/testing}/certificates/partial-trust-chain/ca.pem (100%) rename {testing => packages/testing}/certificates/partial-trust-chain/cert.pem (100%) rename {testing => packages/testing}/certificates/partial-trust-chain/key-and-cert.pem (100%) rename {testing => packages/testing}/certificates/partial-trust-chain/key.pem (100%) rename {testing => packages/testing}/certificates/server-invalidhost.bundle.pem (100%) rename {testing => packages/testing}/certificates/server-invalidhost.key (100%) rename {testing => packages/testing}/certificates/server.bundle.pem (100%) rename {testing => packages/testing}/certificates/server.key (100%) rename {testing => packages/testing}/package.json (100%) rename {testing => packages/testing}/src/eventually.ts (100%) rename {testing => packages/testing}/src/fake-kms.ts (100%) rename {testing => packages/testing}/src/index.ts (100%) rename {testing => packages/testing}/src/integration-testing-hooks.ts (100%) rename {testing => packages/testing}/test-vscode.sh (100%) rename {testing => packages/testing}/tests-globalconfig.conf (100%) rename {testing => packages/testing}/tsconfig-lint.json (100%) rename {testing => packages/testing}/tsconfig.json (100%) diff --git a/package.json b/package.json index a7b666ea7d..9df364227d 100644 --- a/package.json +++ b/package.json @@ -153,6 +153,7 @@ "packages/i18n", "packages/logging", "packages/shell-bson", + "packages/testing", "packages/arg-parser", "packages/service-provider-core", "packages/service-provider-node-driver", diff --git a/testing/.eslintrc.js b/packages/testing/.eslintrc.js similarity index 100% rename from testing/.eslintrc.js rename to packages/testing/.eslintrc.js diff --git a/testing/.eslintrc.json b/packages/testing/.eslintrc.json similarity index 100% rename from testing/.eslintrc.json rename to packages/testing/.eslintrc.json diff --git a/testing/.gitignore b/packages/testing/.gitignore similarity index 100% rename from testing/.gitignore rename to packages/testing/.gitignore diff --git a/testing/.prettierrc b/packages/testing/.prettierrc similarity index 100% rename from testing/.prettierrc rename to packages/testing/.prettierrc diff --git a/testing/.prettierrc.json b/packages/testing/.prettierrc.json similarity index 100% rename from testing/.prettierrc.json rename to packages/testing/.prettierrc.json diff --git a/testing/README.md b/packages/testing/README.md similarity index 100% rename from testing/README.md rename to packages/testing/README.md diff --git a/testing/certificates/README.md b/packages/testing/certificates/README.md similarity index 100% rename from testing/certificates/README.md rename to packages/testing/certificates/README.md diff --git a/testing/certificates/ca-server.crl b/packages/testing/certificates/ca-server.crl similarity index 100% rename from testing/certificates/ca-server.crl rename to packages/testing/certificates/ca-server.crl diff --git a/testing/certificates/ca.cnf b/packages/testing/certificates/ca.cnf similarity index 100% rename from testing/certificates/ca.cnf rename to packages/testing/certificates/ca.cnf diff --git a/testing/certificates/ca.crt b/packages/testing/certificates/ca.crt similarity index 100% rename from testing/certificates/ca.crt rename to packages/testing/certificates/ca.crt diff --git a/testing/certificates/ca.db b/packages/testing/certificates/ca.db similarity index 100% rename from testing/certificates/ca.db rename to packages/testing/certificates/ca.db diff --git a/testing/certificates/ca.db.attr b/packages/testing/certificates/ca.db.attr similarity index 100% rename from testing/certificates/ca.db.attr rename to packages/testing/certificates/ca.db.attr diff --git a/testing/certificates/ca.key b/packages/testing/certificates/ca.key similarity index 100% rename from testing/certificates/ca.key rename to packages/testing/certificates/ca.key diff --git a/testing/certificates/ca.serial b/packages/testing/certificates/ca.serial similarity index 100% rename from testing/certificates/ca.serial rename to packages/testing/certificates/ca.serial diff --git a/testing/certificates/client.bundle.encrypted.pem b/packages/testing/certificates/client.bundle.encrypted.pem similarity index 100% rename from testing/certificates/client.bundle.encrypted.pem rename to packages/testing/certificates/client.bundle.encrypted.pem diff --git a/testing/certificates/client.bundle.pem b/packages/testing/certificates/client.bundle.pem similarity index 100% rename from testing/certificates/client.bundle.pem rename to packages/testing/certificates/client.bundle.pem diff --git a/testing/certificates/client.bundle.pfx b/packages/testing/certificates/client.bundle.pfx similarity index 100% rename from testing/certificates/client.bundle.pfx rename to packages/testing/certificates/client.bundle.pfx diff --git a/testing/certificates/client.encrypted.key b/packages/testing/certificates/client.encrypted.key similarity index 100% rename from testing/certificates/client.encrypted.key rename to packages/testing/certificates/client.encrypted.key diff --git a/testing/certificates/client.key b/packages/testing/certificates/client.key similarity index 100% rename from testing/certificates/client.key rename to packages/testing/certificates/client.key diff --git a/testing/certificates/client.pem b/packages/testing/certificates/client.pem similarity index 100% rename from testing/certificates/client.pem rename to packages/testing/certificates/client.pem diff --git a/testing/certificates/invalid-client.bundle.pem b/packages/testing/certificates/invalid-client.bundle.pem similarity index 100% rename from testing/certificates/invalid-client.bundle.pem rename to packages/testing/certificates/invalid-client.bundle.pem diff --git a/testing/certificates/invalid-client.key b/packages/testing/certificates/invalid-client.key similarity index 100% rename from testing/certificates/invalid-client.key rename to packages/testing/certificates/invalid-client.key diff --git a/testing/certificates/non-ca.crt b/packages/testing/certificates/non-ca.crt similarity index 100% rename from testing/certificates/non-ca.crt rename to packages/testing/certificates/non-ca.crt diff --git a/testing/certificates/non-ca.key b/packages/testing/certificates/non-ca.key similarity index 100% rename from testing/certificates/non-ca.key rename to packages/testing/certificates/non-ca.key diff --git a/testing/certificates/partial-trust-chain/ca.pem b/packages/testing/certificates/partial-trust-chain/ca.pem similarity index 100% rename from testing/certificates/partial-trust-chain/ca.pem rename to packages/testing/certificates/partial-trust-chain/ca.pem diff --git a/testing/certificates/partial-trust-chain/cert.pem b/packages/testing/certificates/partial-trust-chain/cert.pem similarity index 100% rename from testing/certificates/partial-trust-chain/cert.pem rename to packages/testing/certificates/partial-trust-chain/cert.pem diff --git a/testing/certificates/partial-trust-chain/key-and-cert.pem b/packages/testing/certificates/partial-trust-chain/key-and-cert.pem similarity index 100% rename from testing/certificates/partial-trust-chain/key-and-cert.pem rename to packages/testing/certificates/partial-trust-chain/key-and-cert.pem diff --git a/testing/certificates/partial-trust-chain/key.pem b/packages/testing/certificates/partial-trust-chain/key.pem similarity index 100% rename from testing/certificates/partial-trust-chain/key.pem rename to packages/testing/certificates/partial-trust-chain/key.pem diff --git a/testing/certificates/server-invalidhost.bundle.pem b/packages/testing/certificates/server-invalidhost.bundle.pem similarity index 100% rename from testing/certificates/server-invalidhost.bundle.pem rename to packages/testing/certificates/server-invalidhost.bundle.pem diff --git a/testing/certificates/server-invalidhost.key b/packages/testing/certificates/server-invalidhost.key similarity index 100% rename from testing/certificates/server-invalidhost.key rename to packages/testing/certificates/server-invalidhost.key diff --git a/testing/certificates/server.bundle.pem b/packages/testing/certificates/server.bundle.pem similarity index 100% rename from testing/certificates/server.bundle.pem rename to packages/testing/certificates/server.bundle.pem diff --git a/testing/certificates/server.key b/packages/testing/certificates/server.key similarity index 100% rename from testing/certificates/server.key rename to packages/testing/certificates/server.key diff --git a/testing/package.json b/packages/testing/package.json similarity index 100% rename from testing/package.json rename to packages/testing/package.json diff --git a/testing/src/eventually.ts b/packages/testing/src/eventually.ts similarity index 100% rename from testing/src/eventually.ts rename to packages/testing/src/eventually.ts diff --git a/testing/src/fake-kms.ts b/packages/testing/src/fake-kms.ts similarity index 100% rename from testing/src/fake-kms.ts rename to packages/testing/src/fake-kms.ts diff --git a/testing/src/index.ts b/packages/testing/src/index.ts similarity index 100% rename from testing/src/index.ts rename to packages/testing/src/index.ts diff --git a/testing/src/integration-testing-hooks.ts b/packages/testing/src/integration-testing-hooks.ts similarity index 100% rename from testing/src/integration-testing-hooks.ts rename to packages/testing/src/integration-testing-hooks.ts diff --git a/testing/test-vscode.sh b/packages/testing/test-vscode.sh similarity index 100% rename from testing/test-vscode.sh rename to packages/testing/test-vscode.sh diff --git a/testing/tests-globalconfig.conf b/packages/testing/tests-globalconfig.conf similarity index 100% rename from testing/tests-globalconfig.conf rename to packages/testing/tests-globalconfig.conf diff --git a/testing/tsconfig-lint.json b/packages/testing/tsconfig-lint.json similarity index 100% rename from testing/tsconfig-lint.json rename to packages/testing/tsconfig-lint.json diff --git a/testing/tsconfig.json b/packages/testing/tsconfig.json similarity index 100% rename from testing/tsconfig.json rename to packages/testing/tsconfig.json From d5fb0c454448963bd28522a05904b3d598b93509 Mon Sep 17 00:00:00 2001 From: gagik Date: Thu, 13 Nov 2025 20:22:16 +0100 Subject: [PATCH 03/32] chore: package-lock --- package-lock.json | 48 +++++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index 197f0fee94..33e9d68d44 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ "packages/i18n", "packages/logging", "packages/shell-bson", + "packages/testing", "packages/arg-parser", "packages/service-provider-core", "packages/service-provider-node-driver", @@ -7634,7 +7635,7 @@ "link": true }, "node_modules/@mongosh/testing": { - "resolved": "testing", + "resolved": "packages/testing", "link": true }, "node_modules/@mongosh/types": { @@ -13162,7 +13163,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "dev": true, "license": "MIT", "dependencies": { "event-target-shim": "^5.0.0" @@ -17517,7 +17517,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/duplexpair/-/duplexpair-1.0.2.tgz", "integrity": "sha512-6DHuWdEGHNcuSqrn926rWJcRsTDrb+ugw0hx/trAxCH48z9WlFqDtwtbiEMq/KGFYQWzLs1VA0I6KUkuIgCoXw==", - "dev": true, "license": "MIT", "dependencies": { "readable-stream": "^4.5.2" @@ -17527,7 +17526,6 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "dev": true, "funding": [ { "type": "github", @@ -17552,7 +17550,6 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.8.x" @@ -17562,7 +17559,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true, "funding": [ { "type": "github", @@ -17583,7 +17579,6 @@ "version": "4.5.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", - "dev": true, "license": "MIT", "dependencies": { "abort-controller": "^3.0.0", @@ -18706,7 +18701,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -26035,7 +26029,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/mongodb-runner/-/mongodb-runner-6.0.0.tgz", "integrity": "sha512-ijhBVCcTWRlauxp4UdIuktfPjEqlt8yOo0u7XyE99HdaITzL0BjS4x/dOyNzddewC6gw5wxH1uYx+Uo7GfeUnw==", - "dev": true, "license": "Apache-2.0", "dependencies": { "@mongodb-js/mongodb-downloader": "^1.0.0", @@ -26053,7 +26046,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/@mongodb-js/mongodb-downloader/-/mongodb-downloader-1.0.0.tgz", "integrity": "sha512-xz4zr/5RWfAaHp9Kf7XPaLNxKaisl2NJGFEDQRNjB/ru79LdpLQbbSjQazTOl6JLcBvAjNNvauTeTwmgEvSUlA==", - "dev": true, "license": "Apache-2.0", "dependencies": { "debug": "^4.4.0", @@ -26068,7 +26060,6 @@ "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dev": true, "license": "ISC", "dependencies": { "string-width": "^4.2.0", @@ -26083,7 +26074,6 @@ "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, "license": "MIT", "dependencies": { "ms": "^2.1.3" @@ -26101,14 +26091,12 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, "license": "MIT" }, "node_modules/mongodb-runner/node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dev": true, "license": "MIT", "dependencies": { "cliui": "^8.0.1", @@ -26127,7 +26115,6 @@ "version": "21.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, "license": "ISC", "engines": { "node": ">=12" @@ -29116,7 +29103,6 @@ "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.6.0" @@ -29249,7 +29235,6 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.2.tgz", "integrity": "sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==", - "dev": true, "license": "MIT", "dependencies": { "graceful-fs": "^4.2.4", @@ -36444,6 +36429,33 @@ "@types/node": "*" } }, + "packages/testing": { + "name": "@mongosh/testing", + "version": "0.0.0-dev.0", + "license": "Apache-2.0", + "dependencies": { + "@mongosh/build": "3.7.8", + "duplexpair": "^1.0.2", + "mongodb": "^6.19.0", + "mongodb-connection-string-url": "^3.0.1", + "mongodb-runner": "^6.0.0", + "semver": "^7.3.4", + "which": "^2.0.2" + }, + "devDependencies": { + "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/prettier-config-devtools": "^1.0.1", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@types/semver": "^7.3.4", + "@types/which": "^1.3.2", + "eslint": "^7.25.0", + "prettier": "^2.8.8", + "typescript": "^5.3.3" + }, + "engines": { + "node": ">=14.15.1" + } + }, "packages/types": { "name": "@mongosh/types", "version": "3.14.0", @@ -36478,7 +36490,7 @@ "testing": { "name": "@mongosh/testing", "version": "0.0.0-dev.0", - "dev": true, + "extraneous": true, "license": "Apache-2.0", "dependencies": { "@mongosh/build": "3.7.8", From fcfa3cc7bcfd8cd58053076381222145e9d1f0d1 Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 17 Nov 2025 13:29:38 +0100 Subject: [PATCH 04/32] chore: fix testing src --- packages/e2e-tests/test/repl-helpers.ts | 10 +--------- packages/shell-api/src/field-level-encryption.spec.ts | 10 +--------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/packages/e2e-tests/test/repl-helpers.ts b/packages/e2e-tests/test/repl-helpers.ts index 0035465bf7..02ae993a02 100644 --- a/packages/e2e-tests/test/repl-helpers.ts +++ b/packages/e2e-tests/test/repl-helpers.ts @@ -141,15 +141,7 @@ const setTemporaryHomeDirectory = () => { }; function getCertPath(filename: string): string { - return path.join( - __dirname, - '..', - '..', - '..', - 'testing', - 'certificates', - filename - ); + return path.join(__dirname, '..', '..', 'testing', 'certificates', filename); } // TLS requires matching hostnames, so here we need to explicitly diff --git a/packages/shell-api/src/field-level-encryption.spec.ts b/packages/shell-api/src/field-level-encryption.spec.ts index f47073a7db..dacda2f283 100644 --- a/packages/shell-api/src/field-level-encryption.spec.ts +++ b/packages/shell-api/src/field-level-encryption.spec.ts @@ -85,15 +85,7 @@ const exampleUUID = new bson.Binary( ).toUUID(); function getCertPath(filename: string): string { - return path.join( - __dirname, - '..', - '..', - '..', - 'testing', - 'certificates', - filename - ); + return path.join(__dirname, '..', '..', 'testing', 'certificates', filename); } describe('Field Level Encryption', function () { From c3f1a283cfca5fabbf08bedecd1ca0028f396d53 Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 17 Nov 2025 13:40:33 +0100 Subject: [PATCH 05/32] chore: use scripts for test-vscode --- .evergreen.yml | 2 +- .evergreen/evergreen.yml.in | 2 +- {packages/testing => scripts}/test-vscode.sh | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename {packages/testing => scripts}/test-vscode.sh (100%) diff --git a/.evergreen.yml b/.evergreen.yml index 4cfce45453..68dfb79922 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -4117,7 +4117,7 @@ functions: (cd scripts/docker && docker build --build-arg NODE_JS_VERSION="$NODE_VERSION" -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .) docker run \ --rm -v $PWD:/tmp/build ubuntu24.04-xvfb \ - -c 'cd /tmp/build && ./testing/test-vscode.sh' + -c 'cd /tmp/build && ./scripts/test-vscode.sh' } test_connectivity: - command: expansions.write diff --git a/.evergreen/evergreen.yml.in b/.evergreen/evergreen.yml.in index 349318a047..dcb2467763 100644 --- a/.evergreen/evergreen.yml.in +++ b/.evergreen/evergreen.yml.in @@ -336,7 +336,7 @@ functions: (cd scripts/docker && docker build --build-arg NODE_JS_VERSION="$NODE_VERSION" -t ubuntu24.04-xvfb -f ubuntu24.04-xvfb.Dockerfile .) docker run \ --rm -v $PWD:/tmp/build ubuntu24.04-xvfb \ - -c 'cd /tmp/build && ./testing/test-vscode.sh' + -c 'cd /tmp/build && ./scripts/test-vscode.sh' } test_connectivity: - command: expansions.write diff --git a/packages/testing/test-vscode.sh b/scripts/test-vscode.sh similarity index 100% rename from packages/testing/test-vscode.sh rename to scripts/test-vscode.sh From 52c04780cc0a3f74e468364967940cfebb9694ca Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 17 Nov 2025 15:24:57 +0100 Subject: [PATCH 06/32] chore: export getTestCertificatePath --- packages/e2e-tests/test/e2e-oidc.spec.ts | 9 +++--- packages/e2e-tests/test/e2e-proxy.spec.ts | 11 +++---- packages/e2e-tests/test/e2e-tls.spec.ts | 31 +++++++++++-------- packages/e2e-tests/test/repl-helpers.ts | 5 --- .../src/field-level-encryption.spec.ts | 19 ++++++------ packages/testing/README.md | 6 +--- packages/testing/src/index.ts | 12 +++++++ 7 files changed, 49 insertions(+), 44 deletions(-) diff --git a/packages/e2e-tests/test/e2e-oidc.spec.ts b/packages/e2e-tests/test/e2e-oidc.spec.ts index 673f6955eb..69b847abfd 100644 --- a/packages/e2e-tests/test/e2e-oidc.spec.ts +++ b/packages/e2e-tests/test/e2e-oidc.spec.ts @@ -2,6 +2,7 @@ import { MongoRunnerSetup, skipIfApiStrict, skipIfEnvServerVersion, + getTestCertificatePath, } from '@mongosh/testing'; import { promises as fs } from 'fs'; import type { OIDCMockProviderConfig } from '@mongodb-js/oidc-mock-provider'; @@ -10,7 +11,7 @@ import type { TestShell } from './test-shell'; import path from 'path'; import { expect } from 'chai'; import { createServer as createHTTPSServer } from 'https'; -import { getCertPath, readReplLogFile, useTmpdir } from './repl-helpers'; +import { readReplLogFile, useTmpdir } from './repl-helpers'; import { baseOidcServerConfig, commonOidcServerArgs, @@ -67,7 +68,7 @@ describe('OIDC auth e2e', function () { }, }; const httpsServerKeyCertBundle = await fs.readFile( - getCertPath('server.bundle.pem') + getTestCertificatePath('server.bundle.pem') ); [oidcMockProvider, oidcMockProviderHttps] = await Promise.all([ OIDCMockProvider.create(oidcMockProviderConfig), @@ -411,7 +412,7 @@ describe('OIDC auth e2e', function () { it('can specify --tlsUseSystemCA as a no-op', async function () { await fs.mkdir(path.join(tmpdir.path, 'certs'), { recursive: true }); await fs.copyFile( - getCertPath('ca.crt'), + getTestCertificatePath('ca.crt'), path.join(tmpdir.path, 'certs', 'somefilename.crt') ); @@ -441,7 +442,7 @@ describe('OIDC auth e2e', function () { it('uses system ca by default when calling the IdP https endpoint', async function () { await fs.mkdir(path.join(tmpdir.path, 'certs'), { recursive: true }); await fs.copyFile( - getCertPath('ca.crt'), + getTestCertificatePath('ca.crt'), path.join(tmpdir.path, 'certs', 'somefilename.crt') ); diff --git a/packages/e2e-tests/test/e2e-proxy.spec.ts b/packages/e2e-tests/test/e2e-proxy.spec.ts index f827307984..23910ca60f 100644 --- a/packages/e2e-tests/test/e2e-proxy.spec.ts +++ b/packages/e2e-tests/test/e2e-proxy.spec.ts @@ -10,14 +10,11 @@ import { skipIfEnvServerVersion, startSharedTestServer, startTestServer, + getTestCertificatePath, } from '@mongosh/testing'; import type { Server as HTTPSServer } from 'https'; import { createServer as createHTTPSServer } from 'https'; -import { - connectionStringWithLocalhost, - getCertPath, - useTmpdir, -} from './repl-helpers'; +import { connectionStringWithLocalhost, useTmpdir } from './repl-helpers'; import { once } from 'events'; import { connect } from 'net'; import type { AddressInfo, Socket } from 'net'; @@ -32,8 +29,8 @@ import { skipOIDCTestsDueToPlatformOrServerVersion, } from './oidc-helpers'; -const CA_CERT = getCertPath('ca.crt'); -const SERVER_BUNDLE = getCertPath('server.bundle.pem'); +const CA_CERT = getTestCertificatePath('ca.crt'); +const SERVER_BUNDLE = getTestCertificatePath('server.bundle.pem'); describe('e2e proxy support', function () { skipIfApiStrict(); diff --git a/packages/e2e-tests/test/e2e-tls.spec.ts b/packages/e2e-tests/test/e2e-tls.spec.ts index 351fea3ddd..6d763f3b4f 100644 --- a/packages/e2e-tests/test/e2e-tls.spec.ts +++ b/packages/e2e-tests/test/e2e-tls.spec.ts @@ -1,27 +1,32 @@ import { expect } from 'chai'; import { promises as fs } from 'fs'; import path from 'path'; -import { startTestServer } from '@mongosh/testing'; +import { startTestServer, getTestCertificatePath } from '@mongosh/testing'; import { useTmpdir, setTemporaryHomeDirectory, readReplLogFile, - getCertPath, connectionStringWithLocalhost, } from './repl-helpers'; -const CA_CERT = getCertPath('ca.crt'); -const NON_CA_CERT = getCertPath('non-ca.crt'); -const CLIENT_CERT = getCertPath('client.bundle.pem'); -const CLIENT_CERT_PFX = getCertPath('client.bundle.pfx'); -const CLIENT_CERT_ENCRYPTED = getCertPath('client.bundle.encrypted.pem'); +const CA_CERT = getTestCertificatePath('ca.crt'); +const NON_CA_CERT = getTestCertificatePath('non-ca.crt'); +const CLIENT_CERT = getTestCertificatePath('client.bundle.pem'); +const CLIENT_CERT_PFX = getTestCertificatePath('client.bundle.pfx'); +const CLIENT_CERT_ENCRYPTED = getTestCertificatePath( + 'client.bundle.encrypted.pem' +); const CLIENT_CERT_PASSWORD = 'p4ssw0rd'; -const INVALID_CLIENT_CERT = getCertPath('invalid-client.bundle.pem'); -const SERVER_KEY = getCertPath('server.bundle.pem'); -const SERVER_INVALIDHOST_KEY = getCertPath('server-invalidhost.bundle.pem'); -const CRL_INCLUDING_SERVER = getCertPath('ca-server.crl'); -const PARTIAL_TRUST_CHAIN_CA = getCertPath('partial-trust-chain/ca.pem'); -const PARTIAL_TRUST_CHAIN_KEY_AND_CERT = getCertPath( +const INVALID_CLIENT_CERT = getTestCertificatePath('invalid-client.bundle.pem'); +const SERVER_KEY = getTestCertificatePath('server.bundle.pem'); +const SERVER_INVALIDHOST_KEY = getTestCertificatePath( + 'server-invalidhost.bundle.pem' +); +const CRL_INCLUDING_SERVER = getTestCertificatePath('ca-server.crl'); +const PARTIAL_TRUST_CHAIN_CA = getTestCertificatePath( + 'partial-trust-chain/ca.pem' +); +const PARTIAL_TRUST_CHAIN_KEY_AND_CERT = getTestCertificatePath( 'partial-trust-chain/key-and-cert.pem' ); diff --git a/packages/e2e-tests/test/repl-helpers.ts b/packages/e2e-tests/test/repl-helpers.ts index 02ae993a02..8c80cd9970 100644 --- a/packages/e2e-tests/test/repl-helpers.ts +++ b/packages/e2e-tests/test/repl-helpers.ts @@ -140,10 +140,6 @@ const setTemporaryHomeDirectory = () => { return { homedir, env }; }; -function getCertPath(filename: string): string { - return path.join(__dirname, '..', '..', 'testing', 'certificates', filename); -} - // TLS requires matching hostnames, so here we need to explicitly // specify `localhost` + IPv4 instead of `127.0.0.1` async function connectionStringWithLocalhost( @@ -166,7 +162,6 @@ export { readReplLogFile, fakeExternalEditor, setTemporaryHomeDirectory, - getCertPath, connectionStringWithLocalhost, MongoLogEntryFromFile, }; diff --git a/packages/shell-api/src/field-level-encryption.spec.ts b/packages/shell-api/src/field-level-encryption.spec.ts index dacda2f283..33dee8d67b 100644 --- a/packages/shell-api/src/field-level-encryption.spec.ts +++ b/packages/shell-api/src/field-level-encryption.spec.ts @@ -11,7 +11,6 @@ import * as bson from 'bson'; import { expect } from 'chai'; import { EventEmitter } from 'events'; import { promises as fs } from 'fs'; -import path from 'path'; import { Duplex } from 'stream'; import sinon from 'sinon'; import type { StubbedInstance } from 'ts-sinon'; @@ -33,6 +32,7 @@ import { startSharedTestServer, makeFakeHTTPConnection, fakeAWSHandlers, + getTestCertificatePath, } from '@mongosh/testing'; import { Collection } from './collection'; import { dummyOptions } from './helpers.spec'; @@ -84,10 +84,6 @@ const exampleUUID = new bson.Binary( 4 ).toUUID(); -function getCertPath(filename: string): string { - return path.join(__dirname, '..', '..', 'testing', 'certificates', filename); -} - describe('Field Level Encryption', function () { let sp: StubbedInstance; let mongo: Mongo; @@ -871,9 +867,11 @@ srDVjIT3LsvTqw==`, { endpoint: 'kmip.example.com:123', tlsOptions: { - tlsCertificateKeyFile: getCertPath('client.bundle.encrypted.pem'), + tlsCertificateKeyFile: getTestCertificatePath( + 'client.bundle.encrypted.pem' + ), tlsCertificateKeyFilePassword: 'p4ssw0rd', - tlsCAFile: getCertPath('ca.crt'), + tlsCAFile: getTestCertificatePath('ca.crt'), }, }, ], @@ -941,12 +939,12 @@ srDVjIT3LsvTqw==`, servername: 'kmip.example.com', port: 123, passphrase: 'p4ssw0rd', - ca: await fs.readFile(getCertPath('ca.crt')), + ca: await fs.readFile(getTestCertificatePath('ca.crt')), cert: await fs.readFile( - getCertPath('client.bundle.encrypted.pem') + getTestCertificatePath('client.bundle.encrypted.pem') ), key: await fs.readFile( - getCertPath('client.bundle.encrypted.pem') + getTestCertificatePath('client.bundle.encrypted.pem') ), }, }, @@ -954,6 +952,7 @@ srDVjIT3LsvTqw==`, return; } expect.fail('missed exception'); + break; default: throw new Error(`unreachable ${kmsName}`); } diff --git a/packages/testing/README.md b/packages/testing/README.md index 164e1bc172..ff1366bc02 100644 --- a/packages/testing/README.md +++ b/packages/testing/README.md @@ -1,6 +1,6 @@ # @mongosh/testing -Internal testing utilities for mongosh packages. This package is only used for testing purposes within the mongosh monorepo. +Internal testing utilities for mongosh packages. This package is private and only used for testing purposes within the mongosh monorepo. ## Contents @@ -18,7 +18,3 @@ import { makeFakeHTTPServer, } from '@mongosh/testing'; ``` - -## Note - -This package is marked as private and will not be published to npm. diff --git a/packages/testing/src/index.ts b/packages/testing/src/index.ts index 012b9fe339..bc8f9b58a2 100644 --- a/packages/testing/src/index.ts +++ b/packages/testing/src/index.ts @@ -1,3 +1,15 @@ +import path from 'path'; + export * from './integration-testing-hooks'; export * from './eventually'; export * from './fake-kms'; + +/** + * Path to the certificates directory containing test certificates + */ +const TEST_CERTIFICATES_DIR = path.resolve(__dirname, '..', 'certificates'); + +/** Get the path to a test certificate */ +export function getTestCertificatePath(filename: string): string { + return path.join(TEST_CERTIFICATES_DIR, filename); +} From 0d9683607e4320f94cb6da151619aeadf06f6453 Mon Sep 17 00:00:00 2001 From: gagik Date: Tue, 18 Nov 2025 16:55:07 +0100 Subject: [PATCH 07/32] chore: fix setup-env --- .evergreen/setup-env.sh | 2 +- .nycrc | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.evergreen/setup-env.sh b/.evergreen/setup-env.sh index c3c241ba09..1c6cee690a 100755 --- a/.evergreen/setup-env.sh +++ b/.evergreen/setup-env.sh @@ -6,7 +6,7 @@ OS_ARCH="$(uname "-m")" export BASEDIR="$PWD/.evergreen" export PATH="$BASEDIR/npm-10/node_modules/.bin:$BASEDIR/node-v$NODE_JS_VERSION-win-x64:/opt/java/jdk16/bin:$PATH" -export MONGOSH_GLOBAL_CONFIG_FILE_FOR_TESTING="$BASEDIR/../../testing/tests-globalconfig.conf" +export MONGOSH_GLOBAL_CONFIG_FILE_FOR_TESTING="$BASEDIR/../../packages/testing/tests-globalconfig.conf" export IS_MONGOSH_EVERGREEN_CI=1 export DEBUG="mongodb*,$DEBUG" diff --git a/.nycrc b/.nycrc index 6eeae76686..204b9ee857 100644 --- a/.nycrc +++ b/.nycrc @@ -1,12 +1,8 @@ { - "include": [ - "packages/*/src/**", - "scripts/*/src/**", - "configs/*/src/**" - ], + "include": ["packages/*/src/**", "scripts/*/src/**", "configs/*/src/**"], "exclude": [ "test", - "testing", + "packages/testing", "config", "**/*.d.ts", "**/*.spec.{ts,js,tsx,jsx,cjs,mjs}", From a57a1fcd4766106114db41d158672d2e87f56077 Mon Sep 17 00:00:00 2001 From: Gagik Amaryan Date: Wed, 19 Nov 2025 11:13:06 +0100 Subject: [PATCH 08/32] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- packages/testing/src/integration-testing-hooks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/testing/src/integration-testing-hooks.ts b/packages/testing/src/integration-testing-hooks.ts index ad6186fc21..b28925a47b 100644 --- a/packages/testing/src/integration-testing-hooks.ts +++ b/packages/testing/src/integration-testing-hooks.ts @@ -14,7 +14,7 @@ const execFile = promisify(child_process.execFile); // Return the path to the temporary directory and ensure that it exists. async function getTmpdir(): Promise { - const tmpdir = path.resolve(__dirname, '..', '..', 'tmp'); + const tmpdir = path.resolve(__dirname, '..', '..', '..', 'tmp'); await fs.mkdir(tmpdir, { recursive: true }); return tmpdir; } From 4fcbdd285e769f703c376ed97bee856f1584d708 Mon Sep 17 00:00:00 2001 From: gagik Date: Thu, 20 Nov 2025 12:21:02 +0100 Subject: [PATCH 09/32] chore: move certificates inside --- mongosh.code-workspace | 127 ++++++++++++++++++ package-lock.json | 23 +++- package.json | 2 +- packages/testing/package.json | 4 +- .../testing/{ => src}/certificates/README.md | 0 .../{ => src}/certificates/ca-server.crl | 0 .../testing/{ => src}/certificates/ca.cnf | 0 .../testing/{ => src}/certificates/ca.crt | 0 packages/testing/{ => src}/certificates/ca.db | 0 .../testing/{ => src}/certificates/ca.db.attr | 0 .../testing/{ => src}/certificates/ca.key | 0 .../testing/{ => src}/certificates/ca.serial | 0 .../certificates/client.bundle.encrypted.pem | 0 .../{ => src}/certificates/client.bundle.pem | 0 .../{ => src}/certificates/client.bundle.pfx | Bin .../certificates/client.encrypted.key | 0 .../testing/{ => src}/certificates/client.key | 0 .../testing/{ => src}/certificates/client.pem | 0 .../certificates/invalid-client.bundle.pem | 0 .../{ => src}/certificates/invalid-client.key | 0 .../testing/{ => src}/certificates/non-ca.crt | 0 .../testing/{ => src}/certificates/non-ca.key | 0 .../certificates/partial-trust-chain/ca.pem | 0 .../certificates/partial-trust-chain/cert.pem | 0 .../partial-trust-chain/key-and-cert.pem | 0 .../certificates/partial-trust-chain/key.pem | 0 .../server-invalidhost.bundle.pem | 0 .../certificates/server-invalidhost.key | 0 .../{ => src}/certificates/server.bundle.pem | 0 .../testing/{ => src}/certificates/server.key | 0 packages/testing/src/index.ts | 2 +- 31 files changed, 149 insertions(+), 9 deletions(-) create mode 100644 mongosh.code-workspace rename packages/testing/{ => src}/certificates/README.md (100%) rename packages/testing/{ => src}/certificates/ca-server.crl (100%) rename packages/testing/{ => src}/certificates/ca.cnf (100%) rename packages/testing/{ => src}/certificates/ca.crt (100%) rename packages/testing/{ => src}/certificates/ca.db (100%) rename packages/testing/{ => src}/certificates/ca.db.attr (100%) rename packages/testing/{ => src}/certificates/ca.key (100%) rename packages/testing/{ => src}/certificates/ca.serial (100%) rename packages/testing/{ => src}/certificates/client.bundle.encrypted.pem (100%) rename packages/testing/{ => src}/certificates/client.bundle.pem (100%) rename packages/testing/{ => src}/certificates/client.bundle.pfx (100%) rename packages/testing/{ => src}/certificates/client.encrypted.key (100%) rename packages/testing/{ => src}/certificates/client.key (100%) rename packages/testing/{ => src}/certificates/client.pem (100%) rename packages/testing/{ => src}/certificates/invalid-client.bundle.pem (100%) rename packages/testing/{ => src}/certificates/invalid-client.key (100%) rename packages/testing/{ => src}/certificates/non-ca.crt (100%) rename packages/testing/{ => src}/certificates/non-ca.key (100%) rename packages/testing/{ => src}/certificates/partial-trust-chain/ca.pem (100%) rename packages/testing/{ => src}/certificates/partial-trust-chain/cert.pem (100%) rename packages/testing/{ => src}/certificates/partial-trust-chain/key-and-cert.pem (100%) rename packages/testing/{ => src}/certificates/partial-trust-chain/key.pem (100%) rename packages/testing/{ => src}/certificates/server-invalidhost.bundle.pem (100%) rename packages/testing/{ => src}/certificates/server-invalidhost.key (100%) rename packages/testing/{ => src}/certificates/server.bundle.pem (100%) rename packages/testing/{ => src}/certificates/server.key (100%) diff --git a/mongosh.code-workspace b/mongosh.code-workspace new file mode 100644 index 0000000000..293d695fd8 --- /dev/null +++ b/mongosh.code-workspace @@ -0,0 +1,127 @@ +{ + "folders": [ + { + "name": "mongosh", + "path": "." + }, + { + "name": "📦 @mongosh/arg-parser", + "path": "packages/arg-parser" + }, + { + "name": "📦 @mongosh/async-rewriter2", + "path": "packages/async-rewriter2" + }, + { + "name": "📦 @mongosh/autocomplete", + "path": "packages/autocomplete" + }, + // { + // "name": "📦 @mongosh/browser-repl", + // "path": "packages/browser-repl" + // }, + { + "name": "📦 @mongosh/browser-runtime-core", + "path": "packages/browser-runtime-core" + }, + { + "name": "📦 @mongosh/browser-runtime-electron", + "path": "packages/browser-runtime-electron" + }, + { + "name": "📦 @mongosh/build", + "path": "packages/build" + }, + { + "name": "📦 @mongosh/cli-repl", + "path": "packages/cli-repl" + }, + { + "name": "📦 @mongosh/connectivity-tests", + "path": "packages/connectivity-tests" + }, + { + "name": "📦 @mongosh/e2e-tests", + "path": "packages/e2e-tests" + }, + { + "name": "📦 @mongosh/editor", + "path": "packages/editor" + }, + { + "name": "📦 @mongosh/errors", + "path": "packages/errors" + }, + { + "name": "📦 @mongosh/history", + "path": "packages/history" + }, + { + "name": "📦 @mongosh/i18n", + "path": "packages/i18n" + }, + { + "name": "📦 @mongosh/java-shell", + "path": "packages/java-shell" + }, + { + "name": "📦 @mongosh/js-multiline-to-singleline", + "path": "packages/js-multiline-to-singleline" + }, + { + "name": "📦 @mongosh/logging", + "path": "packages/logging" + }, + { + "name": "📦 @mongosh/node-runtime-worker-thread", + "path": "packages/node-runtime-worker-thread" + }, + { + "name": "📦 @mongosh/service-provider-core", + "path": "packages/service-provider-core" + }, + { + "name": "📦 @mongosh/service-provider-node-driver", + "path": "packages/service-provider-node-driver" + }, + { + "name": "📦 @mongosh/shell-api", + "path": "packages/shell-api" + }, + { + "name": "📦 @mongosh/shell-bson", + "path": "packages/shell-bson" + }, + { + "name": "📦 @mongosh/shell-evaluator", + "path": "packages/shell-evaluator" + }, + { + "name": "📦 @mongosh/snippet-manager", + "path": "packages/snippet-manager" + }, + { + "name": "📦 @mongosh/testing", + "path": "packages/testing" + }, + { + "name": "📦 @mongosh/types", + "path": "packages/types" + } + ], + "settings": { + "typescript.tsdk": "node_modules/typescript/lib", + "mochaExplorer.files": "./{src,lib}/**/*.spec.ts", + "mochaExplorer.require": [ + "../../scripts/import-expansions.js", + "ts-node/register" + ], + "mochaExplorer.timeout": 60000, + "mochaExplorer.ui": "bdd", + "mochaExplorer.esmLoader": false, + "mochaExplorer.monkeyPatch": true, + "mochaExplorer.autoload": true, + "testExplorer.codeLens": true, + "testExplorer.gutterDecoration": true + } +} diff --git a/package-lock.json b/package-lock.json index 33e9d68d44..6854d6527e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -62,7 +62,7 @@ "husky": "^9.0.11", "mocha": "^10.2.0", "mongodb": "^6.19.0", - "mongodb-runner": "^6.0.0", + "mongodb-runner": "^6.2.0", "node-gyp": "^9.0.0 || ^10.2.0", "nyc": "^15.1.0", "pkg-up": "^3.1.0", @@ -26026,12 +26026,13 @@ "optional": true }, "node_modules/mongodb-runner": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/mongodb-runner/-/mongodb-runner-6.0.0.tgz", - "integrity": "sha512-ijhBVCcTWRlauxp4UdIuktfPjEqlt8yOo0u7XyE99HdaITzL0BjS4x/dOyNzddewC6gw5wxH1uYx+Uo7GfeUnw==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/mongodb-runner/-/mongodb-runner-6.2.0.tgz", + "integrity": "sha512-3RCYNGUJIHkwxmhyfQdY7gp6KqbyqEb2lNw3ZV36XaJFU07bYb9b497ba2YuH3evdNonbqXCUf+yxdAUWNPojg==", "license": "Apache-2.0", "dependencies": { "@mongodb-js/mongodb-downloader": "^1.0.0", + "@mongodb-js/oidc-mock-provider": "^0.12.0", "@mongodb-js/saslprep": "^1.3.2", "debug": "^4.4.0", "mongodb": "^6.9.0", @@ -26056,6 +26057,18 @@ "tar": "^6.1.15" } }, + "node_modules/mongodb-runner/node_modules/@mongodb-js/oidc-mock-provider": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@mongodb-js/oidc-mock-provider/-/oidc-mock-provider-0.12.0.tgz", + "integrity": "sha512-OBGqTQ25CJpNhvSy5gYNcTSi+cOExeGliAcuObXX6AswhpW7gt62go9md0jYAs10MPKTPFOvK+RrXX4WIkr/nA==", + "license": "Apache-2.0", + "dependencies": { + "yargs": "^17.7.2" + }, + "bin": { + "oidc-mock-provider": "bin/oidc-mock-provider.js" + } + }, "node_modules/mongodb-runner/node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -36438,7 +36451,7 @@ "duplexpair": "^1.0.2", "mongodb": "^6.19.0", "mongodb-connection-string-url": "^3.0.1", - "mongodb-runner": "^6.0.0", + "mongodb-runner": "^6.2.0", "semver": "^7.3.4", "which": "^2.0.2" }, diff --git a/package.json b/package.json index 9df364227d..0d9c315e9a 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,7 @@ "husky": "^9.0.11", "mocha": "^10.2.0", "mongodb": "^6.19.0", - "mongodb-runner": "^6.0.0", + "mongodb-runner": "^6.2.0", "node-gyp": "^9.0.0 || ^10.2.0", "nyc": "^15.1.0", "pkg-up": "^3.1.0", diff --git a/packages/testing/package.json b/packages/testing/package.json index 2450280cf1..e98d975a0b 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -1,7 +1,7 @@ { "name": "@mongosh/testing", "version": "0.0.0-dev.0", - "description": "MongoDB Shell Testing Utilities (internal use only)", + "description": "MongoDB Shell Testing Utilities", "homepage": "https://github.com/mongodb-js/mongosh", "license": "Apache-2.0", "main": "lib/index.js", @@ -26,7 +26,7 @@ "duplexpair": "^1.0.2", "mongodb": "^6.19.0", "mongodb-connection-string-url": "^3.0.1", - "mongodb-runner": "^6.0.0", + "mongodb-runner": "^6.2.0", "semver": "^7.3.4", "which": "^2.0.2" }, diff --git a/packages/testing/certificates/README.md b/packages/testing/src/certificates/README.md similarity index 100% rename from packages/testing/certificates/README.md rename to packages/testing/src/certificates/README.md diff --git a/packages/testing/certificates/ca-server.crl b/packages/testing/src/certificates/ca-server.crl similarity index 100% rename from packages/testing/certificates/ca-server.crl rename to packages/testing/src/certificates/ca-server.crl diff --git a/packages/testing/certificates/ca.cnf b/packages/testing/src/certificates/ca.cnf similarity index 100% rename from packages/testing/certificates/ca.cnf rename to packages/testing/src/certificates/ca.cnf diff --git a/packages/testing/certificates/ca.crt b/packages/testing/src/certificates/ca.crt similarity index 100% rename from packages/testing/certificates/ca.crt rename to packages/testing/src/certificates/ca.crt diff --git a/packages/testing/certificates/ca.db b/packages/testing/src/certificates/ca.db similarity index 100% rename from packages/testing/certificates/ca.db rename to packages/testing/src/certificates/ca.db diff --git a/packages/testing/certificates/ca.db.attr b/packages/testing/src/certificates/ca.db.attr similarity index 100% rename from packages/testing/certificates/ca.db.attr rename to packages/testing/src/certificates/ca.db.attr diff --git a/packages/testing/certificates/ca.key b/packages/testing/src/certificates/ca.key similarity index 100% rename from packages/testing/certificates/ca.key rename to packages/testing/src/certificates/ca.key diff --git a/packages/testing/certificates/ca.serial b/packages/testing/src/certificates/ca.serial similarity index 100% rename from packages/testing/certificates/ca.serial rename to packages/testing/src/certificates/ca.serial diff --git a/packages/testing/certificates/client.bundle.encrypted.pem b/packages/testing/src/certificates/client.bundle.encrypted.pem similarity index 100% rename from packages/testing/certificates/client.bundle.encrypted.pem rename to packages/testing/src/certificates/client.bundle.encrypted.pem diff --git a/packages/testing/certificates/client.bundle.pem b/packages/testing/src/certificates/client.bundle.pem similarity index 100% rename from packages/testing/certificates/client.bundle.pem rename to packages/testing/src/certificates/client.bundle.pem diff --git a/packages/testing/certificates/client.bundle.pfx b/packages/testing/src/certificates/client.bundle.pfx similarity index 100% rename from packages/testing/certificates/client.bundle.pfx rename to packages/testing/src/certificates/client.bundle.pfx diff --git a/packages/testing/certificates/client.encrypted.key b/packages/testing/src/certificates/client.encrypted.key similarity index 100% rename from packages/testing/certificates/client.encrypted.key rename to packages/testing/src/certificates/client.encrypted.key diff --git a/packages/testing/certificates/client.key b/packages/testing/src/certificates/client.key similarity index 100% rename from packages/testing/certificates/client.key rename to packages/testing/src/certificates/client.key diff --git a/packages/testing/certificates/client.pem b/packages/testing/src/certificates/client.pem similarity index 100% rename from packages/testing/certificates/client.pem rename to packages/testing/src/certificates/client.pem diff --git a/packages/testing/certificates/invalid-client.bundle.pem b/packages/testing/src/certificates/invalid-client.bundle.pem similarity index 100% rename from packages/testing/certificates/invalid-client.bundle.pem rename to packages/testing/src/certificates/invalid-client.bundle.pem diff --git a/packages/testing/certificates/invalid-client.key b/packages/testing/src/certificates/invalid-client.key similarity index 100% rename from packages/testing/certificates/invalid-client.key rename to packages/testing/src/certificates/invalid-client.key diff --git a/packages/testing/certificates/non-ca.crt b/packages/testing/src/certificates/non-ca.crt similarity index 100% rename from packages/testing/certificates/non-ca.crt rename to packages/testing/src/certificates/non-ca.crt diff --git a/packages/testing/certificates/non-ca.key b/packages/testing/src/certificates/non-ca.key similarity index 100% rename from packages/testing/certificates/non-ca.key rename to packages/testing/src/certificates/non-ca.key diff --git a/packages/testing/certificates/partial-trust-chain/ca.pem b/packages/testing/src/certificates/partial-trust-chain/ca.pem similarity index 100% rename from packages/testing/certificates/partial-trust-chain/ca.pem rename to packages/testing/src/certificates/partial-trust-chain/ca.pem diff --git a/packages/testing/certificates/partial-trust-chain/cert.pem b/packages/testing/src/certificates/partial-trust-chain/cert.pem similarity index 100% rename from packages/testing/certificates/partial-trust-chain/cert.pem rename to packages/testing/src/certificates/partial-trust-chain/cert.pem diff --git a/packages/testing/certificates/partial-trust-chain/key-and-cert.pem b/packages/testing/src/certificates/partial-trust-chain/key-and-cert.pem similarity index 100% rename from packages/testing/certificates/partial-trust-chain/key-and-cert.pem rename to packages/testing/src/certificates/partial-trust-chain/key-and-cert.pem diff --git a/packages/testing/certificates/partial-trust-chain/key.pem b/packages/testing/src/certificates/partial-trust-chain/key.pem similarity index 100% rename from packages/testing/certificates/partial-trust-chain/key.pem rename to packages/testing/src/certificates/partial-trust-chain/key.pem diff --git a/packages/testing/certificates/server-invalidhost.bundle.pem b/packages/testing/src/certificates/server-invalidhost.bundle.pem similarity index 100% rename from packages/testing/certificates/server-invalidhost.bundle.pem rename to packages/testing/src/certificates/server-invalidhost.bundle.pem diff --git a/packages/testing/certificates/server-invalidhost.key b/packages/testing/src/certificates/server-invalidhost.key similarity index 100% rename from packages/testing/certificates/server-invalidhost.key rename to packages/testing/src/certificates/server-invalidhost.key diff --git a/packages/testing/certificates/server.bundle.pem b/packages/testing/src/certificates/server.bundle.pem similarity index 100% rename from packages/testing/certificates/server.bundle.pem rename to packages/testing/src/certificates/server.bundle.pem diff --git a/packages/testing/certificates/server.key b/packages/testing/src/certificates/server.key similarity index 100% rename from packages/testing/certificates/server.key rename to packages/testing/src/certificates/server.key diff --git a/packages/testing/src/index.ts b/packages/testing/src/index.ts index bc8f9b58a2..bf3a508a27 100644 --- a/packages/testing/src/index.ts +++ b/packages/testing/src/index.ts @@ -7,7 +7,7 @@ export * from './fake-kms'; /** * Path to the certificates directory containing test certificates */ -const TEST_CERTIFICATES_DIR = path.resolve(__dirname, '..', 'certificates'); +const TEST_CERTIFICATES_DIR = path.resolve(__dirname, 'certificates'); /** Get the path to a test certificate */ export function getTestCertificatePath(filename: string): string { From 8b1c26180de22ab3a134634765cb7be3428682eb Mon Sep 17 00:00:00 2001 From: gagik Date: Thu, 20 Nov 2025 12:40:32 +0100 Subject: [PATCH 10/32] chore: remove compilation step --- packages/testing/{src => }/certificates/README.md | 0 .../testing/{src => }/certificates/ca-server.crl | 0 packages/testing/{src => }/certificates/ca.cnf | 0 packages/testing/{src => }/certificates/ca.crt | 0 packages/testing/{src => }/certificates/ca.db | 0 packages/testing/{src => }/certificates/ca.db.attr | 0 packages/testing/{src => }/certificates/ca.key | 0 packages/testing/{src => }/certificates/ca.serial | 0 .../certificates/client.bundle.encrypted.pem | 0 .../{src => }/certificates/client.bundle.pem | 0 .../{src => }/certificates/client.bundle.pfx | Bin .../{src => }/certificates/client.encrypted.key | 0 packages/testing/{src => }/certificates/client.key | 0 packages/testing/{src => }/certificates/client.pem | 0 .../certificates/invalid-client.bundle.pem | 0 .../{src => }/certificates/invalid-client.key | 0 packages/testing/{src => }/certificates/non-ca.crt | 0 packages/testing/{src => }/certificates/non-ca.key | 0 .../certificates/partial-trust-chain/ca.pem | 0 .../certificates/partial-trust-chain/cert.pem | 0 .../partial-trust-chain/key-and-cert.pem | 0 .../certificates/partial-trust-chain/key.pem | 0 .../certificates/server-invalidhost.bundle.pem | 0 .../{src => }/certificates/server-invalidhost.key | 0 .../{src => }/certificates/server.bundle.pem | 0 packages/testing/{src => }/certificates/server.key | 0 packages/testing/package.json | 5 ++--- packages/testing/src/index.ts | 2 +- packages/testing/tsconfig.json | 4 ++-- 29 files changed, 5 insertions(+), 6 deletions(-) rename packages/testing/{src => }/certificates/README.md (100%) rename packages/testing/{src => }/certificates/ca-server.crl (100%) rename packages/testing/{src => }/certificates/ca.cnf (100%) rename packages/testing/{src => }/certificates/ca.crt (100%) rename packages/testing/{src => }/certificates/ca.db (100%) rename packages/testing/{src => }/certificates/ca.db.attr (100%) rename packages/testing/{src => }/certificates/ca.key (100%) rename packages/testing/{src => }/certificates/ca.serial (100%) rename packages/testing/{src => }/certificates/client.bundle.encrypted.pem (100%) rename packages/testing/{src => }/certificates/client.bundle.pem (100%) rename packages/testing/{src => }/certificates/client.bundle.pfx (100%) rename packages/testing/{src => }/certificates/client.encrypted.key (100%) rename packages/testing/{src => }/certificates/client.key (100%) rename packages/testing/{src => }/certificates/client.pem (100%) rename packages/testing/{src => }/certificates/invalid-client.bundle.pem (100%) rename packages/testing/{src => }/certificates/invalid-client.key (100%) rename packages/testing/{src => }/certificates/non-ca.crt (100%) rename packages/testing/{src => }/certificates/non-ca.key (100%) rename packages/testing/{src => }/certificates/partial-trust-chain/ca.pem (100%) rename packages/testing/{src => }/certificates/partial-trust-chain/cert.pem (100%) rename packages/testing/{src => }/certificates/partial-trust-chain/key-and-cert.pem (100%) rename packages/testing/{src => }/certificates/partial-trust-chain/key.pem (100%) rename packages/testing/{src => }/certificates/server-invalidhost.bundle.pem (100%) rename packages/testing/{src => }/certificates/server-invalidhost.key (100%) rename packages/testing/{src => }/certificates/server.bundle.pem (100%) rename packages/testing/{src => }/certificates/server.key (100%) diff --git a/packages/testing/src/certificates/README.md b/packages/testing/certificates/README.md similarity index 100% rename from packages/testing/src/certificates/README.md rename to packages/testing/certificates/README.md diff --git a/packages/testing/src/certificates/ca-server.crl b/packages/testing/certificates/ca-server.crl similarity index 100% rename from packages/testing/src/certificates/ca-server.crl rename to packages/testing/certificates/ca-server.crl diff --git a/packages/testing/src/certificates/ca.cnf b/packages/testing/certificates/ca.cnf similarity index 100% rename from packages/testing/src/certificates/ca.cnf rename to packages/testing/certificates/ca.cnf diff --git a/packages/testing/src/certificates/ca.crt b/packages/testing/certificates/ca.crt similarity index 100% rename from packages/testing/src/certificates/ca.crt rename to packages/testing/certificates/ca.crt diff --git a/packages/testing/src/certificates/ca.db b/packages/testing/certificates/ca.db similarity index 100% rename from packages/testing/src/certificates/ca.db rename to packages/testing/certificates/ca.db diff --git a/packages/testing/src/certificates/ca.db.attr b/packages/testing/certificates/ca.db.attr similarity index 100% rename from packages/testing/src/certificates/ca.db.attr rename to packages/testing/certificates/ca.db.attr diff --git a/packages/testing/src/certificates/ca.key b/packages/testing/certificates/ca.key similarity index 100% rename from packages/testing/src/certificates/ca.key rename to packages/testing/certificates/ca.key diff --git a/packages/testing/src/certificates/ca.serial b/packages/testing/certificates/ca.serial similarity index 100% rename from packages/testing/src/certificates/ca.serial rename to packages/testing/certificates/ca.serial diff --git a/packages/testing/src/certificates/client.bundle.encrypted.pem b/packages/testing/certificates/client.bundle.encrypted.pem similarity index 100% rename from packages/testing/src/certificates/client.bundle.encrypted.pem rename to packages/testing/certificates/client.bundle.encrypted.pem diff --git a/packages/testing/src/certificates/client.bundle.pem b/packages/testing/certificates/client.bundle.pem similarity index 100% rename from packages/testing/src/certificates/client.bundle.pem rename to packages/testing/certificates/client.bundle.pem diff --git a/packages/testing/src/certificates/client.bundle.pfx b/packages/testing/certificates/client.bundle.pfx similarity index 100% rename from packages/testing/src/certificates/client.bundle.pfx rename to packages/testing/certificates/client.bundle.pfx diff --git a/packages/testing/src/certificates/client.encrypted.key b/packages/testing/certificates/client.encrypted.key similarity index 100% rename from packages/testing/src/certificates/client.encrypted.key rename to packages/testing/certificates/client.encrypted.key diff --git a/packages/testing/src/certificates/client.key b/packages/testing/certificates/client.key similarity index 100% rename from packages/testing/src/certificates/client.key rename to packages/testing/certificates/client.key diff --git a/packages/testing/src/certificates/client.pem b/packages/testing/certificates/client.pem similarity index 100% rename from packages/testing/src/certificates/client.pem rename to packages/testing/certificates/client.pem diff --git a/packages/testing/src/certificates/invalid-client.bundle.pem b/packages/testing/certificates/invalid-client.bundle.pem similarity index 100% rename from packages/testing/src/certificates/invalid-client.bundle.pem rename to packages/testing/certificates/invalid-client.bundle.pem diff --git a/packages/testing/src/certificates/invalid-client.key b/packages/testing/certificates/invalid-client.key similarity index 100% rename from packages/testing/src/certificates/invalid-client.key rename to packages/testing/certificates/invalid-client.key diff --git a/packages/testing/src/certificates/non-ca.crt b/packages/testing/certificates/non-ca.crt similarity index 100% rename from packages/testing/src/certificates/non-ca.crt rename to packages/testing/certificates/non-ca.crt diff --git a/packages/testing/src/certificates/non-ca.key b/packages/testing/certificates/non-ca.key similarity index 100% rename from packages/testing/src/certificates/non-ca.key rename to packages/testing/certificates/non-ca.key diff --git a/packages/testing/src/certificates/partial-trust-chain/ca.pem b/packages/testing/certificates/partial-trust-chain/ca.pem similarity index 100% rename from packages/testing/src/certificates/partial-trust-chain/ca.pem rename to packages/testing/certificates/partial-trust-chain/ca.pem diff --git a/packages/testing/src/certificates/partial-trust-chain/cert.pem b/packages/testing/certificates/partial-trust-chain/cert.pem similarity index 100% rename from packages/testing/src/certificates/partial-trust-chain/cert.pem rename to packages/testing/certificates/partial-trust-chain/cert.pem diff --git a/packages/testing/src/certificates/partial-trust-chain/key-and-cert.pem b/packages/testing/certificates/partial-trust-chain/key-and-cert.pem similarity index 100% rename from packages/testing/src/certificates/partial-trust-chain/key-and-cert.pem rename to packages/testing/certificates/partial-trust-chain/key-and-cert.pem diff --git a/packages/testing/src/certificates/partial-trust-chain/key.pem b/packages/testing/certificates/partial-trust-chain/key.pem similarity index 100% rename from packages/testing/src/certificates/partial-trust-chain/key.pem rename to packages/testing/certificates/partial-trust-chain/key.pem diff --git a/packages/testing/src/certificates/server-invalidhost.bundle.pem b/packages/testing/certificates/server-invalidhost.bundle.pem similarity index 100% rename from packages/testing/src/certificates/server-invalidhost.bundle.pem rename to packages/testing/certificates/server-invalidhost.bundle.pem diff --git a/packages/testing/src/certificates/server-invalidhost.key b/packages/testing/certificates/server-invalidhost.key similarity index 100% rename from packages/testing/src/certificates/server-invalidhost.key rename to packages/testing/certificates/server-invalidhost.key diff --git a/packages/testing/src/certificates/server.bundle.pem b/packages/testing/certificates/server.bundle.pem similarity index 100% rename from packages/testing/src/certificates/server.bundle.pem rename to packages/testing/certificates/server.bundle.pem diff --git a/packages/testing/src/certificates/server.key b/packages/testing/certificates/server.key similarity index 100% rename from packages/testing/src/certificates/server.key rename to packages/testing/certificates/server.key diff --git a/packages/testing/package.json b/packages/testing/package.json index e98d975a0b..e8e1baafff 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -4,8 +4,8 @@ "description": "MongoDB Shell Testing Utilities", "homepage": "https://github.com/mongodb-js/mongosh", "license": "Apache-2.0", - "main": "lib/index.js", - "types": "lib/index.d.ts", + "main": "src/index.ts", + "types": "src/index.ts", "private": true, "repository": { "type": "git", @@ -15,7 +15,6 @@ "node": ">=14.15.1" }, "scripts": { - "compile": "tsc -p tsconfig.json", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", "prettier": "prettier", diff --git a/packages/testing/src/index.ts b/packages/testing/src/index.ts index bf3a508a27..bc8f9b58a2 100644 --- a/packages/testing/src/index.ts +++ b/packages/testing/src/index.ts @@ -7,7 +7,7 @@ export * from './fake-kms'; /** * Path to the certificates directory containing test certificates */ -const TEST_CERTIFICATES_DIR = path.resolve(__dirname, 'certificates'); +const TEST_CERTIFICATES_DIR = path.resolve(__dirname, '..', 'certificates'); /** Get the path to a test certificate */ export function getTestCertificatePath(filename: string): string { diff --git a/packages/testing/tsconfig.json b/packages/testing/tsconfig.json index 53bf421d6c..8c8bebecf8 100644 --- a/packages/testing/tsconfig.json +++ b/packages/testing/tsconfig.json @@ -6,6 +6,6 @@ "declaration": true, "declarationMap": true }, - "include": ["src/**/*"], - "exclude": ["certificates", "lib"] + "include": ["src/**/*", "src/certificates/**/*"], + "exclude": ["lib"] } From 8ca19bc29b74fcec86c1592e5605418ef9931dfd Mon Sep 17 00:00:00 2001 From: gagik Date: Thu, 20 Nov 2025 13:02:17 +0100 Subject: [PATCH 11/32] chore: empty commit From e18ce6464106a37758cd9d5921cac23e029bb7ea Mon Sep 17 00:00:00 2001 From: gagik Date: Wed, 3 Dec 2025 10:46:13 +0100 Subject: [PATCH 12/32] chore: adjust testing file directory --- .evergreen/setup-env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/setup-env.sh b/.evergreen/setup-env.sh index 99b7e1d0ad..6208c20420 100755 --- a/.evergreen/setup-env.sh +++ b/.evergreen/setup-env.sh @@ -5,7 +5,7 @@ OS_ARCH="$(uname "-m")" export BASEDIR="$PWD/.evergreen" export PATH="$BASEDIR/node-v$NODE_JS_VERSION-win-x64:/opt/java/jdk17/bin:$PATH" -export MONGOSH_GLOBAL_CONFIG_FILE_FOR_TESTING="$BASEDIR/../../testing/tests-globalconfig.conf" +export MONGOSH_GLOBAL_CONFIG_FILE_FOR_TESTING="$BASEDIR/../../packages/testing/tests-globalconfig.conf" export IS_MONGOSH_EVERGREEN_CI=1 export DEBUG="mongodb*,$DEBUG" From 48cec6d00e79d15096b798f636b35d5557ae94ce Mon Sep 17 00:00:00 2001 From: gagik Date: Wed, 3 Dec 2025 12:00:51 +0100 Subject: [PATCH 13/32] chore: fix global file? --- .evergreen/setup-env.sh | 2 +- .mocharc.json | 4 ++-- packages/connectivity-tests/.mocharc.json | 2 +- packages/testing/.mocharc.json | 4 ++++ 4 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 packages/testing/.mocharc.json diff --git a/.evergreen/setup-env.sh b/.evergreen/setup-env.sh index 6208c20420..683991ba95 100755 --- a/.evergreen/setup-env.sh +++ b/.evergreen/setup-env.sh @@ -5,7 +5,7 @@ OS_ARCH="$(uname "-m")" export BASEDIR="$PWD/.evergreen" export PATH="$BASEDIR/node-v$NODE_JS_VERSION-win-x64:/opt/java/jdk17/bin:$PATH" -export MONGOSH_GLOBAL_CONFIG_FILE_FOR_TESTING="$BASEDIR/../../packages/testing/tests-globalconfig.conf" +export MONGOSH_GLOBAL_CONFIG_FILE_FOR_TESTING="$BASEDIR/../packages/testing/tests-globalconfig.conf" export IS_MONGOSH_EVERGREEN_CI=1 export DEBUG="mongodb*,$DEBUG" diff --git a/.mocharc.json b/.mocharc.json index a59721fa5b..e82358431f 100644 --- a/.mocharc.json +++ b/.mocharc.json @@ -1,5 +1,5 @@ { - "spec": ["testing/dummy.spec.ts"], - "exclude": ["packages/**", "node_modules/**"], + "spec": ["packages/testing/dummy.spec.ts"], + "exclude": ["node_modules/**"], "node-option": ["no-experimental-strip-types=true"] } diff --git a/packages/connectivity-tests/.mocharc.json b/packages/connectivity-tests/.mocharc.json index 3dca75e7be..64f621e14c 100644 --- a/packages/connectivity-tests/.mocharc.json +++ b/packages/connectivity-tests/.mocharc.json @@ -1,4 +1,4 @@ { - "spec": "../../testing/dummy.spec.ts", + "spec": "../testing/dummy.spec.ts", "exclude": "**/**" } diff --git a/packages/testing/.mocharc.json b/packages/testing/.mocharc.json new file mode 100644 index 0000000000..b595a3ef90 --- /dev/null +++ b/packages/testing/.mocharc.json @@ -0,0 +1,4 @@ +{ + "spec": "./dummy.spec.ts", + "exclude": "**/**" +} From f10f53ff42fe4617517207e13bbe93b8683d7aa2 Mon Sep 17 00:00:00 2001 From: gagik Date: Wed, 3 Dec 2025 13:58:15 +0100 Subject: [PATCH 14/32] chore: use 6.0 mongodb-runner --- package-lock.json | 4 ++-- package.json | 2 +- packages/testing/package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index edf0bbf71e..18e8d83980 100644 --- a/package-lock.json +++ b/package-lock.json @@ -62,7 +62,7 @@ "husky": "^9.0.11", "mocha": "^10.2.0", "mongodb": "^6.19.0", - "mongodb-runner": "^6.2.0", + "mongodb-runner": "^6.0.0", "node-gyp": "^11.5.0", "nyc": "^15.1.0", "pkg-up": "^3.1.0", @@ -38503,7 +38503,7 @@ "duplexpair": "^1.0.2", "mongodb": "^6.19.0", "mongodb-connection-string-url": "^3.0.1", - "mongodb-runner": "^6.2.0", + "mongodb-runner": "^6.0.0", "semver": "^7.3.4", "which": "^2.0.2" }, diff --git a/package.json b/package.json index 32a1804509..d500a8a49d 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,7 @@ "husky": "^9.0.11", "mocha": "^10.2.0", "mongodb": "^6.19.0", - "mongodb-runner": "^6.2.0", + "mongodb-runner": "^6.0.0", "node-gyp": "^11.5.0", "nyc": "^15.1.0", "pkg-up": "^3.1.0", diff --git a/packages/testing/package.json b/packages/testing/package.json index e921223843..9217e9a3dd 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -25,7 +25,7 @@ "duplexpair": "^1.0.2", "mongodb": "^6.19.0", "mongodb-connection-string-url": "^3.0.1", - "mongodb-runner": "^6.2.0", + "mongodb-runner": "^6.0.0", "semver": "^7.3.4", "which": "^2.0.2" }, From 486e1013e3478e53b29e863a43549de2f2ec130d Mon Sep 17 00:00:00 2001 From: gagik Date: Wed, 3 Dec 2025 14:30:30 +0100 Subject: [PATCH 15/32] chore: sanity check: import directly --- .../src/components/editor.spec.tsx | 4 +-- .../src/components/shell-input.spec.tsx | 4 +-- .../src/components/shell-output-line.spec.tsx | 4 +-- .../src/components/shell-output.spec.tsx | 4 +-- .../src/components/shell.spec.tsx | 2 +- .../cursor-iteration-result-output.spec.tsx | 4 +-- .../components/types/cursor-output.spec.tsx | 4 +-- .../components/types/error-output.spec.tsx | 4 +-- .../src/components/types/help-output.spec.tsx | 6 ++-- .../types/show-collections-output.spec.tsx | 4 +-- .../components/types/show-dbs-output.spec.tsx | 4 +-- .../src/components/utils/expandable.spec.tsx | 4 +-- .../components/utils/line-with-icon.spec.tsx | 4 +-- .../utils/syntax-highlight.spec.tsx | 4 +-- .../src/iframe-runtime/iframe-runtime.spec.ts | 2 +- packages/e2e-tests/package.json | 7 ++--- packages/e2e-tests/test/e2e-analytics.spec.ts | 3 +- packages/e2e-tests/test/e2e-auth.spec.ts | 6 ++-- packages/e2e-tests/test/e2e-banners.spec.ts | 5 ++- packages/e2e-tests/test/e2e-bson.spec.ts | 2 +- packages/e2e-tests/test/e2e-direct.spec.ts | 4 +-- packages/e2e-tests/test/e2e-editor.spec.ts | 2 +- packages/e2e-tests/test/e2e-fle.spec.ts | 8 +++-- packages/e2e-tests/test/e2e-oidc.spec.ts | 11 +++---- packages/e2e-tests/test/e2e-proxy.spec.ts | 13 +++++--- packages/e2e-tests/test/e2e-snapshot.spec.ts | 5 ++- packages/e2e-tests/test/e2e-snippet.spec.ts | 2 +- packages/e2e-tests/test/e2e-streams.spec.ts | 2 +- packages/e2e-tests/test/e2e-tls.spec.ts | 31 ++++++++----------- packages/e2e-tests/test/e2e.spec.ts | 8 ++--- packages/e2e-tests/test/repl-helpers.ts | 15 ++++++++- packages/e2e-tests/test/test-shell.ts | 2 +- 32 files changed, 102 insertions(+), 82 deletions(-) diff --git a/packages/browser-repl/src/components/editor.spec.tsx b/packages/browser-repl/src/components/editor.spec.tsx index d5155bd783..433f9e31b1 100644 --- a/packages/browser-repl/src/components/editor.spec.tsx +++ b/packages/browser-repl/src/components/editor.spec.tsx @@ -1,8 +1,8 @@ import sinon from 'sinon'; -import { expect } from '../../testing/chai'; +import { expect } from '../../testing/src/chai'; import { Editor, createCommands } from './editor'; import type { Command } from '@mongodb-js/compass-editor'; -import { shallow } from '../../testing/enzyme'; +import { shallow } from '../../testing/src/enzyme'; import React from 'react'; describe('', function () { diff --git a/packages/browser-repl/src/components/shell-input.spec.tsx b/packages/browser-repl/src/components/shell-input.spec.tsx index 611ee972d4..a2700e890b 100644 --- a/packages/browser-repl/src/components/shell-input.spec.tsx +++ b/packages/browser-repl/src/components/shell-input.spec.tsx @@ -1,7 +1,7 @@ import React from 'react'; import sinon from 'sinon'; -import { expect } from '../../testing/chai'; -import { shallow, mount } from '../../testing/enzyme'; +import { expect } from '../../testing/src/chai'; +import { shallow, mount } from '../../testing/src/enzyme'; import { ShellInput } from './shell-input'; import { Editor } from './editor'; diff --git a/packages/browser-repl/src/components/shell-output-line.spec.tsx b/packages/browser-repl/src/components/shell-output-line.spec.tsx index 87ce1091b9..03b0c76f69 100644 --- a/packages/browser-repl/src/components/shell-output-line.spec.tsx +++ b/packages/browser-repl/src/components/shell-output-line.spec.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { expect } from '../../testing/chai'; -import { shallow, mount } from '../../testing/enzyme'; +import { expect } from '../../testing/src/chai'; +import { shallow, mount } from '../../testing/src/enzyme'; import { ShellOutputLine } from './shell-output-line'; import { HelpOutput } from './types/help-output'; diff --git a/packages/browser-repl/src/components/shell-output.spec.tsx b/packages/browser-repl/src/components/shell-output.spec.tsx index eb906dc0ae..23acd7694f 100644 --- a/packages/browser-repl/src/components/shell-output.spec.tsx +++ b/packages/browser-repl/src/components/shell-output.spec.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { expect } from '../../testing/chai'; -import { shallow } from '../../testing/enzyme'; +import { expect } from '../../testing/src/chai'; +import { shallow } from '../../testing/src/enzyme'; import type { ShellOutputEntry } from './shell-output-line'; import { ShellOutputLine } from './shell-output-line'; diff --git a/packages/browser-repl/src/components/shell.spec.tsx b/packages/browser-repl/src/components/shell.spec.tsx index 17f9e8764c..4607be6a0a 100644 --- a/packages/browser-repl/src/components/shell.spec.tsx +++ b/packages/browser-repl/src/components/shell.spec.tsx @@ -3,7 +3,7 @@ import React, { useState, useEffect } from 'react'; import sinon from 'sinon'; import { render, screen, waitFor, configure } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { expect } from '../../testing/chai'; +import { expect } from '../../testing/src/chai'; import { Shell } from './shell'; import type { ShellOutputEntry } from './shell-output-line'; diff --git a/packages/browser-repl/src/components/types/cursor-iteration-result-output.spec.tsx b/packages/browser-repl/src/components/types/cursor-iteration-result-output.spec.tsx index 7e54fa0f7f..50f4ad4e63 100644 --- a/packages/browser-repl/src/components/types/cursor-iteration-result-output.spec.tsx +++ b/packages/browser-repl/src/components/types/cursor-iteration-result-output.spec.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { expect } from '../../../testing/chai'; -import { shallow } from '../../../testing/enzyme'; +import { expect } from '../../testing/src/chai'; +import { shallow } from '../../testing/src/enzyme'; import { CursorIterationResultOutput } from './cursor-iteration-result-output'; import { ObjectOutput } from './object-output'; diff --git a/packages/browser-repl/src/components/types/cursor-output.spec.tsx b/packages/browser-repl/src/components/types/cursor-output.spec.tsx index f45f0473ea..0c17826b07 100644 --- a/packages/browser-repl/src/components/types/cursor-output.spec.tsx +++ b/packages/browser-repl/src/components/types/cursor-output.spec.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { expect } from '../../../testing/chai'; -import { shallow, mount } from '../../../testing/enzyme'; +import { expect } from '../../testing/src/chai'; +import { shallow, mount } from '../../testing/src/enzyme'; import { CursorOutput } from './cursor-output'; import { CursorIterationResultOutput } from './cursor-iteration-result-output'; diff --git a/packages/browser-repl/src/components/types/error-output.spec.tsx b/packages/browser-repl/src/components/types/error-output.spec.tsx index 2a46a6646b..0c736dd6ef 100644 --- a/packages/browser-repl/src/components/types/error-output.spec.tsx +++ b/packages/browser-repl/src/components/types/error-output.spec.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { expect } from '../../../testing/chai'; -import { render, mount } from '../../../testing/enzyme'; +import { expect } from '../../testing/src/chai'; +import { render, mount } from '../../testing/src/enzyme'; import { ErrorOutput } from './error-output'; diff --git a/packages/browser-repl/src/components/types/help-output.spec.tsx b/packages/browser-repl/src/components/types/help-output.spec.tsx index b7edab240e..29d0e6e2b3 100644 --- a/packages/browser-repl/src/components/types/help-output.spec.tsx +++ b/packages/browser-repl/src/components/types/help-output.spec.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import { expect } from '../../../testing/chai'; -import type { ShallowWrapper } from '../../../testing/enzyme'; -import { shallow } from '../../../testing/enzyme'; +import { expect } from '../../testing/src/chai'; +import type { ShallowWrapper } from '../../testing/src/enzyme'; +import { shallow } from '../../testing/src/enzyme'; import { HelpOutput } from './help-output'; diff --git a/packages/browser-repl/src/components/types/show-collections-output.spec.tsx b/packages/browser-repl/src/components/types/show-collections-output.spec.tsx index 99daa7cb46..03d806c9d7 100644 --- a/packages/browser-repl/src/components/types/show-collections-output.spec.tsx +++ b/packages/browser-repl/src/components/types/show-collections-output.spec.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { expect } from '../../../testing/chai'; -import { shallow } from '../../../testing/enzyme'; +import { expect } from '../../testing/src/chai'; +import { shallow } from '../../testing/src/enzyme'; import { ShowCollectionsOutput } from './show-collections-output'; diff --git a/packages/browser-repl/src/components/types/show-dbs-output.spec.tsx b/packages/browser-repl/src/components/types/show-dbs-output.spec.tsx index c8f1df9e70..5753bc5636 100644 --- a/packages/browser-repl/src/components/types/show-dbs-output.spec.tsx +++ b/packages/browser-repl/src/components/types/show-dbs-output.spec.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { expect } from '../../../testing/chai'; -import { shallow } from '../../../testing/enzyme'; +import { expect } from '../../testing/src/chai'; +import { shallow } from '../../testing/src/enzyme'; import { ShowDbsOutput } from './show-dbs-output'; diff --git a/packages/browser-repl/src/components/utils/expandable.spec.tsx b/packages/browser-repl/src/components/utils/expandable.spec.tsx index 588774d868..df55cf9698 100644 --- a/packages/browser-repl/src/components/utils/expandable.spec.tsx +++ b/packages/browser-repl/src/components/utils/expandable.spec.tsx @@ -1,8 +1,8 @@ import React from 'react'; import sinon from 'sinon'; import { Icon } from '@mongodb-js/compass-components'; -import { expect } from '../../../testing/chai'; -import { mount } from '../../../testing/enzyme'; +import { expect } from '../../testing/src/chai'; +import { mount } from '../../testing/src/enzyme'; import { Expandable } from './expandable'; describe('', function () { diff --git a/packages/browser-repl/src/components/utils/line-with-icon.spec.tsx b/packages/browser-repl/src/components/utils/line-with-icon.spec.tsx index 4e684601d5..88084797c3 100644 --- a/packages/browser-repl/src/components/utils/line-with-icon.spec.tsx +++ b/packages/browser-repl/src/components/utils/line-with-icon.spec.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { expect } from '../../../testing/chai'; -import { shallow } from '../../../testing/enzyme'; +import { expect } from '../../testing/src/chai'; +import { shallow } from '../../testing/src/enzyme'; import { LineWithIcon } from './line-with-icon'; describe('', function () { diff --git a/packages/browser-repl/src/components/utils/syntax-highlight.spec.tsx b/packages/browser-repl/src/components/utils/syntax-highlight.spec.tsx index 37d09393ed..9ca1447f8b 100644 --- a/packages/browser-repl/src/components/utils/syntax-highlight.spec.tsx +++ b/packages/browser-repl/src/components/utils/syntax-highlight.spec.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { CodemirrorInlineEditor } from '@mongodb-js/compass-editor'; -import { expect } from '../../../testing/chai'; -import { mount } from '../../../testing/enzyme'; +import { expect } from '../../testing/src/chai'; +import { mount } from '../../testing/src/enzyme'; import { SyntaxHighlight } from './syntax-highlight'; describe('', function () { diff --git a/packages/browser-repl/src/iframe-runtime/iframe-runtime.spec.ts b/packages/browser-repl/src/iframe-runtime/iframe-runtime.spec.ts index 60f8d86b19..a8558b3119 100644 --- a/packages/browser-repl/src/iframe-runtime/iframe-runtime.spec.ts +++ b/packages/browser-repl/src/iframe-runtime/iframe-runtime.spec.ts @@ -1,5 +1,5 @@ import { IframeRuntime } from './iframe-runtime'; -import { expect } from '../../testing/chai'; +import { expect } from '../../testing/src/chai'; import type { ServiceProvider } from '@mongosh/service-provider-core'; import * as bson from 'bson'; diff --git a/packages/e2e-tests/package.json b/packages/e2e-tests/package.json index 2466c649d4..5f45f2174b 100644 --- a/packages/e2e-tests/package.json +++ b/packages/e2e-tests/package.json @@ -1,6 +1,6 @@ { "name": "@mongosh/e2e-tests", - "version": "3.16.7", + "version": "3.17.0", "private": true, "description": "MongoDB Shell E2E Tests Package", "homepage": "https://github.com/mongodb-js/mongosh", @@ -28,7 +28,7 @@ }, "dependencies": { "@mongosh/cli-repl": "2.5.10", - "@mongosh/service-provider-core": "3.6.5", + "@mongosh/service-provider-core": "3.7.0", "@mongodb-js/oidc-plugin": "^2.0.5", "strip-ansi": "^6.0.0" }, @@ -50,7 +50,6 @@ "mongodb": "^6.19.0", "node-fetch": "^3.3.2", "prettier": "^2.8.8", - "rimraf": "^3.0.2", - "@mongosh/testing": "0.0.0-dev.0" + "rimraf": "^3.0.2" } } diff --git a/packages/e2e-tests/test/e2e-analytics.spec.ts b/packages/e2e-tests/test/e2e-analytics.spec.ts index 9ec901793b..40e6b4560d 100644 --- a/packages/e2e-tests/test/e2e-analytics.spec.ts +++ b/packages/e2e-tests/test/e2e-analytics.spec.ts @@ -1,5 +1,6 @@ import { expect } from 'chai'; -import { startTestCluster, eventually } from '@mongosh/testing'; +import { startTestCluster } from '../../testing/src/integration-testing-hooks'; +import { eventually } from '../../testing/src/eventually'; describe('e2e Analytics Node', function () { const replSetName = 'replicaSet'; diff --git a/packages/e2e-tests/test/e2e-auth.spec.ts b/packages/e2e-tests/test/e2e-auth.spec.ts index cc9881d187..b1a9ed5d49 100644 --- a/packages/e2e-tests/test/e2e-auth.spec.ts +++ b/packages/e2e-tests/test/e2e-auth.spec.ts @@ -1,12 +1,12 @@ import { expect } from 'chai'; import type { Db, Document, MongoClientOptions } from 'mongodb'; import { MongoClient } from 'mongodb'; +import { eventually } from '../../testing/src/eventually'; +import type { TestShell } from './test-shell'; import { - eventually, skipIfApiStrict, startSharedTestServer, -} from '@mongosh/testing'; -import type { TestShell } from './test-shell'; +} from '../../testing/src/integration-testing-hooks'; type AssertUserExists = (opts?: Document, username?: string) => Promise; function createAssertUserExists(db: Db, dbName: string): AssertUserExists { diff --git a/packages/e2e-tests/test/e2e-banners.spec.ts b/packages/e2e-tests/test/e2e-banners.spec.ts index c9f6412e7c..5e2300add8 100644 --- a/packages/e2e-tests/test/e2e-banners.spec.ts +++ b/packages/e2e-tests/test/e2e-banners.spec.ts @@ -1,4 +1,7 @@ -import { skipIfApiStrict, startSharedTestServer } from '@mongosh/testing'; +import { + skipIfApiStrict, + startSharedTestServer, +} from '../../testing/src/integration-testing-hooks'; import type { TestShell } from './test-shell'; describe('e2e startup banners', function () { diff --git a/packages/e2e-tests/test/e2e-bson.spec.ts b/packages/e2e-tests/test/e2e-bson.spec.ts index 159691017b..e84942bd09 100644 --- a/packages/e2e-tests/test/e2e-bson.spec.ts +++ b/packages/e2e-tests/test/e2e-bson.spec.ts @@ -3,7 +3,7 @@ import type { Db } from 'mongodb'; import { MongoClient } from 'mongodb'; import * as bson from 'bson'; import type { TestShell } from './test-shell'; -import { startSharedTestServer } from '@mongosh/testing'; +import { startSharedTestServer } from '../../testing/src/integration-testing-hooks'; describe('BSON e2e', function () { const testServer = startSharedTestServer(); diff --git a/packages/e2e-tests/test/e2e-direct.spec.ts b/packages/e2e-tests/test/e2e-direct.spec.ts index 9e2599878c..3496075d8c 100644 --- a/packages/e2e-tests/test/e2e-direct.spec.ts +++ b/packages/e2e-tests/test/e2e-direct.spec.ts @@ -2,8 +2,8 @@ import { startTestCluster, skipIfServerVersion, skipIfApiStrict, - eventually, -} from '@mongosh/testing'; +} from '../../testing/src/integration-testing-hooks'; +import { eventually } from '../../testing/src/eventually'; import { expect } from 'chai'; import type { TestShell } from './test-shell'; diff --git a/packages/e2e-tests/test/e2e-editor.spec.ts b/packages/e2e-tests/test/e2e-editor.spec.ts index a11239bb7f..eaf0da3b0a 100644 --- a/packages/e2e-tests/test/e2e-editor.spec.ts +++ b/packages/e2e-tests/test/e2e-editor.spec.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; import path from 'path'; import { promises as fs } from 'fs'; -import { eventually } from '@mongosh/testing'; +import { eventually } from '../../testing/src/eventually'; import { TestShell } from './test-shell'; import { ensureTestShellAfterHook } from './test-shell-context'; import { diff --git a/packages/e2e-tests/test/e2e-fle.spec.ts b/packages/e2e-tests/test/e2e-fle.spec.ts index f678d90de0..f0f9ddc6f6 100644 --- a/packages/e2e-tests/test/e2e-fle.spec.ts +++ b/packages/e2e-tests/test/e2e-fle.spec.ts @@ -1,17 +1,19 @@ import { expect } from 'chai'; import { MongoClient } from 'mongodb'; import type { TestShell } from './test-shell'; +import { eventually } from '../../testing/src/eventually'; import { - eventually, startTestServer, skipIfApiStrict, skipIfServerVersion, skipIfCommunityServer, downloadCurrentCryptSharedLibrary, sortObjectArray, +} from '../../testing/src/integration-testing-hooks'; +import { makeFakeHTTPServer, fakeAWSHandlers, -} from '@mongosh/testing'; +} from '../../testing/src/fake-kms'; import { once } from 'events'; import { serialize } from 'v8'; import { inspect } from 'util'; @@ -30,6 +32,8 @@ describe('FLE tests', function () { let cryptLibrary82: string; before(async function () { + this.timeout(120_000); // Downloading the crypt-shared library can take some time + if (process.platform === 'linux') { const [major, minor] = (process.report as any) .getReport() diff --git a/packages/e2e-tests/test/e2e-oidc.spec.ts b/packages/e2e-tests/test/e2e-oidc.spec.ts index 019f0abe97..a8ac8a772c 100644 --- a/packages/e2e-tests/test/e2e-oidc.spec.ts +++ b/packages/e2e-tests/test/e2e-oidc.spec.ts @@ -2,8 +2,7 @@ import { MongoRunnerSetup, skipIfApiStrict, skipIfEnvServerVersion, - getTestCertificatePath, -} from '@mongosh/testing'; +} from '../../testing/src/integration-testing-hooks'; import { promises as fs } from 'fs'; import type { OIDCMockProviderConfig } from '@mongodb-js/oidc-mock-provider'; import { OIDCMockProvider } from '@mongodb-js/oidc-mock-provider'; @@ -11,7 +10,7 @@ import type { TestShell } from './test-shell'; import path from 'path'; import { expect } from 'chai'; import { createServer as createHTTPSServer } from 'https'; -import { readReplLogFile, useTmpdir } from './repl-helpers'; +import { getCertPath, readReplLogFile, useTmpdir } from './repl-helpers'; import { baseOidcServerConfig, commonOidcServerArgs, @@ -68,7 +67,7 @@ describe('OIDC auth e2e', function () { }, }; const httpsServerKeyCertBundle = await fs.readFile( - getTestCertificatePath('server.bundle.pem') + getCertPath('server.bundle.pem') ); [oidcMockProvider, oidcMockProviderHttps] = await Promise.all([ OIDCMockProvider.create(oidcMockProviderConfig), @@ -412,7 +411,7 @@ describe('OIDC auth e2e', function () { it('can specify --tlsUseSystemCA as a no-op', async function () { await fs.mkdir(path.join(tmpdir.path, 'certs'), { recursive: true }); await fs.copyFile( - getTestCertificatePath('ca.crt'), + getCertPath('ca.crt'), path.join(tmpdir.path, 'certs', 'somefilename.crt') ); @@ -442,7 +441,7 @@ describe('OIDC auth e2e', function () { it('uses system ca by default when calling the IdP https endpoint', async function () { await fs.mkdir(path.join(tmpdir.path, 'certs'), { recursive: true }); await fs.copyFile( - getTestCertificatePath('ca.crt'), + getCertPath('ca.crt'), path.join(tmpdir.path, 'certs', 'somefilename.crt') ); diff --git a/packages/e2e-tests/test/e2e-proxy.spec.ts b/packages/e2e-tests/test/e2e-proxy.spec.ts index 23910ca60f..b120abeb5b 100644 --- a/packages/e2e-tests/test/e2e-proxy.spec.ts +++ b/packages/e2e-tests/test/e2e-proxy.spec.ts @@ -10,11 +10,14 @@ import { skipIfEnvServerVersion, startSharedTestServer, startTestServer, - getTestCertificatePath, -} from '@mongosh/testing'; +} from '../../testing/src/integration-testing-hooks'; import type { Server as HTTPSServer } from 'https'; import { createServer as createHTTPSServer } from 'https'; -import { connectionStringWithLocalhost, useTmpdir } from './repl-helpers'; +import { + connectionStringWithLocalhost, + getCertPath, + useTmpdir, +} from './repl-helpers'; import { once } from 'events'; import { connect } from 'net'; import type { AddressInfo, Socket } from 'net'; @@ -29,8 +32,8 @@ import { skipOIDCTestsDueToPlatformOrServerVersion, } from './oidc-helpers'; -const CA_CERT = getTestCertificatePath('ca.crt'); -const SERVER_BUNDLE = getTestCertificatePath('server.bundle.pem'); +const CA_CERT = getCertPath('ca.crt'); +const SERVER_BUNDLE = getCertPath('server.bundle.pem'); describe('e2e proxy support', function () { skipIfApiStrict(); diff --git a/packages/e2e-tests/test/e2e-snapshot.spec.ts b/packages/e2e-tests/test/e2e-snapshot.spec.ts index 201fa26a97..29f83612af 100644 --- a/packages/e2e-tests/test/e2e-snapshot.spec.ts +++ b/packages/e2e-tests/test/e2e-snapshot.spec.ts @@ -1,4 +1,7 @@ -import { skipIfApiStrict, startSharedTestServer } from '@mongosh/testing'; +import { + skipIfApiStrict, + startSharedTestServer, +} from '../../testing/src/integration-testing-hooks'; import { expect } from 'chai'; const setDifference = (a: T[], b: T[]) => a.filter((e) => !b.includes(e)); diff --git a/packages/e2e-tests/test/e2e-snippet.spec.ts b/packages/e2e-tests/test/e2e-snippet.spec.ts index 58a7427568..c79b63e658 100644 --- a/packages/e2e-tests/test/e2e-snippet.spec.ts +++ b/packages/e2e-tests/test/e2e-snippet.spec.ts @@ -3,7 +3,7 @@ import path from 'path'; import { expect } from 'chai'; import type { TestShell } from './test-shell'; import { useTmpdir } from './repl-helpers'; -import { eventually } from '@mongosh/testing'; +import { eventually } from '../../testing/src/eventually'; describe('snippet integration tests', function () { this.timeout(120_000); diff --git a/packages/e2e-tests/test/e2e-streams.spec.ts b/packages/e2e-tests/test/e2e-streams.spec.ts index 1ec70cb269..914b390ead 100644 --- a/packages/e2e-tests/test/e2e-streams.spec.ts +++ b/packages/e2e-tests/test/e2e-streams.spec.ts @@ -4,7 +4,7 @@ import { MongoClient } from 'mongodb'; import { expect } from 'chai'; import type { TestShell } from './test-shell'; import { sleep } from './util-helpers'; -import { eventually } from '@mongosh/testing'; +import { eventually } from '../../testing/src/eventually'; const { STREAMS_E2E_SPI_CONNECTION_STRING = '', diff --git a/packages/e2e-tests/test/e2e-tls.spec.ts b/packages/e2e-tests/test/e2e-tls.spec.ts index 6d763f3b4f..8101faa35a 100644 --- a/packages/e2e-tests/test/e2e-tls.spec.ts +++ b/packages/e2e-tests/test/e2e-tls.spec.ts @@ -1,32 +1,27 @@ import { expect } from 'chai'; import { promises as fs } from 'fs'; import path from 'path'; -import { startTestServer, getTestCertificatePath } from '@mongosh/testing'; +import { startTestServer } from '../../testing/src/integration-testing-hooks'; import { useTmpdir, setTemporaryHomeDirectory, readReplLogFile, + getCertPath, connectionStringWithLocalhost, } from './repl-helpers'; -const CA_CERT = getTestCertificatePath('ca.crt'); -const NON_CA_CERT = getTestCertificatePath('non-ca.crt'); -const CLIENT_CERT = getTestCertificatePath('client.bundle.pem'); -const CLIENT_CERT_PFX = getTestCertificatePath('client.bundle.pfx'); -const CLIENT_CERT_ENCRYPTED = getTestCertificatePath( - 'client.bundle.encrypted.pem' -); +const CA_CERT = getCertPath('ca.crt'); +const NON_CA_CERT = getCertPath('non-ca.crt'); +const CLIENT_CERT = getCertPath('client.bundle.pem'); +const CLIENT_CERT_PFX = getCertPath('client.bundle.pfx'); +const CLIENT_CERT_ENCRYPTED = getCertPath('client.bundle.encrypted.pem'); const CLIENT_CERT_PASSWORD = 'p4ssw0rd'; -const INVALID_CLIENT_CERT = getTestCertificatePath('invalid-client.bundle.pem'); -const SERVER_KEY = getTestCertificatePath('server.bundle.pem'); -const SERVER_INVALIDHOST_KEY = getTestCertificatePath( - 'server-invalidhost.bundle.pem' -); -const CRL_INCLUDING_SERVER = getTestCertificatePath('ca-server.crl'); -const PARTIAL_TRUST_CHAIN_CA = getTestCertificatePath( - 'partial-trust-chain/ca.pem' -); -const PARTIAL_TRUST_CHAIN_KEY_AND_CERT = getTestCertificatePath( +const INVALID_CLIENT_CERT = getCertPath('invalid-client.bundle.pem'); +const SERVER_KEY = getCertPath('server.bundle.pem'); +const SERVER_INVALIDHOST_KEY = getCertPath('server-invalidhost.bundle.pem'); +const CRL_INCLUDING_SERVER = getCertPath('ca-server.crl'); +const PARTIAL_TRUST_CHAIN_CA = getCertPath('partial-trust-chain/ca.pem'); +const PARTIAL_TRUST_CHAIN_KEY_AND_CERT = getCertPath( 'partial-trust-chain/key-and-cert.pem' ); diff --git a/packages/e2e-tests/test/e2e.spec.ts b/packages/e2e-tests/test/e2e.spec.ts index 5ea2bcf2d0..7adc59e31b 100644 --- a/packages/e2e-tests/test/e2e.spec.ts +++ b/packages/e2e-tests/test/e2e.spec.ts @@ -3,13 +3,13 @@ import { expect } from 'chai'; import type { Db } from 'mongodb'; import { MongoClient, ObjectId } from 'mongodb'; +import { eventually } from '../../testing/src/eventually'; +import { TestShell } from './test-shell'; +import { ensureTestShellAfterHook } from './test-shell-context'; import { - eventually, skipIfServerVersion, startSharedTestServer, -} from '@mongosh/testing'; -import { TestShell } from './test-shell'; -import { ensureTestShellAfterHook } from './test-shell-context'; +} from '../../testing/src/integration-testing-hooks'; import { promises as fs, createReadStream } from 'fs'; import { promisify } from 'util'; import path from 'path'; diff --git a/packages/e2e-tests/test/repl-helpers.ts b/packages/e2e-tests/test/repl-helpers.ts index 8fea5acfeb..0d0ddab915 100644 --- a/packages/e2e-tests/test/repl-helpers.ts +++ b/packages/e2e-tests/test/repl-helpers.ts @@ -5,7 +5,7 @@ import rimraf from 'rimraf'; import * as chai from 'chai'; import sinonChai from 'sinon-chai'; import chaiAsPromised from 'chai-as-promised'; -import type { MongodSetup } from '@mongosh/testing'; +import type { MongodSetup } from '../../testing/src/integration-testing-hooks'; import type { MongoLogEntry } from 'mongodb-log-writer'; chai.use(sinonChai); @@ -140,6 +140,18 @@ const setTemporaryHomeDirectory = () => { return { homedir, env }; }; +function getCertPath(filename: string): string { + return path.join( + __dirname, + '..', + '..', + '..', + 'testing', + 'certificates', + filename + ); +} + // TLS requires matching hostnames, so here we need to explicitly // specify `localhost` + IPv4 instead of `127.0.0.1` async function connectionStringWithLocalhost( @@ -162,6 +174,7 @@ export { readReplLogFile, fakeExternalEditor, setTemporaryHomeDirectory, + getCertPath, connectionStringWithLocalhost, MongoLogEntryFromFile, }; diff --git a/packages/e2e-tests/test/test-shell.ts b/packages/e2e-tests/test/test-shell.ts index 4b9dd1603b..9bdeaed011 100644 --- a/packages/e2e-tests/test/test-shell.ts +++ b/packages/e2e-tests/test/test-shell.ts @@ -9,7 +9,7 @@ import { inspect } from 'util'; import path from 'path'; import stripAnsi from 'strip-ansi'; import { EJSON } from 'bson'; -import { eventually } from '@mongosh/testing'; +import { eventually } from '../../testing/src/eventually'; /* eslint-disable mocha/no-exports -- This file export hooks wrapping Mocha's Hooks APIs */ From cc857c05316c98e687f463852eedf1188acaa23a Mon Sep 17 00:00:00 2001 From: gagik Date: Wed, 3 Dec 2025 14:36:04 +0100 Subject: [PATCH 16/32] chore: service-provider alignment --- package-lock.json | 3 +-- packages/e2e-tests/package.json | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 18e8d83980..4cc2a6b2db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37892,7 +37892,7 @@ }, "packages/e2e-tests": { "name": "@mongosh/e2e-tests", - "version": "3.16.7", + "version": "3.17.0", "license": "Apache-2.0", "dependencies": { "@mongodb-js/oidc-plugin": "^2.0.5", @@ -37905,7 +37905,6 @@ "@mongodb-js/oidc-mock-provider": "^0.11.3", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", - "@mongosh/testing": "0.0.0-dev.0", "@types/chai-as-promised": "^8.0.2", "@types/node": "^22.15.30", "@types/rimraf": "^3.0.0", diff --git a/packages/e2e-tests/package.json b/packages/e2e-tests/package.json index 5f45f2174b..2b8b3028c9 100644 --- a/packages/e2e-tests/package.json +++ b/packages/e2e-tests/package.json @@ -28,7 +28,7 @@ }, "dependencies": { "@mongosh/cli-repl": "2.5.10", - "@mongosh/service-provider-core": "3.7.0", + "@mongosh/service-provider-core": "3.6.5", "@mongodb-js/oidc-plugin": "^2.0.5", "strip-ansi": "^6.0.0" }, From dd4a547c625b720f80b1de42dca7138714f55c0b Mon Sep 17 00:00:00 2001 From: gagik Date: Wed, 3 Dec 2025 15:08:19 +0100 Subject: [PATCH 17/32] chore: one less .. --- packages/e2e-tests/test/repl-helpers.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/e2e-tests/test/repl-helpers.ts b/packages/e2e-tests/test/repl-helpers.ts index 0d0ddab915..5617e03370 100644 --- a/packages/e2e-tests/test/repl-helpers.ts +++ b/packages/e2e-tests/test/repl-helpers.ts @@ -141,15 +141,7 @@ const setTemporaryHomeDirectory = () => { }; function getCertPath(filename: string): string { - return path.join( - __dirname, - '..', - '..', - '..', - 'testing', - 'certificates', - filename - ); + return path.join(__dirname, '..', '..', 'testing', 'certificates', filename); } // TLS requires matching hostnames, so here we need to explicitly From c909d884cfd35a6156dfcec8f29ba1022bbaf2b1 Mon Sep 17 00:00:00 2001 From: gagik Date: Thu, 4 Dec 2025 15:45:13 +0100 Subject: [PATCH 18/32] chore: empty commit From 1c165af9e73726465947efaac7d152db5502be37 Mon Sep 17 00:00:00 2001 From: gagik Date: Fri, 5 Dec 2025 12:27:14 +0100 Subject: [PATCH 19/32] chore: fixup browser-repl --- package-lock.json | 36 +++++++++++++++---- packages/browser-repl/package.json | 3 +- .../src/components/editor.spec.tsx | 4 +-- .../src/components/shell-input.spec.tsx | 4 +-- .../src/components/shell-output-line.spec.tsx | 4 +-- .../src/components/shell-output.spec.tsx | 4 +-- .../src/components/shell.spec.tsx | 2 +- .../cursor-iteration-result-output.spec.tsx | 4 +-- .../components/types/cursor-output.spec.tsx | 4 +-- .../components/types/error-output.spec.tsx | 4 +-- .../src/components/types/help-output.spec.tsx | 6 ++-- .../types/show-collections-output.spec.tsx | 4 +-- .../components/types/show-dbs-output.spec.tsx | 4 +-- .../src/components/utils/expandable.spec.tsx | 4 +-- .../components/utils/line-with-icon.spec.tsx | 4 +-- .../utils/syntax-highlight.spec.tsx | 4 +-- .../src/iframe-runtime/iframe-runtime.spec.ts | 2 +- packages/testing/package.json | 6 ++++ .../testing => testing/src}/chai.ts | 0 packages/testing/src/index.browser.ts | 12 +++++++ packages/testing/src/index.ts | 1 + packages/testing/tsconfig.json | 8 ++++- 22 files changed, 85 insertions(+), 39 deletions(-) rename packages/{browser-repl/testing => testing/src}/chai.ts (100%) create mode 100644 packages/testing/src/index.browser.ts diff --git a/package-lock.json b/package-lock.json index 4cc2a6b2db..a0654d9ecc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14475,6 +14475,7 @@ "integrity": "sha512-us+UrmGOilqttSOgoWZTpOvHu68vZT2YCjc/H4vhu56vzZpaDFBhB+Se2UwqWzMKbDv7Myq5M5pcZLAtUvTQdQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", @@ -16027,6 +16028,7 @@ "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "cheerio-select": "^2.1.0", "dom-serializer": "^2.0.0", @@ -16049,6 +16051,7 @@ "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", "dev": true, "license": "BSD-2-Clause", + "peer": true, "dependencies": { "boolbase": "^1.0.0", "css-select": "^5.1.0", @@ -17003,6 +17006,7 @@ "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", "dev": true, "license": "BSD-2-Clause", + "peer": true, "dependencies": { "boolbase": "^1.0.0", "css-what": "^6.1.0", @@ -17869,7 +17873,8 @@ "resolved": "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz", "integrity": "sha512-c68LpLbO+7kP/b1Hr1qs8/BJ09F5khZGTxqxZuhzxpmwJKOgRFHJWIb9/KmqnqHhLdO55aOxFH/EGBvUQbL/RQ==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/dns-packet": { "version": "5.6.1", @@ -17943,6 +17948,7 @@ "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.2", @@ -17971,6 +17977,7 @@ "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", "dev": true, "license": "BSD-2-Clause", + "peer": true, "dependencies": { "domelementtype": "^2.3.0" }, @@ -17987,6 +17994,7 @@ "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", "dev": true, "license": "BSD-2-Clause", + "peer": true, "dependencies": { "dom-serializer": "^2.0.0", "domelementtype": "^2.3.0", @@ -18515,6 +18523,7 @@ "integrity": "sha512-Dw8/Gs4vRjxY6/6i9wU0V+utmQO9kvh9XLnz3LIudviOnVYDEe2ec+0k+NQoMamn1VrjKgCUOWj5jG/5M5M0Qw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "array.prototype.flat": "^1.2.3", "cheerio": "^1.0.0-rc.3", @@ -18690,7 +18699,8 @@ "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/es-define-property": { "version": "1.0.1", @@ -21366,6 +21376,7 @@ "integrity": "sha512-6XMlxrAFX4UEEGxctfFnmrFaaZFNf9i5fNuV5wZ3WWQ4FVaNP1aX1LkX9j2mfEx1NpjeE/rL3nmgEn23GdFmrg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "array.prototype.filter": "^1.0.0", "call-bind": "^1.0.2" @@ -21548,6 +21559,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.3", @@ -22628,7 +22640,8 @@ "resolved": "https://registry.npmjs.org/is-subset/-/is-subset-0.1.1.tgz", "integrity": "sha512-6Ybun0IkarhmEqxXCNw/C0bna6Zb/TkfUX9UbwJtK6ObwAVCxmAP308WWTHviM/zAqXk05cdhYsUsZeGQh99iw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/is-symbol": { "version": "1.1.1", @@ -25587,7 +25600,8 @@ "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-4.0.1.tgz", "integrity": "sha512-nXEOnb/jK9g0DYMr1/Xvq6l5xMD7GDG55+GSYIYmS0G4tBk/hURD4JR9WCavs04t33WmJx9kCyp9vJ+mr4BOUw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/lodash.flattendeep": { "version": "4.4.0", @@ -27304,7 +27318,8 @@ "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.2.tgz", "integrity": "sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q==", "dev": true, - "license": "BSD-3-Clause" + "license": "BSD-3-Clause", + "peer": true }, "node_modules/mrmime": { "version": "1.0.1", @@ -27497,6 +27512,7 @@ "integrity": "sha512-+Mc8UaAebFzgV+KpI5n7DasuuQCHA89dmwm7JXw3TV43ukfNQ9DnBH3Mdb2g/I4Fdxc26pwimBWvjIw0UAILSQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "commander": "^2.19.0", "moo": "^0.5.0", @@ -29907,6 +29923,7 @@ "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "entities": "^4.4.0" }, @@ -29920,6 +29937,7 @@ "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "domhandler": "^5.0.2", "parse5": "^7.0.0" @@ -30839,6 +30857,7 @@ "integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "performance-now": "^2.1.0" } @@ -30848,7 +30867,8 @@ "resolved": "https://registry.npmjs.org/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz", "integrity": "sha512-cz93DjNeLY0idrCNOH6PviZGRN9GJhsdm9hpn1YCS879fj4W+x5IFJhhkRZcwVgMmFF7R82UA/7Oh+R8lLZg6A==", "dev": true, - "license": "CC0-1.0" + "license": "CC0-1.0", + "peer": true }, "node_modules/ramda": { "version": "0.27.2", @@ -30862,6 +30882,7 @@ "integrity": "sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "discontinuous-range": "1.0.0", "ret": "~0.1.10" @@ -31987,6 +32008,7 @@ "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=0.12" } @@ -32126,6 +32148,7 @@ "integrity": "sha512-nDG1rZeP6oFTLN6yNDV/uiAvs1+FS/KlrEwh7+y7dpuApDBy6bI2HTBcc0/V8lv9OTqfyD34eF7au2pm8aBbhA==", "dev": true, "license": "BSD-3-Clause", + "peer": true, "dependencies": { "lodash.flattendeep": "^4.4.0", "nearley": "^2.7.10" @@ -36814,7 +36837,6 @@ "babel-loader": "^8.3.0", "buffer": "^6.0.3", "depcheck": "^1.4.7", - "enzyme": "^3.11.0", "eslint": "^7.25.0", "html-webpack-plugin": "^5.5.0", "karma": "^6.3.9", diff --git a/packages/browser-repl/package.json b/packages/browser-repl/package.json index daa83d5296..96c8f1bf01 100644 --- a/packages/browser-repl/package.json +++ b/packages/browser-repl/package.json @@ -73,7 +73,6 @@ "@babel/plugin-proposal-class-properties": "^7.18.6", "@babel/preset-react": "^7.26.3", "@babel/preset-typescript": "^7.27.0", - "mongodb": "^6.19.0", "@mongodb-js/compass-components": "*", "@mongodb-js/compass-editor": "*", "@mongodb-js/eslint-config-mongosh": "^1.0.0", @@ -93,7 +92,6 @@ "babel-loader": "^8.3.0", "buffer": "^6.0.3", "depcheck": "^1.4.7", - "enzyme": "^3.11.0", "eslint": "^7.25.0", "html-webpack-plugin": "^5.5.0", "karma": "^6.3.9", @@ -104,6 +102,7 @@ "karma-typescript": "^5.5.4", "karma-webpack": "^5.0.0", "lodash": "^4.17.21", + "mongodb": "^6.19.0", "path-browserify": "^1.0.1", "prettier": "^2.8.8", "prop-types": "^15.7.2", diff --git a/packages/browser-repl/src/components/editor.spec.tsx b/packages/browser-repl/src/components/editor.spec.tsx index 433f9e31b1..c73b158f46 100644 --- a/packages/browser-repl/src/components/editor.spec.tsx +++ b/packages/browser-repl/src/components/editor.spec.tsx @@ -1,8 +1,8 @@ import sinon from 'sinon'; -import { expect } from '../../testing/src/chai'; +import { expect } from '@mongosh/testing'; import { Editor, createCommands } from './editor'; import type { Command } from '@mongodb-js/compass-editor'; -import { shallow } from '../../testing/src/enzyme'; +import { shallow } from '../../testing/enzyme'; import React from 'react'; describe('', function () { diff --git a/packages/browser-repl/src/components/shell-input.spec.tsx b/packages/browser-repl/src/components/shell-input.spec.tsx index a2700e890b..e419f10b76 100644 --- a/packages/browser-repl/src/components/shell-input.spec.tsx +++ b/packages/browser-repl/src/components/shell-input.spec.tsx @@ -1,7 +1,7 @@ import React from 'react'; import sinon from 'sinon'; -import { expect } from '../../testing/src/chai'; -import { shallow, mount } from '../../testing/src/enzyme'; +import { expect } from '@mongosh/testing'; +import { shallow, mount } from '../../testing/enzyme'; import { ShellInput } from './shell-input'; import { Editor } from './editor'; diff --git a/packages/browser-repl/src/components/shell-output-line.spec.tsx b/packages/browser-repl/src/components/shell-output-line.spec.tsx index 03b0c76f69..8450f2c366 100644 --- a/packages/browser-repl/src/components/shell-output-line.spec.tsx +++ b/packages/browser-repl/src/components/shell-output-line.spec.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { expect } from '../../testing/src/chai'; -import { shallow, mount } from '../../testing/src/enzyme'; +import { expect } from '@mongosh/testing'; +import { shallow, mount } from '../../testing/enzyme'; import { ShellOutputLine } from './shell-output-line'; import { HelpOutput } from './types/help-output'; diff --git a/packages/browser-repl/src/components/shell-output.spec.tsx b/packages/browser-repl/src/components/shell-output.spec.tsx index 23acd7694f..b6ad248eb0 100644 --- a/packages/browser-repl/src/components/shell-output.spec.tsx +++ b/packages/browser-repl/src/components/shell-output.spec.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { expect } from '../../testing/src/chai'; -import { shallow } from '../../testing/src/enzyme'; +import { expect } from '@mongosh/testing'; +import { shallow } from '../../testing/enzyme'; import type { ShellOutputEntry } from './shell-output-line'; import { ShellOutputLine } from './shell-output-line'; diff --git a/packages/browser-repl/src/components/shell.spec.tsx b/packages/browser-repl/src/components/shell.spec.tsx index 4607be6a0a..f9d1ec48d2 100644 --- a/packages/browser-repl/src/components/shell.spec.tsx +++ b/packages/browser-repl/src/components/shell.spec.tsx @@ -3,7 +3,7 @@ import React, { useState, useEffect } from 'react'; import sinon from 'sinon'; import { render, screen, waitFor, configure } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { expect } from '../../testing/src/chai'; +import { expect } from '@mongosh/testing'; import { Shell } from './shell'; import type { ShellOutputEntry } from './shell-output-line'; diff --git a/packages/browser-repl/src/components/types/cursor-iteration-result-output.spec.tsx b/packages/browser-repl/src/components/types/cursor-iteration-result-output.spec.tsx index 50f4ad4e63..efe7072103 100644 --- a/packages/browser-repl/src/components/types/cursor-iteration-result-output.spec.tsx +++ b/packages/browser-repl/src/components/types/cursor-iteration-result-output.spec.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { expect } from '../../testing/src/chai'; -import { shallow } from '../../testing/src/enzyme'; +import { expect } from '@mongosh/testing'; +import { shallow } from '../../../testing/enzyme'; import { CursorIterationResultOutput } from './cursor-iteration-result-output'; import { ObjectOutput } from './object-output'; diff --git a/packages/browser-repl/src/components/types/cursor-output.spec.tsx b/packages/browser-repl/src/components/types/cursor-output.spec.tsx index 0c17826b07..307dc4d8e7 100644 --- a/packages/browser-repl/src/components/types/cursor-output.spec.tsx +++ b/packages/browser-repl/src/components/types/cursor-output.spec.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { expect } from '../../testing/src/chai'; -import { shallow, mount } from '../../testing/src/enzyme'; +import { expect } from '@mongosh/testing'; +import { shallow, mount } from '../../../testing/enzyme'; import { CursorOutput } from './cursor-output'; import { CursorIterationResultOutput } from './cursor-iteration-result-output'; diff --git a/packages/browser-repl/src/components/types/error-output.spec.tsx b/packages/browser-repl/src/components/types/error-output.spec.tsx index 0c736dd6ef..ab5a6d529c 100644 --- a/packages/browser-repl/src/components/types/error-output.spec.tsx +++ b/packages/browser-repl/src/components/types/error-output.spec.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { expect } from '../../testing/src/chai'; -import { render, mount } from '../../testing/src/enzyme'; +import { expect } from '@mongosh/testing'; +import { render, mount } from '../../../testing/enzyme'; import { ErrorOutput } from './error-output'; diff --git a/packages/browser-repl/src/components/types/help-output.spec.tsx b/packages/browser-repl/src/components/types/help-output.spec.tsx index 29d0e6e2b3..291c6c88e2 100644 --- a/packages/browser-repl/src/components/types/help-output.spec.tsx +++ b/packages/browser-repl/src/components/types/help-output.spec.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import { expect } from '../../testing/src/chai'; -import type { ShallowWrapper } from '../../testing/src/enzyme'; -import { shallow } from '../../testing/src/enzyme'; +import { expect } from '@mongosh/testing'; +import type { ShallowWrapper } from '../../../testing/enzyme'; +import { shallow } from '../../../testing/enzyme'; import { HelpOutput } from './help-output'; diff --git a/packages/browser-repl/src/components/types/show-collections-output.spec.tsx b/packages/browser-repl/src/components/types/show-collections-output.spec.tsx index 03d806c9d7..21315f3492 100644 --- a/packages/browser-repl/src/components/types/show-collections-output.spec.tsx +++ b/packages/browser-repl/src/components/types/show-collections-output.spec.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { expect } from '../../testing/src/chai'; -import { shallow } from '../../testing/src/enzyme'; +import { expect } from '@mongosh/testing'; +import { shallow } from '../../../testing/enzyme'; import { ShowCollectionsOutput } from './show-collections-output'; diff --git a/packages/browser-repl/src/components/types/show-dbs-output.spec.tsx b/packages/browser-repl/src/components/types/show-dbs-output.spec.tsx index 5753bc5636..f6242d12d2 100644 --- a/packages/browser-repl/src/components/types/show-dbs-output.spec.tsx +++ b/packages/browser-repl/src/components/types/show-dbs-output.spec.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { expect } from '../../testing/src/chai'; -import { shallow } from '../../testing/src/enzyme'; +import { expect } from '@mongosh/testing'; +import { shallow } from '../../../testing/enzyme'; import { ShowDbsOutput } from './show-dbs-output'; diff --git a/packages/browser-repl/src/components/utils/expandable.spec.tsx b/packages/browser-repl/src/components/utils/expandable.spec.tsx index df55cf9698..f8363906fb 100644 --- a/packages/browser-repl/src/components/utils/expandable.spec.tsx +++ b/packages/browser-repl/src/components/utils/expandable.spec.tsx @@ -1,8 +1,8 @@ import React from 'react'; import sinon from 'sinon'; import { Icon } from '@mongodb-js/compass-components'; -import { expect } from '../../testing/src/chai'; -import { mount } from '../../testing/src/enzyme'; +import { expect } from '@mongosh/testing'; +import { mount } from '../../../testing/enzyme'; import { Expandable } from './expandable'; describe('', function () { diff --git a/packages/browser-repl/src/components/utils/line-with-icon.spec.tsx b/packages/browser-repl/src/components/utils/line-with-icon.spec.tsx index 88084797c3..521561ac61 100644 --- a/packages/browser-repl/src/components/utils/line-with-icon.spec.tsx +++ b/packages/browser-repl/src/components/utils/line-with-icon.spec.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { expect } from '../../testing/src/chai'; -import { shallow } from '../../testing/src/enzyme'; +import { expect } from '@mongosh/testing'; +import { shallow } from '../../../testing/enzyme'; import { LineWithIcon } from './line-with-icon'; describe('', function () { diff --git a/packages/browser-repl/src/components/utils/syntax-highlight.spec.tsx b/packages/browser-repl/src/components/utils/syntax-highlight.spec.tsx index 9ca1447f8b..c53527975e 100644 --- a/packages/browser-repl/src/components/utils/syntax-highlight.spec.tsx +++ b/packages/browser-repl/src/components/utils/syntax-highlight.spec.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { CodemirrorInlineEditor } from '@mongodb-js/compass-editor'; -import { expect } from '../../testing/src/chai'; -import { mount } from '../../testing/src/enzyme'; +import { expect } from '@mongosh/testing'; +import { mount } from '../../../testing/enzyme'; import { SyntaxHighlight } from './syntax-highlight'; describe('', function () { diff --git a/packages/browser-repl/src/iframe-runtime/iframe-runtime.spec.ts b/packages/browser-repl/src/iframe-runtime/iframe-runtime.spec.ts index a8558b3119..d8507014d2 100644 --- a/packages/browser-repl/src/iframe-runtime/iframe-runtime.spec.ts +++ b/packages/browser-repl/src/iframe-runtime/iframe-runtime.spec.ts @@ -1,5 +1,5 @@ import { IframeRuntime } from './iframe-runtime'; -import { expect } from '../../testing/src/chai'; +import { expect } from '@mongosh/testing'; import type { ServiceProvider } from '@mongosh/service-provider-core'; import * as bson from 'bson'; diff --git a/packages/testing/package.json b/packages/testing/package.json index 9217e9a3dd..af4faa35eb 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -7,6 +7,12 @@ "main": "src/index.ts", "types": "src/index.ts", "private": true, + "exports": { + ".": { + "browser": "./src/index.browser.ts", + "default": "./src/index.ts" + } + }, "repository": { "type": "git", "url": "https://github.com/mongodb-js/mongosh" diff --git a/packages/browser-repl/testing/chai.ts b/packages/testing/src/chai.ts similarity index 100% rename from packages/browser-repl/testing/chai.ts rename to packages/testing/src/chai.ts diff --git a/packages/testing/src/index.browser.ts b/packages/testing/src/index.browser.ts new file mode 100644 index 0000000000..18c9ce9205 --- /dev/null +++ b/packages/testing/src/index.browser.ts @@ -0,0 +1,12 @@ +export * from './eventually'; +export * from './chai'; + +/** + * Path to the certificates directory containing test certificates + */ +const TEST_CERTIFICATES_DIR = './certificates'; + +/** Get the path to a test certificate */ +export function getTestCertificatePath(filename: string): string { + return `${TEST_CERTIFICATES_DIR}/${filename}`; +} diff --git a/packages/testing/src/index.ts b/packages/testing/src/index.ts index bc8f9b58a2..5d33019af8 100644 --- a/packages/testing/src/index.ts +++ b/packages/testing/src/index.ts @@ -3,6 +3,7 @@ import path from 'path'; export * from './integration-testing-hooks'; export * from './eventually'; export * from './fake-kms'; +export * from './chai'; /** * Path to the certificates directory containing test certificates diff --git a/packages/testing/tsconfig.json b/packages/testing/tsconfig.json index 8c8bebecf8..d44fb86a10 100644 --- a/packages/testing/tsconfig.json +++ b/packages/testing/tsconfig.json @@ -6,6 +6,12 @@ "declaration": true, "declarationMap": true }, - "include": ["src/**/*", "src/certificates/**/*"], + "include": [ + "src/**/*", + "src/certificates/**/*", + "src/chai.ts", + "../browser-repl/testing/enzyme.ts", + "../browser-repl/testing/enzyme.ts" + ], "exclude": ["lib"] } From 97e50cead9eff2e87c5ea6974e821d57fdb21ca2 Mon Sep 17 00:00:00 2001 From: gagik Date: Fri, 5 Dec 2025 12:33:40 +0100 Subject: [PATCH 20/32] chore: package-lock --- package-lock.json | 89 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 66 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5f8aa8776e..9771f24340 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ "packages/i18n", "packages/logging", "packages/shell-bson", + "packages/testing", "packages/arg-parser", "packages/service-provider-core", "packages/service-provider-node-driver", @@ -7780,6 +7781,10 @@ "resolved": "packages/snippet-manager", "link": true }, + "node_modules/@mongosh/testing": { + "resolved": "packages/testing", + "link": true + }, "node_modules/@mongosh/types": { "resolved": "packages/types", "link": true @@ -13684,7 +13689,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "dev": true, "license": "MIT", "dependencies": { "event-target-shim": "^5.0.0" @@ -14206,6 +14210,7 @@ "integrity": "sha512-us+UrmGOilqttSOgoWZTpOvHu68vZT2YCjc/H4vhu56vzZpaDFBhB+Se2UwqWzMKbDv7Myq5M5pcZLAtUvTQdQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", @@ -15732,6 +15737,7 @@ "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "cheerio-select": "^2.1.0", "dom-serializer": "^2.0.0", @@ -15754,6 +15760,7 @@ "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", "dev": true, "license": "BSD-2-Clause", + "peer": true, "dependencies": { "boolbase": "^1.0.0", "css-select": "^5.1.0", @@ -16708,6 +16715,7 @@ "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", "dev": true, "license": "BSD-2-Clause", + "peer": true, "dependencies": { "boolbase": "^1.0.0", "css-what": "^6.1.0", @@ -17574,7 +17582,8 @@ "resolved": "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz", "integrity": "sha512-c68LpLbO+7kP/b1Hr1qs8/BJ09F5khZGTxqxZuhzxpmwJKOgRFHJWIb9/KmqnqHhLdO55aOxFH/EGBvUQbL/RQ==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/dns-packet": { "version": "5.6.1", @@ -17648,6 +17657,7 @@ "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.2", @@ -17676,6 +17686,7 @@ "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", "dev": true, "license": "BSD-2-Clause", + "peer": true, "dependencies": { "domelementtype": "^2.3.0" }, @@ -17692,6 +17703,7 @@ "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", "dev": true, "license": "BSD-2-Clause", + "peer": true, "dependencies": { "dom-serializer": "^2.0.0", "domelementtype": "^2.3.0", @@ -17832,7 +17844,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/duplexpair/-/duplexpair-1.0.2.tgz", "integrity": "sha512-6DHuWdEGHNcuSqrn926rWJcRsTDrb+ugw0hx/trAxCH48z9WlFqDtwtbiEMq/KGFYQWzLs1VA0I6KUkuIgCoXw==", - "dev": true, "license": "MIT", "dependencies": { "readable-stream": "^4.5.2" @@ -17842,7 +17853,6 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "dev": true, "funding": [ { "type": "github", @@ -17867,7 +17877,6 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.8.x" @@ -17877,7 +17886,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true, "funding": [ { "type": "github", @@ -17898,7 +17906,6 @@ "version": "4.5.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", - "dev": true, "license": "MIT", "dependencies": { "abort-controller": "^3.0.0", @@ -18225,6 +18232,7 @@ "integrity": "sha512-Dw8/Gs4vRjxY6/6i9wU0V+utmQO9kvh9XLnz3LIudviOnVYDEe2ec+0k+NQoMamn1VrjKgCUOWj5jG/5M5M0Qw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "array.prototype.flat": "^1.2.3", "cheerio": "^1.0.0-rc.3", @@ -18400,7 +18408,8 @@ "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/es-define-property": { "version": "1.0.1", @@ -19019,7 +19028,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -21288,6 +21296,7 @@ "integrity": "sha512-6XMlxrAFX4UEEGxctfFnmrFaaZFNf9i5fNuV5wZ3WWQ4FVaNP1aX1LkX9j2mfEx1NpjeE/rL3nmgEn23GdFmrg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "array.prototype.filter": "^1.0.0", "call-bind": "^1.0.2" @@ -21470,6 +21479,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.3", @@ -22550,7 +22560,8 @@ "resolved": "https://registry.npmjs.org/is-subset/-/is-subset-0.1.1.tgz", "integrity": "sha512-6Ybun0IkarhmEqxXCNw/C0bna6Zb/TkfUX9UbwJtK6ObwAVCxmAP308WWTHviM/zAqXk05cdhYsUsZeGQh99iw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/is-symbol": { "version": "1.1.1", @@ -25509,7 +25520,8 @@ "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-4.0.1.tgz", "integrity": "sha512-nXEOnb/jK9g0DYMr1/Xvq6l5xMD7GDG55+GSYIYmS0G4tBk/hURD4JR9WCavs04t33WmJx9kCyp9vJ+mr4BOUw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/lodash.flattendeep": { "version": "4.4.0", @@ -27046,7 +27058,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/mongodb-runner/-/mongodb-runner-6.0.0.tgz", "integrity": "sha512-ijhBVCcTWRlauxp4UdIuktfPjEqlt8yOo0u7XyE99HdaITzL0BjS4x/dOyNzddewC6gw5wxH1uYx+Uo7GfeUnw==", - "dev": true, "license": "Apache-2.0", "dependencies": { "@mongodb-js/mongodb-downloader": "^1.0.0", @@ -27064,7 +27075,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/@mongodb-js/mongodb-downloader/-/mongodb-downloader-1.0.0.tgz", "integrity": "sha512-xz4zr/5RWfAaHp9Kf7XPaLNxKaisl2NJGFEDQRNjB/ru79LdpLQbbSjQazTOl6JLcBvAjNNvauTeTwmgEvSUlA==", - "dev": true, "license": "Apache-2.0", "dependencies": { "debug": "^4.4.0", @@ -27079,7 +27089,6 @@ "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dev": true, "license": "ISC", "dependencies": { "string-width": "^4.2.0", @@ -27094,7 +27103,6 @@ "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, "license": "MIT", "dependencies": { "ms": "^2.1.3" @@ -27112,14 +27120,12 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, "license": "MIT" }, "node_modules/mongodb-runner/node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dev": true, "license": "MIT", "dependencies": { "cliui": "^8.0.1", @@ -27138,7 +27144,6 @@ "version": "21.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, "license": "ISC", "engines": { "node": ">=12" @@ -27220,7 +27225,8 @@ "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.2.tgz", "integrity": "sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q==", "dev": true, - "license": "BSD-3-Clause" + "license": "BSD-3-Clause", + "peer": true }, "node_modules/mrmime": { "version": "1.0.1", @@ -27413,6 +27419,7 @@ "integrity": "sha512-+Mc8UaAebFzgV+KpI5n7DasuuQCHA89dmwm7JXw3TV43ukfNQ9DnBH3Mdb2g/I4Fdxc26pwimBWvjIw0UAILSQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "commander": "^2.19.0", "moo": "^0.5.0", @@ -29823,6 +29830,7 @@ "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "entities": "^4.4.0" }, @@ -29836,6 +29844,7 @@ "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "domhandler": "^5.0.2", "parse5": "^7.0.0" @@ -30413,7 +30422,6 @@ "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.6.0" @@ -30546,7 +30554,6 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.2.tgz", "integrity": "sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==", - "dev": true, "license": "MIT", "dependencies": { "graceful-fs": "^4.2.4", @@ -30756,6 +30763,7 @@ "integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "performance-now": "^2.1.0" } @@ -30765,7 +30773,8 @@ "resolved": "https://registry.npmjs.org/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz", "integrity": "sha512-cz93DjNeLY0idrCNOH6PviZGRN9GJhsdm9hpn1YCS879fj4W+x5IFJhhkRZcwVgMmFF7R82UA/7Oh+R8lLZg6A==", "dev": true, - "license": "CC0-1.0" + "license": "CC0-1.0", + "peer": true }, "node_modules/ramda": { "version": "0.27.2", @@ -30779,6 +30788,7 @@ "integrity": "sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "discontinuous-range": "1.0.0", "ret": "~0.1.10" @@ -31908,6 +31918,7 @@ "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=0.12" } @@ -32048,6 +32059,7 @@ "integrity": "sha512-nDG1rZeP6oFTLN6yNDV/uiAvs1+FS/KlrEwh7+y7dpuApDBy6bI2HTBcc0/V8lv9OTqfyD34eF7au2pm8aBbhA==", "dev": true, "license": "BSD-3-Clause", + "peer": true, "dependencies": { "lodash.flattendeep": "^4.4.0", "nearley": "^2.7.10" @@ -37005,7 +37017,6 @@ "babel-loader": "^8.3.0", "buffer": "^6.0.3", "depcheck": "^1.4.7", - "enzyme": "^3.11.0", "eslint": "^7.25.0", "html-webpack-plugin": "^5.5.0", "karma": "^6.3.9", @@ -38187,6 +38198,7 @@ "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/sbom-tools": "^0.8.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongosh/testing": "0.0.0-dev.0", "@types/ansi-escape-sequences": "^4.0.0", "@types/chai-as-promised": "^8.0.2", "@types/js-yaml": "^4.0.5", @@ -38640,6 +38652,7 @@ "@mongosh/browser-runtime-electron": "^3.29.0", "@mongosh/service-provider-core": "3.7.0", "@mongosh/service-provider-node-driver": "^3.18.0", + "@mongosh/testing": "0.0.0-dev.0", "@mongosh/types": "^3.14.1", "bson": "^6.10.4", "depcheck": "^1.4.7", @@ -38697,6 +38710,7 @@ "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongosh/testing": "0.0.0-dev.0", "@types/sinon-chai": "^4.0.0", "depcheck": "^1.4.7", "eslint": "^7.25.0", @@ -38731,6 +38745,7 @@ "@mongodb-js/mongodb-ts-autocomplete": "^0.4.7", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongosh/testing": "0.0.0-dev.0", "@mongosh/types": "^3.14.1", "bson": "^6.10.4", "depcheck": "^1.4.7", @@ -38808,6 +38823,7 @@ "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongosh/testing": "0.0.0-dev.0", "@types/cross-spawn": "^6.0.6", "@types/tar": "^4.0.4", "depcheck": "^1.4.7", @@ -38829,6 +38845,33 @@ "@types/node": "*" } }, + "packages/testing": { + "name": "@mongosh/testing", + "version": "0.0.0-dev.0", + "license": "Apache-2.0", + "dependencies": { + "@mongosh/build": "^3.7.10", + "duplexpair": "^1.0.2", + "mongodb": "^6.19.0", + "mongodb-connection-string-url": "^3.0.1", + "mongodb-runner": "^6.0.0", + "semver": "^7.3.4", + "which": "^2.0.2" + }, + "devDependencies": { + "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/prettier-config-devtools": "^1.0.1", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@types/semver": "^7.3.4", + "@types/which": "^1.3.2", + "eslint": "^7.25.0", + "prettier": "^2.8.8", + "typescript": "^5.3.3" + }, + "engines": { + "node": ">=14.15.1" + } + }, "packages/types": { "name": "@mongosh/types", "version": "3.14.1", From 29ddf23e3e4a64b56b5bec3b8d8d7e01b56cda84 Mon Sep 17 00:00:00 2001 From: gagik Date: Fri, 5 Dec 2025 12:36:51 +0100 Subject: [PATCH 21/32] chore: fix chore, package-lock --- package-lock.json | 37 ++++++------------------------ packages/browser-repl/package.json | 3 ++- 2 files changed, 9 insertions(+), 31 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9771f24340..c61095565f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14210,7 +14210,6 @@ "integrity": "sha512-us+UrmGOilqttSOgoWZTpOvHu68vZT2YCjc/H4vhu56vzZpaDFBhB+Se2UwqWzMKbDv7Myq5M5pcZLAtUvTQdQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", @@ -15737,7 +15736,6 @@ "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "cheerio-select": "^2.1.0", "dom-serializer": "^2.0.0", @@ -15760,7 +15758,6 @@ "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "boolbase": "^1.0.0", "css-select": "^5.1.0", @@ -16715,7 +16712,6 @@ "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "boolbase": "^1.0.0", "css-what": "^6.1.0", @@ -17582,8 +17578,7 @@ "resolved": "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz", "integrity": "sha512-c68LpLbO+7kP/b1Hr1qs8/BJ09F5khZGTxqxZuhzxpmwJKOgRFHJWIb9/KmqnqHhLdO55aOxFH/EGBvUQbL/RQ==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/dns-packet": { "version": "5.6.1", @@ -17657,7 +17652,6 @@ "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.2", @@ -17686,7 +17680,6 @@ "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "domelementtype": "^2.3.0" }, @@ -17703,7 +17696,6 @@ "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "dom-serializer": "^2.0.0", "domelementtype": "^2.3.0", @@ -18232,7 +18224,6 @@ "integrity": "sha512-Dw8/Gs4vRjxY6/6i9wU0V+utmQO9kvh9XLnz3LIudviOnVYDEe2ec+0k+NQoMamn1VrjKgCUOWj5jG/5M5M0Qw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "array.prototype.flat": "^1.2.3", "cheerio": "^1.0.0-rc.3", @@ -18408,8 +18399,7 @@ "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/es-define-property": { "version": "1.0.1", @@ -21296,7 +21286,6 @@ "integrity": "sha512-6XMlxrAFX4UEEGxctfFnmrFaaZFNf9i5fNuV5wZ3WWQ4FVaNP1aX1LkX9j2mfEx1NpjeE/rL3nmgEn23GdFmrg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "array.prototype.filter": "^1.0.0", "call-bind": "^1.0.2" @@ -21479,7 +21468,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.3", @@ -22560,8 +22548,7 @@ "resolved": "https://registry.npmjs.org/is-subset/-/is-subset-0.1.1.tgz", "integrity": "sha512-6Ybun0IkarhmEqxXCNw/C0bna6Zb/TkfUX9UbwJtK6ObwAVCxmAP308WWTHviM/zAqXk05cdhYsUsZeGQh99iw==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/is-symbol": { "version": "1.1.1", @@ -25520,8 +25507,7 @@ "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-4.0.1.tgz", "integrity": "sha512-nXEOnb/jK9g0DYMr1/Xvq6l5xMD7GDG55+GSYIYmS0G4tBk/hURD4JR9WCavs04t33WmJx9kCyp9vJ+mr4BOUw==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/lodash.flattendeep": { "version": "4.4.0", @@ -27225,8 +27211,7 @@ "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.2.tgz", "integrity": "sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q==", "dev": true, - "license": "BSD-3-Clause", - "peer": true + "license": "BSD-3-Clause" }, "node_modules/mrmime": { "version": "1.0.1", @@ -27419,7 +27404,6 @@ "integrity": "sha512-+Mc8UaAebFzgV+KpI5n7DasuuQCHA89dmwm7JXw3TV43ukfNQ9DnBH3Mdb2g/I4Fdxc26pwimBWvjIw0UAILSQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "commander": "^2.19.0", "moo": "^0.5.0", @@ -29830,7 +29814,6 @@ "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "entities": "^4.4.0" }, @@ -29844,7 +29827,6 @@ "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "domhandler": "^5.0.2", "parse5": "^7.0.0" @@ -30763,7 +30745,6 @@ "integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "performance-now": "^2.1.0" } @@ -30773,8 +30754,7 @@ "resolved": "https://registry.npmjs.org/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz", "integrity": "sha512-cz93DjNeLY0idrCNOH6PviZGRN9GJhsdm9hpn1YCS879fj4W+x5IFJhhkRZcwVgMmFF7R82UA/7Oh+R8lLZg6A==", "dev": true, - "license": "CC0-1.0", - "peer": true + "license": "CC0-1.0" }, "node_modules/ramda": { "version": "0.27.2", @@ -30788,7 +30768,6 @@ "integrity": "sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "discontinuous-range": "1.0.0", "ret": "~0.1.10" @@ -31918,7 +31897,6 @@ "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=0.12" } @@ -32059,7 +32037,6 @@ "integrity": "sha512-nDG1rZeP6oFTLN6yNDV/uiAvs1+FS/KlrEwh7+y7dpuApDBy6bI2HTBcc0/V8lv9OTqfyD34eF7au2pm8aBbhA==", "dev": true, "license": "BSD-3-Clause", - "peer": true, "dependencies": { "lodash.flattendeep": "^4.4.0", "nearley": "^2.7.10" @@ -37011,12 +36988,12 @@ "@types/react": "^16.9.17", "@types/react-dom": "^18.0.8", "@types/sinon": "^7.5.1", - "@types/sinon-chai": "^4.0.0", "@types/text-table": "^0.2.1", "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0", "babel-loader": "^8.3.0", "buffer": "^6.0.3", "depcheck": "^1.4.7", + "enzyme": "^3.11.0", "eslint": "^7.25.0", "html-webpack-plugin": "^5.5.0", "karma": "^6.3.9", diff --git a/packages/browser-repl/package.json b/packages/browser-repl/package.json index 12357d78af..6bc9152ded 100644 --- a/packages/browser-repl/package.json +++ b/packages/browser-repl/package.json @@ -86,14 +86,15 @@ "@types/react": "^16.9.17", "@types/react-dom": "^18.0.8", "@types/sinon": "^7.5.1", - "@types/sinon-chai": "^4.0.0", "@types/text-table": "^0.2.1", "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0", "babel-loader": "^8.3.0", "buffer": "^6.0.3", "depcheck": "^1.4.7", + "enzyme": "^3.11.0", "eslint": "^7.25.0", "html-webpack-plugin": "^5.5.0", + "@mongosh/testing": "0.0.0-dev.0", "karma": "^6.3.9", "karma-chrome-launcher": "^3.1.0", "karma-cli": "^2.0.0", From 7139b8025296ca7ceb5495982c0703db75b9b9bf Mon Sep 17 00:00:00 2001 From: gagik Date: Thu, 13 Nov 2025 13:19:13 +0100 Subject: [PATCH 22/32] chore: setup knip --- .knipignore | 43 ++++ knip.ts | 192 +++++++++++++++++ package-lock.json | 520 ++++++++++++++++++++++++++++++++++++++++++++-- package.json | 6 +- 4 files changed, 743 insertions(+), 18 deletions(-) create mode 100644 .knipignore create mode 100644 knip.ts diff --git a/.knipignore b/.knipignore new file mode 100644 index 0000000000..2efa1101a4 --- /dev/null +++ b/.knipignore @@ -0,0 +1,43 @@ +# Knip ignore file - patterns to exclude from analysis + +# Build outputs +**/lib/** +**/dist/** +**/build/** + +# Coverage and test outputs +**/coverage/** +**/.nyc_output/** + +# Generated files +**/tmp/** +**/.sbom/** + +# Test fixtures +**/test/fixtures/** +**/test/data/** + +# Evergreen CI specific +.evergreen/** + +# Async rewriter3 (Rust/WASM project) +packages/async-rewriter3/** + +# Lock files and dependencies +**/node_modules/** +package-lock.json +npm-shrinkwrap.json +yarn.lock +pnpm-lock.yaml + +# IDE and editor files +**/.vscode/** +**/.idea/** +**/*.swp +**/*.swo +**/*~ + +# OS files +**/.DS_Store +**/Thumbs.db + diff --git a/knip.ts b/knip.ts new file mode 100644 index 0000000000..2dce56fbb2 --- /dev/null +++ b/knip.ts @@ -0,0 +1,192 @@ +import type { KnipConfig } from "knip"; + +const config: KnipConfig = { + // Ignore patterns for files that should not be analyzed + ignore: [ + // Build outputs + "**/lib/**", + "**/dist/**", + "**/build/**", + "**/coverage/**", + "**/.nyc_output/**", + // Generated files + "**/tmp/**", + "**/.sbom/**", + // Test fixtures and data + "**/test/fixtures/**", + "**/test/data/**", + // Docker and scripts that are executed directly + "scripts/docker/**", + // Async rewriter3 has its own build system (Rust/WASM) + "packages/async-rewriter3/**", + // Configuration files + ".evergreen/**", + "config/**", + "configs/**", + ], + + // Ignore dependencies that are used in build processes or special contexts + ignoreDependencies: [ + // Used in build scripts and webpack configs + "terser-webpack-plugin", + "webpack-bundle-analyzer", + "webpack-cli", + "webpack-merge", + // Used in special build contexts + "mongodb-runner", + "mongodb-crypt-library-dummy", + // Used in scripts + "mongodb-sbom-tools", + "@pkgjs/nv", + // Used for husky git hooks + "husky", + // CLI tool + "depcheck", + ], + + // Ignore binaries that are used in scripts + ignoreBinaries: ["depalign", "monorepo-where", "precommit"], + + // Global entry files at root level + entry: ["scripts/**/*.{js,ts,mjs}", "testing/**/*.ts"], + + // Project files to analyze at root level + project: [ + "scripts/**/*.{js,ts,mjs}", + "testing/**/*.ts", + "configs/**/*.{js,ts}", + ], + + // Workspace-specific configurations + workspaces: { + ".": { + // Root workspace configuration + entry: ["scripts/**/*.{js,ts,mjs}", "testing/**/*.ts"], + }, + + // Config packages + "configs/eslint-config-mongosh": { + entry: ["index.js", "utils.js"], + }, + + "configs/tsconfig-mongosh": { + entry: ["tsconfig.common.json"], + }, + + // Main packages + "packages/*": { + entry: ["src/index.ts", "src/index.tsx", "lib/index.js", "bin/**/*.js"], + project: ["src/**/*.{ts,tsx}", "bin/**/*.js"], + }, + + // Special cases for packages with different entry points + "packages/cli-repl": { + entry: ["bin/mongosh.js", "src/run.ts", "dist/add-module-mapping.js"], + project: ["src/**/*.ts", "bin/**/*.js"], + }, + + "packages/shell-api": { + entry: ["src/api.ts"], + project: ["src/**/*.ts"], + }, + + "packages/build": { + entry: [ + "src/evergreen-release.ts", + "src/release.ts", + "src/update-cta.ts", + ], + project: ["src/**/*.ts"], + }, + + "packages/e2e-tests": { + entry: ["test/**/*.ts"], + project: ["test/**/*.ts"], + }, + + "packages/browser-repl": { + entry: ["src/index.tsx"], + project: ["src/**/*.{ts,tsx}"], + }, + + "packages/java-shell": { + entry: [ + "src/main/kotlin/**/*.kt", + "src/test/kotlin/**/*.kt", + "gen-doc/**/*.js", + "gen-kotlin/**/*.js", + ], + project: [ + "src/main/kotlin/**/*.kt", + "gen-doc/**/*.js", + "gen-kotlin/**/*.js", + ], + }, + + "packages/connectivity-tests": { + entry: ["index.js"], + project: ["**/*.js"], + }, + + testing: { + entry: [ + "eventually.ts", + "fake-kms.ts", + "integration-testing-hooks.ts", + "disable-dns-srv.js", + ], + project: ["**/*.{ts,js}"], + }, + + "scripts/docker": { + entry: ["**/*.js"], + project: ["**/*.js"], + }, + }, + + // Mocha test files configuration + mocha: { + config: ["**/mocharc.{js,json,yml,yaml}", "**/.mocharc.{js,json,yml,yaml}"], + entry: ["**/*.spec.{ts,tsx,js}", "**/*.test.{ts,tsx,js}"], + }, + + // TypeScript configuration + typescript: { + config: [ + "tsconfig.json", + "tsconfig-lint.json", + "**/tsconfig.json", + "**/tsconfig-lint.json", + "configs/tsconfig-mongosh/tsconfig.common.json", + ], + }, + + // Webpack configuration + webpack: { + config: ["config/webpack.base.config.js", "**/webpack.config.js"], + }, + + // ESLint configuration + eslint: { + config: [ + "configs/eslint-config-mongosh/index.js", + "**/.eslintrc.{js,json}", + ], + }, + + // Prettier configuration + prettier: { + config: [ + ".prettierrc", + ".prettierrc.{js,json,yml,yaml}", + "prettier.config.js", + ], + }, + + // Nyc (test coverage) configuration + nyc: { + config: [".nycrc", ".nycrc.{json,yml,yaml}", "nyc.config.js"], + }, +}; + +export default config; diff --git a/package-lock.json b/package-lock.json index c61095565f..8004561ab5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,6 +60,7 @@ "find-up": "^5.0.0", "glob": "^10.3.12", "husky": "^9.0.11", + "knip": "^5.69.1", "mocha": "^10.2.0", "mongodb": "^6.19.0", "mongodb-runner": "^6.0.0", @@ -3349,13 +3350,13 @@ "license": "0BSD" }, "node_modules/@emnapi/core": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.2.0.tgz", - "integrity": "sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.7.1.tgz", + "integrity": "sha512-o1uhUASyo921r2XtHYOHy7gdkGLge8ghBEQHMWmyJFoXlpU58kIrhhN3w26lpQb6dspetweapMn2CSNwQ8I4wg==", "license": "MIT", "optional": true, "dependencies": { - "@emnapi/wasi-threads": "1.0.1", + "@emnapi/wasi-threads": "1.1.0", "tslib": "^2.4.0" } }, @@ -3367,9 +3368,9 @@ "optional": true }, "node_modules/@emnapi/runtime": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.2.0.tgz", - "integrity": "sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.1.tgz", + "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==", "license": "MIT", "optional": true, "dependencies": { @@ -3384,9 +3385,9 @@ "optional": true }, "node_modules/@emnapi/wasi-threads": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.0.1.tgz", - "integrity": "sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.1.0.tgz", + "integrity": "sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==", "license": "MIT", "optional": true, "dependencies": { @@ -3394,9 +3395,9 @@ } }, "node_modules/@emnapi/wasi-threads/node_modules/tslib": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.0.tgz", - "integrity": "sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "license": "0BSD", "optional": true }, @@ -10311,6 +10312,321 @@ "integrity": "sha512-XuySG1E38YScSJoMlqovLru4KTUNSjgVTIjyh7qMX6aNN5HY5Ct5LhRJdxO79JtTzKfzV/bnWpz+zquYrISsvw==", "license": "MIT" }, + "node_modules/@oxc-resolver/binding-android-arm-eabi": { + "version": "11.15.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-android-arm-eabi/-/binding-android-arm-eabi-11.15.0.tgz", + "integrity": "sha512-Q+lWuFfq7whNelNJIP1dhXaVz4zO9Tu77GcQHyxDWh3MaCoO2Bisphgzmsh4ZoUe2zIchQh6OvQL99GlWHg9Tw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@oxc-resolver/binding-android-arm64": { + "version": "11.15.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-android-arm64/-/binding-android-arm64-11.15.0.tgz", + "integrity": "sha512-vbdBttesHR0W1oJaxgWVTboyMUuu+VnPsHXJ6jrXf4czELzB6GIg5DrmlyhAmFBhjwov+yJH/DfTnHS+2sDgOw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@oxc-resolver/binding-darwin-arm64": { + "version": "11.15.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-arm64/-/binding-darwin-arm64-11.15.0.tgz", + "integrity": "sha512-R67lsOe1UzNjqVBCwCZX1rlItTsj/cVtBw4Uy19CvTicqEWvwaTn8t34zLD75LQwDDPCY3C8n7NbD+LIdw+ZoA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@oxc-resolver/binding-darwin-x64": { + "version": "11.15.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-x64/-/binding-darwin-x64-11.15.0.tgz", + "integrity": "sha512-77mya5F8WV0EtCxI0MlVZcqkYlaQpfNwl/tZlfg4jRsoLpFbaTeWv75hFm6TE84WULVlJtSgvf7DhoWBxp9+ZQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@oxc-resolver/binding-freebsd-x64": { + "version": "11.15.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-freebsd-x64/-/binding-freebsd-x64-11.15.0.tgz", + "integrity": "sha512-X1Sz7m5PC+6D3KWIDXMUtux+0Imj6HfHGdBStSvgdI60OravzI1t83eyn6eN0LPTrynuPrUgjk7tOnOsBzSWHw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm-gnueabihf": { + "version": "11.15.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-11.15.0.tgz", + "integrity": "sha512-L1x/wCaIRre+18I4cH/lTqSAymlV0k4HqfSYNNuI9oeL28Ks86lI6O5VfYL6sxxWYgjuWB98gNGo7tq7d4GarQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm-musleabihf": { + "version": "11.15.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-11.15.0.tgz", + "integrity": "sha512-abGXd/zMGa0tH8nKlAXdOnRy4G7jZmkU0J85kMKWns161bxIgGn/j7zxqh3DKEW98wAzzU9GofZMJ0P5YCVPVw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm64-gnu": { + "version": "11.15.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-11.15.0.tgz", + "integrity": "sha512-SVjjjtMW66Mza76PBGJLqB0KKyFTBnxmtDXLJPbL6ZPGSctcXVmujz7/WAc0rb9m2oV0cHQTtVjnq6orQnI/jg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm64-musl": { + "version": "11.15.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-musl/-/binding-linux-arm64-musl-11.15.0.tgz", + "integrity": "sha512-JDv2/AycPF2qgzEiDeMJCcSzKNDm3KxNg0KKWipoKEMDFqfM7LxNwwSVyAOGmrYlE4l3dg290hOMsr9xG7jv9g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-ppc64-gnu": { + "version": "11.15.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-11.15.0.tgz", + "integrity": "sha512-zbu9FhvBLW4KJxo7ElFvZWbSt4vP685Qc/Gyk/Ns3g2gR9qh2qWXouH8PWySy+Ko/qJ42+HJCLg+ZNcxikERfg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-riscv64-gnu": { + "version": "11.15.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-11.15.0.tgz", + "integrity": "sha512-Kfleehe6B09C2qCnyIU01xLFqFXCHI4ylzkicfX/89j+gNHh9xyNdpEvit88Kq6i5tTGdavVnM6DQfOE2qNtlg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-riscv64-musl": { + "version": "11.15.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-11.15.0.tgz", + "integrity": "sha512-J7LPiEt27Tpm8P+qURDwNc8q45+n+mWgyys4/V6r5A8v5gDentHRGUx3iVk5NxdKhgoGulrzQocPTZVosq25Eg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-s390x-gnu": { + "version": "11.15.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-11.15.0.tgz", + "integrity": "sha512-+8/d2tAScPjVJNyqa7GPGnqleTB/XW9dZJQ2D/oIM3wpH3TG+DaFEXBbk4QFJ9K9AUGBhvQvWU2mQyhK/yYn3Q==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-x64-gnu": { + "version": "11.15.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-gnu/-/binding-linux-x64-gnu-11.15.0.tgz", + "integrity": "sha512-xtvSzH7Nr5MCZI2FKImmOdTl9kzuQ51RPyLh451tvD2qnkg3BaqI9Ox78bTk57YJhlXPuxWSOL5aZhKAc9J6qg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-x64-musl": { + "version": "11.15.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-musl/-/binding-linux-x64-musl-11.15.0.tgz", + "integrity": "sha512-14YL1zuXj06+/tqsuUZuzL0T425WA/I4nSVN1kBXeC5WHxem6lQ+2HGvG+crjeJEqHgZUT62YIgj88W+8E7eyg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-openharmony-arm64": { + "version": "11.15.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-openharmony-arm64/-/binding-openharmony-arm64-11.15.0.tgz", + "integrity": "sha512-/7Qli+1Wk93coxnrQaU8ySlICYN8HsgyIrzqjgIkQEpI//9eUeaeIHZptNl2fMvBGeXa7k2QgLbRNaBRgpnvMw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@oxc-resolver/binding-wasm32-wasi": { + "version": "11.15.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-wasm32-wasi/-/binding-wasm32-wasi-11.15.0.tgz", + "integrity": "sha512-q5rn2eIMQLuc/AVGR2rQKb2EVlgreATGG8xXg8f4XbbYCVgpxaq+dgMbiPStyNywW1MH8VU2T09UEm30UtOQvg==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@napi-rs/wasm-runtime": "^1.1.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@oxc-resolver/binding-wasm32-wasi/node_modules/@napi-rs/wasm-runtime": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.0.tgz", + "integrity": "sha512-Fq6DJW+Bb5jaWE69/qOE0D1TUN9+6uWhCeZpdnSBk14pjLcCWR7Q8n49PTSPHazM37JqrsdpEthXy2xn6jWWiA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1", + "@tybys/wasm-util": "^0.10.1" + } + }, + "node_modules/@oxc-resolver/binding-wasm32-wasi/node_modules/@tybys/wasm-util": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz", + "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@oxc-resolver/binding-wasm32-wasi/node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD", + "optional": true + }, + "node_modules/@oxc-resolver/binding-win32-arm64-msvc": { + "version": "11.15.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-11.15.0.tgz", + "integrity": "sha512-yCAh2RWjU/8wWTxQDgGPgzV9QBv0/Ojb5ej1c/58iOjyTuy/J1ZQtYi2SpULjKmwIxLJdTiCHpMilauWimE31w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@oxc-resolver/binding-win32-ia32-msvc": { + "version": "11.15.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-11.15.0.tgz", + "integrity": "sha512-lmXKb6lvA6M6QIbtYfgjd+AryJqExZVSY2bfECC18OPu7Lv1mHFF171Mai5l9hG3r4IhHPPIwT10EHoilSCYeA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@oxc-resolver/binding-win32-x64-msvc": { + "version": "11.15.0", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-x64-msvc/-/binding-win32-x64-msvc-11.15.0.tgz", + "integrity": "sha512-HZsfne0s/tGOcJK9ZdTGxsNU2P/dH0Shf0jqrPvsC6wX0Wk+6AyhSpHFLQCnLOuFQiHHU0ePfM8iYsoJb5hHpQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@pkgjs/nv": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/@pkgjs/nv/-/nv-0.2.2.tgz", @@ -19586,16 +19902,16 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.2.11", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", - "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.4" + "micromatch": "^4.0.8" }, "engines": { "node": ">=8.6.0" @@ -19688,6 +20004,26 @@ "node": ">=0.8.0" } }, + "node_modules/fd-package-json": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fd-package-json/-/fd-package-json-2.0.0.tgz", + "integrity": "sha512-jKmm9YtsNXN789RS/0mSzOC1NUq9mkVd65vbSSVsKdjGvYXBuE4oWe2QOEoFeRmJg+lPuZxpmrfFclNhoRMneQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "walk-up-path": "^4.0.0" + } + }, + "node_modules/fd-package-json/node_modules/walk-up-path": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/walk-up-path/-/walk-up-path-4.0.0.tgz", + "integrity": "sha512-3hu+tD8YzSLGuFYtPRb48vdhKMi0KQV5sn+uWr8+7dMEq/2G/dtLrdDinkLjqq5TIbIBjYJ4Ax/n3YiaW7QM8A==", + "dev": true, + "license": "ISC", + "engines": { + "node": "20 || >=22" + } + }, "node_modules/fd-slicer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", @@ -20100,6 +20436,22 @@ "node": ">=0.4.x" } }, + "node_modules/formatly": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/formatly/-/formatly-0.3.0.tgz", + "integrity": "sha512-9XNj/o4wrRFyhSMJOvsuyMwy8aUfBaZ1VrqHVfohyXf0Sw0e+yfKG+xZaY3arGCOMdwFsqObtzVOc1gU9KiT9w==", + "dev": true, + "license": "MIT", + "dependencies": { + "fd-package-json": "^2.0.0" + }, + "bin": { + "formatly": "bin/index.mjs" + }, + "engines": { + "node": ">=18.3.0" + } + }, "node_modules/formdata-polyfill": { "version": "4.0.10", "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", @@ -23018,6 +23370,16 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/jiti": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz", + "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, "node_modules/jju": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", @@ -23871,6 +24233,84 @@ "node": ">=0.10.0" } }, + "node_modules/knip": { + "version": "5.71.0", + "resolved": "https://registry.npmjs.org/knip/-/knip-5.71.0.tgz", + "integrity": "sha512-hwgdqEJ+7DNJ5jE8BCPu7b57TY7vUwP6MzWYgCgPpg6iPCee/jKPShDNIlFER2koti4oz5xF88VJbKCb4Wl71g==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/webpro" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/knip" + } + ], + "license": "ISC", + "dependencies": { + "@nodelib/fs.walk": "^1.2.3", + "fast-glob": "^3.3.3", + "formatly": "^0.3.0", + "jiti": "^2.6.0", + "js-yaml": "^4.1.1", + "minimist": "^1.2.8", + "oxc-resolver": "^11.13.2", + "picocolors": "^1.1.1", + "picomatch": "^4.0.1", + "smol-toml": "^1.5.2", + "strip-json-comments": "5.0.3", + "zod": "^4.1.11" + }, + "bin": { + "knip": "bin/knip.js", + "knip-bun": "bin/knip-bun.js" + }, + "engines": { + "node": ">=18.18.0" + }, + "peerDependencies": { + "@types/node": ">=18", + "typescript": ">=5.0.4 <7" + } + }, + "node_modules/knip/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/knip/node_modules/strip-json-comments": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.3.tgz", + "integrity": "sha512-1tB5mhVo7U+ETBKNf92xT4hrQa3pm0MZ0PQvuDnWgAAGHDsfp4lPSpiS6psrSiet87wyGPh9ft6wmhOMQ0hDiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/knip/node_modules/zod": { + "version": "4.1.13", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.1.13.tgz", + "integrity": "sha512-AvvthqfqrAhNH9dnfmrfKzX5upOdjUVJYFqNSlkmGf64gRaTzlPwz99IHYnVs28qYAybvAlBV+H7pn0saFY4Ig==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/language-subtag-registry": { "version": "0.3.22", "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz", @@ -29229,6 +29669,38 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/oxc-resolver": { + "version": "11.15.0", + "resolved": "https://registry.npmjs.org/oxc-resolver/-/oxc-resolver-11.15.0.tgz", + "integrity": "sha512-Hk2J8QMYwmIO9XTCUiOH00+Xk2/+aBxRUnhrSlANDyCnLYc32R1WSIq1sU2yEdlqd53FfMpPEpnBYIKQMzliJw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "optionalDependencies": { + "@oxc-resolver/binding-android-arm-eabi": "11.15.0", + "@oxc-resolver/binding-android-arm64": "11.15.0", + "@oxc-resolver/binding-darwin-arm64": "11.15.0", + "@oxc-resolver/binding-darwin-x64": "11.15.0", + "@oxc-resolver/binding-freebsd-x64": "11.15.0", + "@oxc-resolver/binding-linux-arm-gnueabihf": "11.15.0", + "@oxc-resolver/binding-linux-arm-musleabihf": "11.15.0", + "@oxc-resolver/binding-linux-arm64-gnu": "11.15.0", + "@oxc-resolver/binding-linux-arm64-musl": "11.15.0", + "@oxc-resolver/binding-linux-ppc64-gnu": "11.15.0", + "@oxc-resolver/binding-linux-riscv64-gnu": "11.15.0", + "@oxc-resolver/binding-linux-riscv64-musl": "11.15.0", + "@oxc-resolver/binding-linux-s390x-gnu": "11.15.0", + "@oxc-resolver/binding-linux-x64-gnu": "11.15.0", + "@oxc-resolver/binding-linux-x64-musl": "11.15.0", + "@oxc-resolver/binding-openharmony-arm64": "11.15.0", + "@oxc-resolver/binding-wasm32-wasi": "11.15.0", + "@oxc-resolver/binding-win32-arm64-msvc": "11.15.0", + "@oxc-resolver/binding-win32-ia32-msvc": "11.15.0", + "@oxc-resolver/binding-win32-x64-msvc": "11.15.0" + } + }, "node_modules/p-cancelable": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.4.1.tgz", @@ -33021,6 +33493,19 @@ "npm": ">= 3.0.0" } }, + "node_modules/smol-toml": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.5.2.tgz", + "integrity": "sha512-QlaZEqcAH3/RtNyet1IPIYPsEWAaYyXXv1Krsi+1L/QHppjX4Ifm8MQsBISz9vE8cHicIq3clogsheili5vhaQ==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">= 18" + }, + "funding": { + "url": "https://github.com/sponsors/cyyynthia" + } + }, "node_modules/snyk-module": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/snyk-module/-/snyk-module-3.2.0.tgz", @@ -36980,6 +37465,7 @@ "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongosh/testing": "0.0.0-dev.0", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.8", "@testing-library/dom": "^8.20.1", "@testing-library/react": "^12.1.5", diff --git a/package.json b/package.json index a8326455b1..c4b07a2f9a 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,9 @@ "depalign": "depalign", "predepcheck": "npm run depalign", "depcheck": "npm run depcheck --workspaces --if-present", + "knip": "knip", + "knip:summary": "knip --reporter summary", + "knip:production": "knip --production --strict", "lint": "npm run lint --workspaces --if-present", "test": "rimraf .nyc_output && npm run test-coverage --workspaces --if-present && npm run report-coverage", "test-ci": "rimraf .nyc_output && npm run test-ci-coverage --workspaces --if-present && npm run post-process-nyc", @@ -134,7 +137,8 @@ "webpack-bundle-analyzer": "^4.7.0", "webpack-cli": "^6.0.1", "which": "^2.0.2", - "yaml": "^1.10.0" + "yaml": "^1.10.0", + "knip": "^5.69.1" }, "optionalDependencies": { "lerna": "^8.1.8" From cd9fa573ef6378d63bd8caaeea4378f23322d944 Mon Sep 17 00:00:00 2001 From: gagik Date: Fri, 5 Dec 2025 13:21:57 +0100 Subject: [PATCH 23/32] chore: finalize config, fix all non-prod knip issues --- knip.ts | 186 +++++++++++++++++-------------- package-lock.json | 10 +- package.json | 18 +-- packages/java-shell/package.json | 3 +- 4 files changed, 110 insertions(+), 107 deletions(-) diff --git a/knip.ts b/knip.ts index 2dce56fbb2..6e5ba59b92 100644 --- a/knip.ts +++ b/knip.ts @@ -1,6 +1,12 @@ import type { KnipConfig } from "knip"; const config: KnipConfig = { + rules: { + // Disable checking for unused exports, unused exported types, and duplicate dependencies. + exports: "off", + types: "off", + duplicates: "off", + }, // Ignore patterns for files that should not be analyzed ignore: [ // Build outputs @@ -12,135 +18,151 @@ const config: KnipConfig = { // Generated files "**/tmp/**", "**/.sbom/**", - // Test fixtures and data - "**/test/fixtures/**", "**/test/data/**", - // Docker and scripts that are executed directly - "scripts/docker/**", - // Async rewriter3 has its own build system (Rust/WASM) - "packages/async-rewriter3/**", - // Configuration files + // Configuration files (from depcheck ignore-patterns) ".evergreen/**", "config/**", "configs/**", + "**/.eslintrc.js", ], - // Ignore dependencies that are used in build processes or special contexts - ignoreDependencies: [ - // Used in build scripts and webpack configs - "terser-webpack-plugin", - "webpack-bundle-analyzer", - "webpack-cli", - "webpack-merge", - // Used in special build contexts - "mongodb-runner", - "mongodb-crypt-library-dummy", - // Used in scripts - "mongodb-sbom-tools", - "@pkgjs/nv", - // Used for husky git hooks - "husky", - // CLI tool - "depcheck", - ], - - // Ignore binaries that are used in scripts - ignoreBinaries: ["depalign", "monorepo-where", "precommit"], - - // Global entry files at root level - entry: ["scripts/**/*.{js,ts,mjs}", "testing/**/*.ts"], - - // Project files to analyze at root level - project: [ - "scripts/**/*.{js,ts,mjs}", - "testing/**/*.ts", - "configs/**/*.{js,ts}", - ], + // Received from @mongodb-js/sbom-tools + ignoreBinaries: ["mongodb-sbom-tools"], // Workspace-specific configurations workspaces: { + // Root package (monorepo root, no entry file needed) ".": { - // Root workspace configuration - entry: ["scripts/**/*.{js,ts,mjs}", "testing/**/*.ts"], + entry: ["scripts/*.ts"], + project: [], + ignoreBinaries: [ + // Lerna is listed as an optional dependency. + "lerna", + ], }, // Config packages "configs/eslint-config-mongosh": { - entry: ["index.js", "utils.js"], + entry: ["utils.js"], }, "configs/tsconfig-mongosh": { entry: ["tsconfig.common.json"], }, - // Main packages - "packages/*": { - entry: ["src/index.ts", "src/index.tsx", "lib/index.js", "bin/**/*.js"], - project: ["src/**/*.{ts,tsx}", "bin/**/*.js"], - }, - // Special cases for packages with different entry points "packages/cli-repl": { - entry: ["bin/mongosh.js", "src/run.ts", "dist/add-module-mapping.js"], - project: ["src/**/*.ts", "bin/**/*.js"], + project: ["src/**/*.ts", "bin/**/*.js", "test/**/*.ts"], + ignoreDependencies: [ + // Eagerly loaded startup snapshot dependencies + "@mongodb-js/saslprep", + "socks", + "emphasize", + "ipv6-normalize", + "bindings", + "system-ca", + // Used for monkey-patching our s390x fix + "@tootallnate/quickjs-emscripten", + ], }, "packages/shell-api": { entry: ["src/api.ts"], - project: ["src/**/*.ts"], }, - "packages/build": { - entry: [ - "src/evergreen-release.ts", - "src/release.ts", - "src/update-cta.ts", - ], - project: ["src/**/*.ts"], + "packages/mongosh": { + project: ["bin/**/*.js"], }, "packages/e2e-tests": { - entry: ["test/**/*.ts"], - project: ["test/**/*.ts"], + entry: ["test/**/*", "test/fixtures/**/*"], + ignoreDependencies: [ + // Used indirectly + "@mongosh/cli-repl", + ], + }, + + "scripts/docker": { + ignoreDependencies: [ + // Used by build.sh script. + "mongodb-crypt-library-version", + ], + }, + + "packages/service-provider-node-driver": { + ignoreDependencies: [ + // Used for MONGODB-AWS auth + // See: https://github.com/mongodb-js/mongosh/pull/1149 + // See: https://jira.mongodb.org/browse/NODE-5005 + "aws4", + ], + }, + + "packages/node-runtime-worker-thread": { + ignoreDependencies: [ + // Used in worker thread context + "system-ca", + ], + ignoreFiles: [ + // Used in package.json + "tests/register-worker.js", + ], }, "packages/browser-repl": { - entry: ["src/index.tsx"], + entry: ["config/*.js"], project: ["src/**/*.{ts,tsx}"], + ignoreDependencies: [ + "@wojtekmaj/enzyme-adapter-react-17", + "enzyme", + // Karma test runner plugins + "karma-chrome-launcher", + "karma-mocha", + "karma-mocha-reporter", + "karma-typescript", + // Resolved as `/` so depcheck doesn't see it being used + "buffer", + "util", + ], }, "packages/java-shell": { - entry: [ - "src/main/kotlin/**/*.kt", - "src/test/kotlin/**/*.kt", - "gen-doc/**/*.js", - "gen-kotlin/**/*.js", - ], - project: [ - "src/main/kotlin/**/*.kt", - "gen-doc/**/*.js", - "gen-kotlin/**/*.js", + entry: ["src/test/js/run-tests.ts"], + project: ["src/main/js/**/*"], + ignoreDependencies: [ + // Used in webpack and build scripts + "bson", + "tr46", + "assert", + "buffer", + "util", ], }, "packages/connectivity-tests": { - entry: ["index.js"], - project: ["**/*.js"], + entry: ["scripts/disable-dns-srv.js"], + // This package only contains bash test scripts + ignoreDependencies: [ + // Used by test scripts + "mongosh", + ], }, - testing: { - entry: [ - "eventually.ts", - "fake-kms.ts", - "integration-testing-hooks.ts", - "disable-dns-srv.js", + "packages/async-rewriter2": { + entry: ["test/fixtures/**/*"], + ignoreFiles: [ + // Used by make-runtime-support.js + "src/runtime-support.nocov.js", ], - project: ["**/*.{ts,js}"], }, - "scripts/docker": { - entry: ["**/*.js"], - project: ["**/*.js"], + "packages/snippet-manager": { + entry: ["test/fixtures/**/*"], + }, + + testing: { + entry: ["src/**/*.ts"], + project: ["src/**/*.ts"], }, }, diff --git a/package-lock.json b/package-lock.json index 8004561ab5..2c28454b03 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,32 +43,24 @@ "mongosh": "packages/cli-repl/bin/mongosh.js" }, "devDependencies": { - "@babel/compat-data": "^7.26.8", "@mongodb-js/monorepo-tools": "^1.1.10", "@pkgjs/nv": "^0.2.2", "@types/chai": "^5.2.3", "@types/mocha": "^5.2.7", "@types/node": "^22.15.30", - "@types/rimraf": "^3.0.0", "@types/semver": "^7.3.4", "@types/sinon-chai": "^4.0.0", - "@types/which": "^1.3.2", "chai": "^6.2.1", "cross-env": "^6.0.3", - "depcheck": "^1.4.7", - "duplexpair": "^1.0.2", "find-up": "^5.0.0", "glob": "^10.3.12", "husky": "^9.0.11", "knip": "^5.69.1", "mocha": "^10.2.0", - "mongodb": "^6.19.0", "mongodb-runner": "^6.0.0", - "node-gyp": "^11.5.0", "nyc": "^15.1.0", "pkg-up": "^3.1.0", "rimraf": "^3.0.2", - "semver": "^7.6.3", "sinon": "^7.5.0", "sinon-chai": "^4.0.1", "terser-webpack-plugin": "^5.3.11", @@ -79,7 +71,6 @@ "webpack": "^5.99.9", "webpack-bundle-analyzer": "^4.7.0", "webpack-cli": "^6.0.1", - "which": "^2.0.2", "yaml": "^1.10.0" }, "engines": { @@ -38866,6 +38857,7 @@ "license": "SSPL", "devDependencies": { "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongosh/testing": "0.0.0-dev.0", "assert": "^1.5.0", "buffer": "^6.0.3", "crypto-browserify": "^3.12.0", diff --git a/package.json b/package.json index c4b07a2f9a..805bfb7b0f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,6 @@ { "name": "mongosh", "description": "The MongoDB Shell", - "main": "index.js", "bin": { "mongosh": "packages/cli-repl/bin/mongosh.js" }, @@ -15,9 +14,7 @@ "check-ci": "npm run check --workspaces --if-present", "depalign": "depalign", "predepcheck": "npm run depalign", - "depcheck": "npm run depcheck --workspaces --if-present", - "knip": "knip", - "knip:summary": "knip --reporter summary", + "depcheck": "knip", "knip:production": "knip --production --strict", "lint": "npm run lint --workspaces --if-present", "test": "rimraf .nyc_output && npm run test-coverage --workspaces --if-present && npm run report-coverage", @@ -101,31 +98,24 @@ "node": ">=20.19.3" }, "devDependencies": { - "@babel/compat-data": "^7.26.8", "@mongodb-js/monorepo-tools": "^1.1.10", "@pkgjs/nv": "^0.2.2", "@types/chai": "^5.2.3", "@types/mocha": "^5.2.7", "@types/node": "^22.15.30", - "@types/rimraf": "^3.0.0", "@types/semver": "^7.3.4", "@types/sinon-chai": "^4.0.0", - "@types/which": "^1.3.2", "chai": "^6.2.1", "cross-env": "^6.0.3", - "depcheck": "^1.4.7", - "duplexpair": "^1.0.2", "find-up": "^5.0.0", "glob": "^10.3.12", "husky": "^9.0.11", + "knip": "^5.69.1", "mocha": "^10.2.0", - "mongodb": "^6.19.0", "mongodb-runner": "^6.0.0", - "node-gyp": "^11.5.0", "nyc": "^15.1.0", "pkg-up": "^3.1.0", "rimraf": "^3.0.2", - "semver": "^7.6.3", "sinon": "^7.5.0", "sinon-chai": "^4.0.1", "terser-webpack-plugin": "^5.3.11", @@ -136,9 +126,7 @@ "webpack": "^5.99.9", "webpack-bundle-analyzer": "^4.7.0", "webpack-cli": "^6.0.1", - "which": "^2.0.2", - "yaml": "^1.10.0", - "knip": "^5.69.1" + "yaml": "^1.10.0" }, "optionalDependencies": { "lerna": "^8.1.8" diff --git a/packages/java-shell/package.json b/packages/java-shell/package.json index 32a46f666d..6598051650 100644 --- a/packages/java-shell/package.json +++ b/packages/java-shell/package.json @@ -28,7 +28,8 @@ "path-browserify": "^1.0.1", "stream-browserify": "^3.0.0", "util": "^0.12.5", - "webpack-merge": "^5.8.0" + "webpack-merge": "^5.8.0", + "@mongosh/testing": "0.0.0-dev.0" }, "license": "SSPL", "publishConfig": { From 3ae015744ea97b6e8aa7f94bffbed3dbdfa89a8f Mon Sep 17 00:00:00 2001 From: gagik Date: Fri, 5 Dec 2025 14:46:28 +0100 Subject: [PATCH 24/32] chore: fix knip --production --- knip.ts | 30 ++++++++++++++----- mongosh.code-workspace | 8 ++--- package-lock.json | 25 ++++++++-------- package.json | 7 ++--- packages/async-rewriter2/bin/async-rewrite.js | 2 +- .../{bin => scripts}/make-runtime-support.js | 0 packages/browser-repl/package.json | 3 +- packages/e2e-tests/package.json | 12 ++++---- packages/e2e-tests/test/e2e.spec.ts | 2 +- packages/logging/package.json | 4 +-- .../node-runtime-worker-thread/package.json | 6 ++-- packages/shell-api/package.json | 12 ++++---- .../{bin => scripts}/api-postprocess.ts | 2 +- .../{bin => scripts}/report-missing-help.ts | 0 .../{bin => scripts}/report-supported-api.ts | 2 +- 15 files changed, 63 insertions(+), 52 deletions(-) rename packages/async-rewriter2/{bin => scripts}/make-runtime-support.js (100%) rename packages/shell-api/{bin => scripts}/api-postprocess.ts (99%) rename packages/shell-api/{bin => scripts}/report-missing-help.ts (100%) rename packages/shell-api/{bin => scripts}/report-supported-api.ts (91%) diff --git a/knip.ts b/knip.ts index 6e5ba59b92..6abc28fbdd 100644 --- a/knip.ts +++ b/knip.ts @@ -52,7 +52,7 @@ const config: KnipConfig = { // Special cases for packages with different entry points "packages/cli-repl": { - project: ["src/**/*.ts", "bin/**/*.js", "test/**/*.ts"], + project: ["src/**/*.ts!", "bin/**/*.js", "test/**/*.ts"], ignoreDependencies: [ // Eagerly loaded startup snapshot dependencies "@mongodb-js/saslprep", @@ -67,7 +67,7 @@ const config: KnipConfig = { }, "packages/shell-api": { - entry: ["src/api.ts"], + entry: ["src/api.ts!", "scripts/*.ts", "test/*.ts"], }, "packages/mongosh": { @@ -75,9 +75,9 @@ const config: KnipConfig = { }, "packages/e2e-tests": { - entry: ["test/**/*", "test/fixtures/**/*"], + entry: ["test/**/*.ts", "test/fixtures/**/*"], ignoreDependencies: [ - // Used indirectly + // This is used for version check. TODO: Consider changing that test. "@mongosh/cli-repl", ], }, @@ -109,9 +109,13 @@ const config: KnipConfig = { ], }, + "packages/errors": { + entry: ["src/index.ts!", "scripts/*.ts"], + }, + "packages/browser-repl": { - entry: ["config/*.js"], - project: ["src/**/*.{ts,tsx}"], + entry: ["src/index.tsx!", "config/*.js"], + project: ["src/**/*.{ts,tsx}!"], ignoreDependencies: [ "@wojtekmaj/enzyme-adapter-react-17", "enzyme", @@ -149,7 +153,13 @@ const config: KnipConfig = { }, "packages/async-rewriter2": { - entry: ["test/fixtures/**/*"], + entry: [ + "src/index.ts!", + "bin/*.js!", + "test/fixtures/**/*", + "scripts/*.js", + "benchmark/index.ts", + ], ignoreFiles: [ // Used by make-runtime-support.js "src/runtime-support.nocov.js", @@ -185,7 +195,11 @@ const config: KnipConfig = { // Webpack configuration webpack: { - config: ["config/webpack.base.config.js", "**/webpack.config.js"], + config: [ + "config/webpack.base.config.js", + "**/webpack.config.js", + "**/webpack.config.*.js", + ], }, // ESLint configuration diff --git a/mongosh.code-workspace b/mongosh.code-workspace index 728c1c39f8..9ce22be57a 100644 --- a/mongosh.code-workspace +++ b/mongosh.code-workspace @@ -32,10 +32,6 @@ "name": "📦 @mongosh/history", "path": "packages/history" }, - { - "name": "📦 @mongosh/java-shell", - "path": "packages/java-shell" - }, { "name": "📦 @mongosh/js-multiline-to-singleline", "path": "packages/js-multiline-to-singleline" @@ -64,6 +60,10 @@ "name": "📦 @mongosh/arg-parser", "path": "packages/arg-parser" }, + { + "name": "📦 @mongosh/java-shell", + "path": "packages/java-shell" + }, { "name": "📦 @mongosh/service-provider-core", "path": "packages/service-provider-core" diff --git a/package-lock.json b/package-lock.json index 2c28454b03..992c2abdf1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -55,7 +55,7 @@ "find-up": "^5.0.0", "glob": "^10.3.12", "husky": "^9.0.11", - "knip": "^5.69.1", + "knip": "^5.71.0", "mocha": "^10.2.0", "mongodb-runner": "^6.0.0", "nyc": "^15.1.0", @@ -35931,6 +35931,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/web-worker/-/web-worker-1.3.0.tgz", "integrity": "sha512-BSR9wyRsy/KOValMgd5kMyr3JzpdeoR9KVId8u5GVlTTAtNChlsE4yTxeY7zMdNSyOmoKBv8NH2qeRY9Tg+IaA==", + "dev": true, "license": "Apache-2.0" }, "node_modules/webdriver-bidi-protocol": { @@ -38700,17 +38701,14 @@ "name": "@mongosh/e2e-tests", "version": "3.17.0", "license": "Apache-2.0", - "dependencies": { - "@mongodb-js/oidc-plugin": "^2.0.5", - "@mongosh/cli-repl": "2.5.10", - "@mongosh/service-provider-core": "3.7.0", - "strip-ansi": "^6.0.0" - }, "devDependencies": { "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/oidc-mock-provider": "^0.11.3", + "@mongodb-js/oidc-plugin": "^2.0.5", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongosh/cli-repl": "2.5.10", + "@mongosh/service-provider-core": "3.7.0", "@types/chai-as-promised": "^8.0.2", "@types/node": "^22.15.30", "@types/rimraf": "^3.0.0", @@ -38724,7 +38722,8 @@ "mongodb-log-writer": "^2.4.3", "node-fetch": "^3.3.2", "prettier": "^2.8.8", - "rimraf": "^3.0.2" + "rimraf": "^3.0.2", + "strip-ansi": "^6.0.0" }, "engines": { "node": ">=16.15.0" @@ -38947,7 +38946,6 @@ "dependencies": { "@mongodb-js/device-id": "^0.2.1", "@mongodb-js/devtools-connect": "^3.9.4", - "@mongosh/errors": "2.4.5", "@mongosh/types": "^3.14.1", "mongodb-log-writer": "^2.4.3", "mongodb-redact": "^1.3.0", @@ -38957,6 +38955,7 @@ "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongosh/errors": "2.4.5", "@segment/analytics-node": "^1.3.0", "depcheck": "^1.4.7", "eslint": "^7.25.0", @@ -39095,8 +39094,7 @@ "license": "Apache-2.0", "dependencies": { "interruptor": "^1.0.1", - "system-ca": "^2.0.1", - "web-worker": "^1.3.0" + "system-ca": "^2.0.1" }, "devDependencies": { "@mongodb-js/eslint-config-mongosh": "^1.0.0", @@ -39115,6 +39113,7 @@ "mocha": "^10.2.0", "postmsg-rpc": "^2.4.0", "prettier": "^2.8.8", + "web-worker": "^1.3.0", "webpack-merge": "^5.8.0" }, "engines": { @@ -39184,8 +39183,6 @@ "version": "3.29.0", "license": "Apache-2.0", "dependencies": { - "@babel/core": "^7.26.10", - "@babel/types": "^7.26.10", "@mongosh/arg-parser": "^3.23.0", "@mongosh/errors": "2.4.5", "@mongosh/i18n": "^2.20.0", @@ -39195,6 +39192,8 @@ "mongodb-schema": "^12.6.2" }, "devDependencies": { + "@babel/core": "^7.26.10", + "@babel/types": "^7.26.10", "@microsoft/api-extractor": "^7.39.3", "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/mongodb-ts-autocomplete": "^0.4.7", diff --git a/package.json b/package.json index 805bfb7b0f..0c3796d5f1 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,7 @@ "check-ci": "npm run check --workspaces --if-present", "depalign": "depalign", "predepcheck": "npm run depalign", - "depcheck": "knip", - "knip:production": "knip --production --strict", + "depcheck": "knip && knip --production", "lint": "npm run lint --workspaces --if-present", "test": "rimraf .nyc_output && npm run test-coverage --workspaces --if-present && npm run report-coverage", "test-ci": "rimraf .nyc_output && npm run test-ci-coverage --workspaces --if-present && npm run post-process-nyc", @@ -110,7 +109,7 @@ "find-up": "^5.0.0", "glob": "^10.3.12", "husky": "^9.0.11", - "knip": "^5.69.1", + "knip": "^5.71.0", "mocha": "^10.2.0", "mongodb-runner": "^6.0.0", "nyc": "^15.1.0", @@ -139,7 +138,6 @@ "packages/build", "packages/errors", "packages/history", - "packages/java-shell", "packages/js-multiline-to-singleline", "packages/types", "packages/i18n", @@ -147,6 +145,7 @@ "packages/shell-bson", "packages/testing", "packages/arg-parser", + "packages/java-shell", "packages/service-provider-core", "packages/service-provider-node-driver", "packages/shell-api", diff --git a/packages/async-rewriter2/bin/async-rewrite.js b/packages/async-rewriter2/bin/async-rewrite.js index f2aa3224c9..29b8954dec 100755 --- a/packages/async-rewriter2/bin/async-rewrite.js +++ b/packages/async-rewriter2/bin/async-rewrite.js @@ -1,6 +1,6 @@ #!/usr/bin/env node 'use strict'; -const AsyncWriter = require('../').default; +const AsyncWriter = require('../lib').default; const fs = require('fs'); const input = fs.readFileSync(process.argv[2], 'utf8'); const asyncWriter = new AsyncWriter(); diff --git a/packages/async-rewriter2/bin/make-runtime-support.js b/packages/async-rewriter2/scripts/make-runtime-support.js similarity index 100% rename from packages/async-rewriter2/bin/make-runtime-support.js rename to packages/async-rewriter2/scripts/make-runtime-support.js diff --git a/packages/browser-repl/package.json b/packages/browser-repl/package.json index 6bc9152ded..baf951785e 100644 --- a/packages/browser-repl/package.json +++ b/packages/browser-repl/package.json @@ -21,7 +21,8 @@ } }, "scripts": { - "start": "webpack serve --config ./config/webpack.config.watch.js", + "start": "npm run webpack-serve", + "webpack-serve": "webpack serve --config ./config/webpack.config.watch.js", "clean": "rimraf ./lib", "preprepublish": "rimraf ./lib", "prepublish": "npm run compile", diff --git a/packages/e2e-tests/package.json b/packages/e2e-tests/package.json index 5f45f2174b..003938854c 100644 --- a/packages/e2e-tests/package.json +++ b/packages/e2e-tests/package.json @@ -26,12 +26,6 @@ "engines": { "node": ">=16.15.0" }, - "dependencies": { - "@mongosh/cli-repl": "2.5.10", - "@mongosh/service-provider-core": "3.7.0", - "@mongodb-js/oidc-plugin": "^2.0.5", - "strip-ansi": "^6.0.0" - }, "devDependencies": { "mongodb-log-writer": "^2.4.3", "@mongodb-js/eslint-config-mongosh": "^1.0.0", @@ -50,6 +44,10 @@ "mongodb": "^6.19.0", "node-fetch": "^3.3.2", "prettier": "^2.8.8", - "rimraf": "^3.0.2" + "rimraf": "^3.0.2", + "@mongodb-js/oidc-plugin": "^2.0.5", + "strip-ansi": "^6.0.0", + "@mongosh/cli-repl": "2.5.10", + "@mongosh/service-provider-core": "3.7.0" } } diff --git a/packages/e2e-tests/test/e2e.spec.ts b/packages/e2e-tests/test/e2e.spec.ts index 7adc59e31b..ec3cbf4614 100644 --- a/packages/e2e-tests/test/e2e.spec.ts +++ b/packages/e2e-tests/test/e2e.spec.ts @@ -442,7 +442,7 @@ describe('e2e', function () { } const currentOp = await shell.executeLine('db.currentOp()'); const expectedVersion = - require('../package.json')['dependencies']['@mongosh/cli-repl']; + require('../package.json')['devDependencies']['@mongosh/cli-repl']; expect(currentOp).to.include(`appName: 'mongosh ${expectedVersion}'`); expect(currentOp).to.include("name: 'nodejs|mongosh'"); shell.assertNoErrors(); diff --git a/packages/logging/package.json b/packages/logging/package.json index 4de66e70ae..29b8693b13 100644 --- a/packages/logging/package.json +++ b/packages/logging/package.json @@ -19,7 +19,6 @@ "dependencies": { "@mongodb-js/device-id": "^0.2.1", "@mongodb-js/devtools-connect": "^3.9.4", - "@mongosh/errors": "2.4.5", "@mongosh/types": "^3.14.1", "mongodb-log-writer": "^2.4.3", "mongodb-redact": "^1.3.0", @@ -33,7 +32,8 @@ "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8", - "sinon": "^19.0.4" + "sinon": "^19.0.4", + "@mongosh/errors": "2.4.5" }, "scripts": { "test": "mocha", diff --git a/packages/node-runtime-worker-thread/package.json b/packages/node-runtime-worker-thread/package.json index f0909de616..404dc2bf16 100644 --- a/packages/node-runtime-worker-thread/package.json +++ b/packages/node-runtime-worker-thread/package.json @@ -52,11 +52,11 @@ "mocha": "^10.2.0", "postmsg-rpc": "^2.4.0", "prettier": "^2.8.8", - "webpack-merge": "^5.8.0" + "webpack-merge": "^5.8.0", + "web-worker": "^1.3.0" }, "dependencies": { "interruptor": "^1.0.1", - "system-ca": "^2.0.1", - "web-worker": "^1.3.0" + "system-ca": "^2.0.1" } } diff --git a/packages/shell-api/package.json b/packages/shell-api/package.json index 176d3e36ab..1df36a0a87 100644 --- a/packages/shell-api/package.json +++ b/packages/shell-api/package.json @@ -23,14 +23,14 @@ }, "scripts": { "compile": "tsc -p tsconfig.json && npm run api-generate", - "api-generate": "api-extractor run && ts-node bin/api-postprocess.ts", + "api-generate": "api-extractor run && ts-node scripts/api-postprocess.ts", "pretest": "npm run compile", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", "check": "npm run lint && npm run depcheck", "depcheck": "depcheck", - "report-missing-help": "ts-node bin/report-missing-help.ts", - "report-supported-api": "ts-node bin/report-supported-api.ts", + "report-missing-help": "ts-node scripts/report-missing-help.ts", + "report-supported-api": "ts-node scripts/report-supported-api.ts", "test": "mocha", "test-ci": "node ../../scripts/run-if-package-requested.js npm test", "test-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test", @@ -51,8 +51,6 @@ "build" ], "dependencies": { - "@babel/core": "^7.26.10", - "@babel/types": "^7.26.10", "@mongosh/arg-parser": "^3.23.0", "@mongosh/errors": "2.4.5", "@mongosh/i18n": "^2.20.0", @@ -74,6 +72,8 @@ "eslint": "^7.25.0", "mongodb": "^6.19.0", "prettier": "^2.8.8", - "semver": "^7.5.3" + "semver": "^7.5.3", + "@babel/core": "^7.26.10", + "@babel/types": "^7.26.10" } } diff --git a/packages/shell-api/bin/api-postprocess.ts b/packages/shell-api/scripts/api-postprocess.ts similarity index 99% rename from packages/shell-api/bin/api-postprocess.ts rename to packages/shell-api/scripts/api-postprocess.ts index 0e1c6ad10f..2bf9bd33d0 100644 --- a/packages/shell-api/bin/api-postprocess.ts +++ b/packages/shell-api/scripts/api-postprocess.ts @@ -2,7 +2,7 @@ import * as babel from '@babel/core'; import type * as BabelTypes from '@babel/types'; import { promises as fs } from 'fs'; import path from 'path'; -import { signatures } from '../'; +import { signatures } from '../lib'; import enUs from '../../i18n/src/locales/en_US'; function applyAsyncRewriterChanges() { diff --git a/packages/shell-api/bin/report-missing-help.ts b/packages/shell-api/scripts/report-missing-help.ts similarity index 100% rename from packages/shell-api/bin/report-missing-help.ts rename to packages/shell-api/scripts/report-missing-help.ts diff --git a/packages/shell-api/bin/report-supported-api.ts b/packages/shell-api/scripts/report-supported-api.ts similarity index 91% rename from packages/shell-api/bin/report-supported-api.ts rename to packages/shell-api/scripts/report-supported-api.ts index 730aad97a9..a7524bed88 100644 --- a/packages/shell-api/bin/report-supported-api.ts +++ b/packages/shell-api/scripts/report-supported-api.ts @@ -1,5 +1,5 @@ /* eslint-disable no-console */ -import { signatures } from '../'; +import { signatures } from '../lib'; Object.keys(signatures) .sort() From 0183a87c5aac3603807e1d34d1c26f15dc7b2d57 Mon Sep 17 00:00:00 2001 From: gagik Date: Fri, 5 Dec 2025 15:08:09 +0100 Subject: [PATCH 25/32] chore: fix depalign --- package-lock.json | 2 +- package.json | 2 +- packages/browser-repl/package.json | 1 - packages/browser-runtime-electron/package.json | 2 -- 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 992c2abdf1..80aff21379 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,6 @@ "packages/build", "packages/errors", "packages/history", - "packages/java-shell", "packages/js-multiline-to-singleline", "packages/types", "packages/i18n", @@ -23,6 +22,7 @@ "packages/shell-bson", "packages/testing", "packages/arg-parser", + "packages/java-shell", "packages/service-provider-core", "packages/service-provider-node-driver", "packages/shell-api", diff --git a/package.json b/package.json index 0c3796d5f1..51198fd77b 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,7 @@ "nyc": "^15.1.0", "pkg-up": "^3.1.0", "rimraf": "^3.0.2", - "sinon": "^7.5.0", + "sinon": "^19.0.4", "sinon-chai": "^4.0.1", "terser-webpack-plugin": "^5.3.11", "ts-loader": "^8.0.14", diff --git a/packages/browser-repl/package.json b/packages/browser-repl/package.json index baf951785e..d84b4e1d60 100644 --- a/packages/browser-repl/package.json +++ b/packages/browser-repl/package.json @@ -86,7 +86,6 @@ "@types/numeral": "^2.0.2", "@types/react": "^16.9.17", "@types/react-dom": "^18.0.8", - "@types/sinon": "^7.5.1", "@types/text-table": "^0.2.1", "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0", "babel-loader": "^8.3.0", diff --git a/packages/browser-runtime-electron/package.json b/packages/browser-runtime-electron/package.json index 67903eead7..e1031671f6 100644 --- a/packages/browser-runtime-electron/package.json +++ b/packages/browser-runtime-electron/package.json @@ -42,8 +42,6 @@ "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/service-provider-node-driver": "^3.18.0", - "@types/sinon": "^7.5.1", - "@types/sinon-chai": "^4.0.0", "bson": "^6.10.4", "depcheck": "^1.4.7", "eslint": "^7.25.0", From 4e6d08bf330f0547afca990ff0042fce9fabd907 Mon Sep 17 00:00:00 2001 From: gagik Date: Fri, 5 Dec 2025 15:13:11 +0100 Subject: [PATCH 26/32] chore: package-lock --- package-lock.json | 310 ++++++++++++++++------------------------------ 1 file changed, 108 insertions(+), 202 deletions(-) diff --git a/package-lock.json b/package-lock.json index 80aff21379..ded52ac3c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -61,7 +61,7 @@ "nyc": "^15.1.0", "pkg-up": "^3.1.0", "rimraf": "^3.0.2", - "sinon": "^7.5.0", + "sinon": "^19.0.4", "sinon-chai": "^4.0.1", "terser-webpack-plugin": "^5.3.11", "ts-loader": "^8.0.14", @@ -11317,33 +11317,51 @@ "@sinonjs/commons": "^1.7.0" } }, - "node_modules/@sinonjs/formatio": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.2.2.tgz", - "integrity": "sha512-B8SEsgd8gArBLMD6zpRw3juQ2FVSsmdd7qlevyDqzS9WTCtvF55/gAL+h6gue8ZvPYcdiPdvueM/qm//9XzyTQ==", + "node_modules/@sinonjs/samsam": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-8.0.3.tgz", + "integrity": "sha512-hw6HbX+GyVZzmaYNh82Ecj1vdGZrqVIn/keDTg63IgAwiQPO+xCz99uG6Woqgb4tM0mUiFENKZ4cqd7IX94AXQ==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "@sinonjs/commons": "^1", - "@sinonjs/samsam": "^3.1.0" + "@sinonjs/commons": "^3.0.1", + "type-detect": "^4.1.0" } }, - "node_modules/@sinonjs/samsam": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.3.3.tgz", - "integrity": "sha512-bKCMKZvWIjYD0BLGnNrxVuw4dkWCYsLqFOUWw8VgKF/+5Y+mE7LfHWPIYoDXowH+3a9LsWDMo0uAP8YDosPvHQ==", + "node_modules/@sinonjs/samsam/node_modules/@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "@sinonjs/commons": "^1.3.0", - "array-from": "^2.1.1", - "lodash": "^4.17.15" + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/samsam/node_modules/@sinonjs/commons/node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/@sinonjs/samsam/node_modules/type-detect": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" } }, "node_modules/@sinonjs/text-encoding": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", - "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.3.tgz", + "integrity": "sha512-DE427ROAphMQzU4ENbliGYrBSYPXF+TtLg9S8vzeA+OF4ZKzoDdzfL8sxuMUGS/lgRhM6j1URSk9ghf7Xo1tyA==", "dev": true, "license": "(Unlicense OR Apache-2.0)" }, @@ -14469,13 +14487,6 @@ "dev": true, "license": "MIT" }, - "node_modules/array-from": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", - "integrity": "sha512-GQTc6Uupx1FCavi5mPzBvVT7nEOeWMmUA9P95wpfpW1XwMSKs+KaymD5C2Up7KAUKg/mYwbsUYzdZWcoajlNZg==", - "dev": true, - "license": "MIT" - }, "node_modules/array-ify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", @@ -26101,13 +26112,6 @@ "node": ">=8.0" } }, - "node_modules/lolex": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.2.0.tgz", - "integrity": "sha512-gKO5uExCXvSm6zbF562EvM+rd1kQDnB9AZBbiQVzf1ZmdDpxUSvpnAaVOP83N/31mRK8Ml8/VE8DMvsAZQ+7wg==", - "dev": true, - "license": "BSD-3-Clause" - }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -27884,27 +27888,55 @@ "license": "MIT" }, "node_modules/nise": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/nise/-/nise-1.5.3.tgz", - "integrity": "sha512-Ymbac/94xeIrMf59REBPOv0thr+CJVFMhrlAkW/gjCIE58BGQdCj0x7KRCb3yz+Ga2Rz3E9XXSvUyyxqqhjQAQ==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/nise/-/nise-6.1.1.tgz", + "integrity": "sha512-aMSAzLVY7LyeM60gvBS423nBmIPP+Wy7St7hsb+8/fc1HmeoHJfLO8CKse4u3BtOZvQLJghYPI2i/1WZrEj5/g==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "@sinonjs/formatio": "^3.2.1", - "@sinonjs/text-encoding": "^0.7.1", - "just-extend": "^4.0.2", - "lolex": "^5.0.1", - "path-to-regexp": "^1.7.0" + "@sinonjs/commons": "^3.0.1", + "@sinonjs/fake-timers": "^13.0.1", + "@sinonjs/text-encoding": "^0.7.3", + "just-extend": "^6.2.0", + "path-to-regexp": "^8.1.0" } }, - "node_modules/nise/node_modules/lolex": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-5.1.2.tgz", - "integrity": "sha512-h4hmjAvHTmd+25JSwrtTIuwbKdwg5NzZVRMLn9saij4SZaepCrTCxPr35H/3bjwfMJtN+t3CX8672UIkglz28A==", + "node_modules/nise/node_modules/@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "@sinonjs/commons": "^1.7.0" + "type-detect": "4.0.8" + } + }, + "node_modules/nise/node_modules/@sinonjs/fake-timers": { + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-13.0.5.tgz", + "integrity": "sha512-36/hTbH2uaWuGVERyC6da9YwGWnzUZXuPro/F2LfsdOsLnCojz/iSH8MxUt/FD2S5XBSVPhmArFUXcpCQ2Hkiw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.1" + } + }, + "node_modules/nise/node_modules/just-extend": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-6.2.0.tgz", + "integrity": "sha512-cYofQu2Xpom82S6qD778jBDpwvvy39s1l/hrYij2u9AMdQcGRpaBu6kY4mVhuno5kJVi1DAz4aiphA2WI1/OAw==", + "dev": true, + "license": "MIT" + }, + "node_modules/nise/node_modules/path-to-regexp": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz", + "integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==", + "dev": true, + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/no-case": { @@ -33374,19 +33406,22 @@ } }, "node_modules/sinon": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.5.0.tgz", - "integrity": "sha512-AoD0oJWerp0/rY9czP/D6hDTTUYGpObhZjMpd7Cl/A6+j0xBE+ayL/ldfggkBXUs0IkvIiM1ljM8+WkOc5k78Q==", + "version": "19.0.5", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-19.0.5.tgz", + "integrity": "sha512-r15s9/s+ub/d4bxNXqIUmwp6imVSdTorIRaxoecYjqTVLZ8RuoXr/4EDGwIBo6Waxn7f2gnURX9zuhAfCwaF6Q==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "@sinonjs/commons": "^1.4.0", - "@sinonjs/formatio": "^3.2.1", - "@sinonjs/samsam": "^3.3.3", - "diff": "^3.5.0", - "lolex": "^4.2.0", - "nise": "^1.5.2", - "supports-color": "^5.5.0" + "@sinonjs/commons": "^3.0.1", + "@sinonjs/fake-timers": "^13.0.5", + "@sinonjs/samsam": "^8.0.1", + "diff": "^7.0.0", + "nise": "^6.1.1", + "supports-color": "^7.2.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/sinon" } }, "node_modules/sinon-chai": { @@ -33400,37 +33435,34 @@ "sinon": ">=4.0.0" } }, - "node_modules/sinon/node_modules/diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "node_modules/sinon/node_modules/@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", "dev": true, "license": "BSD-3-Clause", - "engines": { - "node": ">=0.3.1" + "dependencies": { + "type-detect": "4.0.8" } }, - "node_modules/sinon/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "node_modules/sinon/node_modules/@sinonjs/fake-timers": { + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-13.0.5.tgz", + "integrity": "sha512-36/hTbH2uaWuGVERyC6da9YwGWnzUZXuPro/F2LfsdOsLnCojz/iSH8MxUt/FD2S5XBSVPhmArFUXcpCQ2Hkiw==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.1" } }, - "node_modules/sinon/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/sinon/node_modules/diff": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", + "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^3.0.0" - }, + "license": "BSD-3-Clause", "engines": { - "node": ">=4" + "node": ">=0.3.1" } }, "node_modules/sirv": { @@ -37465,7 +37497,6 @@ "@types/numeral": "^2.0.2", "@types/react": "^16.9.17", "@types/react-dom": "^18.0.8", - "@types/sinon": "^7.5.1", "@types/text-table": "^0.2.1", "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0", "babel-loader": "^8.3.0", @@ -37550,13 +37581,6 @@ "node": ">=12" } }, - "packages/browser-repl/node_modules/@types/sinon": { - "version": "7.5.2", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-7.5.2.tgz", - "integrity": "sha512-T+m89VdXj/eidZyejvmoP9jivXgBDdkOSBVQjU9kF349NEx10QdPNGxHeZUaj1IlJ32/ewdyXJjnJxyxJroYwg==", - "dev": true, - "license": "MIT" - }, "packages/browser-repl/node_modules/ajv": { "version": "8.17.1", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", @@ -38207,8 +38231,6 @@ "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/service-provider-node-driver": "^3.18.0", - "@types/sinon": "^7.5.1", - "@types/sinon-chai": "^4.0.0", "bson": "^6.10.4", "depcheck": "^1.4.7", "eslint": "^7.25.0", @@ -38219,13 +38241,6 @@ "node": ">=14.15.1" } }, - "packages/browser-runtime-electron/node_modules/@types/sinon": { - "version": "7.5.2", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-7.5.2.tgz", - "integrity": "sha512-T+m89VdXj/eidZyejvmoP9jivXgBDdkOSBVQjU9kF349NEx10QdPNGxHeZUaj1IlJ32/ewdyXJjnJxyxJroYwg==", - "dev": true, - "license": "MIT" - }, "packages/build": { "name": "@mongosh/build", "version": "3.7.11", @@ -38966,115 +38981,6 @@ "node": ">=14.15.1" } }, - "packages/logging/node_modules/@sinonjs/commons": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", - "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "type-detect": "4.0.8" - } - }, - "packages/logging/node_modules/@sinonjs/fake-timers": { - "version": "13.0.5", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-13.0.5.tgz", - "integrity": "sha512-36/hTbH2uaWuGVERyC6da9YwGWnzUZXuPro/F2LfsdOsLnCojz/iSH8MxUt/FD2S5XBSVPhmArFUXcpCQ2Hkiw==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@sinonjs/commons": "^3.0.1" - } - }, - "packages/logging/node_modules/@sinonjs/samsam": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-8.0.2.tgz", - "integrity": "sha512-v46t/fwnhejRSFTGqbpn9u+LQ9xJDse10gNnPgAcxgdoCDMXj/G2asWAC/8Qs+BAZDicX+MNZouXT1A7c83kVw==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@sinonjs/commons": "^3.0.1", - "lodash.get": "^4.4.2", - "type-detect": "^4.1.0" - } - }, - "packages/logging/node_modules/@sinonjs/samsam/node_modules/type-detect": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", - "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "packages/logging/node_modules/@sinonjs/text-encoding": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.3.tgz", - "integrity": "sha512-DE427ROAphMQzU4ENbliGYrBSYPXF+TtLg9S8vzeA+OF4ZKzoDdzfL8sxuMUGS/lgRhM6j1URSk9ghf7Xo1tyA==", - "dev": true, - "license": "(Unlicense OR Apache-2.0)" - }, - "packages/logging/node_modules/diff": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", - "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.3.1" - } - }, - "packages/logging/node_modules/just-extend": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-6.2.0.tgz", - "integrity": "sha512-cYofQu2Xpom82S6qD778jBDpwvvy39s1l/hrYij2u9AMdQcGRpaBu6kY4mVhuno5kJVi1DAz4aiphA2WI1/OAw==", - "dev": true, - "license": "MIT" - }, - "packages/logging/node_modules/nise": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/nise/-/nise-6.1.1.tgz", - "integrity": "sha512-aMSAzLVY7LyeM60gvBS423nBmIPP+Wy7St7hsb+8/fc1HmeoHJfLO8CKse4u3BtOZvQLJghYPI2i/1WZrEj5/g==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@sinonjs/commons": "^3.0.1", - "@sinonjs/fake-timers": "^13.0.1", - "@sinonjs/text-encoding": "^0.7.3", - "just-extend": "^6.2.0", - "path-to-regexp": "^8.1.0" - } - }, - "packages/logging/node_modules/path-to-regexp": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz", - "integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=16" - } - }, - "packages/logging/node_modules/sinon": { - "version": "19.0.4", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-19.0.4.tgz", - "integrity": "sha512-myidFob7fjmYHJb+CHNLtAYScxn3sngGq4t75L2rCGGpE/k4OQVkN3KE5FsN+XkO2+fcDZ65PGvq3KHrlLAm7g==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@sinonjs/commons": "^3.0.1", - "@sinonjs/fake-timers": "^13.0.5", - "@sinonjs/samsam": "^8.0.1", - "diff": "^7.0.0", - "nise": "^6.1.1", - "supports-color": "^7.2.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/sinon" - } - }, "packages/mongosh": { "version": "2.5.10", "license": "Apache-2.0", From dc52f81c7d9ce7110ba0ecac4d8c7a7309bc6ed6 Mon Sep 17 00:00:00 2001 From: gagik Date: Fri, 5 Dec 2025 15:15:16 +0100 Subject: [PATCH 27/32] chore: remove depcheck at package level --- packages/arg-parser/package.json | 2 +- packages/async-rewriter2/package.json | 2 +- packages/autocomplete/package.json | 2 +- packages/browser-repl/package.json | 2 +- packages/browser-runtime-core/package.json | 2 +- packages/browser-runtime-electron/package.json | 2 +- packages/build/package.json | 2 +- packages/cli-repl/package.json | 2 +- packages/e2e-tests/package.json | 2 +- packages/editor/package.json | 2 +- packages/errors/package.json | 2 +- packages/history/package.json | 2 +- packages/i18n/package.json | 2 +- packages/js-multiline-to-singleline/package.json | 2 +- packages/logging/package.json | 2 +- packages/node-runtime-worker-thread/package.json | 2 +- packages/service-provider-core/package.json | 2 +- packages/service-provider-node-driver/package.json | 2 +- packages/shell-api/package.json | 2 +- packages/shell-bson/package.json | 2 +- packages/shell-evaluator/package.json | 2 +- packages/snippet-manager/package.json | 2 +- packages/types/package.json | 2 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/packages/arg-parser/package.json b/packages/arg-parser/package.json index 73f6f9e16c..1186439fcf 100644 --- a/packages/arg-parser/package.json +++ b/packages/arg-parser/package.json @@ -28,7 +28,7 @@ "test-ci-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test-ci", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", - "check": "npm run lint && npm run depcheck", + "check": "npm run lint", "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "prepublish": "npm run compile", diff --git a/packages/async-rewriter2/package.json b/packages/async-rewriter2/package.json index 221e6c3ff3..4423666b39 100644 --- a/packages/async-rewriter2/package.json +++ b/packages/async-rewriter2/package.json @@ -12,7 +12,7 @@ "test-ci-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test-ci", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", - "check": "npm run lint && npm run depcheck", + "check": "npm run lint", "depcheck": "depcheck", "compile": "node bin/make-runtime-support.js --firstpass && tsc -p tsconfig.json && node bin/make-runtime-support.js --secondpass && tsc -p tsconfig.json", "prepublish": "npm run compile", diff --git a/packages/autocomplete/package.json b/packages/autocomplete/package.json index ec4030b3fa..9b7c04f002 100644 --- a/packages/autocomplete/package.json +++ b/packages/autocomplete/package.json @@ -23,7 +23,7 @@ "test-ci-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test-ci", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", - "check": "npm run lint && npm run depcheck", + "check": "npm run lint", "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "prepublish": "npm run compile", diff --git a/packages/browser-repl/package.json b/packages/browser-repl/package.json index d84b4e1d60..bc653aa87b 100644 --- a/packages/browser-repl/package.json +++ b/packages/browser-repl/package.json @@ -32,7 +32,7 @@ "test-ci-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test-ci", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", - "check": "npm run lint && npm run depcheck", + "check": "npm run lint", "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "prettier": "prettier", diff --git a/packages/browser-runtime-core/package.json b/packages/browser-runtime-core/package.json index ab226f2b4b..3fe7e24e80 100644 --- a/packages/browser-runtime-core/package.json +++ b/packages/browser-runtime-core/package.json @@ -21,7 +21,7 @@ "test-ci-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test-ci", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", - "check": "npm run lint && npm run depcheck", + "check": "npm run lint", "depcheck": "depcheck", "preprepublish": "rimraf ./lib", "prepublish": "npm run compile", diff --git a/packages/browser-runtime-electron/package.json b/packages/browser-runtime-electron/package.json index e1031671f6..142075f3fb 100644 --- a/packages/browser-runtime-electron/package.json +++ b/packages/browser-runtime-electron/package.json @@ -21,7 +21,7 @@ "test-ci-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test-ci", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", - "check": "npm run lint && npm run depcheck", + "check": "npm run lint", "depcheck": "depcheck", "preprepublish": "rimraf ./lib", "prepublish": "npm run compile", diff --git a/packages/build/package.json b/packages/build/package.json index 4d5b196ad8..8e5cea6fa9 100644 --- a/packages/build/package.json +++ b/packages/build/package.json @@ -21,7 +21,7 @@ "test-ci-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test-ci", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", - "check": "npm run lint && npm run depcheck", + "check": "npm run lint", "depcheck": "depcheck", "evergreen-release": "ts-node -r ../../scripts/import-expansions.js src/index.ts", "release": "ts-node src/index.ts trigger-release", diff --git a/packages/cli-repl/package.json b/packages/cli-repl/package.json index bf7ea80399..bd01b5b3ac 100644 --- a/packages/cli-repl/package.json +++ b/packages/cli-repl/package.json @@ -29,7 +29,7 @@ "test-smoke": "node bin/mongosh.js --smokeTests", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", - "check": "npm run lint && npm run depcheck", + "check": "npm run lint", "depcheck": "depcheck", "prepublish": "npm run compile", "webpack-build": "npm run compile && webpack --mode production && cat dist/add-module-mapping.js >> dist/mongosh.js", diff --git a/packages/e2e-tests/package.json b/packages/e2e-tests/package.json index 003938854c..f9b109778c 100644 --- a/packages/e2e-tests/package.json +++ b/packages/e2e-tests/package.json @@ -17,7 +17,7 @@ "test-ci-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test-ci", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", - "check": "npm run lint && npm run depcheck", + "check": "npm run lint", "depcheck": "depcheck", "prettier": "prettier", "reformat": "npm run prettier -- --write . && npm run eslint -- --fix" diff --git a/packages/editor/package.json b/packages/editor/package.json index c3f4e859bd..97c7fb0974 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -17,7 +17,7 @@ "test-ci-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test-ci", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", - "check": "npm run lint && npm run depcheck", + "check": "npm run lint", "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "prepublish": "npm run compile", diff --git a/packages/errors/package.json b/packages/errors/package.json index 2436bcd7fe..10913f6ee9 100644 --- a/packages/errors/package.json +++ b/packages/errors/package.json @@ -23,7 +23,7 @@ "test-ci-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test-ci", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", - "check": "npm run lint && npm run depcheck", + "check": "npm run lint", "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "prepublish": "npm run compile", diff --git a/packages/history/package.json b/packages/history/package.json index 8f18d8a34b..cf3c5cfc6e 100644 --- a/packages/history/package.json +++ b/packages/history/package.json @@ -17,7 +17,7 @@ "test-ci-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test-ci", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", - "check": "npm run lint && npm run depcheck", + "check": "npm run lint", "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "prepublish": "npm run compile", diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 9662777e39..57195162c4 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -20,7 +20,7 @@ "test-ci-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test-ci", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", - "check": "npm run lint && npm run depcheck", + "check": "npm run lint", "depcheck": "depcheck", "prettier": "prettier", "reformat": "npm run prettier -- --write . && npm run eslint -- --fix" diff --git a/packages/js-multiline-to-singleline/package.json b/packages/js-multiline-to-singleline/package.json index fbf231d1b8..2eaff8092e 100644 --- a/packages/js-multiline-to-singleline/package.json +++ b/packages/js-multiline-to-singleline/package.json @@ -17,7 +17,7 @@ "test-ci-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test-ci", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", - "check": "npm run lint && npm run depcheck", + "check": "npm run lint", "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "prepublish": "npm run compile", diff --git a/packages/logging/package.json b/packages/logging/package.json index 29b8693b13..a10df4d230 100644 --- a/packages/logging/package.json +++ b/packages/logging/package.json @@ -42,7 +42,7 @@ "test-ci-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test-ci", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", - "check": "npm run lint && npm run depcheck", + "check": "npm run lint", "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "prepublish": "npm run compile", diff --git a/packages/node-runtime-worker-thread/package.json b/packages/node-runtime-worker-thread/package.json index 404dc2bf16..32ec6b123c 100644 --- a/packages/node-runtime-worker-thread/package.json +++ b/packages/node-runtime-worker-thread/package.json @@ -24,7 +24,7 @@ "test-ci-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test-ci", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", - "check": "npm run lint && npm run depcheck", + "check": "npm run lint", "depcheck": "depcheck", "webpack-build": "npm run compile && webpack --mode production", "webpack-build-dev": "npm run compile && webpack --mode development", diff --git a/packages/service-provider-core/package.json b/packages/service-provider-core/package.json index 90f9dc45bf..090bfd311e 100644 --- a/packages/service-provider-core/package.json +++ b/packages/service-provider-core/package.json @@ -20,7 +20,7 @@ "test-ci-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test-ci", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", - "check": "npm run lint && npm run depcheck", + "check": "npm run lint", "depcheck": "depcheck", "prettier": "prettier", "reformat": "npm run prettier -- --write . && npm run eslint -- --fix" diff --git a/packages/service-provider-node-driver/package.json b/packages/service-provider-node-driver/package.json index bfd544f6a7..bef57864b3 100644 --- a/packages/service-provider-node-driver/package.json +++ b/packages/service-provider-node-driver/package.json @@ -20,7 +20,7 @@ "prepublish": "npm run compile", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", - "check": "npm run lint && npm run depcheck", + "check": "npm run lint", "depcheck": "depcheck", "prettier": "prettier", "reformat": "npm run prettier -- --write . && npm run eslint -- --fix" diff --git a/packages/shell-api/package.json b/packages/shell-api/package.json index 1df36a0a87..7c8e332287 100644 --- a/packages/shell-api/package.json +++ b/packages/shell-api/package.json @@ -27,7 +27,7 @@ "pretest": "npm run compile", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", - "check": "npm run lint && npm run depcheck", + "check": "npm run lint", "depcheck": "depcheck", "report-missing-help": "ts-node scripts/report-missing-help.ts", "report-supported-api": "ts-node scripts/report-supported-api.ts", diff --git a/packages/shell-bson/package.json b/packages/shell-bson/package.json index ee52a2a664..1a6e7ba44a 100644 --- a/packages/shell-bson/package.json +++ b/packages/shell-bson/package.json @@ -17,7 +17,7 @@ "url": "git+https://github.com/mongodb-js/mongosh.git" }, "scripts": { - "check": "npm run lint && npm run depcheck", + "check": "npm run lint", "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "eslint": "eslint", diff --git a/packages/shell-evaluator/package.json b/packages/shell-evaluator/package.json index ffc2f4e8f1..4fec798ffe 100644 --- a/packages/shell-evaluator/package.json +++ b/packages/shell-evaluator/package.json @@ -10,7 +10,7 @@ "test-ci-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test-ci", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", - "check": "npm run lint && npm run depcheck", + "check": "npm run lint", "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "prepublish": "npm run compile", diff --git a/packages/snippet-manager/package.json b/packages/snippet-manager/package.json index f99557c9ab..3874701a4e 100644 --- a/packages/snippet-manager/package.json +++ b/packages/snippet-manager/package.json @@ -17,7 +17,7 @@ "test-ci-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test-ci", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", - "check": "npm run lint && npm run depcheck", + "check": "npm run lint", "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "prepublish": "npm run compile", diff --git a/packages/types/package.json b/packages/types/package.json index e9c975c566..0a997910f2 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -18,7 +18,7 @@ "url": "git+https://github.com/mongodb-js/mongosh.git" }, "scripts": { - "check": "npm run lint && npm run depcheck", + "check": "npm run lint", "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "eslint": "eslint", From 21baf75d02528024ca2971016b2e3a50ec546242 Mon Sep 17 00:00:00 2001 From: gagik Date: Fri, 5 Dec 2025 15:18:44 +0100 Subject: [PATCH 28/32] chore: rename fix --- packages/async-rewriter2/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/async-rewriter2/package.json b/packages/async-rewriter2/package.json index 4423666b39..207afa7d3f 100644 --- a/packages/async-rewriter2/package.json +++ b/packages/async-rewriter2/package.json @@ -14,7 +14,7 @@ "lint": "npm run eslint . && npm run prettier -- --check .", "check": "npm run lint", "depcheck": "depcheck", - "compile": "node bin/make-runtime-support.js --firstpass && tsc -p tsconfig.json && node bin/make-runtime-support.js --secondpass && tsc -p tsconfig.json", + "compile": "node scripts/make-runtime-support.js --firstpass && tsc -p tsconfig.json && node scripts/make-runtime-support.js --secondpass && tsc -p tsconfig.json", "prepublish": "npm run compile", "prettier": "prettier", "reformat": "npm run prettier -- --write . && npm run eslint -- --fix" From 5c1c4793df4c1f2a1ca3fb378f635e9b9ce36e31 Mon Sep 17 00:00:00 2001 From: gagik Date: Fri, 5 Dec 2025 15:45:10 +0100 Subject: [PATCH 29/32] chore: fix check, get rid of depcheck completely --- knip.ts | 4 +- package-lock.json | 395 +----------------- package.json | 2 +- packages/arg-parser/.depcheckrc | 16 - packages/arg-parser/package.json | 2 - packages/async-rewriter2/.depcheckrc | 14 - packages/async-rewriter2/package.json | 2 - packages/autocomplete/.depcheckrc | 11 - packages/autocomplete/package.json | 2 - packages/browser-repl/.depcheckrc | 22 - packages/browser-repl/package.json | 2 - packages/browser-runtime-core/.depcheckrc | 14 - packages/browser-runtime-core/package.json | 2 - packages/browser-runtime-electron/.depcheckrc | 13 - .../browser-runtime-electron/package.json | 2 - packages/build/.depcheckrc | 16 - packages/build/package.json | 2 - packages/cli-repl/.depcheckrc | 24 -- packages/cli-repl/package.json | 2 - packages/e2e-tests/.depcheckrc | 23 - packages/e2e-tests/package.json | 2 - packages/editor/.depcheckrc | 14 - packages/editor/package.json | 2 - packages/errors/.depcheckrc | 14 - packages/errors/package.json | 2 - packages/history/.depcheckrc | 11 - packages/history/package.json | 2 - packages/i18n/.depcheckrc | 11 - packages/i18n/package.json | 2 - .../js-multiline-to-singleline/.depcheckrc | 11 - .../js-multiline-to-singleline/package.json | 2 - packages/logging/.depcheckrc | 11 - packages/logging/package.json | 2 - .../node-runtime-worker-thread/.depcheckrc | 14 - .../node-runtime-worker-thread/package.json | 2 - packages/service-provider-core/.depcheckrc | 11 - packages/service-provider-core/package.json | 2 - .../service-provider-node-driver/.depcheckrc | 20 - .../service-provider-node-driver/package.json | 2 - packages/shell-api/.depcheckrc | 14 - packages/shell-api/package.json | 2 - packages/shell-api/tsconfig-lint.json | 2 +- packages/shell-bson/.depcheckrc | 16 - packages/shell-bson/package.json | 2 - packages/shell-evaluator/.depcheckrc | 14 - packages/shell-evaluator/package.json | 2 - packages/snippet-manager/.depcheckrc | 14 - packages/snippet-manager/package.json | 2 - packages/types/.depcheckrc | 16 - packages/types/package.json | 2 - 50 files changed, 7 insertions(+), 786 deletions(-) delete mode 100644 packages/arg-parser/.depcheckrc delete mode 100644 packages/async-rewriter2/.depcheckrc delete mode 100644 packages/autocomplete/.depcheckrc delete mode 100644 packages/browser-repl/.depcheckrc delete mode 100644 packages/browser-runtime-core/.depcheckrc delete mode 100644 packages/browser-runtime-electron/.depcheckrc delete mode 100644 packages/build/.depcheckrc delete mode 100644 packages/cli-repl/.depcheckrc delete mode 100644 packages/e2e-tests/.depcheckrc delete mode 100644 packages/editor/.depcheckrc delete mode 100644 packages/errors/.depcheckrc delete mode 100644 packages/history/.depcheckrc delete mode 100644 packages/i18n/.depcheckrc delete mode 100644 packages/js-multiline-to-singleline/.depcheckrc delete mode 100644 packages/logging/.depcheckrc delete mode 100644 packages/node-runtime-worker-thread/.depcheckrc delete mode 100644 packages/service-provider-core/.depcheckrc delete mode 100644 packages/service-provider-node-driver/.depcheckrc delete mode 100644 packages/shell-api/.depcheckrc delete mode 100644 packages/shell-bson/.depcheckrc delete mode 100644 packages/shell-evaluator/.depcheckrc delete mode 100644 packages/snippet-manager/.depcheckrc delete mode 100644 packages/types/.depcheckrc diff --git a/knip.ts b/knip.ts index 6abc28fbdd..5d765d4d30 100644 --- a/knip.ts +++ b/knip.ts @@ -19,7 +19,7 @@ const config: KnipConfig = { "**/tmp/**", "**/.sbom/**", "**/test/data/**", - // Configuration files (from depcheck ignore-patterns) + // Configuration files ".evergreen/**", "config/**", "configs/**", @@ -124,7 +124,7 @@ const config: KnipConfig = { "karma-mocha", "karma-mocha-reporter", "karma-typescript", - // Resolved as `/` so depcheck doesn't see it being used + // Resolved as `/` "buffer", "util", ], diff --git a/package-lock.json b/package-lock.json index ded52ac3c8..73676f3d5e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13610,67 +13610,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/@vue/compiler-core": { - "version": "3.5.12", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.12.tgz", - "integrity": "sha512-ISyBTRMmMYagUxhcpyEH0hpXRd/KqDU4ymofPgl2XAkY9ZhQ+h0ovEZJIiPop13UmR/54oA2cgMDjgroRelaEw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.25.3", - "@vue/shared": "3.5.12", - "entities": "^4.5.0", - "estree-walker": "^2.0.2", - "source-map-js": "^1.2.0" - } - }, - "node_modules/@vue/compiler-dom": { - "version": "3.5.12", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.12.tgz", - "integrity": "sha512-9G6PbJ03uwxLHKQ3P42cMTi85lDRvGLB2rSGOiQqtXELat6uI4n8cNz9yjfVHRPIu+MsK6TE418Giruvgptckg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vue/compiler-core": "3.5.12", - "@vue/shared": "3.5.12" - } - }, - "node_modules/@vue/compiler-sfc": { - "version": "3.5.12", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.12.tgz", - "integrity": "sha512-2k973OGo2JuAa5+ZlekuQJtitI5CgLMOwgl94BzMCsKZCX/xiqzJYzapl4opFogKHqwJk34vfsaKpfEhd1k5nw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.25.3", - "@vue/compiler-core": "3.5.12", - "@vue/compiler-dom": "3.5.12", - "@vue/compiler-ssr": "3.5.12", - "@vue/shared": "3.5.12", - "estree-walker": "^2.0.2", - "magic-string": "^0.30.11", - "postcss": "^8.4.47", - "source-map-js": "^1.2.0" - } - }, - "node_modules/@vue/compiler-ssr": { - "version": "3.5.12", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.12.tgz", - "integrity": "sha512-eLwc7v6bfGBSM7wZOGPmRavSWzNFF6+PdRhE+VFJhNCgHiF8AM7ccoqcv5kBXA2eWUfigD7byekvf/JsOfKvPA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vue/compiler-dom": "3.5.12", - "@vue/shared": "3.5.12" - } - }, - "node_modules/@vue/shared": { - "version": "3.5.12", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.12.tgz", - "integrity": "sha512-L2RPSAwUFbgZH20etwrXyVyCBu9OxRSi8T/38QsvnkJyvq2LufW2lDCOzm7t/U9C1mkhJGWYfCuFBCmIuNivrg==", - "dev": true, - "license": "MIT" - }, "node_modules/@webassemblyjs/ast": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", @@ -14464,8 +14403,8 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", - "devOptional": true, "license": "MIT", + "optional": true, "engines": { "node": ">=8" } @@ -15889,15 +15828,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/callsite": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", - "integrity": "sha512-0vdNRFXn5q+dtOqjfFtmtlI9N2eVZ7LMyEV2iKC5mEEFvSg/69Ml6b/WU2qF8W1nLRa0wiSrDT3Y5jOHZCwKPQ==", - "dev": true, - "engines": { - "node": "*" - } - }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -17648,94 +17578,6 @@ "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", "license": "MIT" }, - "node_modules/depcheck": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/depcheck/-/depcheck-1.4.7.tgz", - "integrity": "sha512-1lklS/bV5chOxwNKA/2XUUk/hPORp8zihZsXflr8x0kLwmcZ9Y9BsS6Hs3ssvA+2wUVbG0U2Ciqvm1SokNjPkA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.23.0", - "@babel/traverse": "^7.23.2", - "@vue/compiler-sfc": "^3.3.4", - "callsite": "^1.0.0", - "camelcase": "^6.3.0", - "cosmiconfig": "^7.1.0", - "debug": "^4.3.4", - "deps-regex": "^0.2.0", - "findup-sync": "^5.0.0", - "ignore": "^5.2.4", - "is-core-module": "^2.12.0", - "js-yaml": "^3.14.1", - "json5": "^2.2.3", - "lodash": "^4.17.21", - "minimatch": "^7.4.6", - "multimatch": "^5.0.0", - "please-upgrade-node": "^3.2.0", - "readdirp": "^3.6.0", - "require-package-name": "^2.0.1", - "resolve": "^1.22.3", - "resolve-from": "^5.0.0", - "semver": "^7.5.4", - "yargs": "^16.2.0" - }, - "bin": { - "depcheck": "bin/depcheck.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/depcheck/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/depcheck/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/depcheck/node_modules/minimatch": { - "version": "7.4.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.6.tgz", - "integrity": "sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/depcheck/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -17751,13 +17593,6 @@ "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", "license": "ISC" }, - "node_modules/deps-regex": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/deps-regex/-/deps-regex-0.2.0.tgz", - "integrity": "sha512-PwuBojGMQAYbWkMXOY9Pd/NWCDNHVH12pnS7WHqZkTSeMESe4hwnKKRp0yR87g37113x4JPbo/oIvXY+s/f56Q==", - "dev": true, - "license": "MIT" - }, "node_modules/dequal": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", @@ -17789,16 +17624,6 @@ "npm": "1.2.8000 || >= 1.4.16" } }, - "node_modules/detect-file": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/detect-indent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", @@ -19307,13 +19132,6 @@ "node": ">=4.0" } }, - "node_modules/estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true, - "license": "MIT" - }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -19437,19 +19255,6 @@ "node": ">=6" } }, - "node_modules/expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==", - "dev": true, - "license": "MIT", - "dependencies": { - "homedir-polyfill": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/exponential-backoff": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.1.tgz", @@ -20283,22 +20088,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/findup-sync": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-5.0.0.tgz", - "integrity": "sha512-MzwXju70AuyflbgeOhzvQWAvvQdo1XL0A9bVvlXsYcFEBM87WR4OakL4OfZq+QRmr+duJubio+UtNQCPsVESzQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "detect-file": "^1.0.0", - "is-glob": "^4.0.3", - "micromatch": "^4.0.4", - "resolve-dir": "^1.0.1" - }, - "engines": { - "node": ">= 10.13.0" - } - }, "node_modules/flat": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", @@ -21045,51 +20834,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/global-modules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", - "dev": true, - "license": "MIT", - "dependencies": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/global-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==", - "dev": true, - "license": "MIT", - "dependencies": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/global-prefix/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, "node_modules/globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", @@ -21596,19 +21340,6 @@ "minimalistic-crypto-utils": "^1.0.1" } }, - "node_modules/homedir-polyfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", - "dev": true, - "license": "MIT", - "dependencies": { - "parse-passwd": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/hosted-git-info": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", @@ -26222,16 +25953,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/magic-string": { - "version": "0.30.12", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.12.tgz", - "integrity": "sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0" - } - }, "node_modules/make-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", @@ -27682,8 +27403,8 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-5.0.0.tgz", "integrity": "sha512-ypMKuglUrZUD99Tk2bUQ+xNQj43lPEfAeX2o9cTteAmShXy2VHDJpuwu1o0xqoKCt9jLVAvwyFKdLTPXKAfJyA==", - "devOptional": true, "license": "MIT", + "optional": true, "dependencies": { "@types/minimatch": "^3.0.3", "array-differ": "^3.0.0", @@ -27702,8 +27423,8 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", - "devOptional": true, "license": "MIT", + "optional": true, "engines": { "node": ">=8" } @@ -30273,16 +29994,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/parse-path": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/parse-path/-/parse-path-7.0.0.tgz", @@ -30673,16 +30384,6 @@ "node": ">=4" } }, - "node_modules/please-upgrade-node": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", - "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", - "dev": true, - "license": "MIT", - "dependencies": { - "semver-compare": "^1.0.0" - } - }, "node_modules/polished": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/polished/-/polished-4.2.2.tgz", @@ -30705,35 +30406,6 @@ "node": ">= 0.4" } }, - "node_modules/postcss": { - "version": "8.4.47", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz", - "integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "nanoid": "^3.3.7", - "picocolors": "^1.1.0", - "source-map-js": "^1.2.1" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, "node_modules/postcss-selector-parser": { "version": "6.1.2", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", @@ -32251,13 +31923,6 @@ "dev": true, "license": "ISC" }, - "node_modules/require-package-name": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/require-package-name/-/require-package-name-2.0.1.tgz", - "integrity": "sha512-uuoJ1hU/k6M0779t3VMVIYpb2VMJk05cehCaABFhXaibcbvfgR8wKiozLjVFSzJPmQMRqIcO0HMyTFqfV09V6Q==", - "dev": true, - "license": "MIT" - }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -32317,20 +31982,6 @@ "node": ">=8" } }, - "node_modules/resolve-dir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==", - "dev": true, - "license": "MIT", - "dependencies": { - "expand-tilde": "^2.0.0", - "global-modules": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -32778,13 +32429,6 @@ "node": ">=10" } }, - "node_modules/semver-compare": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", - "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", - "dev": true, - "license": "MIT" - }, "node_modules/send": { "version": "0.19.1", "resolved": "https://registry.npmjs.org/send/-/send-0.19.1.tgz", @@ -33760,16 +33404,6 @@ "node": ">=0.10.0" } }, - "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/source-map-support": { "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", @@ -37401,7 +37035,6 @@ "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/yargs-parser": "^21.0.3", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "mongodb": "^6.19.0", "prettier": "^2.8.8" @@ -37432,7 +37065,6 @@ "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/babel__core": "^7.20.1", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" }, @@ -37454,7 +37086,6 @@ "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "mocha": "^10.2.0", "prettier": "^2.8.8" @@ -37501,7 +37132,6 @@ "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0", "babel-loader": "^8.3.0", "buffer": "^6.0.3", - "depcheck": "^1.4.7", "enzyme": "^3.11.0", "eslint": "^7.25.0", "html-webpack-plugin": "^5.5.0", @@ -38208,7 +37838,6 @@ "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/types": "^3.14.1", "bson": "^6.10.4", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8", "rimraf": "^3.0.2" @@ -38232,7 +37861,6 @@ "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/service-provider-node-driver": "^3.18.0", "bson": "^6.10.4", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8", "rimraf": "^3.0.2" @@ -38281,7 +37909,6 @@ "@types/tar-fs": "^2.0.0", "@types/tmp": "^0.2.3", "cross-spawn": "^7.0.5", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8", "sinon-chai": "^4.0.1", @@ -38676,7 +38303,6 @@ "@types/numeral": "^2.0.2", "@types/text-table": "^0.2.1", "chai-as-promised": "^8.0.2", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "mongodb": "^6.19.0", "mongodb-crypt-library-dummy": "^1.0.2", @@ -38729,7 +38355,6 @@ "@types/rimraf": "^3.0.0", "bson": "^6.10.4", "chai-as-promised": "^8.0.2", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "lodash": "^4.17.21", "moment": "^2.29.1", @@ -38799,7 +38424,6 @@ "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "nanobus": "^4.5.0", "prettier": "^2.8.8" @@ -38817,7 +38441,6 @@ "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "chalk": "^4.1.2", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "handlebars": "^4.7.7", "prettier": "^2.8.8", @@ -38838,7 +38461,6 @@ "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" }, @@ -38857,7 +38479,6 @@ "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" }, @@ -38946,7 +38567,6 @@ "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/babel__core": "^7.1.18", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" }, @@ -38972,7 +38592,6 @@ "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/errors": "2.4.5", "@segment/analytics-node": "^1.3.0", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8", "sinon": "^19.0.4" @@ -39014,7 +38633,6 @@ "@mongosh/testing": "0.0.0-dev.0", "@mongosh/types": "^3.14.1", "bson": "^6.10.4", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "mocha": "^10.2.0", "postmsg-rpc": "^2.4.0", @@ -39042,7 +38660,6 @@ "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" }, @@ -39072,7 +38689,6 @@ "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/testing": "0.0.0-dev.0", "@types/sinon-chai": "^4.0.0", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" }, @@ -39108,7 +38724,6 @@ "@mongosh/testing": "0.0.0-dev.0", "@mongosh/types": "^3.14.1", "bson": "^6.10.4", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "mongodb": "^6.19.0", "prettier": "^2.8.8", @@ -39130,7 +38745,6 @@ "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "bson": "^6.10.4", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" }, @@ -39156,7 +38770,6 @@ "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/types": "^3.14.1", "@types/sinon-chai": "^4.0.0", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" }, @@ -39186,7 +38799,6 @@ "@mongosh/testing": "0.0.0-dev.0", "@types/cross-spawn": "^6.0.6", "@types/tar": "^4.0.4", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "nanobus": "^4.5.0", "prettier": "^2.8.8" @@ -39243,7 +38855,6 @@ "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "mongodb": "^6.19.0", "prettier": "^2.8.8" diff --git a/package.json b/package.json index 51198fd77b..278dd0159b 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "bootstrap": "npx cross-env PUPPETEER_SKIP_DOWNLOAD=1 npm install && npm run compile", "clean": "lerna clean -y && rm -Rf node_modules", "check": "lerna run check --since HEAD --exclude-dependents", - "check-ci": "npm run check --workspaces --if-present", + "check-ci": "npm run depcheck && npm run check --workspaces --if-present", "depalign": "depalign", "predepcheck": "npm run depalign", "depcheck": "knip && knip --production", diff --git a/packages/arg-parser/.depcheckrc b/packages/arg-parser/.depcheckrc deleted file mode 100644 index dc0bc2df82..0000000000 --- a/packages/arg-parser/.depcheckrc +++ /dev/null @@ -1,16 +0,0 @@ -ignores: - - '@mongodb-js/eslint-config-mongosh' - - '@mongodb-js/tsconfig-mongosh' - - '@mongodb-js/prettier-config-devtools' - - '@typescript-eslint/parser' - - '@typescript-eslint/eslint-plugin' - - chai - - sinon-chai - - eslint-plugin-mocha - - eslint-config-mongodb-js -# needed as a peer dependency of @mongodb-js/devtools-connect - - mongodb - # only used in arg-parser export; should be removed once switched to knip - - yargs-parser -ignore-patterns: - - .eslintrc.js \ No newline at end of file diff --git a/packages/arg-parser/package.json b/packages/arg-parser/package.json index 1186439fcf..d590adda21 100644 --- a/packages/arg-parser/package.json +++ b/packages/arg-parser/package.json @@ -29,7 +29,6 @@ "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", "check": "npm run lint", - "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "prepublish": "npm run compile", "prettier": "prettier", @@ -60,7 +59,6 @@ "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/yargs-parser": "^21.0.3", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "mongodb": "^6.19.0", "prettier": "^2.8.8" diff --git a/packages/async-rewriter2/.depcheckrc b/packages/async-rewriter2/.depcheckrc deleted file mode 100644 index 8721cf6363..0000000000 --- a/packages/async-rewriter2/.depcheckrc +++ /dev/null @@ -1,14 +0,0 @@ -ignores: - - '@mongodb-js/eslint-config-mongosh' - - '@mongodb-js/tsconfig-mongosh' - - '@mongodb-js/prettier-config-devtools' - - '@typescript-eslint/parser' - - '@typescript-eslint/eslint-plugin' - - chai - - sinon - - sinon-chai - - ts-sinon - - eslint-plugin-mocha - - eslint-config-mongodb-js -ignore-patterns: - - .eslintrc.js \ No newline at end of file diff --git a/packages/async-rewriter2/package.json b/packages/async-rewriter2/package.json index 207afa7d3f..7c99bc8c5c 100644 --- a/packages/async-rewriter2/package.json +++ b/packages/async-rewriter2/package.json @@ -13,7 +13,6 @@ "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", "check": "npm run lint", - "depcheck": "depcheck", "compile": "node scripts/make-runtime-support.js --firstpass && tsc -p tsconfig.json && node scripts/make-runtime-support.js --secondpass && tsc -p tsconfig.json", "prepublish": "npm run compile", "prettier": "prettier", @@ -51,7 +50,6 @@ "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/babel__core": "^7.20.1", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" } diff --git a/packages/autocomplete/.depcheckrc b/packages/autocomplete/.depcheckrc deleted file mode 100644 index b0d55bf402..0000000000 --- a/packages/autocomplete/.depcheckrc +++ /dev/null @@ -1,11 +0,0 @@ -ignores: - - '@mongodb-js/tsconfig-mongosh' - - '@mongodb-js/eslint-config-mongosh' - - '@mongodb-js/prettier-config-devtools' - - '@typescript-eslint/parser' - - '@typescript-eslint/eslint-plugin' - - chai - - eslint-plugin-mocha - - eslint-config-mongodb-js -ignore-patterns: - - .eslintrc.js \ No newline at end of file diff --git a/packages/autocomplete/package.json b/packages/autocomplete/package.json index 9b7c04f002..a5b70ffcc7 100644 --- a/packages/autocomplete/package.json +++ b/packages/autocomplete/package.json @@ -24,7 +24,6 @@ "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", "check": "npm run lint", - "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "prepublish": "npm run compile", "prettier": "prettier", @@ -37,7 +36,6 @@ "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "mocha": "^10.2.0", "prettier": "^2.8.8" diff --git a/packages/browser-repl/.depcheckrc b/packages/browser-repl/.depcheckrc deleted file mode 100644 index 203ccbcf87..0000000000 --- a/packages/browser-repl/.depcheckrc +++ /dev/null @@ -1,22 +0,0 @@ -ignores: - - '@mongodb-js/tsconfig-mongosh' - - '@mongodb-js/eslint-config-mongosh' - - '@mongodb-js/prettier-config-devtools' - - '@typescript-eslint/parser' - - '@typescript-eslint/eslint-plugin' - - chai - - eslint-plugin-mocha - - eslint-config-mongodb-js - - sinon - - sinon-chai - - karma-chrome-launcher - - karma-mocha - - karma-mocha-reporter - - karma-typescript -# used by webpack - - webpack-cli -# resolved as `/` so depcheck doesn't see it being used - - buffer - - util -ignore-patterns: - - .eslintrc.js \ No newline at end of file diff --git a/packages/browser-repl/package.json b/packages/browser-repl/package.json index bc653aa87b..cd8c8aece4 100644 --- a/packages/browser-repl/package.json +++ b/packages/browser-repl/package.json @@ -33,7 +33,6 @@ "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", "check": "npm run lint", - "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "prettier": "prettier", "reformat": "npm run prettier -- --write . && npm run eslint -- --fix", @@ -90,7 +89,6 @@ "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0", "babel-loader": "^8.3.0", "buffer": "^6.0.3", - "depcheck": "^1.4.7", "enzyme": "^3.11.0", "eslint": "^7.25.0", "html-webpack-plugin": "^5.5.0", diff --git a/packages/browser-runtime-core/.depcheckrc b/packages/browser-runtime-core/.depcheckrc deleted file mode 100644 index 64321acf68..0000000000 --- a/packages/browser-runtime-core/.depcheckrc +++ /dev/null @@ -1,14 +0,0 @@ -ignores: - - '@mongodb-js/tsconfig-mongosh' - - '@mongodb-js/eslint-config-mongosh' - - '@mongodb-js/prettier-config-devtools' - - '@typescript-eslint/parser' - - '@typescript-eslint/eslint-plugin' - - chai - - sinon - - sinon-chai - - ts-sinon - - eslint-plugin-mocha - - eslint-config-mongodb-js -ignore-patterns: - - .eslintrc.js \ No newline at end of file diff --git a/packages/browser-runtime-core/package.json b/packages/browser-runtime-core/package.json index 3fe7e24e80..4cb46713f3 100644 --- a/packages/browser-runtime-core/package.json +++ b/packages/browser-runtime-core/package.json @@ -22,7 +22,6 @@ "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", "check": "npm run lint", - "depcheck": "depcheck", "preprepublish": "rimraf ./lib", "prepublish": "npm run compile", "compile": "tsc -p tsconfig.json", @@ -44,7 +43,6 @@ "@mongodb-js/mongodb-ts-autocomplete": "^0.4.7", "@mongosh/types": "^3.14.1", "bson": "^6.10.4", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8", "rimraf": "^3.0.2" diff --git a/packages/browser-runtime-electron/.depcheckrc b/packages/browser-runtime-electron/.depcheckrc deleted file mode 100644 index a24c6469c9..0000000000 --- a/packages/browser-runtime-electron/.depcheckrc +++ /dev/null @@ -1,13 +0,0 @@ -ignores: - - '@mongodb-js/eslint-config-mongosh' - - '@mongodb-js/tsconfig-mongosh' - - '@mongodb-js/prettier-config-devtools' - - '@typescript-eslint/parser' - - '@typescript-eslint/eslint-plugin' - - chai - - sinon-chai - - sinon - - eslint-plugin-mocha - - eslint-config-mongodb-js -ignore-patterns: - - .eslintrc.js \ No newline at end of file diff --git a/packages/browser-runtime-electron/package.json b/packages/browser-runtime-electron/package.json index 142075f3fb..734e012ca1 100644 --- a/packages/browser-runtime-electron/package.json +++ b/packages/browser-runtime-electron/package.json @@ -22,7 +22,6 @@ "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", "check": "npm run lint", - "depcheck": "depcheck", "preprepublish": "rimraf ./lib", "prepublish": "npm run compile", "compile": "tsc -p tsconfig.json", @@ -43,7 +42,6 @@ "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/service-provider-node-driver": "^3.18.0", "bson": "^6.10.4", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8", "rimraf": "^3.0.2" diff --git a/packages/build/.depcheckrc b/packages/build/.depcheckrc deleted file mode 100644 index baf681c00b..0000000000 --- a/packages/build/.depcheckrc +++ /dev/null @@ -1,16 +0,0 @@ -ignores: - - '@mongodb-js/eslint-config-mongosh' - - '@mongodb-js/tsconfig-mongosh' - - '@mongodb-js/prettier-config-devtools' - - '@typescript-eslint/parser' - - '@typescript-eslint/eslint-plugin' - - chai - - sinon - - ts-sinon - - sinon - - eslint-plugin-mocha - - eslint-config-mongodb-js - # transitive type dependency of @types/tmp-promise - - '@types/tmp' -ignore-patterns: - - .eslintrc.js diff --git a/packages/build/package.json b/packages/build/package.json index 8e5cea6fa9..0059524de9 100644 --- a/packages/build/package.json +++ b/packages/build/package.json @@ -22,7 +22,6 @@ "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", "check": "npm run lint", - "depcheck": "depcheck", "evergreen-release": "ts-node -r ../../scripts/import-expansions.js src/index.ts", "release": "ts-node src/index.ts trigger-release", "prettier": "prettier", @@ -57,7 +56,6 @@ "@types/tar-fs": "^2.0.0", "@types/tmp": "^0.2.3", "cross-spawn": "^7.0.5", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8", "sinon-chai": "^4.0.1", diff --git a/packages/cli-repl/.depcheckrc b/packages/cli-repl/.depcheckrc deleted file mode 100644 index ba9a7904de..0000000000 --- a/packages/cli-repl/.depcheckrc +++ /dev/null @@ -1,24 +0,0 @@ -ignores: - - '@mongodb-js/eslint-config-mongosh' - - '@mongodb-js/tsconfig-mongosh' - - '@mongodb-js/prettier-config-devtools' - - '@typescript-eslint/parser' - - '@typescript-eslint/eslint-plugin' - - chai - - sinon - - sinon-chai - - ts-sinon - - mocha - - eslint-plugin-mocha - - eslint-config-mongodb-js - # eagerly loaded startup snapshot dependencies - - '@mongodb-js/saslprep' - - socks - - emphasize - - ipv6-normalize - - bindings - - system-ca - # used for monkey-patching our s390x fix in - - '@tootallnate/quickjs-emscripten' -ignore-patterns: - - .eslintrc.js diff --git a/packages/cli-repl/package.json b/packages/cli-repl/package.json index bd01b5b3ac..b76d02e8f7 100644 --- a/packages/cli-repl/package.json +++ b/packages/cli-repl/package.json @@ -30,7 +30,6 @@ "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", "check": "npm run lint", - "depcheck": "depcheck", "prepublish": "npm run compile", "webpack-build": "npm run compile && webpack --mode production && cat dist/add-module-mapping.js >> dist/mongosh.js", "webpack-build-dev": "npm run compile && webpack --mode development && cat dist/add-module-mapping.js >> dist/mongosh.js", @@ -106,7 +105,6 @@ "@types/numeral": "^2.0.2", "@types/text-table": "^0.2.1", "chai-as-promised": "^8.0.2", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "mongodb": "^6.19.0", "mongodb-crypt-library-dummy": "^1.0.2", diff --git a/packages/e2e-tests/.depcheckrc b/packages/e2e-tests/.depcheckrc deleted file mode 100644 index 4468341a36..0000000000 --- a/packages/e2e-tests/.depcheckrc +++ /dev/null @@ -1,23 +0,0 @@ -ignores: - - '@mongosh/cli-repl' - - '@mongodb-js/eslint-config-mongosh' - - '@mongodb-js/tsconfig-mongosh' - - '@mongodb-js/prettier-config-devtools' - - '@typescript-eslint/parser' - - '@typescript-eslint/eslint-plugin' - - chai - - sinon - - sinon-chai - - ts-sinon - - mocha - - eslint-plugin-mocha - - eslint-config-mongodb-js -ignore-patterns: - - .eslintrc.js -parsers: - '**/*.mjs': - - 'es6' - '**/*.js': - - 'es6' - '**/*.ts': - - 'typescript' diff --git a/packages/e2e-tests/package.json b/packages/e2e-tests/package.json index f9b109778c..a33d3e64e7 100644 --- a/packages/e2e-tests/package.json +++ b/packages/e2e-tests/package.json @@ -18,7 +18,6 @@ "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", "check": "npm run lint", - "depcheck": "depcheck", "prettier": "prettier", "reformat": "npm run prettier -- --write . && npm run eslint -- --fix" }, @@ -37,7 +36,6 @@ "@types/rimraf": "^3.0.0", "bson": "^6.10.4", "chai-as-promised": "^8.0.2", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "lodash": "^4.17.21", "moment": "^2.29.1", diff --git a/packages/editor/.depcheckrc b/packages/editor/.depcheckrc deleted file mode 100644 index 8721cf6363..0000000000 --- a/packages/editor/.depcheckrc +++ /dev/null @@ -1,14 +0,0 @@ -ignores: - - '@mongodb-js/eslint-config-mongosh' - - '@mongodb-js/tsconfig-mongosh' - - '@mongodb-js/prettier-config-devtools' - - '@typescript-eslint/parser' - - '@typescript-eslint/eslint-plugin' - - chai - - sinon - - sinon-chai - - ts-sinon - - eslint-plugin-mocha - - eslint-config-mongodb-js -ignore-patterns: - - .eslintrc.js \ No newline at end of file diff --git a/packages/editor/package.json b/packages/editor/package.json index 97c7fb0974..bbdcc23071 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -18,7 +18,6 @@ "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", "check": "npm run lint", - "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "prepublish": "npm run compile", "prettier": "prettier", @@ -46,7 +45,6 @@ "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "nanobus": "^4.5.0", "prettier": "^2.8.8" diff --git a/packages/errors/.depcheckrc b/packages/errors/.depcheckrc deleted file mode 100644 index 8721cf6363..0000000000 --- a/packages/errors/.depcheckrc +++ /dev/null @@ -1,14 +0,0 @@ -ignores: - - '@mongodb-js/eslint-config-mongosh' - - '@mongodb-js/tsconfig-mongosh' - - '@mongodb-js/prettier-config-devtools' - - '@typescript-eslint/parser' - - '@typescript-eslint/eslint-plugin' - - chai - - sinon - - sinon-chai - - ts-sinon - - eslint-plugin-mocha - - eslint-config-mongodb-js -ignore-patterns: - - .eslintrc.js \ No newline at end of file diff --git a/packages/errors/package.json b/packages/errors/package.json index 10913f6ee9..33252021e4 100644 --- a/packages/errors/package.json +++ b/packages/errors/package.json @@ -24,7 +24,6 @@ "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", "check": "npm run lint", - "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "prepublish": "npm run compile", "generate-error-overview": "ts-node scripts/extract-errors.ts .. generated/error-overview.md generated/error-overview.rst && npm run reformat", @@ -40,7 +39,6 @@ "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "chalk": "^4.1.2", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "handlebars": "^4.7.7", "prettier": "^2.8.8", diff --git a/packages/history/.depcheckrc b/packages/history/.depcheckrc deleted file mode 100644 index fe4bc51f91..0000000000 --- a/packages/history/.depcheckrc +++ /dev/null @@ -1,11 +0,0 @@ -ignores: - - '@mongodb-js/eslint-config-mongosh' - - '@mongodb-js/tsconfig-mongosh' - - '@mongodb-js/prettier-config-devtools' - - '@typescript-eslint/parser' - - '@typescript-eslint/eslint-plugin' - - chai - - eslint-plugin-mocha - - eslint-config-mongodb-js -ignore-patterns: - - .eslintrc.js \ No newline at end of file diff --git a/packages/history/package.json b/packages/history/package.json index cf3c5cfc6e..9f7f20e032 100644 --- a/packages/history/package.json +++ b/packages/history/package.json @@ -18,7 +18,6 @@ "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", "check": "npm run lint", - "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "prepublish": "npm run compile", "prettier": "prettier", @@ -41,7 +40,6 @@ "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" } diff --git a/packages/i18n/.depcheckrc b/packages/i18n/.depcheckrc deleted file mode 100644 index fe4bc51f91..0000000000 --- a/packages/i18n/.depcheckrc +++ /dev/null @@ -1,11 +0,0 @@ -ignores: - - '@mongodb-js/eslint-config-mongosh' - - '@mongodb-js/tsconfig-mongosh' - - '@mongodb-js/prettier-config-devtools' - - '@typescript-eslint/parser' - - '@typescript-eslint/eslint-plugin' - - chai - - eslint-plugin-mocha - - eslint-config-mongodb-js -ignore-patterns: - - .eslintrc.js \ No newline at end of file diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 57195162c4..b5c3fc68c1 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -21,7 +21,6 @@ "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", "check": "npm run lint", - "depcheck": "depcheck", "prettier": "prettier", "reformat": "npm run prettier -- --write . && npm run eslint -- --fix" }, @@ -42,7 +41,6 @@ "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" } diff --git a/packages/js-multiline-to-singleline/.depcheckrc b/packages/js-multiline-to-singleline/.depcheckrc deleted file mode 100644 index fe4bc51f91..0000000000 --- a/packages/js-multiline-to-singleline/.depcheckrc +++ /dev/null @@ -1,11 +0,0 @@ -ignores: - - '@mongodb-js/eslint-config-mongosh' - - '@mongodb-js/tsconfig-mongosh' - - '@mongodb-js/prettier-config-devtools' - - '@typescript-eslint/parser' - - '@typescript-eslint/eslint-plugin' - - chai - - eslint-plugin-mocha - - eslint-config-mongodb-js -ignore-patterns: - - .eslintrc.js \ No newline at end of file diff --git a/packages/js-multiline-to-singleline/package.json b/packages/js-multiline-to-singleline/package.json index 2eaff8092e..a184318063 100644 --- a/packages/js-multiline-to-singleline/package.json +++ b/packages/js-multiline-to-singleline/package.json @@ -18,7 +18,6 @@ "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", "check": "npm run lint", - "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "prepublish": "npm run compile", "prettier": "prettier", @@ -43,7 +42,6 @@ "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/babel__core": "^7.1.18", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" } diff --git a/packages/logging/.depcheckrc b/packages/logging/.depcheckrc deleted file mode 100644 index fe4bc51f91..0000000000 --- a/packages/logging/.depcheckrc +++ /dev/null @@ -1,11 +0,0 @@ -ignores: - - '@mongodb-js/eslint-config-mongosh' - - '@mongodb-js/tsconfig-mongosh' - - '@mongodb-js/prettier-config-devtools' - - '@typescript-eslint/parser' - - '@typescript-eslint/eslint-plugin' - - chai - - eslint-plugin-mocha - - eslint-config-mongodb-js -ignore-patterns: - - .eslintrc.js \ No newline at end of file diff --git a/packages/logging/package.json b/packages/logging/package.json index a10df4d230..84f01ad83e 100644 --- a/packages/logging/package.json +++ b/packages/logging/package.json @@ -29,7 +29,6 @@ "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@segment/analytics-node": "^1.3.0", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8", "sinon": "^19.0.4", @@ -43,7 +42,6 @@ "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", "check": "npm run lint", - "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "prepublish": "npm run compile", "prettier": "prettier", diff --git a/packages/node-runtime-worker-thread/.depcheckrc b/packages/node-runtime-worker-thread/.depcheckrc deleted file mode 100644 index 9fdd5e5898..0000000000 --- a/packages/node-runtime-worker-thread/.depcheckrc +++ /dev/null @@ -1,14 +0,0 @@ -ignores: - - '@mongodb-js/eslint-config-mongosh' - - '@mongodb-js/tsconfig-mongosh' - - '@mongodb-js/prettier-config-devtools' - - '@typescript-eslint/parser' - - '@typescript-eslint/eslint-plugin' - - chai - - sinon - - sinon-chai - - eslint-plugin-mocha - - eslint-config-mongodb-js - - system-ca -ignore-patterns: - - .eslintrc.js \ No newline at end of file diff --git a/packages/node-runtime-worker-thread/package.json b/packages/node-runtime-worker-thread/package.json index 32ec6b123c..a458f50e34 100644 --- a/packages/node-runtime-worker-thread/package.json +++ b/packages/node-runtime-worker-thread/package.json @@ -25,7 +25,6 @@ "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", "check": "npm run lint", - "depcheck": "depcheck", "webpack-build": "npm run compile && webpack --mode production", "webpack-build-dev": "npm run compile && webpack --mode development", "compile": "tsc -p tsconfig.json", @@ -47,7 +46,6 @@ "@mongosh/service-provider-node-driver": "^3.18.0", "@mongosh/types": "^3.14.1", "bson": "^6.10.4", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "mocha": "^10.2.0", "postmsg-rpc": "^2.4.0", diff --git a/packages/service-provider-core/.depcheckrc b/packages/service-provider-core/.depcheckrc deleted file mode 100644 index fe4bc51f91..0000000000 --- a/packages/service-provider-core/.depcheckrc +++ /dev/null @@ -1,11 +0,0 @@ -ignores: - - '@mongodb-js/eslint-config-mongosh' - - '@mongodb-js/tsconfig-mongosh' - - '@mongodb-js/prettier-config-devtools' - - '@typescript-eslint/parser' - - '@typescript-eslint/eslint-plugin' - - chai - - eslint-plugin-mocha - - eslint-config-mongodb-js -ignore-patterns: - - .eslintrc.js \ No newline at end of file diff --git a/packages/service-provider-core/package.json b/packages/service-provider-core/package.json index 090bfd311e..dec5b3826c 100644 --- a/packages/service-provider-core/package.json +++ b/packages/service-provider-core/package.json @@ -21,7 +21,6 @@ "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", "check": "npm run lint", - "depcheck": "depcheck", "prettier": "prettier", "reformat": "npm run prettier -- --write . && npm run eslint -- --fix" }, @@ -47,7 +46,6 @@ "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" } diff --git a/packages/service-provider-node-driver/.depcheckrc b/packages/service-provider-node-driver/.depcheckrc deleted file mode 100644 index f68e976681..0000000000 --- a/packages/service-provider-node-driver/.depcheckrc +++ /dev/null @@ -1,20 +0,0 @@ -ignores: - - '@mongodb-js/eslint-config-mongosh' - - '@mongodb-js/tsconfig-mongosh' - - '@mongodb-js/prettier-config-devtools' - - '@typescript-eslint/parser' - - '@typescript-eslint/eslint-plugin' - - chai - - sinon - - sinon-chai - - ts-sinon - - eslint-plugin-mocha - - eslint-config-mongodb-js -# Used for MONGODB-AWS auth -# See: https://github.com/mongodb-js/mongosh/pull/1149 -# See: https://jira.mongodb.org/browse/NODE-5005 - - aws4 -# peer dep of devtools-connect - - '@mongodb-js/oidc-plugin' -ignore-patterns: - - .eslintrc.js \ No newline at end of file diff --git a/packages/service-provider-node-driver/package.json b/packages/service-provider-node-driver/package.json index bef57864b3..7411de2fd1 100644 --- a/packages/service-provider-node-driver/package.json +++ b/packages/service-provider-node-driver/package.json @@ -21,7 +21,6 @@ "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", "check": "npm run lint", - "depcheck": "depcheck", "prettier": "prettier", "reformat": "npm run prettier -- --write . && npm run eslint -- --fix" }, @@ -69,7 +68,6 @@ "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/sinon-chai": "^4.0.0", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8", "@mongosh/testing": "0.0.0-dev.0" diff --git a/packages/shell-api/.depcheckrc b/packages/shell-api/.depcheckrc deleted file mode 100644 index 8721cf6363..0000000000 --- a/packages/shell-api/.depcheckrc +++ /dev/null @@ -1,14 +0,0 @@ -ignores: - - '@mongodb-js/eslint-config-mongosh' - - '@mongodb-js/tsconfig-mongosh' - - '@mongodb-js/prettier-config-devtools' - - '@typescript-eslint/parser' - - '@typescript-eslint/eslint-plugin' - - chai - - sinon - - sinon-chai - - ts-sinon - - eslint-plugin-mocha - - eslint-config-mongodb-js -ignore-patterns: - - .eslintrc.js \ No newline at end of file diff --git a/packages/shell-api/package.json b/packages/shell-api/package.json index 7c8e332287..a0e3025eba 100644 --- a/packages/shell-api/package.json +++ b/packages/shell-api/package.json @@ -28,7 +28,6 @@ "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", "check": "npm run lint", - "depcheck": "depcheck", "report-missing-help": "ts-node scripts/report-missing-help.ts", "report-supported-api": "ts-node scripts/report-supported-api.ts", "test": "mocha", @@ -68,7 +67,6 @@ "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/types": "^3.14.1", "bson": "^6.10.4", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "mongodb": "^6.19.0", "prettier": "^2.8.8", diff --git a/packages/shell-api/tsconfig-lint.json b/packages/shell-api/tsconfig-lint.json index d2adcff841..5af0d6b981 100644 --- a/packages/shell-api/tsconfig-lint.json +++ b/packages/shell-api/tsconfig-lint.json @@ -1,5 +1,5 @@ { "extends": "./tsconfig.json", - "include": ["./src/**/*", "./bin/**/*", "./test/**/*"], + "include": ["./src/**/*", "./scripts/**/*", "./test/**/*"], "exclude": ["node_modules", "dist", "lib"] } diff --git a/packages/shell-bson/.depcheckrc b/packages/shell-bson/.depcheckrc deleted file mode 100644 index 8f69b97b99..0000000000 --- a/packages/shell-bson/.depcheckrc +++ /dev/null @@ -1,16 +0,0 @@ -ignores: - - '@mongodb-js/eslint-config-mongosh' - - '@mongodb-js/tsconfig-mongosh' - - '@mongodb-js/prettier-config-devtools' - - '@typescript-eslint/parser' - - '@typescript-eslint/eslint-plugin' - - chai - - sinon - - sinon-chai - - ts-sinon - - eslint-plugin-mocha - - eslint-config-mongodb-js -# needed as a peer dependency of @mongodb-js/devtools-connect - - mongodb -ignore-patterns: - - .eslintrc.js \ No newline at end of file diff --git a/packages/shell-bson/package.json b/packages/shell-bson/package.json index 1a6e7ba44a..17ce34c71a 100644 --- a/packages/shell-bson/package.json +++ b/packages/shell-bson/package.json @@ -18,7 +18,6 @@ }, "scripts": { "check": "npm run lint", - "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", @@ -47,7 +46,6 @@ "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "bson": "^6.10.4", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" } diff --git a/packages/shell-evaluator/.depcheckrc b/packages/shell-evaluator/.depcheckrc deleted file mode 100644 index 8721cf6363..0000000000 --- a/packages/shell-evaluator/.depcheckrc +++ /dev/null @@ -1,14 +0,0 @@ -ignores: - - '@mongodb-js/eslint-config-mongosh' - - '@mongodb-js/tsconfig-mongosh' - - '@mongodb-js/prettier-config-devtools' - - '@typescript-eslint/parser' - - '@typescript-eslint/eslint-plugin' - - chai - - sinon - - sinon-chai - - ts-sinon - - eslint-plugin-mocha - - eslint-config-mongodb-js -ignore-patterns: - - .eslintrc.js \ No newline at end of file diff --git a/packages/shell-evaluator/package.json b/packages/shell-evaluator/package.json index 4fec798ffe..f0a4097319 100644 --- a/packages/shell-evaluator/package.json +++ b/packages/shell-evaluator/package.json @@ -11,7 +11,6 @@ "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", "check": "npm run lint", - "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "prepublish": "npm run compile", "prettier": "prettier", @@ -40,7 +39,6 @@ "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/types": "^3.14.1", "@types/sinon-chai": "^4.0.0", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" }, diff --git a/packages/snippet-manager/.depcheckrc b/packages/snippet-manager/.depcheckrc deleted file mode 100644 index 8721cf6363..0000000000 --- a/packages/snippet-manager/.depcheckrc +++ /dev/null @@ -1,14 +0,0 @@ -ignores: - - '@mongodb-js/eslint-config-mongosh' - - '@mongodb-js/tsconfig-mongosh' - - '@mongodb-js/prettier-config-devtools' - - '@typescript-eslint/parser' - - '@typescript-eslint/eslint-plugin' - - chai - - sinon - - sinon-chai - - ts-sinon - - eslint-plugin-mocha - - eslint-config-mongodb-js -ignore-patterns: - - .eslintrc.js \ No newline at end of file diff --git a/packages/snippet-manager/package.json b/packages/snippet-manager/package.json index 3874701a4e..c406f5a218 100644 --- a/packages/snippet-manager/package.json +++ b/packages/snippet-manager/package.json @@ -18,7 +18,6 @@ "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", "check": "npm run lint", - "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "prepublish": "npm run compile", "prettier": "prettier", @@ -51,7 +50,6 @@ "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/cross-spawn": "^6.0.6", "@types/tar": "^4.0.4", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "nanobus": "^4.5.0", "prettier": "^2.8.8", diff --git a/packages/types/.depcheckrc b/packages/types/.depcheckrc deleted file mode 100644 index 8f69b97b99..0000000000 --- a/packages/types/.depcheckrc +++ /dev/null @@ -1,16 +0,0 @@ -ignores: - - '@mongodb-js/eslint-config-mongosh' - - '@mongodb-js/tsconfig-mongosh' - - '@mongodb-js/prettier-config-devtools' - - '@typescript-eslint/parser' - - '@typescript-eslint/eslint-plugin' - - chai - - sinon - - sinon-chai - - ts-sinon - - eslint-plugin-mocha - - eslint-config-mongodb-js -# needed as a peer dependency of @mongodb-js/devtools-connect - - mongodb -ignore-patterns: - - .eslintrc.js \ No newline at end of file diff --git a/packages/types/package.json b/packages/types/package.json index 0a997910f2..01e9e7baf7 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -19,7 +19,6 @@ }, "scripts": { "check": "npm run lint", - "depcheck": "depcheck", "compile": "tsc -p tsconfig.json", "eslint": "eslint", "lint": "npm run eslint . && npm run prettier -- --check .", @@ -44,7 +43,6 @@ "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", - "depcheck": "^1.4.7", "eslint": "^7.25.0", "mongodb": "^6.19.0", "prettier": "^2.8.8" From 197e77290ec2b06ea20995f0999dc1dfbf1aa003 Mon Sep 17 00:00:00 2001 From: gagik Date: Fri, 5 Dec 2025 15:53:00 +0100 Subject: [PATCH 30/32] chore: handle sinon update fallout --- package-lock.json | 317 +++++++++++++++--- package.json | 2 +- .../src/electron-runtime.spec.ts | 5 +- .../node-runtime-worker-thread/package.json | 2 +- 4 files changed, 277 insertions(+), 49 deletions(-) diff --git a/package-lock.json b/package-lock.json index 73676f3d5e..378cd7f54b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -56,7 +56,7 @@ "glob": "^10.3.12", "husky": "^9.0.11", "knip": "^5.71.0", - "mocha": "^10.2.0", + "mocha": "^11.7.5", "mongodb-runner": "^6.0.0", "nyc": "^15.1.0", "pkg-up": "^3.1.0", @@ -22490,6 +22490,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", @@ -26832,30 +26842,32 @@ "license": "MIT" }, "node_modules/mocha": { - "version": "10.8.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", - "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", + "version": "11.7.5", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.5.tgz", + "integrity": "sha512-mTT6RgopEYABzXWFx+GcJ+ZQ32kp4fMf0xvpZIIfSq9Z8lC/++MtcCnQ9t5FP2veYEP95FIYSvW+U9fV4xrlig==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-colors": "^4.1.3", "browser-stdout": "^1.3.1", - "chokidar": "^3.5.3", + "chokidar": "^4.0.1", "debug": "^4.3.5", - "diff": "^5.2.0", + "diff": "^7.0.0", "escape-string-regexp": "^4.0.0", "find-up": "^5.0.0", - "glob": "^8.1.0", + "glob": "^10.4.5", "he": "^1.2.0", + "is-path-inside": "^3.0.3", "js-yaml": "^4.1.0", "log-symbols": "^4.1.0", - "minimatch": "^5.1.6", + "minimatch": "^9.0.5", "ms": "^2.1.3", + "picocolors": "^1.1.1", "serialize-javascript": "^6.0.2", "strip-json-comments": "^3.1.1", "supports-color": "^8.1.1", - "workerpool": "^6.5.1", - "yargs": "^16.2.0", - "yargs-parser": "^20.2.9", + "workerpool": "^9.2.0", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1", "yargs-unparser": "^2.0.0" }, "bin": { @@ -26863,7 +26875,7 @@ "mocha": "bin/mocha.js" }, "engines": { - "node": ">= 14.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/mocha/node_modules/brace-expansion": { @@ -26876,6 +26888,37 @@ "balanced-match": "^1.0.0" } }, + "node_modules/mocha/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/mocha/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/mocha/node_modules/debug": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", @@ -26894,34 +26937,15 @@ } }, "node_modules/mocha/node_modules/diff": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", - "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", + "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } }, - "node_modules/mocha/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "deprecated": "Glob versions prior to v9 are no longer supported", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/mocha/node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -26940,15 +26964,19 @@ } }, "node_modules/mocha/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=10" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/mocha/node_modules/ms": { @@ -26958,6 +26986,20 @@ "dev": true, "license": "MIT" }, + "node_modules/mocha/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/mocha/node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -26974,6 +27016,35 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/mocha/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/mocha/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/modify-values": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz", @@ -36664,10 +36735,11 @@ "license": "MIT" }, "node_modules/workerpool": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", - "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", - "dev": true + "version": "9.3.4", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-9.3.4.tgz", + "integrity": "sha512-TmPRQYYSAnnDiEB0P/Ytip7bFGvqnSU6I2BcuSw7Hx+JSg/DsUi5ebYfc8GYaSdpuvOcEs6dXxPurOYpe9QFwg==", + "dev": true, + "license": "Apache-2.0" }, "node_modules/wrap-ansi": { "version": "7.0.0", @@ -37094,6 +37166,161 @@ "node": ">=14.15.1" } }, + "packages/autocomplete/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "packages/autocomplete/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "packages/autocomplete/node_modules/diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "packages/autocomplete/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "packages/autocomplete/node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/autocomplete/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "packages/autocomplete/node_modules/mocha": { + "version": "10.8.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", + "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-colors": "^4.1.3", + "browser-stdout": "^1.3.1", + "chokidar": "^3.5.3", + "debug": "^4.3.5", + "diff": "^5.2.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^8.1.0", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9", + "yargs-unparser": "^2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "packages/autocomplete/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "packages/autocomplete/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "packages/autocomplete/node_modules/workerpool": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", + "dev": true, + "license": "Apache-2.0" + }, "packages/browser-repl": { "name": "@mongosh/browser-repl", "version": "3.29.0", @@ -38634,7 +38861,7 @@ "@mongosh/types": "^3.14.1", "bson": "^6.10.4", "eslint": "^7.25.0", - "mocha": "^10.2.0", + "mocha": "^11.7.5", "postmsg-rpc": "^2.4.0", "prettier": "^2.8.8", "web-worker": "^1.3.0", diff --git a/package.json b/package.json index 278dd0159b..b3b558c5d0 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,7 @@ "glob": "^10.3.12", "husky": "^9.0.11", "knip": "^5.71.0", - "mocha": "^10.2.0", + "mocha": "^11.7.5", "mongodb-runner": "^6.0.0", "nyc": "^15.1.0", "pkg-up": "^3.1.0", diff --git a/packages/browser-runtime-electron/src/electron-runtime.spec.ts b/packages/browser-runtime-electron/src/electron-runtime.spec.ts index 23ee421162..47843664b5 100644 --- a/packages/browser-runtime-electron/src/electron-runtime.spec.ts +++ b/packages/browser-runtime-electron/src/electron-runtime.spec.ts @@ -24,8 +24,9 @@ describe('Electron runtime', function () { extraInfo: { uri: '' }, } as any); messageBus = sinon.createStubInstance(EventEmitter); - evaluationListener = sinon.createStubInstance(class FakeListener {}); - evaluationListener.onPrint = sinon.stub(); + evaluationListener = { + onPrint: sinon.stub(), + } as SinonStubbedInstance; electronRuntime = new ElectronRuntime(serviceProvider, messageBus); electronRuntime.setEvaluationListener(evaluationListener as any); }); diff --git a/packages/node-runtime-worker-thread/package.json b/packages/node-runtime-worker-thread/package.json index a458f50e34..1385da8d26 100644 --- a/packages/node-runtime-worker-thread/package.json +++ b/packages/node-runtime-worker-thread/package.json @@ -47,7 +47,7 @@ "@mongosh/types": "^3.14.1", "bson": "^6.10.4", "eslint": "^7.25.0", - "mocha": "^10.2.0", + "mocha": "^11.7.5", "postmsg-rpc": "^2.4.0", "prettier": "^2.8.8", "webpack-merge": "^5.8.0", From 231b794d38ddbefea58a91c2f65a6a44dab850a6 Mon Sep 17 00:00:00 2001 From: gagik Date: Fri, 5 Dec 2025 17:13:22 +0100 Subject: [PATCH 31/32] chore: fix depalign, use script for runtime-support-nocov --- knip.ts | 7 + package-lock.json | 157 +----------------- packages/async-rewriter2/bin/async-rewrite.js | 2 +- packages/autocomplete/package.json | 2 +- packages/shell-api/scripts/api-postprocess.ts | 2 +- 5 files changed, 11 insertions(+), 159 deletions(-) diff --git a/knip.ts b/knip.ts index 5d765d4d30..0e319f0ebd 100644 --- a/knip.ts +++ b/knip.ts @@ -1,4 +1,11 @@ import type { KnipConfig } from "knip"; +import fs from "fs"; + +// Create an empty file to satisfy the knip rule for async-rewriter2 +fs.writeFileSync( + "packages/async-rewriter2/src/runtime-support.out.nocov.ts", + "" +); const config: KnipConfig = { rules: { diff --git a/package-lock.json b/package-lock.json index 378cd7f54b..6339c1ffe0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37159,168 +37159,13 @@ "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "eslint": "^7.25.0", - "mocha": "^10.2.0", + "mocha": "^11.7.5", "prettier": "^2.8.8" }, "engines": { "node": ">=14.15.1" } }, - "packages/autocomplete/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "packages/autocomplete/node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "packages/autocomplete/node_modules/diff": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", - "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.3.1" - } - }, - "packages/autocomplete/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "deprecated": "Glob versions prior to v9 are no longer supported", - "dev": true, - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "packages/autocomplete/node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "packages/autocomplete/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "packages/autocomplete/node_modules/mocha": { - "version": "10.8.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", - "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-colors": "^4.1.3", - "browser-stdout": "^1.3.1", - "chokidar": "^3.5.3", - "debug": "^4.3.5", - "diff": "^5.2.0", - "escape-string-regexp": "^4.0.0", - "find-up": "^5.0.0", - "glob": "^8.1.0", - "he": "^1.2.0", - "js-yaml": "^4.1.0", - "log-symbols": "^4.1.0", - "minimatch": "^5.1.6", - "ms": "^2.1.3", - "serialize-javascript": "^6.0.2", - "strip-json-comments": "^3.1.1", - "supports-color": "^8.1.1", - "workerpool": "^6.5.1", - "yargs": "^16.2.0", - "yargs-parser": "^20.2.9", - "yargs-unparser": "^2.0.0" - }, - "bin": { - "_mocha": "bin/_mocha", - "mocha": "bin/mocha.js" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "packages/autocomplete/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, - "packages/autocomplete/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "packages/autocomplete/node_modules/workerpool": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", - "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", - "dev": true, - "license": "Apache-2.0" - }, "packages/browser-repl": { "name": "@mongosh/browser-repl", "version": "3.29.0", diff --git a/packages/async-rewriter2/bin/async-rewrite.js b/packages/async-rewriter2/bin/async-rewrite.js index 29b8954dec..f2aa3224c9 100755 --- a/packages/async-rewriter2/bin/async-rewrite.js +++ b/packages/async-rewriter2/bin/async-rewrite.js @@ -1,6 +1,6 @@ #!/usr/bin/env node 'use strict'; -const AsyncWriter = require('../lib').default; +const AsyncWriter = require('../').default; const fs = require('fs'); const input = fs.readFileSync(process.argv[2], 'utf8'); const asyncWriter = new AsyncWriter(); diff --git a/packages/autocomplete/package.json b/packages/autocomplete/package.json index a5b70ffcc7..eb6af1d8d8 100644 --- a/packages/autocomplete/package.json +++ b/packages/autocomplete/package.json @@ -37,7 +37,7 @@ "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "eslint": "^7.25.0", - "mocha": "^10.2.0", + "mocha": "^11.7.5", "prettier": "^2.8.8" }, "dependencies": { diff --git a/packages/shell-api/scripts/api-postprocess.ts b/packages/shell-api/scripts/api-postprocess.ts index 2bf9bd33d0..a5a6a9facf 100644 --- a/packages/shell-api/scripts/api-postprocess.ts +++ b/packages/shell-api/scripts/api-postprocess.ts @@ -2,7 +2,7 @@ import * as babel from '@babel/core'; import type * as BabelTypes from '@babel/types'; import { promises as fs } from 'fs'; import path from 'path'; -import { signatures } from '../lib'; +import { signatures } from '../src'; import enUs from '../../i18n/src/locales/en_US'; function applyAsyncRewriterChanges() { From a4c2d77ded3457c8612e37bb52f561645ea42585 Mon Sep 17 00:00:00 2001 From: gagik Date: Fri, 5 Dec 2025 17:19:55 +0100 Subject: [PATCH 32/32] chore: ../lib -> ../ --- packages/shell-api/scripts/api-postprocess.ts | 2 +- packages/shell-api/scripts/report-supported-api.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/shell-api/scripts/api-postprocess.ts b/packages/shell-api/scripts/api-postprocess.ts index a5a6a9facf..0e1c6ad10f 100644 --- a/packages/shell-api/scripts/api-postprocess.ts +++ b/packages/shell-api/scripts/api-postprocess.ts @@ -2,7 +2,7 @@ import * as babel from '@babel/core'; import type * as BabelTypes from '@babel/types'; import { promises as fs } from 'fs'; import path from 'path'; -import { signatures } from '../src'; +import { signatures } from '../'; import enUs from '../../i18n/src/locales/en_US'; function applyAsyncRewriterChanges() { diff --git a/packages/shell-api/scripts/report-supported-api.ts b/packages/shell-api/scripts/report-supported-api.ts index a7524bed88..730aad97a9 100644 --- a/packages/shell-api/scripts/report-supported-api.ts +++ b/packages/shell-api/scripts/report-supported-api.ts @@ -1,5 +1,5 @@ /* eslint-disable no-console */ -import { signatures } from '../lib'; +import { signatures } from '../'; Object.keys(signatures) .sort()