@shopkit/cli 0.1.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.
package/README.md ADDED
@@ -0,0 +1,81 @@
1
+ # @shopkit/cli
2
+
3
+ CLI tools for Shopkit storefront development. Provides generators for themes, widgets, and templates, plus validators for structure compliance.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ # In your monorepo
9
+ bun add @shopkit/cli
10
+ ```
11
+
12
+ ## Usage
13
+
14
+ ### Generate Commands (Angular-style)
15
+
16
+ ```bash
17
+ # Generate a new theme
18
+ bun run g theme <name> [--lang=en]
19
+ bun run g theme dawn
20
+ bun run g t "My Store" --lang=hi
21
+
22
+ # Generate a new widget
23
+ bun run g widget <name> [--scope=common]
24
+ bun run g widget HeroBanner
25
+ bun run g w ProductCard --scope=common
26
+
27
+ # Generate a new template
28
+ bun run g template <name> [--theme=<theme>]
29
+ bun run g template cart
30
+ bun run g tp checkout --theme=dawn
31
+ ```
32
+
33
+ ### Validators
34
+
35
+ ```bash
36
+ # Validate widget structures
37
+ bun run validate:widget
38
+ bun run validate:widget --staged-only
39
+
40
+ # Validate template structures
41
+ bun run validate:template
42
+ bun run validate:template --theme=dawn
43
+ ```
44
+
45
+ ### Interactive Mode
46
+
47
+ ```bash
48
+ bun run cli
49
+ ```
50
+
51
+ ## Programmatic Usage
52
+
53
+ ```typescript
54
+ import {
55
+ generateWidget,
56
+ generateTheme,
57
+ generateTemplate,
58
+ validateWidgets,
59
+ validateTemplates,
60
+ } from "@shopkit/cli";
61
+
62
+ // Generate a widget programmatically
63
+ await generateWidget({ name: "HeroBanner", scope: "common" });
64
+
65
+ // Validate widgets
66
+ const { passed, errors } = await runWidgetValidation();
67
+ ```
68
+
69
+ ## Options
70
+
71
+ | Option | Description | Default |
72
+ |--------|-------------|---------|
73
+ | `--lang=<code>` | Default language for theme | `en` |
74
+ | `--scope=<name>` | Widget scope/namespace | `common` |
75
+ | `--theme=<name>` | Theme name for template | - |
76
+ | `--staged-only` | Validate only staged files | `false` |
77
+ | `--skip-generate` | Skip registry generation | `false` |
78
+
79
+ ## License
80
+
81
+ MIT
package/bin/shopkit.js ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Shopkit CLI Executable
5
+ *
6
+ * This is the entry point for the shopkit CLI when installed globally
7
+ * or via npx/bunx.
8
+ */
9
+
10
+ import "../dist/cli.js";