@macroforge/mcp-server 0.1.30 → 0.1.32
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/docs/custom-macros/ts-quote/comments-and.md +7 -28
- package/docs/custom-macros/ts-quote/complete-example-json-derive-macro.md +20 -16
- package/docs/custom-macros/ts-quote/interpolation-expr.md +349 -0
- package/docs/custom-macros/ts-quote/local-constants-let.md +34 -0
- package/docs/custom-macros/ts-quote/overview.md +8 -6
- package/docs/custom-macros/ts-quote/quick-reference.md +128 -80
- package/docs/custom-macros/ts-quote/side-effects-do.md +67 -3
- package/docs/custom-macros/ts-quote/tsstream-injection-typescript.md +1 -1
- package/docs/custom-macros/ts-quote/while-loops-while.md +0 -33
- package/docs/custom-macros/ts-quote.md +199 -102
- package/docs/sections.json +14 -74
- package/package.json +4 -2
|
@@ -5,71 +5,144 @@
|
|
|
5
5
|
## Available Macros
|
|
6
6
|
|
|
7
7
|
| `ts_template!`
|
|
8
|
-
| Any TypeScript code
|
|
9
|
-
| General code generation
|
|
8
|
+
| Any TypeScript code
|
|
9
|
+
| General code generation
|
|
10
|
+
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
|
13
|
-
|
|
|
12
|
+
|
|
13
|
+
| `body!`
|
|
14
|
+
| Class body members
|
|
15
|
+
| Methods and properties
|
|
14
16
|
|
|
15
17
|
## Quick Reference
|
|
16
18
|
|
|
17
19
|
| `@{expr}`
|
|
18
|
-
| Interpolate a Rust expression (adds space after)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
20
|
+
| Interpolate a Rust expression (adds space after)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
| `{| content |}`
|
|
25
|
+
| Ident block: concatenates without spaces (e.g., <code
|
|
26
|
+
>{|get@{name}|}</code
|
|
27
|
+
>
|
|
28
|
+
→ `getUser`)</td
|
|
29
|
+
>
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
<td>`{> "comment" <}`
|
|
34
|
+
| Block comment: outputs `/* comment */` (string preserves
|
|
35
|
+
whitespace)</td
|
|
36
|
+
>
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
<td>`{>> "doc" <<}`
|
|
41
|
+
| Doc comment: outputs `/** doc */` (string preserves whitespace)</td
|
|
42
|
+
>
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<td>`@@{`
|
|
47
|
+
| Escape for literal `@{` (e.g.,
|
|
48
|
+
`"@@{foo}"`
|
|
49
|
+
→ `@{foo}`)</td
|
|
50
|
+
>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
<td>`"text @{expr}"`
|
|
55
|
+
| String interpolation (auto-detected)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
| `"'^template ${js}^'"`
|
|
60
|
+
| JS backtick template literal (outputs <code
|
|
61
|
+
>`template ${js}`</code
|
|
62
|
+
>)</td
|
|
63
|
+
>
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
<td>`{#if cond}...{/if}`
|
|
68
|
+
| Conditional block
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
| <code
|
|
73
|
+
>{#if cond}...{:else}...{/if}</code
|
|
74
|
+
></td
|
|
75
|
+
>
|
|
76
|
+
<td>Conditional with else
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
| <code
|
|
81
|
+
>{#if a}...{:else if
|
|
82
|
+
b}...{:else}...{/if}</code
|
|
83
|
+
></td
|
|
84
|
+
>
|
|
85
|
+
<td>Full if/else-if/else chain
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
| <code
|
|
90
|
+
>{#if let pattern = expr}...{/if}</code
|
|
91
|
+
></td
|
|
92
|
+
>
|
|
93
|
+
<td>Pattern matching if-let
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
| <code
|
|
98
|
+
>{#match expr}{:case
|
|
99
|
+
pattern}...{/match}</code
|
|
100
|
+
></td
|
|
101
|
+
>
|
|
102
|
+
<td>Match expression with case arms
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
| <code>{#for item in list}...{/for}</code
|
|
107
|
+
></td
|
|
108
|
+
>
|
|
109
|
+
<td>Iterate over a collection
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
| `{#while cond}...{/while}`
|
|
114
|
+
| While loop
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
| <code
|
|
119
|
+
>{#while let pattern = expr}...{/while}</code
|
|
120
|
+
></td
|
|
121
|
+
>
|
|
122
|
+
<td>While-let pattern matching loop
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
| `{$let name = expr}`
|
|
127
|
+
| Define a local constant
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
| `{$let mut name = expr}`
|
|
132
|
+
| Define a mutable local variable
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
| `{$do expr}`
|
|
137
|
+
| Execute a side-effectful expression
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
| `{$typescript stream}`
|
|
142
|
+
<td
|
|
143
|
+
>Inject a TsStream, preserving its source and runtime_patches
|
|
144
|
+
(imports)</td
|
|
145
|
+
>
|
|
73
146
|
|
|
74
147
|
**Note:** A single `@` not followed by `{` passes through unchanged (e.g., `email@domain.com` works as expected).
|
|
75
148
|
|
|
@@ -96,7 +169,9 @@ User.prototype.toString = function () {
|
|
|
96
169
|
};
|
|
97
170
|
```
|
|
98
171
|
|
|
99
|
-
|
|
172
|
+
<h2 id="ident-blocks">
|
|
173
|
+
Identifier Concatenation: `{| content |}`
|
|
174
|
+
</h2>
|
|
100
175
|
|
|
101
176
|
When you need to build identifiers dynamically (like `getUser`, `setName`), use the ident block syntax. Everything inside `{| |}` is concatenated without spaces:
|
|
102
177
|
|
|
@@ -139,17 +214,20 @@ let action = "create";
|
|
|
139
214
|
ts_template! { {|@{entity}_@{action}|} } // → "user_create"
|
|
140
215
|
```
|
|
141
216
|
|
|
142
|
-
|
|
217
|
+
<h2 id="comments">
|
|
218
|
+
Comments: `{> "..." <}` and
|
|
219
|
+
`{>> "..." <<}`
|
|
220
|
+
</h2>
|
|
143
221
|
|
|
144
|
-
Since Rust's tokenizer strips
|
|
222
|
+
Since Rust's tokenizer strips whitespace before macros see them, use string literals to preserve exact spacing in comments:
|
|
145
223
|
|
|
146
224
|
### Block Comments
|
|
147
225
|
|
|
148
|
-
Use `{> comment <}` for block comments:
|
|
226
|
+
Use `{> "comment" <}` for block comments:
|
|
149
227
|
|
|
150
228
|
```rust
|
|
151
229
|
let code = ts_template! {
|
|
152
|
-
{> This is a block comment <}
|
|
230
|
+
{> "This is a block comment" <}
|
|
153
231
|
const x = 42;
|
|
154
232
|
};
|
|
155
233
|
```
|
|
@@ -163,12 +241,12 @@ const x = 42;
|
|
|
163
241
|
|
|
164
242
|
### Doc Comments (JSDoc)
|
|
165
243
|
|
|
166
|
-
Use `{>> doc <<}` for JSDoc comments:
|
|
244
|
+
Use `{>> "doc" <<}` for JSDoc comments:
|
|
167
245
|
|
|
168
246
|
```rust
|
|
169
247
|
let code = ts_template! {
|
|
170
|
-
{>> @param {string} name - The user's name <<}
|
|
171
|
-
{>> @returns {string} A greeting message <<}
|
|
248
|
+
{>> "@param {string} name - The user's name" <<}
|
|
249
|
+
{>> "@returns {string} A greeting message" <<}
|
|
172
250
|
function greet(name: string): string {
|
|
173
251
|
return "Hello, " + name;
|
|
174
252
|
}
|
|
@@ -187,14 +265,15 @@ function greet(name: string): string {
|
|
|
187
265
|
|
|
188
266
|
### Comments with Interpolation
|
|
189
267
|
|
|
190
|
-
|
|
268
|
+
Use `format!()` or similar to build dynamic comment strings:
|
|
191
269
|
|
|
192
270
|
```rust
|
|
193
271
|
let param_name = "userId";
|
|
194
272
|
let param_type = "number";
|
|
273
|
+
let comment = format!("@param {{{}}} {} - The user ID", param_type, param_name);
|
|
195
274
|
|
|
196
275
|
let code = ts_template! {
|
|
197
|
-
{>> @
|
|
276
|
+
{>> @{comment} <<}
|
|
198
277
|
function getUser(userId: number) {}
|
|
199
278
|
};
|
|
200
279
|
```
|
|
@@ -206,9 +285,11 @@ let code = ts_template! {
|
|
|
206
285
|
function getUser(userId: number) {}
|
|
207
286
|
```
|
|
208
287
|
|
|
209
|
-
|
|
288
|
+
<h2 id="string-interpolation">
|
|
289
|
+
String Interpolation: `"text @{expr}"`
|
|
290
|
+
</h2>
|
|
210
291
|
|
|
211
|
-
Interpolation works automatically inside string literals - no
|
|
292
|
+
Interpolation works automatically inside string literals - no <code >format!()</code > needed:
|
|
212
293
|
|
|
213
294
|
```rust
|
|
214
295
|
let name = "World";
|
|
@@ -237,9 +318,11 @@ let code = ts_template! {
|
|
|
237
318
|
};
|
|
238
319
|
```
|
|
239
320
|
|
|
240
|
-
|
|
321
|
+
<h2 id="backtick-templates">
|
|
322
|
+
Backtick Template Literals: `"'^...^'"`
|
|
323
|
+
</h2>
|
|
241
324
|
|
|
242
|
-
For JavaScript template literals (backtick strings), use the
|
|
325
|
+
For JavaScript template literals (backtick strings), use the <code >'^...^'</code > syntax. This outputs actual backticks and passes through `${"${}"}` for JS interpolation:
|
|
243
326
|
|
|
244
327
|
```rust
|
|
245
328
|
let tag_name = "div";
|
|
@@ -251,7 +334,7 @@ let code = ts_template! {
|
|
|
251
334
|
|
|
252
335
|
**Generates:**
|
|
253
336
|
|
|
254
|
-
<CodeBlock code={
|
|
337
|
+
<CodeBlock code={"const html = `${content}`;"} lang="typescript" />
|
|
255
338
|
|
|
256
339
|
You can mix Rust `@{}` interpolation (evaluated at macro expansion time) with JS `${"${}"}` interpolation (evaluated at runtime):
|
|
257
340
|
|
|
@@ -265,9 +348,11 @@ let code = ts_template! {
|
|
|
265
348
|
|
|
266
349
|
**Generates:**
|
|
267
350
|
|
|
268
|
-
<CodeBlock code={
|
|
351
|
+
<CodeBlock code={"`Hello ${this.name}, you are a User`"} lang="typescript" />
|
|
269
352
|
|
|
270
|
-
|
|
353
|
+
<h2 id="conditionals">
|
|
354
|
+
Conditionals: `{#if}...{/if}`
|
|
355
|
+
</h2>
|
|
271
356
|
|
|
272
357
|
Basic conditional:
|
|
273
358
|
|
|
@@ -314,7 +399,9 @@ let code = ts_template! {
|
|
|
314
399
|
};
|
|
315
400
|
```
|
|
316
401
|
|
|
317
|
-
|
|
402
|
+
<h2 id="pattern-matching">
|
|
403
|
+
Pattern Matching: `{#if let}`
|
|
404
|
+
</h2>
|
|
318
405
|
|
|
319
406
|
Use `if let` for pattern matching on `Option`, `Result`, or other Rust enums:
|
|
320
407
|
|
|
@@ -348,7 +435,9 @@ let code = ts_template! {
|
|
|
348
435
|
};
|
|
349
436
|
```
|
|
350
437
|
|
|
351
|
-
|
|
438
|
+
<h2 id="match-expressions">
|
|
439
|
+
Match Expressions: `{#match}`
|
|
440
|
+
</h2>
|
|
352
441
|
|
|
353
442
|
Use `match` for exhaustive pattern matching:
|
|
354
443
|
|
|
@@ -535,9 +624,11 @@ let code = ts_template! {
|
|
|
535
624
|
|
|
536
625
|
This is useful for computing derived values inside loops without cluttering the Rust code.
|
|
537
626
|
|
|
538
|
-
|
|
627
|
+
<h2 id="mutable-variables">
|
|
628
|
+
Mutable Variables: `{$let mut}`
|
|
629
|
+
</h2>
|
|
539
630
|
|
|
540
|
-
When you need to modify a variable within the template (e.g., in a
|
|
631
|
+
When you need to modify a variable within the template (e.g., in a <code >while</code > loop), use `{$let mut}`:
|
|
541
632
|
|
|
542
633
|
```rust
|
|
543
634
|
let code = ts_template! {
|
|
@@ -568,13 +659,15 @@ Common uses for `{$do}`:
|
|
|
568
659
|
|
|
569
660
|
- Incrementing counters: `{$do i += 1}`
|
|
570
661
|
|
|
571
|
-
- Building collections: `{$do vec.push(item)}`
|
|
662
|
+
- Building collections: `{$do vec.push(item)}`
|
|
572
663
|
|
|
573
|
-
- Setting flags: `{$do found = true}`
|
|
664
|
+
- Setting flags: `{$do found = true}`
|
|
574
665
|
|
|
575
|
-
- Any mutating operation
|
|
666
|
+
- Any mutating operation
|
|
576
667
|
|
|
577
|
-
|
|
668
|
+
<h2 id="typescript-injection">
|
|
669
|
+
TsStream Injection: `{$typescript}`
|
|
670
|
+
</h2>
|
|
578
671
|
|
|
579
672
|
Inject another TsStream into your template, preserving both its source code and runtime patches (like imports added via `add_import()`):
|
|
580
673
|
|
|
@@ -585,7 +678,7 @@ let mut helper = body! {
|
|
|
585
678
|
return Result.ok(true);
|
|
586
679
|
}
|
|
587
680
|
};
|
|
588
|
-
helper.add_import("Result", "macroforge/
|
|
681
|
+
helper.add_import("Result", "macroforge/utils");
|
|
589
682
|
|
|
590
683
|
// Inject the helper into the main template
|
|
591
684
|
let result = body! {
|
|
@@ -704,11 +797,11 @@ pub fn derive_json_macro(input: TsStream) -> MacroResult {
|
|
|
704
797
|
|
|
705
798
|
1. **Compile-Time:** The template is parsed during macro expansion
|
|
706
799
|
|
|
707
|
-
2. **String Building:** Generates Rust code that builds a TypeScript string at runtime
|
|
800
|
+
2. **String Building:** Generates Rust code that builds a TypeScript string at runtime
|
|
708
801
|
|
|
709
|
-
3. **SWC Parsing:** The generated string is parsed with SWC to produce a typed AST
|
|
802
|
+
3. **SWC Parsing:** The generated string is parsed with SWC to produce a typed AST
|
|
710
803
|
|
|
711
|
-
4. **Result:** Returns `Stmt` that can be used in `MacroResult` patches
|
|
804
|
+
4. **Result:** Returns `Stmt` that can be used in `MacroResult` patches
|
|
712
805
|
|
|
713
806
|
## Return Type
|
|
714
807
|
|
|
@@ -725,11 +818,11 @@ This shows you exactly what was generated, making debugging easy!
|
|
|
725
818
|
|
|
726
819
|
## Nesting and Regular TypeScript
|
|
727
820
|
|
|
728
|
-
You can mix template syntax with regular TypeScript. Braces
|
|
821
|
+
You can mix template syntax with regular TypeScript. Braces <code >{}</code > are recognized as either:
|
|
729
822
|
|
|
730
823
|
- **Template tags** if they start with `#`, `$`, `:`, or `/`
|
|
731
824
|
|
|
732
|
-
- **Regular TypeScript blocks** otherwise
|
|
825
|
+
- **Regular TypeScript blocks** otherwise
|
|
733
826
|
|
|
734
827
|
```rust
|
|
735
828
|
ts_template! {
|
|
@@ -747,23 +840,27 @@ ts_template! {
|
|
|
747
840
|
## Comparison with Alternatives
|
|
748
841
|
|
|
749
842
|
| `ts_quote!`
|
|
750
|
-
| Compile-time validation, type-safe
|
|
751
|
-
| Can't handle Vec<Stmt>, verbose
|
|
843
|
+
| Compile-time validation, type-safe
|
|
844
|
+
| Can't handle Vec<Stmt>, verbose
|
|
845
|
+
|
|
752
846
|
|
|
753
|
-
|
|
754
|
-
|
|
|
755
|
-
|
|
|
847
|
+
|
|
848
|
+
| `parse_ts_str()`
|
|
849
|
+
| Maximum flexibility
|
|
850
|
+
| Runtime parsing, less readable
|
|
851
|
+
|
|
756
852
|
|
|
757
|
-
|
|
758
|
-
|
|
|
759
|
-
|
|
|
853
|
+
|
|
854
|
+
| `ts_template!`
|
|
855
|
+
| Readable, handles loops/conditions
|
|
856
|
+
| Small runtime parsing overhead
|
|
760
857
|
|
|
761
858
|
## Best Practices
|
|
762
859
|
|
|
763
860
|
1. Use `ts_template!` for complex code generation with loops/conditions
|
|
764
861
|
|
|
765
|
-
2. Use `ts_quote!` for simple, static statements
|
|
862
|
+
2. Use `ts_quote!` for simple, static statements
|
|
766
863
|
|
|
767
|
-
3. Keep templates readable - extract complex logic into variables
|
|
864
|
+
3. Keep templates readable - extract complex logic into variables
|
|
768
865
|
|
|
769
|
-
4. Don't nest templates too deeply - split into helper functions
|
|
866
|
+
4. Don't nest templates too deeply - split into helper functions
|
package/docs/sections.json
CHANGED
|
@@ -338,66 +338,12 @@
|
|
|
338
338
|
"parent_id": "ts-quote"
|
|
339
339
|
},
|
|
340
340
|
{
|
|
341
|
-
"id": "ts-quote/
|
|
342
|
-
"title": "Template Syntax:
|
|
341
|
+
"id": "ts-quote/interpolation-expr",
|
|
342
|
+
"title": "Template Syntax: Interpolation: `@{expr}`",
|
|
343
343
|
"category": "custom-macros",
|
|
344
344
|
"category_title": "Custom Macros",
|
|
345
|
-
"path": "custom-macros/ts-quote/
|
|
346
|
-
"use_cases": "ts_quote, template,
|
|
347
|
-
"parent_id": "ts-quote"
|
|
348
|
-
},
|
|
349
|
-
{
|
|
350
|
-
"id": "ts-quote/comments-and",
|
|
351
|
-
"title": "Template Syntax: Comments: `{> ... <}` and `{>> ... <<}`",
|
|
352
|
-
"category": "custom-macros",
|
|
353
|
-
"category_title": "Custom Macros",
|
|
354
|
-
"path": "custom-macros/ts-quote/comments-and.md",
|
|
355
|
-
"use_cases": "ts_quote, template, \n\n**generates:**\n\n",
|
|
356
|
-
"parent_id": "ts-quote"
|
|
357
|
-
},
|
|
358
|
-
{
|
|
359
|
-
"id": "ts-quote/string-interpolation-text-expr",
|
|
360
|
-
"title": "Template Syntax: String Interpolation: `\"text @{expr}\"`",
|
|
361
|
-
"category": "custom-macros",
|
|
362
|
-
"category_title": "Custom Macros",
|
|
363
|
-
"path": "custom-macros/ts-quote/string-interpolation-text-expr.md",
|
|
364
|
-
"use_cases": "ts_quote, template, format!(), \n\n**generates:**\n\n",
|
|
365
|
-
"parent_id": "ts-quote"
|
|
366
|
-
},
|
|
367
|
-
{
|
|
368
|
-
"id": "ts-quote/backtick-template-literals",
|
|
369
|
-
"title": "Template Syntax: Backtick Template Literals: `\"'^...^'\"`",
|
|
370
|
-
"category": "custom-macros",
|
|
371
|
-
"category_title": "Custom Macros",
|
|
372
|
-
"path": "custom-macros/ts-quote/backtick-template-literals.md",
|
|
373
|
-
"use_cases": "ts_quote, template, \"'^...^'\", '^...^', ${\"${}\"}",
|
|
374
|
-
"parent_id": "ts-quote"
|
|
375
|
-
},
|
|
376
|
-
{
|
|
377
|
-
"id": "ts-quote/conditionals-ifif",
|
|
378
|
-
"title": "Template Syntax: Conditionals: `{#if}...{/if}`",
|
|
379
|
-
"category": "custom-macros",
|
|
380
|
-
"category_title": "Custom Macros",
|
|
381
|
-
"path": "custom-macros/ts-quote/conditionals-ifif.md",
|
|
382
|
-
"use_cases": "ts_quote, template",
|
|
383
|
-
"parent_id": "ts-quote"
|
|
384
|
-
},
|
|
385
|
-
{
|
|
386
|
-
"id": "ts-quote/pattern-matching-if-let",
|
|
387
|
-
"title": "Template Syntax: Pattern Matching: `{#if let}`",
|
|
388
|
-
"category": "custom-macros",
|
|
389
|
-
"category_title": "Custom Macros",
|
|
390
|
-
"path": "custom-macros/ts-quote/pattern-matching-if-let.md",
|
|
391
|
-
"use_cases": "ts_quote, template, option, result",
|
|
392
|
-
"parent_id": "ts-quote"
|
|
393
|
-
},
|
|
394
|
-
{
|
|
395
|
-
"id": "ts-quote/match-expressions-match",
|
|
396
|
-
"title": "Template Syntax: Match Expressions: `{#match}`",
|
|
397
|
-
"category": "custom-macros",
|
|
398
|
-
"category_title": "Custom Macros",
|
|
399
|
-
"path": "custom-macros/ts-quote/match-expressions-match.md",
|
|
400
|
-
"use_cases": "ts_quote, template, {#match}, match, \n\n**generates:**\n\n",
|
|
345
|
+
"path": "custom-macros/ts-quote/interpolation-expr.md",
|
|
346
|
+
"use_cases": "ts_quote, template, @{expr}, \n\n**generates:**\n\n",
|
|
401
347
|
"parent_id": "ts-quote"
|
|
402
348
|
},
|
|
403
349
|
{
|
|
@@ -419,21 +365,21 @@
|
|
|
419
365
|
"parent_id": "ts-quote"
|
|
420
366
|
},
|
|
421
367
|
{
|
|
422
|
-
"id": "ts-quote/
|
|
423
|
-
"title": "Template Syntax:
|
|
368
|
+
"id": "ts-quote/local-constants-let",
|
|
369
|
+
"title": "Template Syntax: Local Constants: `{$let}`",
|
|
424
370
|
"category": "custom-macros",
|
|
425
371
|
"category_title": "Custom Macros",
|
|
426
|
-
"path": "custom-macros/ts-quote/
|
|
427
|
-
"use_cases": "ts_quote, template, {$
|
|
372
|
+
"path": "custom-macros/ts-quote/local-constants-let.md",
|
|
373
|
+
"use_cases": "ts_quote, template, {$let}, :\n\n",
|
|
428
374
|
"parent_id": "ts-quote"
|
|
429
375
|
},
|
|
430
376
|
{
|
|
431
|
-
"id": "ts-quote/
|
|
432
|
-
"title": "Template Syntax:
|
|
377
|
+
"id": "ts-quote/side-effects-do",
|
|
378
|
+
"title": "Template Syntax: Side Effects: `{$do}`",
|
|
433
379
|
"category": "custom-macros",
|
|
434
380
|
"category_title": "Custom Macros",
|
|
435
|
-
"path": "custom-macros/ts-quote/
|
|
436
|
-
"use_cases": "ts_quote, template, {$
|
|
381
|
+
"path": "custom-macros/ts-quote/side-effects-do.md",
|
|
382
|
+
"use_cases": "ts_quote, template, {$do}",
|
|
437
383
|
"parent_id": "ts-quote"
|
|
438
384
|
},
|
|
439
385
|
{
|
|
@@ -456,17 +402,11 @@
|
|
|
456
402
|
"chunk_ids": [
|
|
457
403
|
"ts-quote/overview",
|
|
458
404
|
"ts-quote/quick-reference",
|
|
459
|
-
"ts-quote/
|
|
460
|
-
"ts-quote/comments-and",
|
|
461
|
-
"ts-quote/string-interpolation-text-expr",
|
|
462
|
-
"ts-quote/backtick-template-literals",
|
|
463
|
-
"ts-quote/conditionals-ifif",
|
|
464
|
-
"ts-quote/pattern-matching-if-let",
|
|
465
|
-
"ts-quote/match-expressions-match",
|
|
405
|
+
"ts-quote/interpolation-expr",
|
|
466
406
|
"ts-quote/iteration-for",
|
|
467
407
|
"ts-quote/while-loops-while",
|
|
408
|
+
"ts-quote/local-constants-let",
|
|
468
409
|
"ts-quote/side-effects-do",
|
|
469
|
-
"ts-quote/tsstream-injection-typescript",
|
|
470
410
|
"ts-quote/complete-example-json-derive-macro"
|
|
471
411
|
]
|
|
472
412
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@macroforge/mcp-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.32",
|
|
4
4
|
"description": "MCP server for Macroforge documentation and code analysis",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
"scripts": {
|
|
16
16
|
"build": "tsc && chmod +x dist/index.js",
|
|
17
17
|
"build:docs": "node scripts/extract-docs.cjs",
|
|
18
|
+
"clean": "rm -rf dist",
|
|
19
|
+
"cleanbuild": "npm run clean && npm run build",
|
|
18
20
|
"dev": "npx @modelcontextprotocol/inspector dist/index.js",
|
|
19
21
|
"start": "node dist/index.js",
|
|
20
22
|
"test": "node --test tests/**/*.test.js"
|
|
@@ -27,7 +29,7 @@
|
|
|
27
29
|
"typescript": "^5.7.0"
|
|
28
30
|
},
|
|
29
31
|
"peerDependencies": {
|
|
30
|
-
"macroforge": "^0.1.
|
|
32
|
+
"macroforge": "^0.1.32"
|
|
31
33
|
},
|
|
32
34
|
"peerDependenciesMeta": {
|
|
33
35
|
"macroforge": {
|