dekit-cli 0.1.1 → 0.2.1

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.
Files changed (57) hide show
  1. package/README.md +23 -0
  2. package/bin/dekit.js +16 -0
  3. package/bin/dekit.ts +98 -35
  4. package/dist/editor/assets/{index-DK9iczjI.js → index-yt1AtkL3.js} +6 -6
  5. package/dist/editor/index.html +1 -1
  6. package/docs/usage.md +127 -0
  7. package/editor/src/App.tsx +9 -11
  8. package/editor/src/types.ts +1 -0
  9. package/package.json +37 -12
  10. package/src/chrome.test.ts +24 -0
  11. package/src/chrome.ts +37 -0
  12. package/src/cli/add.test.ts +62 -0
  13. package/src/cli/add.ts +104 -0
  14. package/src/cli/init.test.ts +61 -0
  15. package/src/cli/init.ts +46 -0
  16. package/src/cli/ls.test.ts +29 -0
  17. package/src/cli/ls.ts +24 -0
  18. package/src/cli/resolve.test.ts +43 -0
  19. package/src/cli/resolve.ts +92 -0
  20. package/src/cli/screenshot.test.ts +54 -0
  21. package/src/cli/screenshot.ts +154 -0
  22. package/src/cli/usage.ts +8 -0
  23. package/src/devices.ts +23 -0
  24. package/src/injected/inspector.ts +31 -0
  25. package/src/parser.test.ts +6 -6
  26. package/src/parser.ts +2 -2
  27. package/src/ref.test.ts +68 -0
  28. package/src/ref.ts +42 -0
  29. package/src/server.ts +8 -5
  30. package/src/types.ts +13 -0
  31. package/src/vite-plugin-dekit.ts +13 -6
  32. package/templates/components/blank/component.css +3 -0
  33. package/templates/components/blank/component.html +5 -0
  34. package/templates/pages/blank/page.css +3 -0
  35. package/templates/pages/blank/page.html +3 -0
  36. package/templates/pages/form/page.css +88 -0
  37. package/templates/pages/form/page.html +21 -0
  38. package/templates/pages/grid/page.css +84 -0
  39. package/templates/pages/grid/page.html +40 -0
  40. package/templates/pages/hero/page.css +62 -0
  41. package/templates/pages/hero/page.html +10 -0
  42. package/templates/projects/blank/dekit.yaml +9 -0
  43. package/templates/projects/blank/global.css +18 -0
  44. package/templates/projects/blank/pages/home/home.css +3 -0
  45. package/templates/projects/blank/pages/home/home.html +3 -0
  46. package/templates/projects/dashboard/dekit.yaml +9 -0
  47. package/templates/projects/dashboard/global.css +18 -0
  48. package/templates/projects/dashboard/pages/home/home.css +248 -0
  49. package/templates/projects/dashboard/pages/home/home.html +100 -0
  50. package/templates/projects/landing/dekit.yaml +9 -0
  51. package/templates/projects/landing/global.css +18 -0
  52. package/templates/projects/landing/pages/home/home.css +255 -0
  53. package/templates/projects/landing/pages/home/home.html +79 -0
  54. package/templates/projects/mobile/dekit.yaml +9 -0
  55. package/templates/projects/mobile/global.css +20 -0
  56. package/templates/projects/mobile/pages/home/home.css +267 -0
  57. package/templates/projects/mobile/pages/home/home.html +110 -0
@@ -0,0 +1,100 @@
1
+ <div class="app">
2
+ <!-- Sidebar -->
3
+ <aside class="sidebar">
4
+ <div class="sidebar__logo">
5
+ <span class="sidebar__logo-icon">&#9670;</span>
6
+ <span class="sidebar__logo-text">Dashboard</span>
7
+ </div>
8
+ <nav class="sidebar__nav">
9
+ <a href="#" class="nav-item nav-item--active">
10
+ <span class="nav-item__icon">&#9632;</span>
11
+ <span class="nav-item__label">Overview</span>
12
+ </a>
13
+ <a href="#" class="nav-item">
14
+ <span class="nav-item__icon">&#128200;</span>
15
+ <span class="nav-item__label">Analytics</span>
16
+ </a>
17
+ <a href="#" class="nav-item">
18
+ <span class="nav-item__icon">&#128179;</span>
19
+ <span class="nav-item__label">Revenue</span>
20
+ </a>
21
+ <a href="#" class="nav-item">
22
+ <span class="nav-item__icon">&#128101;</span>
23
+ <span class="nav-item__label">Users</span>
24
+ </a>
25
+ <a href="#" class="nav-item">
26
+ <span class="nav-item__icon">&#9881;</span>
27
+ <span class="nav-item__label">Settings</span>
28
+ </a>
29
+ </nav>
30
+ </aside>
31
+
32
+ <!-- Main content -->
33
+ <div class="main">
34
+ <!-- Topbar -->
35
+ <header class="topbar">
36
+ <h1 class="topbar__title">Overview</h1>
37
+ <div class="topbar__actions">
38
+ <button class="topbar__btn">Export</button>
39
+ <div class="topbar__avatar">JD</div>
40
+ </div>
41
+ </header>
42
+
43
+ <!-- Content -->
44
+ <div class="content">
45
+ <!-- Stats Grid -->
46
+ <div class="stats-grid">
47
+ <div class="stat-card">
48
+ <p class="stat-card__label">Total Revenue</p>
49
+ <p class="stat-card__value">$48,295</p>
50
+ <p class="stat-card__change stat-card__change--up">+12.5% this month</p>
51
+ </div>
52
+ <div class="stat-card">
53
+ <p class="stat-card__label">Active Users</p>
54
+ <p class="stat-card__value">3,842</p>
55
+ <p class="stat-card__change stat-card__change--up">+8.1% this month</p>
56
+ </div>
57
+ <div class="stat-card">
58
+ <p class="stat-card__label">New Signups</p>
59
+ <p class="stat-card__value">214</p>
60
+ <p class="stat-card__change stat-card__change--down">-3.2% this month</p>
61
+ </div>
62
+ </div>
63
+
64
+ <!-- Recent Activity -->
65
+ <div class="section-card">
66
+ <h2 class="section-card__title">Recent Activity</h2>
67
+ <table class="activity-table">
68
+ <thead>
69
+ <tr>
70
+ <th>User</th>
71
+ <th>Event</th>
72
+ <th>Date</th>
73
+ <th>Status</th>
74
+ </tr>
75
+ </thead>
76
+ <tbody>
77
+ <tr>
78
+ <td>Alice Johnson</td>
79
+ <td>Signed up</td>
80
+ <td>Jan 12, 2025</td>
81
+ <td><span class="badge badge--green">Active</span></td>
82
+ </tr>
83
+ <tr>
84
+ <td>Bob Smith</td>
85
+ <td>Upgraded plan</td>
86
+ <td>Jan 11, 2025</td>
87
+ <td><span class="badge badge--blue">Pro</span></td>
88
+ </tr>
89
+ <tr>
90
+ <td>Carol White</td>
91
+ <td>Cancelled</td>
92
+ <td>Jan 10, 2025</td>
93
+ <td><span class="badge badge--gray">Inactive</span></td>
94
+ </tr>
95
+ </tbody>
96
+ </table>
97
+ </div>
98
+ </div>
99
+ </div>
100
+ </div>
@@ -0,0 +1,9 @@
1
+ version: 1.0
2
+ global-style: "global.css"
3
+
4
+ components: {}
5
+
6
+ pages:
7
+ home:
8
+ template: "pages/home/home.html"
9
+ style: "pages/home/home.css"
@@ -0,0 +1,18 @@
1
+ :root {
2
+ --color-primary: #2563eb;
3
+ --color-text: #1f2937;
4
+ --color-bg: #ffffff;
5
+ --font-sans: system-ui, -apple-system, sans-serif;
6
+ }
7
+
8
+ * {
9
+ margin: 0;
10
+ padding: 0;
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ body {
15
+ font-family: var(--font-sans);
16
+ color: var(--color-text);
17
+ background: var(--color-bg);
18
+ }
@@ -0,0 +1,255 @@
1
+ /* Hero */
2
+ .hero {
3
+ background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
4
+ padding: 96px 24px;
5
+ text-align: center;
6
+ }
7
+
8
+ .hero__inner {
9
+ max-width: 640px;
10
+ margin: 0 auto;
11
+ }
12
+
13
+ .hero__title {
14
+ font-size: 3rem;
15
+ font-weight: 800;
16
+ line-height: 1.15;
17
+ letter-spacing: -0.02em;
18
+ color: #111827;
19
+ margin-bottom: 20px;
20
+ }
21
+
22
+ .hero__subtitle {
23
+ font-size: 1.125rem;
24
+ color: #6b7280;
25
+ line-height: 1.7;
26
+ margin-bottom: 36px;
27
+ }
28
+
29
+ .hero__actions {
30
+ display: flex;
31
+ gap: 12px;
32
+ justify-content: center;
33
+ flex-wrap: wrap;
34
+ }
35
+
36
+ /* Buttons */
37
+ .btn {
38
+ display: inline-block;
39
+ padding: 12px 28px;
40
+ border-radius: 8px;
41
+ font-size: 0.9375rem;
42
+ font-weight: 600;
43
+ text-decoration: none;
44
+ cursor: pointer;
45
+ transition: opacity 0.15s, transform 0.15s;
46
+ }
47
+
48
+ .btn:hover {
49
+ opacity: 0.88;
50
+ transform: translateY(-1px);
51
+ }
52
+
53
+ .btn--primary {
54
+ background: var(--color-primary);
55
+ color: #ffffff;
56
+ border: 2px solid var(--color-primary);
57
+ }
58
+
59
+ .btn--outline {
60
+ background: transparent;
61
+ color: var(--color-primary);
62
+ border: 2px solid var(--color-primary);
63
+ }
64
+
65
+ .btn--full {
66
+ display: block;
67
+ text-align: center;
68
+ }
69
+
70
+ /* Sections */
71
+ .section-title {
72
+ font-size: 2rem;
73
+ font-weight: 700;
74
+ text-align: center;
75
+ color: #111827;
76
+ margin-bottom: 12px;
77
+ }
78
+
79
+ .section-subtitle {
80
+ font-size: 1rem;
81
+ color: #6b7280;
82
+ text-align: center;
83
+ margin-bottom: 48px;
84
+ }
85
+
86
+ /* Features */
87
+ .features {
88
+ padding: 80px 24px;
89
+ background: #ffffff;
90
+ }
91
+
92
+ .features__inner {
93
+ max-width: 960px;
94
+ margin: 0 auto;
95
+ }
96
+
97
+ .features__grid {
98
+ display: grid;
99
+ grid-template-columns: repeat(3, 1fr);
100
+ gap: 32px;
101
+ }
102
+
103
+ @media (max-width: 768px) {
104
+ .features__grid {
105
+ grid-template-columns: 1fr;
106
+ }
107
+ }
108
+
109
+ .feature-card {
110
+ padding: 32px 24px;
111
+ border: 1px solid #e5e7eb;
112
+ border-radius: 12px;
113
+ background: #f9fafb;
114
+ }
115
+
116
+ .feature-card__icon {
117
+ font-size: 2rem;
118
+ margin-bottom: 16px;
119
+ }
120
+
121
+ .feature-card__title {
122
+ font-size: 1.125rem;
123
+ font-weight: 600;
124
+ color: #111827;
125
+ margin-bottom: 10px;
126
+ }
127
+
128
+ .feature-card__desc {
129
+ font-size: 0.9375rem;
130
+ color: #6b7280;
131
+ line-height: 1.6;
132
+ }
133
+
134
+ /* Pricing */
135
+ .pricing {
136
+ padding: 80px 24px;
137
+ background: #f9fafb;
138
+ }
139
+
140
+ .pricing__inner {
141
+ max-width: 720px;
142
+ margin: 0 auto;
143
+ }
144
+
145
+ .pricing__grid {
146
+ display: grid;
147
+ grid-template-columns: repeat(2, 1fr);
148
+ gap: 24px;
149
+ }
150
+
151
+ @media (max-width: 600px) {
152
+ .pricing__grid {
153
+ grid-template-columns: 1fr;
154
+ }
155
+ }
156
+
157
+ .pricing-card {
158
+ position: relative;
159
+ padding: 36px 28px;
160
+ border: 1px solid #e5e7eb;
161
+ border-radius: 16px;
162
+ background: #ffffff;
163
+ }
164
+
165
+ .pricing-card--featured {
166
+ border-color: var(--color-primary);
167
+ box-shadow: 0 0 0 2px var(--color-primary);
168
+ }
169
+
170
+ .pricing-card__badge {
171
+ position: absolute;
172
+ top: -14px;
173
+ left: 50%;
174
+ transform: translateX(-50%);
175
+ background: var(--color-primary);
176
+ color: #ffffff;
177
+ font-size: 0.75rem;
178
+ font-weight: 700;
179
+ padding: 4px 14px;
180
+ border-radius: 99px;
181
+ white-space: nowrap;
182
+ }
183
+
184
+ .pricing-card__header {
185
+ margin-bottom: 24px;
186
+ }
187
+
188
+ .pricing-card__plan {
189
+ font-size: 1.125rem;
190
+ font-weight: 700;
191
+ color: #111827;
192
+ margin-bottom: 8px;
193
+ }
194
+
195
+ .pricing-card__price {
196
+ display: flex;
197
+ align-items: baseline;
198
+ gap: 4px;
199
+ }
200
+
201
+ .pricing-card__amount {
202
+ font-size: 2.5rem;
203
+ font-weight: 800;
204
+ color: #111827;
205
+ }
206
+
207
+ .pricing-card__period {
208
+ font-size: 0.9375rem;
209
+ color: #9ca3af;
210
+ }
211
+
212
+ .pricing-card__features {
213
+ list-style: none;
214
+ margin-bottom: 28px;
215
+ }
216
+
217
+ .pricing-card__features li {
218
+ padding: 8px 0;
219
+ font-size: 0.9375rem;
220
+ color: #374151;
221
+ border-bottom: 1px solid #f3f4f6;
222
+ }
223
+
224
+ .pricing-card__features li::before {
225
+ content: "✓ ";
226
+ color: var(--color-primary);
227
+ font-weight: 700;
228
+ }
229
+
230
+ /* Footer */
231
+ .footer {
232
+ padding: 40px 24px;
233
+ background: #111827;
234
+ color: #9ca3af;
235
+ }
236
+
237
+ .footer__inner {
238
+ max-width: 960px;
239
+ margin: 0 auto;
240
+ display: flex;
241
+ justify-content: space-between;
242
+ align-items: center;
243
+ flex-wrap: wrap;
244
+ gap: 12px;
245
+ }
246
+
247
+ .footer__brand {
248
+ font-size: 1.25rem;
249
+ font-weight: 800;
250
+ color: #ffffff;
251
+ }
252
+
253
+ .footer__copy {
254
+ font-size: 0.875rem;
255
+ }
@@ -0,0 +1,79 @@
1
+ <!-- Hero Section -->
2
+ <section class="hero">
3
+ <div class="hero__inner">
4
+ <h1 class="hero__title">Build something amazing</h1>
5
+ <p class="hero__subtitle">The fastest way to design, preview, and ship beautiful interfaces with clean HTML and CSS.</p>
6
+ <div class="hero__actions">
7
+ <a href="#" class="btn btn--primary">Get Started</a>
8
+ <a href="#" class="btn btn--outline">Learn More</a>
9
+ </div>
10
+ </div>
11
+ </section>
12
+
13
+ <!-- Features Section -->
14
+ <section class="features">
15
+ <div class="features__inner">
16
+ <h2 class="section-title">Everything you need</h2>
17
+ <p class="section-subtitle">A complete toolkit for modern interface development.</p>
18
+ <div class="features__grid">
19
+ <div class="feature-card">
20
+ <div class="feature-card__icon">&#9881;</div>
21
+ <h3 class="feature-card__title">Fast Setup</h3>
22
+ <p class="feature-card__desc">Get running in seconds with a single CLI command. No complex configuration required.</p>
23
+ </div>
24
+ <div class="feature-card">
25
+ <div class="feature-card__icon">&#10024;</div>
26
+ <h3 class="feature-card__title">Live Preview</h3>
27
+ <p class="feature-card__desc">See your changes instantly in the browser as you edit your HTML and CSS files.</p>
28
+ </div>
29
+ <div class="feature-card">
30
+ <div class="feature-card__icon">&#128196;</div>
31
+ <h3 class="feature-card__title">Clean Output</h3>
32
+ <p class="feature-card__desc">Pure HTML and CSS — no framework lock-in, no build step needed for your designs.</p>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </section>
37
+
38
+ <!-- Pricing Section -->
39
+ <section class="pricing">
40
+ <div class="pricing__inner">
41
+ <h2 class="section-title">Simple pricing</h2>
42
+ <p class="section-subtitle">Start for free, upgrade when you're ready.</p>
43
+ <div class="pricing__grid">
44
+ <div class="pricing-card">
45
+ <div class="pricing-card__header">
46
+ <h3 class="pricing-card__plan">Free</h3>
47
+ <div class="pricing-card__price"><span class="pricing-card__amount">$0</span><span class="pricing-card__period">/month</span></div>
48
+ </div>
49
+ <ul class="pricing-card__features">
50
+ <li>Up to 3 projects</li>
51
+ <li>All page templates</li>
52
+ <li>Community support</li>
53
+ </ul>
54
+ <a href="#" class="btn btn--outline btn--full">Get Started</a>
55
+ </div>
56
+ <div class="pricing-card pricing-card--featured">
57
+ <div class="pricing-card__badge">Most Popular</div>
58
+ <div class="pricing-card__header">
59
+ <h3 class="pricing-card__plan">Pro</h3>
60
+ <div class="pricing-card__price"><span class="pricing-card__amount">$12</span><span class="pricing-card__period">/month</span></div>
61
+ </div>
62
+ <ul class="pricing-card__features">
63
+ <li>Unlimited projects</li>
64
+ <li>Custom components</li>
65
+ <li>Priority support</li>
66
+ </ul>
67
+ <a href="#" class="btn btn--primary btn--full">Start Free Trial</a>
68
+ </div>
69
+ </div>
70
+ </div>
71
+ </section>
72
+
73
+ <!-- Footer -->
74
+ <footer class="footer">
75
+ <div class="footer__inner">
76
+ <p class="footer__brand">dekit</p>
77
+ <p class="footer__copy">&copy; 2025 dekit. All rights reserved.</p>
78
+ </div>
79
+ </footer>
@@ -0,0 +1,9 @@
1
+ version: 1.0
2
+ global-style: "global.css"
3
+
4
+ components: {}
5
+
6
+ pages:
7
+ home:
8
+ template: "pages/home/home.html"
9
+ style: "pages/home/home.css"
@@ -0,0 +1,20 @@
1
+ :root {
2
+ --color-primary: #2563eb;
3
+ --color-text: #1f2937;
4
+ --color-bg: #ffffff;
5
+ --font-sans: system-ui, -apple-system, sans-serif;
6
+ }
7
+
8
+ * {
9
+ margin: 0;
10
+ padding: 0;
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ body {
15
+ font-family: var(--font-sans);
16
+ color: var(--color-text);
17
+ background: var(--color-bg);
18
+ max-width: 430px;
19
+ margin: 0 auto;
20
+ }