@macroforge/mcp-server 0.1.33 → 0.1.35

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.
Files changed (50) hide show
  1. package/README.md +68 -0
  2. package/dist/index.d.ts +32 -0
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +46 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/tools/docs-loader.d.ts +133 -5
  7. package/dist/tools/docs-loader.d.ts.map +1 -1
  8. package/dist/tools/docs-loader.js +131 -15
  9. package/dist/tools/docs-loader.js.map +1 -1
  10. package/dist/tools/index.d.ts +48 -1
  11. package/dist/tools/index.d.ts.map +1 -1
  12. package/dist/tools/index.js +163 -14
  13. package/dist/tools/index.js.map +1 -1
  14. package/docs/api/api-overview.md +24 -46
  15. package/docs/api/expand-sync.md +24 -51
  16. package/docs/api/native-plugin.md +24 -56
  17. package/docs/api/position-mapper.md +34 -76
  18. package/docs/api/transform-sync.md +27 -59
  19. package/docs/builtin-macros/clone.md +45 -104
  20. package/docs/builtin-macros/debug.md +33 -104
  21. package/docs/builtin-macros/default.md +78 -114
  22. package/docs/builtin-macros/deserialize.md +93 -273
  23. package/docs/builtin-macros/hash.md +58 -100
  24. package/docs/builtin-macros/macros-overview.md +42 -103
  25. package/docs/builtin-macros/ord.md +65 -133
  26. package/docs/builtin-macros/partial-eq.md +53 -179
  27. package/docs/builtin-macros/partial-ord.md +67 -159
  28. package/docs/builtin-macros/serialize.md +64 -194
  29. package/docs/concepts/architecture.md +40 -99
  30. package/docs/concepts/derive-system.md +129 -125
  31. package/docs/concepts/how-macros-work.md +52 -84
  32. package/docs/custom-macros/custom-overview.md +17 -39
  33. package/docs/custom-macros/rust-setup.md +22 -55
  34. package/docs/custom-macros/ts-macro-derive.md +43 -107
  35. package/docs/custom-macros/ts-quote.md +177 -507
  36. package/docs/getting-started/first-macro.md +108 -33
  37. package/docs/getting-started/installation.md +32 -73
  38. package/docs/integration/cli.md +70 -156
  39. package/docs/integration/configuration.md +32 -75
  40. package/docs/integration/integration-overview.md +16 -55
  41. package/docs/integration/mcp-server.md +30 -69
  42. package/docs/integration/svelte-preprocessor.md +60 -83
  43. package/docs/integration/typescript-plugin.md +32 -74
  44. package/docs/integration/vite-plugin.md +30 -79
  45. package/docs/language-servers/ls-overview.md +22 -46
  46. package/docs/language-servers/svelte.md +30 -69
  47. package/docs/language-servers/zed.md +34 -72
  48. package/docs/roadmap/roadmap.md +54 -130
  49. package/docs/sections.json +3 -262
  50. package/package.json +2 -2
@@ -1,47 +1,23 @@
1
1
  # Language Servers
2
-
3
- *Macroforge provides language server integrations for enhanced IDE support beyond the TypeScript plugin.*
4
-
5
- <Alert type="warning" title="Work in Progress">
6
- Language server integrations are currently experimental. They work in the repository but are not yet published as official extensions. You'll need to fork the repo and install them as developer extensions.
7
- </Alert>
8
-
9
- ## Overview
10
-
11
- While the [TypeScript Plugin]({base}/docs/integration/typescript-plugin) provides macro support in any TypeScript-aware editor, dedicated language servers offer deeper integration for specific frameworks and editors.
12
-
13
- | [Svelte Language Server]({base}/docs/language-servers/svelte)
14
- | Full Svelte support with macroforge
15
- | Working (dev install)
16
-
17
- | [Zed Extensions]({base}/docs/language-servers/zed)
18
- | VTSLS and Svelte for Zed editor
19
- | Working (dev install)
20
-
21
- ## Current Status
22
-
23
- The language servers are functional and used during development of macroforge itself. However, they require manual installation:
24
-
25
- 1. Fork or clone the [macroforge-ts repository](https://github.com/rymskip/macroforge-ts)
26
-
27
- 2. Build the extension you need
28
-
29
- 3. Install it as a developer extension in your editor
30
-
31
- See the individual pages for detailed installation instructions.
32
-
33
- ## Roadmap
34
-
35
- We're working on official extension releases for:
36
-
37
- - VS Code (via VTSLS)
38
-
39
- - Zed (native extensions)
40
-
41
- - Other editors with LSP support
42
-
43
- ## Detailed Guides
44
-
45
- - [Svelte Language Server]({base}/docs/language-servers/svelte) - Full Svelte IDE support
46
-
47
- - [Zed Extensions]({base}/docs/language-servers/zed) - VTSLS and Svelte for Zed
2
+ *Macroforge provides language server integrations for enhanced IDE support beyond the TypeScript plugin.*
3
+ **Work in Progress Language server integrations are currently experimental. They work in the repository but are not yet published as official extensions. You'll need to fork the repo and install them as developer extensions. ## Overview
4
+ While the [TypeScript Plugin](../docs/integration/typescript-plugin) provides macro support in any TypeScript-aware editor, dedicated language servers offer deeper integration for specific frameworks and editors.
5
+ | Integration | Purpose | Status |
6
+ | --- | --- | --- |
7
+ | [Svelte Language Server](../docs/language-servers/svelte) | Full Svelte support with macroforge | Working (dev install) |
8
+ | [Zed Extensions](../docs/language-servers/zed) | VTSLS and Svelte for Zed editor | Working (dev install) |
9
+ ## Current Status
10
+ The language servers are functional and used during development of macroforge itself. However, they require manual installation:
11
+ 1. Fork or clone the [macroforge-ts repository](https://github.com/rymskip/macroforge-ts)
12
+ 2. Build the extension you need
13
+ 3. Install it as a developer extension in your editor
14
+ See the individual pages for detailed installation instructions.
15
+ ## Roadmap
16
+ We're working on official extension releases for:
17
+ - VS Code (via VTSLS)
18
+ - Zed (native extensions)
19
+ - Other editors with LSP support
20
+ ## Detailed Guides
21
+ - [Svelte Language Server](../docs/language-servers/svelte) - Full Svelte IDE support
22
+ - [Zed Extensions](../docs/language-servers/zed) - VTSLS and Svelte for Zed
23
+ **
@@ -1,80 +1,41 @@
1
1
  # Svelte Language Server
2
-
3
- *`@macroforge/svelte-language-server` provides full Svelte IDE support with macroforge integration.*
4
-
5
- <Alert type="warning" title="Developer Installation Required">
6
- This package is not yet published as an official extension. You'll need to build and install it manually.
7
- </Alert>
8
-
9
- ## Features
10
-
11
- - **Svelte syntax diagnostics** - Errors and warnings in .svelte files
12
-
13
- - **HTML support** - Hover info, autocompletions, Emmet, outline symbols
14
-
15
- - **CSS/SCSS/LESS** - Diagnostics, hover, completions, formatting, Emmet, color picking
16
-
17
- - **TypeScript/JavaScript** - Full language features with macroforge macro expansion
18
-
19
- - **Go-to-definition** - Navigate to macro-generated code
20
-
21
- - **Code actions** - Quick fixes and refactorings
22
-
23
- ## Installation
24
-
25
- ### 1. Clone the Repository
26
-
27
- ```bash
2
+ *`@macroforge/svelte-language-server` provides full Svelte IDE support with macroforge integration.*
3
+ **Developer Installation Required This package is not yet published as an official extension. You'll need to build and install it manually. ## Features
4
+ - **Svelte syntax diagnostics** - Errors and warnings in .svelte files
5
+ - **HTML support** - Hover info, autocompletions, Emmet, outline symbols
6
+ - **CSS/SCSS/LESS** - Diagnostics, hover, completions, formatting, Emmet, color picking
7
+ - **TypeScript/JavaScript** - Full language features with macroforge macro expansion
8
+ - **Go-to-definition** - Navigate to macro-generated code
9
+ - **Code actions** - Quick fixes and refactorings
10
+ ## Installation
11
+ ### 1. Clone the Repository
12
+ ```
28
13
  git clone https://github.com/rymskip/macroforge-ts.git
29
14
  cd macroforge-ts
30
- ```
31
-
32
- ### 2. Build the Language Server
33
-
34
- ```bash
15
+ ``` ### 2. Build the Language Server
16
+ ```
35
17
  # Install dependencies
36
18
  npm install
37
19
 
38
20
  # Build the Svelte language server
39
21
  cd packages/svelte-language-server
40
22
  npm run build
41
- ```
42
-
43
- ### 3. Configure Your Editor
44
-
45
- The language server exposes a `svelteserver` binary that implements the Language Server Protocol (LSP). Configure your editor to use it:
46
-
47
- ```bash
23
+ ``` ### 3. Configure Your Editor
24
+ The language server exposes a `svelteserver` binary that implements the Language Server Protocol (LSP). Configure your editor to use it:
25
+ ```
48
26
  # The binary is located at:
49
27
  ./packages/svelte-language-server/bin/server.js
50
- ```
51
-
52
- ## Package Info
53
-
54
- | Package
55
- | `@macroforge/svelte-language-server`
56
-
57
- | Version
58
- | 0.1.7
59
-
60
- | CLI Command
61
- | `svelteserver`
62
-
63
- | Node Version
64
- | >= 18.0.0
65
-
66
- ## How It Works
67
-
68
- The Svelte language server extends the standard Svelte language tooling with macroforge integration:
69
-
70
- 1. Parses `.svelte` files and extracts TypeScript/JavaScript blocks
71
-
72
- 2. Expands macros using the `@macroforge/typescript-plugin`
73
-
74
- 3. Maps diagnostics back to original source positions
75
-
76
- 4. Provides completions for macro-generated methods
77
-
78
- ## Using with Zed
79
-
80
- For Zed editor, see the [Zed Extensions]({base}/docs/language-servers/zed) page for the dedicated `svelte-macroforge` extension.
28
+ ``` ## Package Info
29
+ | Package | `@macroforge/svelte-language-server` |
30
+ | Version | 0.1.7 |
31
+ | CLI Command | `svelteserver` |
32
+ | Node Version | >= 18.0.0 |
33
+ ## How It Works
34
+ The Svelte language server extends the standard Svelte language tooling with macroforge integration:
35
+ 1. Parses `.svelte` files and extracts TypeScript/JavaScript blocks
36
+ 2. Expands macros using the `@macroforge/typescript-plugin`
37
+ 3. Maps diagnostics back to original source positions
38
+ 4. Provides completions for macro-generated methods
39
+ ## Using with Zed
40
+ For Zed editor, see the [Zed Extensions](../../docs/language-servers/zed) page for the dedicated `svelte-macroforge` extension.
41
+ **
@@ -1,84 +1,46 @@
1
1
  # Zed Extensions
2
-
3
- *Macroforge provides two extensions for the [Zed editor](https://zed.dev): one for TypeScript via VTSLS, and one for Svelte.*
4
-
5
- <Alert type="warning" title="Developer Installation Required">
6
- These extensions are not yet in the Zed extension registry. You'll need to install them as developer extensions.
7
- </Alert>
8
-
9
- ## Available Extensions
10
-
11
- | `vtsls-macroforge`
12
- | VTSLS with macroforge support for TypeScript
13
- | `crates/extensions/vtsls-macroforge`
14
-
15
- | `svelte-macroforge`
16
- | Svelte language support with macroforge
17
- | `crates/extensions/svelte-macroforge`
18
-
19
- ## Installation
20
-
21
- ### 1. Clone the Repository
22
-
23
- ```bash
2
+ *Macroforge provides two extensions for the [Zed editor](https://zed.dev): one for TypeScript via VTSLS, and one for Svelte.*
3
+ **Developer Installation Required These extensions are not yet in the Zed extension registry. You'll need to install them as developer extensions. ## Available Extensions
4
+ | Extension | Description | Location |
5
+ | --- | --- | --- |
6
+ | `vtsls-macroforge` | VTSLS with macroforge support for TypeScript | `crates/extensions/vtsls-macroforge` |
7
+ | `svelte-macroforge` | Svelte language support with macroforge | `crates/extensions/svelte-macroforge` |
8
+ ## Installation
9
+ ### 1. Clone the Repository
10
+ ```
24
11
  git clone https://github.com/rymskip/macroforge-ts.git
25
12
  cd macroforge-ts
26
- ```
27
-
28
- ### 2. Build the Extension
29
-
30
- Build the extension you want to use:
31
-
32
- ```bash
13
+ ``` ### 2. Build the Extension
14
+ Build the extension you want to use:
15
+ ```
33
16
  # For VTSLS (TypeScript)
34
17
  cd crates/extensions/vtsls-macroforge
35
18
 
36
19
  # Or for Svelte
37
20
  cd crates/extensions/svelte-macroforge
38
- ```
39
-
40
- ### 3. Install as Dev Extension in Zed
41
-
42
- In Zed, open the command palette and run **zed: install dev extension**, then select the extension directory.
43
-
44
- Alternatively, symlink the extension to your Zed extensions directory:
45
-
46
- ```bash
21
+ ``` ### 3. Install as Dev Extension in Zed
22
+ In Zed, open the command palette and run **zed: install dev extension**, then select the extension directory.
23
+ Alternatively, symlink the extension to your Zed extensions directory:
24
+ ```
47
25
  # macOS
48
- ln -s /path/to/macroforge-ts/crates/extensions/vtsls-macroforge ~/Library/Application\\ Support/Zed/extensions/installed/vtsls-macroforge
26
+ ln -s /path/to/macroforge-ts/crates/extensions/vtsls-macroforge ~/Library/Application\ Support/Zed/extensions/installed/vtsls-macroforge
49
27
 
50
28
  # Linux
51
29
  ln -s /path/to/macroforge-ts/crates/extensions/vtsls-macroforge ~/.config/zed/extensions/installed/vtsls-macroforge
52
- ```
53
-
54
- ## vtsls-macroforge
55
-
56
- This extension wraps [VTSLS](https://github.com/yioneko/vtsls) (a TypeScript language server) with macroforge integration. It provides:
57
-
58
- - Full TypeScript language features
59
-
60
- - Macro expansion at edit time
61
-
62
- - Accurate error positions in original source
63
-
64
- - Completions for macro-generated methods
65
-
66
- ## svelte-macroforge
67
-
68
- This extension provides Svelte support using the `@macroforge/svelte-language-server`. It includes:
69
-
70
- - Svelte component syntax support
71
-
72
- - HTML, CSS, and TypeScript features
73
-
74
- - Macroforge integration in script blocks
75
-
76
- ## Troubleshooting
77
-
78
- ### Extension not loading
79
-
80
- Make sure you've restarted Zed after installing the extension. Check the Zed logs for any error messages.
81
-
82
- ### Macros not expanding
83
-
84
- Ensure your project has the `macroforge` package installed and a valid `tsconfig.json` with the TypeScript plugin configured.
30
+ ``` ## vtsls-macroforge
31
+ This extension wraps [VTSLS](https://github.com/yioneko/vtsls) (a TypeScript language server) with macroforge integration. It provides:
32
+ - Full TypeScript language features
33
+ - Macro expansion at edit time
34
+ - Accurate error positions in original source
35
+ - Completions for macro-generated methods
36
+ ## svelte-macroforge
37
+ This extension provides Svelte support using the `@macroforge/svelte-language-server`. It includes:
38
+ - Svelte component syntax support
39
+ - HTML, CSS, and TypeScript features
40
+ - Macroforge integration in script blocks
41
+ ## Troubleshooting
42
+ ### Extension not loading
43
+ Make sure you've restarted Zed after installing the extension. Check the Zed logs for any error messages.
44
+ ### Macros not expanding
45
+ Ensure your project has the `macroforge` package installed and a valid `tsconfig.json` with the TypeScript plugin configured.
46
+ **
@@ -1,131 +1,55 @@
1
1
  # Roadmap
2
-
3
- *Planned features and improvements for Macroforge. This roadmap reflects our current priorities but may change based on community feedback.*
4
-
5
- ## IDE Extensions
6
-
7
- Bring Macroforge support directly into your favorite editors with native extensions.
8
-
9
- | VS Code / Cursor
10
- | Planned
11
- | Native extension with macro expansion preview, error highlighting, and completions
12
-
13
- | Zed
14
- | Available
15
- | Full support via vtsls-macroforge and svelte-macroforge extensions
16
-
17
- | Neovim
18
- | Considering
19
- | LSP integration for Neovim users
20
-
21
- | JetBrains (WebStorm)
22
- | Considering
23
- | Plugin for WebStorm and other JetBrains IDEs
24
-
25
- ## Framework Support
26
-
27
- Expanding Macroforge to work seamlessly with popular frontend frameworks.
28
-
29
- | Svelte / SvelteKit
30
- | Available
31
- | Full support via svelte-language-server and Vite plugin
32
-
33
- | React
34
- | Planned
35
- | React-specific macros and integration with React tooling
36
-
37
- | Vue
38
- | Planned
39
- | Vue SFC support and Vue-specific derive macros
40
-
41
- | Angular
42
- | Planned
43
- | Angular decorator integration and CLI support
44
-
45
- | Solid
46
- | Planned
47
- | SolidJS integration
48
-
49
- ## Pure TypeScript Macro Creation
50
-
51
- While Rust provides the best performance and type safety, we recognize that not everyone wants to write Rust. We're exploring options for writing macros in pure TypeScript.
52
-
53
- | TypeScript Macro API
54
- | Planned
55
- | Define macros using TypeScript with a simple API
56
-
57
- | Template Strings
58
- | Planned
59
- | Generate code using tagged template literals
60
-
61
- | AST Helpers
62
- | Planned
63
- | TypeScript utilities for working with the AST
64
-
65
- ## Built-in Macros
66
-
67
- Expanding the library of built-in derive macros.
68
-
69
- | Debug, Clone, PartialEq, Ord, Hash
70
- | Available
71
- | Core derive macros
72
-
73
- | Serialize, Deserialize
74
- | Available
75
- | JSON serialization with validation
76
-
77
- | Builder
78
- | Planned
79
- | Generate builder pattern for classes
80
-
81
- | Immutable
82
- | Considering
83
- | Generate immutable update methods (with, set)
84
-
85
- ## Distribution & Packaging
86
-
87
- Making it easier to publish and share custom macros.
88
-
89
- | Native Node Binaries
90
- | Available
91
- | Platform-specific binaries for maximum performance
92
-
93
- | WASM Binary Generation
94
- | Planned
95
- | Cross-platform WebAssembly binaries for easier macro distribution
96
-
97
- | Macro Registry
98
- | Considering
99
- | Central registry for discovering and sharing community macros
100
-
101
- ## Tooling & DX
102
-
103
- Improvements to the developer experience.
104
-
105
- | CLI Expansion
106
- | Available
107
- | Expand macros from the command line
108
-
109
- | Macro Playground
110
- | Planned
111
- | Web-based playground to test macros
112
-
113
- | create-macroforge
114
- | Planned
115
- | Scaffolding tool for new macro projects
116
-
117
- | Macro Debugging
118
- | Considering
119
- | Step-through debugging for macro expansion
120
-
121
- ## Contributing
122
-
123
- Interested in helping? We welcome contributions of all kinds:
124
-
125
- - Feature requests and feedback on [GitHub Issues](https://github.com/rymskip/macroforge-ts/issues)
126
-
127
- - Pull requests for new macros or improvements
128
-
129
- - Documentation improvements
130
-
131
- - Framework integrations
2
+ *Planned features and improvements for Macroforge. This roadmap reflects our current priorities but may change based on community feedback.*
3
+ ## IDE Extensions
4
+ Bring Macroforge support directly into your favorite editors with native extensions.
5
+ | Extension | Status | Description |
6
+ | --- | --- | --- |
7
+ | VS Code / Cursor | Planned | Native extension with macro expansion preview, error highlighting, and completions |
8
+ | Zed | Available | Full support via vtsls-macroforge and svelte-macroforge extensions |
9
+ | Neovim | Considering | LSP integration for Neovim users |
10
+ | JetBrains (WebStorm) | Considering | Plugin for WebStorm and other JetBrains IDEs |
11
+ ## Framework Support
12
+ Expanding Macroforge to work seamlessly with popular frontend frameworks.
13
+ | Framework | Status | Description |
14
+ | --- | --- | --- |
15
+ | Svelte / SvelteKit | Available | Full support via svelte-language-server and Vite plugin |
16
+ | React | Planned | React-specific macros and integration with React tooling |
17
+ | Vue | Planned | Vue SFC support and Vue-specific derive macros |
18
+ | Angular | Planned | Angular decorator integration and CLI support |
19
+ | Solid | Planned | SolidJS integration |
20
+ ## Pure TypeScript Macro Creation
21
+ While Rust provides the best performance and type safety, we recognize that not everyone wants to write Rust. We're exploring options for writing macros in pure TypeScript.
22
+ | Feature | Status | Description |
23
+ | --- | --- | --- |
24
+ | TypeScript Macro API | Planned | Define macros using TypeScript with a simple API |
25
+ | Template Strings | Planned | Generate code using tagged template literals |
26
+ | AST Helpers | Planned | TypeScript utilities for working with the AST |
27
+ ## Built-in Macros
28
+ Expanding the library of built-in derive macros.
29
+ | Macro | Status | Description |
30
+ | --- | --- | --- |
31
+ | Debug, Clone, PartialEq, Ord, Hash | Available | Core derive macros |
32
+ | Serialize, Deserialize | Available | JSON serialization with validation |
33
+ | Builder | Planned | Generate builder pattern for classes |
34
+ | Immutable | Considering | Generate immutable update methods (with, set) |
35
+ ## Distribution & Packaging
36
+ Making it easier to publish and share custom macros.
37
+ | Feature | Status | Description |
38
+ | --- | --- | --- |
39
+ | Native Node Binaries | Available | Platform-specific binaries for maximum performance |
40
+ | WASM Binary Generation | Planned | Cross-platform WebAssembly binaries for easier macro distribution |
41
+ | Macro Registry | Considering | Central registry for discovering and sharing community macros |
42
+ ## Tooling & DX
43
+ Improvements to the developer experience.
44
+ | Feature | Status | Description |
45
+ | --- | --- | --- |
46
+ | CLI Expansion | Available | Expand macros from the command line |
47
+ | Macro Playground | Planned | Web-based playground to test macros |
48
+ | create-macroforge | Planned | Scaffolding tool for new macro projects |
49
+ | Macro Debugging | Considering | Step-through debugging for macro expansion |
50
+ ## Contributing
51
+ Interested in helping? We welcome contributions of all kinds:
52
+ - Feature requests and feedback on [GitHub Issues](https://github.com/rymskip/macroforge-ts/issues)
53
+ - Pull requests for new macros or improvements
54
+ - Documentation improvements
55
+ - Framework integrations