idcmd 0.0.1 → 0.0.2

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 (89) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +96 -2
  3. package/package.json +52 -6
  4. package/public/_idcmd/live-reload.js +18 -0
  5. package/public/_idcmd/llm-menu.js +153 -0
  6. package/public/_idcmd/nav-prefetch.js +30 -0
  7. package/public/_idcmd/right-rail-scrollspy.js +262 -0
  8. package/public/anthropic-black.svg +16 -0
  9. package/public/anthropic-white.svg +16 -0
  10. package/public/favicon.svg +13 -0
  11. package/public/live-reload.js +18 -0
  12. package/public/llm-menu.js +153 -0
  13. package/public/openai-black.svg +15 -0
  14. package/public/openai-white.svg +15 -0
  15. package/public/right-rail-scrollspy.js +262 -0
  16. package/src/build.ts +230 -0
  17. package/src/cli/args.ts +101 -0
  18. package/src/cli/commands/build.ts +43 -0
  19. package/src/cli/commands/deploy.ts +82 -0
  20. package/src/cli/commands/dev.ts +79 -0
  21. package/src/cli/commands/init.ts +211 -0
  22. package/src/cli/commands/preview.ts +57 -0
  23. package/src/cli/fs.ts +47 -0
  24. package/src/cli/main.ts +120 -0
  25. package/src/cli/normalize.ts +26 -0
  26. package/src/cli/path.ts +30 -0
  27. package/src/cli/prompt.ts +74 -0
  28. package/src/cli/run.ts +17 -0
  29. package/src/cli/version.ts +12 -0
  30. package/src/cli.ts +6 -0
  31. package/src/client/index.ts +7 -0
  32. package/src/content/components/expand.ts +351 -0
  33. package/src/content/components/install-tabs.ts +120 -0
  34. package/src/content/components/registry.ts +12 -0
  35. package/src/content/components/types.ts +21 -0
  36. package/src/content/frontmatter.ts +89 -0
  37. package/src/content/icons.ts +78 -0
  38. package/src/content/llms.ts +94 -0
  39. package/src/content/meta.ts +92 -0
  40. package/src/content/navigation.ts +156 -0
  41. package/src/content/paths.ts +34 -0
  42. package/src/content/store.ts +10 -0
  43. package/src/project/paths.ts +86 -0
  44. package/src/render/layout-loader.ts +46 -0
  45. package/src/render/layout.tsx +340 -0
  46. package/src/render/markdown.ts +14 -0
  47. package/src/render/page-renderer.ts +321 -0
  48. package/src/render/right-rail.tsx +250 -0
  49. package/src/render/toc.ts +66 -0
  50. package/src/search/api.ts +76 -0
  51. package/src/search/contract.ts +44 -0
  52. package/src/search/index.ts +265 -0
  53. package/src/search/page.tsx +96 -0
  54. package/src/search/server-page.ts +99 -0
  55. package/src/seo/files.ts +124 -0
  56. package/src/seo/server.ts +103 -0
  57. package/src/server/headers.ts +10 -0
  58. package/src/server/live-reload.ts +121 -0
  59. package/src/server/static.ts +59 -0
  60. package/src/server/user-routes.ts +209 -0
  61. package/src/server.ts +234 -0
  62. package/src/site/config.ts +244 -0
  63. package/src/site/url-policy.ts +60 -0
  64. package/src/site/urls.ts +46 -0
  65. package/templates/default/README.md +26 -0
  66. package/templates/default/package.json +29 -0
  67. package/templates/default/site/client/layout.tsx +2 -0
  68. package/templates/default/site/client/right-rail.tsx +1 -0
  69. package/templates/default/site/client/search-page.tsx +1 -0
  70. package/templates/default/site/content/404.md +8 -0
  71. package/templates/default/site/content/about.md +10 -0
  72. package/templates/default/site/content/index.md +10 -0
  73. package/templates/default/site/icons/file.svg +1 -0
  74. package/templates/default/site/icons/home.svg +1 -0
  75. package/templates/default/site/icons/info.svg +1 -0
  76. package/templates/default/site/public/_idcmd/live-reload.js +18 -0
  77. package/templates/default/site/public/_idcmd/llm-menu.js +153 -0
  78. package/templates/default/site/public/_idcmd/nav-prefetch.js +30 -0
  79. package/templates/default/site/public/_idcmd/right-rail-scrollspy.js +262 -0
  80. package/templates/default/site/public/anthropic-white.svg +16 -0
  81. package/templates/default/site/public/favicon.svg +13 -0
  82. package/templates/default/site/public/openai-white.svg +15 -0
  83. package/templates/default/site/server/routes/api/hello.ts +2 -0
  84. package/templates/default/site/server/server.ts +4 -0
  85. package/templates/default/site/site.jsonc +21 -0
  86. package/templates/default/site/styles/tailwind.css +452 -0
  87. package/templates/default/tsconfig.json +23 -0
  88. package/templates/default/vercel.json +7 -0
  89. package/index.js +0 -2
@@ -0,0 +1,452 @@
1
+ @import "tailwindcss";
2
+
3
+ @custom-variant dark (&:is(.dark *));
4
+
5
+ /* ============================================
6
+ THEME - Customize colors, fonts, and sizing
7
+ ============================================ */
8
+
9
+ :root {
10
+ --background: oklch(0.985 0.002 260);
11
+ --foreground: oklch(0.15 0.005 260);
12
+ --card: oklch(0.985 0.002 260);
13
+ --card-foreground: oklch(0.15 0.005 260);
14
+ --popover: oklch(0.98 0.002 260);
15
+ --popover-foreground: oklch(0.15 0.005 260);
16
+ --primary: oklch(0.18 0.005 260);
17
+ --primary-foreground: oklch(0.985 0.002 260);
18
+ --secondary: oklch(0.96 0.003 260);
19
+ --secondary-foreground: oklch(0.18 0.005 260);
20
+ --muted: oklch(0.96 0.003 260);
21
+ --muted-foreground: oklch(0.45 0.005 260);
22
+ --accent: oklch(0.96 0.003 260);
23
+ --accent-foreground: oklch(0.18 0.005 260);
24
+ --destructive: oklch(0.577 0.245 27.325);
25
+ --destructive-foreground: oklch(0.577 0.245 27.325);
26
+ --border: oklch(0 0 0 / 10%);
27
+ --input: oklch(0 0 0 / 10%);
28
+ --ring: oklch(0.5 0.005 260);
29
+ --radius: 0.625rem;
30
+ --sidebar-width: 16rem;
31
+ --sidebar: oklch(0.975 0.002 260);
32
+ --sidebar-foreground: oklch(0.15 0.005 260);
33
+ --sidebar-primary: oklch(0.15 0.005 260);
34
+ --sidebar-primary-foreground: oklch(0.985 0.002 260);
35
+ --sidebar-accent: oklch(0.96 0.003 260);
36
+ --sidebar-accent-foreground: oklch(0.18 0.005 260);
37
+ --sidebar-border: oklch(0 0 0 / 8%);
38
+ --sidebar-ring: oklch(0.5 0.005 260);
39
+ }
40
+
41
+ .dark {
42
+ --background: oklch(0.1 0.005 260);
43
+ --foreground: oklch(0.93 0 0);
44
+ --card: oklch(0.13 0.005 260);
45
+ --card-foreground: oklch(0.93 0 0);
46
+ --popover: oklch(0.13 0.005 260);
47
+ --popover-foreground: oklch(0.93 0 0);
48
+ --primary: oklch(0.93 0 0);
49
+ --primary-foreground: oklch(0.1 0.005 260);
50
+ --secondary: oklch(0.18 0.005 260);
51
+ --secondary-foreground: oklch(0.93 0 0);
52
+ --muted: oklch(0.18 0.005 260);
53
+ --muted-foreground: oklch(0.6 0 0);
54
+ --accent: oklch(0.18 0.005 260);
55
+ --accent-foreground: oklch(0.93 0 0);
56
+ --destructive: oklch(0.704 0.191 22.216);
57
+ --destructive-foreground: oklch(0.637 0.237 25.331);
58
+ --border: oklch(1 0 0 / 8%);
59
+ --input: oklch(1 0 0 / 12%);
60
+ --ring: oklch(0.45 0 0);
61
+ --sidebar: oklch(0.08 0.005 260);
62
+ --sidebar-foreground: oklch(0.93 0 0);
63
+ --sidebar-primary: oklch(0.93 0 0);
64
+ --sidebar-primary-foreground: oklch(0.08 0.005 260);
65
+ --sidebar-accent: oklch(0.15 0.005 260);
66
+ --sidebar-accent-foreground: oklch(0.93 0 0);
67
+ --sidebar-border: oklch(1 0 0 / 8%);
68
+ --sidebar-ring: oklch(0.45 0 0);
69
+ }
70
+
71
+ @theme inline {
72
+ --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
73
+ --font-mono: "JetBrains Mono", ui-monospace, monospace;
74
+ --color-background: var(--background);
75
+ --color-foreground: var(--foreground);
76
+ --color-card: var(--card);
77
+ --color-card-foreground: var(--card-foreground);
78
+ --color-popover: var(--popover);
79
+ --color-popover-foreground: var(--popover-foreground);
80
+ --color-primary: var(--primary);
81
+ --color-primary-foreground: var(--primary-foreground);
82
+ --color-secondary: var(--secondary);
83
+ --color-secondary-foreground: var(--secondary-foreground);
84
+ --color-muted: var(--muted);
85
+ --color-muted-foreground: var(--muted-foreground);
86
+ --color-accent: var(--accent);
87
+ --color-accent-foreground: var(--accent-foreground);
88
+ --color-destructive: var(--destructive);
89
+ --color-destructive-foreground: var(--destructive-foreground);
90
+ --color-border: var(--border);
91
+ --color-input: var(--input);
92
+ --color-ring: var(--ring);
93
+ --radius-sm: calc(var(--radius) - 4px);
94
+ --radius-md: calc(var(--radius) - 2px);
95
+ --radius-lg: var(--radius);
96
+ --radius-xl: calc(var(--radius) + 4px);
97
+ --color-sidebar: var(--sidebar);
98
+ --color-sidebar-foreground: var(--sidebar-foreground);
99
+ --color-sidebar-primary: var(--sidebar-primary);
100
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
101
+ --color-sidebar-accent: var(--sidebar-accent);
102
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
103
+ --color-sidebar-border: var(--sidebar-border);
104
+ --color-sidebar-ring: var(--sidebar-ring);
105
+ }
106
+
107
+ @layer base {
108
+ /*
109
+ Tailwind v4’s `border` utility relies on `border-style: var(--tw-border-style)`.
110
+ In some browsers the Tailwind-defined `--tw-border-style` var can be missing
111
+ (it’s gated behind a complex `@supports` block), which makes borders render
112
+ as `border-style: none`. Defining it here ensures borders consistently show.
113
+ */
114
+ *,
115
+ ::before,
116
+ ::after,
117
+ ::backdrop {
118
+ --tw-border-style: solid;
119
+ }
120
+ * {
121
+ @apply border-border outline-ring/50;
122
+ }
123
+ html,
124
+ body {
125
+ /* Prevent rubber-band overscroll from pulling the sticky top navbar down. */
126
+ overscroll-behavior-y: none;
127
+ }
128
+ body {
129
+ @apply bg-background text-foreground;
130
+ }
131
+ }
132
+
133
+ html.smooth-scroll {
134
+ scroll-behavior: smooth;
135
+ }
136
+
137
+ /*
138
+ Sticky + backdrop-filter can jitter on fast scroll in some browsers.
139
+ Forcing the header into its own composited layer tends to reduce jumping.
140
+ */
141
+ header {
142
+ transform: translateZ(0);
143
+ will-change: transform;
144
+ }
145
+
146
+ /* ============================================
147
+ LAYOUT - Sidebar and main content structure
148
+ ============================================ */
149
+
150
+ .sidebar {
151
+ display: none;
152
+ }
153
+
154
+ @media (min-width: 768px) {
155
+ .sidebar {
156
+ position: fixed;
157
+ top: 0;
158
+ left: 0;
159
+ bottom: 0;
160
+ width: var(--sidebar-width);
161
+ background-color: var(--sidebar);
162
+ color: var(--sidebar-foreground);
163
+ border-right: 1px solid var(--sidebar-border);
164
+ display: flex;
165
+ flex-direction: column;
166
+ z-index: 40;
167
+ }
168
+ }
169
+
170
+ .sidebar-header {
171
+ display: flex;
172
+ align-items: center;
173
+ padding: 1.25rem 1.5rem;
174
+ }
175
+
176
+ .sidebar-content {
177
+ flex: 1;
178
+ overflow-y: auto;
179
+ padding: 0.5rem 0.75rem;
180
+ }
181
+
182
+ .main-wrapper {
183
+ min-height: 100vh;
184
+ display: flex;
185
+ flex-direction: column;
186
+ }
187
+
188
+ @media (min-width: 768px) {
189
+ .main-wrapper {
190
+ margin-left: var(--sidebar-width);
191
+ }
192
+ }
193
+
194
+ .main-content {
195
+ flex: 1;
196
+ padding: 2rem;
197
+ }
198
+
199
+ /* Hide default disclosure markers; we style the dropdown ourselves. */
200
+ .llm-menu summary {
201
+ list-style: none;
202
+ }
203
+ .llm-menu summary::-webkit-details-marker {
204
+ display: none;
205
+ }
206
+
207
+ /* ============================================
208
+ RIGHT RAIL - Table of contents scroll + active
209
+ ============================================ */
210
+
211
+ .toc-scroll {
212
+ height: 100%;
213
+ /*
214
+ The right rail must never be an independently scrollable container.
215
+ Wheel/trackpad input over the TOC should scroll the page, not the sidebar.
216
+ */
217
+ overflow: hidden;
218
+ overflow: clip;
219
+ overscroll-behavior: contain;
220
+ padding-right: 0.25rem;
221
+ scrollbar-gutter: stable;
222
+ }
223
+
224
+ /*
225
+ "Follow" mode:
226
+ - No independent scrolling in the TOC.
227
+ - JS translates the list to keep the active item centered.
228
+ - Without JS, the TOC is clipped (still clickable, but not independently scrollable).
229
+ */
230
+ body[data-toc-follow="1"] .toc-scroll {
231
+ /* Prefer `overflow: clip` (no scroll container) when supported. */
232
+ overflow: hidden;
233
+ overflow: clip;
234
+ /* Ensure wheel/trackpad scroll continues to the page while hovering the TOC. */
235
+ overscroll-behavior: auto;
236
+ }
237
+
238
+ body[data-toc-follow="1"] .toc-scroll > ul {
239
+ will-change: transform;
240
+ }
241
+
242
+ [data-toc-link] {
243
+ display: block;
244
+ padding: 0.25rem 0.5rem;
245
+ border-left: 2px solid transparent;
246
+ }
247
+
248
+ [data-toc-link][aria-current="location"] {
249
+ border-left-color: var(--foreground);
250
+ color: var(--foreground);
251
+ font-weight: 500;
252
+ }
253
+
254
+ /* ============================================
255
+ PROSE - Typography for markdown content
256
+ ============================================ */
257
+
258
+ .prose {
259
+ @apply overflow-x-hidden max-w-full leading-7;
260
+ overflow-wrap: anywhere;
261
+ h1,
262
+ h2,
263
+ h3,
264
+ h4,
265
+ h5,
266
+ h6 {
267
+ @apply font-semibold;
268
+ letter-spacing: -0.025em;
269
+ }
270
+ h1 {
271
+ @apply text-4xl mt-10 mb-4;
272
+ }
273
+ h1:first-child {
274
+ @apply mt-0;
275
+ }
276
+ h2 {
277
+ @apply text-2xl mt-10 mb-4 border-b border-border pb-3;
278
+ }
279
+ h3 {
280
+ @apply text-xl mt-8 mb-3;
281
+ }
282
+ h1,
283
+ h2,
284
+ h3 {
285
+ scroll-margin-top: var(--scroll-margin-top, 96px);
286
+ }
287
+ p {
288
+ @apply my-5;
289
+ }
290
+ a {
291
+ @apply text-foreground underline decoration-muted-foreground/40 underline-offset-4 hover:decoration-foreground transition-colors;
292
+ }
293
+ code {
294
+ @apply bg-muted px-1.5 py-0.5 text-sm rounded-md font-mono;
295
+ }
296
+ /* Shiki code blocks — sharp corners, terminal aesthetic */
297
+ pre.shiki {
298
+ @apply p-5 overflow-x-auto my-6 text-sm border border-border max-w-full;
299
+ border-radius: 0;
300
+ }
301
+ pre.shiki code {
302
+ @apply bg-transparent p-0 rounded-none;
303
+ }
304
+ /* Default to light theme colors */
305
+ pre.shiki,
306
+ pre.shiki span {
307
+ color: var(--shiki-light);
308
+ background-color: var(--shiki-light-bg);
309
+ }
310
+ /* Dark mode: use dark theme colors */
311
+ .dark pre.shiki,
312
+ .dark pre.shiki span {
313
+ color: var(--shiki-dark);
314
+ background-color: var(--shiki-dark-bg);
315
+ }
316
+ /* Fallback for non-shiki pre blocks */
317
+ pre:not(.shiki) {
318
+ @apply bg-foreground text-background p-5 overflow-x-auto my-6 border border-border max-w-full;
319
+ border-radius: 0;
320
+ }
321
+ pre:not(.shiki) code {
322
+ @apply bg-transparent p-0 rounded-none;
323
+ }
324
+ blockquote {
325
+ @apply pl-4 my-5 text-muted-foreground;
326
+ border-left: 3px solid var(--border);
327
+ font-style: normal;
328
+ }
329
+ ul,
330
+ ol {
331
+ @apply my-5 pl-6 leading-7;
332
+ }
333
+ li {
334
+ @apply my-1.5;
335
+ }
336
+ ul {
337
+ list-style-type: "— ";
338
+ }
339
+ ol {
340
+ @apply list-decimal;
341
+ }
342
+ /* Task list checkboxes */
343
+ input[type="checkbox"] {
344
+ accent-color: var(--accent-foreground);
345
+ }
346
+ hr {
347
+ @apply my-12 border-border;
348
+ }
349
+ /* Tables — bottom-border only, minimal chrome */
350
+ table {
351
+ @apply my-6 max-w-full overflow-x-auto block;
352
+ border-collapse: collapse;
353
+ }
354
+ th,
355
+ td {
356
+ @apply px-4 py-2.5 text-left;
357
+ border-bottom: 1px solid var(--border);
358
+ }
359
+ th {
360
+ @apply text-xs font-semibold uppercase tracking-wider text-muted-foreground;
361
+ }
362
+ tr:hover {
363
+ @apply bg-muted/30;
364
+ }
365
+ }
366
+
367
+ /* Homepage hero prose variant */
368
+ .prose-home h1:first-child {
369
+ @apply text-5xl md:text-6xl font-semibold;
370
+ letter-spacing: -0.035em;
371
+ line-height: 1.1;
372
+ }
373
+ .prose-home h1:first-child + p {
374
+ @apply text-xl text-muted-foreground;
375
+ }
376
+
377
+ /* ============================================
378
+ FOOTER
379
+ ============================================ */
380
+
381
+ .site-footer {
382
+ @apply font-mono text-xs text-muted-foreground py-8 px-8 border-t border-border;
383
+ }
384
+
385
+ /* ============================================
386
+ DOC COMPONENTS - Errors + InstallTabs
387
+ ============================================ */
388
+
389
+ .doc-component-error {
390
+ @apply my-6 border border-destructive/40 bg-destructive/10 px-4 py-3 text-sm;
391
+ }
392
+
393
+ /* CSS-only tabs (used by <InstallTabs ... />) */
394
+ .code-tabs {
395
+ @apply my-6 border border-border bg-card;
396
+ position: relative;
397
+ display: grid;
398
+ grid-template-columns: repeat(4, minmax(0, 1fr));
399
+ grid-template-rows: auto auto;
400
+ }
401
+
402
+ .code-tabs__input {
403
+ position: absolute;
404
+ opacity: 0;
405
+ pointer-events: none;
406
+ }
407
+
408
+ .code-tabs__label {
409
+ @apply text-xs font-semibold uppercase tracking-wider text-muted-foreground;
410
+ grid-row: 1;
411
+ border-bottom: 1px solid var(--border);
412
+ padding: 0.75rem 0.9rem;
413
+ cursor: pointer;
414
+ user-select: none;
415
+ text-align: center;
416
+ }
417
+
418
+ .code-tabs__label[data-pm="npm"] {
419
+ grid-column: 1;
420
+ }
421
+ .code-tabs__label[data-pm="pnpm"] {
422
+ grid-column: 2;
423
+ }
424
+ .code-tabs__label[data-pm="bun"] {
425
+ grid-column: 3;
426
+ }
427
+ .code-tabs__label[data-pm="yarn"] {
428
+ grid-column: 4;
429
+ }
430
+
431
+ .code-tabs__panel {
432
+ grid-row: 2;
433
+ grid-column: 1 / -1;
434
+ display: none;
435
+ }
436
+
437
+ .code-tabs__input:checked + .code-tabs__label {
438
+ color: var(--foreground);
439
+ background: color-mix(in oklab, var(--muted) 75%, transparent);
440
+ border-bottom-color: transparent;
441
+ }
442
+
443
+ .code-tabs__input:checked + .code-tabs__label + .code-tabs__panel {
444
+ display: block;
445
+ }
446
+
447
+ /* Remove extra chrome so the tabset reads as a single component. */
448
+ .code-tabs__panel pre.shiki,
449
+ .code-tabs__panel pre:not(.shiki) {
450
+ margin: 0;
451
+ border: none;
452
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "compilerOptions": {
3
+ "jsx": "react-jsx",
4
+ "jsxImportSource": "preact",
5
+ "lib": ["ESNext", "DOM"],
6
+ "target": "ESNext",
7
+ "module": "Preserve",
8
+ "moduleDetection": "force",
9
+ "allowJs": true,
10
+ "moduleResolution": "bundler",
11
+ "allowImportingTsExtensions": true,
12
+ "verbatimModuleSyntax": true,
13
+ "noEmit": true,
14
+ "strict": true,
15
+ "skipLibCheck": true,
16
+ "noFallthroughCasesInSwitch": true,
17
+ "noUncheckedIndexedAccess": true,
18
+ "noImplicitOverride": true,
19
+ "noUnusedLocals": false,
20
+ "noUnusedParameters": false,
21
+ "noPropertyAccessFromIndexSignature": false
22
+ }
23
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "https://openapi.vercel.sh/vercel.json",
3
+ "buildCommand": "bun run build",
4
+ "outputDirectory": "dist",
5
+ "installCommand": "bun install",
6
+ "bunVersion": "1.x"
7
+ }
package/index.js DELETED
@@ -1,2 +0,0 @@
1
- // Placeholder entry point for the idcmd package.
2
- module.exports = {};