@reportwright/fonts-cjk 0.13.1 → 0.13.2-rc.1

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 (3) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +47 -1
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,44 @@
2
2
 
3
3
  All `@reportwright/*` packages (formerly `@pagewrightjs/*`) share one version. The versioning policy is in [CONTRIBUTING.md](CONTRIBUTING.md#versioning-semver).
4
4
 
5
+ ## 0.13.2-rc.1 — 2026-10-09 (release candidate)
6
+
7
+ ### Changed
8
+ - **The rename to ReportWright is finished; every old Pagewright name keeps working until 1.0.** New names, with the old one kept as a deprecated alias:
9
+ - report schema: `reportwright/report@1` is now what new and saved reports carry; `pagewright/report@1` is read as the same format (a server before 0.9 cannot open a report saved by 0.13.2).
10
+ - HTTP headers: `x-reportwright-pages`, `-ms`, `-warnings`, `-snapshot`, `-pending`, `-signature` (webhooks and the audit SIEM webhook) and `-idempotency-key` (mail) are sent together with the old `x-pagewright-*` header; the proxy secret is read from `x-reportwright-proxy-secret`, else `x-pagewright-proxy-secret`.
11
+ - Prometheus metrics: `/api/v1/metrics` emits every family as `reportwright_*` and again as `pagewright_*` (the old ones go in 1.0: move dashboards and alerts). `scripts/uptime-check.mjs` reads either.
12
+ - one console warning per page for `definePagewrightElements`, the `<pagewright-viewer>` / `<pagewright-designer>` tags, the Svelte `pagewrightViewer` / `pagewrightDesigner` actions, `window.Pagewright` and `/embed/pagewright-viewer.js` (and `-viewer.full.js`). The React and Vue `PagewrightViewer` / `PagewrightDesigner` stay the same components, without a warning; all are typed `@deprecated`.
13
+ - the live demo moved to https://mrarun005.github.io/reportwright-demo/ (the site build's default base is `/reportwright-demo/`).
14
+ - kept as they are, since changing them would break stored data: the `.pw.json` extension, the designer clipboard format `pagewright/items@1`, and the salts of the TOTP secret key and the audit checkpoint chain.
15
+ - **The render worker is minified.** `engine.worker.js` (and `engine.worker.bwip.js`) in `@reportwright/viewer` and the embed builds are minified, still one file with no chunk imports, with a linked source map (`engine.worker.js.map`) beside it so worker stack traces stay readable. `engine.worker.js` 2,195,290 → 1,218,659 bytes (608 → 503 KB gzipped); `engine.worker.bwip.js` 1,651,602 → 973,261 bytes (315 → 267 KB gzipped). The size budget in tests/engine/b10-bundle-size.test.js is now 504 KB gzipped (was 600).
16
+ - **Publishing verifies before `latest` moves.** The publish workflow publishes to the `next` dist-tag, installs all nine packages from the registry and smoke-tests them (imports, PDF/XLSX/DOCX export, `qpdf --check`, `pw render`, the viewer's files, the wrappers' peer), and only then moves `latest`.
17
+
18
+ ### Performance
19
+ - **Trade-off made by 0.13.1: less memory, about 10–14% slower.** The 0.13.1 fixes for grouped sorts (N44: sort runs spill to disk in smaller runs, about 8 MB) and for streamed tagged PDFs (N44: tagged structure flushed per page) cost time for the memory they save: about 10–14% slower on the tester's 2 vCPU machine (not measured here). Memory: a 200,000-row grouped ledger peaks at 232 MB instead of 280 MB, and the same with 50 runs (1,000,000 rows' run count) 240 MB instead of 296 MB; a tagged streamed PDF at 50k/100k/200k rows holds 6.7/7.3/9.3 MB off-heap instead of 16.8/29.1/36.6 MB. `spillSorter({ runMB, mergeMB })` sets the sort's run size if speed matters more than memory.
20
+ ### Added
21
+ - **`pw import <folder>`: bulk import.** Every `.rdl`, `.rdlc`, `.jrxml`, `.rptdesign` and `.rdlx-json` report in a folder (`--recursive` for subfolders) is imported into `-o <outDir>`, which mirrors the folder.
22
+ - One bad file never stops the batch. Exit 0 means all were imported, 2 some failed, 1 none.
23
+ - Subreports, SSRS shared data sources (`.rds`), JasperReports style templates (`.jrtx`) and images are resolved across the batch. Images are copied once per content. Unresolved references are listed per file.
24
+ - `import-report.json` and a standalone, escaped `import-report.html` give for each file the mapped, approximated and dropped counts, each item's reason, and every expression that was not translated with its line and column.
25
+ - `.pw-import.json` holds the hash of each written file, and a re-run skips an output the user edited unless `--force`.
26
+ - `--verify` renders each report with its embedded or sample data and compares it with the output it replaced.
27
+ - Paths from the folder are untrusted. Links that point outside it are refused, outputs stay in `outDir`, and `--max-files` and `--max-bytes` cap the input.
28
+ - The importers now return structured `items` (each item's notes, untranslated expressions and source position) and take a `resolve` option for shared data sources and style templates.
29
+ - Docs: the CLI README, "Bulk import". Test: tests/engine/c132-import-batch.test.js.
30
+ - **`pw --version` / `pw -v`** prints the CLI version (from its package.json) and the version of the engine it carries.
31
+ - **`showWarnings`** (viewer option, default `false`): shows the render's warnings under the pages; the designer's Preview always shows them. Documented in the viewer README and typed in `ViewerOptions`.
32
+ - **ⓘ help tooltips in the designer.** Long help paragraphs (the Outline, Layers and Parts panels, field hints over 90 characters) sit behind an ⓘ button that opens on hover, keyboard focus or click and closes with Esc; the button is described by the text (`aria-describedby`).
33
+ ### Fixed
34
+ - **An unchecked check box has no tick on the designer canvas.** The canvas drew ✓ in every check box; it now follows the value as the renderer does (`false`, `=False`, a missing value: empty), and dims the tick of a value only the data decides.
35
+ - **Selecting an item no longer moves the canvas.** The canvas toolbar grew a second row (24 px) when the align buttons of a selection appeared; it now has one fixed height (it scrolls sideways when narrow) and its hint moved to the status bar.
36
+ - **Keyboard nudge steps.** Arrow moves the selection 1 pt, or one grid step with Snap to grid on (a cell in cell mode); Shift+Arrow moves ten of them (it was 4 grid steps); positions stay rounded to 2 decimals.
37
+ - **Render warnings in the viewer read as words.** The count says "8 warnings" or "1 warning", not "warning(s)".
38
+ - **The Data panel lists a data set's fields when it declares none.** It said "No fields" next to 300 rows; it now detects them from inline JSON or the first rows of fetched data with the engine's own detection (`detectFields`, the one streaming uses) and marks them as detected.
39
+ - **No cut-off text in the Inspector and the Outline.** The Regional "Division by zero" choice gets the full width ("Infinity (as SSRS)" was cut); a long name in the Outline wraps inside the panel, with the full name as its tooltip, and the item type and buttons move under it together.
40
+ - **The parameter dialog's help matches the viewer.** The live-parameters option no longer says that turning it off adds a View report button (the button is always there), and the panel-columns help says the grid applies on a wide screen.
41
+ - **Export options icon.** The sun-like gear is a sliders icon; the button keeps its name, Export options.
42
+
5
43
  ## 0.13.1 — 2026-10-09
6
44
 
7
45
  ### Fixed
package/README.md CHANGED
@@ -1,8 +1,12 @@
1
1
  # @reportwright/fonts-cjk (optional)
2
2
 
3
+ Chinese, Japanese, Korean and emoji fonts for ReportWright, downloaded on demand and checked by SHA-256.
4
+
3
5
  [![npm](https://img.shields.io/npm/v/%40reportwright%2Ffonts-cjk)](https://www.npmjs.com/package/@reportwright/fonts-cjk) [![license](https://img.shields.io/badge/license-OFL--1.1%20%2B%20MIT-blue)](https://github.com/MrArun005/reportwright/blob/main/LICENSE) [![Socket](https://socket.dev/api/badge/npm/package/@reportwright/fonts-cjk)](https://socket.dev/npm/package/@reportwright/fonts-cjk)
4
6
 
5
- Chinese, Japanese, Korean and emoji fonts for ReportWright (Noto, SIL Open Font License). They are not in
7
+ **Live demo:** [mrarun005.github.io/reportwright-demo](https://mrarun005.github.io/reportwright-demo) (the gallery and the [designer playground](https://mrarun005.github.io/reportwright-demo/play.html); the demo serves the bundled fonts, so CJK text there needs this package's files in its `fontsUrl` folder).
8
+
9
+ The fonts are Noto (SIL Open Font License). They are not in
6
10
  `@reportwright/fonts` because they are large:
7
11
 
8
12
  | File | Covers | Size |
@@ -50,3 +54,45 @@ The engine loads a face only when text needs it (`FontStore` asks for `cjk/NotoS
50
54
  and a PDF embeds only the glyphs it uses: a line of Japanese, Korean and emoji adds about 8 KB. Without the files,
51
55
  those characters draw as boxes and the render warns how to add them. The fonts are variable fonts drawn at their
52
56
  default (regular) weight; bold CJK text is drawn regular.
57
+
58
+ ## Quick start (30 seconds)
59
+
60
+ After `npx reportwright-fonts-cjk`, CJK text renders with no other change:
61
+
62
+ ```js
63
+ import { render, defaultFontStore, exportPdf } from '@reportwright/engine';
64
+ const fonts = defaultFontStore(); // also reads the CJK cache folder
65
+ const def = { $schema: 'reportwright/report@1', name: 'Hello', page: { size: 'A4', margins: [36, 36, 36, 36] },
66
+ sections: { body: { items: [{ type: 'textbox', name: 'Hi', x: 0, y: 0, w: 400, h: 24, value: 'こんにちは · 안녕하세요 · 你好' }] } } };
67
+ const pdf = await exportPdf(await render(def, { fontStore: fonts }), { fonts });
68
+ ```
69
+
70
+ Verified against this version in Node 20 (Japanese, Korean and Simplified Chinese; the emoji download returned HTTP 504
71
+ from the upstream host on the day it was checked, and the command stops at the first failed file).
72
+
73
+ ## Examples
74
+
75
+ **Docker image:** download at build time into a fixed folder the server also reads.
76
+
77
+ ```dockerfile
78
+ ENV REPORTWRIGHT_FONTS_DIR=/opt/reportwright/fonts
79
+ RUN npx reportwright-fonts-cjk
80
+ ```
81
+
82
+ **Simplified Chinese shapes** instead of the default (Japanese) Han shapes: `"style": { "fontFamily": "Noto Sans SC" }`.
83
+
84
+ **Browser viewer:** download into the served fonts folder, under `cjk/`:
85
+ `npx reportwright-fonts-cjk public/pw/fonts/cjk` with `fontsUrl: '/pw/fonts/'`.
86
+
87
+ ## API
88
+
89
+ | Export | What |
90
+ |---|---|
91
+ | `fetchCjkFonts(dir?, { log?, fetch? })` | downloads and checks every file into `dir` (default `cacheDir()`) |
92
+ | `cacheDir(env?, platform?, home?)` | the folder the fonts go to (rules below) |
93
+ | `fontPath(name)` | a downloaded file's path |
94
+ | `CJK_FONTS` | the files: upstream path, file name, SHA-256 |
95
+ | CLI `reportwright-fonts-cjk [dir]` | `fetchCjkFonts` from the command line |
96
+
97
+ Requires Node 20.9 or later (it uses the global `fetch`). Related: [`@reportwright/fonts`](https://github.com/MrArun005/reportwright/tree/main/packages/fonts) (the bundled
98
+ fonts), [`@reportwright/engine`](https://github.com/MrArun005/reportwright/tree/main/packages/engine), [`@reportwright/viewer`](https://github.com/MrArun005/reportwright/tree/main/packages/viewer).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reportwright/fonts-cjk",
3
- "version": "0.13.1",
3
+ "version": "0.13.2-rc.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },