@decantr/cli 1.6.3 → 1.6.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 +2 -2
- package/dist/{chunk-5MKMLONH.js → chunk-AFX57QLI.js} +58 -23
- package/dist/{chunk-HWMN432I.js → chunk-NH3YWDNG.js} +2 -2
- package/dist/index.js +2 -2
- package/dist/{upgrade-3AAWHJGG.js → upgrade-74OUB65K.js} +1 -1
- package/package.json +1 -1
- package/src/templates/task-modify.md.template +3 -4
package/dist/bin.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./chunk-
|
|
3
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-NH3YWDNG.js";
|
|
3
|
+
import "./chunk-AFX57QLI.js";
|
|
@@ -13,6 +13,8 @@ function generateTreatmentCSS(spatialTokens, treatmentOverrides, themeDecorators
|
|
|
13
13
|
lines.push("");
|
|
14
14
|
lines.push("/* \u2500\u2500 Layer 1: Base Treatments \u2500\u2500 */");
|
|
15
15
|
lines.push("");
|
|
16
|
+
const THEME_ONLY_PROPS = /* @__PURE__ */ new Set(["backdrop-filter", "-webkit-backdrop-filter"]);
|
|
17
|
+
const themeOverrideRules = [];
|
|
16
18
|
function emitRule(selector, props) {
|
|
17
19
|
const treatmentName = selector.replace(/^\./, "").replace(/[:[\s].+$/, "");
|
|
18
20
|
const overrides = treatmentOverrides?.[treatmentName];
|
|
@@ -21,8 +23,20 @@ function generateTreatmentCSS(spatialTokens, treatmentOverrides, themeDecorators
|
|
|
21
23
|
merged.set(prop, val);
|
|
22
24
|
}
|
|
23
25
|
if (overrides && selector === `.${treatmentName}`) {
|
|
26
|
+
const themeProps = [];
|
|
24
27
|
for (const [prop, val] of Object.entries(overrides)) {
|
|
25
|
-
|
|
28
|
+
if (THEME_ONLY_PROPS.has(prop)) {
|
|
29
|
+
themeProps.push([prop, val]);
|
|
30
|
+
} else {
|
|
31
|
+
merged.set(prop, val);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (themeProps.length > 0 && themeName) {
|
|
35
|
+
const themeSelector = `[data-theme="${themeName}"] ${selector}`;
|
|
36
|
+
const themeBody = themeProps.map(([p, v]) => ` ${p}: ${v};`).join("\n");
|
|
37
|
+
themeOverrideRules.push(`${themeSelector} {
|
|
38
|
+
${themeBody}
|
|
39
|
+
}`);
|
|
26
40
|
}
|
|
27
41
|
}
|
|
28
42
|
const body = Array.from(merged.entries()).map(([p, v]) => ` ${p}: ${v};`).join("\n");
|
|
@@ -204,13 +218,16 @@ function generateTreatmentCSS(spatialTokens, treatmentOverrides, themeDecorators
|
|
|
204
218
|
["color", "var(--d-text-muted)"],
|
|
205
219
|
["font-family", "var(--d-font-mono, ui-monospace, monospace)"]
|
|
206
220
|
]);
|
|
221
|
+
if (themeOverrideRules.length > 0) {
|
|
222
|
+
lines.push("/* \u2500\u2500 Theme-scoped Treatment Overrides \u2500\u2500 */");
|
|
223
|
+
lines.push("");
|
|
224
|
+
for (const rule of themeOverrideRules) {
|
|
225
|
+
lines.push(rule);
|
|
226
|
+
lines.push("");
|
|
227
|
+
}
|
|
228
|
+
}
|
|
207
229
|
lines.push("/* \u2500\u2500 Keyframes \u2500\u2500 */");
|
|
208
230
|
lines.push("");
|
|
209
|
-
lines.push("@keyframes decantr-fade-in {");
|
|
210
|
-
lines.push(" from { opacity: 0; transform: translateY(4px); }");
|
|
211
|
-
lines.push(" to { opacity: 1; transform: translateY(0); }");
|
|
212
|
-
lines.push("}");
|
|
213
|
-
lines.push("");
|
|
214
231
|
lines.push("@keyframes decantr-pulse {");
|
|
215
232
|
lines.push(" 0%, 100% { opacity: 1; }");
|
|
216
233
|
lines.push(" 50% { opacity: 0.5; }");
|
|
@@ -475,14 +492,15 @@ function generateTopologySection(data, personality) {
|
|
|
475
492
|
lines.push("");
|
|
476
493
|
lines.push("### Zones");
|
|
477
494
|
lines.push("");
|
|
495
|
+
if (personality.length > 0) {
|
|
496
|
+
lines.push(`**Personality:** ${personality.join(", ")}`);
|
|
497
|
+
lines.push("");
|
|
498
|
+
}
|
|
478
499
|
for (const zone of data.zones) {
|
|
479
500
|
const label = ZONE_LABELS[zone.role] || zone.role;
|
|
480
501
|
lines.push(`**${label}** \u2014 ${zone.shell} shell`);
|
|
481
502
|
lines.push(` Archetypes: ${zone.archetypes.join(", ")}`);
|
|
482
503
|
lines.push(` Purpose: ${zone.descriptions.join(" ")}`);
|
|
483
|
-
if (personality.length > 0) {
|
|
484
|
-
lines.push(` Tone: ${personality.join(", ")}`);
|
|
485
|
-
}
|
|
486
504
|
if (zone.features.length > 0) {
|
|
487
505
|
lines.push(` Features: ${zone.features.join(", ")}`);
|
|
488
506
|
}
|
|
@@ -1615,11 +1633,28 @@ async function refreshDerivedFiles(projectRoot, essence, registry, prefetchedThe
|
|
|
1615
1633
|
const contextDir = join(decantrDir, "context");
|
|
1616
1634
|
mkdirSync(contextDir, { recursive: true });
|
|
1617
1635
|
let storedBlueprintId;
|
|
1636
|
+
let storedVoice;
|
|
1618
1637
|
const projectJsonFilePath = join(decantrDir, "project.json");
|
|
1638
|
+
let projectJsonData = {};
|
|
1619
1639
|
if (existsSync(projectJsonFilePath)) {
|
|
1620
1640
|
try {
|
|
1621
|
-
|
|
1622
|
-
if (
|
|
1641
|
+
projectJsonData = JSON.parse(readFileSync(projectJsonFilePath, "utf-8"));
|
|
1642
|
+
if (projectJsonData.blueprintId) storedBlueprintId = projectJsonData.blueprintId;
|
|
1643
|
+
if (projectJsonData.voice) storedVoice = projectJsonData.voice;
|
|
1644
|
+
} catch {
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
if (!storedVoice && storedBlueprintId) {
|
|
1648
|
+
try {
|
|
1649
|
+
const bpResult = await registry.fetchBlueprint(storedBlueprintId);
|
|
1650
|
+
if (bpResult?.data) {
|
|
1651
|
+
const bpData = bpResult.data;
|
|
1652
|
+
if (bpData.voice) {
|
|
1653
|
+
storedVoice = bpData.voice;
|
|
1654
|
+
projectJsonData.voice = bpData.voice;
|
|
1655
|
+
writeFileSync(projectJsonFilePath, JSON.stringify(projectJsonData, null, 2));
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1623
1658
|
} catch {
|
|
1624
1659
|
}
|
|
1625
1660
|
}
|
|
@@ -1886,14 +1921,6 @@ async function refreshDerivedFiles(projectRoot, essence, registry, prefetchedThe
|
|
|
1886
1921
|
writeFileSync(sectionContextPath, contextContent);
|
|
1887
1922
|
contextFiles.push(sectionContextPath);
|
|
1888
1923
|
}
|
|
1889
|
-
let projectVoice;
|
|
1890
|
-
if (existsSync(projectJsonFilePath)) {
|
|
1891
|
-
try {
|
|
1892
|
-
const projData = JSON.parse(readFileSync(projectJsonFilePath, "utf-8"));
|
|
1893
|
-
if (projData.voice) projectVoice = projData.voice;
|
|
1894
|
-
} catch {
|
|
1895
|
-
}
|
|
1896
|
-
}
|
|
1897
1924
|
const routes = blueprint.routes || {};
|
|
1898
1925
|
const scaffoldContent = generateScaffoldContext({
|
|
1899
1926
|
appName: essence.meta.archetype || "Application",
|
|
@@ -1906,7 +1933,7 @@ async function refreshDerivedFiles(projectRoot, essence, registry, prefetchedThe
|
|
|
1906
1933
|
constraints: essence.dna.constraints,
|
|
1907
1934
|
seo: essence.meta.seo,
|
|
1908
1935
|
navigation: essence.meta.navigation,
|
|
1909
|
-
voice:
|
|
1936
|
+
voice: storedVoice
|
|
1910
1937
|
});
|
|
1911
1938
|
const scaffoldMdPath = join(contextDir, "scaffold.md");
|
|
1912
1939
|
writeFileSync(scaffoldMdPath, scaffoldContent);
|
|
@@ -2122,17 +2149,25 @@ function generateSectionContext(input) {
|
|
|
2122
2149
|
"primary-hover": "Hover state for primary elements",
|
|
2123
2150
|
secondary: "Secondary brand color, supporting elements"
|
|
2124
2151
|
};
|
|
2152
|
+
const addedTokens = /* @__PURE__ */ new Set();
|
|
2125
2153
|
if (input.themeData?.palette) {
|
|
2126
2154
|
const modeKey = input.themeMode || "dark";
|
|
2127
2155
|
for (const [name, values] of Object.entries(input.themeData.palette)) {
|
|
2128
|
-
|
|
2129
|
-
|
|
2156
|
+
if (!addedTokens.has(name)) {
|
|
2157
|
+
addedTokens.add(name);
|
|
2158
|
+
const val = values[modeKey] || values.dark || values.light || Object.values(values)[0];
|
|
2159
|
+
lines.push(`| \`--d-${name}\` | \`${val}\` | ${semanticRoles[name] || ""} |`);
|
|
2160
|
+
}
|
|
2130
2161
|
}
|
|
2131
2162
|
}
|
|
2132
|
-
if (input.themeData?.seed?.accent) {
|
|
2163
|
+
if (input.themeData?.seed?.accent && !addedTokens.has("accent")) {
|
|
2164
|
+
addedTokens.add("accent");
|
|
2133
2165
|
lines.push(`| \`--d-accent\` | \`${input.themeData.seed.accent}\` | CTAs, links, active states, glow effects |`);
|
|
2166
|
+
}
|
|
2167
|
+
if (!addedTokens.has("accent-glow")) {
|
|
2134
2168
|
const accentGlowVal = input.themeData?.palette?.["accent-glow"]?.[input.themeMode || "dark"] || input.themeData?.tokens?.base?.["accent-glow"];
|
|
2135
2169
|
if (accentGlowVal) {
|
|
2170
|
+
addedTokens.add("accent-glow");
|
|
2136
2171
|
lines.push(`| \`--d-accent-glow\` | \`${accentGlowVal}\` | Ambient glow effect around accent elements |`);
|
|
2137
2172
|
}
|
|
2138
2173
|
}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
scaffoldMinimal,
|
|
10
10
|
scaffoldProject,
|
|
11
11
|
syncRegistry
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-AFX57QLI.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-74OUB65K.js");
|
|
4336
4336
|
const applyFlag = args.includes("--apply");
|
|
4337
4337
|
await cmdUpgrade(process.cwd(), { apply: applyFlag });
|
|
4338
4338
|
break;
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "./chunk-
|
|
2
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-NH3YWDNG.js";
|
|
2
|
+
import "./chunk-AFX57QLI.js";
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**Enforcement Tier: Strict**
|
|
4
4
|
|
|
5
|
-
You are modifying existing code in a Decantr project. ALL
|
|
5
|
+
You are modifying existing code in a Decantr project. ALL 7 guard rules are enforced exactly.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -16,7 +16,7 @@ You are modifying existing code in a Decantr project. ALL 8 guard rules are enfo
|
|
|
16
16
|
| 4 | DNA | **Theme-mode** | STRICT | ERROR — Code rejected |
|
|
17
17
|
| 5 | Blueprint | **Structure** | STRICT | ERROR — Code rejected |
|
|
18
18
|
| 6 | Blueprint | **Layout** | STRICT | ERROR — Pattern order must match exactly |
|
|
19
|
-
|
|
|
19
|
+
| 7 | Blueprint | **Pattern-exists** | STRICT | ERROR — Code rejected |
|
|
20
20
|
|
|
21
21
|
## Violation Response Protocol
|
|
22
22
|
|
|
@@ -90,9 +90,8 @@ Before writing code:
|
|
|
90
90
|
Before modifying:
|
|
91
91
|
|
|
92
92
|
- [ ] Page exists in essence structure
|
|
93
|
-
- [ ] I know the
|
|
93
|
+
- [ ] I know the layout order for the target page (check `blueprint.pages[]` or `blueprint.sections[]`)
|
|
94
94
|
- [ ] I will use theme: `{{THEME_STYLE}}`
|
|
95
|
-
- [ ] I will use theme: `{{THEME_RECIPE}}`
|
|
96
95
|
- [ ] I will follow density: `{{DENSITY}}`
|
|
97
96
|
|
|
98
97
|
During modification:
|