@decantr/cli 1.7.0 → 1.7.4
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/dist/bin.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./chunk-
|
|
3
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-Y5C2O7Z7.js";
|
|
3
|
+
import "./chunk-XKXUVNUQ.js";
|
|
@@ -1147,7 +1147,29 @@ Routes are defined in \`decantr.essence.json\` \u2192 \`blueprint.routes\` and l
|
|
|
1147
1147
|
2. **Shell regions are frames, not surfaces.** Sidebar and header use var(--d-surface) or var(--d-bg) directly. Apply d-surface only to content cards within the body region.
|
|
1148
1148
|
3. **One scroll container per region.** Body has overflow-y-auto. Sidebar nav has its own overflow-y-auto. Never nest additional scrollable wrappers.
|
|
1149
1149
|
4. **d-section spacing is self-contained.** Each d-section owns its padding. The d-section + d-section rule adds a separator. Do NOT add extra margin between adjacent sections.
|
|
1150
|
-
5. **Responsive nav rules.** Hamburger menus appear ONLY below the shell collapse breakpoint. Full nav shows above it
|
|
1150
|
+
5. **Responsive nav rules.** Hamburger menus appear ONLY below the shell collapse breakpoint. Full nav shows above it.
|
|
1151
|
+
|
|
1152
|
+
### Motion Philosophy
|
|
1153
|
+
|
|
1154
|
+
Every interaction should feel responsive and polished. Apply motion by default, not as an afterthought:
|
|
1155
|
+
|
|
1156
|
+
- **Page transitions:** Apply entrance-fade (or the personality entrance animation) to the main content area on route change
|
|
1157
|
+
- **Stagger children:** Lists, grids, and card groups should stagger-animate on mount (50-100ms delay per item)
|
|
1158
|
+
- **Data visualization:** Charts, gauges, progress bars, and counters should animate to their values on mount \u2014 never render static
|
|
1159
|
+
- **Micro-interactions:** All interactive elements (buttons, toggles, cards, nav items) need hover/press transitions. Use the motion tokens (--d-duration-hover, --d-easing) for consistency.
|
|
1160
|
+
- **Scroll reveals:** Sections below the fold should fade-in on scroll intersection (IntersectionObserver, once)
|
|
1161
|
+
- **Reduced motion:** Wrap all animations in \`prefers-reduced-motion\` media query \u2014 skip animation, keep state changes instant
|
|
1162
|
+
|
|
1163
|
+
### Interactivity Philosophy
|
|
1164
|
+
|
|
1165
|
+
Build for wow factor. When a pattern describes a canvas, graph, map, or spatial visualization, implement it as a **fully interactive surface**, not a static illustration:
|
|
1166
|
+
|
|
1167
|
+
- **Drag and drop:** Nodes, cards, and items on spatial canvases should be draggable. Use pointer events with proper grab/grabbing cursors.
|
|
1168
|
+
- **Pan and zoom:** Canvases and large visualizations should support pan (click-drag on background) and zoom (scroll wheel or pinch). Show zoom level indicator.
|
|
1169
|
+
- **Connections:** When nodes exist in a graph/topology view, they should have visible connection lines. Implement click-to-select + click-target for connecting nodes.
|
|
1170
|
+
- **Live state:** Data-driven visualizations should update in real-time with simulated data. Status changes should animate (color transitions, pulse effects).
|
|
1171
|
+
- **Direct manipulation:** Prefer drag-to-reorder over dropdown menus. Prefer inline editing over modal forms. Prefer resize handles over fixed layouts.
|
|
1172
|
+
- **Hover reveals:** Show contextual information (tooltips, expanded cards, action menus) on hover \u2014 don't require clicks to discover functionality.`;
|
|
1151
1173
|
function generateDecantrMdV31(params) {
|
|
1152
1174
|
const template = loadTemplate("DECANTR.md.template");
|
|
1153
1175
|
const body = renderTemplate(template, {
|
|
@@ -1191,6 +1213,29 @@ function generateDecantrMdV31(params) {
|
|
|
1191
1213
|
}
|
|
1192
1214
|
briefLines.push("");
|
|
1193
1215
|
}
|
|
1216
|
+
briefLines.push("## Development Workflow");
|
|
1217
|
+
briefLines.push("");
|
|
1218
|
+
briefLines.push("The essence file (`decantr.essence.json`) is the source of truth for your project's structure. Context files in `.decantr/context/` are derived from it. When you need to add, remove, or modify pages, sections, or features:");
|
|
1219
|
+
briefLines.push("");
|
|
1220
|
+
briefLines.push("**1. Update the essence** (use CLI commands for consistency):");
|
|
1221
|
+
briefLines.push("- `decantr add page {section}/{page} --route /{path}`");
|
|
1222
|
+
briefLines.push("- `decantr add section {archetype}`");
|
|
1223
|
+
briefLines.push("- `decantr add feature {name}` (or `--section {id}` for scoped)");
|
|
1224
|
+
briefLines.push("- `decantr remove page {section}/{page}`");
|
|
1225
|
+
briefLines.push("- `decantr remove section {id}`");
|
|
1226
|
+
briefLines.push("- `decantr remove feature {name}`");
|
|
1227
|
+
briefLines.push("- `decantr theme switch {name}`");
|
|
1228
|
+
briefLines.push("");
|
|
1229
|
+
briefLines.push("**2. Regenerate context:** `decantr refresh`");
|
|
1230
|
+
briefLines.push("");
|
|
1231
|
+
briefLines.push("**3. Read the updated context files**, then build.");
|
|
1232
|
+
briefLines.push("");
|
|
1233
|
+
briefLines.push("**Rules:**");
|
|
1234
|
+
briefLines.push("- Never create page components for routes that don't exist in the essence");
|
|
1235
|
+
briefLines.push("- Never delete pages without removing them from the essence");
|
|
1236
|
+
briefLines.push("- Always refresh after mutations \u2014 stale context files lead to drift");
|
|
1237
|
+
briefLines.push("- If you edit the essence directly, run `decantr refresh` before building");
|
|
1238
|
+
briefLines.push("");
|
|
1194
1239
|
briefLines.push("---");
|
|
1195
1240
|
briefLines.push("");
|
|
1196
1241
|
return briefLines.join("\n") + body;
|
|
@@ -2557,6 +2602,15 @@ function generateScaffoldContext(input) {
|
|
|
2557
2602
|
if (input.voice.metrics_format) lines.push(`**Metrics format:** ${input.voice.metrics_format}`);
|
|
2558
2603
|
lines.push("");
|
|
2559
2604
|
}
|
|
2605
|
+
lines.push("## Development Mode");
|
|
2606
|
+
lines.push("");
|
|
2607
|
+
lines.push("For local development and showcases, wire all zone transitions with mock data:");
|
|
2608
|
+
lines.push("");
|
|
2609
|
+
lines.push("- **Auth bypass:** Auth pages should accept any input and redirect to the primary section's default route");
|
|
2610
|
+
lines.push("- **Route guards:** Check a simple localStorage flag (e.g., `decantr_authenticated`). Login sets it \u2192 redirect to app zone entry. Logout clears it \u2192 redirect to public/gateway zone.");
|
|
2611
|
+
lines.push("- **Mock data on every page:** All pages should render with simulated data on first load \u2014 never show empty states during development");
|
|
2612
|
+
lines.push("- **Zone transitions:** CTA links on marketing pages should route to the gateway (login/register). Successful auth should route to the primary section default page.");
|
|
2613
|
+
lines.push("");
|
|
2560
2614
|
lines.push(topologyMarkdown);
|
|
2561
2615
|
lines.push("");
|
|
2562
2616
|
lines.push("## Sections Overview");
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
scaffoldMinimal,
|
|
10
10
|
scaffoldProject,
|
|
11
11
|
syncRegistry
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-XKXUVNUQ.js";
|
|
13
13
|
|
|
14
14
|
// src/index.ts
|
|
15
15
|
import { readFileSync as readFileSync15, existsSync as existsSync23, readdirSync as readdirSync6 } from "fs";
|
|
@@ -3299,48 +3299,16 @@ function extractPatternName(item) {
|
|
|
3299
3299
|
}
|
|
3300
3300
|
function generateCuratedPrompt(ctx) {
|
|
3301
3301
|
const lines = [];
|
|
3302
|
-
lines.push(
|
|
3302
|
+
lines.push("Build this application using the Decantr design system.");
|
|
3303
3303
|
lines.push("");
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
lines.push(
|
|
3308
|
-
lines.push(`Personality: ${ctx.personality.join(", ")}`);
|
|
3309
|
-
lines.push(`Guard mode: ${ctx.guard}`);
|
|
3310
|
-
lines.push("");
|
|
3311
|
-
lines.push("Pages to build:");
|
|
3312
|
-
for (const page of ctx.pages) {
|
|
3313
|
-
const patternNames = page.layout.map(extractPatternName);
|
|
3314
|
-
const patterns = patternNames.length > 0 ? patternNames.join(", ") : "custom";
|
|
3315
|
-
lines.push(` - ${page.id}: ${page.shell} shell with ${patterns}`);
|
|
3316
|
-
}
|
|
3317
|
-
if (ctx.features.length > 0) {
|
|
3318
|
-
lines.push("");
|
|
3319
|
-
lines.push(`Features: ${ctx.features.join(", ")}`);
|
|
3320
|
-
}
|
|
3304
|
+
lines.push("Read DECANTR.md for the design spec, CSS approach, and guard rules.");
|
|
3305
|
+
lines.push("Read .decantr/context/scaffold.md for the app overview, topology, routes, and voice guidance.");
|
|
3306
|
+
lines.push("Read each .decantr/context/section-*.md file before building that section's pages.");
|
|
3307
|
+
lines.push("Import src/styles/global.css, src/styles/tokens.css, and src/styles/treatments.css.");
|
|
3321
3308
|
lines.push("");
|
|
3322
|
-
lines.push("
|
|
3323
|
-
lines.push("Follow the guard rules and use the patterns from decantr.essence.json.");
|
|
3309
|
+
lines.push("Start with the shell layouts, then build each section's pages.");
|
|
3324
3310
|
return lines.join("\n");
|
|
3325
3311
|
}
|
|
3326
|
-
function boxedPrompt(content, title) {
|
|
3327
|
-
const lines = content.split("\n");
|
|
3328
|
-
const maxLen = Math.max(...lines.map((l) => l.length), title.length + 4);
|
|
3329
|
-
const width = maxLen + 4;
|
|
3330
|
-
const top = `\u250C${"\u2500".repeat(width - 2)}\u2510`;
|
|
3331
|
-
const titleLine = `\u2502 ${BOLD6}${title}${RESET13}${" ".repeat(width - title.length - 4)} \u2502`;
|
|
3332
|
-
const sep2 = `\u251C${"\u2500".repeat(width - 2)}\u2524`;
|
|
3333
|
-
const bottom = `\u2514${"\u2500".repeat(width - 2)}\u2518`;
|
|
3334
|
-
const body = lines.map((line) => {
|
|
3335
|
-
const padding = " ".repeat(width - line.length - 4);
|
|
3336
|
-
return `\u2502 ${line}${padding} \u2502`;
|
|
3337
|
-
}).join("\n");
|
|
3338
|
-
return `${top}
|
|
3339
|
-
${titleLine}
|
|
3340
|
-
${sep2}
|
|
3341
|
-
${body}
|
|
3342
|
-
${bottom}`;
|
|
3343
|
-
}
|
|
3344
3312
|
function getAPIClient() {
|
|
3345
3313
|
return new RegistryAPIClient3({
|
|
3346
3314
|
baseUrl: process.env.DECANTR_API_URL || void 0,
|
|
@@ -3895,7 +3863,13 @@ Validation warnings: ${validation.errors.join(", ")}`));
|
|
|
3895
3863
|
guard: options.guard
|
|
3896
3864
|
};
|
|
3897
3865
|
const curatedPrompt = generateCuratedPrompt(promptCtx);
|
|
3898
|
-
console.log(
|
|
3866
|
+
console.log("");
|
|
3867
|
+
console.log(`${BOLD6}Prompt for your AI assistant:${RESET13}`);
|
|
3868
|
+
console.log(dim3("\u2500".repeat(50)));
|
|
3869
|
+
console.log("");
|
|
3870
|
+
console.log(curatedPrompt);
|
|
3871
|
+
console.log("");
|
|
3872
|
+
console.log(dim3("\u2500".repeat(50)));
|
|
3899
3873
|
console.log("");
|
|
3900
3874
|
if (registrySource === "cache") {
|
|
3901
3875
|
console.log(dim3('Run "decantr sync" when online to get the latest registry content.'));
|
|
@@ -4332,7 +4306,7 @@ async function main() {
|
|
|
4332
4306
|
break;
|
|
4333
4307
|
}
|
|
4334
4308
|
case "upgrade": {
|
|
4335
|
-
const { cmdUpgrade } = await import("./upgrade-
|
|
4309
|
+
const { cmdUpgrade } = await import("./upgrade-GTUGOUSD.js");
|
|
4336
4310
|
const applyFlag = args.includes("--apply");
|
|
4337
4311
|
await cmdUpgrade(process.cwd(), { apply: applyFlag });
|
|
4338
4312
|
break;
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "./chunk-
|
|
2
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-Y5C2O7Z7.js";
|
|
2
|
+
import "./chunk-XKXUVNUQ.js";
|