Step 4 adds no-dependency smoke tests so the project can catch high-risk regressions before manual browser testing.
node tests/smoke/run-smoke-tests.jsor, if you use npm:
npm testnode scripts/check-js-syntax.jsor:
npm run test:syntaxThe smoke test suite currently verifies:
- Every file under
js/has valid JavaScript syntax. index.htmldoes not reintroduce functional inline handlers such asonclick,onchange,ondragover,ondragleave, orondrop.- HTML event calls use namespaced paths such as
tools.qr.generate, not bare legacy globals such asgenerateQrCode. js/core/app.jscreatesWebcodingAppand keeps legacy compatibility aliases working.js/core/loader.jsregisters the expected optional dependency names, including QR, OCR, PDF, DOCX, XLSX, formatting, compare, and spreadsheet PDF export dependencies.js/core/events.jscan resolve and call namespaced handlers through the centralized event manager.- Step 5 local-first dependency configuration exists for the managed QR, OCR, PDF, DOCX, XLSX, formatting, compare, and export libraries.
- Direct external startup scripts are limited to the explicit exceptions: Google Analytics and Tailwind browser runtime.
- Public-facing documentation does not reintroduce overbroad privacy/offline claims that imply no third-party requests in every deployment.
npm run docs:auditThis checks the public README and Traditional Chinese README for risky overclaims about privacy, offline behavior, and latency. It does not replace manual review, but it prevents the most problematic phrases from coming back.
npm run vendor:auditThis checks the local-first configuration and reports which local vendor files are still missing. It does not fail when files are missing, because CDN fallback remains valid for online development.
For an offline/release build, require every local vendor file:
npm run vendor:audit:strictTo download the free local vendor assets in an environment with internet access:
npm run vendor:fetchThese are smoke tests, not full end-to-end browser tests. They intentionally avoid extra packages and paid services. They do not test real camera permission, real file picker behavior, real OCR accuracy, or CDN network availability.
For each release, run these smoke tests first, then manually verify:
- QR generation
- QR image decoding
- OCR upload recognition
- OCR camera capture
- PDF / DOCX / XLSX file opening
- Save / export behavior
Use this routine for most pull requests or handoffs:
npm test
npm run test:syntax
npm run docs:audit
npm run vendor:auditUse this routine when release scripts, vendor assets, or analytics/offline behavior changes:
npm run build:offline
npm run offline:audit
npm run build:offline:analytics
npm run offline:audit:analyticsIf vendor files and OCR language data have been downloaded for a strict release package, run the strict variants too:
npm run vendor:audit:strict
npm run offline:audit:strict
npm run offline:audit:analytics:strict- Add high-risk static or simulated-browser checks to
tests/smoke/run-smoke-tests.js. - Add syntax-only checks to
scripts/check-js-syntax.jsonly if they are language parsing checks. - Add release/network checks to
scripts/audit-offline-release.js. - Add documentation wording checks to
scripts/audit-doc-claims.js. - Update
docs/MAINTAINERS_GUIDE.mdif the required maintainer workflow changes.