APNEWDRAW-8300 refresh dependencies and toolchain (esbuild + Vitest + oxlint)#13
Draft
linhmtran168 wants to merge 13 commits into
Draft
APNEWDRAW-8300 refresh dependencies and toolchain (esbuild + Vitest + oxlint)#13linhmtran168 wants to merge 13 commits into
linhmtran168 wants to merge 13 commits into
Conversation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
…drop ES5 - New build pipeline: scripts/build.mjs using esbuild (IIFE, ES2020 target) - Browser tests: spec/browser/vitest.config.mjs + Playwright/Chromium - lib/exceljs.browser.js simplified to re-export exceljs.bare.js - spec/utils/verquire.js: drop EXCEL_BUILD=es5 branch - Delete index.ts (dist/es5 entry), gruntfile.js - Remove grunt/babel/browserify/core-js/regenerator-runtime deps - README: remove ES5-imports section Adds buffer/crypto-browserify/util shim deps + a small process/Buffer inject shim (scripts/browser-process-shim.mjs) — esbuild does not auto-polyfill Node built-ins the way browserify did, and the lib/ source reaches for them. `stream` is aliased to the already-present `readable-stream` runtime dep so the bundle ships one stream implementation. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
- .oxlintrc.json: correctness+suspicious categories, project rules
- .oxfmtrc.json: JS/TS only, singleQuote+semi matching prior style
- lint: oxlint .; lint:fix: oxfmt . && oxlint --fix .
- lint-staged: oxfmt + oxlint --fix on *.{js,ts}
- Add lint CI job (Node 22)
- Delete .eslintrc, .eslintignore, .prettier, .prettierignore and all per-dir .eslintrc files
- Fix: empty catch params in date-xform.js and defined-name-xform.js
- Fix: redundant x&&x pattern in test-conditional-formatting-sheet.js
- Note: max-len:120 not in oxlint scope; follow-up if needed
- Note: quotes/semi/no-trailing-spaces not in oxlint (formatter territory)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Apply codebase-wide canonical formatting via oxfmt. No logic changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
- @types/chai: ^5.2.3 → ^4.3 (fix type/runtime mismatch with chai@4) - @types/node: ^24.10.8 → ^24.12.4 (patch) - dayjs: ^1.11.19 → ^1.11.21 (patch) - fast-csv: ^5.0.5 → ^5.0.7 (patch) - mocha: ^11.7.5 → ^11.7.6 (patch) - rimraf: ^6.1.2 → ^6.1.3 (patch) - tmp: ^0.2.5 → ^0.2.7 (security) - archiver: ^7.0.1 → ^8.0.0 (major; API changed to ZipArchive class) - uuid: ^11.1.0 → ^14.0.0 (major; v4 export stable) Not bumped: - lint-staged: keep ^16.2.7 (lint-staged@17 requires Node >=22.22.1; project supports Node ^20.19.0) - got: keep ^11.8.2 (got@12+ ESM-only, tests are CJS) - chai: keep ^4.5.0 (chai@5 ESM-only, chai-xml incompatible) - dirty-chai: keep ^2.0.1 (chai@4 family) - typescript: keep ^5.9.3 (v6 not stable enough for library) Production audit: 0 vulnerabilities (npm audit --omit=dev) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Set printWidth 100 and trailingComma "all" to match the old .prettier config exactly, then reran the oxfmt + oxlint --fix pipeline. Reduces the formatter-swap diff (~450 fewer churn lines vs 120/es5). oxfmt cannot byte-match prettier-eslint output, so residual reformat diff remains; this is the closest faithful translation of the old config. Refs: APNEWDRAW-8300 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The `oxlint --fix` pipeline silently rewrote 5 `Array#sort()` calls to `Array#toSorted()` via unicorn/no-array-sort. That is a semantic change (in-place mutation vs. returning a copy) and out of scope for a formatting alignment. Disabled the rule and restored the original `.sort()` calls to match master behavior exactly. Refs: APNEWDRAW-8300 🤖 Generated with [Claude Code](https://claude.com/claude-code)
`npm run install-build` was removed in the toolchain migration (it was `npm install && grunt build`). Point the asset-size reporter at the current scripts so it can produce dist/*.js for the size comparison. Refs: APNEWDRAW-8300 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The asset-size action runs build-assets without a shell, so the `npm install && npm run build` form was parsed with `&&` as a package name (EINVALIDTAGNAME). Restore a single `install-build` npm script (npm runs scripts in a shell, where `&&` is valid) and have the workflow call `npm run install-build` as before the grunt removal. Refs: APNEWDRAW-8300 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Referenced in CLAUDE.md but dropped during the grunt removal. Mirrors master: clean dist/ + build/ then run the esbuild build. Refs: APNEWDRAW-8300 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Under setup-takumi-guard-npm's registry proxy, `npm install` rewrites `resolved` URLs in package-lock.json, leaving the tree dirty. The asset-size action then fails its `git checkout <base>` step. `npm ci` installs from the lockfile without ever writing to it, so the tree stays clean for the base-ref checkout. Refs: APNEWDRAW-8300 🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
Files that got Bigger 🚨:
|
Babel was dropped from the toolchain (no @babel deps, no build/test/CI references), but .babelrc was left behind and only got reformatted. Nothing reads it now that esbuild handles transpilation. Refs: APNEWDRAW-8300 🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
Files that got Bigger 🚨:
|
ESLint was replaced by oxlint; the node/no-unsupported-features rule is now enforced by oxlint, not ESLint. Refs: APNEWDRAW-8300 🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
Files that got Bigger 🚨:
|
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
engines.nodeto^20.19.0 || >=22.12.0dist/es5/and all polyfill depsJira: https://88-oct.atlassian.net/browse/APNEWDRAW-8300
Review guide
The diff is ~188 files, but most of it is mechanical reformatting from the prettier-eslint → oxfmt swap. Focus review on the Real rows; the formatting row can be skimmed (use
git diff -w masterto suppress whitespace-only noise).package-lock.json+package.json.babelrc/.eslintrc/gruntfile.js/.prettier, adding oxfmt/oxlint config,tsconfig.json, CI yml, etc.lib/+spec/+test/function (spacing, escaped-quote style), so a reformat diff is unavoidable. One unintended.sort()→.toSorted()autofix was caught and reverted (f68ac85).Browser test suite — Vitest + Playwright (new)
The old Jasmine browser suite (run via
grunt-contrib-jasmine+ PhantomJS) was replaced with a real-browser harness:spec/browser/vitest.config.mjs@vitest/browser-playwrightas the browser provider, headless Chromiumspec/browser/setup.jsbeforeAllhook that injectsdist/exceljs.bare.jsas an IIFE<script>into the page, exposingExcelJSas a global — requiresnpm run buildto run firstspec/browser/exceljs.spec.jsscripts/browser-process-shim.mjsprocess+Buffershims injected by esbuild; replaces Browserify's auto-injected polyfillslib/exceljs.browser.jsexceljs.bare.js(polyfills stripped); kept for back-compat with consumers importing the path directlyKey design point: the browser tests load the pre-built dist bundle into a real Chromium instance (not jsdom). This means they validate the actual browser distribution, including the esbuild output and process/Buffer shims. Any change to
scripts/build.mjsor the shim should re-runnpm run test:browserto confirm the bundle loads cleanly.Test Plan
npm installsucceeds on Node 20.19+ and 22.12+npm run buildproducesdist/exceljs[.bare]{,.min}.js{,.map}anddist/LICENSE(nodist/es5/)node -e "require('./excel.js').Workbook"succeedsnpm run test:unit— 883 passingnpm run test:integration— 195 passingnpm run test:end-to-end— 1 passingnpm run test:dist— 5 passingnpm run test:typescript— 2 passingnpm run test:browser— 3 passing (Vitest + Playwright/Chromium; requiresnpx playwright install chromium --with-depsfirst)npm run lint— exits 0 (warnings only)npm audit --omit=dev— 0 vulnerabilities🤖 Generated with Claude Code