@decantr/cli 1.6.4 → 1.6.6
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 +2 -2
- package/dist/{chunk-NH3YWDNG.js → chunk-3ZYYVKWA.js} +2 -2
- package/dist/{chunk-AFX57QLI.js → chunk-XUX3ZLCK.js} +11 -7
- package/dist/index.js +2 -2
- package/dist/{upgrade-74OUB65K.js → upgrade-QPHY2ER6.js} +1 -1
- package/package.json +1 -1
- package/src/templates/task-add-page.md.template +16 -11
package/dist/bin.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./chunk-
|
|
3
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-3ZYYVKWA.js";
|
|
3
|
+
import "./chunk-XUX3ZLCK.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
scaffoldMinimal,
|
|
10
10
|
scaffoldProject,
|
|
11
11
|
syncRegistry
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-XUX3ZLCK.js";
|
|
13
13
|
|
|
14
14
|
// src/index.ts
|
|
15
15
|
import { readFileSync as readFileSync15, existsSync as existsSync23, readdirSync as readdirSync6 } from "fs";
|
|
@@ -4332,7 +4332,7 @@ async function main() {
|
|
|
4332
4332
|
break;
|
|
4333
4333
|
}
|
|
4334
4334
|
case "upgrade": {
|
|
4335
|
-
const { cmdUpgrade } = await import("./upgrade-
|
|
4335
|
+
const { cmdUpgrade } = await import("./upgrade-QPHY2ER6.js");
|
|
4336
4336
|
const applyFlag = args.includes("--apply");
|
|
4337
4337
|
await cmdUpgrade(process.cwd(), { apply: applyFlag });
|
|
4338
4338
|
break;
|
|
@@ -262,7 +262,7 @@ function generatePersonalityCSS(personality, themeData) {
|
|
|
262
262
|
rules.push(`.status-ring[data-status="error"] { border-color: var(--d-error); box-shadow: 0 0 12px color-mix(in srgb, var(--d-error) 25%, transparent); }`);
|
|
263
263
|
rules.push(`.status-ring[data-status="warning"] { border-color: var(--d-warning); }`);
|
|
264
264
|
rules.push(`.status-ring[data-status="idle"] { border-color: var(--d-text-muted); }`);
|
|
265
|
-
rules.push(`.status-ring[data-status="processing"] { border-color: var(--d-primary); }`);
|
|
265
|
+
rules.push(`.status-ring[data-status="processing"] { border-color: var(--d-primary); animation: pulse-ring 2s ease-in-out infinite; }`);
|
|
266
266
|
rules.push(`@keyframes pulse-ring { 0% { opacity: 0.6; transform: scale(1); } 100% { opacity: 0; transform: scale(1.3); } }`);
|
|
267
267
|
rules.push(`.status-ring[data-status="active"]::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--d-success); opacity: 0; animation: pulse-ring 2s ease-out infinite; }`);
|
|
268
268
|
}
|
|
@@ -492,10 +492,6 @@ function generateTopologySection(data, personality) {
|
|
|
492
492
|
lines.push("");
|
|
493
493
|
lines.push("### Zones");
|
|
494
494
|
lines.push("");
|
|
495
|
-
if (personality.length > 0) {
|
|
496
|
-
lines.push(`**Personality:** ${personality.join(", ")}`);
|
|
497
|
-
lines.push("");
|
|
498
|
-
}
|
|
499
495
|
for (const zone of data.zones) {
|
|
500
496
|
const label = ZONE_LABELS[zone.role] || zone.role;
|
|
501
497
|
lines.push(`**${label}** \u2014 ${zone.shell} shell`);
|
|
@@ -1793,6 +1789,9 @@ async function refreshDerivedFiles(projectRoot, essence, registry, prefetchedThe
|
|
|
1793
1789
|
contextFiles.push(summaryPath);
|
|
1794
1790
|
}
|
|
1795
1791
|
if (!options?.isInitialScaffold) {
|
|
1792
|
+
const scaffoldTaskPath = join(contextDir, "task-scaffold.md");
|
|
1793
|
+
writeFileSync(scaffoldTaskPath, generateTaskContextV3("task-scaffold.md.template", essence));
|
|
1794
|
+
contextFiles.push(scaffoldTaskPath);
|
|
1796
1795
|
const addPagePath = join(contextDir, "task-add-page.md");
|
|
1797
1796
|
writeFileSync(addPagePath, generateTaskContextV3("task-add-page.md.template", essence));
|
|
1798
1797
|
contextFiles.push(addPagePath);
|
|
@@ -2147,7 +2146,11 @@ function generateSectionContext(input) {
|
|
|
2147
2146
|
"text-muted": "Secondary text, placeholders, labels",
|
|
2148
2147
|
primary: "Brand color, key interactive, selected states",
|
|
2149
2148
|
"primary-hover": "Hover state for primary elements",
|
|
2150
|
-
secondary: "Secondary brand color, supporting elements"
|
|
2149
|
+
secondary: "Secondary brand color, supporting elements",
|
|
2150
|
+
"accent-glow": "Ambient glow effect for accent-colored elements"
|
|
2151
|
+
};
|
|
2152
|
+
const paletteToTokenName = {
|
|
2153
|
+
"background": "bg"
|
|
2151
2154
|
};
|
|
2152
2155
|
const addedTokens = /* @__PURE__ */ new Set();
|
|
2153
2156
|
if (input.themeData?.palette) {
|
|
@@ -2155,8 +2158,9 @@ function generateSectionContext(input) {
|
|
|
2155
2158
|
for (const [name, values] of Object.entries(input.themeData.palette)) {
|
|
2156
2159
|
if (!addedTokens.has(name)) {
|
|
2157
2160
|
addedTokens.add(name);
|
|
2161
|
+
const tokenName = paletteToTokenName[name] || name;
|
|
2158
2162
|
const val = values[modeKey] || values.dark || values.light || Object.values(values)[0];
|
|
2159
|
-
lines.push(`| \`--d-${
|
|
2163
|
+
lines.push(`| \`--d-${tokenName}\` | \`${val}\` | ${semanticRoles[name] || ""} |`);
|
|
2160
2164
|
}
|
|
2161
2165
|
}
|
|
2162
2166
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "./chunk-
|
|
2
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-3ZYYVKWA.js";
|
|
2
|
+
import "./chunk-XUX3ZLCK.js";
|
package/package.json
CHANGED
|
@@ -16,23 +16,28 @@ You are adding new pages or features to an existing Decantr project. Guided mode
|
|
|
16
16
|
| 4 | DNA | **Theme-mode** | ENFORCED | Theme/mode combination must be compatible |
|
|
17
17
|
| 5 | Blueprint | **Structure** | ENFORCED | Page MUST exist in essence before generating code |
|
|
18
18
|
| 6 | Blueprint | Layout | advisory | Pattern order is flexible |
|
|
19
|
-
|
|
|
19
|
+
| 7 | Blueprint | **Pattern-exists** | ENFORCED | All patterns must exist in the registry |
|
|
20
20
|
|
|
21
21
|
## Before You Start
|
|
22
22
|
|
|
23
23
|
### 1. Update the Essence
|
|
24
24
|
|
|
25
|
-
Before generating code for a new page, add it to the essence:
|
|
25
|
+
Before generating code for a new page, add it to the relevant section in the essence:
|
|
26
26
|
|
|
27
27
|
```json
|
|
28
28
|
{
|
|
29
29
|
"blueprint": {
|
|
30
|
-
"
|
|
31
|
-
"pages": [
|
|
32
|
-
// ... existing pages ...
|
|
30
|
+
"sections": [
|
|
33
31
|
{
|
|
34
|
-
"id": "
|
|
35
|
-
"
|
|
32
|
+
"id": "section-id",
|
|
33
|
+
"shell": "{{DEFAULT_SHELL}}",
|
|
34
|
+
"pages": [
|
|
35
|
+
// ... existing pages ...
|
|
36
|
+
{
|
|
37
|
+
"id": "new-page-id",
|
|
38
|
+
"layout": ["pattern-1", "pattern-2"]
|
|
39
|
+
}
|
|
40
|
+
]
|
|
36
41
|
}
|
|
37
42
|
]
|
|
38
43
|
}
|
|
@@ -55,8 +60,8 @@ Only after the page exists in the essence should you generate code for it.
|
|
|
55
60
|
|
|
56
61
|
Before adding a page:
|
|
57
62
|
|
|
58
|
-
- [ ] The page ID is added to `blueprint.pages[]` in essence
|
|
59
|
-
- [ ] The
|
|
63
|
+
- [ ] The page ID is added to the target `blueprint.sections[].pages[]` in essence
|
|
64
|
+
- [ ] The section has a `shell` defined
|
|
60
65
|
- [ ] The page has a `layout[]` with pattern IDs
|
|
61
66
|
- [ ] Validation passes (`npx @decantr/cli validate`)
|
|
62
67
|
|
|
@@ -64,7 +69,7 @@ During code generation:
|
|
|
64
69
|
|
|
65
70
|
- [ ] Use theme `{{THEME_STYLE}}` for all styling
|
|
66
71
|
- [ ] Use theme `{{THEME_RECIPE}}` decorators for decoration
|
|
67
|
-
- [ ] Follow the shell structure (
|
|
72
|
+
- [ ] Follow the shell structure for the target section (see section context file for shell notes)
|
|
68
73
|
- [ ] Include patterns from the layout array
|
|
69
74
|
|
|
70
75
|
After generation:
|
|
@@ -95,7 +100,7 @@ Please confirm how you'd like to proceed.
|
|
|
95
100
|
When adding features (auth, search, payments, etc.):
|
|
96
101
|
|
|
97
102
|
1. Add the feature to `features[]` in the essence
|
|
98
|
-
2. Update relevant pages in `blueprint.pages[]`
|
|
103
|
+
2. Update relevant pages in `blueprint.sections[].pages[]`
|
|
99
104
|
3. Then implement the feature
|
|
100
105
|
|
|
101
106
|
## Pattern Selection
|