Remplace le README monolithique par un point d'entrée vers des pages dédiées (manifest, activation/contexte, menus, commandes/feedback, layouts React, fenêtres, services, packaging/distribution) pour couvrir #142-#144 et faciliter la navigation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1.4 KiB
1.4 KiB
Packaging And Distribution
A plugin archive is a ZIP file whose root contains idea-plugin.json.
hello-plugin-0.1.0.zip
├── idea-plugin.json
├── README.md
└── dist/
├── index.js
├── constants.js
└── core/
├── layout.js
├── storage.js
└── workspace.js
The manifest main field must point to an emitted file inside the archive:
{
"main": "dist/index.js"
}
Module Resolution
IdeA loads main as ESM and serves package-relative imports from the plugin
package. This is supported:
import { Dashboard } from "./core/layout.js";
For React, import bare host modules normally:
import { useState } from "react";
import { jsx } from "react/jsx-runtime";
IdeA resolves React/ReactDOM bare imports to the host instance. Other bare dependencies are not host-resolved. Bundle or vendor third-party dependencies other than React/ReactDOM into package-relative files.
TypeScript Build
The hello plugin uses plain tsc:
npm run build
npm run build:hello-plugin
For React layouts, configure JSX:
{
"compilerOptions": {
"jsx": "react-jsx",
"module": "NodeNext",
"moduleResolution": "NodeNext"
}
}
Archive Build
The SDK example can be packaged with:
npm run package:hello-plugin
The resulting archive has no wrapping parent directory and is ready for IdeA's plugin installer.