@macroforge/mcp-server 0.1.42 → 0.1.50

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 (71) hide show
  1. package/LICENSE +22 -0
  2. package/docs/BOOK.md +165 -0
  3. package/docs/api/api-overview.md +67 -48
  4. package/docs/api/expand-sync.md +88 -53
  5. package/docs/api/native-plugin.md +121 -71
  6. package/docs/api/position-mapper.md +115 -55
  7. package/docs/api/transform-sync.md +86 -60
  8. package/docs/builtin-macros/clone.md +0 -20
  9. package/docs/builtin-macros/debug.md +0 -23
  10. package/docs/builtin-macros/default.md +1 -40
  11. package/docs/builtin-macros/deserialize/example.md +8 -1416
  12. package/docs/builtin-macros/deserialize.md +8 -1416
  13. package/docs/builtin-macros/hash.md +0 -42
  14. package/docs/builtin-macros/macros-overview/detailed-documentation.md +13 -0
  15. package/docs/builtin-macros/macros-overview/enum-support.md +30 -0
  16. package/docs/builtin-macros/macros-overview/interface-support.md +28 -0
  17. package/docs/builtin-macros/macros-overview/overview.md +36 -0
  18. package/docs/builtin-macros/macros-overview/type-alias-support.md +62 -0
  19. package/docs/builtin-macros/macros-overview.md +171 -130
  20. package/docs/builtin-macros/ord.md +0 -25
  21. package/docs/builtin-macros/partial-eq.md +0 -84
  22. package/docs/builtin-macros/partial-ord.md +2 -32
  23. package/docs/builtin-macros/serialize.md +2 -62
  24. package/docs/concepts/architecture.md +125 -48
  25. package/docs/concepts/derive-system/built-in-vs-custom-macros.md +13 -0
  26. package/docs/concepts/derive-system/overview.md +200 -0
  27. package/docs/concepts/derive-system.md +157 -104
  28. package/docs/concepts/how-macros-work.md +98 -47
  29. package/docs/custom-macros/custom-overview.md +79 -57
  30. package/docs/custom-macros/rust-setup.md +138 -99
  31. package/docs/custom-macros/ts-macro-derive/accessing-field-data.md +40 -31
  32. package/docs/custom-macros/ts-macro-derive/adding-imports.md +14 -11
  33. package/docs/custom-macros/ts-macro-derive/attribute-options.md +20 -25
  34. package/docs/custom-macros/ts-macro-derive/complete-example.md +40 -38
  35. package/docs/custom-macros/ts-macro-derive/deriveinput-structure.md +49 -47
  36. package/docs/custom-macros/ts-macro-derive/function-signature.md +12 -0
  37. package/docs/custom-macros/ts-macro-derive/overview.md +9 -7
  38. package/docs/custom-macros/ts-macro-derive/parsing-input.md +20 -18
  39. package/docs/custom-macros/ts-macro-derive/returning-errors.md +15 -13
  40. package/docs/custom-macros/ts-macro-derive.md +322 -228
  41. package/docs/custom-macros/ts-quote/backtick-template-literals.md +19 -7
  42. package/docs/custom-macros/ts-quote/comments-and.md +56 -22
  43. package/docs/custom-macros/ts-quote/complete-example-json-derive-macro.md +89 -98
  44. package/docs/custom-macros/ts-quote/conditionals-ifif.md +35 -29
  45. package/docs/custom-macros/ts-quote/identifier-concatenation-content.md +30 -22
  46. package/docs/custom-macros/ts-quote/iteration-for.md +48 -40
  47. package/docs/custom-macros/ts-quote/local-constants-let.md +23 -21
  48. package/docs/custom-macros/ts-quote/match-expressions-match.md +46 -38
  49. package/docs/custom-macros/ts-quote/overview.md +5 -10
  50. package/docs/custom-macros/ts-quote/pattern-matching-iflet.md +39 -0
  51. package/docs/custom-macros/ts-quote/quick-reference.md +50 -129
  52. package/docs/custom-macros/ts-quote/side-effects-do.md +13 -78
  53. package/docs/custom-macros/ts-quote/string-interpolation-textexpr.md +36 -0
  54. package/docs/custom-macros/ts-quote/tsstream-injection-typescript.md +43 -35
  55. package/docs/custom-macros/ts-quote/while-loops-while.md +31 -23
  56. package/docs/custom-macros/ts-quote.md +800 -520
  57. package/docs/getting-started/first-macro.md +98 -71
  58. package/docs/getting-started/installation.md +109 -65
  59. package/docs/integration/cli.md +214 -105
  60. package/docs/integration/configuration.md +115 -72
  61. package/docs/integration/integration-overview.md +55 -18
  62. package/docs/integration/mcp-server.md +84 -43
  63. package/docs/integration/svelte-preprocessor.md +183 -126
  64. package/docs/integration/typescript-plugin.md +101 -53
  65. package/docs/integration/vite-plugin.md +116 -76
  66. package/docs/language-servers/ls-overview.md +37 -21
  67. package/docs/language-servers/svelte.md +69 -38
  68. package/docs/language-servers/zed.md +81 -44
  69. package/docs/roadmap/roadmap.md +75 -53
  70. package/docs/sections.json +1 -242
  71. package/package.json +27 -28
@@ -1,77 +1,117 @@
1
1
  # Vite Plugin
2
- *The Vite plugin provides build-time macro expansion, transforming your code during development and production builds.*
3
- ## Installation
4
- ```
5
- npm install -D @macroforge/vite-plugin
6
- ``` ## Configuration
7
- Add the plugin to your <code class="shiki-inline"><span class="line"><span style="--shiki-dark:#E1E4E8;--shiki-light:#24292E">vite.config.ts</code>:
8
- ```
9
- import&nbsp;macroforge&nbsp;from&nbsp;"@macroforge/vite-plugin";
10
- import&nbsp;&#123;&nbsp;defineConfig&nbsp;&#125;&nbsp;from&nbsp;"vite";
11
-
12
- export&nbsp;default&nbsp;defineConfig(&#123;
13
- &nbsp;&nbsp;plugins:&nbsp;[
14
- &nbsp;&nbsp;&nbsp;&nbsp;macroforge()
15
- &nbsp;&nbsp;]
16
- &#125;);
17
- ``` ## Options
18
- ```
19
- macroforge(&#123;
20
- &nbsp;&nbsp;//&nbsp;Generate&nbsp;.d.ts&nbsp;files&nbsp;for&nbsp;expanded&nbsp;code
21
- &nbsp;&nbsp;generateTypes:&nbsp;true,
22
-
23
- &nbsp;&nbsp;//&nbsp;Output&nbsp;directory&nbsp;for&nbsp;generated&nbsp;types
24
- &nbsp;&nbsp;typesOutputDir:&nbsp;".macroforge/types",
25
-
26
- &nbsp;&nbsp;//&nbsp;Emit&nbsp;metadata&nbsp;files&nbsp;for&nbsp;debugging
27
- &nbsp;&nbsp;emitMetadata:&nbsp;false,
28
-
29
- &nbsp;&nbsp;//&nbsp;Keep&nbsp;@derive&nbsp;decorators&nbsp;in&nbsp;output&nbsp;(for&nbsp;debugging)
30
- &nbsp;&nbsp;keepDecorators:&nbsp;false,
31
-
32
- &nbsp;&nbsp;//&nbsp;File&nbsp;patterns&nbsp;to&nbsp;process
33
- &nbsp;&nbsp;include:&nbsp;["**/*.ts",&nbsp;"**/*.tsx"],
34
- &nbsp;&nbsp;exclude:&nbsp;["node_modules/**"]
35
- &#125;)
36
- ``` ### Option Reference
37
- | Option | Type | Default | Description |
38
- | --- | --- | --- | --- |
39
- | generateTypes | boolean | true | Generate .d.ts files |
40
- | typesOutputDir | string | .macroforge/types | Where to write type files |
41
- | emitMetadata | boolean | false | Emit macro metadata files |
42
- | keepDecorators | boolean | false | Keep decorators in output |
43
- ## Framework Integration
44
- ### React (Vite)
45
- ```
46
- import&nbsp;macroforge&nbsp;from&nbsp;"@macroforge/vite-plugin";
47
- import&nbsp;react&nbsp;from&nbsp;"@vitejs/plugin-react";
48
- import&nbsp;&#123;&nbsp;defineConfig&nbsp;&#125;&nbsp;from&nbsp;"vite";
49
-
50
- export&nbsp;default&nbsp;defineConfig(&#123;
51
- &nbsp;&nbsp;plugins:&nbsp;[
52
- &nbsp;&nbsp;&nbsp;&nbsp;macroforge(),&nbsp;&nbsp;//&nbsp;Before&nbsp;React&nbsp;plugin
53
- &nbsp;&nbsp;&nbsp;&nbsp;react()
54
- &nbsp;&nbsp;]
55
- &#125;);
56
- ``` ### SvelteKit
57
- ```
58
- import&nbsp;macroforge&nbsp;from&nbsp;"@macroforge/vite-plugin";
59
- import&nbsp;&#123;&nbsp;sveltekit&nbsp;&#125;&nbsp;from&nbsp;"@sveltejs/kit/vite";
60
- import&nbsp;&#123;&nbsp;defineConfig&nbsp;&#125;&nbsp;from&nbsp;"vite";
61
-
62
- export&nbsp;default&nbsp;defineConfig(&#123;
63
- &nbsp;&nbsp;plugins:&nbsp;[
64
- &nbsp;&nbsp;&nbsp;&nbsp;macroforge(),&nbsp;&nbsp;//&nbsp;Before&nbsp;SvelteKit
65
- &nbsp;&nbsp;&nbsp;&nbsp;sveltekit()
66
- &nbsp;&nbsp;]
67
- &#125;);
68
- ``` > **Note:** Always place the Macroforge plugin before other framework plugins to ensure macros are expanded first. ## Development Server
69
- During development, the plugin:
70
- - Watches for file changes
71
- - Expands macros on save
72
- - Provides HMR support for expanded code
73
- ## Production Build
74
- During production builds, the plugin:
75
- - Expands all macros in the source files
76
- - Generates type declaration files
77
- - Strips <code class="shiki-inline"><span class="line"><span style="--shiki-dark:#E1E4E8;--shiki-light:#24292E">@derive</code> decorators from output
2
+
3
+ The Vite plugin provides build-time macro expansion, transforming your code during development and production builds.
4
+
5
+ ## Installation
6
+
7
+ Bash
8
+
9
+ ```
10
+ npm install -D @macroforge/vite-plugin
11
+ ```
12
+
13
+ ## Configuration
14
+
15
+ Add the plugin to your `vite.config.ts`:
16
+
17
+ vite.config.ts
18
+
19
+ ```
20
+ import macroforge from "@macroforge/vite-plugin";
21
+ import { defineConfig } from "vite";
22
+
23
+ export default defineConfig({
24
+   plugins: [
25
+     macroforge()
26
+   ]
27
+ });
28
+ ```
29
+
30
+ ## Options
31
+
32
+ TypeScript
33
+
34
+ ```
35
+ macroforge({
36
+   // Generate .d.ts files for expanded code
37
+   generateTypes: true,
38
+
39
+   // Output directory for generated types
40
+   typesOutputDir: ".macroforge/types",
41
+
42
+   // Emit metadata files for debugging
43
+   emitMetadata: false,
44
+
45
+   // Keep @derive decorators in output (for debugging)
46
+   keepDecorators: false,
47
+
48
+   // File patterns to process
49
+   include: ["**/*.ts", "**/*.tsx"],
50
+   exclude: ["node_modules/**"]
51
+ })
52
+ ```
53
+
54
+ ### Option Reference
55
+
56
+ | Option | Type | Default | Description |
57
+ | ---------------- | --------- | ------------------- | ------------------------- |
58
+ | `generateTypes` | `boolean` | `true` | Generate .d.ts files |
59
+ | `typesOutputDir` | `string` | `.macroforge/types` | Where to write type files |
60
+ | `emitMetadata` | `boolean` | `false` | Emit macro metadata files |
61
+ | `keepDecorators` | `boolean` | `false` | Keep decorators in output |
62
+
63
+ ## Framework Integration
64
+
65
+ ### React (Vite)
66
+
67
+ vite.config.ts
68
+
69
+ ```
70
+ import macroforge from "@macroforge/vite-plugin";
71
+ import react from "@vitejs/plugin-react";
72
+ import { defineConfig } from "vite";
73
+
74
+ export default defineConfig({
75
+   plugins: [
76
+     macroforge(),  // Before React plugin
77
+     react()
78
+   ]
79
+ });
80
+ ```
81
+
82
+ ### SvelteKit
83
+
84
+ vite.config.ts
85
+
86
+ ```
87
+ import macroforge from "@macroforge/vite-plugin";
88
+ import { sveltekit } from "@sveltejs/kit/vite";
89
+ import { defineConfig } from "vite";
90
+
91
+ export default defineConfig({
92
+   plugins: [
93
+     macroforge(),  // Before SvelteKit
94
+     sveltekit()
95
+   ]
96
+ });
97
+ ```
98
+
99
+ Note
100
+
101
+ Always place the Macroforge plugin before other framework plugins to ensure macros are expanded first.
102
+
103
+ ## Development Server
104
+
105
+ During development, the plugin:
106
+
107
+ * Watches for file changes
108
+ * Expands macros on save
109
+ * Provides HMR support for expanded code
110
+
111
+ ## Production Build
112
+
113
+ During production builds, the plugin:
114
+
115
+ * Expands all macros in the source files
116
+ * Generates type declaration files
117
+ * Strips `@derive` decorators from output
@@ -1,23 +1,39 @@
1
1
  # Language Servers
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
- | --- | --- | --- |
2
+
3
+ Macroforge provides language server integrations for enhanced IDE support beyond the TypeScript plugin.
4
+
5
+ Work in Progress
6
+
7
+ 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.
8
+
9
+ ## Overview
10
+
11
+ 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.
12
+
13
+ | Integration | Purpose | Status |
14
+ | --------------------------------------------------------- | ----------------------------------- | --------------------- |
7
15
  | [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
- **
16
+ | [Zed Extensions](../docs/language-servers/zed) | VTSLS and Svelte for Zed editor | Working (dev install) |
17
+
18
+ ## Current Status
19
+
20
+ The language servers are functional and used during development of macroforge itself. However, they require manual installation:
21
+
22
+ 1. Fork or clone the [macroforge-ts repository](https://github.com/rymskip/macroforge-ts)
23
+ 2. Build the extension you need
24
+ 3. Install it as a developer extension in your editor
25
+
26
+ See the individual pages for detailed installation instructions.
27
+
28
+ ## Roadmap
29
+
30
+ We're working on official extension releases for:
31
+
32
+ * VS Code (via VTSLS)
33
+ * Zed (native extensions)
34
+ * Other editors with LSP support
35
+
36
+ ## Detailed Guides
37
+
38
+ * [Svelte Language Server](../docs/language-servers/svelte) - Full Svelte IDE support
39
+ * [Zed Extensions](../docs/language-servers/zed) - VTSLS and Svelte for Zed
@@ -1,40 +1,71 @@
1
1
  # Svelte Language Server
2
- *<code class="shiki-inline"><span class="line"><span style="--shiki-dark:#E1E4E8;--shiki-light:#24292E">@macroforge<span style="--shiki-dark:#F97583;--shiki-light:#D73A49">/<span style="--shiki-dark:#E1E4E8;--shiki-light:#24292E">svelte<span style="--shiki-dark:#F97583;--shiki-light:#D73A49">-<span style="--shiki-dark:#E1E4E8;--shiki-light:#24292E">language<span style="--shiki-dark:#F97583;--shiki-light:#D73A49">-<span style="--shiki-dark:#E1E4E8;--shiki-light:#24292E">server</code> 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
- ```
13
- git&nbsp;clone&nbsp;https://github.com/rymskip/macroforge-ts.git
14
- cd&nbsp;macroforge-ts
15
- ``` ### 2. Build the Language Server
16
- ```
17
- #&nbsp;Install&nbsp;dependencies
18
- npm&nbsp;install
19
-
20
- #&nbsp;Build&nbsp;the&nbsp;Svelte&nbsp;language&nbsp;server
21
- cd&nbsp;packages/svelte-language-server
22
- npm&nbsp;run&nbsp;build
23
- ``` ### 3. Configure Your Editor
24
- The language server exposes a **<code class="shiki-inline"><span class="line"><span style="--shiki-dark:#E1E4E8;--shiki-light:#24292E">svelteserver</code> binary that implements the Language Server Protocol (LSP). Configure your editor to use it:
25
- ```
26
- #&nbsp;The&nbsp;binary&nbsp;is&nbsp;located&nbsp;at:
2
+
3
+ `@macroforge/svelte-language-server` provides full Svelte IDE support with macroforge integration.
4
+
5
+ Developer Installation Required
6
+
7
+ This package is not yet published as an official extension. You'll need to build and install it manually.
8
+
9
+ ## Features
10
+
11
+ * **Svelte syntax diagnostics** - Errors and warnings in .svelte files
12
+ * **HTML support** - Hover info, autocompletions, Emmet, outline symbols
13
+ * **CSS/SCSS/LESS** - Diagnostics, hover, completions, formatting, Emmet, color picking
14
+ * **TypeScript/JavaScript** - Full language features with macroforge macro expansion
15
+ * **Go-to-definition** - Navigate to macro-generated code
16
+ * **Code actions** - Quick fixes and refactorings
17
+
18
+ ## Installation
19
+
20
+ ### 1\. Clone the Repository
21
+
22
+ Bash
23
+
24
+ ```
25
+ git clone https://github.com/rymskip/macroforge-ts.git
26
+ cd macroforge-ts
27
+ ```
28
+
29
+ ### 2\. Build the Language Server
30
+
31
+ Bash
32
+
33
+ ```
34
+ # Install dependencies
35
+ npm install
36
+
37
+ # Build the Svelte language server
38
+ cd packages/svelte-language-server
39
+ npm run build
40
+ ```
41
+
42
+ ### 3\. Configure Your Editor
43
+
44
+ The language server exposes a `svelteserver` binary that implements the Language Server Protocol (LSP). Configure your editor to use it:
45
+
46
+ Bash
47
+
48
+ ```
49
+ # The binary is located at:
27
50
  ./packages/svelte-language-server/bin/server.js
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 <code class="shiki-inline"><span class="line"><span style="--shiki-dark:#E1E4E8;--shiki-light:#24292E">.svelte</code> files and extracts TypeScript/JavaScript blocks
36
- 2. Expands macros using the <code class="shiki-inline"><span class="line"><span style="--shiki-dark:#E1E4E8;--shiki-light:#24292E">@macroforge<span style="--shiki-dark:#F97583;--shiki-light:#D73A49">/<span style="--shiki-dark:#E1E4E8;--shiki-light:#24292E">typescript<span style="--shiki-dark:#F97583;--shiki-light:#D73A49">-<span style="--shiki-dark:#E1E4E8;--shiki-light:#24292E">plugin</code>
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 <code class="shiki-inline"><span class="line"><span style="--shiki-dark:#E1E4E8;--shiki-light:#24292E">svelte<span style="--shiki-dark:#F97583;--shiki-light:#D73A49">-<span style="--shiki-dark:#E1E4E8;--shiki-light:#24292E">macroforge</code> extension.
51
+ ```
52
+
53
+ ## Package Info
54
+
55
+ | Package | `@macroforge/svelte-language-server` |
56
+ | Version | 0.1.7 |
57
+ | CLI Command | `svelteserver` |
58
+ | Node Version | \>= 18.0.0 |
59
+
60
+ ## How It Works
61
+
62
+ The Svelte language server extends the standard Svelte language tooling with macroforge integration:
63
+
64
+ 1. Parses `.svelte` files and extracts TypeScript/JavaScript blocks
65
+ 2. Expands macros using the `@macroforge/typescript-plugin`
66
+ 3. Maps diagnostics back to original source positions
67
+ 4. Provides completions for macro-generated methods
68
+
69
+ ## Using with Zed
70
+
71
+ For Zed editor, see the [Zed Extensions](../../docs/language-servers/zed) page for the dedicated `svelte-macroforge` extension.
@@ -1,45 +1,82 @@
1
1
  # Zed Extensions
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
- ```
11
- git&nbsp;clone&nbsp;https://github.com/rymskip/macroforge-ts.git
12
- cd&nbsp;macroforge-ts
13
- ``` ### 2. Build the Extension
14
- Build the extension you want to use:
15
- ```
16
- #&nbsp;For&nbsp;VTSLS&nbsp;(TypeScript)
17
- cd&nbsp;crates/extensions/vtsls-macroforge
18
-
19
- #&nbsp;Or&nbsp;for&nbsp;Svelte
20
- cd&nbsp;crates/extensions/svelte-macroforge
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
- ```
25
- #&nbsp;macOS
26
- ln&nbsp;-s&nbsp;/path/to/macroforge-ts/crates/extensions/vtsls-macroforge&nbsp;~/Library/Application\\&nbsp;Support/Zed/extensions/installed/vtsls-macroforge
27
-
28
- #&nbsp;Linux
29
- ln&nbsp;-s&nbsp;/path/to/macroforge-ts/crates/extensions/vtsls-macroforge&nbsp;~/.config/zed/extensions/installed/vtsls-macroforge
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 **<code class="shiki-inline"><span class="line"><span style="--shiki-dark:#E1E4E8;--shiki-light:#24292E">@macroforge<span style="--shiki-dark:#F97583;--shiki-light:#D73A49">/<span style="--shiki-dark:#E1E4E8;--shiki-light:#24292E">svelte<span style="--shiki-dark:#F97583;--shiki-light:#D73A49">-<span style="--shiki-dark:#E1E4E8;--shiki-light:#24292E">language<span style="--shiki-dark:#F97583;--shiki-light:#D73A49">-<span style="--shiki-dark:#E1E4E8;--shiki-light:#24292E">server</code>. 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 <code class="shiki-inline"><span class="line"><span style="--shiki-dark:#E1E4E8;--shiki-light:#24292E">macroforge</code> package installed and a valid <code class="shiki-inline"><span class="line"><span style="--shiki-dark:#E1E4E8;--shiki-light:#24292E">tsconfig.json</code> with the TypeScript plugin configured.
2
+
3
+ Macroforge provides two extensions for the [Zed editor](https://zed.dev): one for TypeScript via VTSLS, and one for Svelte.
4
+
5
+ Developer Installation Required
6
+
7
+ These extensions are not yet in the Zed extension registry. You'll need to install them as developer extensions.
8
+
9
+ ## Available Extensions
10
+
11
+ | Extension | Description | Location |
12
+ | ------------------- | -------------------------------------------- | ------------------------------------- |
13
+ | `vtsls-macroforge` | VTSLS with macroforge support for TypeScript | `crates/extensions/vtsls-macroforge` |
14
+ | `svelte-macroforge` | Svelte language support with macroforge | `crates/extensions/svelte-macroforge` |
15
+
16
+ ## Installation
17
+
18
+ ### 1\. Clone the Repository
19
+
20
+ Bash
21
+
22
+ ```
23
+ git clone https://github.com/rymskip/macroforge-ts.git
24
+ cd macroforge-ts
25
+ ```
26
+
27
+ ### 2\. Build the Extension
28
+
29
+ Build the extension you want to use:
30
+
31
+ Bash
32
+
33
+ ```
34
+ # For VTSLS (TypeScript)
35
+ cd crates/extensions/vtsls-macroforge
36
+
37
+ # Or for Svelte
38
+ cd crates/extensions/svelte-macroforge
39
+ ```
40
+
41
+ ### 3\. Install as Dev Extension in Zed
42
+
43
+ In Zed, open the command palette and run **zed: install dev extension**, then select the extension directory.
44
+
45
+ Alternatively, symlink the extension to your Zed extensions directory:
46
+
47
+ Bash
48
+
49
+ ```
50
+ # macOS
51
+ ln -s /path/to/macroforge-ts/crates/extensions/vtsls-macroforge ~/Library/Application\\ Support/Zed/extensions/installed/vtsls-macroforge
52
+
53
+ # Linux
54
+ ln -s /path/to/macroforge-ts/crates/extensions/vtsls-macroforge ~/.config/zed/extensions/installed/vtsls-macroforge
55
+ ```
56
+
57
+ ## vtsls-macroforge
58
+
59
+ This extension wraps [VTSLS](https://github.com/yioneko/vtsls) (a TypeScript language server) with macroforge integration. It provides:
60
+
61
+ * Full TypeScript language features
62
+ * Macro expansion at edit time
63
+ * Accurate error positions in original source
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
+ * HTML, CSS, and TypeScript features
72
+ * Macroforge integration in script blocks
73
+
74
+ ## Troubleshooting
75
+
76
+ ### Extension not loading
77
+
78
+ Make sure you've restarted Zed after installing the extension. Check the Zed logs for any error messages.
79
+
80
+ ### Macros not expanding
81
+
82
+ Ensure your project has the `macroforge` package installed and a valid `tsconfig.json` with the TypeScript plugin configured.
@@ -1,55 +1,77 @@
1
1
  # Roadmap
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
- | --- | --- | --- |
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
+ | Extension | Status | Description |
10
+ | -------------------- | ----------- | ---------------------------------------------------------------------------------- |
11
+ | VS Code / Cursor | Planned | Native extension with macro expansion preview, error highlighting, and completions |
12
+ | Zed | Available | Full support via vtsls-macroforge and svelte-macroforge extensions |
13
+ | Neovim | Considering | LSP integration for Neovim users |
14
+ | JetBrains (WebStorm) | Considering | Plugin for WebStorm and other JetBrains IDEs |
15
+
16
+ ## Framework Support
17
+
18
+ Expanding Macroforge to work seamlessly with popular frontend frameworks.
19
+
20
+ | Framework | Status | Description |
21
+ | ------------------ | --------- | -------------------------------------------------------- |
22
+ | Svelte / SvelteKit | Available | Full support via svelte-language-server and Vite plugin |
23
+ | React | Planned | React-specific macros and integration with React tooling |
24
+ | Vue | Planned | Vue SFC support and Vue-specific derive macros |
25
+ | Angular | Planned | Angular decorator integration and CLI support |
26
+ | Solid | Planned | SolidJS integration |
27
+
28
+ ## Pure TypeScript Macro Creation
29
+
30
+ 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.
31
+
32
+ | Feature | Status | Description |
33
+ | -------------------- | ------- | ------------------------------------------------ |
24
34
  | 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
35
+ | Template Strings | Planned | Generate code using tagged template literals |
36
+ | AST Helpers | Planned | TypeScript utilities for working with the AST |
37
+
38
+ ## Built-in Macros
39
+
40
+ Expanding the library of built-in derive macros.
41
+
42
+ | Macro | Status | Description |
43
+ | ---------------------------------- | ----------- | --------------------------------------------- |
44
+ | Debug, Clone, PartialEq, Ord, Hash | Available | Core derive macros |
45
+ | Serialize, Deserialize | Available | JSON serialization with validation |
46
+ | Builder | Planned | Generate builder pattern for classes |
47
+ | Immutable | Considering | Generate immutable update methods (with, set) |
48
+
49
+ ## Distribution & Packaging
50
+
51
+ Making it easier to publish and share custom macros.
52
+
53
+ | Feature | Status | Description |
54
+ | ---------------------- | ----------- | ----------------------------------------------------------------- |
55
+ | Native Node Binaries | Available | Platform-specific binaries for maximum performance |
56
+ | WASM Binary Generation | Planned | Cross-platform WebAssembly binaries for easier macro distribution |
57
+ | Macro Registry | Considering | Central registry for discovering and sharing community macros |
58
+
59
+ ## Tooling & DX
60
+
61
+ Improvements to the developer experience.
62
+
63
+ | Feature | Status | Description |
64
+ | ----------------- | ----------- | ------------------------------------------ |
65
+ | CLI Expansion | Available | Expand macros from the command line |
66
+ | Macro Playground | Planned | Web-based playground to test macros |
67
+ | create-macroforge | Planned | Scaffolding tool for new macro projects |
68
+ | Macro Debugging | Considering | Step-through debugging for macro expansion |
69
+
70
+ ## Contributing
71
+
72
+ Interested in helping? We welcome contributions of all kinds:
73
+
74
+ * Feature requests and feedback on [GitHub Issues](https://github.com/rymskip/macroforge-ts/issues)
75
+ * Pull requests for new macros or improvements
76
+ * Documentation improvements
77
+ * Framework integrations