create-ng-tailwind 2.0.1 โ 2.1.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/CHANGELOG.md +85 -0
- package/README.md +81 -177
- package/lib/managers/ProjectManager.js +2 -2
- package/lib/templates/starter/features.js +49 -7
- package/lib/templates/starter/index.js +121 -48
- package/lib/templates/starter/seo-assets.js +141 -0
- package/lib/templates/starter/seo-features.js +290 -0
- 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,87 @@ 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
|
+
## [2.1.1] - 2025-10-30
|
|
9
|
+
|
|
10
|
+
### ๐ Fixed
|
|
11
|
+
|
|
12
|
+
- **SSR Hydration Error in Contact Form**: Fixed NG0500 hydration mismatch in contact component textarea
|
|
13
|
+
- Removed whitespace between textarea opening and closing tags
|
|
14
|
+
- Prevents "Angular expected a text node but the node was not found" error
|
|
15
|
+
- Ensures proper SSR hydration when Server-Side Rendering is enabled
|
|
16
|
+
|
|
17
|
+
- **AI Config Prettier Formatting**: All AI configuration templates (CLAUDE.md, .cursorrules, .windsurfrules) now pass Prettier formatting checks automatically
|
|
18
|
+
- Added empty lines before code blocks for proper markdown formatting
|
|
19
|
+
- Added parentheses around arrow function parameters (arrowParens: "always")
|
|
20
|
+
- Reordered Tailwind CSS classes according to prettier-plugin-tailwindcss
|
|
21
|
+
- Added trailing commas in objects and arrays per Prettier config
|
|
22
|
+
- Fixed HTML example indentation and structure
|
|
23
|
+
- Renamed Claude file to CLAUDE.md (uppercase) to match Angular CLI convention
|
|
24
|
+
- Scaffolded projects now pass `npm run format:check` without manual fixes
|
|
25
|
+
|
|
26
|
+
## [2.1.0] - 2025-10-28
|
|
27
|
+
|
|
28
|
+
### โจ New Features - Simple SEO Solution
|
|
29
|
+
|
|
30
|
+
- **Simple SEO Service** (Easy to use, easy to extend):
|
|
31
|
+
- โ
Dynamic meta tags (title, description, keywords)
|
|
32
|
+
- โ
Open Graph tags for social sharing (Facebook, LinkedIn)
|
|
33
|
+
- โ
Twitter Card tags for optimized sharing
|
|
34
|
+
- โ
Canonical URL management (auto-updated on route changes)
|
|
35
|
+
- โ
Structured data (JSON-LD) support
|
|
36
|
+
- ๐ฏ **Only 2 methods**: `updateMeta()` and `addStructuredData()` - that's it!
|
|
37
|
+
- ๐ Well-documented with clear examples
|
|
38
|
+
- ๐ง Developers can easily extend with more features as needed
|
|
39
|
+
|
|
40
|
+
- **Essential Structured Data**:
|
|
41
|
+
- โ
Organization schema (company info, logo, social profiles)
|
|
42
|
+
- โ
WebSite schema (site name, description)
|
|
43
|
+
- ๐ก Comment in code shows how to add more schemas (Article, Product, FAQ, etc.)
|
|
44
|
+
- ๐ฏ Keep it simple - only what's actually being used
|
|
45
|
+
|
|
46
|
+
- **SEO Assets**:
|
|
47
|
+
- `robots.txt` - Properly configured for Angular apps with sitemap reference
|
|
48
|
+
- Default Open Graph image (1200x630px SVG placeholder)
|
|
49
|
+
- Complete favicon set (SVG with project initial)
|
|
50
|
+
- Apple Touch Icon for iOS devices
|
|
51
|
+
- Android Chrome icons (192x192 and 512x512)
|
|
52
|
+
- Logo SVG with project branding
|
|
53
|
+
- All placeholders include clear instructions for replacement
|
|
54
|
+
|
|
55
|
+
- **Pre-Integrated & Ready to Use**:
|
|
56
|
+
- โ
All page components (Home, About, Contact) have SEO meta tags configured
|
|
57
|
+
- โ
App component includes Organization and WebSite structured data
|
|
58
|
+
- โ
SEO service auto-updates canonical URLs on navigation
|
|
59
|
+
- โ
Works seamlessly with existing i18n system
|
|
60
|
+
- โ
SSR-compatible for server-side rendering
|
|
61
|
+
- โ
TypeScript interfaces for type safety
|
|
62
|
+
- โ
Well-documented with JSDoc comments and usage examples
|
|
63
|
+
|
|
64
|
+
### ๐งน Maintenance
|
|
65
|
+
|
|
66
|
+
- **Package Cleanup**: Removed CLAUDE.md from published package (internal development file)
|
|
67
|
+
|
|
68
|
+
### ๐ Fixed
|
|
69
|
+
|
|
70
|
+
- **LICENSE Link**: Fixed LICENSE link in README to work properly on npmjs.com (changed from relative link to descriptive text)
|
|
71
|
+
- **Directory Overwrite Flow**: Ensured consistent behavior between local and npx usage. Directory existence check now always happens AFTER configuration questions in both cases.
|
|
72
|
+
|
|
73
|
+
## [2.0.2] - 2025-10-24
|
|
74
|
+
|
|
75
|
+
### ๐ Documentation
|
|
76
|
+
|
|
77
|
+
- **CHANGELOG**: Added v2.0.1 and v2.0.2 entries to published package
|
|
78
|
+
- **PUBLISHING.md**: Updated version references and simplified guidance
|
|
79
|
+
|
|
80
|
+
## [2.0.1] - 2025-10-24
|
|
81
|
+
|
|
82
|
+
### ๐ Documentation Improvements
|
|
83
|
+
|
|
84
|
+
- **README Enhancements**: Removed "Related Projects" section, consolidated duplicate support sections, improved project structure documentation
|
|
85
|
+
- **Terminal Output**: Simplified CLI output to be minimal and professional with green checkmarks and white text
|
|
86
|
+
- **Accuracy Fixes**: Corrected pipe count from 4 to 2 (Truncate, TimeAgo) in all documentation and translations
|
|
87
|
+
- **Better Organization**: Enhanced "Starter Template Features" section with detailed breakdown of core services, UI components, and utilities
|
|
88
|
+
|
|
8
89
|
## [2.0.0] - 2025-01-20
|
|
9
90
|
|
|
10
91
|
**Major Release with Breaking Changes** - This release includes significant updates to the CLI architecture, template system, and development workflow. Review the breaking changes and migration guide below before upgrading.
|
|
@@ -177,16 +258,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
177
258
|
#### Breaking Changes Impact:
|
|
178
259
|
|
|
179
260
|
1. **CSS-Only Approach**:
|
|
261
|
+
|
|
180
262
|
- **Before (v1.x)**: `--style` flag supported css, scss, sass, less
|
|
181
263
|
- **After (v2.0)**: Only CSS is supported (--style flag removed)
|
|
182
264
|
- **Migration**: If you need SCSS, continue using v1.x or migrate to modern CSS
|
|
183
265
|
|
|
184
266
|
2. **Template Names**:
|
|
267
|
+
|
|
185
268
|
- **Before (v1.x)**: `--template=none`
|
|
186
269
|
- **After (v2.0)**: `--template=minimal`
|
|
187
270
|
- **Migration**: Update scripts to use `minimal` instead of `none`
|
|
188
271
|
|
|
189
272
|
3. **Interactive Mode**:
|
|
273
|
+
|
|
190
274
|
- **Before (v1.x)**: Non-interactive by default, `--interactive` flag to enable
|
|
191
275
|
- **After (v2.0)**: Interactive by default, provide all flags to skip prompts
|
|
192
276
|
- **Migration**: Add all required flags to CI/CD scripts for non-interactive mode
|
|
@@ -197,6 +281,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
197
281
|
- **Migration**: Contact via email for support (tehseen_ullah786@hotmail.com)
|
|
198
282
|
|
|
199
283
|
#### Recommended Update Command:
|
|
284
|
+
|
|
200
285
|
```bash
|
|
201
286
|
# Update to v2.0.0
|
|
202
287
|
npx create-ng-tailwind@latest my-app --template=minimal
|
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:
|
|
44
|
+
### What happens next?
|
|
74
45
|
|
|
75
|
-
|
|
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)
|
|
76
51
|
|
|
77
|
-
|
|
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
|
|
84
|
-
|
|
85
|
-
**Note:** You can select multiple AI tools (checkbox selection). Each selected tool will have its configuration folder created by Angular CLI (`ng new --ai-config`). Our CLI focuses on Tailwind CSS setup and template application.
|
|
86
|
-
|
|
87
|
-
### Examples
|
|
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
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
#### Other Options
|
|
126
|
-
|
|
127
|
-
```bash
|
|
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
|
|
55
|
+
cd my-awesome-app
|
|
56
|
+
npm install
|
|
57
|
+
ng serve
|
|
136
58
|
```
|
|
137
59
|
|
|
138
|
-
|
|
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:**
|
|
60
|
+
Your app will be running at `http://localhost:4200` ๐
|
|
158
61
|
|
|
159
|
-
|
|
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,29 @@ 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
|
+
|
|
263
171
|
## ๐ License
|
|
264
172
|
|
|
265
|
-
MIT License - see the
|
|
173
|
+
MIT License - see the LICENSE file included in the package.
|
|
266
174
|
|
|
267
175
|
## ๐ Support & Community
|
|
268
176
|
|
|
@@ -278,8 +186,4 @@ If you find this tool helpful, please consider:
|
|
|
278
186
|
|
|
279
187
|
[](https://www.npmjs.com/package/create-ng-tailwind)
|
|
280
188
|
|
|
281
|
-
**๐ Happy coding with Angular and Tailwind CSS!**
|
|
282
|
-
|
|
283
|
-
_Built with โค๏ธ by developers, for developers_
|
|
284
|
-
|
|
285
189
|
</div>
|
|
@@ -14,13 +14,13 @@ class ProjectManager {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
async create() {
|
|
17
|
-
// Check if directory exists
|
|
17
|
+
// Check if directory exists (after all configuration questions)
|
|
18
18
|
if (await fs.pathExists(this.config.fullPath)) {
|
|
19
19
|
const { overwrite } = await this.logger.prompt([
|
|
20
20
|
{
|
|
21
21
|
type: "confirm",
|
|
22
22
|
name: "overwrite",
|
|
23
|
-
message: `Directory ${this.config.projectName} already exists.
|
|
23
|
+
message: `Directory ${this.config.projectName} already exists. Do you want to overwrite it?`,
|
|
24
24
|
default: false,
|
|
25
25
|
},
|
|
26
26
|
]);
|
|
@@ -2,7 +2,7 @@ const fs = require('fs-extra');
|
|
|
2
2
|
const path = require('path');
|
|
3
3
|
|
|
4
4
|
async function createContactComponent(config) {
|
|
5
|
-
const contactComponentTs = `import { Component, inject } from '@angular/core';
|
|
5
|
+
const contactComponentTs = `import { Component, OnInit, inject } from '@angular/core';
|
|
6
6
|
import { CommonModule } from '@angular/common';
|
|
7
7
|
import { ReactiveFormsModule, FormBuilder, Validators } from '@angular/forms';
|
|
8
8
|
import { NgIconComponent, provideIcons } from '@ng-icons/core';
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
heroPaperAirplane,
|
|
17
17
|
} from '@ng-icons/heroicons/outline';
|
|
18
18
|
import { ButtonComponent } from '@shared/components/button/button.component';
|
|
19
|
+
import { SeoService } from '@core/services/seo.service';
|
|
19
20
|
|
|
20
21
|
@Component({
|
|
21
22
|
selector: 'app-contact',
|
|
@@ -30,12 +31,23 @@ import { ButtonComponent } from '@shared/components/button/button.component';
|
|
|
30
31
|
})],
|
|
31
32
|
templateUrl: './contact.component.html'
|
|
32
33
|
})
|
|
33
|
-
export class ContactComponent {
|
|
34
|
+
export class ContactComponent implements OnInit {
|
|
34
35
|
private fb = inject(FormBuilder);
|
|
36
|
+
private seo = inject(SeoService);
|
|
35
37
|
|
|
36
38
|
isSubmitting = false;
|
|
37
39
|
submitted = false;
|
|
38
40
|
|
|
41
|
+
ngOnInit(): void {
|
|
42
|
+
// Set SEO meta tags for Contact page
|
|
43
|
+
this.seo.updateMeta({
|
|
44
|
+
title: 'Contact Us',
|
|
45
|
+
description: 'Get in touch with us. We would love to hear from you and answer any questions you may have.',
|
|
46
|
+
keywords: 'contact, support, get in touch, email',
|
|
47
|
+
ogType: 'website'
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
39
51
|
contactForm = this.fb.group({
|
|
40
52
|
name: ['', [Validators.required, Validators.minLength(2)]],
|
|
41
53
|
email: ['', [Validators.required, Validators.email]],
|
|
@@ -197,8 +209,7 @@ export class ContactComponent {
|
|
|
197
209
|
placeholder="Tell us more about your inquiry..."
|
|
198
210
|
class="w-full px-4 py-3 border-2 border-gray-200 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-all resize-vertical"
|
|
199
211
|
[class.border-red-500]="contactForm.get('message')?.invalid && contactForm.get('message')?.touched"
|
|
200
|
-
[class.focus:ring-red-500]="contactForm.get('message')?.invalid && contactForm.get('message')?.touched">
|
|
201
|
-
</textarea>
|
|
212
|
+
[class.focus:ring-red-500]="contactForm.get('message')?.invalid && contactForm.get('message')?.touched"></textarea>
|
|
202
213
|
@if (contactForm.get('message')?.invalid && contactForm.get('message')?.touched) {
|
|
203
214
|
<div class="mt-2 text-sm text-red-600 flex items-center gap-1">
|
|
204
215
|
<svg class="h-4 w-4" fill="currentColor" viewBox="0 0 20 20">
|
|
@@ -499,7 +510,7 @@ export const appConfig: ApplicationConfig = {
|
|
|
499
510
|
}
|
|
500
511
|
|
|
501
512
|
async function createAppComponent(config) {
|
|
502
|
-
const app = `import { Component, inject } from '@angular/core';
|
|
513
|
+
const app = `import { Component, OnInit, inject } from '@angular/core';
|
|
503
514
|
import { CommonModule } from '@angular/common';
|
|
504
515
|
import { RouterOutlet } from '@angular/router';
|
|
505
516
|
import { HeaderComponent } from './layout/header/header.component';
|
|
@@ -507,6 +518,8 @@ import { FooterComponent } from './layout/footer/footer.component';
|
|
|
507
518
|
import { ToastComponent } from '@shared/components/toast/toast.component';
|
|
508
519
|
import { ModalComponent } from '@shared/components/modal/modal.component';
|
|
509
520
|
import { TranslationService } from '@core/i18n/translation.service';
|
|
521
|
+
import { SeoService } from '@core/services/seo.service';
|
|
522
|
+
import { createOrganizationSchema, createWebSiteSchema } from '@core/utils/structured-data';
|
|
510
523
|
|
|
511
524
|
@Component({
|
|
512
525
|
selector: 'app-root',
|
|
@@ -529,10 +542,39 @@ import { TranslationService } from '@core/i18n/translation.service';
|
|
|
529
542
|
</div>
|
|
530
543
|
\`
|
|
531
544
|
})
|
|
532
|
-
export class App {
|
|
533
|
-
// Inject
|
|
545
|
+
export class App implements OnInit {
|
|
546
|
+
// Inject services
|
|
534
547
|
private translationService = inject(TranslationService);
|
|
548
|
+
private seo = inject(SeoService);
|
|
549
|
+
|
|
535
550
|
title = '${config.projectName}';
|
|
551
|
+
|
|
552
|
+
ngOnInit(): void {
|
|
553
|
+
// Add global Organization structured data
|
|
554
|
+
const organizationData = createOrganizationSchema({
|
|
555
|
+
name: '${config.projectName}',
|
|
556
|
+
url: 'https://example.com', // TODO: Update with your production URL
|
|
557
|
+
logo: '/assets/images/logo.svg',
|
|
558
|
+
description: 'A modern Angular application built with best practices',
|
|
559
|
+
sameAs: [
|
|
560
|
+
// 'https://twitter.com/yourhandle',
|
|
561
|
+
// 'https://facebook.com/yourpage',
|
|
562
|
+
// 'https://linkedin.com/company/yourcompany'
|
|
563
|
+
]
|
|
564
|
+
});
|
|
565
|
+
|
|
566
|
+
const websiteData = createWebSiteSchema({
|
|
567
|
+
name: '${config.projectName}',
|
|
568
|
+
url: 'https://example.com', // TODO: Update with your production URL
|
|
569
|
+
description: 'A modern Angular application with Tailwind CSS, SEO optimization, and i18n support'
|
|
570
|
+
});
|
|
571
|
+
|
|
572
|
+
// Add structured data to the page
|
|
573
|
+
this.seo.addStructuredData({
|
|
574
|
+
'@context': 'https://schema.org',
|
|
575
|
+
'@graph': [organizationData, websiteData]
|
|
576
|
+
});
|
|
577
|
+
}
|
|
536
578
|
}`;
|
|
537
579
|
|
|
538
580
|
const appHtml = `<!-- This file is not used in standalone components -->
|