@plume-press/cli 0.8.0 → 0.8.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.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Use Node.js 22.13 or newer. Install the scoped package in your website project before using its plume command. These examples use npm; keep your project's chosen package manager.
4
4
 
5
5
  ```sh
6
- npm install --save-dev @plume-press/cli@0.8.0
6
+ npm install --save-dev @plume-press/cli@0.8.1
7
7
  npx plume init --check
8
8
  npx plume --help
9
9
  ```
@@ -29,7 +29,7 @@ A successful connection saves nonsecret Site/editor URL facts in Git-ignored .pl
29
29
 
30
30
  ## Check a connected build
31
31
 
32
- Choose plume build --delivery production-ssr -- <your existing framework build command> for public request-time content, --delivery selected-preview for an immutable publication candidate, or --delivery static (the default) for a pinned build. The wrapper validates clean exact Git HEAD, plume.lock and matching plume.schema.ts once, writes .plume/binding.json and .plume/delivery.json, then runs the framework. Selected-preview HEAD trailers must identify an existing immutable native reservation and agree with the lock. Compilation records operation ID, actual SHA and environment; later host evidence must match the final prepared target. There is no build UUID or preparation wait. It performs no publication. PLUME_ENDPOINT defaults to https://app.plume.press; validation needs no token. Schema files execute locally as trusted framework configuration does.
32
+ Use plume build --delivery auto -- <your existing framework build command> when the host builds both the live branch and preview branches: it builds a selected preview only when HEAD is Plume's prepared publication commit and production SSR otherwise, with no host setting. The explicit modes are --delivery production-ssr for public request-time content, --delivery selected-preview for an immutable publication candidate, or --delivery static (the default) for a pinned build. The wrapper validates clean exact Git HEAD, plume.lock and matching plume.schema.ts once, writes .plume/binding.json and .plume/delivery.json, then runs the framework. Selected-preview HEAD trailers must identify an existing immutable native reservation and agree with the lock. Compilation records operation ID, actual SHA and environment; later host evidence must match the final prepared target. There is no build UUID or preparation wait. It performs no publication. PLUME_ENDPOINT defaults to https://app.plume.press; validation needs no token. Schema files execute locally as trusted framework configuration does.
33
33
 
34
34
  Production SSR resolves createLatestPlume once per render and shares the reader across page queries; selected preview/static use createPlume with the compiled binding. Emit same-reader render evidence with the compiled descriptor. Static or cached pages need a rebuild or real invalidation for freshness; runtime environment variables must not switch an immutable preview to latest.
35
35
 
package/dist/cli.mjs CHANGED
@@ -36690,6 +36690,7 @@ Choose the mode explicitly in application/server configuration:
36690
36690
  - **Immutable host preview:** run plume build --delivery selected-preview -- <existing framework build command> from its clean exact Git candidate. The build reads its committed Plume operation trailers and validates the exact sealed binding against the native immutable reservation, then writes .plume/delivery.json with operationId and compiled code SHA. Final native preparation must match that operation, SHA and binding before Plume confirms the host preview. Use createPlume with the generated .plume/binding.json and mode: "published". Never resolve latest for this mode.
36691
36691
  - **Deliberately static build:** plume build --delivery static -- <existing framework build command> compiles an immutable selection. Content changes require a real rebuild or supported invalidation; a latest probe cannot certify an old page.
36692
36692
  - **Public SSR:** compile the explicit descriptor with plume build --delivery production-ssr -- <existing framework build command>. Only for an explicitly selected public production SSR mode on a host that supports it, await createLatestPlume({ schema, siteId }) once per request/render. Derive siteId from the committed Site binding, and pass the reader to all page/metadata queries. Use a request-scoped promise/cache, never a module-global reader or promise. A public URL or matching schema does not by itself select latest. A prepared host preview must keep its fixed candidate even if public latest advances.
36693
+ - **One build script for live and preview branches:** plume build --delivery auto -- <existing framework build command> builds as selected-preview only when HEAD is Plume's prepared publication commit (same trailer and reservation checks; a failed check stops the build) and as production-ssr otherwise, so the host needs no setting. .plume/delivery.json records the resolved mode; choose the reader from that compiled mode, never from runtime variables.
36693
36694
 
36694
36695
  Next.js: keep the helper server-only (import "server-only"). In App Router, use the existing server components and request-scoped React cache to share the async reader across a render/metadata pass; opt affected public SSR routes into the framework's dynamic behavior and avoid persistent caching of the latest binding. Preserve Pages Router if the site uses it: resolve once inside getServerSideProps and pass rendered data. Keep getStaticProps/static routes pinned when intentional.
36695
36696
 
@@ -37215,7 +37216,7 @@ var init_package2 = __esm({
37215
37216
  "packages/cli/package.json"() {
37216
37217
  package_default2 = {
37217
37218
  name: "@plume-press/cli",
37218
- version: "0.8.0",
37219
+ version: "0.8.1",
37219
37220
  private: true,
37220
37221
  license: "MIT",
37221
37222
  type: "module",
@@ -40186,13 +40187,14 @@ async function runBuild(options2) {
40186
40187
  "INVALID_CONFIGURATION",
40187
40188
  "Build from an exact Git commit."
40188
40189
  );
40189
- const mode = options2.delivery ?? "static";
40190
+ const requested = options2.delivery ?? "static";
40191
+ let mode = requested === "auto" ? "production-ssr" : requested;
40190
40192
  let operationId;
40191
- if (mode === "selected-preview") {
40192
- const message = await git(cwd, "show", "-s", "--format=%B", "HEAD");
40193
- const trailers = /^Prepare Plume publication\n\nPlume-Publication: ([a-f0-9-]{36})\nPlume-Content: ([a-f0-9-]{36})\nPlume-Schema: (sha256:[a-f0-9]{64})$/.exec(
40194
- message
40195
- );
40193
+ const trailers = requested === "selected-preview" || requested === "auto" ? /^Prepare Plume publication\n\nPlume-Publication: ([a-f0-9-]{36})\nPlume-Content: ([a-f0-9-]{36})\nPlume-Schema: (sha256:[a-f0-9]{64})$/.exec(
40194
+ await git(cwd, "show", "-s", "--format=%B", "HEAD")
40195
+ ) : null;
40196
+ if (requested === "selected-preview" || trailers) {
40197
+ mode = "selected-preview";
40196
40198
  const candidate = previewCandidateSchema.safeParse({
40197
40199
  operationId: trailers?.[1],
40198
40200
  commitSha
@@ -40349,13 +40351,15 @@ ${developerHelp}
40349
40351
  if (!flag || !value || !["--delivery", "--environment"].includes(flag) || buildFlags.has(flag))
40350
40352
  throw new PlumeBuildError(
40351
40353
  "INVALID_CONFIGURATION",
40352
- "Usage: plume build [--delivery production-ssr|selected-preview|static] [--environment production|preview] -- <command ...>"
40354
+ "Usage: plume build [--delivery auto|production-ssr|selected-preview|static] [--environment production|preview] -- <command ...>"
40353
40355
  );
40354
40356
  buildFlags.set(flag, value);
40355
40357
  }
40356
40358
  const mode = buildFlags.get("--delivery") ?? "static";
40357
40359
  const environment = buildFlags.get("--environment");
40358
- if (!["production-ssr", "selected-preview", "static"].includes(mode) || environment && !["production", "preview"].includes(environment))
40360
+ if (!["auto", "production-ssr", "selected-preview", "static"].includes(
40361
+ mode
40362
+ ) || environment && !["production", "preview"].includes(environment))
40359
40363
  throw new PlumeBuildError(
40360
40364
  "INVALID_CONFIGURATION",
40361
40365
  "Choose a supported delivery mode and environment."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plume-press/cli",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "The plume command: set up a website's Plume CMS and check its builds.",
5
5
  "homepage": "https://app.plume.press",
6
6
  "license": "MIT",