launchframe 0.2.0 → 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 (72) hide show
  1. package/README.md +143 -183
  2. package/bin/launchframe.mjs +234 -30
  3. package/package.json +52 -67
  4. package/template/.aider.conf.yml +3 -0
  5. package/template/.amazonq/cli-agents/clone-website.json +9 -0
  6. package/template/.amazonq/rules/project.md +156 -0
  7. package/template/.augment/commands/clone-website.md +516 -0
  8. package/template/.claude/skills/clone-website/SKILL.md +515 -0
  9. package/template/.clinerules +156 -0
  10. package/template/.codex/skills/clone-website/SKILL.md +515 -0
  11. package/template/.continue/commands/clone-website.md +517 -0
  12. package/template/.continue/rules/project.md +160 -0
  13. package/template/.cursor/commands/clone-website.md +512 -0
  14. package/template/.cursor/rules/project.mdc +7 -0
  15. package/template/.dockerignore +60 -0
  16. package/template/.gemini/commands/clone-website.toml +518 -0
  17. package/template/.gitattributes +9 -0
  18. package/template/.github/ISSUE_TEMPLATE/bug_report.yml +86 -0
  19. package/template/.github/ISSUE_TEMPLATE/config.yml +5 -0
  20. package/template/.github/ISSUE_TEMPLATE/feature_request.yml +50 -0
  21. package/template/.github/PULL_REQUEST_TEMPLATE.md +19 -0
  22. package/template/.github/copilot-instructions.md +156 -0
  23. package/template/.github/copilot-setup-steps.yml +3 -0
  24. package/template/.github/skills/clone-website/SKILL.md +515 -0
  25. package/template/.github/workflows/ci.yml +36 -0
  26. package/template/.nvmrc +1 -0
  27. package/template/.opencode/commands/clone-website.md +515 -0
  28. package/template/.windsurf/workflows/clone-website.md +512 -0
  29. package/template/.windsurfrules +2 -0
  30. package/template/AGENTS.md +74 -0
  31. package/template/CHANGELOG.md +80 -0
  32. package/template/CLAUDE.md +1 -0
  33. package/template/Dockerfile +114 -0
  34. package/template/Dockerfile.dev +15 -0
  35. package/template/GEMINI.md +1 -0
  36. package/template/README.md +129 -0
  37. package/template/components.json +25 -0
  38. package/template/docker-compose.yml +53 -0
  39. package/template/docs/design-references/.gitkeep +0 -0
  40. package/template/docs/design-references/comparison.png +0 -0
  41. package/template/docs/research/INSPECTION_GUIDE.md +80 -0
  42. package/template/eslint.config.mjs +18 -0
  43. package/template/next.config.ts +8 -0
  44. package/template/package.json +59 -0
  45. package/template/postcss.config.mjs +7 -0
  46. package/template/public/images/.gitkeep +0 -0
  47. package/template/public/seo/.gitkeep +0 -0
  48. package/template/public/videos/.gitkeep +0 -0
  49. package/template/scripts/.gitkeep +0 -0
  50. package/template/scripts/sync-agent-rules.sh +88 -0
  51. package/template/scripts/sync-skills.mjs +111 -0
  52. package/template/src/app/favicon.ico +0 -0
  53. package/template/src/app/globals.css +130 -0
  54. package/template/src/app/layout.tsx +33 -0
  55. package/template/src/app/page.tsx +9 -0
  56. package/template/src/components/ui/button.tsx +60 -0
  57. package/template/src/hooks/.gitkeep +0 -0
  58. package/template/src/lib/utils.ts +6 -0
  59. package/template/src/types/.gitkeep +0 -0
  60. package/template/tsconfig.json +34 -0
  61. package/packages/extract/automated-clone-pass.ts +0 -353
  62. package/packages/extract/browser-extract.ts +0 -237
  63. package/packages/extract/cloner-research-emit.ts +0 -270
  64. package/packages/extract/dom-crawler.ts +0 -521
  65. package/packages/extract/emit.ts +0 -553
  66. package/packages/extract/extract.ts +0 -548
  67. package/packages/extract/host-slug.ts +0 -5
  68. package/packages/extract/mirror-emit.ts +0 -620
  69. package/packages/extract/package.json +0 -13
  70. package/packages/extract/reference-dump.ts +0 -431
  71. package/packages/extract/synthesize.ts +0 -551
  72. package/packages/extract/types.ts +0 -316
@@ -1,316 +0,0 @@
1
- /**
2
- * Types for the design-system extraction pipeline.
3
- *
4
- * Shape of the run:
5
- *
6
- * URLs ──▶ capture ──▶ RawTokens (per site) ──▶ synthesize ──▶ DesignSystem ──▶ emit
7
- *
8
- * Every record is plain data and JSON-serializable. The synthesizer is a
9
- * pure function over `RawTokens[]`, which makes it easy to test and to
10
- * re-run with different tuning without recapturing.
11
- */
12
-
13
- /* -------------------------------------------------------------------------- */
14
- /* Raw tokens (per page, harvested from the live DOM) */
15
- /* -------------------------------------------------------------------------- */
16
-
17
- export interface ColorObservation {
18
- /** Hex RGB ("#0a0a0a"). Alpha is folded into the area weight. */
19
- hex: string;
20
- /** Where the color was found. */
21
- role: "text" | "background" | "border" | "shadow";
22
- /** Effective area in CSS pixels² (text uses font-size² × char count proxy). */
23
- area: number;
24
- }
25
-
26
- export interface TypographyObservation {
27
- fontFamily: string;
28
- fontSize: number;
29
- fontWeight: number;
30
- /** Effective line-height in px. */
31
- lineHeight: number;
32
- /** Letter-spacing in px. */
33
- letterSpacing: number;
34
- /** Number of distinct text nodes seen with this style. */
35
- count: number;
36
- }
37
-
38
- export interface SpacingObservation {
39
- /** "padding" | "gap" | "margin". */
40
- axis: "padding" | "gap" | "margin";
41
- /** Computed value in px. */
42
- px: number;
43
- /** How often this value appears across the page. */
44
- count: number;
45
- }
46
-
47
- export interface RadiusObservation {
48
- px: number;
49
- count: number;
50
- }
51
-
52
- export interface ShadowObservation {
53
- /** Verbatim computed box-shadow string. Used to derive 1–3 representative stops. */
54
- value: string;
55
- count: number;
56
- }
57
-
58
- export interface RawTokens {
59
- url: string;
60
- capturedAt: string;
61
- viewport: { width: number; height: number };
62
- colors: ColorObservation[];
63
- typography: TypographyObservation[];
64
- spacing: SpacingObservation[];
65
- radii: RadiusObservation[];
66
- shadows: ShadowObservation[];
67
- /**
68
- * Container width signal: the largest layout-dominating block width
69
- * observed (used to derive the recommended max-w container).
70
- */
71
- dominantContainerPx: number | null;
72
- }
73
-
74
- /* -------------------------------------------------------------------------- */
75
- /* Synthesized design system */
76
- /* -------------------------------------------------------------------------- */
77
-
78
- export interface ColorRamp {
79
- /** Hex value, e.g. "#0f0f10". */
80
- background: string;
81
- foreground: string;
82
- card: string;
83
- cardForeground: string;
84
- popover: string;
85
- popoverForeground: string;
86
- primary: string;
87
- primaryForeground: string;
88
- secondary: string;
89
- secondaryForeground: string;
90
- muted: string;
91
- mutedForeground: string;
92
- accent: string;
93
- accentForeground: string;
94
- destructive: string;
95
- destructiveForeground: string;
96
- border: string;
97
- input: string;
98
- ring: string;
99
- }
100
-
101
- export interface TypeScale {
102
- /** Recommended sans family (verbatim if open-source; substitute if proprietary). */
103
- fontSans: string;
104
- /** Recommended mono family. */
105
- fontMono: string;
106
- /** Whether the sans family was substituted because the source was proprietary. */
107
- fontSansSubstituted: boolean;
108
- /** Whether the mono family was substituted because the source was proprietary. */
109
- fontMonoSubstituted: boolean;
110
- /** Body base font-size (px). All other steps are derived from this. */
111
- basePx: number;
112
- /** Computed scale ratio between consecutive steps. */
113
- scaleRatio: number;
114
- /** Concrete pixel sizes per step, in ascending order. */
115
- steps: {
116
- xs: number;
117
- sm: number;
118
- base: number;
119
- lg: number;
120
- xl: number;
121
- "2xl": number;
122
- "3xl": number;
123
- "4xl": number;
124
- "5xl": number;
125
- "6xl": number;
126
- };
127
- /** Body line-height as a unitless ratio. */
128
- bodyLineHeight: number;
129
- /** Heading line-height as a unitless ratio. */
130
- headingLineHeight: number;
131
- /** Body letter-spacing in em (negative for tighter). */
132
- bodyLetterSpacingEm: number;
133
- }
134
-
135
- export interface SpacingScale {
136
- /** The scale's base unit in px (typically 4). */
137
- basePx: number;
138
- /** Concrete steps in px. */
139
- steps: number[];
140
- /** Recommended max-content width in px. */
141
- containerPx: number;
142
- }
143
-
144
- export interface RadiusScale {
145
- /** Base radius in px (used for shadcn's `--radius`). */
146
- basePx: number;
147
- }
148
-
149
- export interface ShadowScale {
150
- sm: string;
151
- md: string;
152
- lg: string;
153
- }
154
-
155
- export interface DesignSystem {
156
- /** Run identifier (timestamp-based). */
157
- runId: string;
158
- /** Sites the system was inspired by. Used for attribution in REPORT.md. */
159
- sources: Array<{ url: string; capturedAt: string }>;
160
- light: ColorRamp;
161
- dark: ColorRamp;
162
- typography: TypeScale;
163
- spacing: SpacingScale;
164
- radius: RadiusScale;
165
- shadows: ShadowScale;
166
- /**
167
- * Notes the synthesizer wants surfaced in the report. Each note is a
168
- * factual statement, not a recommendation.
169
- */
170
- notes: string[];
171
- }
172
-
173
- /* -------------------------------------------------------------------------- */
174
- /* Layout mirror (per-site) */
175
- /* -------------------------------------------------------------------------- */
176
-
177
- /**
178
- * Structural roles a top-level section can play. Inferred heuristically from
179
- * geometry, content kinds, and document position — not from the source's
180
- * class names.
181
- */
182
- export type SectionRole =
183
- | "nav"
184
- | "hero"
185
- | "feature-grid"
186
- | "feature-deep-dive"
187
- | "proof-logos"
188
- | "proof-quotes"
189
- | "pricing"
190
- | "conversion"
191
- | "footer"
192
- | "other";
193
-
194
- /**
195
- * Coarse composition shape used by the emitter to pick a wrapper layout.
196
- */
197
- export type Composition =
198
- | "single-column"
199
- | "split-2"
200
- | "grid-2"
201
- | "grid-3"
202
- | "grid-4"
203
- | "list"
204
- | "logo-row"
205
- | "unknown";
206
-
207
- /**
208
- * The kinds of content a section can hold. The emitter renders an
209
- * appropriately-styled placeholder (`<TextSlot>` / `<MediaSlot>`) per slot
210
- * so the user fills in their own copy and assets.
211
- */
212
- export type SlotKind =
213
- | "heading-1"
214
- | "heading-2"
215
- | "heading-3"
216
- | "eyebrow"
217
- | "body"
218
- | "bullet"
219
- | "button-primary"
220
- | "button-secondary"
221
- | "image"
222
- | "logo-mono"
223
- | "icon"
224
- | "code"
225
- | "badge"
226
- | "input"
227
- | "video";
228
-
229
- export interface SlotCount {
230
- kind: SlotKind;
231
- count: number;
232
- }
233
-
234
- /**
235
- * A single top-level section in document order. Geometry is normalized to
236
- * [0, 1] over the rendered page so the emitter can compare relative weight.
237
- */
238
- export interface SectionLayout {
239
- /** Stable id assigned in document order: s1, s2, ... */
240
- id: string;
241
- role: SectionRole;
242
- composition: Composition;
243
- density: "thin" | "balanced" | "dense";
244
- /** Bounding box [x, y, w, h] normalized to [0, 1] over the rendered page. */
245
- bbox: [number, number, number, number];
246
- /** Aggregated content-kind counts inside the section. */
247
- slots: SlotCount[];
248
- /** Per-section style hints; the emitter applies these as inline overrides. */
249
- styles: {
250
- backgroundHex: string | null;
251
- foregroundHex: string | null;
252
- paddingTopPx: number | null;
253
- paddingBottomPx: number | null;
254
- };
255
- /** Free-form notes the emitter surfaces in `MIRROR_NOTES.md`. */
256
- notes: string[];
257
- }
258
-
259
- /**
260
- * Page-level computed-style tokens. These complement the synthesized
261
- * `DesignSystem` so a mirror page can apply a site-specific theme without
262
- * the system having to reseed the cross-corpus palette.
263
- */
264
- export interface SiteTokens {
265
- bodyFontFamily: string;
266
- headingFontFamily: string;
267
- backgroundHex: string;
268
- foregroundHex: string;
269
- primaryHex: string;
270
- mutedHex: string;
271
- borderHex: string;
272
- radiusPx: number;
273
- containerPx: number | null;
274
- }
275
-
276
- export interface SiteLayout {
277
- url: string;
278
- host: string;
279
- capturedAt: string;
280
- viewport: { width: number; height: number };
281
- /** Full rendered page height in CSS pixels. */
282
- pageHeightPx: number;
283
- sections: SectionLayout[];
284
- tokens: SiteTokens;
285
- }
286
-
287
- /* -------------------------------------------------------------------------- */
288
- /* Run summary */
289
- /* -------------------------------------------------------------------------- */
290
-
291
- export interface SiteCapture {
292
- url: string;
293
- host: string;
294
- capturedAt: string;
295
- screenshotPath: string;
296
- rawTokensPath?: string;
297
- /** Path to crawled layout JSON when DOM crawl succeeded. */
298
- layoutPath?: string;
299
- /** Verbatim HTML + copy + media listing for AI reference. */
300
- referenceDir?: string;
301
- /** Path to the per-site mirror page directory, if emission succeeded. */
302
- mirrorDir?: string;
303
- status: "ok" | "skipped" | "failed";
304
- reason?: string;
305
- }
306
-
307
- export interface ExtractionRun {
308
- runId: string;
309
- startedAt: string;
310
- finishedAt: string;
311
- outputDir: string;
312
- captures: SiteCapture[];
313
- designSystem: DesignSystem | null;
314
- /** Product narrative from CLI/env — drives FOR_AI.md and docs/research/. */
315
- saasIdea?: string;
316
- }