From c9f4c7b9fcd0f3e6b5bbc35c7c9b6cda35580eb8 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Sun, 1 Nov 2026 23:11:22 +0000 Subject: [PATCH] docs(chord): fold the cross-plugin import rule into design and slices --- packages/chord/docs/next/design.md | 5 ++++- packages/chord/docs/next/slices.md | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/chord/docs/next/design.md b/packages/chord/docs/next/design.md index 517276db3..c11cb89e4 100644 --- a/packages/chord/docs/next/design.md +++ b/packages/chord/docs/next/design.md @@ -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 - (`.`; tools `_`). + (`.`; tools `_`). 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: { : { 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 diff --git a/packages/chord/docs/next/slices.md b/packages/chord/docs/next/slices.md index 28e094cd5..084d3456e 100644 --- a/packages/chord/docs/next/slices.md +++ b/packages/chord/docs/next/slices.md @@ -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