@macroforge/mcp-server 0.1.74 → 0.1.76

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.
@@ -75,6 +75,13 @@ Note
75
75
 
76
76
  The `import macro` comment tells Macroforge which package provides the macro.
77
77
 
78
+ ## Vite Dev Server
79
+
80
+ When using a custom macro package as a local `file:` dependency, you may need to configure Vite's
81
+ `server.fs.allow` and add `exports` to your package's `package.json` for dev mode to work. See the
82
+ [Vite Plugin integration guide](../integration/vite-plugin.md#custom-macro-packages-with-file-dependencies)
83
+ for details.
84
+
78
85
  ## Getting Started
79
86
 
80
87
  Follow these guides to create your own macros:
@@ -110,6 +110,46 @@ During development, the plugin:
110
110
  - Expands macros on save
111
111
  - Provides HMR support for expanded code
112
112
 
113
+ ### Custom Macro Packages with `file:` Dependencies
114
+
115
+ If your custom macro package is a local `file:` dependency (e.g. `"@my/macros": "file:./macros"`),
116
+ the expanded code may contain runtime imports pointing to files inside that package. Vite's dev
117
+ server restricts filesystem access to a set of allowed directories (`src/`, `.svelte-kit/`,
118
+ `node_modules/`, etc.), and local `file:` dependencies outside those paths will be blocked.
119
+
120
+ You must add the package directory to `server.fs.allow`:
121
+
122
+ vite.config.ts
123
+
124
+ ```
125
+ export default defineConfig({
126
+ plugins: [macroforge()],
127
+ server: {
128
+ fs: {
129
+ allow: ['macros'] // path to your local macro package
130
+ }
131
+ }
132
+ });
133
+ ```
134
+
135
+ The macro package also needs a `package.json` `exports` field so Vite can resolve subpath imports.
136
+ For example, if expanded code imports from `@my/macros/helpers`:
137
+
138
+ macros/package.json
139
+
140
+ ```
141
+ {
142
+ "name": "@my/macros",
143
+ "exports": {
144
+ ".": { "types": "./index.d.ts", "default": "./index.js" },
145
+ "./helpers": "./helpers.ts"
146
+ }
147
+ }
148
+ ```
149
+
150
+ Without this, Vite's dev server will fail with `Pre-transform error: Failed to load url ...` even
151
+ though the file exists on disk.
152
+
113
153
  ## Production Build
114
154
 
115
155
  During production builds, the plugin:
package/package.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "main": "dist/index.js",
26
26
  "name": "@macroforge/mcp-server",
27
27
  "peerDependencies": {
28
- "macroforge": "^0.1.74"
28
+ "macroforge": "^0.1.76"
29
29
  },
30
30
  "peerDependenciesMeta": {
31
31
  "macroforge": {
@@ -46,5 +46,5 @@
46
46
  "test": "node --test tests/**/*.test.js"
47
47
  },
48
48
  "type": "module",
49
- "version": "0.1.74"
49
+ "version": "0.1.76"
50
50
  }