@dxvis/flatbi 0.0.0-stage → 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.
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
3
+ "name": "flatbi",
4
+ "owner": {
5
+ "name": "DavisMcCracken"
6
+ },
7
+ "metadata": {
8
+ "description": "flatbi Claude Code plugin marketplace for authoring self-contained offline HTML dashboards."
9
+ },
10
+ "plugins": [
11
+ {
12
+ "name": "flatbi",
13
+ "source": "./",
14
+ "description": "Dashboard authoring skill teaching inspect -> write -> check -> render -> look with flatbi.",
15
+ "version": "0.0.0",
16
+ "category": "analytics",
17
+ "homepage": "https://github.com/DavisMcCracken/flatbi",
18
+ "keywords": ["dashboard", "bi", "analytics", "duckdb"]
19
+ }
20
+ ]
21
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "flatbi",
3
+ "version": "0.0.0",
4
+ "description": "Author self-contained, offline BI dashboards from local data with flatbi.",
5
+ "author": {
6
+ "name": "DavisMcCracken"
7
+ },
8
+ "homepage": "https://github.com/DavisMcCracken/flatbi",
9
+ "repository": "https://github.com/DavisMcCracken/flatbi",
10
+ "license": "MIT",
11
+ "keywords": ["dashboard", "bi", "analytics", "duckdb", "echarts", "html"],
12
+ "skills": "./skills/"
13
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Davis McCracken
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,97 @@
1
- # Temporary Holding Version
1
+ # flatbi
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Compact BI dashboards, Tableau/Power BI-style, that an AI agent can build end-to-end and you can share as **one private, offline HTML file**.
4
+
5
+ An agent writes a short `*.dash.yaml` spec: sources → models (dimensions and measures) → tiles → layout. `flatbi check` validates the spec against the real data. `flatbi build` snapshots the data and emits a single HTML file that anyone can open in a browser. There is no server, no account and no network access.
6
+
7
+ > **Status:** in development. Read the v1 spec in [issue #1](https://github.com/DavisMcCracken/flatbi/issues/1); work is tracked in its sub-issues.
8
+
9
+ ## Usage
10
+
11
+ Install globally with `npm install -g @dxvis/flatbi` (exposes the `flatbi` CLI) or run with `npx --package=@dxvis/flatbi flatbi`.
12
+
13
+ Specs read CSV, Parquet, JSON/NDJSON, XLSX, DuckDB, SQLite, and `sql:` derived sources into models whose measures aggregate (`sum`, `count`, `count_distinct`, `min`, `max`, `avg`, each with an optional row-level `where`) or combine other measures in a `formula`, and show them as `kpi`, `line`, `area`, `bar`, `combo`, `scatter`, `donut`, `heatmap`, `table`, and `text` tiles. [`examples/sales.dash.yaml`](examples/sales.dash.yaml) is a complete one. With more than one model, each tile names its own with `model:`.
14
+
15
+ > **Build-time network note:** Built HTML files never make network requests. At build time, the only network access `flatbi` ever performs is DuckDB's one-time download of the `excel` (for `.xlsx`) or `sqlite` (for `.sqlite` / `.db`) extension on first use. They are cached locally for offline reuse, and zero data is ever sent anywhere.
16
+
17
+ ```sh
18
+ flatbi init [dir] # create a starter dashboard and sample CSV
19
+ flatbi inspect data/orders.csv # columns, types, sample rows, cardinality, nulls, dates
20
+ flatbi check examples/sales.dash.yaml # findings as file:line:col CODE message
21
+ flatbi build examples/sales.dash.yaml # writes dist/sales.html
22
+ flatbi dev examples/sales.dash.yaml # live reload server with findings overlay
23
+ flatbi render examples/sales.dash.yaml # screenshot to PNG with visual findings
24
+ flatbi extract dist/sales.html # recover spec YAML and slim tables as CSV
25
+ flatbi migrate "dashboards/*.dash.yaml" # upgrade older specs to the current version
26
+ flatbi check "dashboards/*.dash.yaml" # several specs, by file or quoted glob
27
+ flatbi check # every *.dash.yaml here, skipping node_modules and dist
28
+ ```
29
+
30
+ - Paths inside a spec resolve against the spec file. `build` writes to `dist/<spec name>.html` under the working directory; `--out` overrides that for a single spec. With several specs, `build` writes each one that passes and skips those with errors.
31
+ - Findings are grouped by file. Each names the allowed values where there is a closed set, and suggests the nearest one when a name looks like a typo ("Did you mean `revenue`?").
32
+ - `--json` prints one envelope on every command: `ok`, `summary`, `findings` (each with its file, line and column, plus `allowed` and `suggestion` where they apply), the command's `result` (the specs that ran, the files `build` wrote, or the usage text under `--help`), and an `error` when the command cannot run: `usage`, `io` (a file it could not write) or `internal`.
33
+ - Exit codes: `0` clean or only warnings, `1` errors found, `2` usage, I/O or internal error. `--strict` treats warnings as errors.
34
+
35
+ ### The spec
36
+
37
+ [`docs/spec-reference.md`](docs/spec-reference.md) lists every key a spec may hold. It is generated from the same schema `check` validates against, as is the JSON Schema the package ships in `schema/dash.schema.json`.
38
+
39
+ To have your editor validate a spec as you type, point the first line of the spec at the schema (the path is relative to the spec). This works with any editor that uses the YAML language server, such as VS Code with the Red Hat YAML extension:
40
+
41
+ ```yaml
42
+ # yaml-language-server: $schema=./node_modules/@dxvis/flatbi/schema/dash.schema.json
43
+ dash: 1
44
+ ```
45
+
46
+ The editor catches mistakes of shape, such as an unknown key or tile type. `check` also resolves every reference and runs every tile against the data.
47
+
48
+ ## Development
49
+
50
+ Requires Node 22.17+, where `fs.glob` is stable.
51
+
52
+ | Command | What it does |
53
+ |---|---|
54
+ | `npm ci` | Install dependencies |
55
+ | `npm run typecheck` | Type-check the Node side and the viewer runtime |
56
+ | `npm run lint` | Lint and check formatting with Biome (`npm run format` fixes) |
57
+ | `npm test` | Build, then run the tests with Vitest, including the examples gate, the browser tests and the check that generated files are current |
58
+ | `npm run generate` | Regenerate `schema/dash.schema.json` and `docs/spec-reference.md` from the spec schema |
59
+ | `npm run build` | Build the viewer runtime (one HTML file) and the CLI |
60
+ | `npm run size` | Check the built runtime against its gzipped budget: 300 kB, font included |
61
+ | `npm run bench:10m` | Generate a 10M-row Parquet fixture and benchmark `flatbi build` (also runs weekly in CI) |
62
+ | `npm run bench:paint` | Measure FCP and ready time on `examples/sales.dash.yaml` in Chromium |
63
+ | `npx changeset` | Describe a user-facing change for the changelog |
64
+
65
+ Add or upgrade dependencies with `npx npm@11 install …`. npm 10 crashes while resolving one of tsdown's optional peer dependencies; `npm ci` works with either version.
66
+
67
+ The browser tests open built files in an installed Google Chrome, and never download a browser. To use another Chromium-based browser, set `FLATBI_BROWSER` to its executable.
68
+
69
+ Every dashboard in [`examples/`](examples/) must pass `check` with no findings at all; CI fails otherwise.
70
+
71
+ ### Architecture
72
+
73
+ | Module | Responsibility |
74
+ |---|---|
75
+ | `src/spec` | Parse, validate and resolve `*.dash.yaml` specs |
76
+ | `src/compile` | Snapshot sources with DuckDB into slim tables and the manifest (build time) |
77
+ | `src/engine` | Pure filtering and aggregation, shared by the viewer and `check` |
78
+ | `src/runtime` | The viewer, built into one self-contained HTML file |
79
+ | `src/cli` | The `flatbi` command |
80
+ | `src/pipeline.ts` | The build pipeline behind `check` and `build`: spec, then compile, then the engine on the default view state |
81
+
82
+ The engine is type-checked against both the Node and the browser configs, so it can use neither Node nor DOM APIs. It also owns the compiled-dashboard format that `build` embeds and the viewer reads.
83
+
84
+ ## Docs
85
+
86
+ - [`llms.txt`](llms.txt): one-page overview and link index for coding agents.
87
+ - [`docs/tile-guide.md`](docs/tile-guide.md) and [`docs/recipes.md`](docs/recipes.md): chart selection guide and copy-ready dashboard recipes across all 10 tile types.
88
+ - [`skills/flatbi/SKILL.md`](skills/flatbi/SKILL.md) and [`.claude-plugin/marketplace.json`](.claude-plugin/marketplace.json): Claude Code skill and plugin marketplace manifest (`/plugin marketplace add DavisMcCracken/flatbi`).
89
+ - [`GLOSSARY.md`](GLOSSARY.md): the project's vocabulary.
90
+ - [`docs/performance.md`](docs/performance.md): scale, 200k-row latency, and first-paint targets and benchmarks.
91
+ - [`docs/releasing.md`](docs/releasing.md): Changesets release pipeline and owner publish checklist.
92
+ - [`docs/adr/`](docs/adr/): architecture decision records.
93
+ - [`docs/research/`](docs/research/): the research behind the design (bento, prior art, stack, impeccable).
94
+
95
+ ## Inspiration
96
+
97
+ [nyblnet/bento](https://github.com/nyblnet/bento) ("the file *is* the software") and its agent-first authoring loop.