Made of plugins
About 80% of the code lives in 31 plugin packages. The core, plugin contract included, is around 10,000 lines. Turn the toolbar off with one line and the IDE still starts, then tells you which plugin was supposed to draw it.
Mosetta IDE · open source · MIT
A code editor built on the web platform. The core only brings plugins up and connects them to a local daemon. The editor, the file tree, the terminal, git, the debugger, even the toolbar and the column layout are plugins. A plugin is an ordinary npm package written in TypeScript and Preact.
Nothing leaves your tab. Files, git, the language server and the terminal are played by a daemon made of memory; search and find-in-files run the plugins' real server code. Anything that needs a machine says so instead of pretending. The buttons above call the IDE's commands from this page, the same way a key does.
About 80% of the code lives in 31 plugin packages. The core, plugin contract included, is around 10,000 lines. Turn the toolbar off with one line and the IDE still starts, then tells you which plugin was supposed to draw it.
TypeScript and Preact, a manifest in package.json, and no build step for the author: the IDE builds a plugin from its sources, so there is one copy of Preact and CodeMirror for everyone.
The same interface in a browser tab or in the Electron shell. Several projects side by side are just several tabs. And, as this page shows, it mounts into any element of your own page.
Terminals and language servers live in a local daemon. Reload the tab and it picks up exactly where it was: same terminals, same scrollback, same unsaved edits.
Git state and file contents are read from memory kept current in the background. Twenty git status reads in a row fit in 300 ms, and a test holds it to that.
A list cut short says so: "2000 of 2010 files checked". A broken tool says it is broken instead of showing an empty panel.
Keys, settings and labels are JSON files, one per machine and one per project. The settings window writes the same file you edit by hand, comments included.
Search everywhere with typed tags, changelists and a shelf of patches, a three-way merge screen, a debugger that follows your server into the browser.
Each one is a package you can read, replace or switch off. The core has no commands, no panels and no word about windows of its own.
A plugin is a package with an ide field in its package.json, and a class. This is the whole of a real one: it re-runs the last npm script, using another plugin as a typed neighbour.
{
"name": "@mosetta/ide-plugin-rerun",
"type": "module",
"ide": {
"client": "src/client.ts",
"strings": { "en": "src/en.json" }
}
}
import { command, plugin, type Ide } from '@mosetta/ide-api/client';
import NpmScripts from '@mosetta/ide-plugin-npm-scripts';
@plugin({ title: 'plugin.rerun' })
export default class Rerun {
private last: string | null = null;
constructor(private readonly ide: Ide) {}
@command('scripts.rerun')
protected rerun(): void {
const npm = this.ide.getPlugin(NpmScripts);
const id = this.last ?? npm.scripts()[0]?.id ?? null;
if (!id) return this.ide.say(this.ide.t('rerun.nothing'));
this.last = id;
void npm.run(id);
}
}
search.source, editor.extension, panel.action…), never by patching one another.@mosetta/ide-api/testing.Many of the answers to hard IDE problems here — search everywhere, changelists, the shelf, a keymap that explains itself — are borrowed from WebStorm and rebuilt on the web platform.
npm create mosetta-pluginStatus: early. Mosetta is used every day on macOS, Windows and Linux, in the browser and in the desktop shell, which is not the same as being ready for you. Installing third-party plugins from npm and a remote daemon are on the roadmap, not in the build.