diff --git a/.changeset/readme-playground-link.md b/.changeset/readme-playground-link.md new file mode 100644 index 0000000..de15b74 --- /dev/null +++ b/.changeset/readme-playground-link.md @@ -0,0 +1,5 @@ +--- +"javascript-excel": patch +--- + +README: link the live playground (https://javascript-excel-playground.vercel.app/). diff --git a/RELEASING.md b/RELEASING.md index 32d5286..11f0ac7 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -2,7 +2,7 @@ **Pull request → merge to `main` → publish to npm.** Merging is the approval. A release is just a pull request that changes the package version. When it merges, `.github/workflows/release.yml` publishes that version to npm with trusted publishing (OIDC, no npm token, provenance attached automatically). Then it creates the `v` tag and a GitHub Release. -The published package is `packages/javascript-excel`. The playground (`apps/playground`) and the workspace root are private and never published. +The published package is `packages/javascript-excel`. The dev sandbox (`apps/playground`), the examples and the workspace root are private and never published. The public playground is a separate repository that installs the published package. ## 1. Add a changeset to your pull request @@ -12,7 +12,7 @@ Every pull request that changes the published package adds a changeset: npx changeset ``` -Pick `javascript-excel`, choose the bump (patch, minor, major) and write one line for the changelog. This creates a small Markdown file in `.changeset/`; commit it with your change. Pull requests that only touch docs, CI or the playground need no changeset. +Pick `javascript-excel`, choose the bump (patch, minor, major) and write one line for the changelog. This creates a small Markdown file in `.changeset/`; commit it with your change. Pull requests that only touch docs, CI or the playground need no changeset. A change to the package README does, because the README ships in the package. Merging a pull request with only a changeset publishes nothing. The version doesn't change until a release pull request. @@ -30,7 +30,7 @@ git diff # review the version bump and CHANGELOG.md - consumes the pending changesets, - bumps `packages/javascript-excel/package.json`, - writes `packages/javascript-excel/CHANGELOG.md`, -- updates the playground's dependency on the package. +- updates the dev sandbox's and the examples' dependency on the package. It then runs `scripts/reset-pre-counter.mjs`, which restarts the prerelease number at 0 when the prerelease tag changed (see [§3](#3-prereleases-pre-mode)), and `scripts/sync-version.mjs`, which sets the `VERSION` constant in `packages/javascript-excel/src/index.ts` to the new version (`changeset version` never edits source files). It fails if it can't find exactly one such constant, so renaming the constant can't silently break the sync. diff --git a/docs/api.md b/docs/api.md index ddee4fb..955ef60 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1695,7 +1695,7 @@ The limits are on by default. Raising them is an explicit `limits` option, and t ### 9.2 Compatibility of files - Writes ECMA-376 transitional SpreadsheetML that opens without repair in Excel (Windows and Mac, current), LibreOffice Calc, Apple Numbers and Google Sheets. The conformance suite (JSE-9) checks it. -- Reads files produced by those four plus common generators (SheetJS, ExcelJS, openpyxl, Apache POI). +- Reads files produced by those four plus common generators. Tested today: files written by openpyxl and LibreOffice (reader fixtures) and the corpus re-saved by LibreOffice; files from Excel, Numbers and Google Sheets come from the manual check. Other generators (SheetJS, ExcelJS, Apache POI) `[to verify with fixtures]`. The cross-checks, and why openpyxl replaced the planned SheetJS comparison, are in [conformance.md](conformance.md#automated-cross-checks). ### 9.3 Runtime support matrix diff --git a/docs/conformance.md b/docs/conformance.md index c201468..1fd2cef 100644 --- a/docs/conformance.md +++ b/docs/conformance.md @@ -242,3 +242,13 @@ These facts are marked `[to verify]` in `docs/api.md`. Each one is checked by th | how newer Excel errors such as `#SPILL!` are stored (§3.4) | *(make one)* | In Excel 365, enter `=SEQUENCE(3)` in A2 and any value in A3 so it spills into a blocked cell, save as `.xlsx`, and attach the file to the report. The XML is inspected from it. | Not covered by a manual check: date detection for custom formats (§3.4.1) is checked automatically by the reader tests, and the maximum digit width for default fonts other than Calibri 11 stays open. + +## Automated cross-checks + +Every pull request checks the writer and reader against independent implementations: + +- **openpyxl** (`packages/javascript-excel/test/interop/xlsx_dump.py`) reads the corpus files and the writer's golden files back: values, formulas with their cached results, number formats and full styles, sheet features and document properties. openpyxl also writes the reader fixtures in `packages/javascript-excel/test/fixtures/read/`. +- **LibreOffice** (headless) opens every corpus file except the large `18-limits.xlsx` and re-saves it as `.xlsx`; javascript-excel's reader then checks that every sheet and text cell survived. Files written by LibreOffice are reader fixtures too. +- **Python's standard library** cross-checks the zip layer (`zipfile`, `packages/javascript-excel/test/interop/zip_interop.py`) and CSV (`csv`, `packages/javascript-excel/test/interop/csv_interop.py`) in both directions. + +The original plan (JSE-9) also called for a cross-check against SheetJS as a devDependency. It was replaced by the openpyxl tests above. openpyxl is a separate implementation in another language and exposes the whole style model, so a test can compare fonts, fills, borders, alignment and number formats cell by cell; SheetJS's community edition reads little of the styling. The SheetJS package on the npm registry is also no longer its current release (newer versions are distributed from the SheetJS CDN), and javascript-excel replaces a SheetJS fork, so a SheetJS comparison would check against the predecessor's lineage rather than an independent reading of the format. Python and openpyxl are CI tools only: the package keeps zero dependencies and no new devDependency was added. Files from Excel, Numbers and Google Sheets come from the manual check above. diff --git a/packages/javascript-excel/README.md b/packages/javascript-excel/README.md index 2058e33..401fa54 100644 --- a/packages/javascript-excel/README.md +++ b/packages/javascript-excel/README.md @@ -8,6 +8,8 @@ Read and write `.xlsx` and `.csv` files in browsers, Web Workers and Node.js. Ty npm install javascript-excel@next ``` +**Try it in the browser:** the [playground](https://javascript-excel-playground.vercel.app/) writes, reads and previews workbooks with the published package, and shows the code for what you build. + | entry | for | |---|---| | `javascript-excel` | the workbook model, the `.xlsx` writer, dataset builders, dates, addresses, errors | diff --git a/packages/javascript-excel/test/conformance/checklist.ts b/packages/javascript-excel/test/conformance/checklist.ts index 7d239dd..42c9899 100644 --- a/packages/javascript-excel/test/conformance/checklist.ts +++ b/packages/javascript-excel/test/conformance/checklist.ts @@ -53,6 +53,16 @@ export function renderChecklist(): string { "", "Not covered by a manual check: date detection for custom formats (§3.4.1) is checked automatically by the reader tests, and the maximum digit width for default fonts other than Calibri 11 stays open.", "", + "## Automated cross-checks", + "", + "Every pull request checks the writer and reader against independent implementations:", + "", + "- **openpyxl** (`packages/javascript-excel/test/interop/xlsx_dump.py`) reads the corpus files and the writer's golden files back: values, formulas with their cached results, number formats and full styles, sheet features and document properties. openpyxl also writes the reader fixtures in `packages/javascript-excel/test/fixtures/read/`.", + "- **LibreOffice** (headless) opens every corpus file except the large `18-limits.xlsx` and re-saves it as `.xlsx`; javascript-excel's reader then checks that every sheet and text cell survived. Files written by LibreOffice are reader fixtures too.", + "- **Python's standard library** cross-checks the zip layer (`zipfile`, `packages/javascript-excel/test/interop/zip_interop.py`) and CSV (`csv`, `packages/javascript-excel/test/interop/csv_interop.py`) in both directions.", + "", + "The original plan (JSE-9) also called for a cross-check against SheetJS as a devDependency. It was replaced by the openpyxl tests above. openpyxl is a separate implementation in another language and exposes the whole style model, so a test can compare fonts, fills, borders, alignment and number formats cell by cell; SheetJS's community edition reads little of the styling. The SheetJS package on the npm registry is also no longer its current release (newer versions are distributed from the SheetJS CDN), and javascript-excel replaces a SheetJS fork, so a SheetJS comparison would check against the predecessor's lineage rather than an independent reading of the format. Python and openpyxl are CI tools only: the package keeps zero dependencies and no new devDependency was added. Files from Excel, Numbers and Google Sheets come from the manual check above.", + "", ); return out.join("\n"); }