Overview of @mongodb-js/compass-find-in-page
main@mongodb-js/compass-find-in-page package provides a cmd-f style user interface for MongoDB Compass, allowing users to search for text within the application's views.repository·main·Indexed 23 days ago
https://github.com/mongodb-js/compassSource code, plugins, and build tooling for MongoDB Compass, the official MongoDB graphical user interface. This monorepo includes shared configurations for ESLint, Mocha, Prettier, and TypeScript, as well as specialized packages such as bson-transpilers for converting BSON code between languages, mongodb-collection-model, and the @mongodb-js/compass-aggregations plugin for building aggregation pipelines.
@mongodb-js/compass-find-in-page package provides a cmd-f style user interface for MongoDB Compass, allowing users to search for text within the application's views.compass-schema package is a plugin for the MongoDB Compass Schema Tab. It provides functionality related to schema visualization and analysis within the Compass interface.The MongoDB Compass Monorepo contains the source code and build tooling for MongoDB Compass. The repository is organized into several categories of packages:
These packages extend the functionality of the Compass GUI, including features like:
@mongodb-js/compass-aggregations@mongodb-js/compass-crud@mongodb-js/compass-databases-collections@mongodb-js/compass-explain-plan@mongodb-js/compass-schema@mongodb-js/compass-shell@mongodb-js/compass-indexes@mongodb-js/compass-import-export@mongodb-js/compass-find-in-pageInternal utilities and services used across the monorepo, such as:
@mongodb-js/atlas-service (handles Atlas sign-in and API requests)@mongodb-js/compass-components (React components)@mongodb-js/compass-editor (CodeMirror-based editor)@mongodb-js/compass-connections and @mongodb-js/connection-form@mongodb-js/compass-smoke-tests and compass-e2e-testshadron-build (tooling for Hadron apps like Compass)Standardized configurations for development:
@mongodb-js/eslint-config-compass and @mongodb-js/eslint-plugin-compass@mongodb-js/mocha-config-compass and @mongodb-js/testing-library-compass@mongodb-js/prettier-config-compass@mongodb-js/tsconfig-compass@mongodb-js/webpack-config-compassThe @mongodb-js/compass-components package serves as the central repository for all foundational components and hooks used to build parts of MongoDB Compass.
By consolidating leafygreen dependencies and core UI components into this single package, the project achieves two main goals:
compass-schema-validation plugin extends MongoDB Compass by providing advanced schema validation capabilities. It allows users to manage complex validation rules using JSON Schema in addition to standard MongoDB Query Language (MQL) based simple validation. This plugin is more flexible than standard document validation for creating intricate rules.Aggregation Builder, Assistant, Connection, Data Modeling, Find Queries, Gen AI, Indexes, Schema, and Search Indexes. This plan ensures consistent tracking of user interactions, errors, and feature usage across the Compass ecosystem.The Compass Databases and Collections Plugin extends MongoDB Compass by providing essential UI components for managing data structures. It provides the following features:
compass-explain-plan plugin provides the Explain Plan tab within MongoDB Compass. This feature allows you to view and analyze the execution plan for a specific query, helping you understand how MongoDB executes your operations and identify potential performance optimizations.@mongodb-js/tsconfig-compass package provides shared TypeScript base configurations designed for use across various MongoDB Compass packages. It ensures consistent TypeScript compiler settings throughout the monorepo.mongodb-explain-compat package provides functionality to convert MongoDB SBE (Small Binary Encoding) explain output into the format used by MongoDB version 4.4. While the converted output may not be an exact match, it is designed to be close enough for practical use and analysis in tools expecting the 4.4 schema.hadron-ipc provides a simplified wrapper around Electron's Inter-Process Communication (IPC) events. It distinguishes between two environments:
broadcast or responding to renderer requests using respondTo.call or listens for broadcasts from the main process using on.Common patterns include a renderer calling a method (ipc.call), the main process responding to that call (ipc.respondTo), and the main process subsequently notifying all renderers of a state change (ipc.broadcast).
const ipc = require('hadron-ipc');
const AppRegistry = require('@mongodb-js/compass-app-registry');
const globalAppRegistry = new AppRegistry();
// 1. Renderer process initiates a call
ipc.call('compass:loading:change-status', { status: 'loading preferences' });
// 2. Main process responds to the call and broadcasts the update
ipc.respondTo('app:loading:change-status', (evt, meta) => {
ipc.broadcast('app:loading:change-status', meta);
});
// 3. Renderer processes listen for the broadcast
ipc.on('app:loading:change-status', (evt, meta) => {
globalAppRegistry.emit('app:loading:change-status', meta);
});The plugin provides the following capabilities for managing collection validation:
$jsonSchema.validationLevel (strict, moderate, or off) and validationAction (error or warn).