Skip to content

Architecture

PlainScript is a Turbo monorepo composed of three npm workspaces layered on top of Eclipse Theia.


Repository Layout

PlainScript/
├── custom-ui/          # Custom Theia frontend plugin (TypeScript)
│   └── src/frontend/   # All UI customisation source files
├── browser-app/        # Theia browser application entry point
├── electron-app/       # Theia Electron application entry point
├── plugins/            # Pre-bundled VS Code–compatible extensions
├── scripts/            # Build and launch helper scripts
├── docs/               # MkDocs documentation source (this site)
├── .github/workflows/  # CI/CD and docs deployment workflows
├── mkdocs.yml          # MkDocs configuration
├── turbo.json          # Turbo pipeline configuration
└── package.json        # Root monorepo config

Build Graph

Turbo builds workspaces in topological order:

graph LR
  A[custom-ui] --> B[browser-app]
  A --> C[electron-app]

custom-ui is compiled first as a Theia frontend plugin; both application targets depend on it.


Theia Customisation Model

PlainScript customises Theia by providing a ContainerModule (custom-ui/src/frontend/index.ts) that is registered as a Theia frontend plugin. The module uses InversifyJS bind / rebind to replace or augment Theia's built-in services and widgets.

What is Customised

Feature Mechanism Source file
Application shell layout rebind(ApplicationShell) application-shell.ts
Side-panel tab bar position rebind(SidePanelHandler) application-shell.ts
Default view layout on startup FrontendApplicationContribution application-shell.ts
Command/menu pruning & additions CommandContribution, MenuContribution commands-contributions.ts
Contribution filtering (hide panels) FilterContribution contribution-filters.ts
Keyboard shortcut reference command CommandContribution, MenuContribution keyboard-shortcuts-contribution.ts
File navigator (no Open Editors) rebind(NavigatorWidgetFactory) navigator-widget-factory.ts
Output panel (locked, no toolbar buttons) rebind(OutputToolbarContribution), rebind(OutputWidget) output-toolbar-contribution.ts

What is Filtered Out

The following Theia contributions are blocked from registering via RemoveFromUIFilterContribution:

  • DebugFrontendApplicationContribution
  • DebugFrontendContribution
  • ScmContribution
  • OutlineViewContribution
  • CallHierarchyContribution
  • ProblemContribution
  • PluginApiFrontendContribution
  • PluginFrontendViewContribution
  • WindowContribution
  • All @theia/test view contributions

Dependency Injection

PlainScript uses the InversifyJS container that Theia provides. All custom classes are decorated with @injectable() and registered through the ContainerModule entry point. Constructor-injected dependencies use @inject() with Theia's service identifiers.


CI/CD Pipelines

Workflow Trigger Purpose
ci.yml Push / PR to main, develop Lint, typecheck, npm audit, and frontend bundle build
release.yml Push of v* tag Build Linux AppImage, macOS DMG/ZIP, Windows NSIS/portable EXE
docs.yml Push to main, push of v* tag Build and deploy this documentation to GitHub Pages