@see-ms/converter 0.1.1 → 0.1.3
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 +38 -13
- package/dist/cli.mjs +1230 -24
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +20 -10
- package/dist/index.mjs +798 -37
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -5,22 +5,26 @@ CLI tool for converting HTML exports to Nuxt 3 projects with automatic CMS integ
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
✨ **Automatic Conversion**
|
|
8
|
+
|
|
8
9
|
- Convert HTML to Vue components
|
|
9
10
|
- Transform `<a>` tags to `<NuxtLink>` with proper routing
|
|
10
11
|
- Normalize all asset paths automatically
|
|
11
12
|
|
|
12
13
|
🎨 **Asset Management**
|
|
14
|
+
|
|
13
15
|
- CSS files → `assets/css/`
|
|
14
16
|
- Images, fonts, JS → `public/assets/`
|
|
15
17
|
- Auto-generate Vite plugin for path resolution (For Webflow)
|
|
16
18
|
|
|
17
19
|
🔧 **Smart Transforms**
|
|
20
|
+
|
|
18
21
|
- Extract and deduplicate embedded styles
|
|
19
22
|
- Remove unnecessary attributes (srcset, sizes)
|
|
20
23
|
- Clean up script tags and inline code
|
|
21
24
|
- Format output with Prettier
|
|
22
25
|
|
|
23
26
|
📦 **Boilerplate Support**
|
|
27
|
+
|
|
24
28
|
- Clone from GitHub repository
|
|
25
29
|
- Copy from local directory
|
|
26
30
|
- Works with your custom Nuxt boilerplate
|
|
@@ -30,11 +34,13 @@ CLI tool for converting HTML exports to Nuxt 3 projects with automatic CMS integ
|
|
|
30
34
|
## Installation
|
|
31
35
|
|
|
32
36
|
### Quick Use (npx - no installation)
|
|
37
|
+
|
|
33
38
|
```bash
|
|
34
39
|
npx @see-ms/converter convert <webflow-export> <output-dir> [options]
|
|
35
40
|
```
|
|
36
41
|
|
|
37
42
|
### Global Installation
|
|
43
|
+
|
|
38
44
|
```bash
|
|
39
45
|
npm install -g @see-ms/converter
|
|
40
46
|
# or
|
|
@@ -42,6 +48,7 @@ pnpm add -g @see-ms/converter
|
|
|
42
48
|
```
|
|
43
49
|
|
|
44
50
|
Then use anywhere:
|
|
51
|
+
|
|
45
52
|
```bash
|
|
46
53
|
cms convert <webflow-export> <output-dir> [options]
|
|
47
54
|
```
|
|
@@ -51,11 +58,13 @@ cms convert <webflow-export> <output-dir> [options]
|
|
|
51
58
|
## Usage
|
|
52
59
|
|
|
53
60
|
### Basic Conversion
|
|
61
|
+
|
|
54
62
|
```bash
|
|
55
63
|
cms convert ./my-webflow-export ./my-nuxt-site
|
|
56
64
|
```
|
|
57
65
|
|
|
58
66
|
### With Boilerplate (Recommended)
|
|
67
|
+
|
|
59
68
|
```bash
|
|
60
69
|
# From GitHub
|
|
61
70
|
cms convert ./webflow-export ./nuxt-site \
|
|
@@ -67,9 +76,10 @@ cms convert ./webflow-export ./nuxt-site \
|
|
|
67
76
|
```
|
|
68
77
|
|
|
69
78
|
### Full Example
|
|
79
|
+
|
|
70
80
|
```bash
|
|
71
|
-
cms convert ./
|
|
72
|
-
--boilerplate git@github.com:
|
|
81
|
+
cms convert ./project-html ./project-nuxt \
|
|
82
|
+
--boilerplate git@github.com:username/repo-boilerplate.git \
|
|
73
83
|
--cms strapi
|
|
74
84
|
```
|
|
75
85
|
|
|
@@ -77,12 +87,12 @@ cms convert ./jagal.webflow ./jagal-nuxt \
|
|
|
77
87
|
|
|
78
88
|
## Options
|
|
79
89
|
|
|
80
|
-
| Option
|
|
81
|
-
|
|
82
|
-
| `-b, --boilerplate <source>` | GitHub URL or local path to Nuxt boilerplate | none
|
|
83
|
-
| `-o, --overrides <path>`
|
|
84
|
-
| `--generate-schemas`
|
|
85
|
-
| `--cms <type>`
|
|
90
|
+
| Option | Description | Default |
|
|
91
|
+
|------------------------------|----------------------------------------------|---------|
|
|
92
|
+
| `-b, --boilerplate <source>` | GitHub URL or local path to Nuxt boilerplate | none |
|
|
93
|
+
| `-o, --overrides <path>` | Path to overrides JSON file | none |
|
|
94
|
+
| `--generate-schemas` | Generate CMS schemas after conversion | false |
|
|
95
|
+
| `--cms <type>` | CMS type: strapi, contentful, or sanity | strapi |
|
|
86
96
|
|
|
87
97
|
---
|
|
88
98
|
|
|
@@ -91,6 +101,7 @@ cms convert ./jagal.webflow ./jagal-nuxt \
|
|
|
91
101
|
### HTML → Vue Components
|
|
92
102
|
|
|
93
103
|
**Before (Webflow):**
|
|
104
|
+
|
|
94
105
|
```html
|
|
95
106
|
<!-- index.html -->
|
|
96
107
|
<a href="about.html">About</a>
|
|
@@ -98,10 +109,11 @@ cms convert ./jagal.webflow ./jagal-nuxt \
|
|
|
98
109
|
```
|
|
99
110
|
|
|
100
111
|
**After (Nuxt):**
|
|
112
|
+
|
|
101
113
|
```vue
|
|
102
114
|
<!-- pages/index.vue -->
|
|
103
115
|
<script setup lang="ts">
|
|
104
|
-
// Page: index
|
|
116
|
+
// Page: index
|
|
105
117
|
</script>
|
|
106
118
|
|
|
107
119
|
<template>
|
|
@@ -113,6 +125,7 @@ cms convert ./jagal.webflow ./jagal-nuxt \
|
|
|
113
125
|
```
|
|
114
126
|
|
|
115
127
|
### Asset Structure
|
|
128
|
+
|
|
116
129
|
```
|
|
117
130
|
webflow-export/ nuxt-project/
|
|
118
131
|
├── css/ → ├── assets/css/
|
|
@@ -133,28 +146,33 @@ webflow-export/ nuxt-project/
|
|
|
133
146
|
## Transformations Applied
|
|
134
147
|
|
|
135
148
|
### Links
|
|
149
|
+
|
|
136
150
|
- `<a href="about.html">` → `<NuxtLink to="/about">`
|
|
137
151
|
- `<a href="../index.html">` → `<NuxtLink to="/">`
|
|
138
152
|
- `<a href="index.html">` → `<NuxtLink to="/">`
|
|
139
153
|
- External links remain as `<a>` tags
|
|
140
154
|
|
|
141
155
|
### Images
|
|
156
|
+
|
|
142
157
|
- `images/logo.svg` → `/assets/images/logo.svg`
|
|
143
158
|
- Removes `srcset` and `sizes` attributes
|
|
144
159
|
- Normalizes relative paths
|
|
145
160
|
|
|
146
161
|
### Styles
|
|
162
|
+
|
|
147
163
|
- Extracts `.global-embed` styles (For Webflow)
|
|
148
164
|
- Deduplicates repeated styles
|
|
149
165
|
- Adds to `assets/css/main.css`
|
|
150
166
|
|
|
151
167
|
### Scripts
|
|
168
|
+
|
|
152
169
|
- Removes all inline `<script>` tags
|
|
153
170
|
- Cleans up Webflow-specific JavaScript
|
|
154
171
|
|
|
155
172
|
---
|
|
156
173
|
|
|
157
174
|
## Output Structure
|
|
175
|
+
|
|
158
176
|
```
|
|
159
177
|
my-nuxt-site/
|
|
160
178
|
├── pages/
|
|
@@ -182,12 +200,14 @@ my-nuxt-site/
|
|
|
182
200
|
## After Conversion
|
|
183
201
|
|
|
184
202
|
1. **Install dependencies:**
|
|
203
|
+
|
|
185
204
|
```bash
|
|
186
205
|
cd my-nuxt-site
|
|
187
206
|
pnpm install
|
|
188
207
|
```
|
|
189
208
|
|
|
190
209
|
2. **Start development server:**
|
|
210
|
+
|
|
191
211
|
```bash
|
|
192
212
|
pnpm dev
|
|
193
213
|
```
|
|
@@ -212,6 +232,7 @@ If you have a standard Nuxt boilerplate for all projects:
|
|
|
212
232
|
|
|
213
233
|
1. Create a GitHub repo with your boilerplate
|
|
214
234
|
2. Use it in every conversion:
|
|
235
|
+
|
|
215
236
|
```bash
|
|
216
237
|
cms convert ./webflow ./output --boilerplate git@github.com:you/boilerplate.git
|
|
217
238
|
```
|
|
@@ -225,6 +246,7 @@ If you have a standard Nuxt boilerplate for all projects:
|
|
|
225
246
|
### Handling Custom Code
|
|
226
247
|
|
|
227
248
|
If your Webflow site has custom JavaScript that you need:
|
|
249
|
+
|
|
228
250
|
1. The converter removes inline scripts for clean Vue components
|
|
229
251
|
2. Port necessary JavaScript to Vue composables or plugins
|
|
230
252
|
3. Add to your Nuxt `plugins/` or `composables/` folders
|
|
@@ -236,28 +258,31 @@ If your Webflow site has custom JavaScript that you need:
|
|
|
236
258
|
### `nuxt.config.ts not found`
|
|
237
259
|
|
|
238
260
|
The converter expects a `nuxt.config.ts` file. Either:
|
|
261
|
+
|
|
239
262
|
- Use a boilerplate that has one, or
|
|
240
263
|
- The converter will create a minimal one if no boilerplate is specified
|
|
241
264
|
|
|
242
265
|
### Assets not loading
|
|
243
266
|
|
|
244
267
|
Make sure the `webflow-assets.ts` plugin is imported in your `nuxt.config.ts`:
|
|
268
|
+
|
|
245
269
|
```typescript
|
|
246
270
|
import webflowAssets from './utils/webflow-assets'
|
|
247
271
|
|
|
248
272
|
export default defineNuxtConfig({
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
273
|
+
vite: {
|
|
274
|
+
plugins: [webflowAssets()]
|
|
275
|
+
}
|
|
252
276
|
})
|
|
253
277
|
```
|
|
254
278
|
|
|
255
279
|
### Routes not working
|
|
256
280
|
|
|
257
281
|
Check that your `pages/` directory is enabled in Nuxt. It should be automatic, but verify in `nuxt.config.ts`:
|
|
282
|
+
|
|
258
283
|
```typescript
|
|
259
284
|
export default defineNuxtConfig({
|
|
260
|
-
|
|
285
|
+
pages: true
|
|
261
286
|
})
|
|
262
287
|
```
|
|
263
288
|
|