spacefn-docs 0.11.0 → 0.11.1

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.
@@ -26,9 +26,10 @@ Commit `.env.example` only: the scaffolded `.gitignore` keeps every other `.env`
26
26
 
27
27
  Besides your own, spacefn reads a few:
28
28
 
29
- | Variable | What it's for |
30
- | ---------------------------------------------- | --------------------------------------------------- |
31
- | `DB_<NAME>_URL`, `DB_<NAME>_AUTH_TOKEN` | a libSQL database: Turso, `sqld`, or a `file:` |
32
- | `SPACE_STATE_URL`, `SPACE_STATE_AUTH_TOKEN` | the state database on Bun |
33
- | `OTEL_EXPORTER_OTLP_ENDPOINT`, `_HEADERS` | where traces, logs and metrics go |
34
- | `PORT`, `HOST`, `SPACE_DATA_DIR`, `SPACE_ROLE` | the Bun server; see [Bun](../5-deployment/2-bun.md) |
29
+ | Variable | What it's for |
30
+ | ---------------------------------------------- | ----------------------------------------------------------------------------------- |
31
+ | `DB_<NAME>_URL`, `DB_<NAME>_AUTH_TOKEN` | a libSQL database: Turso, `sqld`, or a `file:` |
32
+ | `SPACE_STATE_URL`, `SPACE_STATE_AUTH_TOKEN` | the state database on Bun |
33
+ | `OTEL_EXPORTER_OTLP_ENDPOINT`, `_HEADERS` | where traces, logs and metrics go |
34
+ | `PORT`, `HOST`, `SPACE_DATA_DIR`, `SPACE_ROLE` | the Bun server; see [Bun](../5-deployment/2-bun.md) |
35
+ | `SPACE_DEV_PORT` | `space dev --port` on Cloudflare; see [Cloudflare](../5-deployment/1-cloudflare.md) |
@@ -34,4 +34,4 @@ The app's name, scripts, dependencies, and the `#` imports that every tool reads
34
34
  - **`imports`** are Node's [subpath imports](https://nodejs.org/api/packages.html#subpath-imports): Node, TypeScript, Vite, Vitest and Bun all read them, so nothing else needs configuring. Add one for a folder of your own, such as `"#ui/*": "./src/ui/*"`.
35
35
  - **`postinstall`** runs `space gen`, so `.space/` exists after `npm install`, in CI too.
36
36
 
37
- The dependencies are `spacefn` and `effect`; the dev dependencies Vite, Vitest, TypeScript, Alchemy and its provider for the target, and `spacefn-docs`, which holds these docs and the examples, for you and your agents to read in `node_modules/spacefn-docs/`. `space upgrade` updates spacefn, its provider and the docs together.
37
+ The dependencies are `spacefn` and `effect`; the dev dependencies Vite, Vitest, TypeScript, Alchemy and its provider for the target, and `spacefn-docs`, which holds these docs and the examples, for you and your agents to read in `node_modules/spacefn-docs/`. [`space upgrade`](../7-reference/2-cli.md#upgrading) updates spacefn, the docs, Alchemy and what they need newer together.
@@ -10,7 +10,7 @@ On Cloudflare, one Worker serves the pages and routes, consumes the queues and r
10
10
  space deploy
11
11
  ```
12
12
 
13
- The first deploy asks you to sign in to Cloudflare in the browser. In CI, set `CLOUDFLARE_API_TOKEN` and `CLOUDFLARE_ACCOUNT_ID` instead; see [CI/CD](4-ci-cd.md).
13
+ The first deploy asks you to sign in to Cloudflare in the browser. In CI, set `CLOUDFLARE_API_TOKEN` and `CLOUDFLARE_ACCOUNT_ID` instead; see [CI/CD](4-ci-cd.md). To deploy on push from the Cloudflare dashboard, see [Cloudflare dashboard](4-ci-cd.md#cloudflare-dashboard).
14
14
 
15
15
  ## What it creates
16
16
 
@@ -48,6 +48,20 @@ const worker =
48
48
 
49
49
  `space dev` runs the same stack with `alchemy dev`: the Worker in workerd, with local D1, KV, R2, queues, Durable Objects and workflows. No account is needed, and the local state stays on your machine.
50
50
 
51
+ It serves on port 1337, or the next free one. `space dev --port 3000` sets `SPACE_DEV_PORT`, which `configs/infra.ts` gives to the Worker; that port must be free:
52
+
53
+ ```ts [configs/infra.ts]
54
+ const devPort = process.env.SPACE_DEV_PORT;
55
+ const worker =
56
+ yield *
57
+ Cloudflare.Website.Vite("Worker", {
58
+ // ...
59
+ dev: devPort ? { port: Number(devPort), strictPort: true } : undefined,
60
+ });
61
+ ```
62
+
63
+ An app made with spacefn 0.11.0 or earlier doesn't have these lines yet. Add them to use `--port`; until then `space dev --port` says they're missing.
64
+
51
65
  ## Things to know
52
66
 
53
67
  - **D1 has no transactions.** spacefn runs a migration, or other atomic work, as one batch.
@@ -20,11 +20,59 @@ npx space deploy --stage prod --yes
20
20
  On your machine, the first deploy signs you in through the browser. CI can't, so give it an API token:
21
21
 
22
22
  1. In the Cloudflare dashboard, **My Profile → API Tokens → Create Token**, start from the **Edit Cloudflare Workers** template.
23
- 2. Add the permissions for what the app uses: **D1**, **Queues**, **Workers R2 Storage** and **Workers KV Storage**, all **Edit**.
24
- 3. Store it as `CLOUDFLARE_API_TOKEN` in the CI's secrets, and your account's ID (on the dashboard's overview) as `CLOUDFLARE_ACCOUNT_ID`.
23
+ 2. Keep what the template has, and add:
24
+
25
+ | Permission | For |
26
+ | --------------------------------- | ------------------------------------------------------ |
27
+ | Account → **Secrets Store: Edit** | every app: the key to Alchemy's deploy state |
28
+ | Account → **D1: Edit** | D1 databases, as the scaffolded app has |
29
+ | Account → **Queues: Edit** | `app/queues/` |
30
+ | Zone → **Zone: Read** | a [domain](1-cloudflare.md#a-domain), to find its zone |
31
+
32
+ Secrets Store needs **Edit** even to read the key: Alchemy reads it through a temporary Worker bound to it.
33
+
34
+ 3. Under **Account Resources** pick the account, and under **Zone Resources** its zones.
35
+ 4. Store the token as `CLOUDFLARE_API_TOKEN` in the CI's secrets, and your account's ID (on the **Workers & Pages** overview) as `CLOUDFLARE_ACCOUNT_ID`.
25
36
 
26
37
  Alchemy keeps the deploy state in the account too, so CI and your machine see the same deploys and either can deploy next.
27
38
 
39
+ ## Cloudflare dashboard
40
+
41
+ [Workers Builds](https://developers.cloudflare.com/workers/ci-cd/builds/) deploys on every push to a branch, from a repository you link in the dashboard. The app needs no Wrangler file: you replace the default `npx wrangler deploy` with `space deploy`.
42
+
43
+ 1. Deploy once from your machine, with the production values in `.env.prod`, so the Worker exists:
44
+
45
+ ```sh
46
+ npx space deploy --stage prod
47
+ ```
48
+
49
+ 2. In **Workers & Pages**, open that Worker, named like `<app>-worker-prod-<id>`, then **Settings → Builds → Connect**, and pick the repository. Don't use **Create application**: Alchemy names the Worker itself, so you'd get a second, unused one.
50
+
51
+ 3. Set the build:
52
+
53
+ | Setting | Value |
54
+ | ------------------ | -------------------------------------------------------------------------------------------------------------- |
55
+ | **Git branch** | `main` |
56
+ | **Build command** | `npm test`, or empty: the deploy builds the app |
57
+ | **Deploy command** | `npx space deploy --stage prod --yes` |
58
+ | **Preview builds** | off: their default, `wrangler preview`, needs a Wrangler file |
59
+ | **Root directory** | the app's folder, if it isn't the repository's root |
60
+ | **API token** | the token from [Cloudflare credentials](#cloudflare-credentials), not a generated one, which lacks permissions |
61
+
62
+ 4. Under **Build variables and secrets**, add:
63
+
64
+ - `CLOUDFLARE_ACCOUNT_ID`, and `CLOUDFLARE_API_TOKEN` as a secret, with the same token;
65
+ - what `.env.prod` has, as it isn't committed: the fields of `configs/env.ts`, and any `DB_<NAME>_*` and `OTEL_*` variables, with secrets as secrets.
66
+
67
+ 5. Push to `main`. The build installs the dependencies, which runs `space gen`, then runs the two commands.
68
+
69
+ > [!WARNING]
70
+ > Change the app's variables in **Build variables and secrets**, then deploy again. A deploy doesn't read the Worker's own **Variables and Secrets**, and replaces the plain variables set there.
71
+
72
+ For another stage, such as `staging`, do the same with that stage's Worker, its branch and `--stage staging`. For a stage per pull request, use [GitHub Actions](#a-stage-per-pull-request): Workers Builds has no step to destroy a stage when the pull request closes.
73
+
74
+ Workers Builds has its own default versions of Node and the package managers. If installing fails there but works on your machine, pin yours with `packageManager` in `package.json` and a `.node-version` file.
75
+
28
76
  ## GitHub
29
77
 
30
78
  Deploy `main` to `prod` after the tests pass:
@@ -15,10 +15,28 @@ icon: terminal-2
15
15
  | `space gen [--watch] [--prod]` | Writes `.space/` from `app/` and `configs/`. `--prod` takes `.prod.ts` files instead of `.dev.ts`. |
16
16
  | `space db status\|migrate\|rollback [--db name] [--steps N]` | Migrations of libSQL databases. See [Database](../6-guides/5-database.md). |
17
17
  | `space doctor` | Checks Node, the config, `.space/`, the target's tools, the bindings in `configs/infra.ts` and `configs/env.ts`, and says what to fix. |
18
- | `space upgrade` | Updates spacefn, its Alchemy provider and `spacefn-docs`, then regenerates. |
18
+ | `space upgrade` | Updates spacefn and what moves with it, then regenerates. See [Upgrading](#upgrading). |
19
19
  | `space docs [--port N]` | Serves your `docs/` and spacefn's docs at `http://localhost:4321/`. `space dev` serves them too, at `/__space/docs/`. See [Writing docs](3-writing-docs.md). |
20
20
  | `space clean` | Deletes generated files and builds. Keeps local data. |
21
21
 
22
+ ## Upgrading
23
+
24
+ `space upgrade` reads the latest release from the registry, prints each change as `old → new`, and installs them at once with the app's package manager:
25
+
26
+ | Package | Moves to |
27
+ | --------------------------- | ---------------------------------------------- |
28
+ | `spacefn`, `spacefn-docs` | the latest release |
29
+ | `alchemy` and its providers | the exact version that release is built on |
30
+ | `effect`, `vite` | what that release needs, if the app's is older |
31
+ | everything else | stays: the app's choice |
32
+
33
+ An exact version stays exact. If the install fails or you stop it, `package.json` and the lockfile are put back and installed again. A version it can't edit, such as `catalog:` or `workspace:`, stops it before anything changes. It needs `npm` to read the registry, whichever package manager the app uses.
34
+
35
+ > [!IMPORTANT]
36
+ > In spacefn 0.11.0, `space upgrade` updates only spacefn. From that version, upgrade with the latest one's instead: `npx spacefn@latest upgrade`.
37
+
38
+ ## Errors
39
+
22
40
  Every command prints errors with a code, the file and a hint, for example:
23
41
 
24
42
  ```txt
package/content/index.md CHANGED
@@ -12,13 +12,13 @@ Start with [Getting started](1-getting-started.md) and [Conventions](2-conventio
12
12
 
13
13
  **Deployment**
14
14
 
15
- | Page | What it covers |
16
- | -------------------------------------------------- | ------------------------------------------------------------ |
17
- | [Deployment](5-deployment/index.md) | `space deploy`, stages, telemetry |
18
- | [Cloudflare](5-deployment/1-cloudflare.md) | What a deploy creates, domains, local dev |
19
- | [Bun](5-deployment/2-bun.md) | The processes, the image, servers, more than one machine |
20
- | [Infrastructure](5-deployment/3-infrastructure.md) | `configs/infra.ts`, `#space/infra.ts`, `variables`, state |
21
- | [CI/CD](5-deployment/4-ci-cd.md) | Cloudflare tokens, GitHub Actions, GitLab CI, preview stages |
15
+ | Page | What it covers |
16
+ | -------------------------------------------------- | -------------------------------------------------------------------------- |
17
+ | [Deployment](5-deployment/index.md) | `space deploy`, stages, telemetry |
18
+ | [Cloudflare](5-deployment/1-cloudflare.md) | What a deploy creates, domains, local dev |
19
+ | [Bun](5-deployment/2-bun.md) | The processes, the image, servers, more than one machine |
20
+ | [Infrastructure](5-deployment/3-infrastructure.md) | `configs/infra.ts`, `#space/infra.ts`, `variables`, state |
21
+ | [CI/CD](5-deployment/4-ci-cd.md) | Cloudflare tokens and dashboard, GitHub Actions, GitLab CI, preview stages |
22
22
 
23
23
  **Guides**
24
24
 
@@ -15,4 +15,4 @@ Apps that show spacefn's conventions in full: `app/` only wires, the code is in
15
15
  | `vue`, `svelte` | Cloudflare | The same island with Vue and Svelte single-file components |
16
16
  | `mini-shopify` | Bun | A database per shop: created with Turso's Platform API, opened per request |
17
17
 
18
- In the repo, `pnpm examples` remakes the starters from the `create-spacefn` template, and `pnpm install` gives every example the workspace's packages. Run one with `cd examples/<name> && pnpm dev`.
18
+ In the repo, the starters are copies of the `create-spacefn` template, and `pnpm install` gives every example the workspace's packages. Run one with `cd examples/<name> && pnpm dev`.
@@ -54,12 +54,15 @@ export default Alchemy.Stack(
54
54
  for (const { className, binding } of app.workflows)
55
55
  bindings[binding] = Cloudflare.Workflow(className, { className });
56
56
 
57
+ // space dev --port N sets it; without one, 1337 or the next free port.
58
+ const devPort = process.env.SPACE_DEV_PORT;
57
59
  const worker = yield* Cloudflare.Website.Vite("Worker", {
58
60
  // Vite runs in .space/: its vite.config.ts is configs/vite.ts, and entry.ts runs app/entry.ts.
59
61
  rootDir: ".space",
60
62
  main: "./entry.ts",
61
63
  crons: [...app.crons],
62
64
  env: bindings,
65
+ dev: devPort ? { port: Number(devPort), strictPort: true } : undefined,
63
66
  // What a deploy hashes to tell whether to rebuild, from .space/.
64
67
  memo: {
65
68
  include: [
@@ -20,12 +20,12 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "effect": "4.1.4",
23
- "spacefn": "^0.11.0"
23
+ "spacefn": "^0.11.1"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@alchemy.run/cloudflare": "2.0.0-beta.87",
27
27
  "alchemy": "2.0.0-beta.87",
28
- "spacefn-docs": "^0.11.0",
28
+ "spacefn-docs": "^0.11.1",
29
29
  "typescript": "^7.0.2",
30
30
  "vite": "8.3.8",
31
31
  "vitest": "5.1.1"
@@ -20,12 +20,12 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "effect": "4.1.4",
23
- "spacefn": "^0.11.0"
23
+ "spacefn": "^0.11.1"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@alchemy.run/docker": "2.0.0-beta.87",
27
27
  "alchemy": "2.0.0-beta.87",
28
- "spacefn-docs": "^0.11.0",
28
+ "spacefn-docs": "^0.11.1",
29
29
  "typescript": "^7.0.2",
30
30
  "vite": "8.3.8",
31
31
  "vitest": "5.1.1"
@@ -21,13 +21,13 @@
21
21
  "dependencies": {
22
22
  "@tursodatabase/api": "2.0.6",
23
23
  "effect": "4.1.4",
24
- "spacefn": "^0.11.0"
24
+ "spacefn": "^0.11.1"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@alchemy.run/docker": "2.0.0-beta.87",
28
28
  "@types/bun": "^1.4.4",
29
29
  "alchemy": "2.0.0-beta.87",
30
- "spacefn-docs": "^0.11.0",
30
+ "spacefn-docs": "^0.11.1",
31
31
  "typescript": "^7.0.2",
32
32
  "vite": "8.3.8",
33
33
  "vitest": "5.1.1"
@@ -22,7 +22,7 @@
22
22
  "effect": "4.1.4",
23
23
  "react": "19.3.1",
24
24
  "react-dom": "19.3.1",
25
- "spacefn": "^0.11.0"
25
+ "spacefn": "^0.11.1"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@alchemy.run/docker": "2.0.0-beta.87",
@@ -30,7 +30,7 @@
30
30
  "@types/react-dom": "19.3.0",
31
31
  "@vitejs/plugin-react": "6.2.1",
32
32
  "alchemy": "2.0.0-beta.87",
33
- "spacefn-docs": "^0.11.0",
33
+ "spacefn-docs": "^0.11.1",
34
34
  "typescript": "^7.0.2",
35
35
  "vite": "8.3.8",
36
36
  "vitest": "5.1.1"
@@ -18,12 +18,12 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "effect": "4.1.4",
21
- "spacefn": "^0.11.0"
21
+ "spacefn": "^0.11.1"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@alchemy.run/docker": "2.0.0-beta.87",
25
25
  "alchemy": "2.0.0-beta.87",
26
- "spacefn-docs": "^0.11.0",
26
+ "spacefn-docs": "^0.11.1",
27
27
  "typescript": "^7.0.2",
28
28
  "vite": "8.3.8"
29
29
  }
@@ -54,12 +54,15 @@ export default Alchemy.Stack(
54
54
  for (const { className, binding } of app.workflows)
55
55
  bindings[binding] = Cloudflare.Workflow(className, { className });
56
56
 
57
+ // space dev --port N sets it; without one, 1337 or the next free port.
58
+ const devPort = process.env.SPACE_DEV_PORT;
57
59
  const worker = yield* Cloudflare.Website.Vite("Worker", {
58
60
  // Vite runs in .space/: its vite.config.ts is configs/vite.ts, and entry.ts runs app/entry.ts.
59
61
  rootDir: ".space",
60
62
  main: "./entry.ts",
61
63
  crons: [...app.crons],
62
64
  env: bindings,
65
+ dev: devPort ? { port: Number(devPort), strictPort: true } : undefined,
63
66
  // What a deploy hashes to tell whether to rebuild, from .space/.
64
67
  memo: {
65
68
  include: [
@@ -18,12 +18,12 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "effect": "4.1.4",
21
- "spacefn": "^0.11.0"
21
+ "spacefn": "^0.11.1"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@alchemy.run/cloudflare": "2.0.0-beta.87",
25
25
  "alchemy": "2.0.0-beta.87",
26
- "spacefn-docs": "^0.11.0",
26
+ "spacefn-docs": "^0.11.1",
27
27
  "typescript": "^7.0.2",
28
28
  "vite": "8.3.8"
29
29
  }
@@ -21,12 +21,12 @@
21
21
  "dependencies": {
22
22
  "effect": "4.1.4",
23
23
  "solid-js": "1.9.18",
24
- "spacefn": "^0.11.0"
24
+ "spacefn": "^0.11.1"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@alchemy.run/docker": "2.0.0-beta.87",
28
28
  "alchemy": "2.0.0-beta.87",
29
- "spacefn-docs": "^0.11.0",
29
+ "spacefn-docs": "^0.11.1",
30
30
  "typescript": "^7.0.2",
31
31
  "vite": "8.3.8",
32
32
  "vite-plugin-solid": "2.11.15",
@@ -19,12 +19,12 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "effect": "4.1.4",
22
- "spacefn": "^0.11.0"
22
+ "spacefn": "^0.11.1"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@alchemy.run/docker": "2.0.0-beta.87",
26
26
  "alchemy": "2.0.0-beta.87",
27
- "spacefn-docs": "^0.11.0",
27
+ "spacefn-docs": "^0.11.1",
28
28
  "typescript": "^7.0.2",
29
29
  "vite": "8.3.8",
30
30
  "vitest": "5.1.1"
@@ -54,12 +54,15 @@ export default Alchemy.Stack(
54
54
  for (const { className, binding } of app.workflows)
55
55
  bindings[binding] = Cloudflare.Workflow(className, { className });
56
56
 
57
+ // space dev --port N sets it; without one, 1337 or the next free port.
58
+ const devPort = process.env.SPACE_DEV_PORT;
57
59
  const worker = yield* Cloudflare.Website.Vite("Worker", {
58
60
  // Vite runs in .space/: its vite.config.ts is configs/vite.ts, and entry.ts runs app/entry.ts.
59
61
  rootDir: ".space",
60
62
  main: "./entry.ts",
61
63
  crons: [...app.crons],
62
64
  env: bindings,
65
+ dev: devPort ? { port: Number(devPort), strictPort: true } : undefined,
63
66
  // What a deploy hashes to tell whether to rebuild, from .space/.
64
67
  memo: {
65
68
  include: [
@@ -19,14 +19,17 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "effect": "4.1.4",
22
- "spacefn": "^0.11.0"
22
+ "spacefn": "^0.11.1"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@alchemy.run/cloudflare": "2.0.0-beta.87",
26
26
  "alchemy": "2.0.0-beta.87",
27
- "spacefn-docs": "^0.11.0",
27
+ "spacefn-docs": "^0.11.1",
28
28
  "typescript": "^7.0.2",
29
29
  "vite": "8.3.8",
30
30
  "vitest": "5.1.1"
31
+ },
32
+ "allowScripts": {
33
+ "workerd": false
31
34
  }
32
35
  }
@@ -54,12 +54,15 @@ export default Alchemy.Stack(
54
54
  for (const { className, binding } of app.workflows)
55
55
  bindings[binding] = Cloudflare.Workflow(className, { className });
56
56
 
57
+ // space dev --port N sets it; without one, 1337 or the next free port.
58
+ const devPort = process.env.SPACE_DEV_PORT;
57
59
  const worker = yield* Cloudflare.Website.Vite("Worker", {
58
60
  // Vite runs in .space/: its vite.config.ts is configs/vite.ts, and entry.ts runs app/entry.ts.
59
61
  rootDir: ".space",
60
62
  main: "./entry.ts",
61
63
  crons: [...app.crons],
62
64
  env: bindings,
65
+ dev: devPort ? { port: Number(devPort), strictPort: true } : undefined,
63
66
  // What a deploy hashes to tell whether to rebuild, from .space/.
64
67
  memo: {
65
68
  include: [
@@ -20,14 +20,14 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "effect": "4.1.4",
23
- "spacefn": "^0.11.0",
23
+ "spacefn": "^0.11.1",
24
24
  "svelte": "5.57.3"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@alchemy.run/cloudflare": "2.0.0-beta.87",
28
28
  "@sveltejs/vite-plugin-svelte": "7.3.1",
29
29
  "alchemy": "2.0.0-beta.87",
30
- "spacefn-docs": "^0.11.0",
30
+ "spacefn-docs": "^0.11.1",
31
31
  "typescript": "^7.0.2",
32
32
  "vite": "8.3.8",
33
33
  "vitest": "5.1.1"
@@ -20,13 +20,13 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "effect": "4.1.4",
23
- "spacefn": "^0.11.0"
23
+ "spacefn": "^0.11.1"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@alchemy.run/docker": "2.0.0-beta.87",
27
27
  "@tailwindcss/vite": "4.3.5",
28
28
  "alchemy": "2.0.0-beta.87",
29
- "spacefn-docs": "^0.11.0",
29
+ "spacefn-docs": "^0.11.1",
30
30
  "tailwindcss": "4.3.5",
31
31
  "typescript": "^7.0.2",
32
32
  "vite": "8.3.8",
@@ -54,12 +54,15 @@ export default Alchemy.Stack(
54
54
  for (const { className, binding } of app.workflows)
55
55
  bindings[binding] = Cloudflare.Workflow(className, { className });
56
56
 
57
+ // space dev --port N sets it; without one, 1337 or the next free port.
58
+ const devPort = process.env.SPACE_DEV_PORT;
57
59
  const worker = yield* Cloudflare.Website.Vite("Worker", {
58
60
  // Vite runs in .space/: its vite.config.ts is configs/vite.ts, and entry.ts runs app/entry.ts.
59
61
  rootDir: ".space",
60
62
  main: "./entry.ts",
61
63
  crons: [...app.crons],
62
64
  env: bindings,
65
+ dev: devPort ? { port: Number(devPort), strictPort: true } : undefined,
63
66
  // What a deploy hashes to tell whether to rebuild, from .space/.
64
67
  memo: {
65
68
  include: [
@@ -20,14 +20,14 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "effect": "4.1.4",
23
- "spacefn": "^0.11.0",
23
+ "spacefn": "^0.11.1",
24
24
  "vue": "3.5.45"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@alchemy.run/cloudflare": "2.0.0-beta.87",
28
28
  "@vitejs/plugin-vue": "6.0.10",
29
29
  "alchemy": "2.0.0-beta.87",
30
- "spacefn-docs": "^0.11.0",
30
+ "spacefn-docs": "^0.11.1",
31
31
  "typescript": "^7.0.2",
32
32
  "vite": "8.3.8",
33
33
  "vitest": "5.1.1"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spacefn-docs",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "spacefn's docs and examples, and the reader `space docs` serves them with",
5
5
  "keywords": [
6
6
  "docs",