@shbernal/ts-xlsx 1.3.1 → 2.1.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 (186) hide show
  1. package/README.md +20 -10
  2. package/dist/bytes.d.ts +24 -0
  3. package/dist/bytes.js +34 -0
  4. package/dist/core/address.d.ts +72 -3
  5. package/dist/core/address.js +50 -10
  6. package/dist/core/autofilter.d.ts +13 -2
  7. package/dist/core/autofilter.js +35 -10
  8. package/dist/core/cell.d.ts +17 -16
  9. package/dist/core/cell.js +3 -7
  10. package/dist/core/color-resolution.d.ts +8 -8
  11. package/dist/core/color-resolution.js +7 -8
  12. package/dist/core/column.d.ts +8 -9
  13. package/dist/core/column.js +2 -4
  14. package/dist/core/comment-thread.d.ts +32 -23
  15. package/dist/core/comment-thread.js +4 -4
  16. package/dist/core/conditional-formatting-overlay.d.ts +6 -1
  17. package/dist/core/conditional-formatting-overlay.js +11 -0
  18. package/dist/core/conditional-formatting.d.ts +48 -8
  19. package/dist/core/conditional-formatting.js +88 -0
  20. package/dist/core/data-validation-overlay.d.ts +12 -1
  21. package/dist/core/data-validation-overlay.js +21 -2
  22. package/dist/core/data-validation.d.ts +12 -5
  23. package/dist/core/data-validation.js +34 -0
  24. package/dist/core/date.d.ts +3 -3
  25. package/dist/core/formula.d.ts +6 -6
  26. package/dist/core/grid-edits.d.ts +16 -0
  27. package/dist/core/grid-edits.js +29 -11
  28. package/dist/core/grid-shift.d.ts +19 -0
  29. package/dist/core/grid-shift.js +8 -0
  30. package/dist/core/image.d.ts +39 -2
  31. package/dist/core/image.js +10 -0
  32. package/dist/core/internal.d.ts +9 -1
  33. package/dist/core/limits.d.ts +4 -4
  34. package/dist/core/merge.d.ts +17 -12
  35. package/dist/core/merge.js +36 -5
  36. package/dist/core/page-setup.d.ts +20 -6
  37. package/dist/core/page-setup.js +8 -1
  38. package/dist/core/pivot-table.d.ts +4 -4
  39. package/dist/core/pivot-table.js +29 -20
  40. package/dist/core/preserved.d.ts +3 -3
  41. package/dist/core/protection.d.ts +7 -4
  42. package/dist/core/protection.js +20 -14
  43. package/dist/core/range.d.ts +16 -14
  44. package/dist/core/range.js +5 -5
  45. package/dist/core/row-input.d.ts +9 -8
  46. package/dist/core/row-input.js +12 -10
  47. package/dist/core/row.d.ts +7 -8
  48. package/dist/core/row.js +2 -4
  49. package/dist/core/style.d.ts +41 -14
  50. package/dist/core/style.js +82 -67
  51. package/dist/core/table-style.d.ts +9 -9
  52. package/dist/core/table-style.js +1 -1
  53. package/dist/core/table.d.ts +53 -51
  54. package/dist/core/table.js +83 -41
  55. package/dist/core/theme.d.ts +16 -44
  56. package/dist/core/theme.js +6 -148
  57. package/dist/core/value.d.ts +7 -7
  58. package/dist/core/workbook-protection.d.ts +2 -2
  59. package/dist/core/workbook-styles.d.ts +26 -0
  60. package/dist/core/workbook-styles.js +48 -0
  61. package/dist/core/workbook-theme.d.ts +25 -0
  62. package/dist/core/workbook-theme.js +49 -0
  63. package/dist/core/workbook-vba.d.ts +17 -0
  64. package/dist/core/workbook-vba.js +79 -0
  65. package/dist/core/workbook.d.ts +133 -87
  66. package/dist/core/workbook.js +74 -133
  67. package/dist/core/worksheet-comments.d.ts +17 -0
  68. package/dist/core/worksheet-comments.js +70 -0
  69. package/dist/core/worksheet-model.d.ts +4 -4
  70. package/dist/core/worksheet-model.js +1 -0
  71. package/dist/core/worksheet-pictures.d.ts +29 -0
  72. package/dist/core/worksheet-pictures.js +42 -0
  73. package/dist/core/worksheet.d.ts +100 -79
  74. package/dist/core/worksheet.js +63 -142
  75. package/dist/customui/errors.d.ts +1 -1
  76. package/dist/customui/ribbon.d.ts +3 -3
  77. package/dist/customui/ribbon.js +24 -23
  78. package/dist/entries/core.d.ts +7 -7
  79. package/dist/entries/core.js +1 -1
  80. package/dist/entries/csv.d.ts +1 -1
  81. package/dist/entries/node-unavailable.d.ts +15 -0
  82. package/dist/entries/node-unavailable.js +20 -0
  83. package/dist/entries/node.d.ts +1 -0
  84. package/dist/entries/node.js +1 -0
  85. package/dist/entries/vba.d.ts +1 -1
  86. package/dist/entries/vba.js +1 -1
  87. package/dist/entries/xlsx.d.ts +1 -1
  88. package/dist/entries/xlsx.js +1 -1
  89. package/dist/errors.d.ts +12 -12
  90. package/dist/io/csv/read.js +2 -3
  91. package/dist/io/csv/write.d.ts +19 -4
  92. package/dist/io/csv/write.js +34 -4
  93. package/dist/io/opc/errors.d.ts +6 -6
  94. package/dist/io/opc/inflate.d.ts +1 -1
  95. package/dist/io/opc/inflate.js +2 -12
  96. package/dist/io/opc/namespaces.d.ts +1 -1
  97. package/dist/io/opc/read-opc.d.ts +19 -3
  98. package/dist/io/opc/read-opc.js +14 -8
  99. package/dist/io/opc/read-options.d.ts +2 -2
  100. package/dist/io/opc/rels.d.ts +11 -0
  101. package/dist/io/opc/rels.js +3 -2
  102. package/dist/io/opc/sniff-format.d.ts +2 -2
  103. package/dist/io/style/xf-style.d.ts +44 -7
  104. package/dist/io/style/xf-style.js +27 -0
  105. package/dist/io/xlsb/errors.d.ts +1 -1
  106. package/dist/io/xlsb/formula.d.ts +4 -4
  107. package/dist/io/xlsb/primitives.d.ts +8 -8
  108. package/dist/io/xlsb/ptg-functions.d.ts +1 -1
  109. package/dist/io/xlsb/read-styles.js +2 -20
  110. package/dist/io/xlsb/read.d.ts +2 -2
  111. package/dist/io/xlsx/cell-accumulator.d.ts +26 -9
  112. package/dist/io/xlsx/cell-accumulator.js +89 -46
  113. package/dist/io/xlsx/cell-value.d.ts +3 -3
  114. package/dist/io/xlsx/cell-value.js +9 -6
  115. package/dist/io/xlsx/color-xml.d.ts +1 -1
  116. package/dist/io/xlsx/color-xml.js +18 -23
  117. package/dist/io/xlsx/comments.d.ts +5 -5
  118. package/dist/io/xlsx/comments.js +17 -8
  119. package/dist/io/xlsx/conditional-formatting.d.ts +4 -4
  120. package/dist/io/xlsx/conditional-formatting.js +64 -58
  121. package/dist/io/xlsx/data-validation.d.ts +3 -3
  122. package/dist/io/xlsx/data-validation.js +35 -33
  123. package/dist/io/xlsx/errors.d.ts +3 -3
  124. package/dist/io/xlsx/hyperlinks.d.ts +4 -2
  125. package/dist/io/xlsx/hyperlinks.js +10 -18
  126. package/dist/io/xlsx/images.d.ts +1 -1
  127. package/dist/io/xlsx/images.js +25 -28
  128. package/dist/io/xlsx/namespaces.d.ts +2 -2
  129. package/dist/io/xlsx/package-plan.js +5 -2
  130. package/dist/io/xlsx/read-pivot.js +4 -13
  131. package/dist/io/xlsx/read-rows.d.ts +13 -13
  132. package/dist/io/xlsx/read-rows.js +19 -55
  133. package/dist/io/xlsx/read-shared-strings.js +7 -44
  134. package/dist/io/xlsx/read-styles.d.ts +3 -3
  135. package/dist/io/xlsx/read-styles.js +42 -66
  136. package/dist/io/xlsx/read-worksheet.js +73 -129
  137. package/dist/io/xlsx/read.d.ts +4 -6
  138. package/dist/io/xlsx/read.js +104 -142
  139. package/dist/io/xlsx/rich-runs.d.ts +41 -7
  140. package/dist/io/xlsx/rich-runs.js +94 -30
  141. package/dist/io/xlsx/rich-text.d.ts +1 -1
  142. package/dist/io/xlsx/shared-strings.d.ts +2 -2
  143. package/dist/io/xlsx/sheet-properties.d.ts +1 -1
  144. package/dist/io/xlsx/sheet-properties.js +14 -10
  145. package/dist/io/xlsx/styles.d.ts +9 -22
  146. package/dist/io/xlsx/styles.js +65 -89
  147. package/dist/io/xlsx/tables.d.ts +2 -2
  148. package/dist/io/xlsx/tables.js +20 -25
  149. package/dist/io/xlsx/theme-xml.d.ts +37 -0
  150. package/dist/io/xlsx/theme-xml.js +145 -0
  151. package/dist/io/xlsx/threaded-comments.d.ts +18 -27
  152. package/dist/io/xlsx/threaded-comments.js +26 -38
  153. package/dist/io/xlsx/workbook-xml.js +14 -8
  154. package/dist/io/xlsx/worksheet-xml.d.ts +2 -2
  155. package/dist/io/xlsx/worksheet-xml.js +40 -48
  156. package/dist/io/xlsx/write-stream.d.ts +23 -16
  157. package/dist/io/xlsx/write-stream.js +13 -14
  158. package/dist/io/xlsx/write.d.ts +8 -7
  159. package/dist/io/xlsx/write.js +6 -3
  160. package/dist/io/xlsx/x14-ext.d.ts +1 -1
  161. package/dist/sha512.d.ts +2 -0
  162. package/dist/sha512.js +146 -0
  163. package/dist/vba/bytes.d.ts +11 -0
  164. package/dist/vba/bytes.js +29 -0
  165. package/dist/vba/cfb-writer.d.ts +1 -1
  166. package/dist/vba/cfb.d.ts +1 -1
  167. package/dist/vba/cfb.js +15 -51
  168. package/dist/vba/codepage.d.ts +2 -2
  169. package/dist/vba/dir-records.d.ts +53 -0
  170. package/dist/vba/dir-records.js +28 -0
  171. package/dist/vba/errors.d.ts +2 -2
  172. package/dist/vba/index.d.ts +2 -2
  173. package/dist/vba/index.js +2 -2
  174. package/dist/vba/ms-ovba.d.ts +1 -1
  175. package/dist/vba/ms-ovba.js +1 -3
  176. package/dist/vba/project-editor.d.ts +9 -9
  177. package/dist/vba/project-editor.js +6 -44
  178. package/dist/vba/project.d.ts +5 -5
  179. package/dist/vba/project.js +3 -28
  180. package/dist/vba/vba-encoding.d.ts +1 -1
  181. package/dist/xml/errors.d.ts +1 -1
  182. package/dist/xml/xml-read.d.ts +98 -9
  183. package/dist/xml/xml-read.js +70 -0
  184. package/dist/xml/xml.d.ts +74 -10
  185. package/dist/xml/xml.js +39 -7
  186. package/package.json +59 -36
package/dist/xml/xml.d.ts CHANGED
@@ -1,23 +1,45 @@
1
+ /**
2
+ * Refuse a string that XML cannot carry, naming the character and where it is so the author
3
+ * can find it in a value they never inspected. These arrive from a database column or a CSV
4
+ * field, not from a literal in the calling code.
5
+ *
6
+ * Exported for the one escape that cannot be {@link escapeAttr}: a number format code escapes
7
+ * everything but the apostrophe, and needs this guard just the same.
8
+ *
9
+ * @throws {AuthoringError} naming the code point and its offset.
10
+ */
11
+ export declare function assertRepresentable(value: string): void;
1
12
  /** Escape a string for use as XML element text. */
2
13
  export declare function escapeText(value: string): string;
3
14
  /** Escape a string for use inside a double-quoted XML attribute value. */
4
15
  export declare function escapeAttr(value: string): string;
5
16
  /**
6
- * Whether an element's text must be wrapped with `xml:space="preserve"` to survive a
7
- * round-trip. Leading/trailing whitespace is otherwise collapsed by consumers, so a
8
- * string cell value that begins or ends with a space needs the marker.
17
+ * Escape a cell value: the `_xHHHH_` convention first, then XML's own escapes.
18
+ *
19
+ * The order of the two replacements is load-bearing. Once `_xHHHH_` decodes to something, a
20
+ * value that legitimately reads `_x0041_` would come back as `A`, so the underscore is
21
+ * escaped first, and only where it begins a sequence that would otherwise decode, leaving
22
+ * every other underscore alone. Doing that after the character escape would re-escape the
23
+ * `_x005F_` it had just introduced.
24
+ *
25
+ * `escapeText` runs last and sees no unrepresentable character left, so its guard is a
26
+ * standing proof that the escape was complete rather than a second check of the same thing.
27
+ *
28
+ * Reversed by `decodeSpreadsheetText` in `./xml-read.ts`, whose single left-to-right pass is what
29
+ * makes the `_x005F_` step above reversible. Change either and read its comment first.
9
30
  */
10
- export declare function needsSpacePreserve(value: string): boolean;
31
+ export declare function escapeSpreadsheetText(value: string): string;
11
32
  /**
12
33
  * A `<t>` text element carrying an escaped string, marked `xml:space="preserve"` when its
13
- * whitespace would otherwise be collapsed. Shared by every string-bearing element a plain
14
- * inline string cell, a rich-text run so all decode identically on the way back.
34
+ * whitespace would otherwise be collapsed. Shared by every string-bearing element (a plain
35
+ * inline string cell, a rich-text run, a pooled string, a note's body) so all decode
36
+ * identically on the way back.
15
37
  */
16
38
  export declare function textElement(value: string): string;
17
39
  /**
18
40
  * Render a formula operand for serialisation: a number becomes its literal, a string is stripped of
19
41
  * the single optional leading '=' an author may write (OOXML stores the expression without it, e.g.
20
- * `=A1>0` on disk is `A1>0`). The result is unescaped the caller escapes it for its target,
42
+ * `=A1>0` on disk is `A1>0`). The result is unescaped: the caller escapes it for its target,
21
43
  * whether that is element text or an attribute value.
22
44
  */
23
45
  export declare function stripFormulaEquals(value: string | number): string;
@@ -25,14 +47,56 @@ export declare function stripFormulaEquals(value: string | number): string;
25
47
  * A boolean attribute rendered with a leading space (` name="1"` / ` name="0"`), or '' when the value
26
48
  * is undefined. OOXML booleans serialise as 1/0; emitting the explicit `="0"` lets a writer force a
27
49
  * flag off against a consumer's default, while an unset (undefined) flag stays out of the element
28
- * entirely the two-state-plus-absent contract every flag writer here shares.
50
+ * entirely: the two-state-plus-absent contract every flag writer here shares.
29
51
  */
30
52
  export declare function boolAttr(name: string, value: boolean | undefined): string;
53
+ /**
54
+ * A free-string attribute rendered with a leading space (` name="a &amp; b"`), or '' when the value
55
+ * is undefined. The third of the trio with {@link boolAttr} and {@link numAttr}: the value is prose
56
+ * the caller chose, so it is escaped rather than checked.
57
+ *
58
+ * A token from a closed OOXML enumeration is the other case and goes through {@link checkedToken}
59
+ * instead. Escaping a bogus token would produce a well-formed document that Excel still rejects,
60
+ * which hides the mistake in the file rather than raising it at the call.
61
+ */
62
+ export declare function textAttr(name: string, value: string | undefined): string;
63
+ /**
64
+ * Refuse a token from a closed OOXML enumeration that the writer would otherwise emit verbatim, and
65
+ * return it unchanged when it belongs. The public types already forbid an out-of-contract value, so
66
+ * this fires only for one smuggled past them by an untyped caller, a `JSON.parse`, or a cast.
67
+ *
68
+ * The writer must never serialise such a value: it would be schema-invalid OOXML that Excel
69
+ * sometimes tolerates yet the library's own reader, which narrows every such token through the same
70
+ * guard, discards on read-back. Refusing at the write boundary keeps the two symmetric, garbage out
71
+ * refused exactly as garbage in, so a value the writer accepts is always one that round-trips.
72
+ *
73
+ * @throws {AuthoringError} naming the value and the enumeration.
74
+ */
75
+ export declare function checkedToken(value: string, isValid: (candidate: string) => boolean, kind: string): string;
31
76
  /**
32
77
  * A numeric attribute rendered with a leading space (` name="42"`), or '' when the value is undefined
33
- * so a count an author never set stays out of the element rather than fabricating a default.
78
+ * so that a count an author never set stays out of the element rather than fabricating a default.
79
+ *
80
+ * The value goes through {@link numberText}, so a non-finite one is refused here rather than written
81
+ * as `NaN`. Every attribute on this path is `xsd:double` or `xsd:unsignedInt`, neither of which has a
82
+ * spelling for it, so the alternative is a package Excel reports as damaged.
83
+ *
84
+ * @throws {AuthoringError} when the value is not finite.
85
+ */
86
+ export declare function numAttr(name: string, value: number | undefined): string;
87
+ /**
88
+ * Refuse a number OOXML cannot spell. Every numeric attribute in the format is `xsd:double`,
89
+ * `xsd:unsignedInt` or a bounded flavour of one, and none of those lexical spaces has a form for a
90
+ * NaN or an infinity, so a value that reaches the file as `NaN` is a package Excel reports as
91
+ * damaged.
92
+ *
93
+ * Exported for the callers that must refuse before they write. A number can be unwritable and still
94
+ * be read on the way to the bytes: compared, summed, walked. A comparison against `NaN` or an
95
+ * infinity silently takes the wrong branch long before the value would have been serialised.
96
+ *
97
+ * @throws {AuthoringError} naming the value.
34
98
  */
35
- export declare function attr(name: string, value: number | undefined): string;
99
+ export declare function assertWritableNumber(value: number): void;
36
100
  /**
37
101
  * A finite number serialises as its shortest round-trippable decimal; a non-finite one
38
102
  * has no OOXML numeric representation, so the writer refuses it rather than emit `NaN`.
package/dist/xml/xml.js CHANGED
@@ -14,18 +14,38 @@ const ATTR_ESCAPES = {
14
14
  '\r': '&#13;',
15
15
  '\t': '&#9;',
16
16
  };
17
+ const UNREPRESENTABLE = /[\u{0}-\u{8}\u{B}\u{C}\u{E}-\u{1F}\u{FFFE}\u{FFFF}\u{D800}-\u{DFFF}]/u;
18
+ const UNREPRESENTABLE_GLOBAL = new RegExp(UNREPRESENTABLE.source, 'gu');
19
+ function codePointHex(codePoint) {
20
+ return codePoint.toString(16).toUpperCase().padStart(4, '0');
21
+ }
22
+ export function assertRepresentable(value) {
23
+ const found = UNREPRESENTABLE.exec(value);
24
+ if (found === null)
25
+ return;
26
+ throw new AuthoringError(`cannot write U+${codePointHex(value.codePointAt(found.index))} at offset ${found.index}: ` +
27
+ 'XML 1.0 has no representation for it, and the _xHHHH_ escape that would carry it is a ' +
28
+ 'convention of cell values only');
29
+ }
17
30
  export function escapeText(value) {
31
+ assertRepresentable(value);
18
32
  return value.replace(/[&<>]/g, (ch) => TEXT_ESCAPES[ch]);
19
33
  }
20
34
  export function escapeAttr(value) {
35
+ assertRepresentable(value);
21
36
  return value.replace(/[&<>"'\n\r\t]/g, (ch) => ATTR_ESCAPES[ch]);
22
37
  }
23
- export function needsSpacePreserve(value) {
38
+ export function escapeSpreadsheetText(value) {
39
+ return escapeText(value
40
+ .replace(/_(x[0-9A-Fa-f]{4}_)/g, '_x005F_$1')
41
+ .replace(UNREPRESENTABLE_GLOBAL, (ch) => `_x${codePointHex(ch.codePointAt(0))}_`));
42
+ }
43
+ function needsSpacePreserve(value) {
24
44
  return value.length > 0 && (value !== value.trim() || /[\n\r\t]/.test(value));
25
45
  }
26
46
  export function textElement(value) {
27
47
  const space = needsSpacePreserve(value) ? ' xml:space="preserve"' : '';
28
- return `<t${space}>${escapeText(value)}</t>`;
48
+ return `<t${space}>${escapeSpreadsheetText(value)}</t>`;
29
49
  }
30
50
  export function stripFormulaEquals(value) {
31
51
  if (typeof value === 'number')
@@ -35,13 +55,25 @@ export function stripFormulaEquals(value) {
35
55
  export function boolAttr(name, value) {
36
56
  return value === undefined ? '' : ` ${name}="${value ? 1 : 0}"`;
37
57
  }
38
- export function attr(name, value) {
39
- return value === undefined ? '' : ` ${name}="${value}"`;
58
+ export function textAttr(name, value) {
59
+ return value === undefined ? '' : ` ${name}="${escapeAttr(value)}"`;
40
60
  }
41
- export function numberText(value) {
42
- if (!Number.isFinite(value)) {
43
- throw new AuthoringError(`cannot write a non-finite number (${value}) it has no OOXML representation`);
61
+ export function checkedToken(value, isValid, kind) {
62
+ if (!isValid(value)) {
63
+ throw new AuthoringError(`Invalid ${kind} ${JSON.stringify(value)}: not a value the OOXML enumeration allows`);
44
64
  }
65
+ return value;
66
+ }
67
+ export function numAttr(name, value) {
68
+ return value === undefined ? '' : ` ${name}="${numberText(value)}"`;
69
+ }
70
+ export function assertWritableNumber(value) {
71
+ if (Number.isFinite(value))
72
+ return;
73
+ throw new AuthoringError(`cannot write a non-finite number (${value}): it has no OOXML representation`);
74
+ }
75
+ export function numberText(value) {
76
+ assertWritableNumber(value);
45
77
  return String(value);
46
78
  }
47
79
  export const XML_DECLARATION = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n';
package/package.json CHANGED
@@ -1,23 +1,37 @@
1
1
  {
2
2
  "name": "@shbernal/ts-xlsx",
3
- "version": "1.3.1",
3
+ "version": "2.1.0",
4
4
  "description": "A TypeScript-first library for reading and writing xlsx (OOXML) spreadsheets.",
5
+ "keywords": [
6
+ "csv",
7
+ "excel",
8
+ "ooxml",
9
+ "spreadsheet",
10
+ "streaming",
11
+ "typescript",
12
+ "workbook",
13
+ "xlsx"
14
+ ],
15
+ "homepage": "https://shbernal.github.io/ts-xlsx/",
16
+ "bugs": {
17
+ "url": "https://github.com/shbernal/ts-xlsx/issues"
18
+ },
5
19
  "license": "MIT",
6
20
  "author": "shbernal",
7
- "type": "module",
8
21
  "repository": {
9
22
  "type": "git",
10
23
  "url": "https://github.com/shbernal/ts-xlsx.git"
11
24
  },
12
- "homepage": "https://github.com/shbernal/ts-xlsx#readme",
13
- "bugs": {
14
- "url": "https://github.com/shbernal/ts-xlsx/issues"
15
- },
16
- "engines": {
17
- "node": ">=24"
18
- },
19
- "packageManager": "pnpm@11.11.0",
25
+ "files": [
26
+ "dist",
27
+ "skills",
28
+ "LICENSE",
29
+ "README.md"
30
+ ],
31
+ "type": "module",
20
32
  "sideEffects": false,
33
+ "main": "./dist/index.js",
34
+ "types": "./dist/index.d.ts",
21
35
  "exports": {
22
36
  ".": {
23
37
  "types": "./dist/index.d.ts",
@@ -47,71 +61,80 @@
47
61
  "types": "./dist/entries/customui.d.ts",
48
62
  "default": "./dist/entries/customui.js"
49
63
  },
64
+ "./node": {
65
+ "types": "./dist/entries/node.d.ts",
66
+ "browser": "./dist/entries/node-unavailable.js",
67
+ "default": "./dist/entries/node.js"
68
+ },
50
69
  "./errors": {
51
70
  "types": "./dist/entries/errors.d.ts",
52
71
  "default": "./dist/entries/errors.js"
53
72
  },
54
73
  "./package.json": "./package.json"
55
74
  },
56
- "main": "./dist/index.js",
57
- "types": "./dist/index.d.ts",
58
75
  "publishConfig": {
59
76
  "access": "public"
60
77
  },
61
- "files": [
62
- "dist",
63
- "skills",
64
- "LICENSE",
65
- "README.md"
66
- ],
67
78
  "scripts": {
68
79
  "prepare": "node scripts/install-hooks.ts",
69
80
  "clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
70
81
  "build": "pnpm run clean && tsc -p tsconfig.build.json && tsc -p tsconfig.build.dts.json",
71
82
  "size": "node scripts/size-budget.ts",
72
83
  "smoke:dist": "node scripts/smoke-dist.ts",
84
+ "site:prepare": "node www/scripts/sync-docs.ts",
85
+ "site:check": "node www/scripts/check.ts",
86
+ "samples:check": "node www/scripts/check-samples.ts",
87
+ "site:dev": "pnpm run site:prepare && vitepress dev www",
88
+ "site:build": "pnpm run site:prepare && vitepress build www && node www/scripts/check-built-links.ts",
89
+ "site:preview": "vitepress preview www",
73
90
  "docs": "node scripts/gen-docs.ts",
74
91
  "docs:check": "node scripts/gen-docs.ts && git add --intent-to-add -- docs/api && git diff --exit-code -- docs/api",
75
92
  "constitution:check": "node scripts/check-constitution.ts",
76
93
  "layering:check": "node scripts/check-layering.ts",
77
94
  "entries:check": "node scripts/check-entries.ts",
95
+ "browser:check": "node scripts/check-browser-safe.ts",
78
96
  "source-text:check": "node scripts/check-source-text.ts",
79
- "lint": "biome check --error-on-warnings src scripts test tools",
80
- "lint:fix": "biome check --write --error-on-warnings src scripts test tools",
81
- "format": "biome format --write src scripts test tools",
97
+ "chars:check": "charcheck",
98
+ "lint": "node node_modules/oxlint/bin/oxlint src scripts test tools www charcheck.config.ts --type-aware --deny-warnings --report-unused-disable-directives",
99
+ "lint:fix": "pnpm run lint --fix",
100
+ "format": "node scripts/format.ts --write",
101
+ "format:check": "node scripts/format.ts --check",
82
102
  "typecheck": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.test.json",
83
103
  "typecheck:src": "tsc --noEmit -p tsconfig.json",
84
104
  "typecheck:test": "tsc --noEmit -p tsconfig.test.json",
85
105
  "typecheck:dist": "tsc --noEmit -p tsconfig.dist.json",
106
+ "typecheck:site": "tsc --noEmit -p www/tsconfig.json",
86
107
  "test:src": "node --test \"src/**/*.test.ts\"",
87
- "test:coverage": "node --test --experimental-test-coverage \"src/**/*.test.ts\"",
108
+ "test:site": "node --test \"www/**/*.test.ts\"",
109
+ "coverage": "node scripts/coverage.ts",
88
110
  "corpus": "node test/corpus/run.ts",
89
111
  "corpus:dist": "node test/corpus/run.ts --target dist",
90
112
  "verify": "node scripts/verify.ts --full",
91
113
  "verify:quick": "node scripts/verify.ts --quick",
92
114
  "test": "node scripts/verify.ts --full",
93
115
  "prepublishOnly": "pnpm run build && pnpm run test && pnpm run smoke:dist && pnpm run size",
94
- "validate:ooxml": "node scripts/ooxml-validator.ts",
116
+ "validate:ooxml": "ooxml-validate",
95
117
  "test:ooxml": "node test/ooxml-validation/run.ts"
96
118
  },
97
- "keywords": [
98
- "xlsx",
99
- "ooxml",
100
- "excel",
101
- "spreadsheet",
102
- "csv",
103
- "typescript",
104
- "workbook",
105
- "streaming"
106
- ],
107
119
  "dependencies": {
108
120
  "fflate": "^0.8.3"
109
121
  },
110
122
  "devDependencies": {
111
- "@biomejs/biome": "2.5.7",
112
123
  "@types/node": "^24.13.3",
124
+ "charcheck": "^0.3.0",
113
125
  "jszip": "^3.10.1",
114
126
  "lefthook": "^2.1.10",
115
- "typescript": "^7.0.2"
116
- }
127
+ "ooxml-validate": "^0.0.3",
128
+ "oxfmt": "^0.64.0",
129
+ "oxlint": "^1.80.0",
130
+ "oxlint-tsgolint": "7.0.2001",
131
+ "shiki": "^4.4.3",
132
+ "typescript": "^7.0.2",
133
+ "vitepress": "^1.6.4",
134
+ "vue": "^3.5.41"
135
+ },
136
+ "engines": {
137
+ "node": ">=24"
138
+ },
139
+ "packageManager": "pnpm@11.11.0"
117
140
  }