@open-press/cli 0.3.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.
Files changed (178) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +58 -0
  3. package/dist/cli.js +365 -0
  4. package/package.json +57 -0
  5. package/template/core/.turbo/turbo-test.log +341 -0
  6. package/template/core/CHANGELOG.md +11 -0
  7. package/template/core/README.md +36 -0
  8. package/template/core/engine/chrome-pdf.d.mts +34 -0
  9. package/template/core/engine/chrome-pdf.mjs +344 -0
  10. package/template/core/engine/cli.mjs +93 -0
  11. package/template/core/engine/commands/_shared.mjs +170 -0
  12. package/template/core/engine/commands/deploy.mjs +31 -0
  13. package/template/core/engine/commands/dev.mjs +26 -0
  14. package/template/core/engine/commands/export.mjs +8 -0
  15. package/template/core/engine/commands/init.mjs +24 -0
  16. package/template/core/engine/commands/inspect.mjs +35 -0
  17. package/template/core/engine/commands/migrate-to-react.mjs +27 -0
  18. package/template/core/engine/commands/pdf.mjs +26 -0
  19. package/template/core/engine/commands/preview.mjs +26 -0
  20. package/template/core/engine/commands/render.mjs +17 -0
  21. package/template/core/engine/commands/replace.mjs +41 -0
  22. package/template/core/engine/commands/search.mjs +33 -0
  23. package/template/core/engine/commands/typecheck.mjs +5 -0
  24. package/template/core/engine/commands/validate.mjs +17 -0
  25. package/template/core/engine/config.d.mts +40 -0
  26. package/template/core/engine/config.mjs +160 -0
  27. package/template/core/engine/deploy-sync.mjs +15 -0
  28. package/template/core/engine/document-export.mjs +15 -0
  29. package/template/core/engine/file-utils.mjs +106 -0
  30. package/template/core/engine/fonts.mjs +62 -0
  31. package/template/core/engine/init.mjs +90 -0
  32. package/template/core/engine/inspection.mjs +348 -0
  33. package/template/core/engine/issue-report.mjs +44 -0
  34. package/template/core/engine/katex-assets.mjs +45 -0
  35. package/template/core/engine/page-block.mjs +30 -0
  36. package/template/core/engine/page-renderer.mjs +217 -0
  37. package/template/core/engine/pdf-media.mjs +45 -0
  38. package/template/core/engine/public-assets.mjs +19 -0
  39. package/template/core/engine/react/chapter-css.mjs +53 -0
  40. package/template/core/engine/react/comment-endpoint.d.mts +11 -0
  41. package/template/core/engine/react/comment-endpoint.mjs +128 -0
  42. package/template/core/engine/react/comment-marker.mjs +306 -0
  43. package/template/core/engine/react/document-entry.mjs +253 -0
  44. package/template/core/engine/react/document-export.mjs +392 -0
  45. package/template/core/engine/react/mdx-compile.mjs +295 -0
  46. package/template/core/engine/react/measurement-css.mjs +44 -0
  47. package/template/core/engine/react/migrate-to-react.mjs +355 -0
  48. package/template/core/engine/react/pagination-constants.mjs +3 -0
  49. package/template/core/engine/react/pagination.mjs +121 -0
  50. package/template/core/engine/react/project-asset-endpoint.d.mts +10 -0
  51. package/template/core/engine/react/project-asset-endpoint.mjs +379 -0
  52. package/template/core/engine/react/workspace-discovery.mjs +156 -0
  53. package/template/core/engine/source-text-tools.mjs +280 -0
  54. package/template/core/engine/source-workspace.mjs +76 -0
  55. package/template/core/engine/static-server.mjs +493 -0
  56. package/template/core/engine/validation.mjs +172 -0
  57. package/template/core/index.html +13 -0
  58. package/template/core/openpress.config.mjs +12 -0
  59. package/template/core/package.json +86 -0
  60. package/template/core/src/main.tsx +16 -0
  61. package/template/core/src/openpress/App.tsx +127 -0
  62. package/template/core/src/openpress/composerMentions.ts +188 -0
  63. package/template/core/src/openpress/core/basePages.tsx +87 -0
  64. package/template/core/src/openpress/core/index.tsx +20 -0
  65. package/template/core/src/openpress/core/types.ts +71 -0
  66. package/template/core/src/openpress/frameScheduler.ts +32 -0
  67. package/template/core/src/openpress/indexes.ts +329 -0
  68. package/template/core/src/openpress/inspector.ts +282 -0
  69. package/template/core/src/openpress/pageRoute.ts +21 -0
  70. package/template/core/src/openpress/pagination.ts +845 -0
  71. package/template/core/src/openpress/projectIdentity.ts +15 -0
  72. package/template/core/src/openpress/projectSources.ts +24 -0
  73. package/template/core/src/openpress/projectWorkspace.tsx +919 -0
  74. package/template/core/src/openpress/publicPage.tsx +469 -0
  75. package/template/core/src/openpress/reactDocumentMetadata.ts +41 -0
  76. package/template/core/src/openpress/readerPageRegistry.ts +41 -0
  77. package/template/core/src/openpress/readerRuntime.ts +230 -0
  78. package/template/core/src/openpress/readerScroll.ts +92 -0
  79. package/template/core/src/openpress/readerState.ts +15 -0
  80. package/template/core/src/openpress/renderer.tsx +91 -0
  81. package/template/core/src/openpress/runtimeMode.ts +22 -0
  82. package/template/core/src/openpress/types.ts +112 -0
  83. package/template/core/src/openpress/workbench.tsx +1299 -0
  84. package/template/core/src/openpress/workbenchPanels.tsx +122 -0
  85. package/template/core/src/openpress/workbenchTypes.ts +4 -0
  86. package/template/core/src/styles/openpress/app-shell.css +251 -0
  87. package/template/core/src/styles/openpress/media-workspace.css +230 -0
  88. package/template/core/src/styles/openpress/print-route.css +186 -0
  89. package/template/core/src/styles/openpress/project-workspace.css +1318 -0
  90. package/template/core/src/styles/openpress/public-viewer.css +983 -0
  91. package/template/core/src/styles/openpress/reader-runtime.css +792 -0
  92. package/template/core/src/styles/openpress/responsive.css +384 -0
  93. package/template/core/src/styles/openpress/workbench-panels.css +558 -0
  94. package/template/core/src/styles/openpress/workbench.css +720 -0
  95. package/template/core/src/styles/openpress.css +14 -0
  96. package/template/core/src/vite-env.d.ts +9 -0
  97. package/template/core/tsconfig.json +37 -0
  98. package/template/core/vite.config.ts +512 -0
  99. package/template/skills/chinese-ai-writing-polish/SKILL.md +195 -0
  100. package/template/skills/claude-document/SKILL.md +66 -0
  101. package/template/skills/claude-document/starter/document/chapters/01-document-shape/chapter.tsx +30 -0
  102. package/template/skills/claude-document/starter/document/chapters/01-document-shape/content/01-document-shape.mdx +51 -0
  103. package/template/skills/claude-document/starter/document/chapters/02-review-loop/chapter.tsx +30 -0
  104. package/template/skills/claude-document/starter/document/chapters/02-review-loop/content/01-review-loop.mdx +31 -0
  105. package/template/skills/claude-document/starter/document/components/ChapterOpenerVisual.tsx +96 -0
  106. package/template/skills/claude-document/starter/document/components/Page.tsx +27 -0
  107. package/template/skills/claude-document/starter/document/design.md +142 -0
  108. package/template/skills/claude-document/starter/document/index.tsx +89 -0
  109. package/template/skills/claude-document/starter/document/media/README.md +13 -0
  110. package/template/skills/claude-document/starter/document/openpress.config.mjs +26 -0
  111. package/template/skills/claude-document/starter/document/theme/README.md +15 -0
  112. package/template/skills/claude-document/starter/document/theme/base/page-contract.css +525 -0
  113. package/template/skills/claude-document/starter/document/theme/base/print.css +93 -0
  114. package/template/skills/claude-document/starter/document/theme/base/typography.css +612 -0
  115. package/template/skills/claude-document/starter/document/theme/fonts.css +4 -0
  116. package/template/skills/claude-document/starter/document/theme/page-surfaces/back-cover.css +72 -0
  117. package/template/skills/claude-document/starter/document/theme/page-surfaces/chapter-opener.css +236 -0
  118. package/template/skills/claude-document/starter/document/theme/page-surfaces/cover.css +309 -0
  119. package/template/skills/claude-document/starter/document/theme/page-surfaces/toc.css +213 -0
  120. package/template/skills/claude-document/starter/document/theme/patterns/_chart-frame.css +53 -0
  121. package/template/skills/claude-document/starter/document/theme/patterns/figure-grid.css +68 -0
  122. package/template/skills/claude-document/starter/document/theme/patterns/table-utilities.css +66 -0
  123. package/template/skills/claude-document/starter/document/theme/shell/reader-controls.css +789 -0
  124. package/template/skills/claude-document/starter/document/theme/tokens.css +89 -0
  125. package/template/skills/claude-document/starter/openpress.config.mjs +5 -0
  126. package/template/skills/editorial-monograph/SKILL.md +73 -0
  127. package/template/skills/editorial-monograph/starter/document/chapters/01-product-and-use-cases/content/01-product-and-use-cases.mdx +31 -0
  128. package/template/skills/editorial-monograph/starter/document/chapters/02-workflow/content/01-workflow.mdx +89 -0
  129. package/template/skills/editorial-monograph/starter/document/chapters/03-agent-skills-contributors/content/01-agent-skills-contributors.mdx +52 -0
  130. package/template/skills/editorial-monograph/starter/document/chapters/04-validation-deploy/content/01-validation-deploy.mdx +39 -0
  131. package/template/skills/editorial-monograph/starter/document/components/ChapterOpenerVisual/index.tsx +76 -0
  132. package/template/skills/editorial-monograph/starter/document/components/Page.tsx +27 -0
  133. package/template/skills/editorial-monograph/starter/document/components/TokenSwatchGrid/index.tsx +46 -0
  134. package/template/skills/editorial-monograph/starter/document/components/TokenSwatchGrid/style.css +63 -0
  135. package/template/skills/editorial-monograph/starter/document/components/TypeSpecimen/index.tsx +38 -0
  136. package/template/skills/editorial-monograph/starter/document/components/TypeSpecimen/style.css +111 -0
  137. package/template/skills/editorial-monograph/starter/document/design.md +279 -0
  138. package/template/skills/editorial-monograph/starter/document/index.tsx +73 -0
  139. package/template/skills/editorial-monograph/starter/document/media/README.md +13 -0
  140. package/template/skills/editorial-monograph/starter/document/openpress.config.mjs +26 -0
  141. package/template/skills/editorial-monograph/starter/document/theme/README.md +11 -0
  142. package/template/skills/editorial-monograph/starter/document/theme/base/page-contract.css +505 -0
  143. package/template/skills/editorial-monograph/starter/document/theme/base/print.css +93 -0
  144. package/template/skills/editorial-monograph/starter/document/theme/base/typography.css +336 -0
  145. package/template/skills/editorial-monograph/starter/document/theme/fonts.css +3 -0
  146. package/template/skills/editorial-monograph/starter/document/theme/page-surfaces/back-cover.css +43 -0
  147. package/template/skills/editorial-monograph/starter/document/theme/page-surfaces/chapter-opener.css +205 -0
  148. package/template/skills/editorial-monograph/starter/document/theme/page-surfaces/cover.css +147 -0
  149. package/template/skills/editorial-monograph/starter/document/theme/page-surfaces/toc.css +139 -0
  150. package/template/skills/editorial-monograph/starter/document/theme/patterns/_chart-frame.css +49 -0
  151. package/template/skills/editorial-monograph/starter/document/theme/patterns/figure-grid.css +68 -0
  152. package/template/skills/editorial-monograph/starter/document/theme/patterns/table-utilities.css +66 -0
  153. package/template/skills/editorial-monograph/starter/document/theme/shell/reader-controls.css +761 -0
  154. package/template/skills/editorial-monograph/starter/document/theme/tokens.css +80 -0
  155. package/template/skills/editorial-monograph/starter/openpress.config.mjs +5 -0
  156. package/template/skills/openpress/SKILL.md +114 -0
  157. package/template/skills/openpress/references/cli-commands.md +31 -0
  158. package/template/skills/openpress/references/local-review.md +43 -0
  159. package/template/skills/openpress-deploy/SKILL.md +69 -0
  160. package/template/skills/openpress-deploy/references/cloudflare-pages.md +51 -0
  161. package/template/skills/openpress-design/SKILL.md +51 -0
  162. package/template/skills/openpress-design/references/pdf-safe-css.md +29 -0
  163. package/template/skills/openpress-design/references/responsive-fixed-layout.md +48 -0
  164. package/template/skills/openpress-design/references/theme-and-components.md +77 -0
  165. package/template/skills/openpress-diagram-drawing/SKILL.md +44 -0
  166. package/template/skills/openpress-diagram-drawing/references/diagram-patterns.md +93 -0
  167. package/template/skills/openpress-document-hierarchy/SKILL.md +81 -0
  168. package/template/skills/openpress-document-hierarchy/agents/openai.yaml +4 -0
  169. package/template/skills/openpress-document-hierarchy/references/data-structures-outline.md +115 -0
  170. package/template/skills/openpress-init/SKILL.md +84 -0
  171. package/template/skills/openpress-style-pack-contributor/SKILL.md +62 -0
  172. package/template/skills/openpress-style-pack-contributor/references/starter-contract.md +49 -0
  173. package/template/skills/openpress-update/SKILL.md +88 -0
  174. package/template/skills/openpress-writing/SKILL.md +68 -0
  175. package/template/skills/openpress-writing/references/source-and-writing-rules.md +120 -0
  176. package/template/skills/teaching-notes-writing/SKILL.md +54 -0
  177. package/template/skills/teaching-notes-writing/references/programming.md +65 -0
  178. package/template/skills/teaching-notes-writing/references/teaching-patterns.md +60 -0
@@ -0,0 +1,341 @@
1
+
2
+ > @open-press/core@0.2.0 test /Users/quan/Desktop/QDoc Playgorund/data structure note/packages/core
3
+ > pnpm run test:node && pnpm run test:react
4
+
5
+
6
+ > @open-press/core@0.2.0 test:node /Users/quan/Desktop/QDoc Playgorund/data structure note/packages/core
7
+ > node --test tests/*.test.mjs
8
+
9
+ TAP version 13
10
+ # Subtest: cli pdf and deploy dry runs use workspace config
11
+ ok 1 - cli pdf and deploy dry runs use workspace config
12
+ ---
13
+ duration_ms: 1898.54
14
+ ...
15
+ # Subtest: static server serves workspace pdf and exposes deployment status
16
+ ok 2 - static server serves workspace pdf and exposes deployment status
17
+ ---
18
+ duration_ms: 459.933375
19
+ ...
20
+ # Subtest: deploy gate validates public adapters require confirmation
21
+ ok 3 - deploy gate validates public adapters require confirmation
22
+ ---
23
+ duration_ms: 860.309125
24
+ ...
25
+ # Subtest: validate supports machine-readable issue report JSON
26
+ ok 4 - validate supports machine-readable issue report JSON
27
+ ---
28
+ duration_ms: 872.810334
29
+ ...
30
+ # Subtest: validate warns when React source still contains pending openpress comments
31
+ ok 5 - validate warns when React source still contains pending openpress comments
32
+ ---
33
+ duration_ms: 867.950458
34
+ ...
35
+ # Subtest: validate reports React pagination overflow warnings from exported document metadata
36
+ ok 6 - validate reports React pagination overflow warnings from exported document metadata
37
+ ---
38
+ duration_ms: 867.326666
39
+ ...
40
+ # Subtest: inspect dry run describes render and browser inspection steps
41
+ ok 7 - inspect dry run describes render and browser inspection steps
42
+ ---
43
+ duration_ms: 733.269791
44
+ ...
45
+ # Subtest: export copies theme font stylesheet and font files for nested workspaces
46
+ ok 8 - export copies theme font stylesheet and font files for nested workspaces
47
+ ---
48
+ duration_ms: 1151.318875
49
+ ...
50
+ # Subtest: export supports chapter-opener pages as no-footer page surfaces
51
+ ok 9 - export supports chapter-opener pages as no-footer page surfaces
52
+ ---
53
+ duration_ms: 1118.779584
54
+ ...
55
+ # Subtest: export includes katex stylesheet and font assets for latex math
56
+ ok 10 - export includes katex stylesheet and font assets for latex math
57
+ ---
58
+ duration_ms: 1114.688208
59
+ ...
60
+ # Subtest: inspection source scan reads React MDX chapters when document/index.tsx is present
61
+ ok 11 - inspection source scan reads React MDX chapters when document/index.tsx is present
62
+ ---
63
+ duration_ms: 94.999084
64
+ ...
65
+ # Subtest: overflow measurements become page warnings with source metadata
66
+ ok 12 - overflow measurements become page warnings with source metadata
67
+ ---
68
+ duration_ms: 0.838333
69
+ ...
70
+ # Subtest: project asset endpoint renames media and updates document references
71
+ ok 13 - project asset endpoint renames media and updates document references
72
+ ---
73
+ duration_ms: 176.032333
74
+ ...
75
+ # Subtest: project asset endpoint refuses to delete referenced media
76
+ ok 14 - project asset endpoint refuses to delete referenced media
77
+ ---
78
+ duration_ms: 81.165209
79
+ ...
80
+ # Subtest: project asset endpoint renames component support directory and literal references
81
+ ok 15 - project asset endpoint renames component support directory and literal references
82
+ ---
83
+ duration_ms: 62.403042
84
+ ...
85
+ # Subtest: project asset endpoint creates a source comment from the asset dialog
86
+ ok 16 - project asset endpoint creates a source comment from the asset dialog
87
+ ---
88
+ duration_ms: 48.93275
89
+ ...
90
+ # Subtest: insertCommentMarker writes a JSX marker before the selected MDX block line
91
+ ok 17 - insertCommentMarker writes a JSX marker before the selected MDX block line
92
+ ---
93
+ duration_ms: 37.651084
94
+ ...
95
+ # Subtest: insertCommentMarker rejects paths outside editable React document sources
96
+ ok 18 - insertCommentMarker rejects paths outside editable React document sources
97
+ ---
98
+ duration_ms: 5.009083
99
+ ...
100
+ # Subtest: listCommentMarkers returns decoded pending comments from editable React sources
101
+ ok 19 - listCommentMarkers returns decoded pending comments from editable React sources
102
+ ---
103
+ duration_ms: 222.229375
104
+ ...
105
+ # Subtest: clearCommentMarkers removes one or all pending comments
106
+ ok 20 - clearCommentMarkers removes one or all pending comments
107
+ ---
108
+ duration_ms: 135.881
109
+ ...
110
+ # Subtest: updateCommentMarker updates an existing source marker without duplicating it
111
+ ok 21 - updateCommentMarker updates an existing source marker without duplicating it
112
+ ---
113
+ duration_ms: 44.983834
114
+ ...
115
+ # Subtest: handleCommentRequest accepts React inspector targets and writes source markers
116
+ ok 22 - handleCommentRequest accepts React inspector targets and writes source markers
117
+ ---
118
+ duration_ms: 4.229959
119
+ ...
120
+ # Subtest: handleCommentRequest updates pending comments through PATCH
121
+ ok 23 - handleCommentRequest updates pending comments through PATCH
122
+ ---
123
+ duration_ms: 50.044709
124
+ ...
125
+ # Subtest: handleCommentRequest lists and clears pending comments
126
+ ok 24 - handleCommentRequest lists and clears pending comments
127
+ ---
128
+ duration_ms: 55.842959
129
+ ...
130
+ # Subtest: handleCommentRequest rejects unsupported methods
131
+ ok 25 - handleCommentRequest rejects unsupported methods
132
+ ---
133
+ duration_ms: 0.326792
134
+ ...
135
+ # Subtest: scopeChapterCss prefixes ordinary selectors and nested media rules
136
+ ok 26 - scopeChapterCss prefixes ordinary selectors and nested media rules
137
+ ---
138
+ duration_ms: 5.827334
139
+ ...
140
+ # Subtest: buildChapterScopedCss reads chapter styles in discovery order
141
+ ok 27 - buildChapterScopedCss reads chapter styles in discovery order
142
+ ---
143
+ duration_ms: 30.566
144
+ ...
145
+ # Subtest: discovers React document chapters and component scopes from filesystem structure
146
+ ok 28 - discovers React document chapters and component scopes from filesystem structure
147
+ ---
148
+ duration_ms: 63.16425
149
+ ...
150
+ # Subtest: discovers React workspace using normalized config path overrides
151
+ ok 29 - discovers React workspace using normalized config path overrides
152
+ ---
153
+ duration_ms: 7.797125
154
+ ...
155
+ # Subtest: loadReactDocumentEntry loads document/index.tsx and normalizes config defaults
156
+ ok 30 - loadReactDocumentEntry loads document/index.tsx and normalizes config defaults
157
+ ---
158
+ duration_ms: 190.757833
159
+ ...
160
+ # Subtest: loadReactDocumentEntry maps manifest path overrides into normalized config
161
+ ok 31 - loadReactDocumentEntry maps manifest path overrides into normalized config
162
+ ---
163
+ duration_ms: 43.071958
164
+ ...
165
+ # Subtest: loadReactDocumentEntry rejects obvious top-level side effects before import
166
+ ok 32 - loadReactDocumentEntry rejects obvious top-level side effects before import
167
+ ---
168
+ duration_ms: 18.955959
169
+ ...
170
+ # Subtest: loadReactDocumentEntry rejects side-effect imports and top-level browser or file IO
171
+ ok 33 - loadReactDocumentEntry rejects side-effect imports and top-level browser or file IO
172
+ ---
173
+ duration_ms: 20.809917
174
+ ...
175
+ # Subtest: Vite and TypeScript expose React document import aliases
176
+ ok 34 - Vite and TypeScript expose React document import aliases
177
+ ---
178
+ duration_ms: 9.857875
179
+ ...
180
+ # Subtest: exportReactDocument writes a reader document from React shell pages and MDX chapters
181
+ ok 35 - exportReactDocument writes a reader document from React shell pages and MDX chapters
182
+ ---
183
+ duration_ms: 208.410208
184
+ ...
185
+ # Subtest: exportReactDocument paginates MDX by measured block groups and rerenders page subtrees
186
+ ok 36 - exportReactDocument paginates MDX by measured block groups and rerenders page subtrees
187
+ ---
188
+ duration_ms: 58.566208
189
+ ...
190
+ # Subtest: exportReactDocument injects static table-of-contents entries from rendered headings
191
+ ok 37 - exportReactDocument injects static table-of-contents entries from rendered headings
192
+ ---
193
+ duration_ms: 65.722958
194
+ ...
195
+ # Subtest: exportDocument delegates to React export when document/index.tsx is present
196
+ ok 38 - exportDocument delegates to React export when document/index.tsx is present
197
+ ---
198
+ duration_ms: 77.547709
199
+ ...
200
+ # Subtest: compileMdx renders MDX with stable block ids and component wrappers
201
+ ok 39 - compileMdx renders MDX with stable block ids and component wrappers
202
+ ---
203
+ duration_ms: 18.214959
204
+ ...
205
+ # Subtest: compileMdx rejects import declarations in chapter prose
206
+ ok 40 - compileMdx rejects import declarations in chapter prose
207
+ ---
208
+ duration_ms: 0.331958
209
+ ...
210
+ # Subtest: compileMdx can render only selected block ids for pagination subtrees
211
+ ok 41 - compileMdx can render only selected block ids for pagination subtrees
212
+ ---
213
+ duration_ms: 7.782041
214
+ ...
215
+ # Subtest: compileMdx rejects inline JSX components inside prose
216
+ ok 42 - compileMdx rejects inline JSX components inside prose
217
+ ---
218
+ duration_ms: 0.939334
219
+ ...
220
+ # Subtest: compileMdx renders GitHub-flavored markdown tables as table elements
221
+ ok 43 - compileMdx renders GitHub-flavored markdown tables as table elements
222
+ ---
223
+ duration_ms: 5.05425
224
+ ...
225
+ # Subtest: compileMdx converts TableCaption components into table captions
226
+ ok 44 - compileMdx converts TableCaption components into table captions
227
+ ---
228
+ duration_ms: 7.21325
229
+ ...
230
+ # Subtest: compileMdx renders inline LaTeX math without treating braces as MDX expressions
231
+ ok 45 - compileMdx renders inline LaTeX math without treating braces as MDX expressions
232
+ ---
233
+ duration_ms: 13.443666
234
+ ...
235
+ # Subtest: compileMdx renders display LaTeX math as a paginable block
236
+ ok 46 - compileMdx renders display LaTeX math as a paginable block
237
+ ---
238
+ duration_ms: 38.801375
239
+ ...
240
+ # Subtest: compileMdx treats a whole-line double-dollar formula as display math
241
+ ok 47 - compileMdx treats a whole-line double-dollar formula as display math
242
+ ---
243
+ duration_ms: 12.7585
244
+ ...
245
+ # Subtest: paginateMeasuredBlocks groups measured block ids without splitting atomic blocks
246
+ ok 48 - paginateMeasuredBlocks groups measured block ids without splitting atomic blocks
247
+ ---
248
+ duration_ms: 0.982167
249
+ ...
250
+ # Subtest: paginateMeasuredBlocks keeps an overlong block atomic and emits an overflow warning
251
+ ok 49 - paginateMeasuredBlocks keeps an overlong block atomic and emits an overflow warning
252
+ ---
253
+ duration_ms: 0.219083
254
+ ...
255
+ # Subtest: measureBlocksInChromium derives safe height from rendered page body when no fixed height is configured
256
+ ok 50 - measureBlocksInChromium derives safe height from rendered page body when no fixed height is configured
257
+ ---
258
+ duration_ms: 229.745917
259
+ ...
260
+ # Subtest: buildReactMeasurementCss includes real theme, component and chapter scoped CSS
261
+ ok 51 - buildReactMeasurementCss includes real theme, component and chapter scoped CSS
262
+ ---
263
+ duration_ms: 35.629459
264
+ ...
265
+ # Subtest: reader page registry reports same-index DOM replacements
266
+ ok 52 - reader page registry reports same-index DOM replacements
267
+ ---
268
+ duration_ms: 55.891958
269
+ ...
270
+ # Subtest: page route serializes and validates reader page hashes
271
+ ok 53 - page route serializes and validates reader page hashes
272
+ ---
273
+ duration_ms: 20.061375
274
+ ...
275
+ # Subtest: reader runtime leaves touch gestures to scrolling instead of page turns
276
+ ok 54 - reader runtime leaves touch gestures to scrolling instead of page turns
277
+ ---
278
+ duration_ms: 3.51525
279
+ ...
280
+ # Subtest: search emits source match JSON with file, line, column and preview
281
+ ok 55 - search emits source match JSON with file, line, column and preview
282
+ ---
283
+ duration_ms: 1006.144209
284
+ ...
285
+ # Subtest: replace preview reports changes without writing files
286
+ ok 56 - replace preview reports changes without writing files
287
+ ---
288
+ duration_ms: 822.123458
289
+ ...
290
+ # Subtest: replace apply writes prose matches and skips fenced code by default
291
+ ok 57 - replace apply writes prose matches and skips fenced code by default
292
+ ---
293
+ duration_ms: 818.346291
294
+ ...
295
+ # Subtest: search reads React MDX chapter content when document/index.tsx is present
296
+ ok 58 - search reads React MDX chapter content when document/index.tsx is present
297
+ ---
298
+ duration_ms: 825.881375
299
+ ...
300
+ # Subtest: replace applies to React MDX chapter content when document/index.tsx is present
301
+ ok 59 - replace applies to React MDX chapter content when document/index.tsx is present
302
+ ---
303
+ duration_ms: 829.073666
304
+ ...
305
+ # Subtest: search all includes React document entry and chapter implementation sources
306
+ ok 60 - search all includes React document entry and chapter implementation sources
307
+ ---
308
+ duration_ms: 826.43775
309
+ ...
310
+ 1..60
311
+ # tests 60
312
+ # suites 0
313
+ # pass 60
314
+ # fail 0
315
+ # cancelled 0
316
+ # skipped 0
317
+ # todo 0
318
+ # duration_ms 10037.053417
319
+
320
+ > @open-press/core@0.2.0 test:react /Users/quan/Desktop/QDoc Playgorund/data structure note/packages/core
321
+ > vitest run
322
+
323
+
324
+  RUN  v4.1.7 /Users/quan/Desktop/QDoc Playgorund/data structure note/packages/core
325
+
326
+ ✓ tests/openpress-composer-mentions.test.ts (4 tests) 6ms
327
+ ✓ tests/openpress-react-document-metadata.test.ts (3 tests) 6ms
328
+ ✓ tests/openpress-frame-scheduler.test.ts (3 tests) 10ms
329
+ ✓ tests/openpress-project-mentions.test.ts (1 test) 261ms
330
+ ✓ tests/openpress-pagination.test.ts (11 tests) 179ms
331
+ ✓ tests/openpress-core-primitives.react.test.tsx (4 tests) 52ms
332
+ ✓ tests/openpress-bookmarks.react.test.tsx (4 tests) 145ms
333
+ ✓ tests/openpress-renderer.react.test.tsx (2 tests) 258ms
334
+ ✓ tests/openpress-inspector.react.test.tsx (13 tests) 105ms
335
+ ✓ tests/reader-runtime.react.test.tsx (7 tests) 367ms
336
+
337
+  Test Files  10 passed (10)
338
+  Tests  52 passed (52)
339
+  Start at  14:37:54
340
+  Duration  1.56s (transform 947ms, setup 0ms, import 1.82s, tests 1.39s, environment 7.26s)
341
+
@@ -0,0 +1,11 @@
1
+ # @open-press/core
2
+
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Initial monorepo release of `@open-press/cli` and `@open-press/core` on npm.
8
+
9
+ **@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/`.
10
+
11
+ **@open-press/core** (new): framework runtime, CLI engine, render pipeline, and base page primitives (BasePage, BaseCoverPage, BaseTocPage, BaseBackCoverPage, BaseFigure, BaseCallout). Consumed transitively by workspaces scaffolded via `@open-press/cli`. Exposes the `open-press` bin (dev / build / preview / validate / pdf / deploy / export).
@@ -0,0 +1,36 @@
1
+ # @open-press/core
2
+
3
+ Framework runtime, CLI engine, and page 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 --pack editorial-monograph
9
+ ```
10
+
11
+ The scaffolded workspace contains a snapshot of this package.
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
+ BasePage,
24
+ BaseCoverPage,
25
+ BaseTocPage,
26
+ BaseBackCoverPage,
27
+ BaseFigure,
28
+ BaseCallout,
29
+ } from "@open-press/core";
30
+ ```
31
+
32
+ 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).
33
+
34
+ ## License
35
+
36
+ MIT — see [LICENSE](https://github.com/quan0715/open-press/blob/main/LICENSE).
@@ -0,0 +1,34 @@
1
+ import type { ChildProcess } from "node:child_process";
2
+
3
+ export interface ChromeDevToolsClient {
4
+ send(method: string, params?: Record<string, unknown>): Promise<any>;
5
+ close(): void;
6
+ }
7
+
8
+ export interface PrintUrlToPdfOptions {
9
+ root: string;
10
+ url: string;
11
+ outPath: string;
12
+ chrome?: string;
13
+ waitForReady?: (client: ChromeDevToolsClient) => Promise<unknown>;
14
+ printOptions?: Record<string, unknown>;
15
+ debuggingPortBase?: number;
16
+ debuggingPortRange?: number;
17
+ profilePrefix?: string;
18
+ }
19
+
20
+ export interface EvaluateUrlWithChromeOptions {
21
+ root: string;
22
+ url: string;
23
+ chrome?: string;
24
+ evaluate: (client: ChromeDevToolsClient) => Promise<unknown>;
25
+ emulatedMedia?: "screen" | "print" | "none";
26
+ debuggingPortBase?: number;
27
+ debuggingPortRange?: number;
28
+ profilePrefix?: string;
29
+ }
30
+
31
+ export function printUrlToPdf(options: PrintUrlToPdfOptions): Promise<unknown>;
32
+ export function evaluateUrlWithChrome(options: EvaluateUrlWithChromeOptions): Promise<unknown>;
33
+ export function waitForPrintReady(client: ChromeDevToolsClient): Promise<number>;
34
+ export function stopChildProcess(child: ChildProcess): Promise<void>;