@page-engine/page-cli
v0.4.0
Published
Command-line compiler and standalone package builder for PageEngine.
Downloads
1,001
Readme
@page-engine/page-cli
Command-line compiler and standalone package builder for the PageEngine declarative front-end engine.
Wraps @page-engine/page-compiler with file adapters and adds
build-standalone: compile a multi-page project, validate cross-page
navigation, code-split renderer registries per renderer via dynamic imports,
bundle the application entry with Vite/esbuild, and publish a
deterministic, digest-verified Standalone Runtime Package that
@page-engine/page-standalone-host can boot securely in the browser.
- Build-time fail-closed: schema, pointer, policy, and renderer-contract violations reject the build with structured diagnostics.
- Deterministic output: identical inputs produce identical package bytes.
Install
npm install --save-dev @page-engine/page-cliRequires Node >= 22.12 (Vite 8 requirement). ESM only. Ships the
page-engine bin.
Usage
page-engine build-standalone --project path/to/project.json --out dist/runtimeThe project file (page.standalone-project/v1) declares the application id,
start page, per-page Page Source files, the inventory bundle, the
application entry, and the renderer allowlist. The command exits non-zero
and prints structured diagnostics (reason code + JSON pointer path) on any
violation.
Programmatic use:
import { buildStandaloneProject, runCli } from "@page-engine/page-cli";
const result = await buildStandaloneProject({ projectFile: "project.json", out: "dist/runtime" });
if (!result.ok) throw new Error(JSON.stringify(result.diagnostics));
const code = await runCli(["build-standalone", "--project", "project.json", "--out", "dist/runtime"], {
stdout: (value) => process.stdout.write(value),
stderr: (value) => process.stderr.write(value),
});See the monorepo examples/security-standalone for a complete project and
the CLI tests (packages/page-cli/test) for the contract surface.
