@formepdf/core 0.21.0 → 0.22.0
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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formepdf/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "WASM-powered PDF rendering engine for Forme",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -64,22 +64,22 @@
|
|
|
64
64
|
"prepublishOnly": "npm run build && ./scripts/assert-tarball.sh"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@formepdf/react": "0.
|
|
67
|
+
"@formepdf/react": "0.22.0"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"react": "^18 || ^19"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@cloudflare/vitest-pool-workers": "^0.22.0",
|
|
74
|
-
"@formepdf/templates": "0.
|
|
75
|
-
"@formepdf/html": "^0.
|
|
76
|
-
"@pdf-testkit/vitest": "^0.
|
|
74
|
+
"@formepdf/templates": "0.22.0",
|
|
75
|
+
"@formepdf/html": "^0.22.0",
|
|
76
|
+
"@pdf-testkit/vitest": "^0.4.1",
|
|
77
77
|
"@types/node": "^22.0.0",
|
|
78
78
|
"@types/react": "^19.0.0",
|
|
79
79
|
"react": "^19.0.0",
|
|
80
80
|
"typescript": "^5.7.0",
|
|
81
81
|
"vitest": "^4.1.0",
|
|
82
|
-
"@formepdf/fonts-standard": "0.
|
|
82
|
+
"@formepdf/fonts-standard": "0.22.0"
|
|
83
83
|
},
|
|
84
84
|
"files": [
|
|
85
85
|
"dist/",
|
package/pkg/forme_bg.wasm
CHANGED
|
Binary file
|
package/pkg/package.json
CHANGED
package/pkg-node/forme_bg.wasm
CHANGED
|
Binary file
|
package/pkg-node/package.json
CHANGED
package/pkg-web/forme_bg.wasm
CHANGED
|
Binary file
|
package/pkg-web/package.json
CHANGED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Render one shipped template and write its raw `LayoutInfo` JSON to disk.
|
|
3
|
-
*
|
|
4
|
-
* Exists for CI's "Document Regression Demo" job, which needs the *current*
|
|
5
|
-
* run as a file on disk to hand to @pdf-testkit/action. The vitest matcher
|
|
6
|
-
* compares in memory and never writes one, so this is the missing producer —
|
|
7
|
-
* deliberately the same two calls the regression suite makes (`getTemplate` +
|
|
8
|
-
* `renderDocumentWithLayout`), so the demo can't drift from what that suite
|
|
9
|
-
* asserts.
|
|
10
|
-
*
|
|
11
|
-
* `pdf-testkit snapshot` converts the LayoutInfo emitted here into the same
|
|
12
|
-
* StructuralSnapshot shape as the committed baselines.
|
|
13
|
-
*
|
|
14
|
-
* Usage: node scripts/render-template-layout.mjs <template-name> <out.json>
|
|
15
|
-
*/
|
|
16
|
-
import { writeFile } from 'node:fs/promises';
|
|
17
|
-
import { getTemplate } from '@formepdf/templates';
|
|
18
|
-
import * as schemas from '@formepdf/templates/schemas';
|
|
19
|
-
import { renderDocumentWithLayout } from '../dist/index.js';
|
|
20
|
-
|
|
21
|
-
const [name, out] = process.argv.slice(2);
|
|
22
|
-
if (!name || !out) {
|
|
23
|
-
console.error('usage: render-template-layout.mjs <template-name> <out.json>');
|
|
24
|
-
process.exit(2);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const template = getTemplate(name);
|
|
28
|
-
if (!template) {
|
|
29
|
-
console.error(`getTemplate(${JSON.stringify(name)}) returned null`);
|
|
30
|
-
process.exit(1);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// Same `*Example` fixtures the regression suite uses. They're validated against
|
|
34
|
-
// their Zod schemas at import time, so they can't drift from the schemas.
|
|
35
|
-
const exampleKey = `${name.replace(/-([a-z])/g, (_, c) => c.toUpperCase())}Example`;
|
|
36
|
-
const data = schemas[exampleKey];
|
|
37
|
-
if (!data) {
|
|
38
|
-
console.error(`No example fixture exported as "${exampleKey}" from @formepdf/templates/schemas`);
|
|
39
|
-
process.exit(1);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const { layout } = await renderDocumentWithLayout(template(data));
|
|
43
|
-
await writeFile(out, JSON.stringify(layout, null, 2) + '\n', 'utf8');
|
|
44
|
-
console.error(`wrote layout: ${out} (${layout.pages.length} page(s))`);
|