nexabase-report 0.28.1 → 0.28.4
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/NEXAREPORT.md +3 -3
- package/README.md +23 -0
- package/bin/nexabase-report-ai.mjs +47 -0
- package/dist/{generated-BjsMhDVX.js → generated-BnErILTW.js} +30 -0
- package/dist/{html2pdf-B3mAxkNT.js → html2pdf-CTxi4E42.js} +2 -2
- package/dist/{index-n-ggfS1p.js → index-akrwtZ8x.js} +26684 -26638
- package/dist/{index.es-5IFpweNE.js → index.es-BZ7ri4zm.js} +2 -2
- package/dist/{jspdf.es.min-C6M8fb8R.js → jspdf.es.min-Cs0lmW5w.js} +1 -1
- package/dist/nexabase-report.es.js +1 -1
- package/dist/nexabase-report.umd.js +293 -270
- package/dist/{pptxgen.es-KpBnHDuC.js → pptxgen.es-BTLCUmRS.js} +1 -1
- package/package.json +5 -1
package/NEXAREPORT.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- nexabase-report@0.28.
|
|
1
|
+
<!-- nexabase-report@0.28.4 — generado por scripts/gen-ai-context.mjs, no editar a mano -->
|
|
2
2
|
# NexaReport — referencia para agentes de IA
|
|
3
3
|
|
|
4
4
|
> Este archivo se genera desde los tipos TypeScript reales del paquete (`src/lib/types/report.ts`
|
|
@@ -281,10 +281,10 @@ El schema formal completo (todas las interfaces, no solo bandas/elementos) está
|
|
|
281
281
|
`nexabase-report/schema`, así que es accesible sin instalar nada vía:
|
|
282
282
|
|
|
283
283
|
```
|
|
284
|
-
https://unpkg.com/nexabase-report@0.28.
|
|
284
|
+
https://unpkg.com/nexabase-report@0.28.4/schema/nexareport.schema.json
|
|
285
285
|
```
|
|
286
286
|
|
|
287
|
-
(cambia `@0.28.
|
|
287
|
+
(cambia `@0.28.4` por `@latest` para la versión más reciente). Valida el JSON generado
|
|
288
288
|
contra ese schema antes de darlo por bueno — evita que un campo inventado llegue al usuario.
|
|
289
289
|
|
|
290
290
|
Más ejemplos reales (subreportes, crosstab, master-detail, códigos de barras) en `examples/*.json`
|
package/README.md
CHANGED
|
@@ -241,6 +241,29 @@ Reports use a banded structure:
|
|
|
241
241
|
|
|
242
242
|
`Text`, `Image`, `Barcode`, `QRCode`, `Rectangle`, `Ellipse`, `Line`, `Arrow`, `Table`, `Chart`, `Crosstab`, `SubReport`, `DrillDown`
|
|
243
243
|
|
|
244
|
+
## AI-Assisted Report Generation
|
|
245
|
+
|
|
246
|
+
Let your AI coding assistant (Claude Code, Gemini CLI, OpenCode, Cursor...) build report JSON for
|
|
247
|
+
you — one command, run once per project:
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
npx nexabase-report-ai
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
This detects your project's AI instructions file (`CLAUDE.md`, `AGENTS.md`, `GEMINI.md`,
|
|
254
|
+
`.cursorrules`) — or creates `AGENTS.md` if none exists — and adds a pointer to the always-current
|
|
255
|
+
report reference and JSON Schema (served straight from the published package, so it's never
|
|
256
|
+
stale):
|
|
257
|
+
|
|
258
|
+
- `https://unpkg.com/nexabase-report@latest/NEXAREPORT.md` — band/element types, binding syntax,
|
|
259
|
+
worked examples
|
|
260
|
+
- `https://unpkg.com/nexabase-report@latest/schema/nexareport.schema.json` — the formal schema, to
|
|
261
|
+
validate generated JSON before trusting it
|
|
262
|
+
|
|
263
|
+
From then on, any assistant that reads your project's instructions file already knows the current
|
|
264
|
+
report format — no manual copy-pasting, and it can't drift out of date since both files are
|
|
265
|
+
regenerated from the real TypeScript types on every published version.
|
|
266
|
+
|
|
244
267
|
## Expression Engine
|
|
245
268
|
|
|
246
269
|
Safe evaluation without `eval`. Supports:
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// npx nexabase-report-ai -> agrega, UNA vez, el puntero a NEXAREPORT.md/schema en el archivo
|
|
3
|
+
// de instrucciones de IA que ya tenga el proyecto (CLAUDE.md/AGENTS.md/GEMINI.md/.cursorrules).
|
|
4
|
+
// Idempotente: si ya está, no duplica nada.
|
|
5
|
+
import { readFile, writeFile, appendFile } from 'node:fs/promises';
|
|
6
|
+
import { existsSync } from 'node:fs';
|
|
7
|
+
import { join } from 'node:path';
|
|
8
|
+
|
|
9
|
+
const cwd = process.cwd();
|
|
10
|
+
const MARKER = '<!-- nexabase-report:ai-context -->';
|
|
11
|
+
|
|
12
|
+
const BLOCK = `
|
|
13
|
+
${MARKER}
|
|
14
|
+
## NexaReport
|
|
15
|
+
|
|
16
|
+
Antes de crear o modificar un reporte de NexaReport (JSON \`NexaReportDefinition\`), lee
|
|
17
|
+
https://unpkg.com/nexabase-report@latest/NEXAREPORT.md y valida el JSON generado contra
|
|
18
|
+
https://unpkg.com/nexabase-report@latest/schema/nexareport.schema.json antes de entregarlo.
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
const candidates = ['CLAUDE.md', 'AGENTS.md', 'GEMINI.md', '.cursorrules'];
|
|
22
|
+
const found = candidates.filter(f => existsSync(join(cwd, f)));
|
|
23
|
+
|
|
24
|
+
async function addTo(file) {
|
|
25
|
+
const path = join(cwd, file);
|
|
26
|
+
const current = existsSync(path) ? await readFile(path, 'utf-8') : '';
|
|
27
|
+
if (current.includes(MARKER)) {
|
|
28
|
+
console.log(` = ${file} ya tiene la sección de NexaReport, sin cambios`);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (current) {
|
|
32
|
+
await appendFile(path, '\n' + BLOCK);
|
|
33
|
+
} else {
|
|
34
|
+
await writeFile(path, BLOCK.trimStart() + '\n');
|
|
35
|
+
}
|
|
36
|
+
console.log(` + ${file} actualizado`);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (found.length > 0) {
|
|
40
|
+
for (const f of found) await addTo(f);
|
|
41
|
+
} else {
|
|
42
|
+
// Ningún archivo de instrucciones detectado: crea AGENTS.md, la convención más genérica
|
|
43
|
+
// (la leen Claude Code, Gemini CLI, OpenCode, Cursor y otros).
|
|
44
|
+
await addTo('AGENTS.md');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
console.log('\nListo. Cualquier IA que lea ese archivo ya sabe consultar el formato actual de NexaReport.');
|
|
@@ -859,6 +859,36 @@ promedio…). No dependen de la banda en la que estén, porque no hay bandas.</l
|
|
|
859
859
|
<p>Los formatos pensados para documentos —Word, PPTX— y los de datos —Excel, CSV— están orientados a
|
|
860
860
|
reportes paginados. Si necesitas repartir cifras periódicamente por correo o en un archivo, el
|
|
861
861
|
formato adecuado es un <strong>reporte</strong>, no un dashboard.</p>
|
|
862
|
+
`
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
id: "ia-generacion",
|
|
866
|
+
title: "Generar reportes con IA",
|
|
867
|
+
search: "ia, ai, claude, gemini, copilot, cursor, prompt, generar, automatizar, npx generar reportes con ia si integras nexareport en tu app, no necesitas armar el json del reporte a mano ni empezar desde cero en el diseñador: un asistente de ia puede generarlo por ti. configuración (un comando, una sola vez) desde la carpeta de tu proyecto: npx nexabase report ai ese comando detecta el archivo de instrucciones que tu asistente ya lee solo ( claude.md , agents.md , gemini.md , .cursorrules ) —o crea agents.md si no encuentra ninguno— y le agrega el puntero al formato actual de nexareport. no hay nada que copiar ni pegar a mano, y si lo corres de nuevo no duplica nada. de ahí en adelante, cualquier desarrollador del equipo , en cualquier sesión , con cualquier reporte que pida, la ia ya sabe consultar sola el formato actual — sin volver a tocar nada. por qué siempre está al día el comando apunta a nexabase report@latest en npm, no a una copia local: el documento de referencia y el schema formal se regeneran automáticamente en cada versión publicada, directo desde el código. nunca vas a recibir un json con un campo que ya no existe, o le falte uno nuevo (como staticpage , para reportes de páginas fijas). después de generarlo pega el json resultante en el diseñador ( importar json ) para revisarlo visualmente y ajustar posiciones, colores o binding fino — la ia arma la estructura, el diseñador es donde lo dejas exacto.",
|
|
868
|
+
element: "",
|
|
869
|
+
html: `<h1>Generar reportes con IA</h1>
|
|
870
|
+
<p>Si integras NexaReport en tu app, no necesitas armar el JSON del reporte a mano ni empezar desde
|
|
871
|
+
cero en el diseñador: un asistente de IA puede generarlo por ti.</p>
|
|
872
|
+
<h2>Configuración (un comando, una sola vez)</h2>
|
|
873
|
+
<p>Desde la carpeta de tu proyecto:</p>
|
|
874
|
+
<pre><code>npx nexabase-report-ai
|
|
875
|
+
</code></pre>
|
|
876
|
+
<p>Ese comando detecta el archivo de instrucciones que tu asistente ya lee solo (<code>CLAUDE.md</code>,
|
|
877
|
+
<code>AGENTS.md</code>, <code>GEMINI.md</code>, <code>.cursorrules</code>) —o crea <code>AGENTS.md</code> si no encuentra ninguno— y le agrega
|
|
878
|
+
el puntero al formato actual de NexaReport. No hay nada que copiar ni pegar a mano, y si lo
|
|
879
|
+
corres de nuevo no duplica nada.</p>
|
|
880
|
+
<p>De ahí en adelante, <strong>cualquier desarrollador del equipo</strong>, en <strong>cualquier sesión</strong>, con
|
|
881
|
+
<strong>cualquier reporte</strong> que pida, la IA ya sabe consultar sola el formato actual — sin volver a
|
|
882
|
+
tocar nada.</p>
|
|
883
|
+
<h2>Por qué siempre está al día</h2>
|
|
884
|
+
<p>El comando apunta a <code>nexabase-report@latest</code> en npm, no a una copia local: el documento de
|
|
885
|
+
referencia y el schema formal se regeneran automáticamente en cada versión publicada, directo
|
|
886
|
+
desde el código. Nunca vas a recibir un JSON con un campo que ya no existe, o le falte uno nuevo
|
|
887
|
+
(como <code>StaticPage</code>, para reportes de páginas fijas).</p>
|
|
888
|
+
<h2>Después de generarlo</h2>
|
|
889
|
+
<p>Pega el JSON resultante en el diseñador (<strong>Importar JSON</strong>) para revisarlo visualmente y ajustar
|
|
890
|
+
posiciones, colores o binding fino — la IA arma la estructura, el diseñador es donde lo dejas
|
|
891
|
+
exacto.</p>
|
|
862
892
|
`
|
|
863
893
|
}
|
|
864
894
|
];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as Nl, c as ut, d as Vl } from "./index-
|
|
2
|
-
import { j as Xl } from "./jspdf.es.min-
|
|
1
|
+
import { g as Nl, c as ut, d as Vl } from "./index-akrwtZ8x.js";
|
|
2
|
+
import { j as Xl } from "./jspdf.es.min-Cs0lmW5w.js";
|
|
3
3
|
function Jl(Pe, br) {
|
|
4
4
|
for (var fe = 0; fe < br.length; fe++) {
|
|
5
5
|
const HA = br[fe];
|