chore(all): Replace exceljs with write-excel-file - #2628
Draft
tombrunet wants to merge 2 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace the peer dependency (unmaintained) with across all packages. The XLSX report output is functionally equivalent — same five sheets, same column widths, same colour coding and cell styling.
Motivation
exceljshas not received meaningful maintenance. Switching towrite-excel-fileremoves the dependency on an unmaintained library and eliminates the'use strict'patching workaround that was required in the browser extension'spreprocess.js.Changes
Core logic —
common/module/src/report/ACReporterXLSX.tswrite-excel-file's data-array model.{ data, sheet, columns }object; all sheets are passed towriteExcelFile(sheets).toFile(filename)in one call."FF403151") to standard 6-digit hex ("#403151").write-excel-file/node; warning message updated accordingly.worksheet.commit()/workbook.commit()calls removed (not needed by the new library).Extension —
accessibility-checker-extension/package.json: replacedexceljsdirect dependency withwrite-excel-file.preprocess.js: removed thesedcommands that stripped'use strict'from the exceljs bundle (no longer needed).jest.config.js: removed stale comment referencing exceljs.E2E test helper —
accessibility-checker-extension/test/support/steps/steps_excel.ts: replacedexceljsWorkbookreader withread-excel-file/node; updated cell-address parsing to use the library's row/column array model.package.json: replacedexceljswithread-excel-file.package.jsonpeer / direct dependency updatesAll packages that declared
exceljsas a peer or direct dependency have been updated to declarewrite-excel-file@^4.1.1instead:accessibility-checker/package.jsonaccessibility-checker/src/package.jsoncypress-accessibility-checker/package.json+package/package.jsonvitest-accessibility-checker/package.json+src/package.json+package/package.jsonkarma-accessibility-checker/package.jsoncommon/module/package.jsonPre-built JS artefacts regenerated
All committed copies of
ACReporterXLSX.js(CJS + MJS outputs acrossaccessibility-checker,cypress-accessibility-checker,vitest-accessibility-checker,karma-accessibility-checker) were rebuilt from the new TypeScript source and committed.Testing checklist
XLSX report output (accessibility-checker Node.js)
accessibility-checkeragainst a page with violations and confirm a.xlsxfile is written to disk.#403151), summary counts (Violations / Needs review / Recommendations / Archived) are correct, and column widths are reasonable.outputFilenameTimestamp: falseand confirm the output file is namedresults.xlsx(not timestamped).write-excel-fileis not installed the warning"Warning: write-excel-file is not installed…"is printed and the process does not crash.Browser extension (accessibility-checker-extension)
npm run build:dev) — confirm it compiles without errors (no exceljs webpack error or'use strict'conflict).preprocess.jsno longer modifies anynode_modulesfiles on build.E2E tests (accessibility-checker-extension/test)
npm testinaccessibility-checker-extension/test— the Cucumber stepExcel Sheet "…" Cell "…" is "…"should pass usingread-excel-file.Downstream packages
cypress-accessibility-checker: runnpm run testand confirm XLSX output is produced correctly.vitest-accessibility-checker: runnpm run testand confirm XLSX output is produced correctly.karma-accessibility-checker: runnpm run buildwith no errors.