Skip to content
jsf2xlsx

Changelog

  • Producer identity & recalc control: toXlsx accepts a third optional ToXlsxOptions argument so a host application can identify itself in the produced workbook and tell Excel whether saved values are trustworthy: application and appVersion populate the Application/AppVersion elements in docProps/app.xml (defaulting to GRID / 16.0.300), and calculated: false writes fullCalcOnLoad="1" on <calcPr> to force a recalculation on open. All three are optional, so existing call sites are unaffected.
  • Page margins: each sheet now emits <pageMargins>, populated from the new Worksheet.pageMargins field when present and falling back to the canonical Excel defaults, to minimise round-trip diffs.
  • Pivot button styles: the Style.pivotButton field is now emitted as pivotButton="1" on the corresponding cell format, round-tripping the filter-dropdown header styling on pivot row/column-label cells.
  • Fonts & styles: font records are now built self-contained from each style’s own properties instead of inheriting silently from the Normal/parent font; a cell silent on color renders black rather than Normal’s colour, a font’s scheme is emitted only when the typeface is the theme major/minor font, and a cell’s effective format is resolved correctly against covering column/row defaults (<c s> shadowing <col s>/<row s>). Row default style emission was also fixed.
  • Worksheet XML: skip empty <row> placeholders for unpopulated rows, tighten the <dimension> ref to the populated-cell bounding box, and omit the default showGridLines="1" from the fallback sheet view.
  • Tables: preserve totalsRowShown=false through the JSF → xlsx conversion.
  • Array formulas: stop emitting cm="1" on legacy CSE array-formula cells.
  • Pivot tables & caches: always emit baseField/baseItem defaults on <dataField>, read hideValuesRow from the JSF instead of hard-coding it, emit post-2010 showDataAs as an x14 dataField extension, and emit numFmtId on a cache field even when it is the default 0. Several XML-fidelity fixes reduce repair-dialog risk: scope the x14/xpdl xmlns declarations to their <ext> roots, drop the unused xmlns:xm declaration from the pivot table root, drop count="0" from items-less <sharedItems>, and omit the default v="0" on <x> inside row/col items. Emit the Excel-2016 version markers minRefreshableVersion="3" and createdVersion="8" on pivots with row or column axis content (updatedVersion="8" is already emitted unconditionally) to match Excel’s baseline and close gratuitous resave diffs.
  • Styles XML: drop the empty <numFmts count="0"/> element from styles.xml.
  • @jsfkit/types promoted from a dev dependency to a full dependency — the distributed type declarations import from it, so TypeScript consumers need it at runtime resolution.
  • Build switched from tsup to tsdown.
  • @jsfkit/types and @borgar/xlsx-convert bumped to latest; TypeScript bumped to 6.0.3.
  • Routine docs dependency bumps, Dependabot config update, and transitive security bumps.
  • Named styles: JSF namedStyles records are now emitted as cellStyleXfs and cellStyles entries, with extendsStyle references preserved as xfId on cell formats.
  • Defined names: drop values that would trigger Excel’s Removed Records: Named range repair dialog (parse errors, unqualified refs, missing-sheet refs, spill/implicit-intersection operators, bracketed UI-dialect structured refs, empty values), and match a defined name’s scope to sheet names case-insensitively.
  • Tables: stop emitting <autoFilter> (which added unwanted filter dropdowns) and the totalsRowCount="0" default, and honor the JSF table’s own style instead of hardcoding TableStyleMedium2. Table names that parse as cell references (e.g. T1, R1C1) are now prefixed with _ to avoid Excel rejecting them with a repair dialog.
  • Error cells: emit xl/richData/* parts and xl/metadata.xml entries to back the vm attributes on rich-value error cells (#SPILL!, #CALC!, #FIELD!, #UNKNOWN!).
  • Comments: preserve significant whitespace in sharedStrings.xml <t> elements via xml:space="preserve", drop the (incorrect) count attribute on <sst>, and stop emitting VML drawing shapes for threaded-comment replies (Excel emits one shape per thread root only). When multiple root threads share a cell, combine them into a single legacy <comment> (Excel’s legacy schema keys by ref, and emitting one entry per thread triggered a Removed Records: Comments repair). Strip the trailing Z from threaded-comment dT timestamps to match Excel’s native emission.
  • Pivot caches: in <sharedItems>, omit containsSemiMixedTypes="0" when blanks coexist with typed values (Excel rejects this combination, triggering a Repaired Records: PivotTable report from pivotCacheDefinition repair) and tighten containsNonDate="0" emission to pure-date fields without blanks. Preserve the trailing Z on maxDate whenever minDate and the item values carry it, removing the asymmetric output on Z-suffixed date inputs.
  • Formulas: normalizeExpression no longer throws on formulas containing unknown function names; the call is passed through unchanged so the rest of the formula still gets normalized.
  • Cell IDs: parseCellId now correctly handles 3-letter columns (AAA..XFD) and rejects malformed inputs.
  • Worksheet XML: emit legacyDrawing before tableParts, per OOXML schema.
  • Theme defaults: updated the built-in default theme name and colour palette to match the current Office defaults.
  • CLI: more accurate validation error messages.
  • Colour utilities extracted to the new @jsfkit/utils.
  • @borgar/fx bumped to 5.0.4 for upstream bugfixes.
  • numfmt added as a runtime dependency (used to format pivot cache date bounds).
  • Routine updates to ESLint, Vitest, and GitHub Actions; transitive bumps for security advisories.
  • Pivot table support: pivot tables are now written to XLSX output, enabling full round-trip of pivot tables including layout, fields, cache definitions, cache records, conditional formats, filters, and extension data.
  • Theme and colour support: colours are now fully supported as structured objects with multiple colour models (sRGB, theme, preset) and transforms, rather than plain hex strings. Theme fonts are also supported.
  • Text rotation: cell alignment now includes textRotation in the XLSX output.
  • Fixed a crash when normalising table column formulas that contained unknown or unsupported functions.
  • Fixed row style assignment not being applied correctly.
  • Fixed showGridLines: false not being persisted on sheet views.

This release tracks @jsfkit/types v2.0.0, which introduced breaking changes to the colour model (colours are now objects rather than "#rrggbb" strings) and moved showGridLines into WorksheetView. Update your JSF data accordingly.

Routine updates to ESLint, its plugins, and Vitest.

  • Added: JSF → Excel → JSF roundtripping tests for all eligible fixtures
  • Fix: Additive default properties in XML generation
  • Fix: threadedComments2 URI for hyperlinks in comments
  • Fix: veryHidden sheet state preserved
  • Fix: workbook > bookViews > workbookView default of no activeTab property does not result in a workbookView[activeTab="0"] element
  • Fix column width discrepancy due to no baseColWidth="10" value for JSF workbooks without defaults
  • Added: CLI tool exposing toXlsx, usage: jsf2xlsx input.json -o output.xlsx
  • Row styles included in OOXML
  • Default colWidth converted from PixelValue to character col width
  • Default (CellStyle = normal) font chosen from 0th style[] in JSF
  • Update dependencies
  • Drop assert dependency in favor of lightweight assert helper
  • Add support for data tables
  • Output cell comments and notes
  • Update dependencies
  • Export workbook and worksheet views
  • Fix incorrect worksheet dimension ref
  • Use package.json files prop instead of .npmignore
  • Add default cell format when JSF has no styles
  • Test converted files open in Excel successfully
  • Remove unused code
  • Move JSZip to dev dependencies
  • Fix export compatibility issues
  • Switch to using npm for package management
  • Fix charEscape regex to only escape chars < 32
  • Convert JSF col widths from pixels to points
  • Update dependencies
  • Fix .npmignore issues
  • Initial release after the switch from CSF to JSF