@open-press/cli 1.0.0 → 1.1.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 +11 -12
- package/dist/cli.js +298 -79
- package/package.json +9 -7
- package/template/core/AGENTS.md +0 -130
- package/template/core/CHANGELOG.md +0 -218
- package/template/core/README.md +0 -43
- package/template/core/engine/cli.mjs +0 -96
- package/template/core/engine/commands/_shared.mjs +0 -199
- package/template/core/engine/commands/deploy.mjs +0 -31
- package/template/core/engine/commands/dev.mjs +0 -49
- package/template/core/engine/commands/doctor.mjs +0 -229
- package/template/core/engine/commands/export.mjs +0 -8
- package/template/core/engine/commands/image.mjs +0 -29
- package/template/core/engine/commands/inspect.mjs +0 -35
- package/template/core/engine/commands/pdf.mjs +0 -26
- package/template/core/engine/commands/preview.mjs +0 -26
- package/template/core/engine/commands/render.mjs +0 -17
- package/template/core/engine/commands/replace.mjs +0 -41
- package/template/core/engine/commands/search.mjs +0 -33
- package/template/core/engine/commands/skills-sync.mjs +0 -71
- package/template/core/engine/commands/typecheck.mjs +0 -67
- package/template/core/engine/commands/upgrade.mjs +0 -159
- package/template/core/engine/commands/validate.mjs +0 -17
- package/template/core/engine/document-export.mjs +0 -15
- package/template/core/engine/output/chrome-pdf.d.mts +0 -34
- package/template/core/engine/output/chrome-pdf.mjs +0 -450
- package/template/core/engine/output/deploy-sync.mjs +0 -15
- package/template/core/engine/output/fonts.mjs +0 -62
- package/template/core/engine/output/katex-assets.mjs +0 -45
- package/template/core/engine/output/page-block.mjs +0 -30
- package/template/core/engine/output/pdf-media.mjs +0 -45
- package/template/core/engine/output/public-assets.mjs +0 -19
- package/template/core/engine/output/static-server.mjs +0 -571
- package/template/core/engine/react/caption-numbering.mjs +0 -73
- package/template/core/engine/react/comment-endpoint.d.mts +0 -11
- package/template/core/engine/react/comment-endpoint.mjs +0 -102
- package/template/core/engine/react/comment-marker.mjs +0 -374
- package/template/core/engine/react/document-entry.mjs +0 -331
- package/template/core/engine/react/document-export.mjs +0 -512
- package/template/core/engine/react/http-json.mjs +0 -24
- package/template/core/engine/react/mdx-compile.mjs +0 -629
- package/template/core/engine/react/measurement-css.mjs +0 -157
- package/template/core/engine/react/object-entities.mjs +0 -204
- package/template/core/engine/react/pagination/allocator.mjs +0 -167
- package/template/core/engine/react/pagination/regions.mjs +0 -81
- package/template/core/engine/react/pagination-constants.mjs +0 -3
- package/template/core/engine/react/pagination.mjs +0 -9
- package/template/core/engine/react/pipeline/allocate.mjs +0 -217
- package/template/core/engine/react/pipeline/final-render.mjs +0 -94
- package/template/core/engine/react/pipeline/frame-measurement.mjs +0 -306
- package/template/core/engine/react/pipeline/press-tree.mjs +0 -135
- package/template/core/engine/react/press-tree-inspection.mjs +0 -172
- package/template/core/engine/react/project-asset-endpoint.d.mts +0 -10
- package/template/core/engine/react/project-asset-endpoint.mjs +0 -361
- package/template/core/engine/react/section-css.mjs +0 -56
- package/template/core/engine/react/source-edit-endpoint.d.mts +0 -10
- package/template/core/engine/react/source-edit-endpoint.mjs +0 -75
- package/template/core/engine/react/sources/heading-numbering.mjs +0 -132
- package/template/core/engine/react/sources/mdx-resolver.mjs +0 -439
- package/template/core/engine/react/style-discovery.mjs +0 -160
- package/template/core/engine/runtime/config.d.mts +0 -48
- package/template/core/engine/runtime/config.mjs +0 -172
- package/template/core/engine/runtime/file-utils.mjs +0 -114
- package/template/core/engine/runtime/file-walk.mjs +0 -22
- package/template/core/engine/runtime/inspection.mjs +0 -328
- package/template/core/engine/runtime/issue-report.mjs +0 -44
- package/template/core/engine/runtime/page-geometry.mjs +0 -131
- package/template/core/engine/runtime/path-utils.mjs +0 -20
- package/template/core/engine/runtime/source-text-tools.d.mts +0 -102
- package/template/core/engine/runtime/source-text-tools.mjs +0 -832
- package/template/core/engine/runtime/source-workspace.mjs +0 -168
- package/template/core/engine/runtime/validation.mjs +0 -183
- package/template/core/index.html +0 -13
- package/template/core/openpress.config.mjs +0 -8
- package/template/core/package.json +0 -89
- package/template/core/src/main.tsx +0 -16
- package/template/core/src/openpress/app/OpenPressApp.tsx +0 -296
- package/template/core/src/openpress/app/OpenPressRuntime.tsx +0 -102
- package/template/core/src/openpress/app/WorkspaceGalleryPage.tsx +0 -219
- package/template/core/src/openpress/app/index.ts +0 -2
- package/template/core/src/openpress/core/Frame.tsx +0 -91
- package/template/core/src/openpress/core/FrameContext.tsx +0 -26
- package/template/core/src/openpress/core/MdxArea.tsx +0 -34
- package/template/core/src/openpress/core/Press.tsx +0 -55
- package/template/core/src/openpress/core/Workspace.tsx +0 -36
- package/template/core/src/openpress/core/cn.ts +0 -4
- package/template/core/src/openpress/core/index.tsx +0 -47
- package/template/core/src/openpress/core/primitives.tsx +0 -91
- package/template/core/src/openpress/core/types.ts +0 -236
- package/template/core/src/openpress/core/useSource.ts +0 -28
- package/template/core/src/openpress/document-model/anchorMapModel.ts +0 -27
- package/template/core/src/openpress/document-model/documentIndexes.ts +0 -329
- package/template/core/src/openpress/document-model/documentTypes.ts +0 -147
- package/template/core/src/openpress/document-model/index.ts +0 -7
- package/template/core/src/openpress/document-model/objectEntityModel.ts +0 -55
- package/template/core/src/openpress/document-model/projectIdentityModel.ts +0 -15
- package/template/core/src/openpress/document-model/reactDocumentMetadataModel.ts +0 -27
- package/template/core/src/openpress/document-model/workspaceManifestModel.ts +0 -57
- package/template/core/src/openpress/manuscript/index.tsx +0 -238
- package/template/core/src/openpress/mdx/index.ts +0 -96
- package/template/core/src/openpress/numbering/index.ts +0 -294
- package/template/core/src/openpress/reader/PageThumbnailsPanel.tsx +0 -168
- package/template/core/src/openpress/reader/PublicReaderPage.tsx +0 -267
- package/template/core/src/openpress/reader/ReaderNavigationPanel.tsx +0 -123
- package/template/core/src/openpress/reader/index.ts +0 -11
- package/template/core/src/openpress/reader/pageViewportScaleModel.ts +0 -73
- package/template/core/src/openpress/reader/readerPageRegistry.ts +0 -41
- package/template/core/src/openpress/reader/readerPageRoute.ts +0 -21
- package/template/core/src/openpress/reader/readerScroll.ts +0 -92
- package/template/core/src/openpress/reader/readerStateModel.ts +0 -15
- package/template/core/src/openpress/reader/readerTypes.ts +0 -4
- package/template/core/src/openpress/reader/usePageViewportScale.ts +0 -119
- package/template/core/src/openpress/reader/usePanelState.ts +0 -56
- package/template/core/src/openpress/reader/useReaderHashSync.ts +0 -61
- package/template/core/src/openpress/reader/useReaderKeyboardNav.ts +0 -48
- package/template/core/src/openpress/reader/useReaderRuntime.ts +0 -146
- package/template/core/src/openpress/reader/useReaderScrollAnchor.ts +0 -64
- package/template/core/src/openpress/shared/Panel.tsx +0 -77
- package/template/core/src/openpress/shared/frameScheduler.ts +0 -32
- package/template/core/src/openpress/shared/index.ts +0 -4
- package/template/core/src/openpress/shared/numberUtils.ts +0 -3
- package/template/core/src/openpress/shared/runtimeMode.ts +0 -11
- package/template/core/src/openpress/workbench/Workbench.tsx +0 -506
- package/template/core/src/openpress/workbench/actions/DeploymentControl.tsx +0 -157
- package/template/core/src/openpress/workbench/actions/ExportImageControl.tsx +0 -96
- package/template/core/src/openpress/workbench/actions/PageZoomControl.tsx +0 -182
- package/template/core/src/openpress/workbench/actions/SearchControl.tsx +0 -345
- package/template/core/src/openpress/workbench/actions/deploymentStatusModel.ts +0 -112
- package/template/core/src/openpress/workbench/actions/index.ts +0 -6
- package/template/core/src/openpress/workbench/actions/useDeploymentWorkbench.ts +0 -136
- package/template/core/src/openpress/workbench/dialog/WorkbenchDialog.tsx +0 -72
- package/template/core/src/openpress/workbench/dialog/index.ts +0 -1
- package/template/core/src/openpress/workbench/document/components/DocumentPanel.tsx +0 -127
- package/template/core/src/openpress/workbench/document/components/InlineSourceEditorLayer.tsx +0 -207
- package/template/core/src/openpress/workbench/document/components/ReaderStage.tsx +0 -9
- package/template/core/src/openpress/workbench/document/hooks/useDocumentWorkbenchModel.ts +0 -34
- package/template/core/src/openpress/workbench/document/hooks/useInlineDocumentEditor.ts +0 -525
- package/template/core/src/openpress/workbench/document/index.ts +0 -10
- package/template/core/src/openpress/workbench/index.ts +0 -2
- package/template/core/src/openpress/workbench/inspector/InlineInspectorLayer.tsx +0 -459
- package/template/core/src/openpress/workbench/inspector/index.ts +0 -5
- package/template/core/src/openpress/workbench/inspector/inlineCommentModel.ts +0 -125
- package/template/core/src/openpress/workbench/inspector/inspectorGeometryModel.ts +0 -160
- package/template/core/src/openpress/workbench/inspector/inspectorModel.ts +0 -408
- package/template/core/src/openpress/workbench/inspector/useInspectorComments.ts +0 -254
- package/template/core/src/openpress/workbench/mentions/MentionSuggestionList.tsx +0 -41
- package/template/core/src/openpress/workbench/mentions/index.ts +0 -2
- package/template/core/src/openpress/workbench/mentions/useComposerMentions.ts +0 -185
- package/template/core/src/openpress/workbench/panels/Panel.tsx +0 -1
- package/template/core/src/openpress/workbench/panels/PendingCommentsPanel.tsx +0 -80
- package/template/core/src/openpress/workbench/panels/WorkbenchControlPanel.tsx +0 -29
- package/template/core/src/openpress/workbench/panels/index.ts +0 -3
- package/template/core/src/openpress/workbench/project/ProjectEntryPanel.tsx +0 -525
- package/template/core/src/openpress/workbench/project/ProjectPreviewDialog.tsx +0 -35
- package/template/core/src/openpress/workbench/project/index.ts +0 -2
- package/template/core/src/openpress/workbench/project/projectPreviewTypes.ts +0 -11
- package/template/core/src/openpress/workbench/project/projectSourceModel.ts +0 -24
- package/template/core/src/openpress/workbench/shell/WorkbenchShell.tsx +0 -167
- package/template/core/src/openpress/workbench/shell/index.ts +0 -1
- package/template/core/src/openpress/workbench/workbenchFormatters.ts +0 -120
- package/template/core/src/openpress/workbench/workbenchTypes.ts +0 -35
- package/template/core/src/styles/openpress/app-shell.css +0 -251
- package/template/core/src/styles/openpress/media-workspace.css +0 -230
- package/template/core/src/styles/openpress/print-route.css +0 -184
- package/template/core/src/styles/openpress/project-preview-panel.css +0 -924
- package/template/core/src/styles/openpress/public-viewer.css +0 -688
- package/template/core/src/styles/openpress/reader-runtime.css +0 -989
- package/template/core/src/styles/openpress/responsive.css +0 -245
- package/template/core/src/styles/openpress/workbench-panels.css +0 -707
- package/template/core/src/styles/openpress/workbench.css +0 -1255
- package/template/core/src/styles/openpress/workspace-gallery.css +0 -300
- package/template/core/src/styles/openpress.css +0 -15
- package/template/core/src/vite-env.d.ts +0 -9
- package/template/core/tsconfig.json +0 -40
- package/template/core/vite.config.ts +0 -584
package/template/core/AGENTS.md
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
# Working on this open-press workspace
|
|
2
|
-
|
|
3
|
-
This directory is an **open-press workspace** scaffolded by
|
|
4
|
-
`@open-press/cli`. You (the agent) own:
|
|
5
|
-
|
|
6
|
-
- `document/` — chapters (MDX), components, theme, media. The actual content.
|
|
7
|
-
- `package.json` / `openpress.config.mjs` — project metadata + build config.
|
|
8
|
-
- `.agents/skills/` — agent skills installed by `npx skills` (auto-refreshed via `npx open-press upgrade`).
|
|
9
|
-
|
|
10
|
-
The rest of the tree is the open-press framework copied at scaffold time
|
|
11
|
-
(`engine/`, `src/`, `vite.config.ts`, etc). Treat it as vendored — don't
|
|
12
|
-
hand-edit unless the user explicitly asks; the next `npx open-press upgrade`
|
|
13
|
-
will rewrite it.
|
|
14
|
-
|
|
15
|
-
## Quick reference
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm run dev # workbench at http://127.0.0.1:5173/?dev=1
|
|
19
|
-
npm run build # validate + render dist-react/
|
|
20
|
-
npm run openpress:image # write dist-react/images/page-*.png
|
|
21
|
-
npm run openpress:pdf # write document.pdf
|
|
22
|
-
npm run openpress:deploy # deploy via the configured adapter
|
|
23
|
-
npx open-press doctor # current vs latest version + pending migrations
|
|
24
|
-
npx open-press upgrade # apply the upgrade flow (see below)
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
The intermediate engine steps live behind `node engine/cli.mjs` if you
|
|
28
|
-
need them directly (rarely): `validate` (source-level checks only,
|
|
29
|
-
fast), `export` (write `public/openpress/document.json` without
|
|
30
|
-
bundling), `inspect` (post-render geometry + comment markers).
|
|
31
|
-
|
|
32
|
-
## When the user asks to upgrade
|
|
33
|
-
|
|
34
|
-
Triggers: "升級 / 套件更新 / upgrade open-press / apply latest design /
|
|
35
|
-
update to vX.Y.Z" etc.
|
|
36
|
-
|
|
37
|
-
**Follow the upgrade SOP, do NOT manually diff template versions:**
|
|
38
|
-
|
|
39
|
-
1. `npx open-press doctor` — confirm current vs latest, count pending
|
|
40
|
-
migrations.
|
|
41
|
-
2. Ask the user "go ahead?" — briefly mention what will change (deps,
|
|
42
|
-
skills, migrations to read).
|
|
43
|
-
3. `npx open-press upgrade` — refreshes `@open-press/core`, refreshes
|
|
44
|
-
installed skills, **fetches migration notes for each pending version
|
|
45
|
-
into `.openpress/migrations/<version>.md`** and lists the paths.
|
|
46
|
-
4. For each migration file listed, read it fully. Each has a
|
|
47
|
-
`Document-level changes` section with `rg` find + rewrite rules.
|
|
48
|
-
Apply to `document/` with user confirmation.
|
|
49
|
-
5. Verify:
|
|
50
|
-
```bash
|
|
51
|
-
npm run build
|
|
52
|
-
```
|
|
53
|
-
Fix anything broken using the migration notes.
|
|
54
|
-
6. Report to the user: starting version → ending version, what was
|
|
55
|
-
applied, anything that needed manual judgement.
|
|
56
|
-
|
|
57
|
-
**Anti-pattern**: running `npx @open-press/cli@latest init` somewhere
|
|
58
|
-
and manually diffing against the workspace. The migration notes are the
|
|
59
|
-
authoritative source for what changed; fresh templates ship default
|
|
60
|
-
content that does not apply to a customised workspace.
|
|
61
|
-
|
|
62
|
-
## When the user says "I changed X but the page didn't update"
|
|
63
|
-
|
|
64
|
-
Common cause: **the reader renders from a static `public/openpress/document.json`,
|
|
65
|
-
not from your live MDX / theme files.** Vite Hot Reload covers React UI
|
|
66
|
-
chrome (workbench panels, inspector, navigation) but it does **not**
|
|
67
|
-
regenerate `document.json`. So edits to:
|
|
68
|
-
|
|
69
|
-
- `document/chapters/**/*.mdx` (prose)
|
|
70
|
-
- `document/index.tsx` (Press tree, Cover/BackCover JSX)
|
|
71
|
-
- `document/components/**/*.tsx` (Page, openers, custom components)
|
|
72
|
-
- `document/theme/**` style files that affect pagination capacity
|
|
73
|
-
- `openpress.config.mjs` metadata (title, captionNumbering, …)
|
|
74
|
-
|
|
75
|
-
…all need a re-export before the workbench / public viewer reflect
|
|
76
|
-
the change:
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
npm run build # validate + render (includes the export step)
|
|
80
|
-
# then refresh the browser
|
|
81
|
-
# — or, for the inner export only, without the full Vite bundle step:
|
|
82
|
-
node engine/cli.mjs export .
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
Quick rules of thumb:
|
|
86
|
-
|
|
87
|
-
- Pure CSS edits under `document/theme/` that don't move blocks → HMR
|
|
88
|
-
is enough (CSS is hot-replaced).
|
|
89
|
-
- Anything that affects content, pagination, or metadata → re-build (or
|
|
90
|
-
call `node engine/cli.mjs export .` for just the JSON refresh).
|
|
91
|
-
|
|
92
|
-
**Agent SOP**: after applying any non-CSS edit to `document/`, run
|
|
93
|
-
`npm run build` before telling the user "done". If they ask "why
|
|
94
|
-
didn't my change show up?", check whether `document.json` was
|
|
95
|
-
regenerated since the edit.
|
|
96
|
-
|
|
97
|
-
## When the user reports a render / paginate issue
|
|
98
|
-
|
|
99
|
-
Press Tree paginates at build time. Common things to check:
|
|
100
|
-
|
|
101
|
-
1. `npm run build` then inspect
|
|
102
|
-
`public/openpress/document.json` for `source.warnings` (chain
|
|
103
|
-
overflow, missing chains, etc.).
|
|
104
|
-
2. `node engine/cli.mjs validate .` for structural issues
|
|
105
|
-
(missing entries, broken anchors) — faster than a full build.
|
|
106
|
-
3. `npm run dev` and use the workbench inspector to find which MDX
|
|
107
|
-
block / Frame element is misbehaving — comments and inline
|
|
108
|
-
annotations work directly from there.
|
|
109
|
-
|
|
110
|
-
## Skills
|
|
111
|
-
|
|
112
|
-
This workspace ships agent skills under `.agents/skills/`. If your
|
|
113
|
-
platform supports skills (Claude Code, Cursor, Codex, Cline, Gemini
|
|
114
|
-
CLI, …), prefer invoking them over re-reading this file:
|
|
115
|
-
|
|
116
|
-
- `openpress` — operate the workspace (CLI, validate, export, render,
|
|
117
|
-
PDF, deploy, search/replace, comments, upgrades, routing).
|
|
118
|
-
- `openpress-writing` — writing-time rules for MDX prose.
|
|
119
|
-
- `openpress-design` — theme tokens, layout, page surfaces.
|
|
120
|
-
- `openpress-deploy` — deployment workflows.
|
|
121
|
-
- `openpress-init` — scaffolding new workspaces.
|
|
122
|
-
- Plus any style-pack-specific skills installed by the user.
|
|
123
|
-
|
|
124
|
-
Skills are kept in sync by `npx skills upgrade` (run automatically
|
|
125
|
-
inside `npx open-press upgrade`).
|
|
126
|
-
|
|
127
|
-
## Reporting issues
|
|
128
|
-
|
|
129
|
-
- Issues / questions: https://github.com/quan0715/open-press/issues
|
|
130
|
-
- Source: https://github.com/quan0715/open-press
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
# @open-press/core
|
|
2
|
-
|
|
3
|
-
## 1.0.0
|
|
4
|
-
|
|
5
|
-
### Major Changes
|
|
6
|
-
|
|
7
|
-
- 8c528ad: 1.0 contract release. Breaking changes:
|
|
8
|
-
- `<Workspace>` is now required at the root of `press/index.tsx`; `<Press>` lives as a child, and multi-Press workspaces are first-class (each `<Press>` exports to `/openpress/<slug>/document.json`).
|
|
9
|
-
- Document metadata (`title` / `subtitle` / `organization` / `page` / `sources` / `captionNumbering`) moves onto `<Press>` JSX props. `export const config` and `export const sources` are removed.
|
|
10
|
-
- `openpress.config.mjs` is removed. Operational settings (deploy / pdf) live in the workspace `package.json` under the `"openpress"` field; paths are convention (`press/`, `press/<slug>/chapters/`, `press/theme/`, `public/openpress/`, `dist-react/`).
|
|
11
|
-
- Workspace folder renamed from `document/` → `press/`. The dogfood and starter skills are migrated.
|
|
12
|
-
- Reader gains a workspace gallery for multi-Press projects, per-page PNG export, page thumbnails for canvas-style Press, and a back-to-workspace button.
|
|
13
|
-
- New built-in page presets `a4`, `social-square`, `slide-16-9` and improved init metadata propagation.
|
|
14
|
-
|
|
15
|
-
## 0.8.0
|
|
16
|
-
|
|
17
|
-
### Minor Changes
|
|
18
|
-
|
|
19
|
-
- **Workbench architecture**: the monolithic `workbench.tsx` is split into a modular structure under `workbench/{shell,panels,actions,inspector,mentions,project,document}/`. New panels: `DeploymentControl`, `SearchControl`, `PendingCommentsPanel`, `DocumentPanel`, `ProjectEntryPanel`, plus `WorkbenchShell` and `InlineInspectorLayer`.
|
|
20
|
-
- **Module reorganization**: source tree split into typed subdirectories:
|
|
21
|
-
- `app/`: `OpenPressApp`, `OpenPressRuntime` (replaces the old `App.tsx` + `renderer.tsx`)
|
|
22
|
-
- `document-model/`: `anchorMap`, `documentIndexes`, `documentTypes`, `objectEntityModel`, `projectIdentity`, `reactDocumentMetadata`
|
|
23
|
-
- `reader/`: `PublicReaderPage`, `ReaderNavigationPanel`, `useReaderRuntime`, registry/route/scroll/state helpers
|
|
24
|
-
- `shared/`: `frameScheduler`, `runtimeMode`, `Panel`, `numberUtils`
|
|
25
|
-
- **Object-entity model**: `Frame` and `MdxArea` now expose `data-openpress-object-id`. New `document-model/objectEntityModel` defines the id format.
|
|
26
|
-
- **`MediaFigure` / `ImageFigure`**: new core primitives that accept `src/alt/caption` and resolve relative paths to `/openpress/media/...` automatically.
|
|
27
|
-
- **`<Sections>` default page**: `page` prop becomes optional; when omitted the built-in `DefaultSectionPage` renders the standard manuscript frame.
|
|
28
|
-
- **Engine helpers**: new `engine/react/{http-json,object-entities,source-edit-endpoint}.mjs` and `engine/runtime/{file-walk,path-utils}.mjs` runtime helpers. `engine/runtime/source-text-tools` exports TypeScript definitions.
|
|
29
|
-
- **Dev endpoints**: vite plugin wires `/__openpress/search` and `/__openpress/source-edit` middlewares for the new workbench search + inline editing flows.
|
|
30
|
-
- **Inline source editor**: ships the `InlineSourceEditorLayer` UI on top of `useInlineDocumentEditor` + `/__openpress/source-edit`. The hook now uses a `MutationObserver` so newly inserted blocks become editable, and routes mouse clicks through `focus()` to preserve selection on `contenteditable` boundaries. Workbench wires `sourceEditorTarget` state into the layer.
|
|
31
|
-
- **Table editing in the source pipeline**: table captions are emitted as standalone source blocks (`kind=element`, `name=caption`, `layout="attached"`) with `data-openpress-block-id`/`data-openpress-object-id` markers and preserved source positions; the allocator treats `layout="attached"` blocks as non-paginable. `applySourceBlockTableCellEditToText` (in `engine/runtime/source-text-tools`) accepts a `cellIndex` so the inline source editor can target a single `<td>`.
|
|
32
|
-
- **Reader pagination**: arrow-key pagination now defers to the user's active text selection. Shift-arrow / mouse-drag selections no longer get swallowed by the page-turn shortcut.
|
|
33
|
-
- **Page zoom + spread layout**: new `reader/pageViewportScaleModel` + `usePageViewportScale` hook drive a `--openpress-page-viewport-scale` CSS variable on the page container; the workbench toolbar exposes a `PageZoomControl` dropdown with fit-width / fit-page / fixed percentages plus a one-page / two-page spread toggle.
|
|
34
|
-
- **Inspector cell-precision comments**: `CommentDraft` gains an optional `targetObjectId` so a comment can point at a sub-block (e.g. a single table cell) while still attributing the source position to its enclosing block. `formatInspectorHint` carries the value through to the wire hint.
|
|
35
|
-
- **Shared `WorkbenchDialog` shell**: portal + backdrop + header (eyebrow / title / title-meta / close) + optional footer. `DeploymentControl`, `SearchControl`, and `ProjectPreviewDialog` all render through this shell now, replacing the prior per-dialog scaffolding under `openpress-deploy-dialog-*` / `openpress-search-dialog-*` / `openpress-project-preview-dialog__*`.
|
|
36
|
-
- **`WorkbenchControlPanel` registry**: `HtmlWorkbench` now accepts an `extraControlPanels?: WorkbenchPanel[]` prop and renders the right-side panel from a `{ id, render }` registry. Built-in panels (pending comments, project entry) ship as the first entries.
|
|
37
|
-
- **Workbench state hooks**: extract `useDeploymentWorkbench` and `useInspectorComments` from `HtmlWorkbench`; `useReaderRuntime` is split into focused sub-hooks (`usePanelState`, `useReaderScrollAnchor`, `useReaderHashSync`, `useReaderKeyboardNav`).
|
|
38
|
-
- **`InlineInspectorLayer` memoization**: now wrapped in `React.memo` with a stable `geometryVersion` prop so the geometry / event listeners no longer rebuild on every parent render.
|
|
39
|
-
- **Panels open lazily**: `usePanelState` now defaults both panels closed, so the reader opens with a clean stage; resize never auto-opens them.
|
|
40
|
-
|
|
41
|
-
### Patch Changes
|
|
42
|
-
|
|
43
|
-
- Inspector: fix comment-marker count and multi-target marker rendering.
|
|
44
|
-
- Inspector: object-entity id helpers consolidate in `document-model/objectEntityModel` instead of being duplicated inside `Frame`, `MdxArea`, manuscript `TocArea`, and `PublicReaderPage`.
|
|
45
|
-
- Inline editor: `useInlineDocumentEditor` exposes `onDocumentEdited`; `OpenPressApp` re-loads `/openpress/document.json` after a successful inline edit so derived indexes stay in sync.
|
|
46
|
-
- Dev: reset Vite optimizer cache so workspace-side dependencies are picked up.
|
|
47
|
-
- Workbench dialog: viewport-aware width + max-height so a big media preview doesn't blow up the dialog to full screen.
|
|
48
|
-
- Project composer: add `/apply-comments` to the skill mention list so pending comment resolution can be invoked from the workbench.
|
|
49
|
-
- Carries forward the 0.7.1 measurement + pagination fixes (font/image readiness, relative media src inlining, list-per-item paging, `OPENPRESS_DEBUG_ALLOC`, academic-paper starter body overflow).
|
|
50
|
-
|
|
51
|
-
### Breaking Changes
|
|
52
|
-
|
|
53
|
-
- `FrameContext.consumeArea(chainId)` return type changes from `ReactNode | null` to `{ indexInFrame: number; blocks: ReactNode | null }`. Custom `Frame` consumers must read `.blocks`.
|
|
54
|
-
- `App` export is renamed to `OpenPressApp` and now lives under `@open-press/core/app`. The old `renderer.tsx` is replaced by `OpenPressRuntime`.
|
|
55
|
-
- `data-openpress-mdx-area-empty` is now always emitted (`"true"` / `"false"`). Selectors that relied on the attribute being absent need updating.
|
|
56
|
-
- Reader `ViewMode` collapses to `"paged"` only — the legacy `"reading"` flow mode is removed. Use `usePageViewportScale` for free-scaling instead.
|
|
57
|
-
- Several internal module paths moved into subdirectories (`document-model/`, `reader/`, `shared/`, `workbench/...`). Consumers that deep-imported from the openpress source must switch to the new barrels.
|
|
58
|
-
- Shared dialog scaffolding (backdrop, container, header, close button) moved from per-dialog class families (`openpress-deploy-dialog-backdrop`, `__panel`, `__panel header`, `__close`, etc.) to the shared `openpress-workbench-dialog*` family. Per-dialog modifier classes (`openpress-deploy-dialog`, `openpress-search-dialog`, `openpress-project-preview-dialog`) are still applied for dialog-specific styling. Selectors that targeted the old scaffolding names (notably `*-backdrop` and `__panel`) need updating; selectors that combine the modifier class with new `__heading` / `__footer` / `__close` modifiers continue to work.
|
|
59
|
-
|
|
60
|
-
## 0.7.1
|
|
61
|
-
|
|
62
|
-
### Patch Changes
|
|
63
|
-
|
|
64
|
-
- Measurement pipeline + pagination fixes:
|
|
65
|
-
- **Measurement**: wait on `document.fonts.ready`, image `load`/`error` + `decode()`,
|
|
66
|
-
and two `requestAnimationFrame` ticks before sampling block heights so figures
|
|
67
|
-
no longer under-measure on cold loads.
|
|
68
|
-
- **Measurement**: inline relative `media/`, `./media/`, and `/openpress/media/`
|
|
69
|
-
image sources during the SSR measurement pass (previously only the absolute
|
|
70
|
-
`/openpress/media/...` form was rewritten, leaving relative refs as broken).
|
|
71
|
-
- **MDX compile**: split bullet/numbered lists into per-item paginable blocks
|
|
72
|
-
so long lists can break across pages without losing ordered numbering.
|
|
73
|
-
- **Debug**: new `OPENPRESS_DEBUG_ALLOC` env var prints per-iteration allocator
|
|
74
|
-
state (mdxArea capacities, block heights, pagination hints, warnings).
|
|
75
|
-
- **Academic-paper starter**: `<MdxArea overflow="extend">` on the body and the
|
|
76
|
-
single-column `.reader-page--content .page-body` override removed so content
|
|
77
|
-
paginates naturally with the new allocator.
|
|
78
|
-
|
|
79
|
-
## 0.7.0
|
|
80
|
-
|
|
81
|
-
### Minor Changes
|
|
82
|
-
|
|
83
|
-
- 718d2d1: **Press Tree render architecture** — full refresh of the React export pipeline (clean break, no v0.5 compatibility).
|
|
84
|
-
|
|
85
|
-
The render kernel no longer knows about `cover`, `toc`, `chapter`, or `back-cover` as built-in concepts. Workspaces describe their document as a React tree using three primitives:
|
|
86
|
-
- `Press` — root composition boundary.
|
|
87
|
-
- `Frame` — a single fixed-layout surface (replaces `BasePage` and friends).
|
|
88
|
-
- `MdxArea` — a measurable slot consuming a content chain, with `overflow="extend|truncate|error"` control.
|
|
89
|
-
|
|
90
|
-
Sources are now declarative descriptors:
|
|
91
|
-
|
|
92
|
-
```tsx
|
|
93
|
-
export const sources = {
|
|
94
|
-
story: mdxSource({ preset: "section-folders", root: "chapters" }),
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export default function MyPress() {
|
|
98
|
-
return (
|
|
99
|
-
<Press>
|
|
100
|
-
<Cover />
|
|
101
|
-
<Toc source="story" />
|
|
102
|
-
<Sections source="story" page={Page} />
|
|
103
|
-
<BackCover />
|
|
104
|
-
</Press>
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
Three `mdxSource()` presets: `section-folders` (existing convention), `section-files` (flat file-per-section), `file-list` (explicit ordering).
|
|
110
|
-
|
|
111
|
-
Manuscript helpers (`Toc`, `Sections`, `Chapters` alias) ship in `@open-press/core/manuscript`. `mdxSource()` lives in `@open-press/core/mdx`. Subpath exports keep the public surface tight without committing to separate npm packages.
|
|
112
|
-
|
|
113
|
-
`Toc` is implemented as a manuscript helper, not a core kernel special case. Registered sources generate a synthetic `toc:<sourceId>` chain; `TocArea` consumes it with the same allocation path as `MdxArea`.
|
|
114
|
-
|
|
115
|
-
Reader-side pagination is removed. The export pipeline writes final frame HTML into `document.json`; the reader displays that HTML and no longer mutates headings/captions, injects footers, or reflows pages at runtime. Page shell belongs to workspace components.
|
|
116
|
-
|
|
117
|
-
MDX source resolution now derives manuscript TOC entries from actual `##` / `###` headings, not folder slugs. Heading numbering is written during export as `data-chapter="01"` / `data-section="1.1"` attributes so themes can render numbering with CSS without reader-side mutation.
|
|
118
|
-
|
|
119
|
-
**Removed (no compatibility layer):**
|
|
120
|
-
- `BasePage`, `BaseCoverPage`, `BaseTocPage`, `BaseContentPage`, `BaseBackCoverPage`.
|
|
121
|
-
- Legacy named exports (`cover`, `toc`, `backCover`) from `document/index.tsx`.
|
|
122
|
-
- The `migrate-to-react` CLI command.
|
|
123
|
-
- Implicit chapter discovery as the only source mechanism.
|
|
124
|
-
- Legacy `chapter.tsx` meta/opener auto-discovery. Section openers are explicit workspace components in the Press tree.
|
|
125
|
-
|
|
126
|
-
The top-level purity gate remains: `config` must be data, `sources` must be pure `mdxSource()` descriptors, and filesystem/network/process side effects are rejected before module execution. Default-exported function bodies can contain normal React component logic, including hooks and `.map()`.
|
|
127
|
-
|
|
128
|
-
All `<Frame>` instances require a stable `frameKey`; source roots and file-list entries must stay inside `document/`.
|
|
129
|
-
|
|
130
|
-
**Workspace data attributes:**
|
|
131
|
-
- `data-frame-role` (new, opaque role like `"manuscript.content"`).
|
|
132
|
-
- `data-page-kind` (derived from role's last segment — reader CSS keeps using this).
|
|
133
|
-
- `data-section-id` replaces `data-chapter-slug` for section-scoped CSS.
|
|
134
|
-
|
|
135
|
-
**Migration:** Workspaces written for v0.5.x must rewrite `document/index.tsx` to default-export a Press component. Pre-1.0 minor bump is acceptable per repo policy; no production deployments exist to break.
|
|
136
|
-
|
|
137
|
-
## 0.6.0
|
|
138
|
-
|
|
139
|
-
### Minor Changes
|
|
140
|
-
|
|
141
|
-
- f8fdecd: Third bundled pack: `academic-paper`.
|
|
142
|
-
|
|
143
|
-
A single-column A4 academic / research paper starter — serif title block, abstract band, index terms, numbered sections (I, II, III), italic sub-sections (A, B, C), `[N]` numeric references, sample chapters derived from the IEEE conference template structure (Introduction, Methods, Results & Discussion, Acknowledgment, References).
|
|
144
|
-
|
|
145
|
-
```bash
|
|
146
|
-
npx @open-press/cli init my-paper --pack academic-paper
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
Suitable for: draft / preprint / iteration. Not suitable for camera-ready IEEE / ACM submission — those still need LaTeX with the publisher's class file.
|
|
150
|
-
|
|
151
|
-
Two-column body and other paged-document features (footnotes, cross-references with page numbers, running headers) are intentionally **out of scope for this release**. They'll be designed as a self-maintained engine evolution + multi-mode architecture in a separate spec round, rather than depending on a third-party pagination polyfill.
|
|
152
|
-
|
|
153
|
-
- c490653: `@open-press/cli init` accepts third-party style packs via `--pack github:owner/repo`.
|
|
154
|
-
|
|
155
|
-
```bash
|
|
156
|
-
# bundled (unchanged)
|
|
157
|
-
npx @open-press/cli init my-doc --pack editorial-monograph
|
|
158
|
-
|
|
159
|
-
# third-party (new)
|
|
160
|
-
npx @open-press/cli init my-thesis --pack github:quan0715/openpress-pack-nycu-thesis
|
|
161
|
-
npx @open-press/cli init my-paper --pack github:foo/their-pack#v1.2
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
The cli fetches `starter/document/` from the named repo (default branch, or `#ref` for a specific branch/tag) and copies it into the new workspace. If the pack repo also publishes SKILL files at `skills/<name>/`, they're installed via `npx skills add <owner>/<repo>` after the framework skills, so the agent picks them up automatically.
|
|
165
|
-
|
|
166
|
-
Repo layout convention for third-party packs is documented in `docs/style-pack-authoring.md`. Empty-result extraction (the named repo exists but has no `starter/document/` at root) fails with a clear error pointing at the expected layout.
|
|
167
|
-
|
|
168
|
-
The two bundled packs (`editorial-monograph`, `claude-document`) keep their current short-name behaviour; only the cli's validator widened to accept the `github:` prefix.
|
|
169
|
-
|
|
170
|
-
## 0.5.0
|
|
171
|
-
|
|
172
|
-
### Minor Changes
|
|
173
|
-
|
|
174
|
-
- 0169cba: Agent-driven upgrade flow.
|
|
175
|
-
|
|
176
|
-
**New commands:**
|
|
177
|
-
- `npx open-press doctor` — diagnose workspace against latest framework state. Reports `@open-press/core` version vs npm latest, installed skill count, and any pending `docs/migrations/<version>.md` notes between current and latest. `--json` for machine-readable output, `--no-cache` to bypass the 24h cache. Always exits 0 (informational only).
|
|
178
|
-
|
|
179
|
-
- `npx open-press upgrade` — orchestrate the upgrade. Runs `npm update @open-press/core` (when the workspace declares the dep) and `npx skills upgrade`, then surfaces the list of migration notes for the agent to read. **Does not auto-edit `document/` content** — the agent reads the surfaced `docs/migrations/<version>.md` notes and proposes edits to the user with confirmation. Use `--dry-run` to preview, `--no-deps` / `--no-skills` to target one layer.
|
|
180
|
-
|
|
181
|
-
**Dev startup notice:**
|
|
182
|
-
|
|
183
|
-
`open-press dev` now runs `doctor` before starting Vite. When the workspace is behind, a single line prints: `○ open-press: @open-press/core 0.4.0 → 0.5.0 · 1 migration note(s) — run npx open-press doctor for details.` Cached for 24h, network failure is silent, never blocks dev.
|
|
184
|
-
|
|
185
|
-
**Migration docs:**
|
|
186
|
-
- New `docs/migrations/_template.md` — each release with breaking changes ships a `docs/migrations/<version>.md` file with sections the agent reads.
|
|
187
|
-
- New `docs/migrations/0.4.0.md` — backfilled. Documents the SKILL fold (no document or CLI changes).
|
|
188
|
-
|
|
189
|
-
**SKILL update:**
|
|
190
|
-
|
|
191
|
-
`openpress` skill's "Updating An Existing Workspace" section rewritten around the new commands: detect (`doctor`), apply (`upgrade`), interpret migration notes, propose document edits with user confirmation. Concrete agent workflow + breaking-change reference table.
|
|
192
|
-
|
|
193
|
-
### Patch Changes
|
|
194
|
-
|
|
195
|
-
- 931d4ac: Support framework root dogfood workspaces and correct CLI script paths outside the core package root.
|
|
196
|
-
|
|
197
|
-
## 0.4.0
|
|
198
|
-
|
|
199
|
-
### Minor Changes
|
|
200
|
-
|
|
201
|
-
- 3cb4939: Consolidate internal skills (13 → 11).
|
|
202
|
-
- `openpress-update` folded into `openpress` as an "Updating An Existing Workspace" section. The release-upgrade flow, pre-flight checks, breaking-change reference, and do-not list are now part of the system-operation skill where they naturally belong.
|
|
203
|
-
- `openpress-document-hierarchy` folded into `openpress-writing` as a "Hierarchy" section. Hierarchy decisions (H2/H3/H4 model, TOC depth, appendix placement, H4 granularity) and prose decisions happen in the same workflow; one skill, one routing decision.
|
|
204
|
-
- `references/data-structures-outline.md` moved from the hierarchy skill into `openpress-writing/references/`.
|
|
205
|
-
|
|
206
|
-
Lower maintenance surface: 2 fewer SKILL.md files to keep in sync, ~5 fewer cross-references to police. No content lost — same rules, fewer files.
|
|
207
|
-
|
|
208
|
-
User impact: agents already in workspaces with `openpress-update` or `openpress-document-hierarchy` SKILL files installed should run `npx skills upgrade` to refresh the catalog.
|
|
209
|
-
|
|
210
|
-
## 0.3.0
|
|
211
|
-
|
|
212
|
-
### Minor Changes
|
|
213
|
-
|
|
214
|
-
- Initial monorepo release of `@open-press/cli` and `@open-press/core` on npm.
|
|
215
|
-
|
|
216
|
-
**@open-press/cli** (new): scaffolder for open-press workspaces. Run `npx @open-press/cli init <target> --pack <pack>` to create a fixed-layout document workspace from a bundled template. Supports `editorial-monograph` and `claude-document` style packs, metadata flags, and AI-agent skill installation under `.claude/skills/` and `.agents/skills/`.
|
|
217
|
-
|
|
218
|
-
**@open-press/core** (new): framework runtime, CLI engine, render pipeline, and document primitives. Consumed transitively by workspaces scaffolded via `@open-press/cli`. Exposes the `open-press` bin (dev / build / preview / validate / pdf / deploy / export).
|
package/template/core/README.md
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# @open-press/core
|
|
2
|
-
|
|
3
|
-
Framework runtime, CLI engine, and Press Tree primitives for [open-press](https://github.com/quan0715/open-press) — an AI-first fixed-layout document workspace.
|
|
4
|
-
|
|
5
|
-
Most users do **not** install this package directly. Instead, scaffold a workspace with the CLI:
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npx @open-press/cli init my-doc
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
The scaffolded workspace contains a snapshot of this package. Starter files are supplied by skills, not by `@open-press/core`.
|
|
12
|
-
|
|
13
|
-
## Direct use
|
|
14
|
-
|
|
15
|
-
If you want the runtime primitives in an existing project:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm install @open-press/core
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
```tsx
|
|
22
|
-
import {
|
|
23
|
-
Press,
|
|
24
|
-
Frame,
|
|
25
|
-
MdxArea,
|
|
26
|
-
BaseFigure,
|
|
27
|
-
BaseCallout,
|
|
28
|
-
} from "@open-press/core";
|
|
29
|
-
|
|
30
|
-
import { mdxSource } from "@open-press/core/mdx";
|
|
31
|
-
import { Sections, Toc } from "@open-press/core/manuscript";
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
`press/index.tsx` or transitional `document/index.tsx` default-exports a `<Workspace>/<Press>` tree. `Frame` marks fixed-layout pages, `MdxArea` receives measured MDX blocks, and `mdxSource()` declares which MDX files participate in the render pipeline.
|
|
35
|
-
|
|
36
|
-
For the maintenance contract around Press Tree, page geometry presets, and the
|
|
37
|
-
allocation pipeline, see [`docs/press-tree.md`](https://github.com/quan0715/open-press/blob/main/docs/press-tree.md).
|
|
38
|
-
|
|
39
|
-
The CLI bin (`open-press`) supports dev / build / preview / validate / pdf / deploy / export commands. It requires a workspace with `openpress.config.mjs` and the surrounding framework files (which the scaffolder installs).
|
|
40
|
-
|
|
41
|
-
## License
|
|
42
|
-
|
|
43
|
-
MIT — see [LICENSE](https://github.com/quan0715/open-press/blob/main/LICENSE).
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import * as deployCmd from "./commands/deploy.mjs";
|
|
4
|
-
import * as devCmd from "./commands/dev.mjs";
|
|
5
|
-
import * as doctorCmd from "./commands/doctor.mjs";
|
|
6
|
-
import * as exportCmd from "./commands/export.mjs";
|
|
7
|
-
import * as inspectCmd from "./commands/inspect.mjs";
|
|
8
|
-
import * as imageCmd from "./commands/image.mjs";
|
|
9
|
-
import * as pdfCmd from "./commands/pdf.mjs";
|
|
10
|
-
import * as previewCmd from "./commands/preview.mjs";
|
|
11
|
-
import * as replaceCmd from "./commands/replace.mjs";
|
|
12
|
-
import * as renderCmd from "./commands/render.mjs";
|
|
13
|
-
import * as searchCmd from "./commands/search.mjs";
|
|
14
|
-
import * as skillsSyncCmd from "./commands/skills-sync.mjs";
|
|
15
|
-
import * as typecheckCmd from "./commands/typecheck.mjs";
|
|
16
|
-
import * as upgradeCmd from "./commands/upgrade.mjs";
|
|
17
|
-
import * as validateCmd from "./commands/validate.mjs";
|
|
18
|
-
import { parseOptions } from "./commands/_shared.mjs";
|
|
19
|
-
import { loadConfig } from "./runtime/config.mjs";
|
|
20
|
-
import { discoverWorkspace } from "./runtime/validation.mjs";
|
|
21
|
-
|
|
22
|
-
const COMMANDS = {
|
|
23
|
-
validate: validateCmd,
|
|
24
|
-
inspect: inspectCmd,
|
|
25
|
-
image: imageCmd,
|
|
26
|
-
search: searchCmd,
|
|
27
|
-
replace: replaceCmd,
|
|
28
|
-
export: exportCmd,
|
|
29
|
-
render: renderCmd,
|
|
30
|
-
dev: devCmd,
|
|
31
|
-
preview: previewCmd,
|
|
32
|
-
typecheck: typecheckCmd,
|
|
33
|
-
pdf: pdfCmd,
|
|
34
|
-
deploy: deployCmd,
|
|
35
|
-
doctor: doctorCmd,
|
|
36
|
-
upgrade: upgradeCmd,
|
|
37
|
-
migrate: upgradeCmd,
|
|
38
|
-
"skills:sync": skillsSyncCmd,
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const args = process.argv.slice(2);
|
|
42
|
-
const command = args.shift();
|
|
43
|
-
|
|
44
|
-
try {
|
|
45
|
-
const code = await main(command, args);
|
|
46
|
-
process.exitCode = code;
|
|
47
|
-
} catch (error) {
|
|
48
|
-
console.error(error instanceof Error ? error.message : String(error));
|
|
49
|
-
process.exitCode = 1;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
async function main(commandName, argv) {
|
|
53
|
-
if (!commandName || ["-h", "--help"].includes(commandName)) {
|
|
54
|
-
await printHelp();
|
|
55
|
-
return commandName ? 0 : 2;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const handler = COMMANDS[commandName];
|
|
59
|
-
if (!handler) {
|
|
60
|
-
console.error(`Unknown command: ${commandName}`);
|
|
61
|
-
await printHelp();
|
|
62
|
-
return 2;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (handler.needsWorkspace === false) {
|
|
66
|
-
return handler.run({ argv });
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const options = parseOptions(argv);
|
|
70
|
-
const root = await discoverWorkspace(options.path ?? ".");
|
|
71
|
-
const config = await loadConfig(root);
|
|
72
|
-
return handler.run({ root, config, options, recurse: main });
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
async function printHelp() {
|
|
76
|
-
console.log(`Usage: node engine/cli.mjs <command> [path] [options]
|
|
77
|
-
|
|
78
|
-
Commands:
|
|
79
|
-
validate
|
|
80
|
-
inspect [--json] [--no-build] [--dry-run]
|
|
81
|
-
search [path] <query> [--json] [--scope content|all]
|
|
82
|
-
replace [path] <from> <to> [--json] [--apply] [--scope content|all]
|
|
83
|
-
export
|
|
84
|
-
render --renderer react [--dry-run]
|
|
85
|
-
preview --renderer react [--host 127.0.0.1] [--port 5173] [--no-build] [--dry-run]
|
|
86
|
-
dev --renderer react [--host 127.0.0.1] [--port 5173] [--no-build] [--dry-run]
|
|
87
|
-
typecheck
|
|
88
|
-
image [--output <outputDir>] [--no-build] [--dry-run]
|
|
89
|
-
pdf [--output <outputDir>/<pdf.filename>] [--no-build] [--dry-run]
|
|
90
|
-
deploy --confirm [--dry-run]
|
|
91
|
-
doctor [--json] [--no-cache] # version + skill staleness check
|
|
92
|
-
upgrade [--dry-run] [--no-deps] [--no-skills] [--json] # apply updates; agent-driven
|
|
93
|
-
migrate [--dry-run] [--no-deps] [--no-skills] [--json] # alias for upgrade; reads migration notes
|
|
94
|
-
skills:sync [--source <owner/repo>] [--dry-run] # refresh installed agent skills
|
|
95
|
-
`);
|
|
96
|
-
}
|