@pondasidulu/core
v0.3.0
Published
Pondasi Layer 1: kit-agnostic token governance, lint enforcement, scaffolder CLI, and agent rules template.
Downloads
604
Readme
@pondasidulu/core
Pondasi Layer 1: kit-agnostic token governance, lint enforcement, a scaffolder CLI, and an agent rules template. It is the shared foundation that every Pondasi project (a "Layer 2 consumer") builds on.
What it provides
- Kit-imported tokens — no preset. The agent imports the primary UI kit's default token set into
project.tokens.cssat init and locks kit + version inkit.meta.json. - Lint enforcement — pure functions that flag hard rule violations: arbitrary values, raw UI-kit imports outside
@/ui/*adapters, and new@keyframes. - Scaffolder CLI —
pondasi init,pondasi add-tokens, andpondasi checkto bootstrap and keep a consumer project compliant. - Agent rules template — a generated
AGENTS.mddescribing the governance contract every project follows.
Install
Requires Node.js >= 20.
npm install @pondasidulu/coreUsage
As a module
import { lintSource, checkProject } from '@pondasidulu/core';
const findings = lintSource(sourceText, 'src/Page.tsx');
const report = checkProject('./my-project');Exported values:
lintSource(source, filePath)— returns an array of{ rule, message }findings; empty means compliant.isAdapterFile(filePath)— true when the path is under aui/directory.initProject(dir, { ui, kitVersion, tokens })— imports the kit token set and scaffolds a consumer project. Refuses kits with no clear token set.addTokens(dir, specs)— adds tokens toproject.tokens.css.checkProject(dir)— validates a project: kit lock, referential integrity (every used token defined), no arbitrary values.
As a CLI
# Scaffold a UI-kit adapter into a project (any kit; token set imported)
pondasi init --project <dir> --ui <kit> --tokens-file <file> [--kit-version <v>]
# Add a token
pondasi add-tokens --project <dir> --token <NAME:value>
# Upgrade the kit token set explicitly (never auto-syncs)
pondasi upgrade-kit --project <dir> --kit-version <v> --tokens-file <file>
# Check a project is compliant
pondasi check --project <dir>Governance model
A consumer project must keep one seam: all UI-kit usage goes through @/ui/* adapter files. Pages never import a UI kit directly. Tokens are imported from the primary kit into project.tokens.css (values editable, names migrate explicitly); custom tokens live under --custom-*. New keyframes, tokens, or motion are proposed via an issue before any code.
The full contract is written into each project as AGENTS.md by pondasi init.
Test
npm testLicense
MIT
