@veztraa/report-cli 0.1.0 → 0.1.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.
- package/README.md +96 -0
- package/package.json +7 -3
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @veztraa/report-cli
|
|
2
|
+
|
|
3
|
+
CLI tool for ReportForge. Render PDFs from the terminal without writing any code — point it at a template JSON and a data JSON file and get a PDF back.
|
|
4
|
+
|
|
5
|
+
## Usage (no install needed)
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx @veztraa/report-cli render template.json data.json --output report.pdf
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Installation (optional, for repeated use)
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g @veztraa/report-cli
|
|
15
|
+
report-designer render template.json data.json --output report.pdf
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Commands
|
|
19
|
+
|
|
20
|
+
### `render`
|
|
21
|
+
|
|
22
|
+
Render a template with data to a PDF file.
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx @veztraa/report-cli render <template> <data> [options]
|
|
26
|
+
|
|
27
|
+
Arguments:
|
|
28
|
+
template Path to template JSON file
|
|
29
|
+
data Path to data JSON file
|
|
30
|
+
|
|
31
|
+
Options:
|
|
32
|
+
-o, --output Output PDF path (default: output.pdf)
|
|
33
|
+
-w, --watch Re-render whenever template or data files change
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Examples:**
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Basic render
|
|
40
|
+
npx @veztraa/report-cli render invoice.json data.json --output invoice.pdf
|
|
41
|
+
|
|
42
|
+
# Watch mode — re-renders on file change (great for template development)
|
|
43
|
+
npx @veztraa/report-cli render invoice.json data.json --output invoice.pdf --watch
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### `validate`
|
|
47
|
+
|
|
48
|
+
Validate a template JSON file against the ReportForge schema.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npx @veztraa/report-cli validate <template>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Example:**
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npx @veztraa/report-cli validate invoice.json
|
|
58
|
+
# ✔ Template is valid
|
|
59
|
+
# or
|
|
60
|
+
# ✖ Validation failed: [list of issues]
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Template Format
|
|
64
|
+
|
|
65
|
+
Templates are JSON files matching the ReportForge schema. See [`@veztraa/report-core`](https://www.npmjs.com/package/@veztraa/report-core) for the full schema reference.
|
|
66
|
+
|
|
67
|
+
**Minimal example — `template.json`:**
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"version": "1.0",
|
|
71
|
+
"name": "Hello World",
|
|
72
|
+
"page": { "size": "A4", "orientation": "portrait", "margin": { "top": 30, "right": 30, "bottom": 30, "left": 30 } },
|
|
73
|
+
"header": { "height": 0, "elements": [] },
|
|
74
|
+
"footer": { "height": 0, "elements": [] },
|
|
75
|
+
"body": {
|
|
76
|
+
"elements": [
|
|
77
|
+
{
|
|
78
|
+
"id": "title",
|
|
79
|
+
"type": "text",
|
|
80
|
+
"x": 0, "y": 0, "width": 535, "height": 40,
|
|
81
|
+
"content": "Hello, {{name}}!",
|
|
82
|
+
"style": { "fontSize": 24, "fontWeight": "bold" }
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Matching data — `data.json`:**
|
|
90
|
+
```json
|
|
91
|
+
{ "name": "World" }
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## License
|
|
95
|
+
|
|
96
|
+
MIT © [Veztraa Innovations](https://veztraa.com)
|
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veztraa/report-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "CLI tool for ReportForge — render PDFs from the command line",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
|
-
"files": [
|
|
9
|
-
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
10
14
|
"bin": {
|
|
11
15
|
"report-designer": "dist/cli.js"
|
|
12
16
|
},
|