@twobirds/microcomponents 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -6
- package/dist/cli/create.js +1 -1
- package/dist/mcp/api.json +601 -0
- package/dist/mcp/concepts/custom-element-registry.md +92 -0
- package/dist/mcp/concepts/event-system.md +45 -0
- package/dist/mcp/concepts/implementation-priority.md +10 -0
- package/dist/mcp/concepts/mc-types.md +349 -0
- package/dist/mcp/concepts/microcomponent-architecture.md +31 -0
- package/dist/mcp/concepts/state-management.md +18 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +264 -0
- package/package.json +17 -9
package/README.md
CHANGED
|
@@ -40,17 +40,25 @@ The progress of coding is occasionally being streamed on [twitch](https://twitch
|
|
|
40
40
|
|
|
41
41
|
## MCP Server
|
|
42
42
|
|
|
43
|
-
An MCP (Model Context Protocol) server ships with
|
|
43
|
+
An MCP (Model Context Protocol) server ships with the package so AI assistants can look the library up instead of answering from memory. The source is `src/mcp/index.ts`, compiled by `tsconfig.mcp.json` to `dist/mcp/index.js` and published with the package, so installing it gives you the executable bin:
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
microcomponents-mcp # stdio server, straight from the installed package
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
In a published package the server runs from `dist/mcp` and reads the prebuilt `api.json` and the concept essays that the build step emits next to it. During development it generates the index live from `src/` at startup, so it cannot drift away from the library it documents:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pnpm run mcp:dev # restart it whenever src/ changes
|
|
53
|
+
pnpm run mcp:run # start it from source on stdio
|
|
54
|
+
pnpm run mcp:docs # regenerate dist/mcp/api.json and report undocumented exports
|
|
49
55
|
```
|
|
50
56
|
|
|
51
57
|
Tools: `list-components`, `get-component-docs`, `search-components`, `get-core-concept`, `get-source-file`, `list-undocumented`.
|
|
52
58
|
|
|
53
|
-
There is no hand-written API list in the server. The whole index is extracted
|
|
59
|
+
There is no hand-written API list in the server. The whole index is extracted from the JSDoc blocks of the public exports (the names re-exported by each `src/*/index.ts`), so it can never drift away from the code it documents — and `list-undocumented` tells you when a source file still lacks a doc block. Concept essays are hand-authored markdown, one file per concept under `docs/concepts/`, copied into `dist/mcp/concepts` by the build, which is where the tool's list of available concepts comes from.
|
|
60
|
+
|
|
61
|
+
`get-source-file` reads package-root relative paths (`dist/core/MC.d.ts`, `dist/mcp/concepts/event-system.md`) and refuses any path outside the package sources.
|
|
54
62
|
|
|
55
63
|
## CLI
|
|
56
64
|
|
|
@@ -110,7 +118,7 @@ mc clean
|
|
|
110
118
|
mc check
|
|
111
119
|
```
|
|
112
120
|
|
|
113
|
-
`clean` and `check` are thin wrappers around the package.json scripts of the same name, so the scripts remain the single source of truth for what they do — `mc check` type-checks every project context (lib, cli, test, demo, node) and exits with the script's exit code.
|
|
121
|
+
`clean` and `check` are thin wrappers around the package.json scripts of the same name, so the scripts remain the single source of truth for what they do — `mc check` type-checks every project context (lib, cli, mcp, test, demo, node) and exits with the script's exit code.
|
|
114
122
|
|
|
115
123
|
The scaffold derives the file path from the tag using the same rule the runtime autoload loader uses (`my-card` → `my/card.ts`), names companion assets after the runtime's asset descriptors (`targetHtml` → `card.target.html`), and wires them into a `static assets` declaration. `--js` emits a plain JavaScript file for the rapid-prototyping path.
|
|
116
124
|
|
package/dist/cli/create.js
CHANGED
|
@@ -81,7 +81,7 @@ function packageJson(namespace) {
|
|
|
81
81
|
typecheck: 'tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.vc.json',
|
|
82
82
|
},
|
|
83
83
|
dependencies: {
|
|
84
|
-
'@twobirds/microcomponents': '^0.
|
|
84
|
+
'@twobirds/microcomponents': '^0.5.0',
|
|
85
85
|
},
|
|
86
86
|
devDependencies: {
|
|
87
87
|
vite: '^8.1.5',
|