Files
IdeA/sdk/IdeaSDK
Blomios 5a30ec8b9c fix(plugins): isole les menus plugin et durcit hello-plugin SDK contre la rechute #120
Requalification Architect du 2026-08-01: le crash INTERFACE INTERROMPUE au
chargement d'un plugin (menu + item) remonte via ProjectsView -> usePluginMenus
-> MenuBar jusqu'à RootErrorBoundary, quel que soit le plugin (ancien ou
reconstruit via SDK).

- usePluginMenus isole la résolution/conversion des contributions plugin :
  toute erreur retombe sur [] au lieu de propager.
- ProjectsView sépare les menus natifs des menus enrichis par plugin et rend
  MenuBar derrière une error boundary locale (fallback menus natifs seuls).
- hello-plugin (SDK) et les tests d'installation associés durcis en cohérence.

Bookkeeping ticket #120 uniquement (issue.md, carnet.md) ; les fichiers
counter.json/index.json et le dossier tickets/122/ restent hors commit car
une collision de numérotation #122 existe entre cette base et
feature/ticket120-hello-plugin-install-path-audit (deux tickets différents
revendiquent #122) — à arbitrer avant de committer le bookkeeping global.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-01 16:23:56 +02:00
..

IdeA Plugin SDK

Minimal public TypeScript SDK for IdeA plugins.

This first version intentionally stays small:

  • public manifest types for idea-plugin.json;
  • public runtime types for plugin modules exposing activate(ctx);
  • a lightweight manifest validator;
  • a minimal examples/hello-plugin plugin.

Install

npm install

Build

npm run build

Typecheck the example

npm run typecheck:examples

Build the installable hello plugin archive

npm run package:hello-plugin

The archive is written to:

examples/hello-plugin/build/hello-plugin-0.1.0.zip

Its ZIP root contains idea-plugin.json directly, with no wrapping parent directory. The compiled ESM entrypoint is emitted at dist/index.js, matching the manifest main field.

Plugin shape

An IdeA plugin ships an idea-plugin.json manifest and a JavaScript entrypoint built from TypeScript.

{
  "ideaPluginManifestVersion": 1,
  "id": "com.example.hello",
  "displayName": "Hello Plugin",
  "version": "0.1.0",
  "main": "dist/index.js",
  "trustLevel": "full",
  "contributes": {}
}

The entrypoint exports an activate(ctx) function:

import type { ActivateContext } from "@idea/plugin-sdk";

export function activate(ctx: ActivateContext): void {
  ctx.logger.info("hello from plugin");
}

Manifest Validation

import { validatePluginManifest } from "@idea/plugin-sdk";

const result = validatePluginManifest(manifestJson);
if (!result.success) {
  console.error(result.errors);
}

This validator is deliberately strict for core fields and permissive about future unknown fields. It is not a security boundary.