framer-export 4.0.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dany (danbenba)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,267 @@
1
+ <p align="center">
2
+ <img src="https://img.shields.io/badge/TypeScript-3178C6?style=for-the-badge&logo=typescript&logoColor=white" alt="TypeScript" />
3
+ <img src="https://img.shields.io/badge/Node.js-339933?style=for-the-badge&logo=node.js&logoColor=white" alt="Node.js" />
4
+ <img src="https://img.shields.io/badge/Puppeteer-40B5A4?style=for-the-badge&logo=puppeteer&logoColor=white" alt="Puppeteer" />
5
+ <img src="https://img.shields.io/badge/version-4.0.0-blue?style=for-the-badge" alt="Version" />
6
+ <img src="https://img.shields.io/badge/license-MIT-green?style=for-the-badge" alt="License" />
7
+ </p>
8
+
9
+ <h1 align="center">
10
+ <br />
11
+ F-EXPORT
12
+ <br />
13
+ <sub>Framer &middot; Webflow &middot; Wix Exporter</sub>
14
+ </h1>
15
+
16
+ <p align="center">
17
+ <b>Export any Framer, Webflow, or Wix site into a fully working local mirror.</b><br/>
18
+ All assets, animations, fonts, videos, and scripts — downloaded, rewritten, and pretty-printed.<br/>
19
+ Badges and tracking removed. Ready to serve.
20
+ </p>
21
+
22
+ <p align="center">
23
+ <a href="#-features">Features</a> &middot;
24
+ <a href="#-quick-start">Quick Start</a> &middot;
25
+ <a href="#-platforms">Platforms</a> &middot;
26
+ <a href="#-cli-reference">CLI</a> &middot;
27
+ <a href="#-architecture">Architecture</a> &middot;
28
+ <a href="#-contributing">Contributing</a> &middot;
29
+ <a href="#-license">License</a>
30
+ </p>
31
+
32
+ ---
33
+
34
+ ## &#x2728; Features
35
+
36
+ | Feature | Description |
37
+ |---------|-------------|
38
+ | **Multi-Platform** | Auto-detects Framer, Webflow, and Wix sites from the URL |
39
+ | **Full Mirror** | Downloads HTML, CSS, JS, images, fonts, and videos |
40
+ | **Badge Removal** | Strips "Made in Webflow", Wix ads banner, Framer badge |
41
+ | **URL Rewriting** | All CDN URLs rewritten to local relative paths |
42
+ | **Pretty-Print** | Minified JS/MJS files reformatted with Prettier |
43
+ | **Integrity Strip** | Removes `integrity` and `crossorigin` attributes for local serving |
44
+ | **SEO Optimization** | Injects canonical, OG tags, and robots meta if missing |
45
+ | **Interactive Setup** | Arrow-key wizard with platform detection and progress animation |
46
+ | **Cooking Animation** | Shimmer gradient progress indicator during export |
47
+ | **Local Server** | Built-in serve.cjs with SPA fallback and CORS headers |
48
+ | **Smart Naming** | Output folder auto-named from URL (e.g. `webflow-mysite/`) |
49
+
50
+ ## &#x1F680; Quick Start
51
+
52
+ ```bash
53
+ # Clone and install
54
+ git clone https://github.com/danbenba/FramerExport.git
55
+ cd FramerExport
56
+ npm install
57
+
58
+ # Interactive mode (recommended)
59
+ npm run dev
60
+
61
+ # Direct export
62
+ npm run dev -- https://mysite.framer.app
63
+ npm run dev -- https://mysite.webflow.io
64
+ npm run dev -- https://user.wixsite.com/my-site
65
+
66
+ # Serve the exported site
67
+ cd webflow-mysite && node serve.cjs
68
+ ```
69
+
70
+ ## &#x1F310; Platforms
71
+
72
+ ### Framer
73
+ - Auto-detected via `.framer.app`, `.framer.website`, `.framer.ai`
74
+ - Handles framerusercontent.com, framerstatic.com, framercanvas.com
75
+ - Strips Framer badge, analytics events, bootstrap scripts
76
+ - Waits for SPA hydration (`#main` element)
77
+
78
+ ### Webflow
79
+ - Auto-detected via `.webflow.io`, `.webflow.com`
80
+ - Handles cdn.prod.website-files.com, cloudfront CDN, GSAP plugins
81
+ - Strips "Made in Webflow" badge, "Powered by" footer, `data-wf-*` attributes
82
+ - Removes generator meta tag and HTML comments
83
+ - Downloads videos (MP4/WebM) and responsive image variants
84
+
85
+ ### Wix
86
+ - Auto-detected via `.wixsite.com`, `.wix.com`
87
+ - Handles static.wixstatic.com, static.parastorage.com, video.wixstatic.com
88
+ - Strips WIX_ADS banner (nested div with SVG), wix-ads class, wix-badge
89
+ - Blocks frog.wix.com, panorama.wixapps.net analytics
90
+ - Preserves 40+ inline `<style>` tags (Wix architecture)
91
+
92
+ ## &#x1F4BB; CLI Reference
93
+
94
+ ```
95
+ Usage:
96
+ framer-export <url> [output-dir]
97
+ framer-export --setup
98
+ framer-export --setup --legacy-mode
99
+
100
+ Options:
101
+ --setup Launch interactive setup wizard
102
+ --platform <name> Force platform: framer | webflow | wix
103
+ --legacy-mode Use y/n text input instead of arrow selection
104
+ --help, -h Show help message
105
+ ```
106
+
107
+ ### Examples
108
+
109
+ ```bash
110
+ # Auto-detect platform from URL
111
+ framer-export https://mysite.framer.app
112
+
113
+ # Force platform for custom domains
114
+ framer-export --platform webflow https://custom-domain.com
115
+
116
+ # Specify output directory
117
+ framer-export https://mysite.webflow.io ./my-export
118
+
119
+ # Interactive wizard with arrow-key selection
120
+ framer-export --setup
121
+
122
+ # Legacy mode (y/n prompts)
123
+ framer-export --setup --legacy-mode
124
+ ```
125
+
126
+ ### npm Scripts
127
+
128
+ ```bash
129
+ npm run dev # Run with tsx (development)
130
+ npm start # Same as dev
131
+ npm run build # Bundle with tsup
132
+ npm run typecheck # Type-check with tsc
133
+ npm run format # Format with Prettier
134
+ ```
135
+
136
+ ## &#x1F4C1; Output Structure
137
+
138
+ ```
139
+ webflow-mysite/
140
+ ├── index.html # Main page (URLs rewritten, badges stripped)
141
+ ├── serve.cjs # Local HTTP server with SPA fallback
142
+ ├── styles/ # CSS files
143
+ ├── scripts/
144
+ │ ├── vendor/ # Platform JS modules (pretty-printed)
145
+ │ └── modules/ # Component modules
146
+ ├── assets/
147
+ │ ├── images/ # PNG, JPG, SVG, WebP, AVIF
148
+ │ ├── videos/ # MP4, WebM
149
+ │ ├── fonts/ # WOFF2, WOFF, TTF, OTF
150
+ │ └── misc/ # Other assets
151
+ └── data/ # CMS data, JSON, search index
152
+ ```
153
+
154
+ ## &#x1F3D7; Architecture
155
+
156
+ ```
157
+ src/
158
+ ├── cli/ # Command-line interface
159
+ │ ├── index.ts # Entry point, flag parsing
160
+ │ ├── banner.ts # ASCII art display
161
+ │ ├── help.ts # Help text with examples
162
+ │ ├── setup.ts # Interactive wizard
163
+ │ ├── select.ts # Arrow-key selection component
164
+ │ └── cooking.ts # Shimmer gradient animation
165
+ ├── platforms/ # Platform-specific handlers
166
+ │ ├── types.ts # PlatformHandler interface
167
+ │ ├── framer.ts # Framer detection, mapping, stripping
168
+ │ ├── webflow.ts # Webflow detection, mapping, stripping
169
+ │ ├── wix.ts # Wix detection, mapping, stripping
170
+ │ ├── detect.ts # Auto-detection by URL and HTML
171
+ │ └── index.ts # Barrel exports
172
+ ├── exporter/ # Export engine
173
+ │ ├── index.ts # FramerExporter orchestrator
174
+ │ ├── capture.ts # Puppeteer browser capture
175
+ │ ├── download.ts # Parallel asset downloader
176
+ │ ├── output.ts # HTML processing and file output
177
+ │ └── summary.ts # Export report
178
+ ├── assets/
179
+ │ └── asset-map.ts # URL-to-local-path mapping
180
+ ├── network/
181
+ │ ├── download.ts # HTTP download with retries
182
+ │ └── pool.ts # Concurrency pool
183
+ ├── formatter/
184
+ │ └── prettify.ts # Prettier-based JS formatter
185
+ ├── logger/
186
+ │ └── index.ts # Colored logging with cooking integration
187
+ ├── server/
188
+ │ └── template.ts # Embedded HTTP server template
189
+ ├── config/
190
+ │ └── index.ts # Global configuration
191
+ └── types.ts # Shared TypeScript interfaces
192
+ ```
193
+
194
+ ## &#x1F527; How It Works
195
+
196
+ 1. **SSR Fetch** - Raw HTTP GET of the page HTML (before JavaScript execution)
197
+ 2. **Browser Capture** - Puppeteer loads the page, intercepts all network responses
198
+ 3. **Hydration Wait** - Platform-specific wait for SPA rendering (Framer) or static render (Webflow/Wix)
199
+ 4. **Lazy Load Scroll** - Full-page scroll triggers lazy-loaded images and videos
200
+ 5. **Asset Download** - All intercepted resources downloaded with concurrency pool
201
+ 6. **Badge Strip** - Platform-specific badges, ads, and tracking removed
202
+ 7. **Integrity Strip** - SHA integrity hashes and CORS attributes removed for local serving
203
+ 8. **URL Rewrite** - All CDN URLs in HTML, CSS, and JS rewritten to local paths
204
+ 9. **Pretty-Print** - Minified JS files reformatted with Prettier for readability
205
+ 10. **Output** - Clean `index.html` + `serve.cjs` written to output directory
206
+
207
+ ## &#x1F91D; Contributing
208
+
209
+ Contributions are welcome! Here's how to get started:
210
+
211
+ 1. Fork the repository
212
+ 2. Create a feature branch: `git checkout -b feat/my-feature`
213
+ 3. Make your changes
214
+ 4. Run type-check: `npm run typecheck`
215
+ 5. Format code: `npm run format`
216
+ 6. Commit with conventional commits: `git commit -m "feat(platform): add Squarespace support"`
217
+ 7. Push and open a PR
218
+
219
+ ### Adding a New Platform
220
+
221
+ 1. Create `src/platforms/yourplatform.ts` implementing `PlatformHandler`
222
+ 2. Add it to `src/platforms/detect.ts` and `src/platforms/index.ts`
223
+ 3. Test with a real site URL
224
+
225
+ ### Commit Convention
226
+
227
+ ```
228
+ feat(scope): New feature
229
+ fix(scope): Bug fix
230
+ perf(scope): Performance improvement
231
+ refactor(scope): Code refactoring
232
+ chore(scope): Tooling, deps, config
233
+ ```
234
+
235
+ ## &#x1F4DC; License
236
+
237
+ MIT License - see [LICENSE](LICENSE) for details.
238
+
239
+ ## &#x1F4CB; Code of Conduct
240
+
241
+ ### Our Pledge
242
+
243
+ We are committed to providing a friendly, safe, and welcoming environment for all, regardless of level of experience, gender identity, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
244
+
245
+ ### Our Standards
246
+
247
+ **Positive behavior includes:**
248
+ - Using welcoming and inclusive language
249
+ - Being respectful of differing viewpoints and experiences
250
+ - Gracefully accepting constructive criticism
251
+ - Focusing on what is best for the community
252
+
253
+ **Unacceptable behavior includes:**
254
+ - Trolling, insulting, or derogatory comments
255
+ - Public or private harassment
256
+ - Publishing others' private information without permission
257
+ - Other conduct which could reasonably be considered inappropriate
258
+
259
+ ### Enforcement
260
+
261
+ Project maintainers are responsible for clarifying standards of acceptable behavior and will take appropriate action in response to unacceptable behavior. Violations may be reported by opening an issue or contacting the maintainers.
262
+
263
+ ---
264
+
265
+ <p align="center">
266
+ Made with &#x2764; by <a href="https://github.com/danbenba">Dany</a>
267
+ </p>