@webwaka/core-dashboard-compiler
v0.1.0
Published
Dashboard Declaration Compiler - Converts authoring declarations to runtime declarations
Downloads
84
Maintainers
Readme
@webwaka/core-dashboard-compiler
Phase 4F-2: Dashboard Declaration Compiler
Pure, deterministic compiler that converts validated authoring dashboard declarations into runtime dashboard declarations.
Purpose
This compiler is a build-time artifact generator, not a runtime component. It bridges the gap between:
- Authoring declarations (Phase 4E-3) - Strict, minimal structure for declaration authoring
- Runtime declarations (Phase 4A) - Full structure required for dashboard resolution
Flow
Authoring Declaration (Phase 4E-3)
↓ validateDashboardDeclaration()
Validated Authoring Declaration
↓ compileDashboardDeclaration() ← THIS PACKAGE
Compiled Runtime Declaration
↓ resolveDashboard() (Phase 4A)
Resolved DashboardInstallation
npm install @webwaka/core-dashboard-compilerUsage
import { compileDashboardDeclaration } from '@webwaka/core-dashboard-compiler';
import { validateDashboardDeclaration } from '@webwaka/core-dashboard-control';
// Step 1: Validate authoring declaration
const authoring = {
id: 'superadmin-dashboard',
version: '1.0.0',
suite: 'superadmin',
sections: [
{ id: 'overview', label: 'Overview', order: 1 }
]
};
const validated = validateDashboardDeclaration(authoring);
// Step 2: Compile to runtime declaration
const compiled = compileDashboardDeclaration(validated);
// Step 3: Use runtime declaration
console.log(compiled.declaration); // Ready for Phase 4A resolution
console.log(compiled.metadata); // Build-time traceability infoCompilation Rules
1. Identity Mapping
authoring.id→declaration.dashboardIdauthoring.id→declaration.label(deterministic transformation)authoring.suite→metadata.suite
2. Runtime Visibility Fields
Runtime declarations include visibility fields that are not present in authoring declarations:
allowedSubjects: [](empty, not inferred)
3. Sections
- Sections compiled 1:1 from authoring to runtime
- Sorted strictly by
orderfield (ascending) - Section IDs preserved (
id→sectionId) - Section requirements copied verbatim
4. Version Handling
authoring.versionpreserved only in metadata- Version does not appear in runtime declaration
Determinism
The compiler is completely deterministic and does NOT use:
- ❌
Date.now() - ❌
Math.random() - ❌ Environment variables
- ❌ Filesystem reads
- ❌ Network calls
License
Proprietary - ChangerPlanet
