@decantr/cli 1.0.0-beta.7 → 1.0.0

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.
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ RegistryClient
4
+ } from "./chunk-PWTUBGGJ.js";
5
+ import "./chunk-PDX44BCA.js";
6
+
7
+ // src/commands/upgrade.ts
8
+ import { readFileSync, existsSync } from "fs";
9
+ import { join } from "path";
10
+ var GREEN = "\x1B[32m";
11
+ var YELLOW = "\x1B[33m";
12
+ var RESET = "\x1B[0m";
13
+ var DIM = "\x1B[2m";
14
+ async function cmdUpgrade(projectRoot = process.cwd()) {
15
+ const essencePath = join(projectRoot, "decantr.essence.json");
16
+ if (!existsSync(essencePath)) {
17
+ console.error("No decantr.essence.json found. Run `decantr init` first.");
18
+ process.exitCode = 1;
19
+ return;
20
+ }
21
+ const essence = JSON.parse(readFileSync(essencePath, "utf-8"));
22
+ const client = new RegistryClient({
23
+ cacheDir: join(projectRoot, ".decantr", "cache")
24
+ });
25
+ console.log("Checking for updates...\n");
26
+ const upgrades = [];
27
+ if (essence.theme?.style) {
28
+ const theme = await client.fetchTheme(essence.theme.style);
29
+ if (theme && theme.data.version) {
30
+ const current = essence.theme.version || "0.0.0";
31
+ if (theme.data.version !== current) {
32
+ upgrades.push({
33
+ type: "theme",
34
+ id: essence.theme.style,
35
+ currentVersion: current,
36
+ latestVersion: theme.data.version
37
+ });
38
+ }
39
+ }
40
+ }
41
+ if (essence.blueprint) {
42
+ const blueprint = await client.fetchBlueprint(essence.blueprint);
43
+ if (blueprint && blueprint.data.version) {
44
+ const current = essence.blueprintVersion || "0.0.0";
45
+ if (blueprint.data.version !== current) {
46
+ upgrades.push({
47
+ type: "blueprint",
48
+ id: essence.blueprint,
49
+ currentVersion: current,
50
+ latestVersion: blueprint.data.version
51
+ });
52
+ }
53
+ }
54
+ }
55
+ if (upgrades.length === 0) {
56
+ console.log(`${GREEN}Everything is up to date.${RESET}`);
57
+ return;
58
+ }
59
+ console.log("Available upgrades:\n");
60
+ for (const u of upgrades) {
61
+ console.log(` ${u.type}/${u.id}: ${DIM}${u.currentVersion}${RESET} -> ${GREEN}${u.latestVersion}${RESET}`);
62
+ }
63
+ console.log(`
64
+ ${YELLOW}Run with --apply to apply upgrades.${RESET}`);
65
+ }
66
+ export {
67
+ cmdUpgrade
68
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decantr/cli",
3
- "version": "1.0.0-beta.7",
3
+ "version": "1.0.0",
4
4
  "description": "Decantr CLI — search the registry, validate essence files, and access design intelligence from the terminal",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -15,7 +15,9 @@
15
15
  },
16
16
  "main": "dist/index.js",
17
17
  "files": [
18
- "dist"
18
+ "dist",
19
+ "src/templates",
20
+ "src/bundled"
19
21
  ],
20
22
  "publishConfig": {
21
23
  "access": "public"
@@ -0,0 +1,24 @@
1
+ {
2
+ "id": "default",
3
+ "$schema": "https://decantr.ai/schemas/blueprint.v1.json",
4
+ "version": "1.0.0",
5
+ "decantr_compat": ">=1.0.0",
6
+ "name": "Decantr Default",
7
+ "description": "Minimal starter blueprint for offline scaffolding. Visit decantr.ai/registry for more options.",
8
+ "tags": ["starter", "minimal", "offline"],
9
+ "compose": ["starter"],
10
+ "theme": {
11
+ "style": "default",
12
+ "mode": "system",
13
+ "recipe": null,
14
+ "shape": "rounded"
15
+ },
16
+ "personality": ["clean", "minimal"],
17
+ "features": [],
18
+ "routes": {
19
+ "/": {
20
+ "shell": "default",
21
+ "page": "home"
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "id": "content-section",
3
+ "$schema": "https://decantr.ai/schemas/pattern.v2.json",
4
+ "version": "1.0.0",
5
+ "decantr_compat": ">=1.0.0",
6
+ "name": "Content Section",
7
+ "description": "Generic content section with heading and body.",
8
+ "components": [],
9
+ "default_preset": "standard",
10
+ "presets": {
11
+ "standard": {
12
+ "description": "Centered content with max-width",
13
+ "layout": {
14
+ "layout": "stack",
15
+ "atoms": "_flex _col _gap4 _py8 _px6 _mxauto _maxw[800px]"
16
+ }
17
+ }
18
+ },
19
+ "default_layout": {
20
+ "layout": "stack",
21
+ "atoms": "_flex _col _gap4 _py8 _px6 _mxauto _maxw[800px]",
22
+ "slots": {
23
+ "heading": "Section heading",
24
+ "body": "Section content"
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "id": "footer",
3
+ "$schema": "https://decantr.ai/schemas/pattern.v2.json",
4
+ "version": "1.0.0",
5
+ "decantr_compat": ">=1.0.0",
6
+ "name": "Footer",
7
+ "description": "Page footer with links and copyright.",
8
+ "components": ["Link"],
9
+ "default_preset": "standard",
10
+ "presets": {
11
+ "standard": {
12
+ "description": "Simple footer with links and copyright",
13
+ "layout": {
14
+ "layout": "row",
15
+ "atoms": "_flex _aic _jcsb _px6 _py4 _borderT _fgmuted"
16
+ }
17
+ }
18
+ },
19
+ "default_layout": {
20
+ "layout": "row",
21
+ "atoms": "_flex _aic _jcsb _px6 _py4 _borderT _fgmuted",
22
+ "slots": {
23
+ "links": "Footer links",
24
+ "copyright": "Copyright notice"
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "id": "form-basic",
3
+ "$schema": "https://decantr.ai/schemas/pattern.v2.json",
4
+ "version": "1.0.0",
5
+ "decantr_compat": ">=1.0.0",
6
+ "name": "Basic Form",
7
+ "description": "Simple form with inputs and submit button.",
8
+ "components": ["Input", "Button", "Label"],
9
+ "default_preset": "standard",
10
+ "presets": {
11
+ "standard": {
12
+ "description": "Vertical form with stacked fields",
13
+ "layout": {
14
+ "layout": "stack",
15
+ "atoms": "_flex _col _gap4"
16
+ }
17
+ }
18
+ },
19
+ "default_layout": {
20
+ "layout": "stack",
21
+ "atoms": "_flex _col _gap4",
22
+ "slots": {
23
+ "fields": "Form input fields",
24
+ "actions": "Submit/cancel buttons"
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "id": "hero",
3
+ "$schema": "https://decantr.ai/schemas/pattern.v2.json",
4
+ "version": "1.0.0",
5
+ "decantr_compat": ">=1.0.0",
6
+ "name": "Hero",
7
+ "description": "Landing page hero section with headline, subheadline, and CTA.",
8
+ "components": ["Button"],
9
+ "default_preset": "standard",
10
+ "presets": {
11
+ "standard": {
12
+ "description": "Centered hero with headline and CTA",
13
+ "layout": {
14
+ "layout": "stack",
15
+ "atoms": "_flex _col _aic _tc _py12 _gap6"
16
+ }
17
+ }
18
+ },
19
+ "default_layout": {
20
+ "layout": "stack",
21
+ "atoms": "_flex _col _aic _tc _py12 _gap6",
22
+ "slots": {
23
+ "headline": "Main headline text",
24
+ "subheadline": "Supporting description",
25
+ "cta": "Call-to-action button(s)"
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "id": "nav-header",
3
+ "$schema": "https://decantr.ai/schemas/pattern.v2.json",
4
+ "version": "1.0.0",
5
+ "decantr_compat": ">=1.0.0",
6
+ "name": "Navigation Header",
7
+ "description": "Top navigation bar with logo, links, and actions.",
8
+ "components": ["Button", "Link"],
9
+ "default_preset": "standard",
10
+ "presets": {
11
+ "standard": {
12
+ "description": "Horizontal nav with logo left, links center, actions right",
13
+ "layout": {
14
+ "layout": "row",
15
+ "atoms": "_flex _aic _jcsb _px6 _py3 _borderB"
16
+ }
17
+ }
18
+ },
19
+ "default_layout": {
20
+ "layout": "row",
21
+ "atoms": "_flex _aic _jcsb _px6 _py3 _borderB",
22
+ "slots": {
23
+ "logo": "Brand logo or name",
24
+ "links": "Navigation links",
25
+ "actions": "Action buttons (login, signup)"
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "id": "default",
3
+ "$schema": "https://decantr.ai/schemas/shell.v1.json",
4
+ "version": "1.0.0",
5
+ "name": "Default Shell",
6
+ "description": "Simple top-nav + main content layout.",
7
+ "layout": "stack",
8
+ "atoms": "_flex _col _minh[100vh]",
9
+ "config": {
10
+ "regions": ["header", "body"],
11
+ "header": {
12
+ "height": "auto",
13
+ "sticky": true
14
+ },
15
+ "body": {
16
+ "scroll": true,
17
+ "flex": 1
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "id": "default",
3
+ "$schema": "https://decantr.ai/schemas/theme.v1.json",
4
+ "version": "1.0.0",
5
+ "decantr_compat": ">=1.0.0",
6
+ "name": "Decantr Default",
7
+ "description": "Neutral theme that works in light and dark modes. Clean and professional.",
8
+ "tags": ["neutral", "light", "dark", "minimal"],
9
+ "personality": "clean + minimal + professional",
10
+ "seed": {
11
+ "primary": "#3B82F6",
12
+ "secondary": "#6B7280",
13
+ "accent": "#8B5CF6",
14
+ "background": "#FFFFFF"
15
+ },
16
+ "palette": {
17
+ "background": {
18
+ "light": "#FFFFFF",
19
+ "dark": "#18181B"
20
+ },
21
+ "surface": {
22
+ "light": "#F9FAFB",
23
+ "dark": "#27272A"
24
+ },
25
+ "surface-raised": {
26
+ "light": "#F3F4F6",
27
+ "dark": "#3F3F46"
28
+ },
29
+ "border": {
30
+ "light": "#E5E7EB",
31
+ "dark": "#52525B"
32
+ },
33
+ "text": {
34
+ "light": "#111827",
35
+ "dark": "#FAFAFA"
36
+ },
37
+ "text-muted": {
38
+ "light": "#6B7280",
39
+ "dark": "#A1A1AA"
40
+ },
41
+ "primary": {
42
+ "light": "#3B82F6",
43
+ "dark": "#60A5FA"
44
+ }
45
+ },
46
+ "modes": ["light", "dark", "system"],
47
+ "shapes": ["rounded", "sharp", "pill"]
48
+ }