Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DOCS_WRITING_QA.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ The first review fixed eight findings covering stats, caching, routing, anonymou
| Agent reach | Keep supported-client detection, skill installation, permission ceilings, human-only actions, and team-automation revocation exceptions | `content/cli/agents.mdx`; `content/agents/skills.mdx`; `content/agents/permissions.mdx` |
| Ownership and billing | Distinguish self-serve teams from partner customer ownership; billing reads differ from plan changes; key rotation depends on switching consumers first | `createSpace` public reference; `content/platforms/partner-api/customers.mdx`; `content/(account)/billing.mdx`; `content/(account)/api-keys.mdx` |
| Cache and schedule application | Repeat public-cache exceptions in troubleshooting; crons follow the live version | `content/(serve)/caching.mdx`; `listSpaceCrons` public reference |
| Sentence splitting | Limit missing generated CSS to the dynamic class instead of declaring the whole app unstyled | `content/(dynamic)/zero-runtime.mdx`, Styling |
| Sentence splitting | Limit missing generated CSS to the dynamic class instead of declaring the whole app unstyled | `content/(dynamic)/zero.mdx`, Styling |

Coverage by original PR section:

| Section | Pages compared |
| --- | --- |
| Account | 3: api-keys, authentication, billing |
| Concepts | 3: spaces, teams, versions |
| Dynamic | 8: crons, database, environment-variables, functions, logs, storage, wordpress, zero-runtime |
| Dynamic | 8: crons, database, environment-variables, functions, logs, storage, wordpress, zero |
| Publishing | 8: anonymous-and-claim, ci, frameworks, git, publish, recipes/html, recipes/next, wordpress-data-sources |
| Reference | 3: config-file, glossary, limits |
| Serving | 8: access, caching, customization, domains, routing, site-pages, stats, urls |
Expand Down
2 changes: 1 addition & 1 deletion content/(dynamic)/crons.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ There's no dashboard editor for crons. Declare schedules in `sf.jsonc`, then pub

## How a run happens

A cron is a scheduled `GET` against a path on your own site. It goes through the same front door a visitor gets, so whatever serves that path answers it: a [Zero](/zero-runtime) endpoint, a [Functions](/functions) route, or a static file.
A cron is a scheduled `GET` against a path on your own site. It goes through the same front door a visitor gets, so whatever serves that path answers it: a [Zero](/zero) endpoint, a [Functions](/functions) route, or a static file.

A response under 400 is a success and is silent. A response of 400 or worse, or a fatal error, is a failure and is reported.

Expand Down
4 changes: 2 additions & 2 deletions content/(dynamic)/database.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ sidebar:
There's no connection string for this database — your code reaches it through `ctx.db` or `env.DB`, or through a single-use SQL console when you need raw SQL.

:::note[Don't have a database yet?]
For [Zero](/zero-runtime), start with `sf init --runtime zero`, or add the full [runtime block](/zero-runtime#declare-it) to `sf.jsonc`, including `kind: "zero"`, `server`, and `client` entry paths. The server file is required; Zero can generate a client shell. Publish the app before querying its live database. A [Functions](/functions#what-is-on-env) worker also gets a database through `env.DB`, but the Zero table commands do not apply to it.
For [Zero](/zero), start with `sf init --runtime zero`, or add the full [runtime block](/zero#declare-it) to `sf.jsonc`, including `kind: "zero"`, `server`, and `client` entry paths. The server file is required; Zero can generate a client shell. Publish the app before querying its live database. A [Functions](/functions#what-is-on-env) worker also gets a database through `env.DB`, but the Zero table commands do not apply to it.
:::

## What it is

Every Space that runs [Zero](/zero-runtime) gets one database, the MySQL that lives on the machine serving the site. A [Functions](/functions) worker gets one too, as `env.DB`.
Every Space that runs [Zero](/zero) gets one database, the MySQL that lives on the machine serving the site. A [Functions](/functions) worker gets one too, as `env.DB`.

You do not create it, size it, or connect to it. Your capsule declares the tables. The platform applies the migration when a version finalizes.

Expand Down
4 changes: 2 additions & 2 deletions content/(dynamic)/functions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ sidebar:
order: 1
---

Functions can detect a supported worker layout when you publish, without an explicit `runtime` block. Custom layouts need a declaration, and [Zero](/zero-runtime#declare-it) is always declared explicitly.
Functions can detect a supported worker layout when you publish, without an explicit `runtime` block. Custom layouts need a declaration, and [Zero](/zero#declare-it) is always declared explicitly.

Functions runs your code as a worker. Use it when you need npm packages or framework output like OpenNext Next.js. If you want live queries in the browser and a schema the platform migrates for you, use [Zero](/zero-runtime) instead. Both can call `fetch()`. One version declares one runtime.
Functions runs your code as a worker. Use it when you need npm packages or framework output like OpenNext Next.js. If you want live queries in the browser and a schema the platform migrates for you, use [Zero](/zero) instead. Both can call `fetch()`. One version declares one runtime.

Functions is on for every account.

Expand Down
2 changes: 1 addition & 1 deletion content/(dynamic)/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ export default defineMeta({
title: "Dynamic",
collapsed: false,
order: 5,
pages: ["zero-runtime", "functions", "database", "environment-variables", "crons", "object-storage", "logs", "wordpress"],
pages: ["zero", "functions", "database", "environment-variables", "crons", "object-storage", "logs", "wordpress"],
});
2 changes: 1 addition & 1 deletion content/(dynamic)/object-storage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ An object is addressed by a bare 32-character hexadecimal id. There is no key, n

## Upload from a capsule

The client SDK is the upload path for a [Zero](/zero-runtime) app.
The client SDK is the upload path for a [Zero](/zero) app.

```tsx client/upload.tsx
import { storage } from "@spacefast/zero/client";
Expand Down
2 changes: 1 addition & 1 deletion content/(dynamic)/wordpress.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Every Space runs a WordPress behind its static files. Run WP-CLI ag

Every Space includes a WordPress install behind its published files. Reach it through `sf wp` or its published Abilities.

Your published files serve in front of WordPress, so a static Space never touches it and never pays for it. It is there because it is what makes a Space more than a bucket: [Zero](/zero-runtime) apps run on it, [Storage](/object-storage) is its media library, and [Database](/database) is its MySQL. This page covers the two ways to reach that WordPress directly.
Your published files serve in front of WordPress, so a static Space never touches it and never pays for it. It is there because it is what makes a Space more than a bucket: [Zero](/zero) apps run on it, [Storage](/object-storage) is its media library, and [Database](/database) is its MySQL. This page covers the two ways to reach that WordPress directly.

## `sf wp`

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions content/(reference)/config-file.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ While `name` is set in the file, the API refuses to rename the Space. The file w

Colors accept hex, `rgb()`, `rgba()`, `hsl()`, `hsla()`, and CSS color names. `theme` is a closed object, so an unknown key is an error.

A `theme.json` file next to `sf.jsonc` is an inference input rather than configuration. Only `settings.color.palette` and `settings.typography.fontFamilies` are read from it. A [Zero](/zero-runtime) capsule's Tailwind compile reads the same file.
A `theme.json` file next to `sf.jsonc` is an inference input rather than configuration. Only `settings.color.palette` and `settings.typography.fontFamilies` are read from it. A [Zero](/zero) capsule's Tailwind compile reads the same file.

What these tokens paint, and how to replace those pages outright, is on [Layout, theme, and site pages](/site-pages).

Expand Down Expand Up @@ -187,7 +187,7 @@ One runtime per version, discriminated on `kind`. Omit the block for a static si
| `runtime.server` | string, required | none | Server entry, relative to the published directory |
| `runtime.client` | string, required | none | Client entry, relative to the published directory |

Both are required. Zero is never inferred. See [Dynamic sites with Zero](/zero-runtime).
Both are required. Zero is never inferred. See [Dynamic sites with Zero](/zero).

### `kind: "functions"`

Expand Down
4 changes: 2 additions & 2 deletions content/(reference)/glossary.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ A build turns source code into publishable output. You can build locally or let

## Capsule

The compiled form of a Zero app. `sf publish` turns your TypeScript server code into a capsule, which the platform installs on the Space. See [Dynamic sites with Zero](/zero-runtime).
The compiled form of a Zero app. `sf publish` turns your TypeScript server code into a capsule, which the platform installs on the Space. See [Dynamic sites with Zero](/zero).

## Claim / claiming

Expand Down Expand Up @@ -53,4 +53,4 @@ An immutable snapshot created when a publish produces a new version. A ready ver

## Zero

The runtime for an app with live queries and a declared database schema. One TypeScript app compiles into a [capsule](#capsule) with a MySQL database next to your code. [Functions](#functions) also provides a database, and [crons](/crons) can call either runtime or static files. See [Dynamic sites with Zero](/zero-runtime).
The runtime for an app with live queries and a declared database schema. One TypeScript app compiles into a [capsule](#capsule) with a MySQL database next to your code. [Functions](#functions) also provides a database, and [crons](/crons) can call either runtime or static files. See [Dynamic sites with Zero](/zero).
2 changes: 1 addition & 1 deletion content/(serve)/site-pages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ A WordPress-compatible `theme.json` next to your config is read as an inference

Every other WordPress key rides through and is never read. Slugs are lowercase letters, digits, and dashes, up to 64 characters. The palette takes at most 64 entries and `fontFamilies` at most 32. The file is read up to 64 KiB at publish; a larger one is ignored rather than failing the publish.

`theme.json` is the weakest of the three theme sources. What `sf.jsonc` sets under `theme` overrides it, and what the Space's [Customization](/customization) tab sets overrides both. A [Zero](/zero-runtime) capsule's Tailwind compile reads the same file, so one file styles both.
`theme.json` is the weakest of the three theme sources. What `sf.jsonc` sets under `theme` overrides it, and what the Space's [Customization](/customization) tab sets overrides both. A [Zero](/zero) capsule's Tailwind compile reads the same file, so one file styles both.

## `_layout.html`

Expand Down
2 changes: 1 addition & 1 deletion content/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Publish this folder to Spacefast and give me the live URL.

A **Space** holds a site and its **versions**, immutable snapshots with their own URLs. A publish with no changes can reuse the current version. The `live` channel points at the version visitors see, or is empty before the first publish. Promoting or rolling back to a retained, ready version moves that pointer without rebuilding. Preview publishes and manual promotion policies leave `live` alone. (New terms piling up? See the [glossary](/glossary).)

Static output is the default path. Point `sf publish` at a build directory and it uploads only the files that changed. If you'd rather publish source, Spacefast detects the framework and builds it. Sites that need a database, server functions, or scheduled jobs declare a [Zero runtime](/zero-runtime#declare-it) and server entry.
Static output is the default path. Point `sf publish` at a build directory and it uploads only the files that changed. If you'd rather publish source, Spacefast detects the framework and builds it. Sites that need a database, server functions, or scheduled jobs declare a [Zero runtime](/zero#declare-it) and server entry.

In a self-serve account, your team owns the Spaces you claim, even when you are its only member. On [Plus](/billing#seats), you can add members who publish and roll back without sharing your login. Free and Go allow only the owner. Team roles control who can manage domains, credentials, and billing. See [Teams and members](/teams) to invite people and choose how new Spaces are shared.

Expand Down
2 changes: 1 addition & 1 deletion content/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Working with other people? If your Space is still anonymous, [claim it first](/a
<Card title="Publish from Git" href="/git" icon="git-branch">
Push to a remote or connect GitHub and let Spacefast build.
</Card>
<Card title="Dynamic sites" href="/zero-runtime" icon="database">
<Card title="Dynamic sites" href="/zero" icon="database">
Add a database, functions, and crons with the Zero runtime.
</Card>
<Card title="Run in CI" href="/cli" icon="workflow">
Expand Down
2 changes: 1 addition & 1 deletion evals.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ questions:
- id: zero-declare
question: How do I turn on the Zero runtime for a project?
expected: ["runtime.kind set to zero in sf.jsonc", "a server entry"]
routes: /zero-runtime
routes: /zero
- id: routing-precedence
question: If both a _redirects file and sf.jsonc rules match a path, which wins?
expected: ["_redirects"]
Expand Down
4 changes: 2 additions & 2 deletions redirects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ export const redirects: { from: string; to: string; status: 301 }[] = [
{ from: "/recipes/preview-channels", to: "/versions", status: 301 },
{ from: "/recipes/redirects", to: "/routing", status: 301 },
{ from: "/redirects", to: "/routing", status: 301 },
{ from: "/runtimes", to: "/zero-runtime", status: 301 },
{ from: "/runtimes", to: "/zero", status: 301 },
{ from: "/runtimes/functions", to: "/functions", status: 301 },
{ from: "/runtimes/zero", to: "/zero-runtime", status: 301 },
{ from: "/runtimes/zero", to: "/zero", status: 301 },
{ from: "/sdk", to: "/api/sdk", status: 301 },
{ from: "/spaces/rename", to: "/spaces", status: 301 },
{ from: "/versions-and-rollback", to: "/versions", status: 301 },
Expand Down
4 changes: 2 additions & 2 deletions scripts/docs-experience.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ test("Database gives the Zero prerequisite before query instructions", async ()
const prerequisite = database.indexOf("Don't have a database yet?");
const query = database.indexOf("## Query it from code");
assert.ok(prerequisite >= 0 && query > prerequisite);
assert.match(database.slice(prerequisite, query), /\[Zero\]\(\/docs\/zero-runtime\/\)/u);
assert.match(database.slice(prerequisite, query), /\[Zero\]\(\/docs\/zero\/\)/u);
assert.match(database.slice(prerequisite, query), /kind: "zero"/u);
assert.match(database.slice(prerequisite, query), /\[runtime block\]\(\/docs\/zero-runtime\/#declare-it\)/u);
assert.match(database.slice(prerequisite, query), /\[runtime block\]\(\/docs\/zero\/#declare-it\)/u);
assert.match(database.slice(prerequisite, query), /`server`/u);
assert.match(database.slice(prerequisite, query), /server file is required/iu);
assert.match(database.slice(prerequisite, query), /sf init --runtime zero/u);
Expand Down
6 changes: 3 additions & 3 deletions scripts/redirect-rules.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ const authoredRedirectRules = [
{
from: `${deploymentBase}/apps/zero`,
status: 301,
to: `${deploymentBase}/zero-runtime/`,
to: `${deploymentBase}/zero/`,
},
{
from: `${deploymentBase}/zero`,
from: `${deploymentBase}/zero-runtime`,
status: 301,
to: `${deploymentBase}/zero-runtime/`,
to: `${deploymentBase}/zero/`,
},
{
from: `${deploymentBase}/storage`,
Expand Down
2 changes: 1 addition & 1 deletion scripts/verify-routes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const representativePages = [
["errors/index.html", `${docsRoot}/errors`, "Error reference"],
["errors/rate_limited/index.html", `${docsRoot}/errors/rate_limited`, "rate_limited"],
["recipes/vite/index.html", `${docsRoot}/recipes/vite`, "Vite"],
["zero-runtime/index.html", `${docsRoot}/zero-runtime`, "What Zero is"],
["zero/index.html", `${docsRoot}/zero`, "What Zero is"],
];
for (const page of representativePages) {
await requirePage(...page);
Expand Down
Loading