@dyrebu/ui
v0.0.1
Published
Dynamic Report Builder - A component library for building filtered reports with export functionality
Maintainers
Readme
Dynamic Report Builder (dyrebu)
A monorepo containing a React/MUI component library for building dynamic filtered reports with Excel/CSV export functionality.
Project Structure
dyrebu/
├── packages/
│ ├── api/ # TypeSpec API definitions & TypeScript types
│ ├── mui/ # React/MUI component library
│ └── mocks/ # MSW mock handlers and data generators
├── app/
│ └── dynamic-report-builder/ # Integration test app
└── functional-requirements.md # Detailed requirements documentGetting Started
Prerequisites
- Node.js >= 18.0.0
- npm >= 9.0.0
Installation
# Install all dependencies
npm installDevelopment
# Build the API types first
npm run build:api
# Build all packages
npm run build
# Start the development app
npm run devThis will start the demo application at http://localhost:3000 with mock data served by MSW.
Packages
@dyrebu/api
TypeSpec definitions for the reporting API. Generates:
- OpenAPI 3.0 specification
- TypeScript types
# Build the API package
npm run build:api@dyrebu/mui
React component library with the following exports:
DynamicReportBuilder- Main componentFilterBuilder- Standalone filter builderDataPreview- Standalone AG Grid previewuseDynamicReport- Hook for managing report state
Peer Dependencies:
- react: ^18.3.1
- @mui/material: ^7.2.0
- ag-grid-community: ^32.0.0
- ag-grid-enterprise: ^32.0.0
@dyrebu/mocks
MSW handlers and mock data for development and testing.
Exports:
handlers- MSW request handlersmockDatasets- Sample dataset definitionsworker(from/browser) - Browser MSW workerserver(from/node) - Node MSW server for testing
API Endpoints
| Method | Endpoint | Description | |--------|----------|-------------| | GET | /reporting/datasets | List available datasets | | GET | /reporting/datasets/{key}/columns | Get column metadata | | POST | /reporting/datasets/{key}/preview | Preview filtered data | | POST | /reporting/datasets/{key}/export | Export to CSV/XLSX |
Usage Example
import { DynamicReportBuilder } from '@dyrebu/mui';
function MyReportPage() {
return (
<DynamicReportBuilder
datasetKey="sales"
exportFormat="xlsx"
onExport={(blob) => console.log('Exported:', blob)}
onFilterChange={(filter) => console.log('Filter:', filter)}
/>
);
}Publishing Packages
This monorepo uses Changesets for version management and publishing to npm.
Quick Start
# Interactive publishing helper
./scripts/publish.sh
# Or use npm scripts:
npm run changeset:add # Record what changed
npm run version # Bump versions
npm run release # Build and publish to npmWorkflow
- Make changes to the packages
- Add a changeset:
npm run changeset:add - Commit the changeset with your changes
- Version packages:
npm run version(bumps versions, updates changelogs) - Publish:
npm run release
See docs/PUBLISHING.md for the full publishing guide.
License
MIT
