siteplane 0.1.68 → 0.2.0-next.0
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/README.md +52 -22
- package/dist/bin/siteplane.js +1422 -1475
- package/dist/chunk-KZ3AQ6OA.js +27 -0
- package/dist/chunk-YDCNEIOB.js +339 -0
- package/dist/components.d.ts +19 -0
- package/dist/components.js +33 -0
- package/dist/config.d.ts +8 -0
- package/dist/config.js +6 -0
- package/dist/index.d.ts +38 -1
- package/dist/index.js +128 -1916
- package/dist/internal/bridge-loader.js +28 -0
- package/dist/internal/bridge.js +1 -0
- package/dist/next.cjs +204 -0
- package/dist/next.d.ts +29 -119
- package/dist/next.js +128 -2819
- package/dist/route.d.ts +13 -0
- package/dist/route.js +144 -0
- package/package.json +45 -11
package/README.md
CHANGED
|
@@ -1,9 +1,53 @@
|
|
|
1
1
|
# siteplane
|
|
2
2
|
|
|
3
|
-
Siteplane for Next.js websites
|
|
3
|
+
Siteplane for Next.js websites (App Router, Next 15 and 16): content you can edit in Siteplane with the current
|
|
4
|
+
content as fallback in your code, a Draft Mode preview for the editor, Booking and the `siteplane` CLI.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
## Connect a website
|
|
7
|
+
|
|
8
|
+
Run this in the website's folder, or tell your coding agent "Install Siteplane":
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npx siteplane@next init
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Version 0.2 is on the `next` tag until it becomes `latest`.
|
|
15
|
+
|
|
16
|
+
`init` opens the approval page in the browser. There you sign up or sign in, create the website in Siteplane or pick
|
|
17
|
+
an existing one, and click Connect. If you created the website in Siteplane first, its prompt names the site:
|
|
18
|
+
`npx siteplane@<version> init --site <site ID>`.
|
|
19
|
+
|
|
20
|
+
`init` then writes `siteplane.config.json`, installs this package, wraps `next.config` in `withSiteplane`, adds the
|
|
21
|
+
route `app/api/siteplane/[...siteplane]/route.ts` and `<SiteplaneBridge />`, and prints the task for the agent.
|
|
22
|
+
Siteplane needs no environment variables or secrets in your project.
|
|
23
|
+
|
|
24
|
+
## Field API
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
import { siteplane } from "siteplane";
|
|
28
|
+
|
|
29
|
+
const title = await siteplane.text("home.hero.title", "Fresh rolls since 1920");
|
|
30
|
+
|
|
31
|
+
<h1 {...siteplane.attrs("home.hero.title")}>{title}</h1>;
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Types: `text`, `longText`, `link` (`{ href, label }`) and `image` (`{ src, alt }`). Values load once per request and
|
|
35
|
+
are cached for 60 seconds; without Siteplane the fallbacks render.
|
|
36
|
+
|
|
37
|
+
## Commands
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx siteplane task # the task for the agent
|
|
41
|
+
npx siteplane check # checks the fields in the code
|
|
42
|
+
npx siteplane sync # checks and reports the fields to Siteplane
|
|
43
|
+
npx siteplane status --url <address> # checks a deployed address
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Optional display names for new fields go into `siteplane.labels.json` (`{ "home.hero.title": "Hero headline" }`).
|
|
47
|
+
|
|
48
|
+
A website with `basePath` in `next.config` needs no extra setup. Check it with the base path in the address
|
|
49
|
+
(`npx siteplane status --url https://www.example.com/docs`); Siteplane saves that address as the website URL and
|
|
50
|
+
reaches the website below it.
|
|
7
51
|
|
|
8
52
|
## Booking
|
|
9
53
|
|
|
@@ -13,10 +57,7 @@ export default withSiteplane(nextConfig, { booking: { site: "<immutable-site-id>
|
|
|
13
57
|
```
|
|
14
58
|
|
|
15
59
|
The wrapper adds `/booking/:path*` as a `beforeFiles` rewrite to Siteplane and preserves existing rewrite sections.
|
|
16
|
-
|
|
17
|
-
`<a href="/booking">` instead of `next/link`; exclude this path from customer middleware. Configure the public booking
|
|
18
|
-
address in Siteplane and permit Siteplane/Stripe assets and connections in the customer CSP. `siteplane booking check`
|
|
19
|
-
verifies the Site ID in `next.config.*`. The public API uses Site ID plus allowed Origin; no raw Booking key is needed.
|
|
60
|
+
Use `<a href="/booking">` instead of `next/link`; exclude this path from customer middleware.
|
|
20
61
|
|
|
21
62
|
```bash
|
|
22
63
|
npx siteplane booking init
|
|
@@ -25,18 +66,7 @@ npx siteplane booking sync
|
|
|
25
66
|
npx siteplane booking test
|
|
26
67
|
```
|
|
27
68
|
|
|
28
|
-
`
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
project. Agents without a browser pass the link and code to the user; `--no-browser` skips opening it. A revoked or
|
|
33
|
-
expired connection leads through one new approval.
|
|
34
|
-
|
|
35
|
-
## Image policy
|
|
36
|
-
|
|
37
|
-
When the scan includes image fields, `withSiteplane` prepares Next Image and existing Next-config CSP headers for
|
|
38
|
-
Siteplane's image route and your website's `/siteplane-assets/` path. Existing image sources stay in place. Builds
|
|
39
|
-
that serve Siteplane images from the website set `SITEPLANE_SITE_ORIGIN` to the exact public HTTPS website origin;
|
|
40
|
-
local fallback-image builds can omit it. The wrapper adds only those exact patterns: existing sources, custom loaders
|
|
41
|
-
and redirect settings remain unchanged. Keep existing policies and verify Siteplane images through the website's
|
|
42
|
-
actual renderer. This preparation does not authorize hosting.
|
|
69
|
+
`booking sync` and `booking test` read the Site ID from `siteplane.booking.json` and connect through the same browser
|
|
70
|
+
approval. The agent connection is stored in the user config directory (`$SITEPLANE_CONFIG_DIR`,
|
|
71
|
+
`$XDG_CONFIG_HOME/siteplane`, `%APPDATA%\siteplane` or `~/.config/siteplane`), never in the project; `--no-browser`
|
|
72
|
+
skips opening the browser.
|