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,3 @@
1
+ .component {
2
+ display: block;
3
+ }
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <div class="component">
3
+ <slot></slot>
4
+ </div>
5
+ </template>
@@ -0,0 +1,3 @@
1
+ .page {
2
+ padding: 48px;
3
+ }
@@ -0,0 +1,3 @@
1
+ <div class="page">
2
+ <h1>__PAGE_NAME__</h1>
3
+ </div>
@@ -0,0 +1,88 @@
1
+ .form-page {
2
+ padding: 64px 24px;
3
+ min-height: 100vh;
4
+ display: flex;
5
+ align-items: flex-start;
6
+ justify-content: center;
7
+ }
8
+
9
+ .form-container {
10
+ width: 100%;
11
+ max-width: 520px;
12
+ }
13
+
14
+ .form-title {
15
+ font-size: 2rem;
16
+ font-weight: 800;
17
+ color: #111827;
18
+ margin-bottom: 10px;
19
+ }
20
+
21
+ .form-description {
22
+ font-size: 1rem;
23
+ color: #6b7280;
24
+ margin-bottom: 36px;
25
+ line-height: 1.6;
26
+ }
27
+
28
+ .form {
29
+ display: flex;
30
+ flex-direction: column;
31
+ gap: 20px;
32
+ }
33
+
34
+ .form-group {
35
+ display: flex;
36
+ flex-direction: column;
37
+ gap: 6px;
38
+ }
39
+
40
+ .form-label {
41
+ font-size: 0.875rem;
42
+ font-weight: 600;
43
+ color: #374151;
44
+ }
45
+
46
+ .form-input,
47
+ .form-textarea {
48
+ padding: 10px 14px;
49
+ font-size: 0.9375rem;
50
+ font-family: inherit;
51
+ color: #111827;
52
+ background: #ffffff;
53
+ border: 1px solid #d1d5db;
54
+ border-radius: 8px;
55
+ outline: none;
56
+ transition: border-color 0.15s, box-shadow 0.15s;
57
+ resize: vertical;
58
+ }
59
+
60
+ .form-input:focus,
61
+ .form-textarea:focus {
62
+ border-color: var(--color-primary, #2563eb);
63
+ box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
64
+ }
65
+
66
+ .form-input::placeholder,
67
+ .form-textarea::placeholder {
68
+ color: #9ca3af;
69
+ }
70
+
71
+ .form-submit {
72
+ padding: 12px 28px;
73
+ font-size: 0.9375rem;
74
+ font-weight: 600;
75
+ font-family: inherit;
76
+ color: #ffffff;
77
+ background: var(--color-primary, #2563eb);
78
+ border: none;
79
+ border-radius: 8px;
80
+ cursor: pointer;
81
+ transition: opacity 0.15s, transform 0.15s;
82
+ align-self: flex-start;
83
+ }
84
+
85
+ .form-submit:hover {
86
+ opacity: 0.88;
87
+ transform: translateY(-1px);
88
+ }
@@ -0,0 +1,21 @@
1
+ <section class="form-page">
2
+ <div class="form-container">
3
+ <h1 class="form-title">Contact Us</h1>
4
+ <p class="form-description">Fill out the form below and we'll get back to you shortly.</p>
5
+ <form class="form">
6
+ <div class="form-group">
7
+ <label class="form-label" for="name">Full Name</label>
8
+ <input class="form-input" type="text" id="name" name="name" placeholder="Jane Doe" />
9
+ </div>
10
+ <div class="form-group">
11
+ <label class="form-label" for="email">Email Address</label>
12
+ <input class="form-input" type="email" id="email" name="email" placeholder="jane@example.com" />
13
+ </div>
14
+ <div class="form-group">
15
+ <label class="form-label" for="message">Message</label>
16
+ <textarea class="form-textarea" id="message" name="message" rows="5" placeholder="Write your message here..."></textarea>
17
+ </div>
18
+ <button class="form-submit" type="submit">Send Message</button>
19
+ </form>
20
+ </div>
21
+ </section>
@@ -0,0 +1,84 @@
1
+ .grid-page {
2
+ padding: 64px 24px;
3
+ max-width: 1100px;
4
+ margin: 0 auto;
5
+ }
6
+
7
+ .grid-page__header {
8
+ text-align: center;
9
+ margin-bottom: 48px;
10
+ }
11
+
12
+ .grid-page__title {
13
+ font-size: 2rem;
14
+ font-weight: 800;
15
+ color: #111827;
16
+ margin-bottom: 12px;
17
+ }
18
+
19
+ .grid-page__subtitle {
20
+ font-size: 1rem;
21
+ color: #6b7280;
22
+ line-height: 1.6;
23
+ }
24
+
25
+ .card-grid {
26
+ display: grid;
27
+ grid-template-columns: repeat(2, 1fr);
28
+ gap: 24px;
29
+ }
30
+
31
+ @media (max-width: 600px) {
32
+ .card-grid {
33
+ grid-template-columns: 1fr;
34
+ }
35
+ }
36
+
37
+ .card {
38
+ border: 1px solid #e5e7eb;
39
+ border-radius: 12px;
40
+ overflow: hidden;
41
+ background: #ffffff;
42
+ transition: box-shadow 0.2s, transform 0.2s;
43
+ }
44
+
45
+ .card:hover {
46
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
47
+ transform: translateY(-2px);
48
+ }
49
+
50
+ .card__image {
51
+ width: 100%;
52
+ height: 180px;
53
+ background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 100%);
54
+ }
55
+
56
+ .card__body {
57
+ padding: 20px 20px 24px;
58
+ }
59
+
60
+ .card__title {
61
+ font-size: 1.0625rem;
62
+ font-weight: 700;
63
+ color: #111827;
64
+ margin-bottom: 10px;
65
+ }
66
+
67
+ .card__desc {
68
+ font-size: 0.9375rem;
69
+ color: #6b7280;
70
+ line-height: 1.6;
71
+ margin-bottom: 16px;
72
+ }
73
+
74
+ .card__link {
75
+ font-size: 0.875rem;
76
+ font-weight: 600;
77
+ color: var(--color-primary, #2563eb);
78
+ text-decoration: none;
79
+ transition: opacity 0.15s;
80
+ }
81
+
82
+ .card__link:hover {
83
+ opacity: 0.75;
84
+ }
@@ -0,0 +1,40 @@
1
+ <section class="grid-page">
2
+ <div class="grid-page__header">
3
+ <h1 class="grid-page__title">Featured Items</h1>
4
+ <p class="grid-page__subtitle">Explore our curated collection of items below.</p>
5
+ </div>
6
+ <div class="card-grid">
7
+ <div class="card">
8
+ <div class="card__image" aria-label="Image placeholder"></div>
9
+ <div class="card__body">
10
+ <h2 class="card__title">Card Title One</h2>
11
+ <p class="card__desc">A short description of this item. Add details to inform the reader about what makes it interesting.</p>
12
+ <a href="#" class="card__link">View Details &rarr;</a>
13
+ </div>
14
+ </div>
15
+ <div class="card">
16
+ <div class="card__image" aria-label="Image placeholder"></div>
17
+ <div class="card__body">
18
+ <h2 class="card__title">Card Title Two</h2>
19
+ <p class="card__desc">A short description of this item. Add details to inform the reader about what makes it interesting.</p>
20
+ <a href="#" class="card__link">View Details &rarr;</a>
21
+ </div>
22
+ </div>
23
+ <div class="card">
24
+ <div class="card__image" aria-label="Image placeholder"></div>
25
+ <div class="card__body">
26
+ <h2 class="card__title">Card Title Three</h2>
27
+ <p class="card__desc">A short description of this item. Add details to inform the reader about what makes it interesting.</p>
28
+ <a href="#" class="card__link">View Details &rarr;</a>
29
+ </div>
30
+ </div>
31
+ <div class="card">
32
+ <div class="card__image" aria-label="Image placeholder"></div>
33
+ <div class="card__body">
34
+ <h2 class="card__title">Card Title Four</h2>
35
+ <p class="card__desc">A short description of this item. Add details to inform the reader about what makes it interesting.</p>
36
+ <a href="#" class="card__link">View Details &rarr;</a>
37
+ </div>
38
+ </div>
39
+ </div>
40
+ </section>
@@ -0,0 +1,62 @@
1
+ .hero {
2
+ padding: 96px 24px;
3
+ background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
4
+ text-align: center;
5
+ }
6
+
7
+ .hero__inner {
8
+ max-width: 600px;
9
+ margin: 0 auto;
10
+ }
11
+
12
+ .hero__title {
13
+ font-size: 2.75rem;
14
+ font-weight: 800;
15
+ line-height: 1.15;
16
+ letter-spacing: -0.02em;
17
+ color: #111827;
18
+ margin-bottom: 20px;
19
+ }
20
+
21
+ .hero__subtitle {
22
+ font-size: 1.125rem;
23
+ color: #6b7280;
24
+ line-height: 1.7;
25
+ margin-bottom: 36px;
26
+ }
27
+
28
+ .hero__actions {
29
+ display: flex;
30
+ gap: 12px;
31
+ justify-content: center;
32
+ flex-wrap: wrap;
33
+ }
34
+
35
+ .btn {
36
+ display: inline-block;
37
+ padding: 12px 28px;
38
+ border-radius: 8px;
39
+ font-size: 0.9375rem;
40
+ font-weight: 600;
41
+ text-decoration: none;
42
+ cursor: pointer;
43
+ transition: opacity 0.15s, transform 0.15s;
44
+ border: 2px solid transparent;
45
+ }
46
+
47
+ .btn:hover {
48
+ opacity: 0.88;
49
+ transform: translateY(-1px);
50
+ }
51
+
52
+ .btn--primary {
53
+ background: var(--color-primary, #2563eb);
54
+ color: #ffffff;
55
+ border-color: var(--color-primary, #2563eb);
56
+ }
57
+
58
+ .btn--outline {
59
+ background: transparent;
60
+ color: var(--color-primary, #2563eb);
61
+ border-color: var(--color-primary, #2563eb);
62
+ }
@@ -0,0 +1,10 @@
1
+ <section class="hero">
2
+ <div class="hero__inner">
3
+ <h1 class="hero__title">Welcome to Your Page</h1>
4
+ <p class="hero__subtitle">Add your subtitle here. Describe what this page is about in a clear, compelling sentence.</p>
5
+ <div class="hero__actions">
6
+ <a href="#" class="btn btn--primary">Get Started</a>
7
+ <a href="#" class="btn btn--outline">Learn More</a>
8
+ </div>
9
+ </div>
10
+ </section>
@@ -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,3 @@
1
+ .page {
2
+ padding: 48px;
3
+ }
@@ -0,0 +1,3 @@
1
+ <div class="page">
2
+ <h1>Home</h1>
3
+ </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,248 @@
1
+ /* App layout */
2
+ .app {
3
+ display: flex;
4
+ height: 100vh;
5
+ overflow: hidden;
6
+ }
7
+
8
+ /* Sidebar */
9
+ .sidebar {
10
+ width: 240px;
11
+ flex-shrink: 0;
12
+ background: #111827;
13
+ display: flex;
14
+ flex-direction: column;
15
+ padding: 24px 16px;
16
+ overflow-y: auto;
17
+ }
18
+
19
+ .sidebar__logo {
20
+ display: flex;
21
+ align-items: center;
22
+ gap: 10px;
23
+ padding: 8px 12px;
24
+ margin-bottom: 32px;
25
+ }
26
+
27
+ .sidebar__logo-icon {
28
+ color: var(--color-primary);
29
+ font-size: 1.25rem;
30
+ }
31
+
32
+ .sidebar__logo-text {
33
+ font-size: 1.125rem;
34
+ font-weight: 700;
35
+ color: #ffffff;
36
+ }
37
+
38
+ .sidebar__nav {
39
+ display: flex;
40
+ flex-direction: column;
41
+ gap: 4px;
42
+ }
43
+
44
+ .nav-item {
45
+ display: flex;
46
+ align-items: center;
47
+ gap: 10px;
48
+ padding: 10px 12px;
49
+ border-radius: 8px;
50
+ text-decoration: none;
51
+ color: #9ca3af;
52
+ font-size: 0.9375rem;
53
+ font-weight: 500;
54
+ transition: background 0.15s, color 0.15s;
55
+ }
56
+
57
+ .nav-item:hover {
58
+ background: #1f2937;
59
+ color: #ffffff;
60
+ }
61
+
62
+ .nav-item--active {
63
+ background: #1d4ed8;
64
+ color: #ffffff;
65
+ }
66
+
67
+ .nav-item__icon {
68
+ font-size: 1rem;
69
+ width: 20px;
70
+ text-align: center;
71
+ }
72
+
73
+ /* Main */
74
+ .main {
75
+ flex: 1;
76
+ display: flex;
77
+ flex-direction: column;
78
+ overflow: hidden;
79
+ background: #f9fafb;
80
+ }
81
+
82
+ /* Topbar */
83
+ .topbar {
84
+ display: flex;
85
+ align-items: center;
86
+ justify-content: space-between;
87
+ padding: 0 32px;
88
+ height: 64px;
89
+ background: #ffffff;
90
+ border-bottom: 1px solid #e5e7eb;
91
+ flex-shrink: 0;
92
+ }
93
+
94
+ .topbar__title {
95
+ font-size: 1.25rem;
96
+ font-weight: 700;
97
+ color: #111827;
98
+ }
99
+
100
+ .topbar__actions {
101
+ display: flex;
102
+ align-items: center;
103
+ gap: 16px;
104
+ }
105
+
106
+ .topbar__btn {
107
+ padding: 8px 18px;
108
+ font-size: 0.875rem;
109
+ font-weight: 600;
110
+ background: #ffffff;
111
+ border: 1px solid #d1d5db;
112
+ border-radius: 8px;
113
+ cursor: pointer;
114
+ color: #374151;
115
+ transition: background 0.15s;
116
+ }
117
+
118
+ .topbar__btn:hover {
119
+ background: #f3f4f6;
120
+ }
121
+
122
+ .topbar__avatar {
123
+ width: 36px;
124
+ height: 36px;
125
+ border-radius: 50%;
126
+ background: var(--color-primary);
127
+ color: #ffffff;
128
+ font-size: 0.8125rem;
129
+ font-weight: 700;
130
+ display: flex;
131
+ align-items: center;
132
+ justify-content: center;
133
+ }
134
+
135
+ /* Content */
136
+ .content {
137
+ flex: 1;
138
+ overflow-y: auto;
139
+ padding: 32px;
140
+ display: flex;
141
+ flex-direction: column;
142
+ gap: 24px;
143
+ }
144
+
145
+ /* Stats Grid */
146
+ .stats-grid {
147
+ display: grid;
148
+ grid-template-columns: repeat(3, 1fr);
149
+ gap: 20px;
150
+ }
151
+
152
+ .stat-card {
153
+ background: #ffffff;
154
+ border: 1px solid #e5e7eb;
155
+ border-radius: 12px;
156
+ padding: 24px;
157
+ }
158
+
159
+ .stat-card__label {
160
+ font-size: 0.875rem;
161
+ color: #6b7280;
162
+ font-weight: 500;
163
+ margin-bottom: 8px;
164
+ }
165
+
166
+ .stat-card__value {
167
+ font-size: 2rem;
168
+ font-weight: 800;
169
+ color: #111827;
170
+ margin-bottom: 8px;
171
+ }
172
+
173
+ .stat-card__change {
174
+ font-size: 0.8125rem;
175
+ font-weight: 500;
176
+ }
177
+
178
+ .stat-card__change--up {
179
+ color: #16a34a;
180
+ }
181
+
182
+ .stat-card__change--down {
183
+ color: #dc2626;
184
+ }
185
+
186
+ /* Section Card */
187
+ .section-card {
188
+ background: #ffffff;
189
+ border: 1px solid #e5e7eb;
190
+ border-radius: 12px;
191
+ padding: 24px;
192
+ }
193
+
194
+ .section-card__title {
195
+ font-size: 1rem;
196
+ font-weight: 700;
197
+ color: #111827;
198
+ margin-bottom: 20px;
199
+ }
200
+
201
+ /* Activity Table */
202
+ .activity-table {
203
+ width: 100%;
204
+ border-collapse: collapse;
205
+ font-size: 0.875rem;
206
+ }
207
+
208
+ .activity-table th {
209
+ text-align: left;
210
+ padding: 8px 12px;
211
+ color: #6b7280;
212
+ font-weight: 600;
213
+ border-bottom: 1px solid #e5e7eb;
214
+ }
215
+
216
+ .activity-table td {
217
+ padding: 12px 12px;
218
+ color: #374151;
219
+ border-bottom: 1px solid #f3f4f6;
220
+ }
221
+
222
+ .activity-table tr:last-child td {
223
+ border-bottom: none;
224
+ }
225
+
226
+ /* Badges */
227
+ .badge {
228
+ display: inline-block;
229
+ padding: 3px 10px;
230
+ border-radius: 99px;
231
+ font-size: 0.75rem;
232
+ font-weight: 600;
233
+ }
234
+
235
+ .badge--green {
236
+ background: #dcfce7;
237
+ color: #16a34a;
238
+ }
239
+
240
+ .badge--blue {
241
+ background: #dbeafe;
242
+ color: #2563eb;
243
+ }
244
+
245
+ .badge--gray {
246
+ background: #f3f4f6;
247
+ color: #6b7280;
248
+ }