Skip to content

Commit

Permalink
Merge branch 'main' of github.com:mongodb-js/mongosh into gagik/statu…
Browse files Browse the repository at this point in the history
…s-6.0.3-clusters
  • Loading branch information
gagik committed Oct 24, 2024
2 parents c6f5f86 + 16b453e commit f7bc2b5
Show file tree
Hide file tree
Showing 46 changed files with 573 additions and 507 deletions.
668 changes: 334 additions & 334 deletions .evergreen.yml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Package|Version|License
**[@mongosh/js-multiline-to-singleline](#2dcbeb51aa76c387d04422e84b56be8b65a87471bf5be038ca68d82f13a5d839)**|0.0.0-dev.0|Apache-2.0
**[@mongosh/logging](#a17a0e5de5551ca1d63cf325d510d17b6a0a1821718c63117a4dbccd2b1293e7)**|0.0.0-dev.0|Apache-2.0
**[@mongosh/service-provider-core](#b179d40f2285db3339c362199a8bc0598efaff1c4c727364e26b21325764e981)**|0.0.0-dev.0|Apache-2.0
**[@mongosh/service-provider-server](#b512a107cca2856de34b86ca46809ec1b31a5d964d47102efd920074c19a86c7)**|0.0.0-dev.0|Apache-2.0
**[@mongosh/service-provider-node-driver](#48f5e5df1f8b3f9562c58f987046b55160319224cf59e0ced75ab2037ecf0de3)**|0.0.0-dev.0|Apache-2.0
**[@mongosh/shell-api](#066d6484afa772c771ab73975e5fcac49bf481b96140400d853ecd0b2b9f3629)**|0.0.0-dev.0|Apache-2.0
**[@mongosh/shell-evaluator](#f2b3f8a68c8c280f279921c6fe4cc918d362f7f44cc9b2c52a8e26b75a5b4bb5)**|0.0.0-dev.0|Apache-2.0
**[@mongosh/snippet-manager](#006cfa776d20db3be61c3aa50333c13f27382e2b5a835f17fd767b3033ee8578)**|0.0.0-dev.0|Apache-2.0
Expand Down Expand Up @@ -9684,8 +9684,8 @@ License files:
limitations under the License.


<a id="b512a107cca2856de34b86ca46809ec1b31a5d964d47102efd920074c19a86c7"></a>
### [@mongosh/service-provider-server](https://www.npmjs.com/package/@mongosh/service-provider-server) (version 0.0.0-dev.0)
<a id="48f5e5df1f8b3f9562c58f987046b55160319224cf59e0ced75ab2037ecf0de3"></a>
### [@mongosh/service-provider-node-driver](https://www.npmjs.com/package/@mongosh/service-provider-node-driver) (version 0.0.0-dev.0)
License tags: Apache-2.0

License files:
Expand Down
55 changes: 44 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
"packages/logging",
"packages/service-provider-core",
"packages/arg-parser",
"packages/service-provider-server",
"packages/service-provider-node-driver",
"packages/shell-api",
"packages/autocomplete",
"packages/shell-evaluator",
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-runtime-electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,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/service-provider-server": "0.0.0-dev.0",
"@mongosh/service-provider-node-driver": "0.0.0-dev.0",
"@types/sinon": "^7.5.1",
"@types/sinon-chai": "^3.2.4",
"depcheck": "^1.4.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ import sinonChai from 'sinon-chai';
chai.use(sinonChai);
const { expect } = chai;

import { CliServiceProvider } from '@mongosh/service-provider-server';
import { NodeDriverServiceProvider } from '@mongosh/service-provider-node-driver';
import { bson } from '@mongosh/service-provider-core';
import { ElectronRuntime } from './electron-runtime';
import { EventEmitter } from 'events';
import type { RuntimeEvaluationListener } from '@mongosh/browser-runtime-core';

describe('Electron runtime', function () {
let serviceProvider: SinonStubbedInstance<CliServiceProvider>;
let serviceProvider: SinonStubbedInstance<NodeDriverServiceProvider>;
let messageBus: SinonStubbedInstance<EventEmitter>;
let evaluationListener: SinonStubbedInstance<RuntimeEvaluationListener>;
let electronRuntime: ElectronRuntime;

beforeEach(function () {
serviceProvider = sinon.createStubInstance(CliServiceProvider);
serviceProvider = sinon.createStubInstance(NodeDriverServiceProvider);
serviceProvider.bsonLibrary = bson;
serviceProvider.getConnectionInfo.resolves({
extraInfo: { uri: '' },
Expand Down
13 changes: 8 additions & 5 deletions packages/build/src/compile/signable-compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { compileJSFileAsBinary } from 'boxednode';
async function preCompileHook(nodeSourceTree: string) {
const fleAddonVersion = require(path.join(
await findModulePath(
'service-provider-server',
'service-provider-node-driver',
'mongodb-client-encryption'
),
'package.json'
Expand Down Expand Up @@ -108,17 +108,20 @@ export class SignableCompiler {
async compile(): Promise<void> {
const fleAddon = {
path: await findModulePath(
'service-provider-server',
'service-provider-node-driver',
'mongodb-client-encryption'
),
requireRegexp: /\bmongocrypt\.node$/,
};
const kerberosAddon = {
path: await findModulePath('service-provider-server', 'kerberos'),
path: await findModulePath('service-provider-node-driver', 'kerberos'),
requireRegexp: /\bkerberos\.node$/,
};
const osDnsAddon = {
path: await findModulePath('service-provider-server', 'os-dns-native'),
path: await findModulePath(
'service-provider-node-driver',
'os-dns-native'
),
requireRegexp: /\bos_dns_native\.node$/,
};
const cryptLibraryVersionAddon = {
Expand All @@ -130,7 +133,7 @@ export class SignableCompiler {
requireRegexp: /\bglibc_version\.node$/,
};
// Warning! Until https://jira.mongodb.org/browse/MONGOSH-990,
// packages/service-provider-server *also* has a copy of these.
// packages/service-provider-node-driver *also* has a copy of these.
// We use the versions included in packages/cli-repl here, so these
// should be kept in sync!
const winCAAddon =
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-repl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"@mongosh/js-multiline-to-singleline": "0.0.0-dev.0",
"@mongosh/logging": "0.0.0-dev.0",
"@mongosh/service-provider-core": "0.0.0-dev.0",
"@mongosh/service-provider-server": "0.0.0-dev.0",
"@mongosh/service-provider-node-driver": "0.0.0-dev.0",
"@mongosh/shell-api": "0.0.0-dev.0",
"@mongosh/shell-evaluator": "0.0.0-dev.0",
"@mongosh/snippet-manager": "0.0.0-dev.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/cli-repl/src/build-info.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os from 'os';
import { CliServiceProvider } from '@mongosh/service-provider-server';
import { NodeDriverServiceProvider } from '@mongosh/service-provider-node-driver';

export interface BuildInfo {
version: string;
Expand All @@ -16,7 +16,7 @@ export interface BuildInfo {
sharedOpenssl: boolean;
segmentApiKey?: string;
runtimeGlibcVersion: string;
deps: ReturnType<typeof CliServiceProvider.getVersionInformation>;
deps: ReturnType<typeof NodeDriverServiceProvider.getVersionInformation>;
}

function getSystemArch(): (typeof process)['arch'] {
Expand Down Expand Up @@ -79,7 +79,7 @@ export async function buildInfo({
withSegmentApiKey?: boolean;
} = {}): Promise<BuildInfo> {
const dependencyVersionInfo: BuildInfo['deps'] = {
...CliServiceProvider.getVersionInformation(),
...NodeDriverServiceProvider.getVersionInformation(),
};

const buildInfo = { ...baseBuildInfo(), deps: { ...dependencyVersionInfo } };
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-repl/src/cli-repl.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import ConnectionString from 'mongodb-connection-string-url';
import type { CliReplOptions } from './cli-repl';
import { CliRepl } from './cli-repl';
import { CliReplErrors } from './error-codes';
import type { DevtoolsConnectOptions } from '@mongosh/service-provider-server';
import type { DevtoolsConnectOptions } from '@mongosh/service-provider-node-driver';
import type { AddressInfo } from 'net';
const { EJSON } = bson;

Expand Down
6 changes: 3 additions & 3 deletions packages/cli-repl/src/cli-repl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { redactURICredentials } from '@mongosh/history';
import i18n from '@mongosh/i18n';
import type { AutoEncryptionOptions } from '@mongosh/service-provider-core';
import { bson } from '@mongosh/service-provider-core';
import { CliServiceProvider } from '@mongosh/service-provider-server';
import { NodeDriverServiceProvider } from '@mongosh/service-provider-node-driver';
import type { CliOptions, DevtoolsConnectOptions } from '@mongosh/arg-parser';
import { SnippetManager } from '@mongosh/snippet-manager';
import { Editor } from '@mongosh/editor';
Expand Down Expand Up @@ -829,7 +829,7 @@ export class CliRepl implements MongoshIOProvider {
async connect(
driverUri: string,
driverOptions: DevtoolsConnectOptions
): Promise<CliServiceProvider> {
): Promise<NodeDriverServiceProvider> {
const { quiet } = CliRepl.getFileAndEvalInfo(this.cliOptions);
if (!this.cliOptions.nodb && !quiet) {
this.output.write(
Expand All @@ -839,7 +839,7 @@ export class CliRepl implements MongoshIOProvider {
'\n'
);
}
return await CliServiceProvider.connect(
return await NodeDriverServiceProvider.connect(
driverUri,
driverOptions,
this.cliOptions,
Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/src/locales/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const translations: Catalog = {
},
'service-provider-browser': {},
'service-provider-core': {},
'service-provider-server': {},
'service-provider-node-driver': {},
'shell-api': {
classes: {
ShellApi: {
Expand Down
2 changes: 1 addition & 1 deletion packages/node-runtime-worker-thread/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@mongosh/browser-runtime-core": "0.0.0-dev.0",
"@mongosh/browser-runtime-electron": "0.0.0-dev.0",
"@mongosh/service-provider-core": "0.0.0-dev.0",
"@mongosh/service-provider-server": "0.0.0-dev.0",
"@mongosh/service-provider-node-driver": "0.0.0-dev.0",
"@mongosh/types": "0.0.0-dev.0",
"bson": "^6.8.0",
"depcheck": "^1.4.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/node-runtime-worker-thread/src/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { MongoshBus } from '@mongosh/types';
import { startSharedTestServer } from '../../../testing/integration-testing-hooks';
import { WorkerRuntime } from '../dist/index';

import type { DevtoolsConnectOptions } from '@mongosh/service-provider-server';
import type { DevtoolsConnectOptions } from '@mongosh/service-provider-node-driver';

export const dummyOptions: DevtoolsConnectOptions = Object.freeze({
productName: 'Test Product',
Expand Down
2 changes: 1 addition & 1 deletion packages/node-runtime-worker-thread/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
deserializeEvaluationResult,
serializeConnectOptions,
} from './serializer';
import type { CompassServiceProvider } from '@mongosh/service-provider-server';
import type { CompassServiceProvider } from '@mongosh/service-provider-node-driver';
import type { InterruptHandle } from 'interruptor';
import { interrupt as nativeInterrupt } from 'interruptor';
import { WorkerThreadEvaluationListener } from './worker-thread-evaluation-listener';
Expand Down
2 changes: 1 addition & 1 deletion packages/node-runtime-worker-thread/src/serializer.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { DevtoolsConnectOptions } from '@mongosh/service-provider-server/lib/cli-service-provider';
import type { DevtoolsConnectOptions } from '@mongosh/service-provider-node-driver';
import { expect } from 'chai';
import { UUID, Long } from 'bson';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/node-runtime-worker-thread/src/serializer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { inspect } from 'util';
import { EJSON } from 'bson';
import type { RuntimeEvaluationResult } from '@mongosh/browser-runtime-core';
import type { DevtoolsConnectOptions } from '@mongosh/service-provider-server';
import type { DevtoolsConnectOptions } from '@mongosh/service-provider-node-driver';

function isPrimitive(
val: any
Expand Down
2 changes: 1 addition & 1 deletion packages/node-runtime-worker-thread/src/worker-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
} from '@mongosh/browser-runtime-core';
import { ElectronRuntime } from '@mongosh/browser-runtime-electron';
import type { ServiceProvider } from '@mongosh/service-provider-core';
import { CompassServiceProvider } from '@mongosh/service-provider-server';
import { CompassServiceProvider } from '@mongosh/service-provider-node-driver';
import { exposeAll, createCaller } from './rpc';
import {
serializeEvaluationResult,
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions packages/service-provider-node-driver/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Anna Henningsen <[email protected]>
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@mongosh/service-provider-server",
"name": "@mongosh/service-provider-node-driver",
"version": "0.0.0-dev.0",
"description": "MongoDB Shell Server Service Provider Package",
"main": "lib/index.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { DevtoolsConnectOptions } from '../cli-service-provider';
import CliServiceProvider from '../cli-service-provider';
import type { DevtoolsConnectOptions } from '../node-driver-service-provider';
import { NodeDriverServiceProvider } from '../node-driver-service-provider';
import type { MongoClient } from 'mongodb';
import type { ReplPlatform } from '@mongosh/service-provider-core';
import type ConnectionString from 'mongodb-connection-string-url';
Expand All @@ -8,7 +8,7 @@ import type { EventEmitter } from 'events';
/**
* A service provider that is meant to be used in compass.
*/
class CompassServiceProvider extends CliServiceProvider {
export class CompassServiceProvider extends NodeDriverServiceProvider {
public readonly platform: ReplPlatform;
/**
* Instantiate a new CompassServiceProvider with the data-service's connected
Expand All @@ -28,5 +28,3 @@ class CompassServiceProvider extends CliServiceProvider {
this.platform = 'Compass';
}
}

export default CompassServiceProvider;
4 changes: 4 additions & 0 deletions packages/service-provider-node-driver/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { NodeDriverServiceProvider } from './node-driver-service-provider';
import { CompassServiceProvider } from './compass/compass-service-provider';
export type { DevtoolsConnectOptions } from '@mongodb-js/devtools-connect';
export { NodeDriverServiceProvider, CompassServiceProvider };
Loading

0 comments on commit f7bc2b5

Please sign in to comment.