@plume-press/cli 0.8.4 → 0.9.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 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.4
6
+ npm install --save-dev @plume-press/cli@0.9.0
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 production SSR, with no host setting. The explicit modes are --delivery production-ssr for public request-time content, 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. Compilation records the actual SHA and environment. 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, with no host setting: it builds production SSR, or static in the preview environment for a commit Plume pushed for an Update whose content is not published yet. The explicit modes are --delivery production-ssr for public request-time content, 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. Compilation records the actual SHA and environment. 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; static uses createPlume with the compiled binding. Static or cached pages need a rebuild or real invalidation for freshness.
35
35
 
package/dist/cli.mjs CHANGED
@@ -36477,7 +36477,7 @@ Choose the mode explicitly in application/server configuration:
36477
36477
  - **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.
36478
36478
  - **Deliberately static build:** plume build --delivery static -- <existing framework build command> compiles one immutable selection: the latest published content for the checkout's schema, or an Update's own content when its pull request is built before it is published. Newly published content shows after the next rebuild; a latest probe cannot certify an old page.
36479
36479
  - **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.
36480
- - **One build script for live and preview branches:** plume build --delivery auto -- <existing framework build command> builds as production-ssr, so the host needs no setting. .plume/delivery.json records the resolved mode; choose the reader from that compiled mode, never from runtime variables.
36480
+ - **One build script for live and preview branches:** plume build --delivery auto -- <existing framework build command> needs no host setting: it builds as production-ssr, or as static in the preview environment for a commit Plume pushed for an Update whose content is not published yet (a shared preview build or an Update's pull request), so that build shows the Update. Wire both readers. .plume/delivery.json records the resolved mode; choose the reader from that compiled mode, never from runtime variables.
36481
36481
 
36482
36482
  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.
36483
36483
 
@@ -36974,7 +36974,7 @@ var init_package = __esm({
36974
36974
  "packages/sdk/package.json"() {
36975
36975
  package_default = {
36976
36976
  name: "@plume-press/sdk",
36977
- version: "0.4.0",
36977
+ version: "0.5.0",
36978
36978
  private: true,
36979
36979
  license: "MIT",
36980
36980
  type: "module",
@@ -37001,7 +37001,7 @@ var init_package2 = __esm({
37001
37001
  "packages/cli/package.json"() {
37002
37002
  package_default2 = {
37003
37003
  name: "@plume-press/cli",
37004
- version: "0.8.4",
37004
+ version: "0.9.0",
37005
37005
  private: true,
37006
37006
  license: "MIT",
37007
37007
  type: "module",
@@ -39506,7 +39506,8 @@ var MAX_SCHEMA_BYTES2 = 256 * 1024;
39506
39506
  var validationSchema = external_exports.object({
39507
39507
  binding: contentBindingSchema,
39508
39508
  revision: external_exports.number().int().nonnegative(),
39509
- sealed: external_exports.literal(true)
39509
+ sealed: external_exports.literal(true),
39510
+ preview: external_exports.boolean()
39510
39511
  }).strict();
39511
39512
  var PlumeBuildError = class extends Error {
39512
39513
  constructor(code, message) {
@@ -39626,7 +39627,7 @@ async function validateRemote(url2, binding, commitSha) {
39626
39627
  );
39627
39628
  if (result.binding.siteId !== binding.siteId || result.binding.schemaHash !== binding.schemaHash)
39628
39629
  throw Error();
39629
- return result.binding;
39630
+ return result;
39630
39631
  } catch {
39631
39632
  throw new PlumeBuildError(
39632
39633
  "INVALID_RESPONSE",
@@ -39716,15 +39717,15 @@ async function runBuild(options2) {
39716
39717
  "INVALID_CONFIGURATION",
39717
39718
  "Build from an exact Git commit."
39718
39719
  );
39720
+ const { binding, preview } = await validateRemote(url2, lock, commitSha);
39719
39721
  const requested = options2.delivery ?? "static";
39720
- const mode = requested === "auto" ? "production-ssr" : requested;
39721
- const binding = await validateRemote(url2, lock, commitSha);
39722
+ const update = requested === "auto" && preview;
39722
39723
  const descriptor = deliveryDescriptorSchema.safeParse({
39723
39724
  version: 1,
39724
- mode,
39725
+ mode: update ? "static" : requested === "auto" ? "production-ssr" : requested,
39725
39726
  artifact: {
39726
39727
  commitSha,
39727
- environment: options2.environment ?? "production"
39728
+ environment: options2.environment ?? (update ? "preview" : "production")
39728
39729
  },
39729
39730
  binding
39730
39731
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plume-press/cli",
3
- "version": "0.8.4",
3
+ "version": "0.9.0",
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",