@plume-press/cli 0.8.1 → 0.8.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.
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.1
6
+ npm install --save-dev @plume-press/cli@0.8.2
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
- 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.
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 exact Git HEAD (committed files must be unchanged; new files the host or install adds are allowed and listed in the build log), 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
@@ -36687,7 +36687,7 @@ Create or adapt one reader factory beside the site's existing server data helper
36687
36687
  Choose the mode explicitly in application/server configuration:
36688
36688
 
36689
36689
  - **Plume session preview:** when PLUME_PREVIEW is exactly true, require the session-provided PLUME_ENDPOINT and use createPlume({ schema, binding, endpoint, mode: "preview" }). Read the session's generated .plume/binding.json; fail if it is absent or malformed. Local loopback preview URLs can carry a path capability: keep the complete URL server-only. Do not replace it with the public CMS origin.
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.
36690
+ - **Immutable host preview:** run plume build --delivery selected-preview -- <existing framework build command> from its exact Git candidate with committed files unchanged (new files the host or install adds are allowed and listed in the build log). 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
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.
@@ -37216,7 +37216,7 @@ var init_package2 = __esm({
37216
37216
  "packages/cli/package.json"() {
37217
37217
  package_default2 = {
37218
37218
  name: "@plume-press/cli",
37219
- version: "0.8.1",
37219
+ version: "0.8.2",
37220
37220
  private: true,
37221
37221
  license: "MIT",
37222
37222
  type: "module",
@@ -40148,6 +40148,10 @@ async function runCommand2(cwd, command) {
40148
40148
  });
40149
40149
  });
40150
40150
  }
40151
+ async function untrackedFiles(cwd) {
40152
+ const entries = (await git(cwd, "status", "--porcelain=v1", "-z", "--untracked-files=normal")).split("\0").filter(Boolean);
40153
+ return entries.every((entry) => entry.startsWith("?? ")) ? entries.map((entry) => entry.slice(3)) : null;
40154
+ }
40151
40155
  async function runBuild(options2) {
40152
40156
  const cwd = resolve8(options2.cwd);
40153
40157
  const directory = resolve8(cwd, ".plume");
@@ -40177,10 +40181,10 @@ async function runBuild(options2) {
40177
40181
  const binding = await readLock(cwd);
40178
40182
  await validateSchema(cwd, options2.schemaPath ?? "plume.schema.ts", binding);
40179
40183
  const commitSha = await git(cwd, "rev-parse", "HEAD");
40180
- if (await git(cwd, "status", "--porcelain=v1", "--untracked-files=all"))
40184
+ if (!await untrackedFiles(cwd))
40181
40185
  throw new PlumeBuildError(
40182
40186
  "INVALID_CONFIGURATION",
40183
- "Build from a clean Git checkout so the compiled code identity names the code being built."
40187
+ "Committed files must be unchanged. Commit or undo your changes, then build again."
40184
40188
  );
40185
40189
  if (!/^[a-f0-9]{40}$/.test(commitSha))
40186
40190
  throw new PlumeBuildError(
@@ -40239,11 +40243,17 @@ async function runBuild(options2) {
40239
40243
  mode: 420
40240
40244
  });
40241
40245
  await rename3(temporary, bindingFile);
40242
- if (await git(cwd, "rev-parse", "HEAD") !== commitSha || await git(cwd, "status", "--porcelain=v1", "--untracked-files=all"))
40246
+ const untracked = await untrackedFiles(cwd);
40247
+ if (await git(cwd, "rev-parse", "HEAD") !== commitSha || !untracked)
40243
40248
  throw new PlumeBuildError(
40244
40249
  "INVALID_CONFIGURATION",
40245
40250
  "The checkout changed while validating the build."
40246
40251
  );
40252
+ if (untracked.length)
40253
+ process.stderr.write(
40254
+ `Building commit ${commitSha.slice(0, 7)} with new files not in Git: ${untracked.join(", ")}
40255
+ `
40256
+ );
40247
40257
  return { exitCode: await runCommand2(cwd, options2.command), binding };
40248
40258
  } catch (error62) {
40249
40259
  await rm5(bindingFile, { force: true }).catch(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plume-press/cli",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
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",