create-velocity-astro 1.6.2 → 1.6.4

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 (27) hide show
  1. package/README.md +417 -417
  2. package/dist/index.js +0 -0
  3. package/dist/index.js.map +1 -1
  4. package/package.json +66 -66
  5. package/templates/i18n/src/components/hero/Hero.astro +154 -154
  6. package/templates/i18n/src/components/landing/CTA.astro +3 -3
  7. package/templates/i18n/src/components/landing/Credibility.astro +1 -1
  8. package/templates/i18n/src/components/landing/FeatureTabs.tsx +527 -527
  9. package/templates/i18n/src/components/landing/LandingFooter.astro +1 -1
  10. package/templates/i18n/src/components/landing/LighthouseScores.astro +1 -1
  11. package/templates/i18n/src/components/landing/Navbar.astro +3 -3
  12. package/templates/i18n/src/components/landing/TechStack.astro +1 -1
  13. package/templates/i18n/src/components/layout/Footer.astro +2 -2
  14. package/templates/i18n/src/components/layout/Header.astro +5 -5
  15. package/templates/i18n/src/components/layout/ThemeToggle.astro +1 -1
  16. package/templates/i18n/src/i18n/translations/en.ts +13 -0
  17. package/templates/i18n/src/i18n/translations/es.ts +13 -0
  18. package/templates/i18n/src/i18n/translations/fr.ts +13 -0
  19. package/templates/i18n/src/layouts/BaseLayout.astro +18 -0
  20. package/templates/i18n/src/pages/[lang]/[...about].astro +3 -3
  21. package/templates/i18n/src/pages/[lang]/[...contact].astro +6 -6
  22. package/templates/i18n/src/pages/[lang]/blog/index.astro +2 -2
  23. package/templates/i18n/src/pages/[lang]/index.astro +5 -5
  24. package/templates/i18n/src/pages/about.astro +3 -3
  25. package/templates/i18n/src/pages/blog/index.astro +2 -2
  26. package/templates/i18n/src/pages/contact.astro +6 -6
  27. package/templates/i18n/src/pages/index.astro +5 -5
package/README.md CHANGED
@@ -1,417 +1,417 @@
1
- <p align="center">
2
- <img src="https://raw.githubusercontent.com/southwellmedia/velocity/main/src/assets/branding/logo-full.svg" alt="Velocity" width="320" />
3
- </p>
4
-
5
- <h1 align="center">create-velocity-astro</h1>
6
-
7
- <p align="center">Scaffold and upgrade production-ready <a href="https://github.com/southwellmedia/velocity">Velocity</a> projects in seconds.</p>
8
-
9
- Velocity is an opinionated Astro 6 + Tailwind CSS v4 starter kit with 40+ components, i18n support, SEO optimization, and deployment-ready configuration.
10
-
11
- ## Quick Start
12
-
13
- ```bash
14
- # npm
15
- npm create velocity-astro@latest my-site
16
-
17
- # pnpm (recommended)
18
- pnpm create velocity-astro my-site
19
-
20
- # yarn
21
- yarn create velocity-astro my-site
22
-
23
- # bun
24
- bun create velocity-astro my-site
25
- ```
26
-
27
- ## Upgrade an Existing Project
28
-
29
- Already have a Velocity project? Upgrade to the latest version:
30
-
31
- ```bash
32
- # Preview what will change (no files modified)
33
- pnpm create velocity-astro upgrade --dry-run
34
-
35
- # Run the upgrade
36
- pnpm create velocity-astro upgrade
37
-
38
- # Skip confirmation prompts
39
- pnpm create velocity-astro upgrade --yes
40
- ```
41
-
42
- The upgrade command will:
43
-
44
- 1. **Replace framework files** — UI components, layouts, utilities, and config files are updated to the latest version
45
- 2. **Update dependencies** — `package.json` is merged with new dependency versions (your custom fields are preserved)
46
- 3. **Protect your files** — Pages, content, site config, and customized components are never touched
47
- 4. **Show manual migration steps** — Breaking changes are listed with affected files so you know exactly what to update
48
-
49
- > Requires a project created with `create-velocity-astro` v1.6.0+ (which writes a `.velocity.json` tracking file).
50
-
51
- ## CLI Options
52
-
53
- | Flag | Type | Default | Description |
54
- |------|------|---------|-------------|
55
- | `upgrade` | command | - | Upgrade an existing Velocity project |
56
- | `--demo` | boolean | prompt | Include demo landing page and sample content |
57
- | `--components` | string | prompt | Component selection (see below) |
58
- | `--i18n` | boolean | prompt | Add internationalization support |
59
- | `--pages` | boolean | false | Generate starter pages interactively |
60
- | `--dry-run` | boolean | false | Preview upgrade changes without applying |
61
- | `-y, --yes` | boolean | false | Skip prompts, use defaults |
62
- | `-h, --help` | - | - | Show help message |
63
- | `-v, --version` | - | - | Show version number |
64
-
65
- ### Component Selection
66
-
67
- The `--components` flag controls which UI components are included:
68
-
69
- ```bash
70
- # Include all components (default with -y)
71
- --components
72
- --components=all
73
-
74
- # Exclude all optional components
75
- --components=none
76
-
77
- # Include specific categories
78
- --components=ui
79
- --components=ui,patterns
80
- --components=ui,patterns,hero
81
- ```
82
-
83
- **Component Categories:**
84
-
85
- | Category | Components | Count |
86
- |----------|------------|-------|
87
- | `ui` | Button, Input, Textarea, Select, Checkbox, Radio, Switch, Card, Badge, Avatar, AvatarGroup, Table, Pagination, Progress, Skeleton, Alert, Toast, Tooltip, Dialog, Dropdown, Tabs, VerticalTabs, Accordion, Separator, Icon, CodeBlock, Logo, CTA, NpmCopyButton, SocialProof, TerminalDemo | 31 |
88
- | `patterns` | ContactForm, NewsletterForm, FormField, SearchInput, PasswordInput, StatCard, EmptyState | 7 |
89
- | `hero` | Hero (flexible hero section) | 1 |
90
-
91
- ## Component Features
92
-
93
- ### Header
94
-
95
- Flexible navigation header with variant-based configuration:
96
-
97
- ```astro
98
- <Header
99
- layout="default" <!-- default | centered | minimal -->
100
- position="sticky" <!-- fixed | sticky | static -->
101
- size="md" <!-- sm | md | lg -->
102
- variant="default" <!-- default | solid | transparent -->
103
- colorScheme="default" <!-- default | invert -->
104
- showCta={true}
105
- showThemeToggle={true}
106
- showLanguageSwitcher={true} <!-- i18n only -->
107
- />
108
- ```
109
-
110
- ### Footer
111
-
112
- Four layout variants for different site needs:
113
-
114
- ```astro
115
- <Footer
116
- layout="simple" <!-- simple | columns | minimal | stacked -->
117
- background="default" <!-- default | secondary | invert -->
118
- columns={3} <!-- 2 | 3 | 4 (columns layout only) -->
119
- showSocial={true}
120
- showCopyright={true}
121
- socialLinks={[{ platform: 'github', href: '...' }]}
122
- legalLinks={[{ label: 'Privacy', href: '/privacy' }]}
123
- />
124
- ```
125
-
126
- ### Hero
127
-
128
- Flexible hero section with multiple layout options:
129
-
130
- ```astro
131
- <Hero
132
- layout="single" <!-- single | split -->
133
- splitRatio="1:1" <!-- 1:1 | 1:2 | 2:1 -->
134
- align="left" <!-- left | center | right -->
135
- background="default" <!-- default | secondary | invert | gradient | image -->
136
- size="lg" <!-- sm | md | lg | xl -->
137
- showGrid={true}
138
- showBlob={true}
139
- title="Your Title"
140
- titleHighlight="Title" <!-- text to highlight in brand color -->
141
- description="..."
142
- />
143
- ```
144
-
145
- ### CTA
146
-
147
- Reusable call-to-action section:
148
-
149
- ```astro
150
- <CTA
151
- variant="default" <!-- default | invert -->
152
- size="lg" <!-- sm | md | lg | xl -->
153
- align="center" <!-- center | left -->
154
- showLogo={true}
155
- heading="Ready to start?"
156
- headingHighlight="start"
157
- description="Get started in seconds."
158
- showCopyCommand={true}
159
- />
160
- ```
161
-
162
- ### Button
163
-
164
- Production-ready button with variants:
165
-
166
- ```astro
167
- <Button
168
- variant="primary" <!-- primary | secondary | outline | ghost | destructive -->
169
- size="md" <!-- sm | md | lg -->
170
- colorScheme="default" <!-- default | invert -->
171
- fullWidth={false}
172
- icon={false}
173
- href="/path" <!-- renders as <a> when provided -->
174
- />
175
- ```
176
-
177
- ## Examples
178
-
179
- ### Minimal Project (fastest)
180
-
181
- ```bash
182
- npm create velocity-astro@latest my-site -y --demo=false --components=none
183
- ```
184
-
185
- Creates a clean starter with just layouts, SEO components, and basic pages.
186
-
187
- ### Full-Featured Project
188
-
189
- ```bash
190
- npm create velocity-astro@latest my-site --demo --components --i18n
191
- ```
192
-
193
- Includes everything: demo landing page, all components, and i18n support.
194
-
195
- ### Production Site Setup
196
-
197
- ```bash
198
- npm create velocity-astro@latest client-site --demo --components=ui,patterns
199
- ```
200
-
201
- Demo content to customize, plus UI and form components for building pages.
202
-
203
- ### i18n Multi-Language Site
204
-
205
- ```bash
206
- npm create velocity-astro@latest global-site --i18n --demo
207
- ```
208
-
209
- Full i18n support with:
210
- - Locale-prefixed routes (`/en/`, `/es/`, `/fr/`)
211
- - Language switcher component
212
- - Translated navigation and content
213
- - SEO hreflang tags
214
-
215
- ### Custom Pages Generation
216
-
217
- ```bash
218
- npm create velocity-astro@latest my-site --pages
219
- ```
220
-
221
- Interactive prompt to generate starter pages (services, pricing, team, etc.).
222
-
223
- ## How It Works
224
-
225
- ### Architecture
226
-
227
- ```
228
- User runs CLI
229
-
230
-
231
- Downloads FULL Velocity repo from GitHub (via giget)
232
-
233
-
234
- Applies local template overlays (i18n, base)
235
-
236
-
237
- Configures based on CLI options
238
-
239
-
240
- Installs dependencies
241
- ```
242
-
243
- The CLI downloads the complete [Velocity repository](https://github.com/southwellmedia/velocity) at runtime, then applies configuration overlays based on your selections. This means you always get the latest Velocity features.
244
-
245
- ### 8-Step Scaffolding Process
246
-
247
- 1. **Download template** - Fetches Velocity from GitHub via `giget`
248
- 2. **Configure components** - Filters to selected component categories
249
- 3. **Apply i18n overlay** - Adds internationalization if enabled
250
- 4. **Remove demo content** - Strips demo pages if `--demo=false`
251
- 5. **Generate pages** - Creates starter pages if requested
252
- 6. **Update package.json** - Sets project name and cleans metadata
253
- 7. **Initialize git** - Creates git repository with initial commit
254
- 8. **Install dependencies** - Runs package manager install
255
-
256
- ### Template Overlay System
257
-
258
- The CLI uses a template overlay approach:
259
-
260
- - **Base Velocity**: Downloaded from GitHub (always fresh)
261
- - **i18n overlay**: Adds locale routing, translations, language switcher
262
- - **Base template**: Minimal pages for non-demo projects
263
-
264
- Overlays are applied in order, with later files overwriting earlier ones.
265
-
266
- ### Component Registry
267
-
268
- Components are managed via `component-registry.json` in Velocity. The registry defines:
269
-
270
- - Component files and locations
271
- - Dependencies between components
272
- - Required utilities (like `cn` for class merging)
273
- - Category groupings
274
-
275
- When you select categories, the CLI resolves all dependencies automatically.
276
-
277
- ## What's Included
278
-
279
- Every Velocity project includes:
280
-
281
- | Feature | Description |
282
- |---------|-------------|
283
- | **Astro 6** | Latest Astro with View Transitions |
284
- | **Tailwind CSS v4** | Modern utility-first CSS with native cascade layers |
285
- | **TypeScript** | Full type safety throughout |
286
- | **React** | For interactive islands and components |
287
- | **MDX** | Write content with JSX components |
288
- | **SEO** | Meta tags, Open Graph, JSON-LD schemas |
289
- | **Sitemap** | Auto-generated sitemap.xml |
290
- | **RSS Feed** | Built-in RSS support |
291
- | **Dark Mode** | System-aware theme switching |
292
- | **ESLint + Prettier** | Code quality and formatting |
293
- | **Analytics Ready** | GA4 and GTM support via env vars |
294
-
295
- ### Optional Features
296
-
297
- | Feature | Flag | Description |
298
- |---------|------|-------------|
299
- | Demo content | `--demo` | Landing page, sample blog posts, about/contact pages |
300
- | UI Components | `--components` | 40+ production-ready components |
301
- | i18n Support | `--i18n` | Multi-language routing and translations |
302
- | Starter Pages | `--pages` | Generate custom pages interactively |
303
-
304
- ## Configuration
305
-
306
- ### Environment Variables
307
-
308
- Create a `.env` file to configure analytics and verification:
309
-
310
- ```env
311
- # Analytics (optional)
312
- PUBLIC_GA_MEASUREMENT_ID=G-XXXXXXXXXX
313
- PUBLIC_GTM_ID=GTM-XXXXXXX
314
-
315
- # Site Verification (optional)
316
- GOOGLE_SITE_VERIFICATION=your-verification-code
317
- BING_SITE_VERIFICATION=your-verification-code
318
-
319
- # Site URL (required for production)
320
- SITE_URL=https://your-domain.com
321
- ```
322
-
323
- ### Site Configuration
324
-
325
- Edit `src/config/site.config.ts` to customize:
326
-
327
- ```typescript
328
- const siteConfig: SiteConfig = {
329
- name: 'Your Site Name',
330
- description: 'Your site description',
331
- url: 'https://your-domain.com',
332
- author: 'Your Name',
333
- email: 'hello@example.com',
334
-
335
- // Branding
336
- branding: {
337
- logo: { alt: 'Your Logo' },
338
- favicon: { svg: '/favicon.svg' },
339
- colors: {
340
- themeColor: '#F94C10',
341
- backgroundColor: '#ffffff',
342
- },
343
- },
344
- };
345
- ```
346
-
347
- ### Branding Files
348
-
349
- Replace these files with your own branding:
350
-
351
- - `public/favicon.svg` - Site favicon
352
- - `src/assets/branding/` - Logo SVG files
353
-
354
- ## Development
355
-
356
- After scaffolding, run:
357
-
358
- ```bash
359
- cd my-site
360
- npm run dev # Start dev server at localhost:4321
361
- npm run build # Build for production
362
- npm run preview # Preview production build
363
- ```
364
-
365
- ## Deployment
366
-
367
- Velocity includes ready-to-use configurations for:
368
-
369
- - **Vercel** - Zero-config deployment
370
- - **Netlify** - Includes `netlify.toml`
371
- - **Cloudflare Pages** - SSR-ready
372
-
373
- ## Troubleshooting
374
-
375
- ### Network Errors
376
-
377
- If template download fails:
378
- - Check your internet connection
379
- - Verify GitHub is accessible
380
- - Try again in a few minutes
381
-
382
- ### Directory Already Exists
383
-
384
- The CLI will prompt to overwrite existing directories. Use a new directory name or clear the existing one.
385
-
386
- ### Permission Errors
387
-
388
- On Unix systems, you may need to set execute permissions:
389
-
390
- ```bash
391
- chmod +x node_modules/.bin/create-velocity-astro
392
- ```
393
-
394
- ### Dependency Installation Fails
395
-
396
- If automatic installation fails:
397
-
398
- ```bash
399
- cd my-site
400
- npm install # or pnpm install / yarn
401
- ```
402
-
403
- ## Requirements
404
-
405
- - **Node.js** 18.0.0 or higher
406
- - **Package Manager**: npm, pnpm, yarn, or bun
407
- - **Git** (optional, for repository initialization)
408
-
409
- ## Related
410
-
411
- - [Velocity](https://github.com/southwellmedia/velocity) - The Astro starter kit
412
- - [Astro](https://astro.build) - The web framework
413
- - [Tailwind CSS](https://tailwindcss.com) - The CSS framework
414
-
415
- ## License
416
-
417
- MIT - [Southwell Media](https://southwellmedia.com)
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/southwellmedia/velocity/main/src/assets/branding/logo-full.svg" alt="Velocity" width="320" />
3
+ </p>
4
+
5
+ <h1 align="center">create-velocity-astro</h1>
6
+
7
+ <p align="center">Scaffold and upgrade production-ready <a href="https://github.com/southwellmedia/velocity">Velocity</a> projects in seconds.</p>
8
+
9
+ Velocity is an opinionated Astro 6 + Tailwind CSS v4 starter kit with 40+ components, i18n support, SEO optimization, and deployment-ready configuration.
10
+
11
+ ## Quick Start
12
+
13
+ ```bash
14
+ # npm
15
+ npm create velocity-astro@latest my-site
16
+
17
+ # pnpm (recommended)
18
+ pnpm create velocity-astro my-site
19
+
20
+ # yarn
21
+ yarn create velocity-astro my-site
22
+
23
+ # bun
24
+ bun create velocity-astro my-site
25
+ ```
26
+
27
+ ## Upgrade an Existing Project
28
+
29
+ Already have a Velocity project? Upgrade to the latest version:
30
+
31
+ ```bash
32
+ # Preview what will change (no files modified)
33
+ pnpm create velocity-astro upgrade --dry-run
34
+
35
+ # Run the upgrade
36
+ pnpm create velocity-astro upgrade
37
+
38
+ # Skip confirmation prompts
39
+ pnpm create velocity-astro upgrade --yes
40
+ ```
41
+
42
+ The upgrade command will:
43
+
44
+ 1. **Replace framework files** — UI components, layouts, utilities, and config files are updated to the latest version
45
+ 2. **Update dependencies** — `package.json` is merged with new dependency versions (your custom fields are preserved)
46
+ 3. **Protect your files** — Pages, content, site config, and customized components are never touched
47
+ 4. **Show manual migration steps** — Breaking changes are listed with affected files so you know exactly what to update
48
+
49
+ > Requires a project created with `create-velocity-astro` v1.6.0+ (which writes a `.velocity.json` tracking file).
50
+
51
+ ## CLI Options
52
+
53
+ | Flag | Type | Default | Description |
54
+ |------|------|---------|-------------|
55
+ | `upgrade` | command | - | Upgrade an existing Velocity project |
56
+ | `--demo` | boolean | prompt | Include demo landing page and sample content |
57
+ | `--components` | string | prompt | Component selection (see below) |
58
+ | `--i18n` | boolean | prompt | Add internationalization support |
59
+ | `--pages` | boolean | false | Generate starter pages interactively |
60
+ | `--dry-run` | boolean | false | Preview upgrade changes without applying |
61
+ | `-y, --yes` | boolean | false | Skip prompts, use defaults |
62
+ | `-h, --help` | - | - | Show help message |
63
+ | `-v, --version` | - | - | Show version number |
64
+
65
+ ### Component Selection
66
+
67
+ The `--components` flag controls which UI components are included:
68
+
69
+ ```bash
70
+ # Include all components (default with -y)
71
+ --components
72
+ --components=all
73
+
74
+ # Exclude all optional components
75
+ --components=none
76
+
77
+ # Include specific categories
78
+ --components=ui
79
+ --components=ui,patterns
80
+ --components=ui,patterns,hero
81
+ ```
82
+
83
+ **Component Categories:**
84
+
85
+ | Category | Components | Count |
86
+ |----------|------------|-------|
87
+ | `ui` | Button, Input, Textarea, Select, Checkbox, Radio, Switch, Card, Badge, Avatar, AvatarGroup, Table, Pagination, Progress, Skeleton, Alert, Toast, Tooltip, Dialog, Dropdown, Tabs, VerticalTabs, Accordion, Separator, Icon, CodeBlock, Logo, CTA, NpmCopyButton, SocialProof, TerminalDemo | 31 |
88
+ | `patterns` | ContactForm, NewsletterForm, FormField, SearchInput, PasswordInput, StatCard, EmptyState | 7 |
89
+ | `hero` | Hero (flexible hero section) | 1 |
90
+
91
+ ## Component Features
92
+
93
+ ### Header
94
+
95
+ Flexible navigation header with variant-based configuration:
96
+
97
+ ```astro
98
+ <Header
99
+ layout="default" <!-- default | centered | minimal -->
100
+ position="sticky" <!-- fixed | sticky | static -->
101
+ size="md" <!-- sm | md | lg -->
102
+ variant="default" <!-- default | solid | transparent -->
103
+ colorScheme="default" <!-- default | invert -->
104
+ showCta={true}
105
+ showThemeToggle={true}
106
+ showLanguageSwitcher={true} <!-- i18n only -->
107
+ />
108
+ ```
109
+
110
+ ### Footer
111
+
112
+ Four layout variants for different site needs:
113
+
114
+ ```astro
115
+ <Footer
116
+ layout="simple" <!-- simple | columns | minimal | stacked -->
117
+ background="default" <!-- default | secondary | invert -->
118
+ columns={3} <!-- 2 | 3 | 4 (columns layout only) -->
119
+ showSocial={true}
120
+ showCopyright={true}
121
+ socialLinks={[{ platform: 'github', href: '...' }]}
122
+ legalLinks={[{ label: 'Privacy', href: '/privacy' }]}
123
+ />
124
+ ```
125
+
126
+ ### Hero
127
+
128
+ Flexible hero section with multiple layout options:
129
+
130
+ ```astro
131
+ <Hero
132
+ layout="single" <!-- single | split -->
133
+ splitRatio="1:1" <!-- 1:1 | 1:2 | 2:1 -->
134
+ align="left" <!-- left | center | right -->
135
+ background="default" <!-- default | secondary | invert | gradient | image -->
136
+ size="lg" <!-- sm | md | lg | xl -->
137
+ showGrid={true}
138
+ showBlob={true}
139
+ title="Your Title"
140
+ titleHighlight="Title" <!-- text to highlight in brand color -->
141
+ description="..."
142
+ />
143
+ ```
144
+
145
+ ### CTA
146
+
147
+ Reusable call-to-action section:
148
+
149
+ ```astro
150
+ <CTA
151
+ variant="default" <!-- default | invert -->
152
+ size="lg" <!-- sm | md | lg | xl -->
153
+ align="center" <!-- center | left -->
154
+ showLogo={true}
155
+ heading="Ready to start?"
156
+ headingHighlight="start"
157
+ description="Get started in seconds."
158
+ showCopyCommand={true}
159
+ />
160
+ ```
161
+
162
+ ### Button
163
+
164
+ Production-ready button with variants:
165
+
166
+ ```astro
167
+ <Button
168
+ variant="primary" <!-- primary | secondary | outline | ghost | destructive -->
169
+ size="md" <!-- sm | md | lg -->
170
+ colorScheme="default" <!-- default | invert -->
171
+ fullWidth={false}
172
+ icon={false}
173
+ href="/path" <!-- renders as <a> when provided -->
174
+ />
175
+ ```
176
+
177
+ ## Examples
178
+
179
+ ### Minimal Project (fastest)
180
+
181
+ ```bash
182
+ npm create velocity-astro@latest my-site -y --demo=false --components=none
183
+ ```
184
+
185
+ Creates a clean starter with just layouts, SEO components, and basic pages.
186
+
187
+ ### Full-Featured Project
188
+
189
+ ```bash
190
+ npm create velocity-astro@latest my-site --demo --components --i18n
191
+ ```
192
+
193
+ Includes everything: demo landing page, all components, and i18n support.
194
+
195
+ ### Production Site Setup
196
+
197
+ ```bash
198
+ npm create velocity-astro@latest client-site --demo --components=ui,patterns
199
+ ```
200
+
201
+ Demo content to customize, plus UI and form components for building pages.
202
+
203
+ ### i18n Multi-Language Site
204
+
205
+ ```bash
206
+ npm create velocity-astro@latest global-site --i18n --demo
207
+ ```
208
+
209
+ Full i18n support with:
210
+ - Locale-prefixed routes (`/en/`, `/es/`, `/fr/`)
211
+ - Language switcher component
212
+ - Translated navigation and content
213
+ - SEO hreflang tags
214
+
215
+ ### Custom Pages Generation
216
+
217
+ ```bash
218
+ npm create velocity-astro@latest my-site --pages
219
+ ```
220
+
221
+ Interactive prompt to generate starter pages (services, pricing, team, etc.).
222
+
223
+ ## How It Works
224
+
225
+ ### Architecture
226
+
227
+ ```
228
+ User runs CLI
229
+
230
+
231
+ Downloads FULL Velocity repo from GitHub (via giget)
232
+
233
+
234
+ Applies local template overlays (i18n, base)
235
+
236
+
237
+ Configures based on CLI options
238
+
239
+
240
+ Installs dependencies
241
+ ```
242
+
243
+ The CLI downloads the complete [Velocity repository](https://github.com/southwellmedia/velocity) at runtime, then applies configuration overlays based on your selections. This means you always get the latest Velocity features.
244
+
245
+ ### 8-Step Scaffolding Process
246
+
247
+ 1. **Download template** - Fetches Velocity from GitHub via `giget`
248
+ 2. **Configure components** - Filters to selected component categories
249
+ 3. **Apply i18n overlay** - Adds internationalization if enabled
250
+ 4. **Remove demo content** - Strips demo pages if `--demo=false`
251
+ 5. **Generate pages** - Creates starter pages if requested
252
+ 6. **Update package.json** - Sets project name and cleans metadata
253
+ 7. **Initialize git** - Creates git repository with initial commit
254
+ 8. **Install dependencies** - Runs package manager install
255
+
256
+ ### Template Overlay System
257
+
258
+ The CLI uses a template overlay approach:
259
+
260
+ - **Base Velocity**: Downloaded from GitHub (always fresh)
261
+ - **i18n overlay**: Adds locale routing, translations, language switcher
262
+ - **Base template**: Minimal pages for non-demo projects
263
+
264
+ Overlays are applied in order, with later files overwriting earlier ones.
265
+
266
+ ### Component Registry
267
+
268
+ Components are managed via `component-registry.json` in Velocity. The registry defines:
269
+
270
+ - Component files and locations
271
+ - Dependencies between components
272
+ - Required utilities (like `cn` for class merging)
273
+ - Category groupings
274
+
275
+ When you select categories, the CLI resolves all dependencies automatically.
276
+
277
+ ## What's Included
278
+
279
+ Every Velocity project includes:
280
+
281
+ | Feature | Description |
282
+ |---------|-------------|
283
+ | **Astro 6** | Latest Astro with View Transitions |
284
+ | **Tailwind CSS v4** | Modern utility-first CSS with native cascade layers |
285
+ | **TypeScript** | Full type safety throughout |
286
+ | **React** | For interactive islands and components |
287
+ | **MDX** | Write content with JSX components |
288
+ | **SEO** | Meta tags, Open Graph, JSON-LD schemas |
289
+ | **Sitemap** | Auto-generated sitemap.xml |
290
+ | **RSS Feed** | Built-in RSS support |
291
+ | **Dark Mode** | System-aware theme switching |
292
+ | **ESLint + Prettier** | Code quality and formatting |
293
+ | **Analytics Ready** | GA4 and GTM support via env vars |
294
+
295
+ ### Optional Features
296
+
297
+ | Feature | Flag | Description |
298
+ |---------|------|-------------|
299
+ | Demo content | `--demo` | Landing page, sample blog posts, about/contact pages |
300
+ | UI Components | `--components` | 40+ production-ready components |
301
+ | i18n Support | `--i18n` | Multi-language routing and translations |
302
+ | Starter Pages | `--pages` | Generate custom pages interactively |
303
+
304
+ ## Configuration
305
+
306
+ ### Environment Variables
307
+
308
+ Create a `.env` file to configure analytics and verification:
309
+
310
+ ```env
311
+ # Analytics (optional)
312
+ PUBLIC_GA_MEASUREMENT_ID=G-XXXXXXXXXX
313
+ PUBLIC_GTM_ID=GTM-XXXXXXX
314
+
315
+ # Site Verification (optional)
316
+ GOOGLE_SITE_VERIFICATION=your-verification-code
317
+ BING_SITE_VERIFICATION=your-verification-code
318
+
319
+ # Site URL (required for production)
320
+ SITE_URL=https://your-domain.com
321
+ ```
322
+
323
+ ### Site Configuration
324
+
325
+ Edit `src/config/site.config.ts` to customize:
326
+
327
+ ```typescript
328
+ const siteConfig: SiteConfig = {
329
+ name: 'Your Site Name',
330
+ description: 'Your site description',
331
+ url: 'https://your-domain.com',
332
+ author: 'Your Name',
333
+ email: 'hello@example.com',
334
+
335
+ // Branding
336
+ branding: {
337
+ logo: { alt: 'Your Logo' },
338
+ favicon: { svg: '/favicon.svg' },
339
+ colors: {
340
+ themeColor: '#F94C10',
341
+ backgroundColor: '#ffffff',
342
+ },
343
+ },
344
+ };
345
+ ```
346
+
347
+ ### Branding Files
348
+
349
+ Replace these files with your own branding:
350
+
351
+ - `public/favicon.svg` - Site favicon
352
+ - `src/assets/branding/` - Logo SVG files
353
+
354
+ ## Development
355
+
356
+ After scaffolding, run:
357
+
358
+ ```bash
359
+ cd my-site
360
+ npm run dev # Start dev server at localhost:4321
361
+ npm run build # Build for production
362
+ npm run preview # Preview production build
363
+ ```
364
+
365
+ ## Deployment
366
+
367
+ Velocity includes ready-to-use configurations for:
368
+
369
+ - **Vercel** - Zero-config deployment
370
+ - **Netlify** - Includes `netlify.toml`
371
+ - **Cloudflare Pages** - SSR-ready
372
+
373
+ ## Troubleshooting
374
+
375
+ ### Network Errors
376
+
377
+ If template download fails:
378
+ - Check your internet connection
379
+ - Verify GitHub is accessible
380
+ - Try again in a few minutes
381
+
382
+ ### Directory Already Exists
383
+
384
+ The CLI will prompt to overwrite existing directories. Use a new directory name or clear the existing one.
385
+
386
+ ### Permission Errors
387
+
388
+ On Unix systems, you may need to set execute permissions:
389
+
390
+ ```bash
391
+ chmod +x node_modules/.bin/create-velocity-astro
392
+ ```
393
+
394
+ ### Dependency Installation Fails
395
+
396
+ If automatic installation fails:
397
+
398
+ ```bash
399
+ cd my-site
400
+ npm install # or pnpm install / yarn
401
+ ```
402
+
403
+ ## Requirements
404
+
405
+ - **Node.js** 18.0.0 or higher
406
+ - **Package Manager**: npm, pnpm, yarn, or bun
407
+ - **Git** (optional, for repository initialization)
408
+
409
+ ## Related
410
+
411
+ - [Velocity](https://github.com/southwellmedia/velocity) - The Astro starter kit
412
+ - [Astro](https://astro.build) - The web framework
413
+ - [Tailwind CSS](https://tailwindcss.com) - The CSS framework
414
+
415
+ ## License
416
+
417
+ MIT - [Southwell Media](https://southwellmedia.com)