create-velocity-astro 1.3.0 → 1.4.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.
package/README.md CHANGED
@@ -1,16 +1,16 @@
1
1
  # create-velocity-astro
2
2
 
3
- Scaffold production-ready [Velocity](https://github.com/southwellmedia-dev/velocity) projects in seconds.
3
+ Scaffold production-ready [Velocity](https://github.com/southwellmedia/velocity) projects in seconds.
4
4
 
5
- Velocity is an opinionated Astro 6 + Tailwind CSS v4 starter kit used by Southwell Media to deliver production client sites.
5
+ Velocity is an opinionated Astro 6 + Tailwind CSS v4 starter kit with 27+ components, i18n support, SEO optimization, and deployment-ready configuration.
6
6
 
7
- ## Usage
7
+ ## Quick Start
8
8
 
9
9
  ```bash
10
10
  # npm
11
11
  npm create velocity-astro@latest my-site
12
12
 
13
- # pnpm
13
+ # pnpm (recommended)
14
14
  pnpm create velocity-astro my-site
15
15
 
16
16
  # yarn
@@ -20,85 +20,282 @@ yarn create velocity-astro my-site
20
20
  bun create velocity-astro my-site
21
21
  ```
22
22
 
23
- ## Options
23
+ ## CLI Options
24
24
 
25
- | Flag | Description |
26
- |------|-------------|
27
- | `--demo` | Include demo landing page and sample content |
28
- | `--components` | Include UI component library (buttons, forms, cards, etc.) |
29
- | `--i18n` | Add internationalization support with locale routing |
30
- | `--yes`, `-y` | Skip prompts and use default options |
31
- | `--help`, `-h` | Show help message |
32
- | `--version`, `-v` | Show version number |
25
+ | Flag | Type | Default | Description |
26
+ |------|------|---------|-------------|
27
+ | `--demo` | boolean | prompt | Include demo landing page and sample content |
28
+ | `--components` | string | prompt | Component selection (see below) |
29
+ | `--i18n` | boolean | prompt | Add internationalization support |
30
+ | `--pages` | boolean | false | Generate starter pages interactively |
31
+ | `-y, --yes` | boolean | false | Skip prompts, use defaults |
32
+ | `-h, --help` | - | - | Show help message |
33
+ | `-v, --version` | - | - | Show version number |
34
+
35
+ ### Component Selection
36
+
37
+ The `--components` flag controls which UI components are included:
38
+
39
+ ```bash
40
+ # Include all components (default with -y)
41
+ --components
42
+ --components=all
43
+
44
+ # Exclude all optional components
45
+ --components=none
46
+
47
+ # Include specific categories
48
+ --components=ui
49
+ --components=ui,patterns
50
+ --components=ui,patterns,hero
51
+ ```
52
+
53
+ **Component Categories:**
54
+
55
+ | Category | Components | Count |
56
+ |----------|------------|-------|
57
+ | `ui` | Button, Input, Card, Badge, Alert, Dialog, Tabs, Select, Checkbox, Radio, Textarea, Tooltip, Dropdown, Skeleton, Logo, CodeBlock, SocialProof, Avatar, TerminalDemo, VerticalTabs, CTA | 21 |
58
+ | `patterns` | ContactForm, NewsletterForm, FormField | 3 |
59
+ | `hero` | Hero (flexible hero section) | 1 |
33
60
 
34
61
  ## Examples
35
62
 
36
- ### Create a minimal project
63
+ ### Minimal Project (fastest)
37
64
 
38
65
  ```bash
39
- npm create velocity-astro@latest my-site
66
+ npm create velocity-astro@latest my-site -y --demo=false --components=none
40
67
  ```
41
68
 
42
- This gives you a clean starter with:
43
- - Basic index, blog, and 404 pages
44
- - Layouts and configuration
45
- - SEO components
46
- - Tailwind CSS v4 setup
69
+ Creates a clean starter with just layouts, SEO components, and basic pages.
47
70
 
48
- ### Create a project with demo content
71
+ ### Full-Featured Project
49
72
 
50
73
  ```bash
51
- npm create velocity-astro@latest my-site --demo
74
+ npm create velocity-astro@latest my-site --demo --components --i18n
52
75
  ```
53
76
 
54
- Includes the full demo landing page with:
55
- - Hero, features, CTA sections
56
- - Sample blog posts
57
- - About and contact pages
77
+ Includes everything: demo landing page, all components, and i18n support.
58
78
 
59
- ### Include the UI component library
79
+ ### Production Site Setup
60
80
 
61
81
  ```bash
62
- npm create velocity-astro@latest my-site --components
82
+ npm create velocity-astro@latest client-site --demo --components=ui,patterns
63
83
  ```
64
84
 
65
- Adds 27+ production-ready components:
66
- - Button, Input, Textarea, Select, Checkbox, Radio
67
- - Card, Alert, Badge, Avatar, Skeleton
68
- - Dialog, Dropdown, Tabs, Tooltip
69
- - And more...
85
+ Demo content to customize, plus UI and form components for building pages.
70
86
 
71
- ### Full-featured project
87
+ ### i18n Multi-Language Site
72
88
 
73
89
  ```bash
74
- npm create velocity-astro@latest my-site --demo --components --i18n
90
+ npm create velocity-astro@latest global-site --i18n --demo
75
91
  ```
76
92
 
77
- ### Skip prompts with defaults
93
+ Full i18n support with:
94
+ - Locale-prefixed routes (`/en/`, `/es/`, `/fr/`)
95
+ - Language switcher component
96
+ - Translated navigation and content
97
+ - SEO hreflang tags
98
+
99
+ ### Custom Pages Generation
78
100
 
79
101
  ```bash
80
- npm create velocity-astro@latest my-site -y
102
+ npm create velocity-astro@latest my-site --pages
103
+ ```
104
+
105
+ Interactive prompt to generate starter pages (services, pricing, team, etc.).
106
+
107
+ ## How It Works
108
+
109
+ ### Architecture
110
+
81
111
  ```
112
+ User runs CLI
113
+
114
+
115
+ Downloads FULL Velocity repo from GitHub (via giget)
116
+
117
+
118
+ Applies local template overlays (i18n, base)
119
+
120
+
121
+ Configures based on CLI options
122
+
123
+
124
+ Installs dependencies
125
+ ```
126
+
127
+ 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.
128
+
129
+ ### 8-Step Scaffolding Process
130
+
131
+ 1. **Download template** - Fetches Velocity from GitHub via `giget`
132
+ 2. **Configure components** - Filters to selected component categories
133
+ 3. **Apply i18n overlay** - Adds internationalization if enabled
134
+ 4. **Remove demo content** - Strips demo pages if `--demo=false`
135
+ 5. **Generate pages** - Creates starter pages if requested
136
+ 6. **Update package.json** - Sets project name and cleans metadata
137
+ 7. **Initialize git** - Creates git repository with initial commit
138
+ 8. **Install dependencies** - Runs package manager install
139
+
140
+ ### Template Overlay System
141
+
142
+ The CLI uses a template overlay approach:
143
+
144
+ - **Base Velocity**: Downloaded from GitHub (always fresh)
145
+ - **i18n overlay**: Adds locale routing, translations, language switcher
146
+ - **Base template**: Minimal pages for non-demo projects
147
+
148
+ Overlays are applied in order, with later files overwriting earlier ones.
149
+
150
+ ### Component Registry
151
+
152
+ Components are managed via `component-registry.json` in Velocity. The registry defines:
153
+
154
+ - Component files and locations
155
+ - Dependencies between components
156
+ - Required utilities (like `cn` for class merging)
157
+ - Category groupings
158
+
159
+ When you select categories, the CLI resolves all dependencies automatically.
82
160
 
83
161
  ## What's Included
84
162
 
85
- Every Velocity project comes with:
163
+ Every Velocity project includes:
164
+
165
+ | Feature | Description |
166
+ |---------|-------------|
167
+ | **Astro 6** | Latest Astro with View Transitions |
168
+ | **Tailwind CSS v4** | Modern utility-first CSS with native cascade layers |
169
+ | **TypeScript** | Full type safety throughout |
170
+ | **React** | For interactive islands and components |
171
+ | **MDX** | Write content with JSX components |
172
+ | **SEO** | Meta tags, Open Graph, JSON-LD schemas |
173
+ | **Sitemap** | Auto-generated sitemap.xml |
174
+ | **RSS Feed** | Built-in RSS support |
175
+ | **Dark Mode** | System-aware theme switching |
176
+ | **ESLint + Prettier** | Code quality and formatting |
177
+ | **Analytics Ready** | GA4 and GTM support via env vars |
178
+
179
+ ### Optional Features
180
+
181
+ | Feature | Flag | Description |
182
+ |---------|------|-------------|
183
+ | Demo content | `--demo` | Landing page, sample blog posts, about/contact pages |
184
+ | UI Components | `--components` | 27+ production-ready components |
185
+ | i18n Support | `--i18n` | Multi-language routing and translations |
186
+ | Starter Pages | `--pages` | Generate custom pages interactively |
187
+
188
+ ## Configuration
189
+
190
+ ### Environment Variables
191
+
192
+ Create a `.env` file to configure analytics and verification:
86
193
 
87
- - **Astro 6** - The web framework for content-driven websites
88
- - **Tailwind CSS v4** - Utility-first CSS framework
89
- - **TypeScript** - Type safety out of the box
90
- - **React** - For interactive islands
91
- - **MDX** - Write content with JSX components
92
- - **SEO** - Meta tags, Open Graph, JSON-LD schemas
93
- - **Sitemap** - Auto-generated sitemap.xml
94
- - **ESLint + Prettier** - Code quality and formatting
95
- - **Deployment configs** - Vercel, Netlify, Cloudflare ready
194
+ ```env
195
+ # Analytics (optional)
196
+ PUBLIC_GA_MEASUREMENT_ID=G-XXXXXXXXXX
197
+ PUBLIC_GTM_ID=GTM-XXXXXXX
198
+
199
+ # Site Verification (optional)
200
+ GOOGLE_SITE_VERIFICATION=your-verification-code
201
+ BING_SITE_VERIFICATION=your-verification-code
202
+
203
+ # Site URL (required for production)
204
+ SITE_URL=https://your-domain.com
205
+ ```
206
+
207
+ ### Site Configuration
208
+
209
+ Edit `src/config/site.config.ts` to customize:
210
+
211
+ ```typescript
212
+ const siteConfig: SiteConfig = {
213
+ name: 'Your Site Name',
214
+ description: 'Your site description',
215
+ url: 'https://your-domain.com',
216
+ author: 'Your Name',
217
+ email: 'hello@example.com',
218
+
219
+ // Branding
220
+ branding: {
221
+ logo: { alt: 'Your Logo' },
222
+ favicon: { svg: '/favicon.svg' },
223
+ colors: {
224
+ themeColor: '#F94C10',
225
+ backgroundColor: '#ffffff',
226
+ },
227
+ },
228
+ };
229
+ ```
230
+
231
+ ### Branding Files
232
+
233
+ Replace these files with your own branding:
234
+
235
+ - `public/favicon.svg` - Site favicon
236
+ - `src/assets/branding/` - Logo SVG files
237
+
238
+ ## Development
239
+
240
+ After scaffolding, run:
241
+
242
+ ```bash
243
+ cd my-site
244
+ npm run dev # Start dev server at localhost:4321
245
+ npm run build # Build for production
246
+ npm run preview # Preview production build
247
+ ```
248
+
249
+ ## Deployment
250
+
251
+ Velocity includes ready-to-use configurations for:
252
+
253
+ - **Vercel** - Zero-config deployment
254
+ - **Netlify** - Includes `netlify.toml`
255
+ - **Cloudflare Pages** - SSR-ready
256
+
257
+ ## Troubleshooting
258
+
259
+ ### Network Errors
260
+
261
+ If template download fails:
262
+ - Check your internet connection
263
+ - Verify GitHub is accessible
264
+ - Try again in a few minutes
265
+
266
+ ### Directory Already Exists
267
+
268
+ The CLI will prompt to overwrite existing directories. Use a new directory name or clear the existing one.
269
+
270
+ ### Permission Errors
271
+
272
+ On Unix systems, you may need to set execute permissions:
273
+
274
+ ```bash
275
+ chmod +x node_modules/.bin/create-velocity-astro
276
+ ```
277
+
278
+ ### Dependency Installation Fails
279
+
280
+ If automatic installation fails:
281
+
282
+ ```bash
283
+ cd my-site
284
+ npm install # or pnpm install / yarn
285
+ ```
96
286
 
97
287
  ## Requirements
98
288
 
99
- - Node.js 18.0.0 or higher
100
- - pnpm, npm, yarn, or bun
289
+ - **Node.js** 18.0.0 or higher
290
+ - **Package Manager**: npm, pnpm, yarn, or bun
291
+ - **Git** (optional, for repository initialization)
292
+
293
+ ## Related
294
+
295
+ - [Velocity](https://github.com/southwellmedia/velocity) - The Astro starter kit
296
+ - [Astro](https://astro.build) - The web framework
297
+ - [Tailwind CSS](https://tailwindcss.com) - The CSS framework
101
298
 
102
299
  ## License
103
300
 
104
- MIT - Southwell Media
301
+ MIT - [Southwell Media](https://southwellmedia.com)