Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@ridit/editor-services

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ridit/editor-services

Your editor, in minutes.

Source
npmnpm
Version
0.1.4
Version published
Weekly downloads
22
175%
Maintainers
1
Weekly downloads
 
Created
Source

@ridit/editor-services

Core services for @ridit/editor. Provides everything needed to build a Monaco-based editor — filesystem abstraction, tab management, theming, LSP integration, and a full workbench orchestrator.

Installation

npm install @ridit/editor-services

The fastest way to get started. Workbench presets wire all services together with sensible defaults.

import { Workbench } from "@ridit/editor-services/workbench";

// Electron
const workbench = await Workbench.createElectron({
  rootPath: "/path/to/project",
  lsp: { disableInBuiltTypescriptWorker: true },
  config: { fontSize: 16, fontFamily: "monospace" },
  editorConfig: { fontSize: 15 },
  theme: "Dark", // 'Dark' | 'Light'
  storeName: "my-app", // optional, for tab persistence
});
await workbench.mount(document, window);

// Web (virtual filesystem)
const workbench = await Workbench.createWeb({
  rootPath: "/my-project",
  virtualFsName: "my-project-fs",
  config: { fontSize: 16 },
  theme: "Light",
});
await workbench.mount(document, window);

Manual Composition

For full control, compose services individually.

import {
  EventEmitter,
  FileSystemService,
  ExplorerService,
  EditorService,
  WorkbenchService,
  StorageService,
  ThemeService,
  LspService,
} from "@ridit/editor-services/browser";

const eventEmitter = new EventEmitter();

const storageService = new StorageService(window, "electron", "my-store");
await storageService.start();

const fileSystem = new FileSystemService(eventEmitter, window, {
  mode: "real",
});

const explorerService = new ExplorerService(eventEmitter, {
  services: { fileSystem },
  rootPath: "/path/to/project",
});

const themeService = new ThemeService(eventEmitter);

const editorService = new EditorService(eventEmitter, {
  services: { fileSystem, explorerService, themeService, storageService },
  theme: "Dark",
  editorConfig: { fontSize: 15 },
});

const workbench = new WorkbenchService(eventEmitter, {
  services: { editorService, explorerService, storageService, themeService },
  config: { fontSize: 16, fontFamily: "monospace" },
});

await workbench.mount(document, window);

Services

FileSystemService

Unified filesystem API that works over both the real filesystem (Electron IPC) and an in-memory virtual filesystem.

const fs = new FileSystemService(eventEmitter, window, {
  mode: "real", // 'real' | 'virtual'
  name: "my-vfs", // required when mode is 'virtual'
});

await fs.readFile("/src/index.ts");
await fs.writeFile("/src/index.ts", "content");
await fs.mkdir("/src/utils");
await fs.rm("/src/old.ts");
await fs.rename("/src/old.ts", "/src/new.ts");
await fs.exists("/src/index.ts");
await fs.readdir("/src");

EditorService

Manages Monaco editor instances and file opening.

// Open a file programmatically
await editorService.open("/src/index.ts");

// Register a custom editor
editorService.register(myCustomEditor);

ExplorerService

Renders the file tree and responds to file selection events.

const tree = await explorerService.render(document);
document.body.appendChild(tree.el);

ThemeService

Applies a theme as CSS variables on the document.

import { DarkTheme } from "@ridit/editor-services/browser";

themeService.setTheme(DarkTheme, document);

StorageService

Persistent key-value storage backed by the platform (Electron store or localStorage).

await storageService.set("my-key", { foo: "bar" }, "my-store");
const value = await storageService.get("my-key", "my-store");

WorkbenchService

Orchestrates the full editor UI — titlebar, activity bar, sidebar, editor area, tabs, and statusbar.

// Override a built-in component before mounting
workbench.overrideComponent("titlebar", (classes) => myTitlebar(classes));

await workbench.mount(document, window);

Events

Services communicate via EventEmitter. You can subscribe to any event:

eventEmitter.on('editor:openFile', (path: string) => { ... })
eventEmitter.on('tab:openTab', (path: string) => { ... })
eventEmitter.on('tab:removeTab', (id: string) => { ... })

Theming

Themes are plain objects mapped to CSS variables on :root. Pass a custom theme to WorkbenchService or ThemeService:

import type { ITheme } from "@ridit/editor-services/browser";

const myTheme: ITheme = {
  colors: {
    bg: "#1a1a2e",
    fg: "#e0e0e0",
    // ...
  },
  tokens: {
    keyword: "c792ea",
    // ...
  },
};

const workbench = new WorkbenchService(eventEmitter, {
  customTheme: myTheme,
  // ...
});

License

MIT

FAQs

Package last updated on 02 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts