docs(chord): fold the cross-plugin import rule into design and slices

This commit is contained in:
Mario Zechner 2026-11-01 23:11:22 +00:00
parent e1669ee4b8
commit c9f4c7b9fc
2 changed files with 11 additions and 1 deletions

View file

@ -1962,7 +1962,10 @@ type ReloadReport = {
- **A plugin** is a directory with a `package.json` (its `name` is the plugin's name, npm style) and one file per facet
kind the app names; plugins come from roots found by directory listing (no source parsing; the first root wins a
duplicate name). Dependencies between plugins resolve by contract name at runtime; names are prefixed
(`<plugin>.<name>`; tools `<plugin>_<name>`).
(`<plugin>.<name>`; tools `<plugin>_<name>`). A plugin carries the contracts it was written against (decision "Contracts come from where the
plugin's code came from"): plugins that change together import each other by relative path within a root
(copied into the importer's script); others take contracts as an npm dependency at a fixed version (slice 10 still
resolves imports by plugin name; the plugin slice changes it).
- **Loader D:** one esbuild script per facet (its own files, copied files of other plugins, its npm `dependencies`
inlined; host packages, `chord.external` packages and Node builtins external, passed in at evaluation); each facet kind is defined once, `kinds: { <kind>: { platform: "node" | "browser", hostPackages } }` (slice 11); evaluated with
`vm.Script` under a stable filename per (plugin, kind, digest); no module map: old generations are reclaimed by the

View file

@ -181,6 +181,13 @@ deleted (the slice's spec and code are the record). Moved here from `carry-over.
- **`rebuild` of tables** (key and column-type changes): `evolveTable` has no edit for them; build one only when a
real case needs it. (Slice 6a's second spec review; out of slice 7b's scope, `slice-7b.md` §12.)
### The plugin slice (plugin model)
- **Cross-plugin imports by relative path and npm** (decision "Contracts come from where the plugin's code came
from"): remove `build.ts`'s by-name lookup, allow relative imports into another plugin of the same root, refuse
paths leaving the root; examples 35-38 and fixtures back to relative imports; drop the six `tsconfig` path aliases;
plugins README; the guide's chapter "Plugins Using Plugins". (Slice 10 built by-name imports.)
### After slice 11
- **Small examples** (owner, 2026-10-30: the 7c examples are complete but complex): once HTTP, workers, web and TUI