@helipod/vite 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/README.md +41 -0
  2. package/package.json +7 -7
package/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # @helipod/vite
2
+
3
+ Vite plugin for Helipod: `vite` alone serves your frontend and the Helipod backend on one browser origin — no manual proxy configuration, no CORS.
4
+
5
+ Unlike most Helipod packages, this one is installed directly (it is not part of the umbrella `helipod` package):
6
+
7
+ ```sh
8
+ bun add -D @helipod/vite # or: npm install -D @helipod/vite
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```ts
14
+ // vite.config.ts
15
+ import { defineConfig } from "vite";
16
+ import { helipod } from "@helipod/vite";
17
+
18
+ export default defineConfig({
19
+ plugins: [helipod()],
20
+ });
21
+ ```
22
+
23
+ Run `vite` and the plugin brings the backend up alongside the dev server. `/api` (including the `/api/sync` WebSocket), `/_dashboard`, and `/_admin` are served from the same origin as your app.
24
+
25
+ ## Modes
26
+
27
+ - `"proxy"` (default): spawns `helipod dev` as a child process on a free port and proxies the engine-owned path prefixes to it. Uses Node builtins only; the `@helipod/cli` peer dependency stays optional.
28
+ - `"embed"`: boots the engine inside Vite's own process as middleware plus a `/api/sync` WebSocket — no child process, no proxy hop. Requires `@helipod/cli` to be installed; reached via `helipod({ mode: "embed" })`.
29
+
30
+ ## Options
31
+
32
+ - `mode` — `"proxy"` | `"embed"` (default `"proxy"`).
33
+ - `functionsDir` — app functions directory (default `"helipod"`).
34
+ - Proxy mode: `port`, `command` (how to invoke the CLI), `args` (extra flags forwarded to `helipod dev`).
35
+ - Embed mode: `dataPath` (SQLite file, default `<root>/.helipod/dev.db`), `databaseUrl` (opt-in Postgres), `adminKey` (default: an ephemeral per-run key).
36
+
37
+ The child process is cleaned up when the Vite server closes or receives a signal.
38
+
39
+ Part of [Helipod](https://github.com/helipod-sh/helipod) — docs at https://helipod-six.vercel.app/docs
40
+
41
+ License: FSL-1.1-Apache-2.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helipod/vite",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "peerDependencies": {
21
21
  "vite": ">=5.0.0",
22
- "@helipod/cli": "0.1.0"
22
+ "@helipod/cli": "0.1.2"
23
23
  },
24
24
  "peerDependenciesMeta": {
25
25
  "@helipod/cli": {
@@ -27,11 +27,11 @@
27
27
  }
28
28
  },
29
29
  "devDependencies": {
30
- "@helipod/cli": "0.1.0",
31
- "@helipod/client": "0.1.0",
32
- "@helipod/executor": "0.1.0",
33
- "@helipod/id-codec": "0.1.0",
34
- "@helipod/values": "0.1.0",
30
+ "@helipod/cli": "0.1.2",
31
+ "@helipod/client": "0.1.2",
32
+ "@helipod/executor": "0.1.2",
33
+ "@helipod/id-codec": "0.1.2",
34
+ "@helipod/values": "0.1.2",
35
35
  "@types/node": "^22.10.5",
36
36
  "@types/ws": "^8.5.13",
37
37
  "tsup": "^8.3.5",