create-ng-tailwind 2.0.2 โ 3.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/CHANGELOG.md +120 -0
- package/README.md +115 -177
- package/lib/managers/ProjectManager.js +19 -27
- package/lib/templates/starter/advanced-features.js +9 -10
- package/lib/templates/starter/features.js +228 -61
- package/lib/templates/starter/index.js +272 -216
- package/lib/templates/starter/seo-assets.js +141 -0
- package/lib/templates/starter/seo-features.js +290 -0
- package/lib/templates/starter/ui-features.js +1 -2
- package/lib/utils/ai-config.js +97 -58
- package/package.json +3 -4
- package/CLAUDE.md +0 -178
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,126 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [3.0.0] - 2025-11-30
|
|
9
|
+
|
|
10
|
+
### ๐ฅ Breaking Changes
|
|
11
|
+
|
|
12
|
+
- **Angular CLI Alignment**: Now fully relies on Angular CLI for project configuration
|
|
13
|
+
- Removed custom `ensureZoneJs()` method - Angular CLI handles zone.js natively
|
|
14
|
+
- Explicitly passes `--zoneless=false` or `--zoneless=true` to Angular CLI in non-interactive mode
|
|
15
|
+
- Projects now match exactly what `ng new` produces interactively
|
|
16
|
+
|
|
17
|
+
### ๐ Bug Fixes
|
|
18
|
+
|
|
19
|
+
- **zone.js Configuration**: Fixed issue where zone.js was not being properly configured when selecting "No" for zoneless application
|
|
20
|
+
- Fixes runtime error `NG0908: In this configuration Angular requires Zone.js`
|
|
21
|
+
|
|
22
|
+
## [2.2.0] - 2025-11-01
|
|
23
|
+
|
|
24
|
+
### โจ New Features - Comprehensive Tailwind v4 Theming System
|
|
25
|
+
|
|
26
|
+
- **Complete Theme System using Tailwind v4 @theme directive**:
|
|
27
|
+
- Added comprehensive color theming with 7 semantic color scales (primary, secondary, accent, success, danger, warning, info)
|
|
28
|
+
- Each color includes full 50-950 scale for maximum flexibility
|
|
29
|
+
- All colors defined using modern `@theme` directive in `styles.css`
|
|
30
|
+
- Automatic utility class generation (bg-*, text-*, border-*, ring-*, etc.)
|
|
31
|
+
|
|
32
|
+
- **Theme Customization**:
|
|
33
|
+
- Easy customization by editing CSS custom properties in `styles.css`
|
|
34
|
+
- Clear documentation and usage examples in theme configuration
|
|
35
|
+
- All components automatically update when theme colors change
|
|
36
|
+
- No JavaScript configuration needed - pure CSS approach
|
|
37
|
+
|
|
38
|
+
- **Updated All Components to Use Theme Colors**:
|
|
39
|
+
- ButtonComponent: Uses primary, secondary, and danger theme colors
|
|
40
|
+
- ToastComponent: Uses success, danger, warning, and info colors
|
|
41
|
+
- LoadingSpinnerComponent: Supports all theme color variants
|
|
42
|
+
- Contact page: Gradient backgrounds using primary, secondary, and accent
|
|
43
|
+
- Header component: Navigation and active states use primary theme
|
|
44
|
+
- Home & About pages: Hero sections and feature cards use theme colors
|
|
45
|
+
- Auth pages: Login, Register, Forgot Password use primary theme
|
|
46
|
+
- Footer: Links use primary theme colors
|
|
47
|
+
|
|
48
|
+
- **Developer Experience**:
|
|
49
|
+
- Comprehensive inline documentation in `styles.css`
|
|
50
|
+
- Usage examples for all theme colors
|
|
51
|
+
- Clear instructions for customization
|
|
52
|
+
- Consistent color usage across all generated components
|
|
53
|
+
|
|
54
|
+
### ๐จ Design Improvements
|
|
55
|
+
|
|
56
|
+
- Replaced all hardcoded blue, cyan, red, green colors with semantic theme colors
|
|
57
|
+
- Updated gradients to use primary-secondary-accent combinations
|
|
58
|
+
- Error states now use danger theme color instead of hardcoded red
|
|
59
|
+
- Success states use success theme color instead of hardcoded green
|
|
60
|
+
- Info messages use info theme color
|
|
61
|
+
- Warning states use warning theme color
|
|
62
|
+
|
|
63
|
+
## [2.1.1] - 2025-10-30
|
|
64
|
+
|
|
65
|
+
### ๐ Fixed
|
|
66
|
+
|
|
67
|
+
- **SSR Hydration Error in Contact Form**: Fixed NG0500 hydration mismatch in contact component textarea
|
|
68
|
+
- Removed whitespace between textarea opening and closing tags
|
|
69
|
+
- Prevents "Angular expected a text node but the node was not found" error
|
|
70
|
+
- Ensures proper SSR hydration when Server-Side Rendering is enabled
|
|
71
|
+
|
|
72
|
+
- **AI Config Prettier Formatting**: All AI configuration templates (CLAUDE.md, .cursorrules, .windsurfrules) now pass Prettier formatting checks automatically
|
|
73
|
+
- Added empty lines before code blocks for proper markdown formatting
|
|
74
|
+
- Added parentheses around arrow function parameters (arrowParens: "always")
|
|
75
|
+
- Reordered Tailwind CSS classes according to prettier-plugin-tailwindcss
|
|
76
|
+
- Added trailing commas in objects and arrays per Prettier config
|
|
77
|
+
- Fixed HTML example indentation and structure
|
|
78
|
+
- Renamed Claude file to CLAUDE.md (uppercase) to match Angular CLI convention
|
|
79
|
+
- Scaffolded projects now pass `npm run format:check` without manual fixes
|
|
80
|
+
|
|
81
|
+
## [2.1.0] - 2025-10-28
|
|
82
|
+
|
|
83
|
+
### โจ New Features - Simple SEO Solution
|
|
84
|
+
|
|
85
|
+
- **Simple SEO Service** (Easy to use, easy to extend):
|
|
86
|
+
- โ
Dynamic meta tags (title, description, keywords)
|
|
87
|
+
- โ
Open Graph tags for social sharing (Facebook, LinkedIn)
|
|
88
|
+
- โ
Twitter Card tags for optimized sharing
|
|
89
|
+
- โ
Canonical URL management (auto-updated on route changes)
|
|
90
|
+
- โ
Structured data (JSON-LD) support
|
|
91
|
+
- ๐ฏ **Only 2 methods**: `updateMeta()` and `addStructuredData()` - that's it!
|
|
92
|
+
- ๐ Well-documented with clear examples
|
|
93
|
+
- ๐ง Developers can easily extend with more features as needed
|
|
94
|
+
|
|
95
|
+
- **Essential Structured Data**:
|
|
96
|
+
- โ
Organization schema (company info, logo, social profiles)
|
|
97
|
+
- โ
WebSite schema (site name, description)
|
|
98
|
+
- ๐ก Comment in code shows how to add more schemas (Article, Product, FAQ, etc.)
|
|
99
|
+
- ๐ฏ Keep it simple - only what's actually being used
|
|
100
|
+
|
|
101
|
+
- **SEO Assets**:
|
|
102
|
+
- `robots.txt` - Properly configured for Angular apps with sitemap reference
|
|
103
|
+
- Default Open Graph image (1200x630px SVG placeholder)
|
|
104
|
+
- Complete favicon set (SVG with project initial)
|
|
105
|
+
- Apple Touch Icon for iOS devices
|
|
106
|
+
- Android Chrome icons (192x192 and 512x512)
|
|
107
|
+
- Logo SVG with project branding
|
|
108
|
+
- All placeholders include clear instructions for replacement
|
|
109
|
+
|
|
110
|
+
- **Pre-Integrated & Ready to Use**:
|
|
111
|
+
- โ
All page components (Home, About, Contact) have SEO meta tags configured
|
|
112
|
+
- โ
App component includes Organization and WebSite structured data
|
|
113
|
+
- โ
SEO service auto-updates canonical URLs on navigation
|
|
114
|
+
- โ
Works seamlessly with existing i18n system
|
|
115
|
+
- โ
SSR-compatible for server-side rendering
|
|
116
|
+
- โ
TypeScript interfaces for type safety
|
|
117
|
+
- โ
Well-documented with JSDoc comments and usage examples
|
|
118
|
+
|
|
119
|
+
### ๐งน Maintenance
|
|
120
|
+
|
|
121
|
+
- **Package Cleanup**: Removed CLAUDE.md from published package (internal development file)
|
|
122
|
+
|
|
123
|
+
### ๐ Fixed
|
|
124
|
+
|
|
125
|
+
- **LICENSE Link**: Fixed LICENSE link in README to work properly on npmjs.com (changed from relative link to descriptive text)
|
|
126
|
+
- **Directory Overwrite Flow**: Ensured consistent behavior between local and npx usage. Directory existence check now always happens AFTER configuration questions in both cases.
|
|
127
|
+
|
|
8
128
|
## [2.0.2] - 2025-10-24
|
|
9
129
|
|
|
10
130
|
### ๐ Documentation
|
package/README.md
CHANGED
|
@@ -7,9 +7,7 @@
|
|
|
7
7
|
[](https://nodejs.org/)
|
|
8
8
|
[](https://www.npmjs.com/package/create-ng-tailwind)
|
|
9
9
|
|
|
10
|
-
**๐
|
|
11
|
-
|
|
12
|
-
_Zero configuration โข Modern setup โข Beautiful starter templates_
|
|
10
|
+
**๐ A CLI tool to give starter template for angular project with tailwind css**
|
|
13
11
|
|
|
14
12
|
</div>
|
|
15
13
|
|
|
@@ -19,219 +17,99 @@ _Zero configuration โข Modern setup โข Beautiful starter templates_
|
|
|
19
17
|
|
|
20
18
|
- ๐ฏ **Angular 20+** - Latest version with standalone components and signals
|
|
21
19
|
- ๐จ **Tailwind CSS v4** - Utility-first CSS framework preconfigured
|
|
20
|
+
- ๐ **SEO Optimized** - Meta tags, Open Graph, Twitter Cards, structured data, robots.txt
|
|
22
21
|
- ๐ **i18n Translation** - English & Arabic with RTL support
|
|
23
22
|
- ๐ฎ **Interactive UI** - Toast notifications, Modal dialogs, and components
|
|
24
23
|
- ๐๏ธ **Zero Configuration** - Everything set up and ready to go
|
|
25
|
-
- ๐จ **Fast Setup** - Get started in seconds, not minutes
|
|
26
24
|
|
|
27
25
|
## Quick Start
|
|
28
26
|
|
|
29
27
|
### Using npx (Recommended)
|
|
30
28
|
|
|
29
|
+
Run the following command and follow the prompts:
|
|
30
|
+
|
|
31
31
|
```bash
|
|
32
32
|
npx create-ng-tailwind my-awesome-app
|
|
33
|
-
cd my-awesome-app
|
|
34
|
-
ng serve
|
|
35
33
|
```
|
|
36
34
|
|
|
37
35
|
### Using npm
|
|
38
36
|
|
|
37
|
+
Install globally and use:
|
|
38
|
+
|
|
39
39
|
```bash
|
|
40
40
|
npm install -g create-ng-tailwind
|
|
41
41
|
create-ng-tailwind my-awesome-app
|
|
42
|
-
cd my-awesome-app
|
|
43
|
-
ng serve
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Usage
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
create-ng-tailwind [project-name] [options]
|
|
50
42
|
```
|
|
51
43
|
|
|
52
|
-
###
|
|
53
|
-
|
|
54
|
-
| Option | Description | Default |
|
|
55
|
-
| --------------------------- | ------------------------------------------- | ---------------------------------- |
|
|
56
|
-
| `-t, --template <template>` | Template to use (minimal, starter) | **Prompted** (mandatory selection) |
|
|
57
|
-
| `--routing` | Enable Angular routing | true (routing enabled by default) |
|
|
58
|
-
| `--no-routing` | Disable Angular routing | false |
|
|
59
|
-
| `--ssr` | Enable Server-Side Rendering | **Prompted** (default: false) |
|
|
60
|
-
| `--zoneless` | Create zoneless application without zone.js | **Prompted** (default: false) |
|
|
61
|
-
| `--ai-config <tools>` | AI tools to configure | **Prompted** (default: none) |
|
|
62
|
-
| `--skip-install` | Skip npm install | false |
|
|
63
|
-
| `-h, --help` | Display help for command | - |
|
|
64
|
-
| `-V, --version` | Display version number | - |
|
|
65
|
-
|
|
66
|
-
#### Template Options:
|
|
67
|
-
|
|
68
|
-
- `minimal` - Just Angular + Tailwind (minimal setup with basic example)
|
|
69
|
-
- `starter` - Professional foundation with essential components, routing, services, and best practices
|
|
70
|
-
|
|
71
|
-
**Note:** If you don't provide the `--template` flag, you will be prompted to choose a template during setup.
|
|
72
|
-
|
|
73
|
-
#### AI Tools Options:
|
|
74
|
-
|
|
75
|
-
When you select AI tools during setup, Angular CLI will automatically create configuration folders and files:
|
|
76
|
-
|
|
77
|
-
- `none` (default) - No AI tools configured
|
|
78
|
-
- `claude` - Configure Claude integration
|
|
79
|
-
- `cursor` - Configure Cursor integration
|
|
80
|
-
- `gemini` - Configure Gemini integration
|
|
81
|
-
- `copilot` - Configure GitHub Copilot integration
|
|
82
|
-
- `jetbrains` - Configure JetBrains AI Assistant
|
|
83
|
-
- `windsurf` - Configure Windsurf integration
|
|
44
|
+
### What happens next?
|
|
84
45
|
|
|
85
|
-
|
|
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)
|
|
86
51
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
#### Default Interactive Mode (Like `ng new`)
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
# Run the CLI - it will prompt you for all options
|
|
93
|
-
npx create-ng-tailwind my-app
|
|
94
|
-
|
|
95
|
-
# You'll be asked:
|
|
96
|
-
# โ What is your project name? (my-angular-app)
|
|
97
|
-
# โ Which template would you like to use?
|
|
98
|
-
# โฏ Minimal - Just Angular + Tailwind (minimal setup)
|
|
99
|
-
# Starter - Professional foundation with essential components
|
|
100
|
-
# โ Do you want to enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering)? (y/N)
|
|
101
|
-
# โ Do you want to create a 'zoneless' application without zone.js? (y/N)
|
|
102
|
-
# โ Which AI tools do you want to configure? (Press <space> to select, <a> to toggle all)
|
|
103
|
-
# โฏโ None
|
|
104
|
-
# โฏ Claude
|
|
105
|
-
# โฏ Cursor
|
|
106
|
-
# โฏ Gemini
|
|
107
|
-
# โฏ GitHub Copilot
|
|
108
|
-
# โฏ JetBrains AI
|
|
109
|
-
# โฏ Windsurf
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
#### Quick Start with CLI Flags (Skip Prompts)
|
|
52
|
+
After setup completes:
|
|
113
53
|
|
|
114
54
|
```bash
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
# With more options
|
|
119
|
-
npx create-ng-tailwind my-app --template=starter --ssr --zoneless --ai-config=cursor
|
|
120
|
-
|
|
121
|
-
# Or use short flag for template
|
|
122
|
-
npx create-ng-tailwind my-app -t starter
|
|
55
|
+
cd my-awesome-app
|
|
56
|
+
npm install
|
|
57
|
+
ng serve
|
|
123
58
|
```
|
|
124
59
|
|
|
125
|
-
|
|
60
|
+
Your app will be running at `http://localhost:4200` ๐
|
|
126
61
|
|
|
127
|
-
|
|
128
|
-
# Skip npm install (for CI/CD or manual installation later)
|
|
129
|
-
npx create-ng-tailwind my-app --template=starter --skip-install
|
|
130
|
-
|
|
131
|
-
# Disable routing
|
|
132
|
-
npx create-ng-tailwind my-app --template=starter --no-routing
|
|
133
|
-
|
|
134
|
-
# Combine multiple flags
|
|
135
|
-
npx create-ng-tailwind my-app --template=starter --ssr --zoneless --skip-install
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
## What's Included
|
|
139
|
-
|
|
140
|
-
### ๐ฆ Dependencies
|
|
141
|
-
|
|
142
|
-
- **Angular 20** - Latest Angular framework
|
|
143
|
-
- **Tailwind CSS** - Utility-first CSS framework
|
|
144
|
-
- **@tailwindcss/postcss** - Modern PostCSS plugin for Tailwind
|
|
145
|
-
- **PostCSS** - CSS processing tool
|
|
146
|
-
|
|
147
|
-
### ๐จ Preconfigured Setup
|
|
148
|
-
|
|
149
|
-
- Modern PostCSS configuration (`.postcssrc.json`)
|
|
150
|
-
- Tailwind CSS import in styles file
|
|
151
|
-
- Example components with Tailwind classes
|
|
152
|
-
- Responsive design examples
|
|
153
|
-
- Zero configuration required
|
|
154
|
-
|
|
155
|
-
### ๐ฏ CSS-Only Approach (Tailwind v4 Official)
|
|
156
|
-
|
|
157
|
-
**We use CSS exclusively for Tailwind v4 compatibility:**
|
|
158
|
-
|
|
159
|
-
- **โ
Official Tailwind v4 Approach** - Tailwind v4 no longer supports preprocessors (SCSS/Sass/Less)
|
|
160
|
-
- **๐ Simpler Build Process** - No preprocessor compilation needed
|
|
161
|
-
- **โก Faster Builds** - Direct PostCSS processing with LightningCSS
|
|
162
|
-
- **๐จ Modern CSS Features** - CSS nesting, variables, and modern features built-in
|
|
163
|
-
- **๐ ๏ธ Full Tailwind Support** - All Tailwind directives work seamlessly
|
|
164
|
-
- **๐ฆ Smaller Bundle Size** - No preprocessor runtime needed
|
|
165
|
-
- **๐ง Zero Configuration** - Works out of the box with Angular CLI
|
|
166
|
-
|
|
167
|
-
**Note:** Tailwind CSS v4 uses LightningCSS internally and does not support SCSS, Sass, or Less preprocessors. Modern CSS provides nesting and other features previously requiring preprocessors.
|
|
168
|
-
|
|
169
|
-
### ๐๏ธ Project Structure (Starter Template)
|
|
62
|
+
## ๐๏ธ Project Structure
|
|
170
63
|
|
|
171
64
|
```
|
|
172
65
|
my-app/
|
|
173
66
|
โโโ src/
|
|
174
67
|
โ โโโ app/
|
|
175
68
|
โ โ โโโ core/ # Core services and interceptors
|
|
176
|
-
โ โ โ โโโ services/ # Auth, API, Toast, Modal, etc.
|
|
69
|
+
โ โ โ โโโ services/ # Auth, API, SEO, Toast, Modal, etc.
|
|
177
70
|
โ โ โ โโโ interceptors/ # HTTP interceptors
|
|
178
|
-
โ โ โ โโโ guards/
|
|
179
|
-
โ โ โ
|
|
180
|
-
โ โ
|
|
181
|
-
โ โ
|
|
182
|
-
โ โ โ โโโ
|
|
183
|
-
โ โ โ โโโ
|
|
184
|
-
โ โ โ
|
|
185
|
-
โ โ
|
|
186
|
-
โ โ
|
|
187
|
-
โ โ โ โโโ
|
|
188
|
-
โ โ โ โโโ
|
|
189
|
-
โ โ โ
|
|
190
|
-
โ โ
|
|
191
|
-
โ โ
|
|
192
|
-
โ โ โ
|
|
193
|
-
โ โ
|
|
194
|
-
โ โ โโโ app.
|
|
195
|
-
โ โ
|
|
196
|
-
โ
|
|
197
|
-
โ
|
|
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
|
|
198
92
|
โโโ public/
|
|
199
|
-
โ
|
|
200
|
-
โ
|
|
201
|
-
|
|
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
|
|
202
100
|
โโโ package.json
|
|
203
101
|
โโโ ...
|
|
204
102
|
```
|
|
205
103
|
|
|
206
|
-
## ๐ Interactive Mode
|
|
207
|
-
|
|
208
|
-
By default, the CLI works like `ng new` with interactive prompts:
|
|
209
|
-
|
|
210
|
-
```bash
|
|
211
|
-
npx create-ng-tailwind my-app
|
|
212
|
-
|
|
213
|
-
? Which template would you like to use? โบ Starter
|
|
214
|
-
? Enable Server-Side Rendering (SSR)? โบ No
|
|
215
|
-
? Create zoneless application? โบ No
|
|
216
|
-
? Configure AI tools? โบ None
|
|
217
|
-
|
|
218
|
-
โ
Project created successfully!
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
**Fast Mode**: Skip prompts by providing flags:
|
|
222
|
-
|
|
223
|
-
```bash
|
|
224
|
-
npx create-ng-tailwind my-app --template=starter
|
|
225
|
-
```
|
|
226
|
-
|
|
227
104
|
## ๐ฏ Starter Template Features
|
|
228
105
|
|
|
229
|
-
The **Starter Template** includes
|
|
106
|
+
The **Starter Template** includes 25+ production-ready features:
|
|
230
107
|
|
|
231
108
|
### Core Services
|
|
232
109
|
|
|
233
110
|
- **AuthService** - Authentication & user management
|
|
234
111
|
- **ApiService** - Centralized HTTP request handling
|
|
112
|
+
- **SeoService** - Comprehensive SEO management (meta tags, Open Graph, Twitter Cards, structured data)
|
|
235
113
|
- **ToastService** - Notification system (success, error, warning, info)
|
|
236
114
|
- **ModalService** - Dialog system with confirm & alert
|
|
237
115
|
- **LoadingService** - Global loading state with signals
|
|
@@ -239,6 +117,16 @@ The **Starter Template** includes 20+ production-ready features:
|
|
|
239
117
|
- **StorageService** - LocalStorage wrapper with type safety
|
|
240
118
|
- **i18nService** - Internationalization management
|
|
241
119
|
|
|
120
|
+
### SEO Optimization (Simple & Ready to Use)
|
|
121
|
+
|
|
122
|
+
- **SEO Service** - Just 2 methods: `updateMeta()` and `addStructuredData()`
|
|
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
|
|
129
|
+
|
|
242
130
|
### UI Components
|
|
243
131
|
|
|
244
132
|
- **ButtonComponent** - Variants: primary, secondary, danger
|
|
@@ -249,7 +137,7 @@ The **Starter Template** includes 20+ production-ready features:
|
|
|
249
137
|
|
|
250
138
|
### Utilities
|
|
251
139
|
|
|
252
|
-
- **Pipes** - Truncate, TimeAgo
|
|
140
|
+
- **Pipes** - Truncate, TimeAgo
|
|
253
141
|
- **Directives** - ClickOutside, Tooltip
|
|
254
142
|
- **HTTP Interceptors** - Auth, Error handling, Loading, Caching
|
|
255
143
|
- **TypeScript Path Aliases** - Clean imports with `@core/*`, `@shared/*`, `@features/*`
|
|
@@ -260,9 +148,63 @@ The **Starter Template** includes 20+ production-ready features:
|
|
|
260
148
|
- **Language Switcher** - Built-in header component
|
|
261
149
|
- **Translation Files** - JSON-based translation system
|
|
262
150
|
|
|
151
|
+
### Additional Features
|
|
152
|
+
|
|
153
|
+
- **Routing** - Pre-configured with lazy loading
|
|
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 + Husky pre-commit hooks (all files pass formatting checks out of the box)
|
|
158
|
+
- **Modern Stack** - Tailwind v4, TypeScript, Signals
|
|
159
|
+
|
|
160
|
+
## ๐จ Tailwind CSS v4
|
|
161
|
+
|
|
162
|
+
This tool uses **Tailwind CSS v4** with the official PostCSS approach:
|
|
163
|
+
|
|
164
|
+
- โ
**Modern PostCSS Plugin** - `@tailwindcss/postcss`
|
|
165
|
+
- โก **LightningCSS** - Fast CSS processing
|
|
166
|
+
- ๐จ **Modern CSS Features** - Nesting, variables, and more built-in
|
|
167
|
+
- ๐ **Simplified Build** - No preprocessors needed
|
|
168
|
+
|
|
169
|
+
**Note:** Tailwind v4 does not support SCSS, Sass, or Less. Modern CSS provides all the features you need!
|
|
170
|
+
|
|
171
|
+
### ๐จ Comprehensive Theming System
|
|
172
|
+
|
|
173
|
+
The starter template includes a **powerful Tailwind v4 theming system** using the `@theme` directive:
|
|
174
|
+
|
|
175
|
+
**Theme Colors:**
|
|
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)
|
|
183
|
+
|
|
184
|
+
**Customization:**
|
|
185
|
+
Simply edit `src/styles.css` and change the color values in the `@theme` block. All components automatically update!
|
|
186
|
+
|
|
187
|
+
```css
|
|
188
|
+
@theme {
|
|
189
|
+
--color-primary-500: #3b82f6; /* Change this to your brand color */
|
|
190
|
+
--color-secondary-500: #06b6d4;
|
|
191
|
+
--color-accent-500: #a855f7;
|
|
192
|
+
/* ... complete color scales included */
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Usage in templates:**
|
|
197
|
+
```html
|
|
198
|
+
<div class="bg-primary-600 text-white">Primary button</div>
|
|
199
|
+
<div class="bg-secondary-500">Secondary element</div>
|
|
200
|
+
<p class="text-danger-600">Error message</p>
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
All UI components, pages, and layouts use these theme colors, making it easy to rebrand your entire application by changing a few color values!
|
|
204
|
+
|
|
263
205
|
## ๐ License
|
|
264
206
|
|
|
265
|
-
MIT License - see the
|
|
207
|
+
MIT License - see the LICENSE file included in the package.
|
|
266
208
|
|
|
267
209
|
## ๐ Support & Community
|
|
268
210
|
|
|
@@ -278,8 +220,4 @@ If you find this tool helpful, please consider:
|
|
|
278
220
|
|
|
279
221
|
[](https://www.npmjs.com/package/create-ng-tailwind)
|
|
280
222
|
|
|
281
|
-
**๐ Happy coding with Angular and Tailwind CSS!**
|
|
282
|
-
|
|
283
|
-
_Built with โค๏ธ by developers, for developers_
|
|
284
|
-
|
|
285
223
|
</div>
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
const fs = require(
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const { createAIConfigs } = require("../utils/ai-config");
|
|
1
|
+
const fs = require('fs-extra');
|
|
2
|
+
const execa = require('execa');
|
|
3
|
+
const TailwindManager = require('./TailwindManager');
|
|
4
|
+
const TemplateManager = require('./TemplateManager');
|
|
5
|
+
const { createAIConfigs } = require('../utils/ai-config');
|
|
7
6
|
|
|
8
7
|
class ProjectManager {
|
|
9
8
|
constructor(config, logger) {
|
|
@@ -14,19 +13,19 @@ class ProjectManager {
|
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
async create() {
|
|
17
|
-
// Check if directory exists
|
|
16
|
+
// Check if directory exists (after all configuration questions)
|
|
18
17
|
if (await fs.pathExists(this.config.fullPath)) {
|
|
19
18
|
const { overwrite } = await this.logger.prompt([
|
|
20
19
|
{
|
|
21
|
-
type:
|
|
22
|
-
name:
|
|
23
|
-
message: `Directory ${this.config.projectName} already exists.
|
|
20
|
+
type: 'confirm',
|
|
21
|
+
name: 'overwrite',
|
|
22
|
+
message: `Directory ${this.config.projectName} already exists. Do you want to overwrite it?`,
|
|
24
23
|
default: false,
|
|
25
24
|
},
|
|
26
25
|
]);
|
|
27
26
|
|
|
28
27
|
if (!overwrite) {
|
|
29
|
-
this.logger.warn(
|
|
28
|
+
this.logger.warn('Operation cancelled');
|
|
30
29
|
process.exit(0);
|
|
31
30
|
}
|
|
32
31
|
|
|
@@ -43,37 +42,30 @@ class ProjectManager {
|
|
|
43
42
|
await this.templateManager.apply();
|
|
44
43
|
|
|
45
44
|
// Create AI configuration files (CLAUDE.md + tool-specific)
|
|
46
|
-
await createAIConfigs(
|
|
47
|
-
this.config.fullPath,
|
|
48
|
-
this.config.projectName,
|
|
49
|
-
this.config.aiConfig,
|
|
50
|
-
);
|
|
45
|
+
await createAIConfigs(this.config.fullPath, this.config.projectName, this.config.aiConfig);
|
|
51
46
|
}
|
|
52
47
|
|
|
53
48
|
async createAngularProject() {
|
|
54
|
-
const spinner = this.logger.spinner(
|
|
49
|
+
const spinner = this.logger.spinner('Creating Angular project...');
|
|
55
50
|
|
|
56
51
|
try {
|
|
57
52
|
// Build ng new command with user's choices
|
|
58
53
|
const routing = this.config.routing !== false;
|
|
59
54
|
const ssr = this.config.ssr || false;
|
|
60
55
|
const zoneless = this.config.zoneless || false;
|
|
61
|
-
const aiConfig = this.config.aiConfig || [
|
|
56
|
+
const aiConfig = this.config.aiConfig || ['none'];
|
|
62
57
|
|
|
63
58
|
let cmd = `npx @angular/cli@latest new ${this.config.projectName}`;
|
|
64
59
|
cmd += ` --routing=${routing}`;
|
|
65
60
|
cmd += ` --style=css`; // Always use CSS (Tailwind v4 official approach)
|
|
66
61
|
cmd += ` --ssr=${ssr}`;
|
|
67
|
-
|
|
68
|
-
if (zoneless) {
|
|
69
|
-
cmd += ` --zoneless`;
|
|
70
|
-
}
|
|
62
|
+
cmd += ` --zoneless=${zoneless}`;
|
|
71
63
|
|
|
72
64
|
// Add AI config - Angular CLI supports multiple --ai-config flags
|
|
73
|
-
if (aiConfig.length > 0 && !aiConfig.includes(
|
|
65
|
+
if (aiConfig.length > 0 && !aiConfig.includes('none')) {
|
|
74
66
|
// Add each AI tool as a separate --ai-config flag
|
|
75
67
|
aiConfig.forEach((tool) => {
|
|
76
|
-
if (tool !==
|
|
68
|
+
if (tool !== 'none') {
|
|
77
69
|
cmd += ` --ai-config=${tool}`;
|
|
78
70
|
}
|
|
79
71
|
});
|
|
@@ -83,12 +75,12 @@ class ProjectManager {
|
|
|
83
75
|
|
|
84
76
|
await execa.command(cmd, {
|
|
85
77
|
cwd: process.cwd(),
|
|
86
|
-
stdio:
|
|
78
|
+
stdio: 'pipe',
|
|
87
79
|
});
|
|
88
80
|
|
|
89
|
-
spinner.succeed(
|
|
81
|
+
spinner.succeed('Angular project created');
|
|
90
82
|
} catch (error) {
|
|
91
|
-
spinner.fail(
|
|
83
|
+
spinner.fail('Failed to create Angular project');
|
|
92
84
|
throw error;
|
|
93
85
|
}
|
|
94
86
|
}
|
|
@@ -284,12 +284,11 @@ export class ToastService {
|
|
|
284
284
|
|
|
285
285
|
async function createToastComponent(config) {
|
|
286
286
|
const toastComponent = `import { Component, inject } from '@angular/core';
|
|
287
|
-
import { CommonModule } from '@angular/common';
|
|
288
287
|
import { ToastService, Toast } from '@core/services/toast.service';
|
|
289
288
|
|
|
290
289
|
@Component({
|
|
291
290
|
selector: 'app-toast',
|
|
292
|
-
imports: [
|
|
291
|
+
imports: [],
|
|
293
292
|
template: \`
|
|
294
293
|
<!-- Toast Container -->
|
|
295
294
|
<div class="fixed top-4 right-4 z-50 space-y-2 max-w-sm w-full">
|
|
@@ -302,22 +301,22 @@ import { ToastService, Toast } from '@core/services/toast.service';
|
|
|
302
301
|
<div class="shrink-0">
|
|
303
302
|
@switch (toast.type) {
|
|
304
303
|
@case ('success') {
|
|
305
|
-
<svg class="h-6 w-6 text-
|
|
304
|
+
<svg class="h-6 w-6 text-success-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
306
305
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path>
|
|
307
306
|
</svg>
|
|
308
307
|
}
|
|
309
308
|
@case ('error') {
|
|
310
|
-
<svg class="h-6 w-6 text-
|
|
309
|
+
<svg class="h-6 w-6 text-danger-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
311
310
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
|
|
312
311
|
</svg>
|
|
313
312
|
}
|
|
314
313
|
@case ('warning') {
|
|
315
|
-
<svg class="h-6 w-6 text-
|
|
314
|
+
<svg class="h-6 w-6 text-warning-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
316
315
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path>
|
|
317
316
|
</svg>
|
|
318
317
|
}
|
|
319
318
|
@case ('info') {
|
|
320
|
-
<svg class="h-6 w-6 text-
|
|
319
|
+
<svg class="h-6 w-6 text-primary-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
321
320
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
|
322
321
|
</svg>
|
|
323
322
|
}
|
|
@@ -364,10 +363,10 @@ export class ToastComponent {
|
|
|
364
363
|
getToastClasses(toast: Toast): string {
|
|
365
364
|
const baseClasses = 'border-l-4';
|
|
366
365
|
const typeClasses = {
|
|
367
|
-
success: 'bg-
|
|
368
|
-
error: 'bg-
|
|
369
|
-
warning: 'bg-
|
|
370
|
-
info: 'bg-
|
|
366
|
+
success: 'bg-success-50 border-success-500',
|
|
367
|
+
error: 'bg-danger-50 border-danger-500',
|
|
368
|
+
warning: 'bg-warning-50 border-warning-500',
|
|
369
|
+
info: 'bg-info-50 border-info-500'
|
|
371
370
|
};
|
|
372
371
|
|
|
373
372
|
return \`\${baseClasses} \${typeClasses[toast.type]}\`;
|