Files
archived-orca/src/cli/plugin-authoring/plugin-release-entry.ts
T
Neil 4ee788a725 Build-less TS/TSX plugins, typings and authoring tools (#36918)
* feat(plugins): build-less TS/TSX plugins, typings and authoring tools

- Plugin frames transpile .ts/.tsx/.mts/.jsx on load (sucrase on a shared worker thread with a
  2 s budget, cached in main), resolve relative imports to exact files, and refuse bare
  package imports by name. Components and html panel/editor entries may be .ts/.tsx.
- orca plugin types writes typings for the components orca module, window.orca, worker
  activate(orca), host.call and events into .orca/types, from one host-typings generator.
- orca plugin create --template components; templates omit publisher and target 1.4.246.
- orca plugin release-entry, dev inspect and restart; validate:plugin checks named files.
- Guest console errors reach orca plugin logs; dev workers restart on edits; the dev watcher
  ignores .git, .orca and node_modules; Git and folder installs cannot replace catalog installs.
- examples/plugins/hello-tsx, docs, and the plugin-buildless-tsx e2e spec.

* ci: run the Windows parity probes with one tsgo checker

tsconfig.node peaks near 22 GB with tsgo's default four checkers (each holds its own types)
and about 16 GB with one; the 16 GB Windows runner paged the native probe past its 900 s
timeout once this branch's package.json change triggered the job. One checker gives the
same diagnostics (verified locally with --parity-only); the timing benchmark is unchanged.
2026-11-01 01:28:35 -08:00

42 lines
1.3 KiB
TypeScript

import {
pluginCatalogReleaseForHead,
type PluginCatalogReleaseReport
} from '../../main/plugins/plugin-authoring-checks'
import type { PluginValidationReport } from './plugin-folder-validation'
export type PluginReleaseEntryResult = PluginCatalogReleaseReport & {
path: string
pluginKey?: string
}
/** Release entry for a plugin folder that already passed `validatePluginTarget`. */
export async function pluginReleaseEntryForFolder(
report: PluginValidationReport
): Promise<PluginReleaseEntryResult> {
return {
path: report.path,
...(report.plugin ? { pluginKey: report.plugin.pluginKey } : {}),
...(await pluginCatalogReleaseForHead(report.path))
}
}
/** Same layout as `pnpm validate:plugin`, so either output can be pasted into a catalog. */
export function formatPluginReleaseEntry(result: PluginReleaseEntryResult): string {
return [
...(result.sourcePath
? [
`Catalog source path (set "path" in this plugin's "source"): ${JSON.stringify(result.sourcePath)}`,
''
]
: []),
...(result.entry
? [
'Catalog release entry for HEAD (newest first in "releases"):',
JSON.stringify(result.entry, null, 2)
]
: []),
...(result.note ? [`note: ${result.note}`] : []),
...(result.ownerWarning ? [`warning: ${result.ownerWarning}`] : [])
].join('\n')
}