@deckflow/deckuse 1.2.1 → 1.3.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.
Files changed (282) hide show
  1. package/README.es.md +342 -0
  2. package/README.fr.md +342 -0
  3. package/README.ja.md +342 -0
  4. package/README.ko.md +342 -0
  5. package/README.md +60 -8
  6. package/README.pt-BR.md +342 -0
  7. package/README.ru.md +342 -0
  8. package/README.zh-CN.md +367 -0
  9. package/assets/default.docx +0 -0
  10. package/assets/default.pptx +0 -0
  11. package/dist/bin.js +188 -21
  12. package/dist/bin.js.map +1 -1
  13. package/dist/core/adapter.d.ts +24 -0
  14. package/dist/core/adapter.d.ts.map +1 -0
  15. package/dist/core/adapter.js +20 -0
  16. package/dist/core/adapter.js.map +1 -0
  17. package/dist/core/executor.d.ts +24 -0
  18. package/dist/core/executor.d.ts.map +1 -0
  19. package/dist/core/executor.js +65 -0
  20. package/dist/core/executor.js.map +1 -0
  21. package/dist/core/index.d.ts +7 -0
  22. package/dist/core/index.d.ts.map +1 -0
  23. package/dist/core/index.js +7 -0
  24. package/dist/core/index.js.map +1 -0
  25. package/dist/core/length.d.ts +27 -0
  26. package/dist/core/length.d.ts.map +1 -0
  27. package/dist/core/length.js +63 -0
  28. package/dist/core/length.js.map +1 -0
  29. package/dist/core/measure.d.ts +24 -0
  30. package/dist/core/measure.d.ts.map +1 -0
  31. package/dist/core/measure.js +79 -0
  32. package/dist/core/measure.js.map +1 -0
  33. package/dist/core/not-implemented.d.ts +3 -0
  34. package/dist/core/not-implemented.d.ts.map +1 -0
  35. package/dist/core/not-implemented.js +12 -0
  36. package/dist/core/not-implemented.js.map +1 -0
  37. package/dist/core/schema.d.ts +3065 -0
  38. package/dist/core/schema.d.ts.map +1 -0
  39. package/dist/core/schema.js +799 -0
  40. package/dist/core/schema.js.map +1 -0
  41. package/dist/default-template.d.ts +8 -0
  42. package/dist/default-template.d.ts.map +1 -0
  43. package/dist/default-template.js +29 -0
  44. package/dist/default-template.js.map +1 -0
  45. package/dist/docx/adapter.d.ts +29 -0
  46. package/dist/docx/adapter.d.ts.map +1 -0
  47. package/dist/docx/adapter.js +442 -0
  48. package/dist/docx/adapter.js.map +1 -0
  49. package/dist/docx/addressing.d.ts +18 -0
  50. package/dist/docx/addressing.d.ts.map +1 -0
  51. package/dist/docx/addressing.js +111 -0
  52. package/dist/docx/addressing.js.map +1 -0
  53. package/dist/docx/blank.d.ts +4 -0
  54. package/dist/docx/blank.d.ts.map +1 -0
  55. package/dist/docx/blank.js +75 -0
  56. package/dist/docx/blank.js.map +1 -0
  57. package/dist/docx/index-sync.d.ts +7 -0
  58. package/dist/docx/index-sync.d.ts.map +1 -0
  59. package/dist/docx/index-sync.js +24 -0
  60. package/dist/docx/index-sync.js.map +1 -0
  61. package/dist/docx/index.d.ts +5 -0
  62. package/dist/docx/index.d.ts.map +1 -0
  63. package/dist/docx/index.js +4 -0
  64. package/dist/docx/index.js.map +1 -0
  65. package/dist/docx/indexer.d.ts +41 -0
  66. package/dist/docx/indexer.d.ts.map +1 -0
  67. package/dist/docx/indexer.js +353 -0
  68. package/dist/docx/indexer.js.map +1 -0
  69. package/dist/docx/mutations.d.ts +5 -0
  70. package/dist/docx/mutations.d.ts.map +1 -0
  71. package/dist/docx/mutations.js +311 -0
  72. package/dist/docx/mutations.js.map +1 -0
  73. package/dist/docx/paragraphs.d.ts +26 -0
  74. package/dist/docx/paragraphs.d.ts.map +1 -0
  75. package/dist/docx/paragraphs.js +314 -0
  76. package/dist/docx/paragraphs.js.map +1 -0
  77. package/dist/docx/properties.d.ts +23 -0
  78. package/dist/docx/properties.d.ts.map +1 -0
  79. package/dist/docx/properties.js +414 -0
  80. package/dist/docx/properties.js.map +1 -0
  81. package/dist/docx/tables.d.ts +4 -0
  82. package/dist/docx/tables.d.ts.map +1 -0
  83. package/dist/docx/tables.js +64 -0
  84. package/dist/docx/tables.js.map +1 -0
  85. package/dist/docx/text-spans.d.ts +25 -0
  86. package/dist/docx/text-spans.d.ts.map +1 -0
  87. package/dist/docx/text-spans.js +142 -0
  88. package/dist/docx/text-spans.js.map +1 -0
  89. package/dist/docx/types.d.ts +27 -0
  90. package/dist/docx/types.d.ts.map +1 -0
  91. package/dist/docx/types.js +2 -0
  92. package/dist/docx/types.js.map +1 -0
  93. package/dist/docx/workspace.d.ts +20 -0
  94. package/dist/docx/workspace.d.ts.map +1 -0
  95. package/dist/docx/workspace.js +145 -0
  96. package/dist/docx/workspace.js.map +1 -0
  97. package/dist/docx/xml.d.ts +18 -0
  98. package/dist/docx/xml.d.ts.map +1 -0
  99. package/dist/docx/xml.js +87 -0
  100. package/dist/docx/xml.js.map +1 -0
  101. package/dist/edition-config/index.d.ts +25 -0
  102. package/dist/edition-config/index.d.ts.map +1 -0
  103. package/dist/edition-config/index.js +22 -0
  104. package/dist/edition-config/index.js.map +1 -0
  105. package/dist/edition.d.ts +2 -2
  106. package/dist/edition.d.ts.map +1 -1
  107. package/dist/edition.js +1 -1
  108. package/dist/edition.js.map +1 -1
  109. package/dist/help.d.ts.map +1 -1
  110. package/dist/help.js +124 -32
  111. package/dist/help.js.map +1 -1
  112. package/dist/index.d.ts +1 -1
  113. package/dist/index.d.ts.map +1 -1
  114. package/dist/index.js +6 -6
  115. package/dist/index.js.map +1 -1
  116. package/dist/key/index.d.ts +2 -0
  117. package/dist/key/index.d.ts.map +1 -0
  118. package/dist/key/index.js +3 -0
  119. package/dist/key/index.js.map +1 -0
  120. package/dist/monitor-daemon.d.ts +21 -8
  121. package/dist/monitor-daemon.d.ts.map +1 -1
  122. package/dist/monitor-daemon.js +189 -51
  123. package/dist/monitor-daemon.js.map +1 -1
  124. package/dist/monitor-registry.d.ts +34 -0
  125. package/dist/monitor-registry.d.ts.map +1 -0
  126. package/dist/monitor-registry.js +191 -0
  127. package/dist/monitor-registry.js.map +1 -0
  128. package/dist/monitor.d.ts.map +1 -1
  129. package/dist/monitor.js +2 -12
  130. package/dist/monitor.js.map +1 -1
  131. package/dist/numbers/index.d.ts +2 -0
  132. package/dist/numbers/index.d.ts.map +1 -0
  133. package/dist/numbers/index.js +3 -0
  134. package/dist/numbers/index.js.map +1 -0
  135. package/dist/opc/index.d.ts +96 -0
  136. package/dist/opc/index.d.ts.map +1 -0
  137. package/dist/opc/index.js +596 -0
  138. package/dist/opc/index.js.map +1 -0
  139. package/dist/pptx/adapter.d.ts +167 -0
  140. package/dist/pptx/adapter.d.ts.map +1 -0
  141. package/dist/pptx/adapter.js +841 -0
  142. package/dist/pptx/adapter.js.map +1 -0
  143. package/dist/pptx/addressing.d.ts +47 -0
  144. package/dist/pptx/addressing.d.ts.map +1 -0
  145. package/dist/pptx/addressing.js +481 -0
  146. package/dist/pptx/addressing.js.map +1 -0
  147. package/dist/pptx/align.d.ts +24 -0
  148. package/dist/pptx/align.d.ts.map +1 -0
  149. package/dist/pptx/align.js +112 -0
  150. package/dist/pptx/align.js.map +1 -0
  151. package/dist/pptx/chart-classify.d.ts +10 -0
  152. package/dist/pptx/chart-classify.d.ts.map +1 -0
  153. package/dist/pptx/chart-classify.js +58 -0
  154. package/dist/pptx/chart-classify.js.map +1 -0
  155. package/dist/pptx/chart.d.ts +42 -0
  156. package/dist/pptx/chart.d.ts.map +1 -0
  157. package/dist/pptx/chart.js +614 -0
  158. package/dist/pptx/chart.js.map +1 -0
  159. package/dist/pptx/edition-extension.d.ts +25 -0
  160. package/dist/pptx/edition-extension.d.ts.map +1 -0
  161. package/dist/pptx/edition-extension.js +10 -0
  162. package/dist/pptx/edition-extension.js.map +1 -0
  163. package/dist/pptx/edition.d.ts +20 -0
  164. package/dist/pptx/edition.d.ts.map +1 -0
  165. package/dist/pptx/edition.js +69 -0
  166. package/dist/pptx/edition.js.map +1 -0
  167. package/dist/pptx/elements.d.ts +12 -0
  168. package/dist/pptx/elements.d.ts.map +1 -0
  169. package/dist/pptx/elements.js +224 -0
  170. package/dist/pptx/elements.js.map +1 -0
  171. package/dist/pptx/hyperlink.d.ts +7 -0
  172. package/dist/pptx/hyperlink.d.ts.map +1 -0
  173. package/dist/pptx/hyperlink.js +81 -0
  174. package/dist/pptx/hyperlink.js.map +1 -0
  175. package/dist/pptx/index-sync.d.ts +7 -0
  176. package/dist/pptx/index-sync.d.ts.map +1 -0
  177. package/dist/pptx/index-sync.js +24 -0
  178. package/dist/pptx/index-sync.js.map +1 -0
  179. package/dist/pptx/index.d.ts +10 -0
  180. package/dist/pptx/index.d.ts.map +1 -0
  181. package/dist/pptx/index.js +7 -0
  182. package/dist/pptx/index.js.map +1 -0
  183. package/dist/pptx/indexer.d.ts +19 -0
  184. package/dist/pptx/indexer.d.ts.map +1 -0
  185. package/dist/pptx/indexer.js +320 -0
  186. package/dist/pptx/indexer.js.map +1 -0
  187. package/dist/pptx/layout-ref.d.ts +41 -0
  188. package/dist/pptx/layout-ref.d.ts.map +1 -0
  189. package/dist/pptx/layout-ref.js +145 -0
  190. package/dist/pptx/layout-ref.js.map +1 -0
  191. package/dist/pptx/media.d.ts +15 -0
  192. package/dist/pptx/media.d.ts.map +1 -0
  193. package/dist/pptx/media.js +145 -0
  194. package/dist/pptx/media.js.map +1 -0
  195. package/dist/pptx/mutations.d.ts +11 -0
  196. package/dist/pptx/mutations.d.ts.map +1 -0
  197. package/dist/pptx/mutations.js +1114 -0
  198. package/dist/pptx/mutations.js.map +1 -0
  199. package/dist/pptx/picture.d.ts +25 -0
  200. package/dist/pptx/picture.d.ts.map +1 -0
  201. package/dist/pptx/picture.js +118 -0
  202. package/dist/pptx/picture.js.map +1 -0
  203. package/dist/pptx/placeholder-role.d.ts +19 -0
  204. package/dist/pptx/placeholder-role.d.ts.map +1 -0
  205. package/dist/pptx/placeholder-role.js +71 -0
  206. package/dist/pptx/placeholder-role.js.map +1 -0
  207. package/dist/pptx/properties.d.ts +13 -0
  208. package/dist/pptx/properties.d.ts.map +1 -0
  209. package/dist/pptx/properties.js +587 -0
  210. package/dist/pptx/properties.js.map +1 -0
  211. package/dist/pptx/resolve-properties.d.ts +17 -0
  212. package/dist/pptx/resolve-properties.d.ts.map +1 -0
  213. package/dist/pptx/resolve-properties.js +623 -0
  214. package/dist/pptx/resolve-properties.js.map +1 -0
  215. package/dist/pptx/slide-size.d.ts +9 -0
  216. package/dist/pptx/slide-size.d.ts.map +1 -0
  217. package/dist/pptx/slide-size.js +29 -0
  218. package/dist/pptx/slide-size.js.map +1 -0
  219. package/dist/pptx/slides.d.ts +15 -0
  220. package/dist/pptx/slides.d.ts.map +1 -0
  221. package/dist/pptx/slides.js +247 -0
  222. package/dist/pptx/slides.js.map +1 -0
  223. package/dist/pptx/table-measure.d.ts +43 -0
  224. package/dist/pptx/table-measure.d.ts.map +1 -0
  225. package/dist/pptx/table-measure.js +70 -0
  226. package/dist/pptx/table-measure.js.map +1 -0
  227. package/dist/pptx/table.d.ts +26 -0
  228. package/dist/pptx/table.d.ts.map +1 -0
  229. package/dist/pptx/table.js +638 -0
  230. package/dist/pptx/table.js.map +1 -0
  231. package/dist/pptx/types.d.ts +27 -0
  232. package/dist/pptx/types.d.ts.map +1 -0
  233. package/dist/pptx/types.js +2 -0
  234. package/dist/pptx/types.js.map +1 -0
  235. package/dist/pptx/workspace.d.ts +23 -0
  236. package/dist/pptx/workspace.d.ts.map +1 -0
  237. package/dist/pptx/workspace.js +148 -0
  238. package/dist/pptx/workspace.js.map +1 -0
  239. package/dist/pptx/xml.d.ts +75 -0
  240. package/dist/pptx/xml.d.ts.map +1 -0
  241. package/dist/pptx/xml.js +390 -0
  242. package/dist/pptx/xml.js.map +1 -0
  243. package/dist/render.d.ts.map +1 -1
  244. package/dist/render.js +14 -2
  245. package/dist/render.js.map +1 -1
  246. package/dist/version.d.ts +1 -1
  247. package/dist/version.js +1 -1
  248. package/dist/workspace/git.d.ts +7 -0
  249. package/dist/workspace/git.d.ts.map +1 -0
  250. package/dist/workspace/git.js +119 -0
  251. package/dist/workspace/git.js.map +1 -0
  252. package/dist/workspace/index.d.ts +7 -0
  253. package/dist/workspace/index.d.ts.map +1 -0
  254. package/dist/workspace/index.js +7 -0
  255. package/dist/workspace/index.js.map +1 -0
  256. package/dist/workspace/lock.d.ts +5 -0
  257. package/dist/workspace/lock.d.ts.map +1 -0
  258. package/dist/workspace/lock.js +104 -0
  259. package/dist/workspace/lock.js.map +1 -0
  260. package/dist/workspace/metadata.d.ts +4 -0
  261. package/dist/workspace/metadata.d.ts.map +1 -0
  262. package/dist/workspace/metadata.js +21 -0
  263. package/dist/workspace/metadata.js.map +1 -0
  264. package/dist/workspace/operations.d.ts +14 -0
  265. package/dist/workspace/operations.d.ts.map +1 -0
  266. package/dist/workspace/operations.js +35 -0
  267. package/dist/workspace/operations.js.map +1 -0
  268. package/dist/workspace/paths.d.ts +11 -0
  269. package/dist/workspace/paths.d.ts.map +1 -0
  270. package/dist/workspace/paths.js +12 -0
  271. package/dist/workspace/paths.js.map +1 -0
  272. package/dist/workspace/revision.d.ts +6 -0
  273. package/dist/workspace/revision.d.ts.map +1 -0
  274. package/dist/workspace/revision.js +15 -0
  275. package/dist/workspace/revision.js.map +1 -0
  276. package/dist/xlsx/index.d.ts +2 -0
  277. package/dist/xlsx/index.d.ts.map +1 -0
  278. package/dist/xlsx/index.js +3 -0
  279. package/dist/xlsx/index.js.map +1 -0
  280. package/package.json +51 -27
  281. package/schema/command.schema.json +2405 -0
  282. package/dist/.tsbuildinfo +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workspace/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,SAAS,EACT,cAAc,EACd,UAAU,EACV,UAAU,EACV,SAAS,EACT,QAAQ,EACR,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,eAAe,EACf,QAAQ,EACR,sBAAsB,GACvB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC7E,OAAO,EACL,KAAK,eAAe,EACpB,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,7 @@
1
+ export { sourceDir, deckuseDir, manifestPath, indexPath, operationsPath, monitorDir, previewDir, renderDir, lockPath, gitignorePath, } from './paths.js';
2
+ export { revision, nextRevision, isIntegerRevision, INITIAL_REVISION } from './revision.js';
3
+ export { hasWorkspaceGitRepo, ensureGitignore, initGitRepo, commitWorkspace, resetGit, operationCommitMessage, } from './git.js';
4
+ export { acquireWriteLock, isWriteLockHeld, withWriteLock } from './lock.js';
5
+ export { readOperations, writeOperations, appendOperationCommit, readHistory, } from './operations.js';
6
+ export { readManifest, writeMetadata } from './metadata.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workspace/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,SAAS,EACT,cAAc,EACd,UAAU,EACV,UAAU,EACV,SAAS,EACT,QAAQ,EACR,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,eAAe,EACf,QAAQ,EACR,sBAAsB,GACvB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC7E,OAAO,EAEL,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,5 @@
1
+ /** True when a live process holds the write lock (stale/empty files count as unlocked). */
2
+ export declare const isWriteLockHeld: (workspace: string) => Promise<boolean>;
3
+ export declare const acquireWriteLock: (workspace: string) => Promise<() => Promise<void>>;
4
+ export declare const withWriteLock: <T>(workspace: string, operation: () => Promise<T>) => Promise<T>;
5
+ //# sourceMappingURL=lock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../src/workspace/lock.ts"],"names":[],"mappings":"AAiDA,2FAA2F;AAC3F,eAAO,MAAM,eAAe,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,OAAO,CAaxE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CA0BrF,CAAC;AAEF,eAAO,MAAM,aAAa,GAAU,CAAC,EACnC,WAAW,MAAM,EACjB,WAAW,MAAM,OAAO,CAAC,CAAC,CAAC,KAC1B,OAAO,CAAC,CAAC,CAOX,CAAC"}
@@ -0,0 +1,104 @@
1
+ import { mkdir, open, readFile, rm } from 'node:fs/promises';
2
+ import { deckuseDir, lockPath } from './paths.js';
3
+ const LOCK_WAIT_MS = 30_000;
4
+ const LOCK_POLL_MS = 50;
5
+ const isProcessAlive = (pid) => {
6
+ if (!Number.isInteger(pid) || pid <= 0)
7
+ return false;
8
+ try {
9
+ process.kill(pid, 0);
10
+ return true;
11
+ }
12
+ catch (error) {
13
+ return error.code !== 'ESRCH';
14
+ }
15
+ };
16
+ const parseLockPayload = (raw) => {
17
+ const trimmed = raw.trim();
18
+ if (!trimmed)
19
+ return undefined;
20
+ try {
21
+ const value = JSON.parse(trimmed);
22
+ if (!Number.isInteger(value.pid) || value.pid <= 0)
23
+ return undefined;
24
+ if (!Number.isFinite(value.acquiredAt))
25
+ return undefined;
26
+ return { pid: value.pid, acquiredAt: value.acquiredAt };
27
+ }
28
+ catch {
29
+ return undefined;
30
+ }
31
+ };
32
+ /** Remove lock if missing holder / dead PID. Returns true when the path is free. */
33
+ const reclaimIfStale = async (path) => {
34
+ let raw;
35
+ try {
36
+ raw = await readFile(path, 'utf8');
37
+ }
38
+ catch (error) {
39
+ if (error.code === 'ENOENT')
40
+ return true;
41
+ throw error;
42
+ }
43
+ const payload = parseLockPayload(raw);
44
+ if (payload && isProcessAlive(payload.pid))
45
+ return false;
46
+ await rm(path, { force: true });
47
+ return true;
48
+ };
49
+ /** True when a live process holds the write lock (stale/empty files count as unlocked). */
50
+ export const isWriteLockHeld = async (workspace) => {
51
+ const path = lockPath(workspace);
52
+ let raw;
53
+ try {
54
+ raw = await readFile(path, 'utf8');
55
+ }
56
+ catch (error) {
57
+ if (error.code === 'ENOENT')
58
+ return false;
59
+ throw error;
60
+ }
61
+ const payload = parseLockPayload(raw);
62
+ if (payload && isProcessAlive(payload.pid))
63
+ return true;
64
+ await rm(path, { force: true });
65
+ return false;
66
+ };
67
+ export const acquireWriteLock = async (workspace) => {
68
+ await mkdir(deckuseDir(workspace), { recursive: true });
69
+ const path = lockPath(workspace);
70
+ const deadline = Date.now() + LOCK_WAIT_MS;
71
+ let handle;
72
+ while (Date.now() < deadline) {
73
+ try {
74
+ handle = await open(path, 'wx');
75
+ const payload = { pid: process.pid, acquiredAt: Date.now() };
76
+ await handle.writeFile(`${JSON.stringify(payload)}\n`);
77
+ break;
78
+ }
79
+ catch (error) {
80
+ if (error.code !== 'EEXIST')
81
+ throw error;
82
+ if (await reclaimIfStale(path))
83
+ continue;
84
+ await new Promise((resolve) => setTimeout(resolve, LOCK_POLL_MS));
85
+ }
86
+ }
87
+ if (!handle) {
88
+ throw new Error('Timed out waiting for workspace write lock. If no other deckuse process is running, remove .deckuse/write.lock and retry.');
89
+ }
90
+ return async () => {
91
+ await handle.close();
92
+ await rm(path, { force: true });
93
+ };
94
+ };
95
+ export const withWriteLock = async (workspace, operation) => {
96
+ const release = await acquireWriteLock(workspace);
97
+ try {
98
+ return await operation();
99
+ }
100
+ finally {
101
+ await release();
102
+ }
103
+ };
104
+ //# sourceMappingURL=lock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lock.js","sourceRoot":"","sources":["../../src/workspace/lock.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,4 @@
1
+ import type { WorkspaceManifest } from '../core/index.js';
2
+ export declare const readManifest: (workspace: string) => Promise<WorkspaceManifest>;
3
+ export declare const writeMetadata: (workspace: string, manifest: WorkspaceManifest, index: unknown) => Promise<void>;
4
+ //# sourceMappingURL=metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/workspace/metadata.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG1D,eAAO,MAAM,YAAY,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,iBAAiB,CACE,CAAC;AAEnF,eAAO,MAAM,aAAa,GACxB,WAAW,MAAM,EACjB,UAAU,iBAAiB,EAC3B,OAAO,OAAO,KACb,OAAO,CAAC,IAAI,CAcd,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { mkdir, readFile, rename, rm, writeFile } from 'node:fs/promises';
2
+ import { randomUUID } from 'node:crypto';
3
+ import { deckuseDir, indexPath, manifestPath } from './paths.js';
4
+ export const readManifest = async (workspace) => JSON.parse(await readFile(manifestPath(workspace), 'utf8'));
5
+ export const writeMetadata = async (workspace, manifest, index) => {
6
+ await mkdir(deckuseDir(workspace), { recursive: true });
7
+ const nonce = randomUUID();
8
+ const indexTmp = `${indexPath(workspace)}.${nonce}.tmp`;
9
+ const manifestTmp = `${manifestPath(workspace)}.${nonce}.tmp`;
10
+ try {
11
+ await writeFile(indexTmp, `${JSON.stringify(index, null, 2)}\n`, { flag: 'wx' });
12
+ await writeFile(manifestTmp, `${JSON.stringify(manifest, null, 2)}\n`, { flag: 'wx' });
13
+ await rename(indexTmp, indexPath(workspace));
14
+ await rename(manifestTmp, manifestPath(workspace));
15
+ }
16
+ catch (error) {
17
+ await Promise.all([rm(indexTmp, { force: true }), rm(manifestTmp, { force: true })]);
18
+ throw error;
19
+ }
20
+ };
21
+ //# sourceMappingURL=metadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/workspace/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEjE,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAAE,SAAiB,EAA8B,EAAE,CAClF,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,CAAsB,CAAC;AAEnF,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAChC,SAAiB,EACjB,QAA2B,EAC3B,KAAc,EACC,EAAE;IACjB,MAAM,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACxD,MAAM,KAAK,GAAG,UAAU,EAAE,CAAC;IAC3B,MAAM,QAAQ,GAAG,GAAG,SAAS,CAAC,SAAS,CAAC,IAAI,KAAK,MAAM,CAAC;IACxD,MAAM,WAAW,GAAG,GAAG,YAAY,CAAC,SAAS,CAAC,IAAI,KAAK,MAAM,CAAC;IAC9D,IAAI,CAAC;QACH,MAAM,SAAS,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QACjF,MAAM,SAAS,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QACvF,MAAM,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;QAC7C,MAAM,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;IACrD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACrF,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ export interface OperationRecord {
2
+ readonly at: string;
3
+ readonly revision: string;
4
+ readonly operation: unknown;
5
+ readonly slides: number[];
6
+ }
7
+ export declare const readOperations: (workspace: string) => Promise<OperationRecord[]>;
8
+ export declare const writeOperations: (workspace: string, records: OperationRecord[]) => Promise<void>;
9
+ export declare const appendOperationCommit: (workspace: string, record: OperationRecord) => Promise<string>;
10
+ export declare const readHistory: (workspace: string, limit: number, offset: number) => Promise<{
11
+ records: OperationRecord[];
12
+ total: number;
13
+ }>;
14
+ //# sourceMappingURL=operations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/workspace/operations.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,eAAO,MAAM,cAAc,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,eAAe,EAAE,CAWjF,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,WAAW,MAAM,EACjB,SAAS,eAAe,EAAE,KACzB,OAAO,CAAC,IAAI,CAMd,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,WAAW,MAAM,EACjB,QAAQ,eAAe,KACtB,OAAO,CAAC,MAAM,CAKhB,CAAC;AAEF,eAAO,MAAM,WAAW,GACtB,WAAW,MAAM,EACjB,OAAO,MAAM,EACb,QAAQ,MAAM,KACb,OAAO,CAAC;IAAE,OAAO,EAAE,eAAe,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAGvD,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { mkdir, readFile, writeFile } from 'node:fs/promises';
2
+ import { commitWorkspace, operationCommitMessage } from './git.js';
3
+ import { deckuseDir, operationsPath } from './paths.js';
4
+ export const readOperations = async (workspace) => {
5
+ try {
6
+ const raw = await readFile(operationsPath(workspace), 'utf8');
7
+ return raw
8
+ .split(/\r?\n/)
9
+ .filter(Boolean)
10
+ .map((line) => JSON.parse(line));
11
+ }
12
+ catch (error) {
13
+ if (error.code === 'ENOENT')
14
+ return [];
15
+ throw error;
16
+ }
17
+ };
18
+ export const writeOperations = async (workspace, records) => {
19
+ await mkdir(deckuseDir(workspace), { recursive: true });
20
+ const content = records.length
21
+ ? `${records.map((record) => JSON.stringify(record)).join('\n')}\n`
22
+ : '';
23
+ await writeFile(operationsPath(workspace), content);
24
+ };
25
+ export const appendOperationCommit = async (workspace, record) => {
26
+ const records = await readOperations(workspace);
27
+ records.push(record);
28
+ await writeOperations(workspace, records);
29
+ return commitWorkspace(workspace, operationCommitMessage(record.operation));
30
+ };
31
+ export const readHistory = async (workspace, limit, offset) => {
32
+ const records = await readOperations(workspace);
33
+ return { records: records.slice(offset, offset + limit), total: records.length };
34
+ };
35
+ //# sourceMappingURL=operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../src/workspace/operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AASxD,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EAAE,SAAiB,EAA8B,EAAE;IACpF,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;QAC9D,OAAO,GAAG;aACP,KAAK,CAAC,OAAO,CAAC;aACd,MAAM,CAAC,OAAO,CAAC;aACf,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAoB,CAAC,CAAC;IACxD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAK,KAA+B,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO,EAAE,CAAC;QAClE,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAClC,SAAiB,EACjB,OAA0B,EACX,EAAE;IACjB,MAAM,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACxD,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM;QAC5B,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;QACnE,CAAC,CAAC,EAAE,CAAC;IACP,MAAM,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC;AACtD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,EACxC,SAAiB,EACjB,MAAuB,EACN,EAAE;IACnB,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,SAAS,CAAC,CAAC;IAChD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACrB,MAAM,eAAe,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC1C,OAAO,eAAe,CAAC,SAAS,EAAE,sBAAsB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;AAC9E,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAC9B,SAAiB,EACjB,KAAa,EACb,MAAc,EAC0C,EAAE;IAC1D,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,SAAS,CAAC,CAAC;IAChD,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;AACnF,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ export declare const sourceDir: (workspace: string) => string;
2
+ export declare const deckuseDir: (workspace: string) => string;
3
+ export declare const manifestPath: (workspace: string) => string;
4
+ export declare const indexPath: (workspace: string) => string;
5
+ export declare const operationsPath: (workspace: string) => string;
6
+ export declare const monitorDir: (workspace: string) => string;
7
+ export declare const previewDir: (workspace: string) => string;
8
+ export declare const renderDir: (workspace: string) => string;
9
+ export declare const lockPath: (workspace: string) => string;
10
+ export declare const gitignorePath: (workspace: string) => string;
11
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/workspace/paths.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,GAAI,WAAW,MAAM,WAAuC,CAAC;AACnF,eAAO,MAAM,UAAU,GAAI,WAAW,MAAM,WAAyC,CAAC;AACtF,eAAO,MAAM,YAAY,GAAI,WAAW,MAAM,WAAiD,CAAC;AAChG,eAAO,MAAM,SAAS,GAAI,WAAW,MAAM,WAA8C,CAAC;AAC1F,eAAO,MAAM,cAAc,GAAI,WAAW,MAAM,WACC,CAAC;AAClD,eAAO,MAAM,UAAU,GAAI,WAAW,MAAM,WAA2C,CAAC;AACxF,eAAO,MAAM,UAAU,GAAI,WAAW,MAAM,WAA2C,CAAC;AACxF,eAAO,MAAM,SAAS,GAAI,WAAW,MAAM,WAA0C,CAAC;AACtF,eAAO,MAAM,QAAQ,GAAI,WAAW,MAAM,WAA8C,CAAC;AACzF,eAAO,MAAM,aAAa,GAAI,WAAW,MAAM,WAA2C,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { join, resolve } from 'node:path';
2
+ export const sourceDir = (workspace) => join(resolve(workspace), 'source');
3
+ export const deckuseDir = (workspace) => join(resolve(workspace), '.deckuse');
4
+ export const manifestPath = (workspace) => join(deckuseDir(workspace), 'manifest.json');
5
+ export const indexPath = (workspace) => join(deckuseDir(workspace), 'index.json');
6
+ export const operationsPath = (workspace) => join(deckuseDir(workspace), 'operations.jsonl');
7
+ export const monitorDir = (workspace) => join(deckuseDir(workspace), 'monitor');
8
+ export const previewDir = (workspace) => join(deckuseDir(workspace), 'preview');
9
+ export const renderDir = (workspace) => join(deckuseDir(workspace), 'render');
10
+ export const lockPath = (workspace) => join(deckuseDir(workspace), 'write.lock');
11
+ export const gitignorePath = (workspace) => join(resolve(workspace), '.gitignore');
12
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/workspace/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;AACnF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;AACtF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,eAAe,CAAC,CAAC;AAChG,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,YAAY,CAAC,CAAC;AAC1F,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAAiB,EAAE,EAAE,CAClD,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,kBAAkB,CAAC,CAAC;AAClD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC,CAAC;AACxF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC,CAAC;AACxF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;AACtF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,YAAY,CAAC,CAAC;AACzF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,YAAY,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ /** Monotonic integer revision as a decimal string (index/manifest stay string-typed). */
2
+ export declare const INITIAL_REVISION = "1";
3
+ export declare const revision: () => string;
4
+ export declare const nextRevision: (current: string) => string;
5
+ export declare const isIntegerRevision: (value: string) => boolean;
6
+ //# sourceMappingURL=revision.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revision.d.ts","sourceRoot":"","sources":["../../src/workspace/revision.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC,eAAO,MAAM,QAAQ,QAAO,MAA0B,CAAC;AAEvD,eAAO,MAAM,YAAY,GAAI,SAAS,MAAM,KAAG,MAK9C,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,OAAO,MAAM,KAAG,OAGjD,CAAC"}
@@ -0,0 +1,15 @@
1
+ /** Monotonic integer revision as a decimal string (index/manifest stay string-typed). */
2
+ export const INITIAL_REVISION = '1';
3
+ export const revision = () => INITIAL_REVISION;
4
+ export const nextRevision = (current) => {
5
+ const n = Number(current);
6
+ if (Number.isInteger(n) && n >= 0)
7
+ return String(n + 1);
8
+ // Legacy non-integer revisions: start a new integer line after the write.
9
+ return INITIAL_REVISION;
10
+ };
11
+ export const isIntegerRevision = (value) => {
12
+ const n = Number(value);
13
+ return Number.isInteger(n) && n >= 1 && String(n) === value;
14
+ };
15
+ //# sourceMappingURL=revision.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revision.js","sourceRoot":"","sources":["../../src/workspace/revision.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAEpC,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAW,EAAE,CAAC,gBAAgB,CAAC;AAEvD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAe,EAAU,EAAE;IACtD,MAAM,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAC1B,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACxD,0EAA0E;IAC1E,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAa,EAAW,EAAE;IAC1D,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACxB,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC;AAC9D,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const xlsxAdapter: import("../core/adapter.js").FormatAdapter;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/xlsx/index.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,WAAW,4CAAsC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { createNotImplementedAdapter } from '../core/index.js';
2
+ export const xlsxAdapter = createNotImplementedAdapter('xlsx');
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/xlsx/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/D,MAAM,CAAC,MAAM,WAAW,GAAG,2BAA2B,CAAC,MAAM,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@deckflow/deckuse",
3
- "version": "1.2.1",
3
+ "version": "1.3.1",
4
4
  "license": "AGPL-3.0",
5
5
  "type": "module",
6
6
  "private": false,
7
+ "packageManager": "pnpm@10.6.3",
8
+ "engines": {
9
+ "node": ">=20.19.0"
10
+ },
7
11
  "exports": {
8
12
  ".": {
9
13
  "types": "./dist/index.d.ts",
@@ -12,40 +16,60 @@
12
16
  "./bin": {
13
17
  "types": "./dist/bin.d.ts",
14
18
  "import": "./dist/bin.js"
15
- }
19
+ },
20
+ "./schema/command.json": "./schema/command.schema.json"
16
21
  },
17
22
  "files": [
18
- "dist"
23
+ "dist",
24
+ "assets",
25
+ "schema"
19
26
  ],
20
- "dependencies": {
21
- "@deckflow/office2html": "^0.3.3",
22
- "playwright-core": "^1.62.1",
23
- "@deckflow/deckuse-core": "1.2.1",
24
- "@deckflow/deckuse-edition-config": "1.2.0",
25
- "@deckflow/deckuse-pptx": "1.2.1",
26
- "@deckflow/deckuse-docx": "0.1.3",
27
- "@deckflow/deckuse-workspace": "1.1.2",
28
- "@deckflow/deckuse-xlsx": "0.1.3",
29
- "@deckflow/deckuse-numbers": "0.1.3",
30
- "@deckflow/deckuse-key": "0.1.3"
31
- },
32
- "engines": {
33
- "node": ">=18.0.0"
34
- },
35
27
  "bin": {
36
28
  "deckuse": "./dist/bin.js"
37
29
  },
30
+ "scripts": {
31
+ "prepare": "git config core.hooksPath .githooks || true",
32
+ "build": "node scripts/generate-cli-version.mjs && tsc && node scripts/generate-schema.mjs",
33
+ "prepack": "node scripts/sync-npm-readme.mjs",
34
+ "postpack": "node scripts/sync-npm-readme.mjs --restore",
35
+ "lint": "eslint .",
36
+ "typecheck": "tsc --pretty false",
37
+ "test": "vitest run",
38
+ "test:integration-writes": "node scripts/integration-writes.mjs",
39
+ "test:integration-writes:smoke": "node scripts/integration-writes-smoke.mjs",
40
+ "test:integration-writes:corpus": "node scripts/integration-writes.mjs",
41
+ "test:openability": "node scripts/check-openability.mjs",
42
+ "format": "prettier --write .",
43
+ "format:check": "prettier --check .",
44
+ "check:no-commercial-leak": "node scripts/assert-no-commercial-leak.mjs",
45
+ "install:global": "node scripts/install-global.mjs",
46
+ "uninstall:global": "node scripts/uninstall-global.mjs",
47
+ "changeset": "changeset",
48
+ "version-packages": "changeset version",
49
+ "release": "pnpm build && pnpm check:no-commercial-leak && node scripts/sync-npm-readme.mjs && changeset publish && node scripts/sync-npm-readme.mjs --restore"
50
+ },
51
+ "dependencies": {
52
+ "@deckflow/office2html": "^0.3.5",
53
+ "@xmldom/xmldom": "^0.9.10",
54
+ "@zip.js/zip.js": "^2.8.34",
55
+ "isomorphic-git": "latest",
56
+ "playwright-core": "^1.62.1",
57
+ "zod": "latest"
58
+ },
38
59
  "devDependencies": {
39
- "@deckflow/deckuse-opc": "1.1.0"
60
+ "@changesets/cli": "latest",
61
+ "@eslint/js": "latest",
62
+ "@types/node": "latest",
63
+ "eslint": "latest",
64
+ "eslint-config-prettier": "latest",
65
+ "prettier": "latest",
66
+ "typescript": "^5.9.3",
67
+ "typescript-eslint": "latest",
68
+ "vitest": "latest"
40
69
  },
41
70
  "repository": {
42
71
  "type": "git",
43
- "url": "git+https://github.com/deckflow/deckuse.git",
44
- "directory": "packages/deckuse"
72
+ "url": "git+https://github.com/deckflow/deckuse.git"
45
73
  },
46
- "homepage": "https://github.com/deckflow/deckuse#readme",
47
- "scripts": {
48
- "build": "node ../../scripts/generate-cli-version.mjs && tsc -b",
49
- "typecheck": "tsc -b --pretty false"
50
- }
51
- }
74
+ "homepage": "https://github.com/deckflow/deckuse#readme"
75
+ }