@bilig/xlsx-formula-recalc 0.127.0 → 0.128.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 (2) hide show
  1. package/README.md +67 -59
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,24 +1,72 @@
1
1
  # @bilig/xlsx-formula-recalc
2
2
 
3
- Recalculate XLSX formula values in Node.js after SheetJS, ExcelJS, or
4
- xlsx-populate edits without Excel, LibreOffice, or browser automation.
3
+ Diagnose stale cached XLSX formula values in Node and CI, then recalculate the
4
+ cells your service actually reads without Excel, LibreOffice, or browser
5
+ automation.
5
6
 
6
- This package is the canonical scoped Bilig entrypoint for the high-friction Node
7
- XLSX workflow:
7
+ This is the canonical scoped Bilig package for the high-friction Node XLSX
8
+ workflow: a file library edits workbook bytes, but the formula cells still carry
9
+ old cached values. Start with the cache doctor when you do not know which cells
10
+ are stale. Use recalculation after the detector points at the cells that matter.
8
11
 
9
- 1. import an XLSX workbook,
10
- 2. edit input cells,
11
- 3. recalculate formulas,
12
- 4. read proof values,
13
- 5. export an updated XLSX.
14
-
15
- It fits `xlsx-populate`, SheetJS / `xlsx`, template-generation, and backend file
16
- pipelines where the file writer can edit the workbook but the Node service also
17
- needs fresh formula readback before returning.
12
+ It fits `xlsx-populate`, SheetJS / `xlsx`, template-generation, GitHub Actions,
13
+ and backend file pipelines where stale readback is worse than a hard failure.
18
14
 
19
15
  The unscoped `xlsx-formula-recalc` package remains published as a compatibility
20
16
  and search alias.
21
17
 
18
+ ## Try The Cache Doctor First
19
+
20
+ Run the no-project demo:
21
+
22
+ ```sh
23
+ npx --package @bilig/xlsx-formula-recalc xlsx-cache-doctor --demo --json
24
+ ```
25
+
26
+ Expected shape:
27
+
28
+ ```json
29
+ {
30
+ "formulaCellCount": 1,
31
+ "inspectedFormulaCellCount": 1,
32
+ "uninspectedFormulaCellCount": 0,
33
+ "staleCachedFormulaCount": 1,
34
+ "suggestedReads": ["Summary!B2"],
35
+ "formulas": [
36
+ {
37
+ "target": "Summary!B2",
38
+ "cachedValue": 60000,
39
+ "literalRecalculatedValue": 72000,
40
+ "staleCachedValue": true
41
+ }
42
+ ],
43
+ "commandSucceeded": true,
44
+ "inspectionCompleted": true
45
+ }
46
+ ```
47
+
48
+ The JSON is meant for CI and agents. It does not include star, release-watch, or
49
+ discussion links.
50
+
51
+ ## CI First
52
+
53
+ Generate a read-only GitHub Actions workflow from npm:
54
+
55
+ ```sh
56
+ mkdir -p .github/workflows
57
+ npx --package @bilig/xlsx-formula-recalc xlsx-cache-doctor --print-github-action "**/*.xlsx" \
58
+ > .github/workflows/xlsx-cache-doctor.yml
59
+ ```
60
+
61
+ The generated workflow uses `proompteng/bilig@v1`, uploads JSON and Markdown
62
+ reports, and starts in report-only mode. Add `--fail-on-stale true` when stale
63
+ formula caches should block pull requests.
64
+
65
+ For a live reviewer path, inspect the
66
+ [XLSX Cache Doctor demo PR](https://github.com/proompteng/xlsx-cache-doctor-demo/pull/1).
67
+ It runs the Action, finds one stale cached formula value, and uploads the JSON
68
+ report artifact.
69
+
22
70
  ## If You Arrived From SheetJS or xlsx-populate
23
71
 
24
72
  `xlsx`, SheetJS-style workbook objects, and `xlsx-populate` are good at file
@@ -51,39 +99,6 @@ npm install @bilig/xlsx-formula-recalc
51
99
 
52
100
  ## CLI
53
101
 
54
- Run a self-contained proof first:
55
-
56
- ```sh
57
- npx --package @bilig/xlsx-formula-recalc xlsx-recalc --demo --json
58
- ```
59
-
60
- That command creates a tiny workbook, changes `Inputs!B2` and `Inputs!B3`,
61
- recalculates `Summary!B2`, writes `bilig-formula-recalc-demo.xlsx`, and prints
62
- a proof object with explicit recalculation fields and the recalculated value:
63
-
64
- ```json
65
- {
66
- "reads": {
67
- "Summary!B2": {
68
- "value": 72000
69
- }
70
- },
71
- "warnings": [],
72
- "commandSucceeded": true,
73
- "recalculationCompleted": true,
74
- "excelParity": "not_proven",
75
- "expectedReadback": {
76
- "Summary!B2": 72000
77
- },
78
- "expectedValueMatched": true
79
- }
80
- ```
81
-
82
- Keep the proof first. The JSON is meant for CI and agents, so it does not carry
83
- star, release-watch, or discussion links. Use the links in the README or docs
84
- only after the recalculated value and warnings match the workflow you are
85
- evaluating.
86
-
87
102
  If you have a real workbook but do not yet know which formula cells matter,
88
103
  diagnose it without writing an output file:
89
104
 
@@ -123,24 +138,17 @@ the JSON includes the skipped count as `uninspectedFormulaCellCount`.
123
138
  `xlsx-cache-doctor` is a readable alias for
124
139
  `xlsx-recalc pricing.xlsx --inspect --json`. Use it for issue triage, CI, and
125
140
  pull-request checks when the only question is whether committed XLSX files have
126
- stale cached formula values. The GitHub Action wrapper lives at
127
- [`actions/xlsx-cache-doctor`](../../actions/xlsx-cache-doctor), and the runnable
128
- fixture/workflow example lives at
129
- [`examples/xlsx-cache-doctor-ci`](../../examples/xlsx-cache-doctor-ci).
141
+ stale cached formula values.
130
142
 
131
- To create the GitHub Actions workflow from npm:
143
+ When you know which cells matter, run the recalculation check:
132
144
 
133
145
  ```sh
134
- mkdir -p .github/workflows
135
- npx --package @bilig/xlsx-formula-recalc xlsx-cache-doctor --print-github-action "**/*.xlsx" \
136
- > .github/workflows/xlsx-cache-doctor.yml
146
+ npx --package @bilig/xlsx-formula-recalc xlsx-recalc --demo --json
137
147
  ```
138
148
 
139
- The generated workflow is read-only and report-only by default. Add
140
- `--fail-on-stale true` when stale formula caches should block pull requests.
141
- Use `--inspect-limit`, `--json-output`, and `--markdown-output` when your first
142
- run should sample formulas or write the JSON and Markdown reports somewhere
143
- specific.
149
+ That command creates a tiny workbook, changes `Inputs!B2` and `Inputs!B3`,
150
+ recalculates `Summary!B2`, writes `bilig-formula-recalc-demo.xlsx`, and prints
151
+ the recalculated value.
144
152
 
145
153
  For an existing workbook:
146
154
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bilig/xlsx-formula-recalc",
3
- "version": "0.127.0",
4
- "description": "Recalculate XLSX formula values in Node.js after SheetJS, ExcelJS, or xlsx-populate edits without Excel, LibreOffice, or browser automation.",
3
+ "version": "0.128.0",
4
+ "description": "Diagnose stale cached XLSX formula values and recalculate XLSX formulas in Node.js without Excel, LibreOffice, or browser automation.",
5
5
  "keywords": [
6
6
  "bilig",
7
7
  "excel",
@@ -71,7 +71,7 @@
71
71
  "smoke": "node ./dist/cli.js --help"
72
72
  },
73
73
  "dependencies": {
74
- "xlsx-formula-recalc": "0.127.0"
74
+ "xlsx-formula-recalc": "0.128.0"
75
75
  },
76
76
  "engines": {
77
77
  "node": ">=22.0.0"