@pyreon/mcp 0.7.2 → 0.7.3
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/lib/analysis/index.js.html +1 -1
- package/lib/index.js +975 -1467
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
- package/src/api-reference.ts +47 -0
- package/src/index.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pyreon/mcp",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "MCP server for Pyreon — AI-powered framework assistance",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"prepublishOnly": "bun run build"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@pyreon/compiler": "0.7.
|
|
45
|
+
"@pyreon/compiler": "^0.7.3",
|
|
46
46
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
47
47
|
"zod": "^3.25.76"
|
|
48
48
|
},
|
package/src/api-reference.ts
CHANGED
|
@@ -82,6 +82,19 @@ effect(() => {
|
|
|
82
82
|
- \`effect(() => { count })\` → Must call: \`effect(() => { count() })\``,
|
|
83
83
|
},
|
|
84
84
|
|
|
85
|
+
"reactivity/onCleanup": {
|
|
86
|
+
signature: "onCleanup(fn: () => void): void",
|
|
87
|
+
example: `effect(() => {
|
|
88
|
+
const handler = () => console.log(count())
|
|
89
|
+
window.addEventListener("resize", handler)
|
|
90
|
+
onCleanup(() => window.removeEventListener("resize", handler))
|
|
91
|
+
})`,
|
|
92
|
+
notes:
|
|
93
|
+
"Registers a cleanup function inside an effect. Runs between re-executions (before the effect re-runs) and when the effect is disposed.",
|
|
94
|
+
mistakes: `- Using onCleanup outside an effect — it only works inside effect() or renderEffect()
|
|
95
|
+
- Confusing with onUnmount — onCleanup is for effects, onUnmount is for components`,
|
|
96
|
+
},
|
|
97
|
+
|
|
85
98
|
"reactivity/batch": {
|
|
86
99
|
signature: "batch(fn: () => void): void",
|
|
87
100
|
example: `const a = signal(1)
|
|
@@ -196,6 +209,40 @@ const Child = () => {
|
|
|
196
209
|
example: `const theme = useContext(ThemeContext) // returns provided value or default`,
|
|
197
210
|
},
|
|
198
211
|
|
|
212
|
+
"core/provide": {
|
|
213
|
+
signature: "provide<T>(ctx: Context<T>, value: T): void",
|
|
214
|
+
example: `const ThemeCtx = createContext<"light" | "dark">("light")
|
|
215
|
+
|
|
216
|
+
function App() {
|
|
217
|
+
provide(ThemeCtx, "dark")
|
|
218
|
+
return <Child />
|
|
219
|
+
}`,
|
|
220
|
+
notes:
|
|
221
|
+
"Pushes a context value and auto-cleans up on unmount. Preferred over manual pushContext/popContext. Must be called during component setup.",
|
|
222
|
+
},
|
|
223
|
+
|
|
224
|
+
"core/ExtractProps": {
|
|
225
|
+
signature: "type ExtractProps<T> = T extends ComponentFn<infer P> ? P : T",
|
|
226
|
+
example: `const Greet: ComponentFn<{ name: string }> = ({ name }) => <h1>{name}</h1>
|
|
227
|
+
|
|
228
|
+
type Props = ExtractProps<typeof Greet>
|
|
229
|
+
// { name: string }`,
|
|
230
|
+
notes:
|
|
231
|
+
"Extracts the props type from a ComponentFn. Passes through unchanged if T is not a ComponentFn.",
|
|
232
|
+
},
|
|
233
|
+
|
|
234
|
+
"core/HigherOrderComponent": {
|
|
235
|
+
signature: "type HigherOrderComponent<HOP, P> = ComponentFn<HOP & P>",
|
|
236
|
+
example: `function withLogger<P>(Wrapped: ComponentFn<P>): HigherOrderComponent<{ logLevel?: string }, P> {
|
|
237
|
+
return (props) => {
|
|
238
|
+
console.log(\`[\${props.logLevel ?? "info"}] Rendering\`)
|
|
239
|
+
return <Wrapped {...props} />
|
|
240
|
+
}
|
|
241
|
+
}`,
|
|
242
|
+
notes:
|
|
243
|
+
"Typed HOC pattern — HOP is the props the HOC adds, P is the wrapped component's own props.",
|
|
244
|
+
},
|
|
245
|
+
|
|
199
246
|
"core/For": {
|
|
200
247
|
signature: "<For each={items} by={keyFn}>{renderFn}</For>",
|
|
201
248
|
example: `const items = signal([
|
package/src/index.ts
CHANGED