gantry-web 0.2.0 → 0.3.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gantry-web",
3
- "version": "0.2.0",
3
+ "version": "0.3.2",
4
4
  "description": "Frontend half of the Gantry desktop app framework: window chrome, native bridge, Tea runtime, Vite plugin",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -0,0 +1,11 @@
1
+ import type { Plugin } from "vite";
2
+
3
+ export interface GantryPluginOptions {
4
+ /** App root relative to the Vite root (default ".."). */
5
+ appRoot?: string;
6
+ /** Go server port for the /api and /gantry/ws proxies (default: gantry.json "port", else 8330). */
7
+ goPort?: number;
8
+ }
9
+
10
+ export declare function gantry(opts?: GantryPluginOptions): Plugin;
11
+ export default gantry;
package/src/vite/index.js CHANGED
@@ -164,7 +164,22 @@ export function gantry(opts = {}) {
164
164
  // excluding it from prebundling keeps it in the normal
165
165
  // transform pipeline (plugin-react handles its tsx), and
166
166
  // deduping react avoids a second copy through the symlink.
167
- optimizeDeps: { exclude: ["gantry-web"] },
167
+ // Excluding it also hides its imports from the dep scanner, so
168
+ // deps reached only through gantry-web must be force-included:
169
+ // the CJS ones (react-dom/client) otherwise get served raw and
170
+ // lose their named exports, and lucide-react would waterfall
171
+ // one request per icon module.
172
+ optimizeDeps: {
173
+ exclude: ["gantry-web"],
174
+ include: [
175
+ "react",
176
+ "react-dom",
177
+ "react-dom/client",
178
+ "react/jsx-runtime",
179
+ "react/jsx-dev-runtime",
180
+ "lucide-react",
181
+ ],
182
+ },
168
183
  // dedupe makes imports inside the symlinked gantry-web source
169
184
  // resolve from the APP's node_modules (the package itself has
170
185
  // none) and guarantees a single React instance.