@akanjs/cli 2.3.13 → 2.4.0-rc.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.
- package/guidelines/componentRule/componentRule.instruction.md +8 -0
- package/guidelines/cssRule/cssRule.instruction.md +18 -0
- package/guidelines/framework/framework.instruction.md +6 -0
- package/incrementalBuilder.proc.js +926 -329
- package/index.js +961 -362
- package/package.json +2 -2
- package/templates/app/page/styles.css.template +22 -0
- package/templates/facetIndex/index.ts +3 -9
- package/templates/workspaceRoot/biome.json.template +1 -0
|
@@ -15,6 +15,14 @@ Use this for shared UI rules across module, scalar, app UI, and docs components.
|
|
|
15
15
|
- Client components can use store hooks and event handlers where interaction is required.
|
|
16
16
|
- Use generated model types from app client or module constants; do not invent duplicate UI-only model shapes.
|
|
17
17
|
|
|
18
|
+
## Customizing Framework Components (Slot Overrides)
|
|
19
|
+
- When a default `akanjs/ui` component (Button, Select, Modal, Table, Input, Radio, DatePicker, Loading, …) is too restrictive for the design, re-skin it per route with a slot override instead of forking, wrapping every call site, or fighting it with `!important`.
|
|
20
|
+
- Write the drop-in replacement in `apps/<app>/ui/`, typed against the slot contract — `AkanModalComponent`, or `AkanUiOverrides["<Slot>"]` for any other slot — so it is compile-checked as a real substitute. Compose the framework's headless parts (e.g. `Dialog`) rather than re-implementing focus trapping, portals, or scroll-lock.
|
|
21
|
+
- Bind it in a logic-free `page/**/_overrides.tsx` manifest: imports plus a single `export default override({ Slot: BrandComponent })` (from `akanjs/ui`), no `"use client"`.
|
|
22
|
+
- Place the manifest at `page/` for an app-wide skin, or inside a route group/segment to scope it; nested manifests merge over ancestors slot-by-slot (closest ancestor wins, unlisted slots keep inheriting).
|
|
23
|
+
- Compound components expose one slot per leaf named `<Base><Sub>` (e.g. `InputPassword`, `RadioItem`, `LoadingSpin`); override only the leaves you need.
|
|
24
|
+
- See the `references/ui/customize` docs page for the full slot list and examples.
|
|
25
|
+
|
|
18
26
|
## Codegen Rules
|
|
19
27
|
- Do not put business workflow decisions in render code.
|
|
20
28
|
- Do not use undocumented UI components or props.
|
|
@@ -15,6 +15,24 @@ Use TailwindCSS and DaisyUI in a theme-safe, composable way for Akan UI and docs
|
|
|
15
15
|
- Use consistent density and spacing within one component family.
|
|
16
16
|
- Keep custom CSS files rare and scoped to cases utilities cannot express cleanly.
|
|
17
17
|
|
|
18
|
+
## Theme Customization (`apps/<app>/page/styles.css`)
|
|
19
|
+
- The app theme is defined in `apps/<app>/page/styles.css` with daisyUI v5 `@plugin "daisyui/theme"` blocks (typically `light` and a `default: true` `dark`).
|
|
20
|
+
- Brand-level customization means tuning the whole theme block, not only the color tokens. A theme that only changes `--color-*` still looks like the default framework skin.
|
|
21
|
+
- Color tokens: `--color-primary`, `--color-secondary`, `--color-accent`, `--color-neutral`, `--color-info`, `--color-success`, `--color-warning`, `--color-error`, `--color-base-100/200/300`, and their `*-content` pairs.
|
|
22
|
+
- Shape and feel tokens (set these too):
|
|
23
|
+
- `--radius-selector` — rounding for checkbox, toggle, badge.
|
|
24
|
+
- `--radius-field` — rounding for button, input, select, tab.
|
|
25
|
+
- `--radius-box` — rounding for card, modal, alert.
|
|
26
|
+
- `--size-selector`, `--size-field` — base scale (density) of selector and field controls.
|
|
27
|
+
- `--border` — component border width (e.g. `1px`, `2px`).
|
|
28
|
+
- `--depth` — `0` flat, `1` adds a subtle 3D lift to components.
|
|
29
|
+
- `--noise` — `0` off, `1` adds a grain texture to surfaces.
|
|
30
|
+
- Keep shape/feel tokens consistent across the light and dark theme blocks unless the design deliberately differs by mode.
|
|
31
|
+
|
|
32
|
+
## When Utilities Are Not Enough
|
|
33
|
+
- Prefer theme tokens and DaisyUI component classes over one-off utility stacks that re-implement a component's look.
|
|
34
|
+
- When a framework `akanjs/ui` component is structurally too restrictive, re-skin it with a `page/**/_overrides.tsx` slot override (see the componentRule guideline), not with `!important` utilities or a fork.
|
|
35
|
+
|
|
18
36
|
## Codegen Rules
|
|
19
37
|
- Do not hardcode hex colors or one-off brand colors unless the existing file already defines that design system.
|
|
20
38
|
- Do not use important flags to fight component composition.
|
|
@@ -22,6 +22,12 @@ Use this as the compact framework context for AI codegen. It should explain how
|
|
|
22
22
|
- Keep business decisions in constant, document, or service; keep API exposure in signal; keep client coordination in store; keep rendering in UI files.
|
|
23
23
|
- Use direct module imports where scanner rules expect them, and avoid inventing new top-level app folders.
|
|
24
24
|
|
|
25
|
+
## Theming And UI Customization
|
|
26
|
+
When a request implies a distinct look and feel, do not stop at colors — customize both the theme and, when needed, the components.
|
|
27
|
+
|
|
28
|
+
- **Theme (`apps/<app>/page/styles.css`).** The app theme is one or more daisyUI v5 `@plugin "daisyui/theme"` blocks. Match the brand by tuning the whole block, not only the `--color-*` tokens: set corner rounding (`--radius-selector`, `--radius-field`, `--radius-box`), control density (`--size-selector`, `--size-field`), outline weight (`--border`), and surface treatment (`--depth`, `--noise`). New workspaces ship these knobs at neutral defaults so they are visible to tune. Fetch `get_guideline` with `cssRule` for the full variable reference before a deep theme pass.
|
|
29
|
+
- **Components (`page/**/_overrides.tsx`).** When a default `akanjs/ui` component (Button, Modal, Table, Input, Select, …) is too restrictive for the design, re-skin it per route instead of forking, wrapping, or fighting it with utility classes. Write a drop-in replacement in `apps/<app>/ui/` typed against the slot contract (`AkanModalComponent`, or `AkanUiOverrides["<Slot>"]`), composing the framework's headless parts, then bind it in a `page/**/_overrides.tsx` manifest with a single `export default override({ Slot: BrandComponent })`. Overrides cascade down the route tree like layouts (closest ancestor wins). Fetch `get_guideline` with `componentRule` and read the `references/ui/customize` docs page for the slot list and patterns.
|
|
30
|
+
|
|
25
31
|
## Review Checklist
|
|
26
32
|
- The instruction points to current docs pages, not removed docs routes.
|
|
27
33
|
- Generated examples use current Akan builder APIs and scanner-friendly filenames.
|