create-ng-tailwind 3.1.0 → 4.1.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.
Potentially problematic release.
This version of create-ng-tailwind might be problematic. Click here for more details.
- package/CHANGELOG.md +96 -341
- package/README.md +111 -157
- package/lib/cli/index.js +74 -3
- package/lib/cli/interactive.js +26 -1
- package/lib/managers/ProjectManager.js +2 -5
- package/lib/templates/base/components.js +243 -0
- package/lib/templates/base/index.js +207 -0
- package/lib/templates/base/infrastructure.js +314 -0
- package/lib/templates/base/linting.js +359 -0
- package/lib/templates/base/pwa.js +103 -0
- package/lib/templates/base/services.js +362 -0
- package/lib/templates/blog/app.js +250 -0
- package/lib/templates/blog/components.js +360 -0
- package/lib/templates/blog/i18n.js +77 -0
- package/lib/templates/blog/index.js +126 -0
- package/lib/templates/blog/pages.js +554 -0
- package/lib/templates/blog/services.js +390 -0
- package/lib/templates/dashboard/app.js +320 -0
- package/lib/templates/dashboard/charts.js +305 -0
- package/lib/templates/dashboard/components.js +410 -0
- package/lib/templates/dashboard/i18n.js +340 -0
- package/lib/templates/dashboard/index.js +141 -0
- package/lib/templates/dashboard/layout.js +310 -0
- package/lib/templates/dashboard/pages.js +681 -0
- package/lib/templates/ecommerce/app.js +315 -0
- package/lib/templates/ecommerce/components.js +496 -0
- package/lib/templates/ecommerce/i18n.js +389 -0
- package/lib/templates/ecommerce/index.js +152 -0
- package/lib/templates/ecommerce/layout.js +270 -0
- package/lib/templates/ecommerce/pages.js +969 -0
- package/lib/templates/ecommerce/services.js +300 -0
- package/lib/templates/index.js +12 -0
- package/lib/templates/landing/index.js +1117 -0
- package/lib/templates/portfolio/index.js +1160 -0
- package/lib/templates/saas/index.js +1371 -0
- package/lib/templates/starter/app.js +364 -0
- package/lib/templates/starter/i18n.js +856 -0
- package/lib/templates/starter/index.js +52 -4060
- package/lib/templates/starter/layout.js +852 -0
- package/lib/templates/starter/pages.js +1241 -0
- package/lib/utils/nodeCompat.js +85 -0
- package/package.json +1 -1
- package/lib/templates/starter/features.js +0 -867
- package/lib/utils/ai-config.js +0 -641
- /package/lib/templates/{starter → base}/advanced-features.js +0 -0
- /package/lib/templates/{starter → base}/seo-assets.js +0 -0
- /package/lib/templates/{starter → base}/seo-features.js +0 -0
- /package/lib/templates/{starter → base}/ui-features.js +0 -0
package/README.md
CHANGED
|
@@ -4,218 +4,172 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://badge.fury.io/js/create-ng-tailwind)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
|
-
[](https://nodejs.org/)
|
|
8
7
|
[](https://www.npmjs.com/package/create-ng-tailwind)
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
**Production-ready Angular + Tailwind CSS starter templates**
|
|
11
10
|
|
|
12
11
|
</div>
|
|
13
12
|
|
|
14
13
|
---
|
|
15
14
|
|
|
16
|
-
## ✨ Features
|
|
17
|
-
|
|
18
|
-
- 🎯 **Angular 20+** - Latest version with standalone components and signals
|
|
19
|
-
- 🎨 **Tailwind CSS v4** - Utility-first CSS framework preconfigured
|
|
20
|
-
- 🚀 **SEO Optimized** - Meta tags, Open Graph, Twitter Cards, structured data, robots.txt
|
|
21
|
-
- 🌍 **i18n Translation** - English & Arabic with RTL support
|
|
22
|
-
- 🎮 **Interactive UI** - Toast notifications, Modal dialogs, and components
|
|
23
|
-
- 🏗️ **Zero Configuration** - Everything set up and ready to go
|
|
24
|
-
|
|
25
15
|
## Quick Start
|
|
26
16
|
|
|
27
|
-
### Using npx (Recommended)
|
|
28
|
-
|
|
29
|
-
Run the following command and follow the prompts:
|
|
30
|
-
|
|
31
17
|
```bash
|
|
32
|
-
npx create-ng-tailwind my-
|
|
18
|
+
npx create-ng-tailwind my-app
|
|
33
19
|
```
|
|
34
20
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
Install globally and use:
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
npm install -g create-ng-tailwind
|
|
41
|
-
create-ng-tailwind my-awesome-app
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### What happens next?
|
|
45
|
-
|
|
46
|
-
The CLI will guide you through:
|
|
47
|
-
1. Choosing a template (Minimal or Starter)
|
|
48
|
-
2. Configuring Server-Side Rendering (optional)
|
|
49
|
-
3. Setting up zoneless application (optional)
|
|
50
|
-
4. Selecting AI tools integration (optional)
|
|
51
|
-
|
|
52
|
-
After setup completes:
|
|
21
|
+
Then follow the prompts to choose your template.
|
|
53
22
|
|
|
54
23
|
```bash
|
|
55
|
-
cd my-
|
|
24
|
+
cd my-app
|
|
56
25
|
npm install
|
|
57
26
|
ng serve
|
|
58
27
|
```
|
|
59
28
|
|
|
60
|
-
Your app
|
|
29
|
+
Your app runs at `http://localhost:4200`
|
|
61
30
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
my-app/
|
|
66
|
-
├── src/
|
|
67
|
-
│ ├── app/
|
|
68
|
-
│ │ ├── core/ # Core services and interceptors
|
|
69
|
-
│ │ │ ├── services/ # Auth, API, SEO, Toast, Modal, etc.
|
|
70
|
-
│ │ │ ├── interceptors/ # HTTP interceptors
|
|
71
|
-
│ │ │ ├── guards/ # Route guards
|
|
72
|
-
│ │ │ ├── i18n/ # Translation service
|
|
73
|
-
│ │ │ └── utils/ # Structured data utilities
|
|
74
|
-
│ │ ├── shared/ # Shared components and utilities
|
|
75
|
-
│ │ │ ├── components/ # Button, Card, Toast, Modal
|
|
76
|
-
│ │ │ ├── pipes/ # Truncate, TimeAgo
|
|
77
|
-
│ │ │ ├── directives/ # ClickOutside, Tooltip
|
|
78
|
-
│ │ │ └── models/ # TypeScript interfaces
|
|
79
|
-
│ │ ├── features/ # Feature modules
|
|
80
|
-
│ │ │ ├── home/ # Home page
|
|
81
|
-
│ │ │ ├── about/ # About page
|
|
82
|
-
│ │ │ ├── contact/ # Contact page
|
|
83
|
-
│ │ │ └── auth/ # Authentication pages
|
|
84
|
-
│ │ ├── layout/ # Layout components
|
|
85
|
-
│ │ │ ├── header/ # Navigation header
|
|
86
|
-
│ │ │ └── footer/ # Footer component
|
|
87
|
-
│ │ ├── app.config.ts # App configuration
|
|
88
|
-
│ │ ├── app.routes.ts # Routing configuration
|
|
89
|
-
│ │ └── app.ts # Main app component
|
|
90
|
-
│ ├── styles.css # Tailwind CSS imports
|
|
91
|
-
│ └── main.ts # Bootstrap
|
|
92
|
-
├── public/
|
|
93
|
-
│ ├── assets/
|
|
94
|
-
│ │ ├── i18n/ # Translation files (en.json, ar.json)
|
|
95
|
-
│ │ └── images/ # OG images, logos
|
|
96
|
-
│ ├── robots.txt # SEO robots file
|
|
97
|
-
│ ├── favicon.svg # Favicon
|
|
98
|
-
│ └── android-chrome-*.svg # PWA icons
|
|
99
|
-
├── .postcssrc.json # PostCSS configuration
|
|
100
|
-
├── package.json
|
|
101
|
-
└── ...
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
## 🎯 Starter Template Features
|
|
105
|
-
|
|
106
|
-
The **Starter Template** includes 25+ production-ready features:
|
|
107
|
-
|
|
108
|
-
### Core Services
|
|
109
|
-
|
|
110
|
-
- **AuthService** - Authentication & user management
|
|
111
|
-
- **ApiService** - Centralized HTTP request handling
|
|
112
|
-
- **SeoService** - Comprehensive SEO management (meta tags, Open Graph, Twitter Cards, structured data)
|
|
113
|
-
- **ToastService** - Notification system (success, error, warning, info)
|
|
114
|
-
- **ModalService** - Dialog system with confirm & alert
|
|
115
|
-
- **LoadingService** - Global loading state with signals
|
|
116
|
-
- **CacheService** - Response caching with TTL
|
|
117
|
-
- **StorageService** - LocalStorage wrapper with type safety
|
|
118
|
-
- **i18nService** - Internationalization management
|
|
119
|
-
|
|
120
|
-
### SEO Optimization (Simple & Ready to Use)
|
|
31
|
+
---
|
|
121
32
|
|
|
122
|
-
|
|
123
|
-
- **Meta Tags** - Title, description, keywords (auto-configured on all pages)
|
|
124
|
-
- **Social Sharing** - Open Graph & Twitter Cards (pre-configured)
|
|
125
|
-
- **Structured Data** - Organization & WebSite schemas (included)
|
|
126
|
-
- **Canonical URLs** - Auto-updated on route changes
|
|
127
|
-
- **Assets** - robots.txt, favicon set, OG image placeholder
|
|
128
|
-
- **Extensible** - Easy to add more schemas as needed
|
|
33
|
+
## Templates
|
|
129
34
|
|
|
130
|
-
###
|
|
35
|
+
### Starter (Recommended)
|
|
131
36
|
|
|
132
|
-
|
|
133
|
-
- **CardComponent** - Flexible container with title & shadow
|
|
134
|
-
- **LoadingSpinnerComponent** - Animated loading indicator
|
|
135
|
-
- **ToastComponent** - Auto-dismiss notifications
|
|
136
|
-
- **ModalComponent** - Accessible dialog with sizes
|
|
37
|
+
Professional foundation with everything you need:
|
|
137
38
|
|
|
138
|
-
|
|
39
|
+
- Header, Footer, Auth pages (Login, Register, Forgot Password)
|
|
40
|
+
- i18n (English & Arabic with RTL)
|
|
41
|
+
- Toast & Modal systems
|
|
42
|
+
- SEO optimization
|
|
43
|
+
- HTTP interceptors (Auth, Error, Loading, Cache)
|
|
44
|
+
- PWA support
|
|
139
45
|
|
|
140
|
-
|
|
141
|
-
- **Directives** - ClickOutside, Tooltip
|
|
142
|
-
- **HTTP Interceptors** - Auth, Error handling, Loading, Caching
|
|
143
|
-
- **TypeScript Path Aliases** - Clean imports with `@core/*`, `@shared/*`, `@features/*`
|
|
46
|
+
### Dashboard
|
|
144
47
|
|
|
145
|
-
|
|
48
|
+
Admin dashboard with:
|
|
146
49
|
|
|
147
|
-
-
|
|
148
|
-
-
|
|
149
|
-
-
|
|
50
|
+
- Collapsible sidebar navigation
|
|
51
|
+
- Stats cards with icons and trends
|
|
52
|
+
- Chart components (Bar, Line, Donut)
|
|
53
|
+
- Data table with sorting & pagination
|
|
54
|
+
- 5 pages: Overview, Analytics, Users, Orders, Settings
|
|
55
|
+
- i18n support (EN/AR) with RTL
|
|
56
|
+
- Dark mode ready
|
|
150
57
|
|
|
151
|
-
###
|
|
58
|
+
### Minimal
|
|
152
59
|
|
|
153
|
-
|
|
154
|
-
- **Authentication Pages** - Login, Register, Forgot Password
|
|
155
|
-
- **Example Pages** - Home, About, Contact with reactive forms
|
|
156
|
-
- **PWA Support** - Service worker configuration
|
|
157
|
-
- **Linting & Formatting** - ESLint + Prettier + simple-git-hooks (pre-commit linting)
|
|
158
|
-
- **Modern Stack** - Tailwind v4, TypeScript, Signals
|
|
60
|
+
Clean slate - just Angular + Tailwind CSS configured.
|
|
159
61
|
|
|
160
|
-
|
|
62
|
+
---
|
|
161
63
|
|
|
162
|
-
|
|
64
|
+
## Features Comparison
|
|
65
|
+
|
|
66
|
+
| Feature | Minimal | Starter | Dashboard |
|
|
67
|
+
| ------------------ | ------- | ------- | --------- |
|
|
68
|
+
| Tailwind CSS v4 | ✅ | ✅ | ✅ |
|
|
69
|
+
| Routing | ✅ | ✅ | ✅ |
|
|
70
|
+
| i18n (EN/AR + RTL) | - | ✅ | ✅ |
|
|
71
|
+
| Auth UI | - | ✅ | - |
|
|
72
|
+
| HTTP Interceptors | - | ✅ | ✅ |
|
|
73
|
+
| Toast/Modal | - | ✅ | ✅ |
|
|
74
|
+
| SEO Service | - | ✅ | ✅ |
|
|
75
|
+
| PWA | - | ✅ | ✅ |
|
|
76
|
+
| ESLint + Prettier | ✅ | ✅ | ✅ |
|
|
77
|
+
| Sidebar Layout | - | - | ✅ |
|
|
78
|
+
| Charts | - | - | ✅ |
|
|
79
|
+
| Data Tables | - | - | ✅ |
|
|
163
80
|
|
|
164
|
-
|
|
165
|
-
- ⚡ **LightningCSS** - Fast CSS processing
|
|
166
|
-
- 🎨 **Modern CSS Features** - Nesting, variables, and more built-in
|
|
167
|
-
- 🚀 **Simplified Build** - No preprocessors needed
|
|
81
|
+
---
|
|
168
82
|
|
|
169
|
-
|
|
83
|
+
## Project Structure
|
|
170
84
|
|
|
171
|
-
|
|
85
|
+
```
|
|
86
|
+
src/app/
|
|
87
|
+
├── core/ # Services, guards, interceptors, i18n
|
|
88
|
+
├── shared/ # Components, pipes, directives
|
|
89
|
+
├── features/ # Page components (home, about, auth...)
|
|
90
|
+
├── layout/ # Header, footer, sidebar
|
|
91
|
+
├── app.config.ts # App configuration
|
|
92
|
+
├── app.routes.ts # Routing
|
|
93
|
+
└── app.ts # Root component
|
|
94
|
+
```
|
|
172
95
|
|
|
173
|
-
|
|
96
|
+
---
|
|
174
97
|
|
|
175
|
-
|
|
176
|
-
- `primary` - Main brand color (with full 50-950 scale)
|
|
177
|
-
- `secondary` - Secondary brand color (with full 50-950 scale)
|
|
178
|
-
- `accent` - Accent/highlight color (with full 50-950 scale)
|
|
179
|
-
- `success` - Success states (green)
|
|
180
|
-
- `danger` - Error/danger states (red)
|
|
181
|
-
- `warning` - Warning states (yellow/orange)
|
|
182
|
-
- `info` - Informational states (blue)
|
|
98
|
+
## Theming
|
|
183
99
|
|
|
184
|
-
|
|
185
|
-
Simply edit `src/styles.css` and change the color values in the `@theme` block. All components automatically update!
|
|
100
|
+
Edit `src/styles.css` to customize colors:
|
|
186
101
|
|
|
187
102
|
```css
|
|
188
103
|
@theme {
|
|
189
|
-
--color-primary-500: #3b82f6;
|
|
104
|
+
--color-primary-500: #3b82f6;
|
|
190
105
|
--color-secondary-500: #06b6d4;
|
|
191
106
|
--color-accent-500: #a855f7;
|
|
192
|
-
/* ... complete color scales included */
|
|
193
107
|
}
|
|
194
108
|
```
|
|
195
109
|
|
|
196
|
-
|
|
110
|
+
Use in templates:
|
|
111
|
+
|
|
197
112
|
```html
|
|
198
|
-
<
|
|
199
|
-
<div class="bg-secondary-500">Secondary element</div>
|
|
200
|
-
<p class="text-danger-600">Error message</p>
|
|
113
|
+
<button class="bg-primary-500 text-white">Click me</button>
|
|
201
114
|
```
|
|
202
115
|
|
|
203
|
-
|
|
116
|
+
---
|
|
204
117
|
|
|
205
|
-
##
|
|
118
|
+
## CLI Options
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# Interactive (default)
|
|
122
|
+
npx create-ng-tailwind my-app
|
|
123
|
+
|
|
124
|
+
# With options
|
|
125
|
+
npx create-ng-tailwind my-app --template=starter --ssr --zoneless
|
|
126
|
+
|
|
127
|
+
# Available templates
|
|
128
|
+
--template=<minimal|starter|dashboard>
|
|
129
|
+
|
|
130
|
+
# Other flags
|
|
131
|
+
--ssr # Enable Server-Side Rendering
|
|
132
|
+
--zoneless # Create zoneless application
|
|
133
|
+
--ai-config # Configure AI tools (Claude, Cursor, etc.)
|
|
134
|
+
--ng-version=<v> # Pin Angular CLI version (latest|21|20|19).
|
|
135
|
+
# Default: auto-pick the highest version compatible
|
|
136
|
+
# with your current Node.js runtime.
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
206
140
|
|
|
207
|
-
|
|
141
|
+
## Node.js / Angular Compatibility
|
|
208
142
|
|
|
209
|
-
|
|
143
|
+
This CLI auto-detects your Node.js version and picks the highest compatible Angular CLI release. You don't normally need to think about it — but if you want to pin a specific Angular version, pass `--ng-version=<v>`.
|
|
210
144
|
|
|
211
|
-
|
|
145
|
+
| Angular CLI | Required Node.js |
|
|
146
|
+
| ----------- | --------------------------------- |
|
|
147
|
+
| 22 (latest) | `^22.22.3 \|\| ^24.15.0 \|\| >=26.0.0` |
|
|
148
|
+
| 21 | `^20.19.0 \|\| ^22.12.0 \|\| >=24.0.0` |
|
|
149
|
+
| 20 | `^20.11.1 \|\| ^22.0.0 \|\| ^24.0.0` |
|
|
150
|
+
| 19 | `^18.19.1 \|\| ^20.11.1 \|\| ^22.0.0` |
|
|
212
151
|
|
|
213
|
-
|
|
214
|
-
- 🔄 **Share** with your developer friends
|
|
215
|
-
- 📧 **Contact**: [tehseen_ullah786@hotmail.com](mailto:tehseen_ullah786@hotmail.com)
|
|
152
|
+
If no Angular version supports your Node, the CLI prints an upgrade hint and exits.
|
|
216
153
|
|
|
217
154
|
---
|
|
218
155
|
|
|
156
|
+
## Requirements
|
|
157
|
+
|
|
158
|
+
- Node.js 18+ (Node 20.11.1+ recommended for Angular 20+)
|
|
159
|
+
- npm 9+
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## License
|
|
164
|
+
|
|
165
|
+
MIT
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Support
|
|
170
|
+
|
|
171
|
+
- Contact: [tehseen_ullah786@hotmail.com](mailto:tehseen_ullah786@hotmail.com)
|
|
172
|
+
|
|
219
173
|
<div align="center">
|
|
220
174
|
|
|
221
175
|
[](https://www.npmjs.com/package/create-ng-tailwind)
|
package/lib/cli/index.js
CHANGED
|
@@ -3,6 +3,12 @@ const inquirer = require("inquirer");
|
|
|
3
3
|
const chalk = require("chalk");
|
|
4
4
|
const CLI = require("./interactive");
|
|
5
5
|
const { createLogger } = require("../utils/logger");
|
|
6
|
+
const {
|
|
7
|
+
ANGULAR_COMPAT,
|
|
8
|
+
pickAngularVersion,
|
|
9
|
+
satisfies,
|
|
10
|
+
buildIncompatMessage,
|
|
11
|
+
} = require("../utils/nodeCompat");
|
|
6
12
|
|
|
7
13
|
class CLIHandler {
|
|
8
14
|
constructor() {
|
|
@@ -15,7 +21,7 @@ class CLIHandler {
|
|
|
15
21
|
.description("Create Angular projects with Tailwind CSS")
|
|
16
22
|
.version(require("../../package.json").version)
|
|
17
23
|
.argument("[project-name]", "Project name")
|
|
18
|
-
.option("-t, --template <template>", "Template to use (minimal, starter)")
|
|
24
|
+
.option("-t, --template <template>", "Template to use (minimal, starter, dashboard)")
|
|
19
25
|
.option("--routing", "Enable Angular routing")
|
|
20
26
|
.option("--no-routing", "Disable Angular routing")
|
|
21
27
|
.option(
|
|
@@ -27,6 +33,10 @@ class CLIHandler {
|
|
|
27
33
|
"--ai-config <tools>",
|
|
28
34
|
"AI tools to configure (none, claude, cursor, gemini, copilot, jetbrains, windsurf)",
|
|
29
35
|
)
|
|
36
|
+
.option(
|
|
37
|
+
"--ng-version <version>",
|
|
38
|
+
"Pin Angular CLI version (e.g. latest, 21, 20, 19). Default: auto-pick highest compatible with current Node",
|
|
39
|
+
)
|
|
30
40
|
.option("--skip-install", "Skip npm install")
|
|
31
41
|
.parse();
|
|
32
42
|
|
|
@@ -64,15 +74,41 @@ class CLIHandler {
|
|
|
64
74
|
type: "list",
|
|
65
75
|
name: "template",
|
|
66
76
|
message: "Which template would you like to use?",
|
|
77
|
+
pageSize: 10,
|
|
67
78
|
choices: [
|
|
68
79
|
{
|
|
69
|
-
name: "Minimal - Clean Angular + Tailwind CSS (zero features
|
|
80
|
+
name: "Minimal - Clean Angular + Tailwind CSS (zero features)",
|
|
70
81
|
value: "minimal",
|
|
71
82
|
},
|
|
72
83
|
{
|
|
73
|
-
name: "Starter - Professional foundation (routing, i18n, auth
|
|
84
|
+
name: "Starter - Professional foundation (routing, i18n, auth, services)",
|
|
74
85
|
value: "starter",
|
|
75
86
|
},
|
|
87
|
+
{
|
|
88
|
+
name: "Dashboard - Admin panel with sidebar, charts, and analytics",
|
|
89
|
+
value: "dashboard",
|
|
90
|
+
},
|
|
91
|
+
// TODO: Enable these templates in future releases
|
|
92
|
+
// {
|
|
93
|
+
// name: "Ecommerce - Online store with products, cart, and checkout",
|
|
94
|
+
// value: "ecommerce",
|
|
95
|
+
// },
|
|
96
|
+
// {
|
|
97
|
+
// name: "Blog - CMS with posts, categories, tags, and comments",
|
|
98
|
+
// value: "blog",
|
|
99
|
+
// },
|
|
100
|
+
// {
|
|
101
|
+
// name: "SaaS - Pricing, subscriptions, and user dashboard",
|
|
102
|
+
// value: "saas",
|
|
103
|
+
// },
|
|
104
|
+
// {
|
|
105
|
+
// name: "Portfolio - Projects showcase, skills, and resume",
|
|
106
|
+
// value: "portfolio",
|
|
107
|
+
// },
|
|
108
|
+
// {
|
|
109
|
+
// name: "Landing - Marketing page with hero, features, and pricing",
|
|
110
|
+
// value: "landing",
|
|
111
|
+
// },
|
|
76
112
|
],
|
|
77
113
|
default: "starter",
|
|
78
114
|
},
|
|
@@ -141,7 +177,41 @@ class CLIHandler {
|
|
|
141
177
|
return answers;
|
|
142
178
|
}
|
|
143
179
|
|
|
180
|
+
resolveAngularVersion(requested) {
|
|
181
|
+
const nodeVer = process.versions.node;
|
|
182
|
+
|
|
183
|
+
// User explicitly pinned a version — honor it, but warn if known-incompatible.
|
|
184
|
+
if (requested) {
|
|
185
|
+
const entry = ANGULAR_COMPAT.find((e) => e.version === requested);
|
|
186
|
+
if (entry && !satisfies(nodeVer, entry.nodeRanges)) {
|
|
187
|
+
this.logger.warn(
|
|
188
|
+
`Angular ${requested} requires Node ${entry.nodeRanges.join(" || ")}, but you're on ${nodeVer}. Proceeding anyway — expect engine warnings.`,
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
return { version: requested, label: entry ? entry.label : `Angular ${requested}`, pinned: true };
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Auto-pick the highest compatible version.
|
|
195
|
+
const picked = pickAngularVersion(nodeVer);
|
|
196
|
+
if (!picked) {
|
|
197
|
+
console.error(chalk.red("\n❌ Incompatible Node.js version\n"));
|
|
198
|
+
console.error(buildIncompatMessage(nodeVer));
|
|
199
|
+
process.exit(1);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// Tell the user when we fell back from latest.
|
|
203
|
+
if (picked.version !== "latest") {
|
|
204
|
+
this.logger.info(
|
|
205
|
+
`Node ${nodeVer} doesn't support Angular latest — using ${picked.label}. Pass --ng-version=latest to override.`,
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
return { ...picked, pinned: false };
|
|
210
|
+
}
|
|
211
|
+
|
|
144
212
|
async buildConfiguration(options, projectName, configOptions) {
|
|
213
|
+
const angular = this.resolveAngularVersion(options.ngVersion);
|
|
214
|
+
|
|
145
215
|
const config = {
|
|
146
216
|
projectName,
|
|
147
217
|
template: options.template || "starter",
|
|
@@ -150,6 +220,7 @@ class CLIHandler {
|
|
|
150
220
|
ssr: configOptions.ssr || false,
|
|
151
221
|
zoneless: configOptions.zoneless || false,
|
|
152
222
|
aiConfig: configOptions.aiConfig || ["none"], // Array of AI tools
|
|
223
|
+
angularVersion: angular.version,
|
|
153
224
|
skipInstall: options.skipInstall || false,
|
|
154
225
|
fullPath: require("path").resolve(process.cwd(), projectName),
|
|
155
226
|
};
|
package/lib/cli/interactive.js
CHANGED
|
@@ -6,15 +6,40 @@ async function getInteractiveOptions() {
|
|
|
6
6
|
type: "list",
|
|
7
7
|
name: "template",
|
|
8
8
|
message: "Which template would you like to use?",
|
|
9
|
+
pageSize: 10,
|
|
9
10
|
choices: [
|
|
10
11
|
{
|
|
11
12
|
name: "Minimal - Clean Angular + Tailwind CSS (zero features, build your own way)",
|
|
12
13
|
value: "minimal",
|
|
13
14
|
},
|
|
14
15
|
{
|
|
15
|
-
name: "Starter - Professional foundation (routing, i18n, auth UI, components, services
|
|
16
|
+
name: "Starter - Professional foundation (routing, i18n, auth UI, components, services)",
|
|
16
17
|
value: "starter",
|
|
17
18
|
},
|
|
19
|
+
{
|
|
20
|
+
name: "Dashboard - Admin dashboard with sidebar, charts, tables, and analytics",
|
|
21
|
+
value: "dashboard",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "Ecommerce - Online store with products, cart, checkout, and wishlist",
|
|
25
|
+
value: "ecommerce",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "Blog - Content management with posts, categories, tags, and comments",
|
|
29
|
+
value: "blog",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "SaaS - Pricing page, subscription management, and user dashboard",
|
|
33
|
+
value: "saas",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: "Portfolio - Projects showcase, skills, experience timeline, and resume",
|
|
37
|
+
value: "portfolio",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "Landing - Marketing page with hero, features, testimonials, pricing, FAQ",
|
|
41
|
+
value: "landing",
|
|
42
|
+
},
|
|
18
43
|
],
|
|
19
44
|
default: "starter",
|
|
20
45
|
},
|
|
@@ -2,7 +2,6 @@ const fs = require('fs-extra');
|
|
|
2
2
|
const execa = require('execa');
|
|
3
3
|
const TailwindManager = require('./TailwindManager');
|
|
4
4
|
const TemplateManager = require('./TemplateManager');
|
|
5
|
-
const { createAIConfigs } = require('../utils/ai-config');
|
|
6
5
|
|
|
7
6
|
class ProjectManager {
|
|
8
7
|
constructor(config, logger) {
|
|
@@ -40,9 +39,6 @@ class ProjectManager {
|
|
|
40
39
|
|
|
41
40
|
// Apply template
|
|
42
41
|
await this.templateManager.apply();
|
|
43
|
-
|
|
44
|
-
// Create AI configuration files (CLAUDE.md + tool-specific)
|
|
45
|
-
await createAIConfigs(this.config.fullPath, this.config.projectName, this.config.aiConfig);
|
|
46
42
|
}
|
|
47
43
|
|
|
48
44
|
async createAngularProject() {
|
|
@@ -55,7 +51,8 @@ class ProjectManager {
|
|
|
55
51
|
const zoneless = this.config.zoneless || false;
|
|
56
52
|
const aiConfig = this.config.aiConfig || ['none'];
|
|
57
53
|
|
|
58
|
-
|
|
54
|
+
const ngVersion = this.config.angularVersion || "latest";
|
|
55
|
+
let cmd = `npx @angular/cli@${ngVersion} new ${this.config.projectName}`;
|
|
59
56
|
cmd += ` --routing=${routing}`;
|
|
60
57
|
cmd += ` --style=css`; // Always use CSS (Tailwind v4 official approach)
|
|
61
58
|
cmd += ` --ssr=${ssr}`;
|