launchframe 0.1.4 → 0.1.6
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.
- package/README.md +61 -34
- package/package.json +64 -64
- package/packages/extract/dom-crawler.ts +521 -0
- package/packages/extract/emit.ts +2 -2
- package/packages/extract/extract.ts +66 -16
- package/packages/extract/mirror-emit.ts +522 -0
- package/packages/extract/types.ts +118 -0
package/README.md
CHANGED
|
@@ -10,10 +10,14 @@ radii, shadows), and synthesizes an original design system as
|
|
|
10
10
|
`tailwind.config.ts` + `globals.css` + `tokens.json` + a Markdown
|
|
11
11
|
report and an AI-handoff file.
|
|
12
12
|
|
|
13
|
-
It
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
It also crawls the rendered DOM into a typed `SiteLayout` and emits a
|
|
14
|
+
**layout-mirror page** per source: a Next.js component that reconstructs
|
|
15
|
+
the source's section tree, grid, and density from typed primitives, with
|
|
16
|
+
`<TextSlot>` / `<MediaSlot>` placeholders where the source had copy,
|
|
17
|
+
logos, illustrations, or product imagery. The mirror does **not** embed
|
|
18
|
+
the source's copy text, brand assets, or product screenshots — fill those
|
|
19
|
+
slots with your own content before shipping. Proprietary type families
|
|
20
|
+
are substituted with open-source equivalents.
|
|
17
21
|
|
|
18
22
|
---
|
|
19
23
|
|
|
@@ -35,21 +39,28 @@ cd path/to/your-app-or-empty-folder
|
|
|
35
39
|
npx launchframe@latest https://site-a.example https://site-b.example
|
|
36
40
|
```
|
|
37
41
|
|
|
38
|
-
When it finishes,
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
When it finishes, every source URL has produced a **layout-mirror
|
|
43
|
+
page** under `output/<runId>/mirror/<host>/page.tsx`, plus a synthesized
|
|
44
|
+
design system at the run root.
|
|
41
45
|
|
|
42
46
|
```txt
|
|
43
47
|
output/<runId>/
|
|
44
48
|
├── FOR_AI.md ← paste / @-attach this for your AI (handoff instructions)
|
|
45
|
-
├── tokens.json ← every value, machine-readable
|
|
49
|
+
├── tokens.json ← every aggregated value, machine-readable
|
|
46
50
|
├── tailwind.config.ts ← drop-in Tailwind theme
|
|
47
51
|
├── globals.css ← drop-in shadcn-compatible CSS variables
|
|
48
52
|
├── theme-preview.tsx ← render this to eyeball the system
|
|
49
53
|
├── REPORT.md ← what was extracted, from where, why
|
|
50
54
|
├── run.json ← full run metadata (sources, timing, status)
|
|
51
55
|
├── screenshots/ ← captured PNGs
|
|
52
|
-
|
|
56
|
+
├── raw/ ← per-site raw token + SiteLayout JSON
|
|
57
|
+
└── mirror/
|
|
58
|
+
└── <host>/
|
|
59
|
+
├── page.tsx ← Next.js page reconstructed from the source's
|
|
60
|
+
│ section tree, with <TextSlot> / <MediaSlot>
|
|
61
|
+
│ placeholders for your own copy and assets
|
|
62
|
+
├── layout.json ← the typed SiteLayout the page was built from
|
|
63
|
+
└── MIRROR_NOTES.md ← what was extracted and how to fill slots
|
|
53
64
|
```
|
|
54
65
|
|
|
55
66
|
---
|
|
@@ -57,10 +68,22 @@ output/<runId>/
|
|
|
57
68
|
## Hand the output to your AI
|
|
58
69
|
|
|
59
70
|
1. Run the command above so `output/<runId>/` exists.
|
|
60
|
-
2.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
71
|
+
2. Pick the mirror folder that matches the source whose layout you want
|
|
72
|
+
to start from: `output/<runId>/mirror/<host>/`.
|
|
73
|
+
3. Either:
|
|
74
|
+
- **Cursor:** `@`-attach the mirror folder along with `FOR_AI.md` and
|
|
75
|
+
`tokens.json`, then ask the agent to fill in `<TextSlot>` /
|
|
76
|
+
`<MediaSlot>` placeholders with copy for *your* product.
|
|
77
|
+
- **Claude Code:** copy the mirror folder into your project, then ask
|
|
78
|
+
the agent the same thing.
|
|
79
|
+
4. The AI's authority order is **MIRROR_NOTES.md → page.tsx → tokens.json
|
|
80
|
+
→ tailwind.config.ts + globals.css**. It must:
|
|
81
|
+
- Keep the section tree, grid composition, and density of `page.tsx`
|
|
82
|
+
intact (that is the source's layout grammar, which is the point).
|
|
83
|
+
- Replace every `<TextSlot kind="…" />` placeholder with original
|
|
84
|
+
copy written for *your* product — not paraphrased from the source.
|
|
85
|
+
- Replace every `<MediaSlot kind="…" />` with your own imagery, code
|
|
86
|
+
samples, or brand marks.
|
|
64
87
|
|
|
65
88
|
---
|
|
66
89
|
|
|
@@ -148,11 +171,11 @@ launchframe/
|
|
|
148
171
|
│ ├── capture/ # Playwright screenshot capture (lower level)
|
|
149
172
|
│ ├── analysis/ # Layout-tree extraction & section classifier
|
|
150
173
|
│ ├── patterns/ # Typed pattern schemas + atlas registry loader
|
|
151
|
-
│ ├── blocks/ #
|
|
152
|
-
│ └── evaluation/ # Coherence
|
|
153
|
-
├── pattern-atlas/ #
|
|
174
|
+
│ ├── blocks/ # Shadcn/ui blocks + TextSlot / MediaSlot primitives
|
|
175
|
+
│ └── evaluation/ # Coherence + responsiveness/a11y evaluator
|
|
176
|
+
├── pattern-atlas/ # Pattern catalog per category (block-composition mode)
|
|
154
177
|
├── prompts/ # Markdown prompts for AI agents
|
|
155
|
-
├── rules/ # Design / copy /
|
|
178
|
+
├── rules/ # Design / copy / a11y rules
|
|
156
179
|
├── registry/ # shadcn-compatible custom registry manifest
|
|
157
180
|
└── output/ # ← every `extract` run lands here
|
|
158
181
|
```
|
|
@@ -164,7 +187,7 @@ npm run studio # Next.js dashboard at localhost:3000
|
|
|
164
187
|
npm run capture # Lower-level Playwright capture pipeline
|
|
165
188
|
npm run analyze # Run section classifier on captured screenshots
|
|
166
189
|
npm run formalize # Validate the pattern-atlas/*.json files
|
|
167
|
-
npm run evaluate # Grade a generated page (coherence
|
|
190
|
+
npm run evaluate # Grade a generated page (coherence + a11y)
|
|
168
191
|
npm run typecheck # Project-wide TypeScript check
|
|
169
192
|
```
|
|
170
193
|
|
|
@@ -172,26 +195,30 @@ npm run typecheck # Project-wide TypeScript check
|
|
|
172
195
|
|
|
173
196
|
## What this is not
|
|
174
197
|
|
|
175
|
-
- **Not a
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
198
|
+
- **Not a verbatim site downloader.** The crawler builds a typed
|
|
199
|
+
`SiteLayout` model from the rendered DOM — section tree, geometry,
|
|
200
|
+
computed style tokens, content kinds — and emits code generated from
|
|
201
|
+
that model. It does not save the source's HTML/CSS to disk.
|
|
202
|
+
- **Not a content lift.** Heading text, body copy, logos, illustrations,
|
|
203
|
+
and product imagery become `<TextSlot>` / `<MediaSlot>` placeholders in
|
|
204
|
+
the mirror page. You fill them with your own copy and assets before
|
|
205
|
+
shipping.
|
|
179
206
|
- **Not a component library replacement.** It sits *on top* of
|
|
180
|
-
shadcn/ui and produces theme files
|
|
207
|
+
shadcn/ui and produces theme files plus slot-driven page templates.
|
|
181
208
|
|
|
182
209
|
---
|
|
183
210
|
|
|
184
|
-
##
|
|
185
|
-
|
|
186
|
-
Launchframe
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
211
|
+
## Responsible use in one paragraph
|
|
212
|
+
|
|
213
|
+
Launchframe is intended for layout research and design-system seeding
|
|
214
|
+
against pages you have permission to analyze (your own products, sites
|
|
215
|
+
where the operator has permission, or pages where structural analysis is
|
|
216
|
+
permitted by `robots.txt`). The crawler respects `robots.txt` by default
|
|
217
|
+
and rate-limits per domain. The output is generated code derived from a
|
|
218
|
+
normalized typed model and slot placeholders — not a verbatim copy of
|
|
219
|
+
the source's markup, copy, or assets. Operators are responsible for the
|
|
220
|
+
content they paste into those slots and for honoring third-party
|
|
221
|
+
trademarks, terms of service, and licenses.
|
|
195
222
|
|
|
196
223
|
---
|
|
197
224
|
|
package/package.json
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "launchframe",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Point Launchframe at SaaS sites you admire and get back a drop-in shadcn/ui design system (tokens, Tailwind theme, CSS variables, AI handoff) you can build your own UI on top of.",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"author": "Evan Gruhlkey",
|
|
7
|
-
"homepage": "https://github.com/evangruhlkey/launchframe#readme",
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/evangruhlkey/launchframe.git"
|
|
11
|
-
},
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/evangruhlkey/launchframe/issues"
|
|
14
|
-
},
|
|
15
|
-
"keywords": [
|
|
16
|
-
"launchframe",
|
|
17
|
-
"shadcn",
|
|
18
|
-
"shadcn-ui",
|
|
19
|
-
"tailwind",
|
|
20
|
-
"design-system",
|
|
21
|
-
"design-tokens",
|
|
22
|
-
"playwright",
|
|
23
|
-
"cursor",
|
|
24
|
-
"claude-code",
|
|
25
|
-
"ai",
|
|
26
|
-
"cli"
|
|
27
|
-
],
|
|
28
|
-
"bin": {
|
|
29
|
-
"launchframe": "bin/launchframe.mjs"
|
|
30
|
-
},
|
|
31
|
-
"files": [
|
|
32
|
-
"bin",
|
|
33
|
-
"packages/extract",
|
|
34
|
-
"README.md",
|
|
35
|
-
"LICENSE"
|
|
36
|
-
],
|
|
37
|
-
"workspaces": [
|
|
38
|
-
"apps/*",
|
|
39
|
-
"packages/*"
|
|
40
|
-
],
|
|
41
|
-
"scripts": {
|
|
42
|
-
"extract": "tsx packages/extract/extract.ts",
|
|
43
|
-
"studio": "npm run dev --workspace apps/studio",
|
|
44
|
-
"studio:build": "npm run build --workspace apps/studio",
|
|
45
|
-
"capture": "tsx packages/capture/screenshot-site.ts",
|
|
46
|
-
"analyze": "tsx packages/analysis/analyze-screenshot.ts",
|
|
47
|
-
"formalize": "tsx packages/patterns/pattern-registry.ts",
|
|
48
|
-
"evaluate": "tsx packages/evaluation/evaluate-page.ts",
|
|
49
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
50
|
-
"format:check": "prettier --check ."
|
|
51
|
-
},
|
|
52
|
-
"dependencies": {
|
|
53
|
-
"playwright": "^1.48.0",
|
|
54
|
-
"tsx": "^4.19.0"
|
|
55
|
-
},
|
|
56
|
-
"devDependencies": {
|
|
57
|
-
"@types/node": "^22.7.0",
|
|
58
|
-
"prettier": "^3.3.3",
|
|
59
|
-
"typescript": "^5.6.0"
|
|
60
|
-
},
|
|
61
|
-
"engines": {
|
|
62
|
-
"node": ">=20.0.0"
|
|
63
|
-
}
|
|
64
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "launchframe",
|
|
3
|
+
"version": "0.1.6",
|
|
4
|
+
"description": "Point Launchframe at SaaS sites you admire and get back a drop-in shadcn/ui design system (tokens, Tailwind theme, CSS variables, AI handoff) you can build your own UI on top of.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Evan Gruhlkey",
|
|
7
|
+
"homepage": "https://github.com/evangruhlkey/launchframe#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/evangruhlkey/launchframe.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/evangruhlkey/launchframe/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"launchframe",
|
|
17
|
+
"shadcn",
|
|
18
|
+
"shadcn-ui",
|
|
19
|
+
"tailwind",
|
|
20
|
+
"design-system",
|
|
21
|
+
"design-tokens",
|
|
22
|
+
"playwright",
|
|
23
|
+
"cursor",
|
|
24
|
+
"claude-code",
|
|
25
|
+
"ai",
|
|
26
|
+
"cli"
|
|
27
|
+
],
|
|
28
|
+
"bin": {
|
|
29
|
+
"launchframe": "bin/launchframe.mjs"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"bin",
|
|
33
|
+
"packages/extract",
|
|
34
|
+
"README.md",
|
|
35
|
+
"LICENSE"
|
|
36
|
+
],
|
|
37
|
+
"workspaces": [
|
|
38
|
+
"apps/*",
|
|
39
|
+
"packages/*"
|
|
40
|
+
],
|
|
41
|
+
"scripts": {
|
|
42
|
+
"extract": "tsx packages/extract/extract.ts",
|
|
43
|
+
"studio": "npm run dev --workspace apps/studio",
|
|
44
|
+
"studio:build": "npm run build --workspace apps/studio",
|
|
45
|
+
"capture": "tsx packages/capture/screenshot-site.ts",
|
|
46
|
+
"analyze": "tsx packages/analysis/analyze-screenshot.ts",
|
|
47
|
+
"formalize": "tsx packages/patterns/pattern-registry.ts",
|
|
48
|
+
"evaluate": "tsx packages/evaluation/evaluate-page.ts",
|
|
49
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
50
|
+
"format:check": "prettier --check ."
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"playwright": "^1.48.0",
|
|
54
|
+
"tsx": "^4.19.0"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@types/node": "^22.7.0",
|
|
58
|
+
"prettier": "^3.3.3",
|
|
59
|
+
"typescript": "^5.6.0"
|
|
60
|
+
},
|
|
61
|
+
"engines": {
|
|
62
|
+
"node": ">=20.0.0"
|
|
63
|
+
}
|
|
64
|
+
}
|