@decantr/cli 1.7.22 → 1.7.24
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
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
scaffoldProject,
|
|
15
15
|
syncRegistry,
|
|
16
16
|
writeExecutionPackBundleArtifacts
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-RH6IQ7YX.js";
|
|
18
18
|
import {
|
|
19
19
|
buildGuardRegistryContext,
|
|
20
20
|
scanProjectInteractions
|
|
@@ -2516,7 +2516,7 @@ var reactViteBootstrapAdapter = {
|
|
|
2516
2516
|
react: "^19.0.0",
|
|
2517
2517
|
"react-dom": "^19.0.0",
|
|
2518
2518
|
"react-router-dom": "^7.0.0",
|
|
2519
|
-
"@decantr/css": "^1.0.
|
|
2519
|
+
"@decantr/css": "^1.0.4",
|
|
2520
2520
|
// P0-4: Lucide is the canonical icon library Decantr blueprints
|
|
2521
2521
|
// reference in personality prose ("Lucide icons"). Including it by
|
|
2522
2522
|
// default means cold scaffolds don't have to hand-roll inline SVGs.
|
|
@@ -4013,19 +4013,19 @@ function generateGreenfieldPrompt(ctx) {
|
|
|
4013
4013
|
lines.push("");
|
|
4014
4014
|
lines.push("Read in this order:");
|
|
4015
4015
|
lines.push(
|
|
4016
|
-
|
|
4016
|
+
'1. DECANTR.md for the design spec, "Atoms in 5 minutes" walkthrough, treatment catalog, motion/typography/elevation tables, and the Interaction Requirements canonical-implementation table.'
|
|
4017
4017
|
);
|
|
4018
4018
|
lines.push(
|
|
4019
|
-
|
|
4019
|
+
'2. .decantr/context/scaffold-pack.md \u2014 the canonical compiled contract. Contains the route plan, shell layouts, navigation, AND the project-wide "Required Theme Decorators" table (class | intent | apply-to). This table is the authoritative decorator contract; section packs reference it.'
|
|
4020
4020
|
);
|
|
4021
4021
|
lines.push(
|
|
4022
4022
|
"3. .decantr/context/scaffold.md for the broader app overview, topology, route map, and voice guidance."
|
|
4023
4023
|
);
|
|
4024
4024
|
lines.push(
|
|
4025
|
-
|
|
4025
|
+
'4. Before working on any section, read its matching .decantr/context/section-*-pack.md (compact contract \u2014 pay close attention to the "Section Directives" block; those are non-negotiable execution rules) and then .decantr/context/section-*.md (long-form context with shell internal_layout + slot guidance).'
|
|
4026
4026
|
);
|
|
4027
4027
|
lines.push(
|
|
4028
|
-
|
|
4028
|
+
'5. Before working on any route/page, read its matching .decantr/context/page-*-pack.md file. The "Interactions (MUST implement each)" checklist per pattern is contract \u2014 see the next section.'
|
|
4029
4029
|
);
|
|
4030
4030
|
lines.push("");
|
|
4031
4031
|
lines.push("\u2550\u2550\u2550 INTERACTIONS ARE CONTRACT, NOT GUIDANCE \u2550\u2550\u2550");
|
|
@@ -4063,22 +4063,80 @@ function generateGreenfieldPrompt(ctx) {
|
|
|
4063
4063
|
"`decantr check --strict` FAILS the build when a declared interaction has no matching implementation. The full canonical-implementation table is in DECANTR.md."
|
|
4064
4064
|
);
|
|
4065
4065
|
lines.push("");
|
|
4066
|
+
lines.push("\u2550\u2550\u2550 ATOMS-FIRST FOR LAYOUT \u2014 DO NOT INLINE-STYLE \u2550\u2550\u2550");
|
|
4067
|
+
lines.push("");
|
|
4068
|
+
lines.push(
|
|
4069
|
+
'Decantr ships @decantr/css as a runtime atom system (already in package.json). Use atoms via `css(...)` for ALL layout, spacing, sizing, flex/grid, position, and typography sizing \u2014 wherever you would otherwise reach for `style={{ display: "flex", gap: "1rem", padding: "1rem", ... }}`.'
|
|
4070
|
+
);
|
|
4071
|
+
lines.push("");
|
|
4072
|
+
lines.push("Mandatory translation (NOT optional). USE THESE EXACT ATOM NAMES:");
|
|
4073
|
+
lines.push(
|
|
4074
|
+
' \u274C style={{ display: "flex", gap: "1rem" }} \u2192 \u2705 className={css("_flex _gap4")}'
|
|
4075
|
+
);
|
|
4076
|
+
lines.push(
|
|
4077
|
+
' \u274C style={{ flexDirection: "column", alignItems: "center" }} \u2192 \u2705 className={css("_col _aic")}'
|
|
4078
|
+
);
|
|
4079
|
+
lines.push(
|
|
4080
|
+
' \u274C style={{ justifyContent: "space-between" }} \u2192 \u2705 className={css("_jcsb")}'
|
|
4081
|
+
);
|
|
4082
|
+
lines.push(
|
|
4083
|
+
' \u274C style={{ padding: "1rem 1.5rem" }} \u2192 \u2705 className={css("_py4 _px6")}'
|
|
4084
|
+
);
|
|
4085
|
+
lines.push(
|
|
4086
|
+
' \u274C style={{ gridTemplateColumns: "repeat(3, 1fr)" }} \u2192 \u2705 className={css("_grid _gc3")}'
|
|
4087
|
+
);
|
|
4088
|
+
lines.push(
|
|
4089
|
+
' \u274C style={{ position: "sticky", top: 0 }} \u2192 \u2705 className={css("_sticky _top0")}'
|
|
4090
|
+
);
|
|
4091
|
+
lines.push(
|
|
4092
|
+
' \u274C style={{ width: "100%", maxWidth: "40rem" }} \u2192 \u2705 className={css("_wfull _maxw[40rem]")}'
|
|
4093
|
+
);
|
|
4094
|
+
lines.push(
|
|
4095
|
+
' \u274C style={{ marginInline: "auto" }} \u2192 \u2705 className={css("_mxauto")}'
|
|
4096
|
+
);
|
|
4097
|
+
lines.push(
|
|
4098
|
+
' \u274C style={{ fontSize: "1.5rem" }} \u2192 \u2705 className={css("_text2xl")}'
|
|
4099
|
+
);
|
|
4100
|
+
lines.push("");
|
|
4101
|
+
lines.push(
|
|
4102
|
+
'Atom naming convention: compact prefix-spelling \u2014 `_aic` (align-items:center) not `_items-center`, `_jcsb` (justify-content:space-between) not `_justify-between`, `_wfull` not `_w-full`, `_top0` not `_t0`. The runtime accepts hyphenated Tailwind-style aliases as fallback BUT compact prefix is canonical, shorter, and what every existing scaffold uses. Do not invent your own atom shapes \u2014 if you need an arbitrary value (e.g. `maxWidth: "72rem"`), use the brackets form `_maxw[72rem]`.'
|
|
4103
|
+
);
|
|
4104
|
+
lines.push("");
|
|
4105
|
+
lines.push(
|
|
4106
|
+
'Combine atoms with treatment / decorator strings: `className={css("_flex _col _gap4") + " d-card clean-card"}`.'
|
|
4107
|
+
);
|
|
4108
|
+
lines.push("");
|
|
4109
|
+
lines.push("Inline `style={{...}}` is ONLY acceptable for:");
|
|
4110
|
+
lines.push(
|
|
4111
|
+
' 1. CSS custom-property writes the contract REQUIRES (`style={{ "--d-stagger-index": i }}`, `style={{ "--lum-card-color": accent }}`, etc.)'
|
|
4112
|
+
);
|
|
4113
|
+
lines.push(
|
|
4114
|
+
" 2. Truly dynamic geometry no atom can express (computed pan/zoom transforms, draggable-node positions calculated from data, real-time gradient hue interpolation)."
|
|
4115
|
+
);
|
|
4116
|
+
lines.push("");
|
|
4117
|
+
lines.push(
|
|
4118
|
+
'If you find yourself writing >5 inline styles in a component for static visual values, STOP and migrate to atoms. The full atom reference is in DECANTR.md ("Atoms in 5 minutes" + "Atom Reference"). `decantr check` flags inline-style attributes as a contract violation.'
|
|
4119
|
+
);
|
|
4120
|
+
lines.push("");
|
|
4066
4121
|
lines.push("\u2550\u2550\u2550 TREATMENT SURFACE \u2014 USE WHAT EXISTS \u2550\u2550\u2550");
|
|
4067
4122
|
lines.push("");
|
|
4068
4123
|
lines.push(
|
|
4069
|
-
"
|
|
4124
|
+
"60+ treatment classes ship in src/styles/treatments.css. Reach for these BEFORE inventing equivalent CSS. Families:"
|
|
4070
4125
|
);
|
|
4071
4126
|
lines.push(
|
|
4072
4127
|
"- Core surfaces: d-interactive (data-variant + data-size), d-surface, d-data + d-data-row/cell/header, d-control, d-section, d-annotation, d-label"
|
|
4073
4128
|
);
|
|
4074
4129
|
lines.push(
|
|
4075
|
-
|
|
4130
|
+
'- Common UI: d-link, d-icon-btn (data-size + data-variant), d-nav-link, d-step-chip (data-step-state="pending|active|done"), d-divider-{top,bottom,left,right}'
|
|
4131
|
+
);
|
|
4132
|
+
lines.push(
|
|
4133
|
+
"- Utility primitives (1.7.21): d-tooltip (data-position), d-empty-state, d-breadcrumb + d-breadcrumb-item (data-current) + d-breadcrumb-separator, d-avatar (data-size), d-icon-well (data-size), d-toggle (data-on), d-toc + d-toc-item (data-current), d-popover"
|
|
4076
4134
|
);
|
|
4077
4135
|
lines.push(
|
|
4078
4136
|
'- Spatial / graph: d-agent-node, d-port (data-side, data-active); d-cta-banner; d-interactive[data-variant="dark"]'
|
|
4079
4137
|
);
|
|
4080
4138
|
lines.push(
|
|
4081
|
-
'- Shells: d-shell + data-layout="sidebar-main|centered|top-nav-footer|sidebar-aside"
|
|
4139
|
+
'- Shells (14 layouts shipped): d-shell + data-layout="sidebar-main | centered | top-nav-footer | sidebar-aside | top-nav-main | minimal-header | full-bleed | recipefork-top-nav | canvas-overlay | chat-portal | copilot-overlay | terminal-split | three-column-browser | workspace-aside". Child regions: d-shell-sidebar, d-shell-main, d-shell-aside, d-shell-header, d-shell-body, d-shell-footer, d-shell-centered-card, d-shell-list (three-column-browser), d-shell-copilot (copilot-overlay), d-shell-status-bar + d-shell-hotkey-bar (terminal-split), d-shell-overlay (canvas-overlay, with data-corner). d-shell-mobile-trigger + d-shell-mobile-backdrop close the mobile drawer loop.'
|
|
4082
4140
|
);
|
|
4083
4141
|
lines.push(
|
|
4084
4142
|
'- Modal / palette: d-modal (data-align="top"), d-modal-backdrop, d-modal-panel (data-size="sm|lg"), d-palette + d-palette-input/list/row/section, d-kbd, d-hotkey-indicator'
|
|
@@ -4099,6 +4157,15 @@ function generateGreenfieldPrompt(ctx) {
|
|
|
4099
4157
|
"Token scales are tunable via CSS vars: --d-motion-{instant,fast,base,slow,slower}, --d-text-{xs..6xl}, --d-elevation-{1..5}, --d-tracking-*, --d-leading-*, --d-weight-*. Themes override per-blueprint."
|
|
4100
4158
|
);
|
|
4101
4159
|
lines.push("");
|
|
4160
|
+
lines.push("\u2550\u2550\u2550 THEME DECORATOR CONTRACT \u2014 APPLY OR THE THEME DOES NOT LAND \u2550\u2550\u2550");
|
|
4161
|
+
lines.push("");
|
|
4162
|
+
lines.push(
|
|
4163
|
+
'Each theme ships 5-15 namespaced decorator classes (`clean-card`, `lum-glass`, `carbon-canvas`, `paper-card`, etc.). The full Class | Intent | Apply-to contract for the active theme is in scaffold-pack.md under "Required Theme Decorators". Apply them as additive classes alongside d-* treatments \u2014 that is what makes the theme look like the theme rather than "themed colors only."'
|
|
4164
|
+
);
|
|
4165
|
+
lines.push(
|
|
4166
|
+
'Section packs ship a one-line pointer to the scaffold-pack table; the canonical contract is in scaffold-pack.md (also mirrored in DECANTR.md "Decorator Quick Reference" with intent + apply-to + key CSS).'
|
|
4167
|
+
);
|
|
4168
|
+
lines.push("");
|
|
4102
4169
|
lines.push("\u2550\u2550\u2550 HARD RULES (NON-NEGOTIABLE) \u2550\u2550\u2550");
|
|
4103
4170
|
lines.push("");
|
|
4104
4171
|
lines.push(
|
|
@@ -4110,6 +4177,12 @@ function generateGreenfieldPrompt(ctx) {
|
|
|
4110
4177
|
lines.push(
|
|
4111
4178
|
"- Use lucide-react for ALL iconography (already in package.json). Pick semantic icons (Bot, Activity, Database, Search) over generic ones. Do NOT inline SVGs for icons that have Lucide equivalents."
|
|
4112
4179
|
);
|
|
4180
|
+
lines.push(
|
|
4181
|
+
"- Section Directives (when present in section-*-pack.md) are non-negotiable execution rules. They define layout proportions, treatment stacks (e.g., card-grid uses d-card + d-elevate[1] + d-lift-hover + theme card decorator + d-stagger-children), copy conventions, and pattern-fitness rules per section. Honor them exactly \u2014 they encode product-quality decisions the registry author made for this archetype."
|
|
4182
|
+
);
|
|
4183
|
+
lines.push(
|
|
4184
|
+
"- Filter chip rows / tab strips MUST use d-step-chip with data-step-state, NOT bare d-interactive. d-step-chip ships proper active-fill, hover-tint, and chip-row sizing. Bare buttons make filter rows look like generic SaaS form controls."
|
|
4185
|
+
);
|
|
4113
4186
|
lines.push("");
|
|
4114
4187
|
lines.push("\u2550\u2550\u2550 IMPLEMENTATION RULES \u2550\u2550\u2550");
|
|
4115
4188
|
lines.push(
|
|
@@ -4153,7 +4226,7 @@ function generateGreenfieldPrompt(ctx) {
|
|
|
4153
4226
|
lines.push("- Build the shell and shared layout first.");
|
|
4154
4227
|
lines.push("- Then implement each section's pages using the matching section and page packs.");
|
|
4155
4228
|
lines.push(
|
|
4156
|
-
"- After implementation, run `decantr check
|
|
4229
|
+
"- After implementation, run `decantr check` (primary gate \u2014 8 guard rules including the experiential interactions guard). It fails strict-mode builds when declared interactions[] are not implemented; the suggestions point at the canonical implementation. Run `decantr audit` (supplementary \u2014 surfaces inline-style counts, security hygiene findings, accessibility / auth-flow advisories) for deeper diagnostics."
|
|
4157
4230
|
);
|
|
4158
4231
|
lines.push("- Fix all violations until `decantr check` exits 0.");
|
|
4159
4232
|
lines.push(
|
|
@@ -5942,7 +6015,7 @@ async function main() {
|
|
|
5942
6015
|
break;
|
|
5943
6016
|
}
|
|
5944
6017
|
case "upgrade": {
|
|
5945
|
-
const { cmdUpgrade } = await import("./upgrade-
|
|
6018
|
+
const { cmdUpgrade } = await import("./upgrade-7LHT3S7E.js");
|
|
5946
6019
|
const applyFlag = args.includes("--apply");
|
|
5947
6020
|
await cmdUpgrade(process.cwd(), { apply: applyFlag });
|
|
5948
6021
|
break;
|
|
@@ -2889,12 +2889,15 @@ import './styles/global.css'; // Resets
|
|
|
2889
2889
|
| \u274C Inline (DO NOT) | \u2705 Atom (DO) |
|
|
2890
2890
|
|--------------------|------------|
|
|
2891
2891
|
| \`style={{ display: 'flex', gap: '1rem' }}\` | \`className={css('_flex _gap4')}\` |
|
|
2892
|
-
| \`style={{ flexDirection: 'column', alignItems: 'center' }}\` | \`className={css('_col
|
|
2892
|
+
| \`style={{ flexDirection: 'column', alignItems: 'center' }}\` | \`className={css('_col _aic')}\` |
|
|
2893
2893
|
| \`style={{ padding: '1rem 1.5rem' }}\` | \`className={css('_py4 _px6')}\` |
|
|
2894
|
-
| \`style={{ width: '100%', maxWidth: '40rem' }}\` | \`className={css('
|
|
2894
|
+
| \`style={{ width: '100%', maxWidth: '40rem' }}\` | \`className={css('_wfull _maxw[40rem]')}\` |
|
|
2895
2895
|
| \`style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)' }}\` | \`className={css('_grid _gc3')}\` |
|
|
2896
|
-
| \`style={{ position: 'sticky', top: 0 }}\` | \`className={css('_sticky
|
|
2896
|
+
| \`style={{ position: 'sticky', top: 0 }}\` | \`className={css('_sticky _top0')}\` |
|
|
2897
2897
|
| \`style={{ marginInline: 'auto' }}\` | \`className={css('_mxauto')}\` |
|
|
2898
|
+
| \`style={{ fontSize: '1.5rem' }}\` | \`className={css('_text2xl')}\` |
|
|
2899
|
+
|
|
2900
|
+
> **Naming convention:** atoms use compact prefix-spelling (\`_aic\`, \`_jcsb\`, \`_wfull\`, \`_top0\`) \u2014 not Tailwind-style hyphenation. The runtime accepts both (\`_aic\` and \`_items-center\` both resolve to \`align-items:center\`) but compact prefix is canonical and shorter.
|
|
2898
2901
|
|
|
2899
2902
|
**Inline \`style={{ ... }}\` is ONLY acceptable for these cases:**
|
|
2900
2903
|
1. **CSS custom property writes** \u2014 \`style={{ '--d-stagger-index': i }}\` (the contract REQUIRES inline writes for dynamic CSS-var values that loop variables / animation indices feed into).
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./chunk-
|
|
2
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-7H3PAC5Y.js";
|
|
2
|
+
import "./chunk-RH6IQ7YX.js";
|
|
3
3
|
import "./chunk-QRQCPD3C.js";
|