@dxvis/flatbi 0.0.0-stage → 0.1.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/llms.txt ADDED
@@ -0,0 +1,55 @@
1
+ # flatbi
2
+
3
+ > Compile a declarative `*.dash.yaml` spec into one self-contained, zero-network HTML dashboard powered by DuckDB at build time and a tree-shaken pure-TS + ECharts viewer in the browser.
4
+
5
+ Built files contain only the slim-table columns referenced by tiles and filters, enforce a strict hash-only Content-Security-Policy (`connect-src 'none'`), and work offline from `file://` or any static server. Compressed embedded data is not encrypted; treat shared HTML files according to the sensitivity of the embedded dimensions and measures.
6
+
7
+ ## Authoring workflow
8
+
9
+ 1. `flatbi init` — scaffold a working starter dashboard and sample data (or start from your own data).
10
+ 2. `flatbi inspect <data-or-spec>` — examine columns, types, cardinalities, nulls, and date ranges.
11
+ 3. Write `*.dash.yaml` starting with `dash: 1`.
12
+ 4. `flatbi check <spec>` — validate schema, SQL, formulas, filter reach, budgets, and empty tiles.
13
+ 5. `flatbi render <spec>` — capture a full-page PNG and inspect visual findings (`text-clipped`, `legend-overflow`, `too-many-categories`, `low-contrast`, `tiny-text`).
14
+ 6. View the PNG directly, refine, and run `flatbi build <spec>` (or `flatbi dev <spec>` for live reload).
15
+ 7. Use `flatbi extract <file.html>` to recover the verbatim spec and slim-table CSVs, or `flatbi migrate <spec>` to check spec versions.
16
+
17
+ ## Minimal spec skeleton
18
+
19
+ ```yaml
20
+ # yaml-language-server: $schema=./node_modules/@dxvis/flatbi/schema/dash.schema.json
21
+ dash: 1
22
+ title: Sales overview
23
+ sources:
24
+ orders: { file: data/orders.csv }
25
+ models:
26
+ sales:
27
+ source: orders
28
+ time: order_date
29
+ dimensions: [region, category]
30
+ measures:
31
+ revenue: { agg: sum, sql: amount, format: currency }
32
+ orders: { agg: count, format: integer }
33
+ aov: { formula: revenue / orders, format: currency }
34
+ filters:
35
+ - { field: order_date, type: date_range, default: last_12_months }
36
+ - { field: region, type: multi_select }
37
+ tiles:
38
+ revenue: { type: kpi, value: revenue, compare: previous_period, spark: true }
39
+ trend: { type: line, x: order_date@month, y: revenue }
40
+ by_cat: { type: bar, x: category, y: revenue, limit: 8 }
41
+ layout:
42
+ - [revenue]
43
+ - [trend:7, by_cat]
44
+ ```
45
+
46
+ ## Documentation
47
+
48
+ - [Tile guide](docs/tile-guide.md): match data shapes to the right tile type.
49
+ - [Recipes](docs/recipes.md): verified copy-paste examples covering all 10 tile types.
50
+ - [Spec reference](docs/spec-reference.md): complete schema reference generated from `src/spec/schema.ts`.
51
+ - [JSON Schema](schema/dash.schema.json): machine-readable schema for YAML editors and validators.
52
+ - [Example dashboard](examples/sales.dash.yaml): complete working example spec.
53
+ - [Agent skill](skills/flatbi/SKILL.md): concise agent workflow (`inspect -> write -> check -> render -> look`).
54
+ - [Glossary](GLOSSARY.md): canonical project vocabulary.
55
+ - [Scale and performance](docs/performance.md): 10M-row build, 200k-row latency, and first-paint targets.
package/package.json CHANGED
@@ -1,6 +1,68 @@
1
1
  {
2
2
  "name": "@dxvis/flatbi",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Compile an agent-authored *.dash.yaml spec into one self-contained, offline HTML dashboard.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/DavisMcCracken/flatbi.git"
10
+ },
11
+ "engines": {
12
+ "node": ">=22.17"
13
+ },
14
+ "bin": {
15
+ "flatbi": "./dist/cli/bin.mjs"
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "schema",
20
+ "skills",
21
+ ".claude-plugin",
22
+ "llms.txt",
23
+ "docs/spec-reference.md",
24
+ "docs/tile-guide.md",
25
+ "docs/recipes.md",
26
+ "LICENSE",
27
+ "README.md"
28
+ ],
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "scripts": {
33
+ "build": "npm run build:runtime && npm run build:cli",
34
+ "build:runtime": "vite build",
35
+ "build:cli": "tsdown",
36
+ "typecheck": "tsc -p tsconfig.json && tsc -p src/runtime/tsconfig.json",
37
+ "lint": "biome check .",
38
+ "format": "biome check --write .",
39
+ "test": "vitest run",
40
+ "generate": "vitest run test/reference.test.ts --update",
41
+ "size": "node scripts/size-gate.mjs",
42
+ "bench:10m": "node scripts/bench-10m.mjs",
43
+ "bench:paint": "node scripts/bench-first-paint.mjs",
44
+ "changeset": "changeset",
45
+ "release": "npm run build && changeset publish"
46
+ },
47
+ "dependencies": {
48
+ "@duckdb/node-api": "1.5.6-r.1",
49
+ "yaml": "^2.9.1",
50
+ "zod": "^4.6.7"
51
+ },
52
+ "optionalDependencies": {
53
+ "playwright-core": "^1.64.1"
54
+ },
55
+ "devDependencies": {
56
+ "@biomejs/biome": "^2.5.15",
57
+ "@changesets/cli": "^3.0.3",
58
+ "@types/node": "^22.20.5",
59
+ "ajv": "^8.20.0",
60
+ "axe-core": "^4.14.1",
61
+ "echarts": "^6.1.0",
62
+ "tsdown": "^0.23.1",
63
+ "typescript": "^7.0.2",
64
+ "vite": "^8.3.4",
65
+ "vite-plugin-singlefile": "^2.3.4",
66
+ "vitest": "^5.0.5"
67
+ }
68
+ }