Files
archived-orca/src/cli/plugin-authoring/plugin-templates.ts
Neil 60e25bde45 feat(plugins): make the editor template the rich-editor recipe (#37349)
orca plugin create --template editor wrote an inline-script HTML editor
whose extension came from the folder name squashed to 12 letters. It now
writes the recipe: editor/main.ts (the view), editor/sync.ts (the
document session with a stand-in text merge), editor/sync.test.ts (a
mockEditorHost test of an outside write merged during a save), a
tsconfig on the generated typings, frame isolated, engines.orca
>=1.4.248, and extension .<id>. It passes plugin check and plugin test
as generated.
2026-11-01 22:04:31 -08:00

31 lines
1.0 KiB
TypeScript

/** Starter plugins for `orca plugin create`. Each one validates as-is and runs no build step. */
import { iconTheme, languagePack, syntax, terminalTheme, theme } from './plugin-content-templates'
import { panel } from './plugin-frame-templates'
import { editor } from './plugin-editor-template'
import { components } from './plugin-components-template'
import { workerPanel } from './plugin-worker-panel-template'
import { hook } from './plugin-hook-template'
import type { PluginTemplate, PluginTemplateInput } from './plugin-template-files'
import type { PluginTemplateName } from './plugin-template-names'
const TEMPLATES: Record<PluginTemplateName, (input: PluginTemplateInput) => PluginTemplate> = {
theme,
'terminal-theme': terminalTheme,
'icon-theme': iconTheme,
syntax,
'language-pack': languagePack,
editor,
panel,
components,
'worker-panel': workerPanel,
hook
}
export function renderPluginTemplate(
name: PluginTemplateName,
input: PluginTemplateInput
): PluginTemplate {
return TEMPLATES[name](input)
}