@bilig/xlsx-formula-recalc 0.127.0 → 0.129.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 +87 -59
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,24 +1,84 @@
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
+ "cacheStatusSummary": {
35
+ "inspected": 1,
36
+ "stale": 1,
37
+ "fresh": 0,
38
+ "missingCache": 0,
39
+ "unsupportedRecalculation": 0
40
+ },
41
+ "suggestedReads": ["Summary!B2"],
42
+ "formulas": [
43
+ {
44
+ "target": "Summary!B2",
45
+ "cachedValue": 60000,
46
+ "literalRecalculatedValue": 72000,
47
+ "cacheStatus": "stale",
48
+ "staleCachedValue": true
49
+ }
50
+ ],
51
+ "commandSucceeded": true,
52
+ "inspectionCompleted": true
53
+ }
54
+ ```
55
+
56
+ The JSON is meant for CI and agents. It does not include star, release-watch, or
57
+ discussion links.
58
+
59
+ Use `cacheStatusSummary` and per-formula `cacheStatus` to separate confirmed
60
+ stale caches from missing cached values or formulas without a comparable
61
+ recalculated value.
62
+
63
+ ## CI First
64
+
65
+ Generate a read-only GitHub Actions workflow from npm:
66
+
67
+ ```sh
68
+ mkdir -p .github/workflows
69
+ npx --package @bilig/xlsx-formula-recalc xlsx-cache-doctor --print-github-action "**/*.xlsx" \
70
+ > .github/workflows/xlsx-cache-doctor.yml
71
+ ```
72
+
73
+ The generated workflow uses `proompteng/bilig@v1`, uploads JSON and Markdown
74
+ reports, and starts in report-only mode. Add `--fail-on-stale true` when stale
75
+ formula caches should block pull requests.
76
+
77
+ For a live reviewer path, inspect the
78
+ [XLSX Cache Doctor demo PR](https://github.com/proompteng/xlsx-cache-doctor-demo/pull/1).
79
+ It runs the Action, finds one stale cached formula value, and uploads the JSON
80
+ report artifact.
81
+
22
82
  ## If You Arrived From SheetJS or xlsx-populate
23
83
 
24
84
  `xlsx`, SheetJS-style workbook objects, and `xlsx-populate` are good at file
@@ -51,39 +111,6 @@ npm install @bilig/xlsx-formula-recalc
51
111
 
52
112
  ## CLI
53
113
 
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
114
  If you have a real workbook but do not yet know which formula cells matter,
88
115
  diagnose it without writing an output file:
89
116
 
@@ -103,6 +130,13 @@ the JSON includes the skipped count as `uninspectedFormulaCellCount`.
103
130
  "uninspectedFormulaCellCount": 0,
104
131
  "inspectionLimit": "all",
105
132
  "staleCachedFormulaCount": 3,
133
+ "cacheStatusSummary": {
134
+ "inspected": 12,
135
+ "stale": 3,
136
+ "fresh": 9,
137
+ "missingCache": 0,
138
+ "unsupportedRecalculation": 0
139
+ },
106
140
  "suggestedReads": ["Summary!B7"],
107
141
  "formulas": [
108
142
  {
@@ -110,6 +144,7 @@ the JSON includes the skipped count as `uninspectedFormulaCellCount`.
110
144
  "formula": "=Inputs!B2*Inputs!B3",
111
145
  "cachedValue": 60000,
112
146
  "literalRecalculatedValue": 72000,
147
+ "cacheStatus": "stale",
113
148
  "staleCachedValue": true
114
149
  }
115
150
  ],
@@ -123,24 +158,17 @@ the JSON includes the skipped count as `uninspectedFormulaCellCount`.
123
158
  `xlsx-cache-doctor` is a readable alias for
124
159
  `xlsx-recalc pricing.xlsx --inspect --json`. Use it for issue triage, CI, and
125
160
  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).
161
+ stale cached formula values.
130
162
 
131
- To create the GitHub Actions workflow from npm:
163
+ When you know which cells matter, run the recalculation check:
132
164
 
133
165
  ```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
166
+ npx --package @bilig/xlsx-formula-recalc xlsx-recalc --demo --json
137
167
  ```
138
168
 
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.
169
+ That command creates a tiny workbook, changes `Inputs!B2` and `Inputs!B3`,
170
+ recalculates `Summary!B2`, writes `bilig-formula-recalc-demo.xlsx`, and prints
171
+ the recalculated value.
144
172
 
145
173
  For an existing workbook:
146
174
 
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.129.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",
@@ -27,7 +27,7 @@
27
27
  "xlsx-recalc",
28
28
  "xlsx-recalculation"
29
29
  ],
30
- "homepage": "https://proompteng.github.io/bilig/eval-xlsx-recalc.html",
30
+ "homepage": "https://proompteng.github.io/bilig/eval-xlsx-cache-doctor.html",
31
31
  "bugs": {
32
32
  "url": "https://github.com/proompteng/bilig/issues"
33
33
  },
@@ -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.129.0"
75
75
  },
76
76
  "engines": {
77
77
  "node": ">=22.0.0"