ghostcn 1.0.3 → 1.2.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.
Files changed (41) hide show
  1. package/README.md +96 -5
  2. package/dist/commands/add.js +41 -36
  3. package/dist/commands/create.d.ts +5 -0
  4. package/dist/commands/create.js +115 -0
  5. package/dist/commands/doctor.d.ts +1 -0
  6. package/dist/commands/doctor.js +7 -0
  7. package/dist/commands/init.js +134 -26
  8. package/dist/commands/pack.d.ts +1 -0
  9. package/dist/commands/pack.js +8 -0
  10. package/dist/index.js +12 -0
  11. package/dist/registry/components/author-card.json +2 -2
  12. package/dist/registry/components/featured-posts.json +27 -0
  13. package/dist/registry/components/member-cta.json +27 -0
  14. package/dist/registry/components/newsletter-form.json +9 -6
  15. package/dist/registry/components/pagination.json +28 -0
  16. package/dist/registry/components/post-card.json +2 -2
  17. package/dist/registry/components/post-header.json +27 -0
  18. package/dist/registry/components/pricing-table.json +5 -5
  19. package/dist/registry/components/site-footer.json +27 -0
  20. package/dist/registry/components/site-header.json +27 -0
  21. package/dist/registry/index.json +61 -1
  22. package/dist/templates/theme-tools.mjs +178 -0
  23. package/dist/utils/component-installer.d.ts +16 -0
  24. package/dist/utils/component-installer.js +60 -0
  25. package/dist/utils/registry.d.ts +1 -0
  26. package/dist/utils/registry.js +42 -19
  27. package/dist/utils/styles.d.ts +3 -0
  28. package/dist/utils/styles.js +20 -0
  29. package/dist/utils/theme-files.d.ts +13 -0
  30. package/dist/utils/theme-files.js +108 -0
  31. package/dist/utils/theme-project.d.ts +29 -0
  32. package/dist/utils/theme-project.js +46 -0
  33. package/dist/utils/theme-scaffold.d.ts +21 -0
  34. package/dist/utils/theme-scaffold.js +313 -0
  35. package/dist/utils/theme-tooling.d.ts +2 -0
  36. package/dist/utils/theme-tooling.js +20 -0
  37. package/dist/utils/theme.d.ts +46 -0
  38. package/dist/utils/theme.js +429 -0
  39. package/package.json +7 -4
  40. package/dist/test/registry.test.d.ts +0 -1
  41. package/dist/test/registry.test.js +0 -62
@@ -0,0 +1,429 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ACCENT_COLORS = exports.BASE_PALETTES = void 0;
4
+ exports.generateThemeCss = generateThemeCss;
5
+ const styles_1 = require("./styles");
6
+ exports.BASE_PALETTES = {
7
+ zinc: {
8
+ light: {
9
+ background: '#ffffff',
10
+ foreground: '#09090b',
11
+ card: '#ffffff',
12
+ cardForeground: '#09090b',
13
+ popover: '#ffffff',
14
+ popoverForeground: '#09090b',
15
+ secondary: '#f4f4f5',
16
+ secondaryForeground: '#18181b',
17
+ muted: '#f4f4f5',
18
+ mutedForeground: '#71717a',
19
+ accent: '#f4f4f5',
20
+ accentForeground: '#18181b',
21
+ destructive: '#ef4444',
22
+ destructiveForeground: '#fafafa',
23
+ border: '#e4e4e7',
24
+ input: '#e4e4e7',
25
+ ring: '#18181b'
26
+ },
27
+ dark: {
28
+ background: '#09090b',
29
+ foreground: '#fafafa',
30
+ card: '#09090b',
31
+ cardForeground: '#fafafa',
32
+ popover: '#09090b',
33
+ popoverForeground: '#fafafa',
34
+ secondary: '#27272a',
35
+ secondaryForeground: '#fafafa',
36
+ muted: '#27272a',
37
+ mutedForeground: '#a1a1aa',
38
+ accent: '#27272a',
39
+ accentForeground: '#fafafa',
40
+ destructive: '#7f1d1d',
41
+ destructiveForeground: '#fafafa',
42
+ border: '#27272a',
43
+ input: '#27272a',
44
+ ring: '#d4d4d8'
45
+ }
46
+ },
47
+ slate: {
48
+ light: {
49
+ background: '#ffffff',
50
+ foreground: '#020817',
51
+ card: '#ffffff',
52
+ cardForeground: '#020817',
53
+ popover: '#ffffff',
54
+ popoverForeground: '#020817',
55
+ secondary: '#f1f5f9',
56
+ secondaryForeground: '#0f172a',
57
+ muted: '#f1f5f9',
58
+ mutedForeground: '#64748b',
59
+ accent: '#f1f5f9',
60
+ accentForeground: '#0f172a',
61
+ destructive: '#ef4444',
62
+ destructiveForeground: '#f8fafc',
63
+ border: '#e2e8f0',
64
+ input: '#e2e8f0',
65
+ ring: '#0f172a'
66
+ },
67
+ dark: {
68
+ background: '#020817',
69
+ foreground: '#f8fafc',
70
+ card: '#020817',
71
+ cardForeground: '#f8fafc',
72
+ popover: '#020817',
73
+ popoverForeground: '#f8fafc',
74
+ secondary: '#1e293b',
75
+ secondaryForeground: '#f8fafc',
76
+ muted: '#1e293b',
77
+ mutedForeground: '#94a3b8',
78
+ accent: '#1e293b',
79
+ accentForeground: '#f8fafc',
80
+ destructive: '#7f1d1d',
81
+ destructiveForeground: '#f8fafc',
82
+ border: '#1e293b',
83
+ input: '#1e293b',
84
+ ring: '#cbd5e1'
85
+ }
86
+ },
87
+ stone: {
88
+ light: {
89
+ background: '#ffffff',
90
+ foreground: '#0c0a09',
91
+ card: '#ffffff',
92
+ cardForeground: '#0c0a09',
93
+ popover: '#ffffff',
94
+ popoverForeground: '#0c0a09',
95
+ secondary: '#f5f5f4',
96
+ secondaryForeground: '#1c1917',
97
+ muted: '#f5f5f4',
98
+ mutedForeground: '#78716c',
99
+ accent: '#f5f5f4',
100
+ accentForeground: '#1c1917',
101
+ destructive: '#ef4444',
102
+ destructiveForeground: '#fafaf9',
103
+ border: '#e7e5e4',
104
+ input: '#e7e5e4',
105
+ ring: '#1c1917'
106
+ },
107
+ dark: {
108
+ background: '#0c0a09',
109
+ foreground: '#fafaf9',
110
+ card: '#0c0a09',
111
+ cardForeground: '#fafaf9',
112
+ popover: '#0c0a09',
113
+ popoverForeground: '#fafaf9',
114
+ secondary: '#292524',
115
+ secondaryForeground: '#fafaf9',
116
+ muted: '#292524',
117
+ mutedForeground: '#a8a29e',
118
+ accent: '#292524',
119
+ accentForeground: '#fafaf9',
120
+ destructive: '#7f1d1d',
121
+ destructiveForeground: '#fafaf9',
122
+ border: '#292524',
123
+ input: '#292524',
124
+ ring: '#d6d3d1'
125
+ }
126
+ },
127
+ gray: {
128
+ light: {
129
+ background: '#ffffff',
130
+ foreground: '#111827',
131
+ card: '#ffffff',
132
+ cardForeground: '#111827',
133
+ popover: '#ffffff',
134
+ popoverForeground: '#111827',
135
+ secondary: '#f3f4f6',
136
+ secondaryForeground: '#1f2937',
137
+ muted: '#f3f4f6',
138
+ mutedForeground: '#6b7280',
139
+ accent: '#f3f4f6',
140
+ accentForeground: '#1f2937',
141
+ destructive: '#ef4444',
142
+ destructiveForeground: '#f9fafb',
143
+ border: '#e5e7eb',
144
+ input: '#e5e7eb',
145
+ ring: '#1f2937'
146
+ },
147
+ dark: {
148
+ background: '#030712',
149
+ foreground: '#f9fafb',
150
+ card: '#030712',
151
+ cardForeground: '#f9fafb',
152
+ popover: '#030712',
153
+ popoverForeground: '#f9fafb',
154
+ secondary: '#1f2937',
155
+ secondaryForeground: '#f9fafb',
156
+ muted: '#1f2937',
157
+ mutedForeground: '#9ca3af',
158
+ accent: '#1f2937',
159
+ accentForeground: '#f9fafb',
160
+ destructive: '#7f1d1d',
161
+ destructiveForeground: '#f9fafb',
162
+ border: '#1f2937',
163
+ input: '#1f2937',
164
+ ring: '#d1d5db'
165
+ }
166
+ },
167
+ neutral: {
168
+ light: {
169
+ background: '#ffffff',
170
+ foreground: '#0a0a0a',
171
+ card: '#ffffff',
172
+ cardForeground: '#0a0a0a',
173
+ popover: '#ffffff',
174
+ popoverForeground: '#0a0a0a',
175
+ secondary: '#f5f5f5',
176
+ secondaryForeground: '#171717',
177
+ muted: '#f5f5f5',
178
+ mutedForeground: '#737373',
179
+ accent: '#f5f5f5',
180
+ accentForeground: '#171717',
181
+ destructive: '#ef4444',
182
+ destructiveForeground: '#fafafa',
183
+ border: '#e5e5e5',
184
+ input: '#e5e5e5',
185
+ ring: '#171717'
186
+ },
187
+ dark: {
188
+ background: '#0a0a0a',
189
+ foreground: '#fafafa',
190
+ card: '#0a0a0a',
191
+ cardForeground: '#fafafa',
192
+ popover: '#0a0a0a',
193
+ popoverForeground: '#fafafa',
194
+ secondary: '#262626',
195
+ secondaryForeground: '#fafafa',
196
+ muted: '#262626',
197
+ mutedForeground: '#a3a3a3',
198
+ accent: '#262626',
199
+ accentForeground: '#fafafa',
200
+ destructive: '#7f1d1d',
201
+ destructiveForeground: '#fafafa',
202
+ border: '#262626',
203
+ input: '#262626',
204
+ ring: '#d4d4d4'
205
+ }
206
+ }
207
+ };
208
+ exports.ACCENT_COLORS = {
209
+ ghost: {
210
+ light: {
211
+ primary: 'var(--ghost-accent-color, #18181b)',
212
+ primaryForeground: '#ffffff',
213
+ ring: 'var(--ghost-accent-color, #18181b)'
214
+ },
215
+ dark: {
216
+ primary: 'var(--ghost-accent-color, #fafafa)',
217
+ primaryForeground: '#09090b',
218
+ ring: 'var(--ghost-accent-color, #d4d4d8)'
219
+ }
220
+ },
221
+ zinc: {
222
+ light: { primary: '#18181b', primaryForeground: '#fafafa', ring: '#18181b' },
223
+ dark: { primary: '#fafafa', primaryForeground: '#18181b', ring: '#d4d4d8' }
224
+ },
225
+ indigo: {
226
+ light: { primary: '#4f46e5', primaryForeground: '#ffffff', ring: '#4f46e5' },
227
+ dark: { primary: '#6366f1', primaryForeground: '#ffffff', ring: '#6366f1' }
228
+ },
229
+ violet: {
230
+ light: { primary: '#7c3aed', primaryForeground: '#ffffff', ring: '#7c3aed' },
231
+ dark: { primary: '#8b5cf6', primaryForeground: '#ffffff', ring: '#8b5cf6' }
232
+ },
233
+ blue: {
234
+ light: { primary: '#2563eb', primaryForeground: '#ffffff', ring: '#2563eb' },
235
+ dark: { primary: '#3b82f6', primaryForeground: '#ffffff', ring: '#3b82f6' }
236
+ },
237
+ emerald: {
238
+ light: { primary: '#059669', primaryForeground: '#ffffff', ring: '#059669' },
239
+ dark: { primary: '#10b981', primaryForeground: '#ffffff', ring: '#10b981' }
240
+ },
241
+ rose: {
242
+ light: { primary: '#e11d48', primaryForeground: '#ffffff', ring: '#e11d48' },
243
+ dark: { primary: '#f43f5e', primaryForeground: '#ffffff', ring: '#f43f5e' }
244
+ },
245
+ orange: {
246
+ light: { primary: '#ea580c', primaryForeground: '#ffffff', ring: '#ea580c' },
247
+ dark: { primary: '#f97316', primaryForeground: '#ffffff', ring: '#f97316' }
248
+ }
249
+ };
250
+ function generateThemeCss(config) {
251
+ const base = exports.BASE_PALETTES[config.baseColor] || exports.BASE_PALETTES.zinc;
252
+ const accent = exports.ACCENT_COLORS[config.accentColor] || exports.ACCENT_COLORS.ghost;
253
+ const radius = config.radius || '0.5rem';
254
+ const darkTokens = `
255
+ color-scheme: dark;
256
+ --background: ${base.dark.background};
257
+ --foreground: ${base.dark.foreground};
258
+ --card: ${base.dark.card};
259
+ --card-foreground: ${base.dark.cardForeground};
260
+ --popover: ${base.dark.popover};
261
+ --popover-foreground: ${base.dark.popoverForeground};
262
+ --primary: ${accent.dark.primary};
263
+ --primary-foreground: ${accent.dark.primaryForeground};
264
+ --secondary: ${base.dark.secondary};
265
+ --secondary-foreground: ${base.dark.secondaryForeground};
266
+ --muted: ${base.dark.muted};
267
+ --muted-foreground: ${base.dark.mutedForeground};
268
+ --accent: ${base.dark.accent};
269
+ --accent-foreground: ${base.dark.accentForeground};
270
+ --destructive: ${base.dark.destructive};
271
+ --destructive-foreground: ${base.dark.destructiveForeground};
272
+ --border: ${base.dark.border};
273
+ --input: ${base.dark.input};
274
+ --ring: ${accent.dark.ring || base.dark.ring};`;
275
+ const css = `/*
276
+ ghostcn Design Tokens & Theming System
277
+ Base: ${config.baseColor} | Accent: ${config.accentColor} | Radius: ${radius} | System: ${config.style}
278
+ */
279
+
280
+ :root {
281
+ color-scheme: light;
282
+ --background: ${base.light.background};
283
+ --foreground: ${base.light.foreground};
284
+ --card: ${base.light.card};
285
+ --card-foreground: ${base.light.cardForeground};
286
+ --popover: ${base.light.popover};
287
+ --popover-foreground: ${base.light.popoverForeground};
288
+ --primary: ${accent.light.primary};
289
+ --primary-foreground: ${accent.light.primaryForeground};
290
+ --secondary: ${base.light.secondary};
291
+ --secondary-foreground: ${base.light.secondaryForeground};
292
+ --muted: ${base.light.muted};
293
+ --muted-foreground: ${base.light.mutedForeground};
294
+ --accent: ${base.light.accent};
295
+ --accent-foreground: ${base.light.accentForeground};
296
+ --destructive: ${base.light.destructive};
297
+ --destructive-foreground: ${base.light.destructiveForeground};
298
+ --border: ${base.light.border};
299
+ --input: ${base.light.input};
300
+ --ring: ${accent.light.ring || base.light.ring};
301
+ --radius: ${radius};
302
+
303
+ /* Ghost Native Compatibility Fallbacks */
304
+ --ghost-card-bg: var(--card);
305
+ --ghost-border: var(--border);
306
+ --ghost-heading-color: var(--foreground);
307
+ --ghost-text-muted: var(--muted-foreground);
308
+ }
309
+
310
+ .dark, .dark-mode, [data-theme="dark"] {${darkTokens}
311
+ }
312
+
313
+ /* Casper and other Ghost themes use .auto-color for OS-level dark mode. */
314
+ @media (prefers-color-scheme: dark) {
315
+ .auto-color {${darkTokens}
316
+ }
317
+ }
318
+
319
+ /* Semantic fallbacks; Tailwind utilities can override these defaults. */
320
+ .bg-background { background-color: var(--background); }
321
+ .text-foreground { color: var(--foreground); }
322
+ .bg-card { background-color: var(--card); }
323
+ .text-card-foreground { color: var(--card-foreground); }
324
+ .bg-popover { background-color: var(--popover); }
325
+ .text-popover-foreground { color: var(--popover-foreground); }
326
+ .bg-primary { background-color: var(--primary); }
327
+ .text-primary-foreground { color: var(--primary-foreground); }
328
+ .bg-secondary { background-color: var(--secondary); }
329
+ .text-secondary-foreground { color: var(--secondary-foreground); }
330
+ .bg-muted { background-color: var(--muted); }
331
+ .text-muted-foreground { color: var(--muted-foreground); }
332
+ .bg-accent { background-color: var(--accent); }
333
+ .text-accent-foreground { color: var(--accent-foreground); }
334
+ .border-border { border-color: var(--border); }
335
+ .border-input { border-color: var(--input); }
336
+ .rounded-ghostcn { border-radius: var(--radius); }
337
+
338
+ /* Shared primitives used by ghostcn components. */
339
+ .ghcn-container {
340
+ box-sizing: border-box;
341
+ width: min(100% - 32px, 1152px);
342
+ margin-inline: auto;
343
+ }
344
+ .ghcn-button,
345
+ .ghcn-icon-button {
346
+ box-sizing: border-box;
347
+ display: inline-flex;
348
+ align-items: center;
349
+ justify-content: center;
350
+ gap: 8px;
351
+ min-height: 40px;
352
+ border: 1px solid transparent;
353
+ border-radius: var(--radius);
354
+ padding: 10px 16px;
355
+ color: var(--primary-foreground);
356
+ background: var(--primary);
357
+ font: inherit;
358
+ font-size: 14px;
359
+ font-weight: 600;
360
+ line-height: 1;
361
+ text-decoration: none;
362
+ cursor: pointer;
363
+ transition: opacity 150ms ease, background-color 150ms ease, border-color 150ms ease;
364
+ }
365
+ .ghcn-button:hover,
366
+ .ghcn-icon-button:hover { opacity: 0.9; }
367
+ .ghcn-button:focus-visible,
368
+ .ghcn-icon-button:focus-visible,
369
+ .ghcn-input:focus-visible {
370
+ outline: 2px solid var(--ring);
371
+ outline-offset: 2px;
372
+ }
373
+ .ghcn-button--outline {
374
+ border-color: var(--border);
375
+ color: var(--foreground);
376
+ background: var(--background);
377
+ }
378
+ .ghcn-button--ghost {
379
+ color: var(--foreground);
380
+ background: transparent;
381
+ }
382
+ .ghcn-icon-button {
383
+ width: 40px;
384
+ padding: 0;
385
+ }
386
+ .ghcn-input {
387
+ box-sizing: border-box;
388
+ min-height: 40px;
389
+ width: 100%;
390
+ border: 1px solid var(--input);
391
+ border-radius: var(--radius);
392
+ padding: 10px 14px;
393
+ color: var(--foreground);
394
+ background: var(--background);
395
+ font: inherit;
396
+ font-size: 14px;
397
+ }
398
+ .ghcn-badge {
399
+ display: inline-flex;
400
+ align-items: center;
401
+ border-radius: 9999px;
402
+ padding: 4px 10px;
403
+ color: var(--primary-foreground);
404
+ background: var(--primary);
405
+ font-size: 12px;
406
+ font-weight: 700;
407
+ line-height: 1;
408
+ }
409
+ .ghcn-avatar {
410
+ display: block;
411
+ width: 40px;
412
+ height: 40px;
413
+ border-radius: 9999px;
414
+ object-fit: cover;
415
+ }
416
+ .ghcn-sr-only {
417
+ position: absolute;
418
+ width: 1px;
419
+ height: 1px;
420
+ padding: 0;
421
+ margin: -1px;
422
+ overflow: hidden;
423
+ clip: rect(0, 0, 0, 0);
424
+ white-space: nowrap;
425
+ border: 0;
426
+ }
427
+ `;
428
+ return (0, styles_1.componentCss)(css, config.style);
429
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ghostcn",
3
- "version": "1.0.3",
3
+ "version": "1.2.0",
4
4
  "description": "The shadcn/ui for Ghost CMS themes - component distribution system",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -10,10 +10,11 @@
10
10
  },
11
11
  "files": [
12
12
  "dist",
13
+ "!dist/test",
13
14
  "README.md"
14
15
  ],
15
16
  "scripts": {
16
- "build": "tsc && node -e \"const fs=require('fs'); const path=require('path'); if(fs.existsSync('../../registry')){fs.cpSync('../../registry', 'dist/registry', {recursive:true});} if(fs.existsSync('../../README.md')){fs.copyFileSync('../../README.md', 'README.md');}\"",
17
+ "build": "tsc && node -e \"const fs=require('fs'); fs.cpSync('templates', 'dist/templates', {recursive:true}); if(fs.existsSync('../../registry')){fs.cpSync('../../registry', 'dist/registry', {recursive:true});} if(fs.existsSync('../../README.md')){fs.copyFileSync('../../README.md', 'README.md');}\"",
17
18
  "prepublishOnly": "npm run build",
18
19
  "start": "ts-node src/index.ts",
19
20
  "dev": "ts-node src/index.ts",
@@ -43,12 +44,14 @@
43
44
  "dependencies": {
44
45
  "chalk": "^4.1.2",
45
46
  "commander": "^12.0.0",
46
- "prompts": "^2.4.2",
47
- "ora": "^5.4.1"
47
+ "ora": "^5.4.1",
48
+ "prompts": "^2.4.2"
48
49
  },
49
50
  "devDependencies": {
51
+ "@tailwindcss/cli": "^4.3.3",
50
52
  "@types/node": "^20.11.24",
51
53
  "@types/prompts": "^2.4.9",
54
+ "handlebars": "^4.7.9",
52
55
  "ts-node": "^10.9.2",
53
56
  "typescript": "^5.3.3"
54
57
  }
@@ -1 +0,0 @@
1
- export {};
@@ -1,62 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const node_test_1 = require("node:test");
7
- const node_assert_1 = __importDefault(require("node:assert"));
8
- const registry_1 = require("../utils/registry");
9
- (0, node_test_1.describe)('Ghost UI Registry Utils', () => {
10
- (0, node_test_1.describe)('sanitizeComponentName', () => {
11
- (0, node_test_1.test)('accepts valid kebab-case names', () => {
12
- node_assert_1.default.strictEqual((0, registry_1.sanitizeComponentName)('newsletter-form'), 'newsletter-form');
13
- node_assert_1.default.strictEqual((0, registry_1.sanitizeComponentName)('pricing-table'), 'pricing-table');
14
- node_assert_1.default.strictEqual((0, registry_1.sanitizeComponentName)('post-card-2'), 'post-card-2');
15
- });
16
- (0, node_test_1.test)('trims whitespace and converts uppercase to lowercase', () => {
17
- node_assert_1.default.strictEqual((0, registry_1.sanitizeComponentName)(' Newsletter-Form '), 'newsletter-form');
18
- });
19
- (0, node_test_1.test)('rejects path traversal and invalid characters', () => {
20
- node_assert_1.default.throws(() => (0, registry_1.sanitizeComponentName)('../secret'), /Invalid component name/);
21
- node_assert_1.default.throws(() => (0, registry_1.sanitizeComponentName)('component/nested'), /Invalid component name/);
22
- node_assert_1.default.throws(() => (0, registry_1.sanitizeComponentName)('name with spaces'), /Invalid component name/);
23
- node_assert_1.default.throws(() => (0, registry_1.sanitizeComponentName)('hello$world'), /Invalid component name/);
24
- });
25
- });
26
- (0, node_test_1.describe)('getRegistryIndex', () => {
27
- (0, node_test_1.test)('returns list of available components', async () => {
28
- const items = await (0, registry_1.getRegistryIndex)();
29
- node_assert_1.default.ok(Array.isArray(items));
30
- node_assert_1.default.ok(items.length >= 4, `Expected at least 4 components, got ${items.length}`);
31
- const names = items.map(i => i.name);
32
- node_assert_1.default.ok(names.includes('newsletter-form'));
33
- node_assert_1.default.ok(names.includes('pricing-table'));
34
- node_assert_1.default.ok(names.includes('author-card'));
35
- node_assert_1.default.ok(names.includes('post-card'));
36
- });
37
- });
38
- (0, node_test_1.describe)('getComponent', () => {
39
- (0, node_test_1.test)('retrieves newsletter-form manifest correctly', async () => {
40
- const manifest = await (0, registry_1.getComponent)('newsletter-form');
41
- node_assert_1.default.ok(manifest !== null);
42
- node_assert_1.default.strictEqual(manifest?.name, 'newsletter-form');
43
- node_assert_1.default.ok(Array.isArray(manifest?.files));
44
- node_assert_1.default.ok(manifest?.files.length >= 2);
45
- const hbs = manifest?.files.find(f => f.type === 'partial');
46
- node_assert_1.default.ok(hbs !== null);
47
- node_assert_1.default.ok(hbs?.content.includes('gh-newsletter-form'));
48
- const css = manifest?.files.find(f => f.type === 'style');
49
- node_assert_1.default.ok(css !== null);
50
- });
51
- (0, node_test_1.test)('retrieves pricing-table manifest correctly', async () => {
52
- const manifest = await (0, registry_1.getComponent)('pricing-table');
53
- node_assert_1.default.ok(manifest !== null);
54
- node_assert_1.default.strictEqual(manifest?.name, 'pricing-table');
55
- node_assert_1.default.ok(manifest?.files.some(f => f.name === 'pricing-table.hbs'));
56
- });
57
- (0, node_test_1.test)('returns null for non-existent component', async () => {
58
- const manifest = await (0, registry_1.getComponent)('non-existent-xyz-123');
59
- node_assert_1.default.strictEqual(manifest, null);
60
- });
61
- });
62
- });