mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-06 16:08:33 +00:00
Per the maintainer's decision for #24, no third-party themes are bundled; instead a theme plugin template and docs let the community port themes (IntelliJ also ships few themes, the rest are plugins). - templates/theme-plugin: manifest-only plugin with an original example (Harbor Night) covering every UI token and an editor scheme (.icls equivalent). - docs/plugins/themes.md: format, IntelliJ / VS Code porting tables, generated token reference (pnpm gen:theme-docs); drift test fails when tokens.css and the template/reference disagree. - pnpm theme:import-intellij: dependency-free converter for IntelliJ .theme.json (+ .icls). - Plugin host: themes may name an editor-scheme merged over the theme; comments allowed in theme files. - Fixes: a plugin theme's kind now switches the light/dark base; plugin themes go in their own stylesheet so the Appearance accent and editor scheme still layer on top. Verified: ide-plugin tests, vitest (44), in-app on macOS: installed the template from disk, applied Harbor Night (dark base + teal accent over Islands Light), back to default restored the light theme. Claude-Session: https://claude.ai/code/session_01VUYsdXA2nkF5v6zsC93dpn
15 lines
671 B
TypeScript
15 lines
671 B
TypeScript
/**
|
|
* Regenerates the token reference in docs/plugins/themes.md from
|
|
* src/styles/tokens.css (`pnpm gen:theme-docs`). scripts/theme/theme.test.ts
|
|
* fails when the checked-in reference is stale.
|
|
*/
|
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
import { referenceMarkdown, themeTokenGroups, withReference } from "./tokens.ts";
|
|
|
|
const DOC = "docs/plugins/themes.md";
|
|
const groups = themeTokenGroups(readFileSync("src/styles/tokens.css", "utf8"));
|
|
const doc = readFileSync(DOC, "utf8");
|
|
const next = withReference(doc, referenceMarkdown(groups));
|
|
if (next !== doc) writeFileSync(DOC, next);
|
|
console.log(next === doc ? `${DOC} is up to date` : `updated ${DOC}`);
|