@julianoczkowski/create-trimble-app 2.0.0 → 2.0.2

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.
@@ -1,92 +1,435 @@
1
- # AngularVite
1
+ # Modus Angular Boilerplate
2
2
 
3
- This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.3.8.
3
+ ![Angular](https://img.shields.io/badge/Angular-20-DD0031?logo=angular&logoColor=white)
4
+ ![Tailwind CSS](https://img.shields.io/badge/Tailwind_CSS-v4-06B6D4?logo=tailwindcss&logoColor=white)
5
+ ![TypeScript](https://img.shields.io/badge/TypeScript-5.9-3178C6?logo=typescript&logoColor=white)
6
+ ![Modus](https://img.shields.io/badge/Modus-2.0-00A3E0)
4
7
 
5
- ## Development server
8
+ A production-ready Angular 20 boilerplate with **Trimble Modus Design System** integration, featuring 47 wrapped components, comprehensive dev tools, and enforced design system compliance.
6
9
 
7
- To start a local development server, run:
10
+ ---
11
+
12
+ ## Quick Start
8
13
 
9
14
  ```bash
10
- ng serve
15
+ # 1. Install dependencies
16
+ npm install
17
+
18
+ # 2. Start development server
19
+ npm start
20
+
21
+ # 3. Open in browser
22
+ open http://localhost:4200
11
23
  ```
12
24
 
13
- Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
25
+ Press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>D</kbd> to open the **Dev Panel** and explore components, themes, and icons.
14
26
 
15
- ## Code scaffolding
27
+ ---
16
28
 
17
- Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
29
+ ## What's Included
18
30
 
19
- ```bash
20
- ng generate component component-name
21
- ```
31
+ | Feature | Description |
32
+ | ------------------------- | -------------------------------------------------------------------------------------- |
33
+ | **47 Wrapper Components** | Angular wrappers for all Modus Web Components with signal-based APIs |
34
+ | **46 Component Demos** | Interactive demos organized by category (Display, Feedback, Forms, Layout, Navigation) |
35
+ | **Dev Panel** | Floating panel with theme switcher, color palette, icon browser, and component gallery |
36
+ | **8 Lint Scripts** | Automated design system compliance checking (colors, icons, borders, opacity, styles) |
37
+ | **52 AI Rules** | Cursor/Copilot rules for guided development with Modus patterns |
38
+ | **6 Themes** | Classic, Modern, and Connect themes in light/dark variants |
39
+ | **Pre-commit Hooks** | Automatic linting on every commit via Husky |
22
40
 
23
- For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
41
+ ---
42
+
43
+ ## Tech Stack
44
+
45
+ | Technology | Version | Package |
46
+ | ---------------------- | ---------- | ----------------------------------------- |
47
+ | Angular | 20.3.0 | `@angular/core` |
48
+ | Modus Web Components | 1.0.6 | `@trimble-oss/moduswebcomponents` |
49
+ | Modus Angular Wrappers | 1.0.6-ng19 | `@trimble-oss/moduswebcomponents-angular` |
50
+ | Modus Icons | 1.18.0 | `@trimble-oss/modus-icons` |
51
+ | Tailwind CSS | 4.1.16 | `tailwindcss` |
52
+ | TypeScript | 5.9.2 | `typescript` |
53
+
54
+ ---
55
+
56
+ ## Project Structure
24
57
 
25
- ```bash
26
- ng generate --help
58
+ ```
59
+ src/app/
60
+ ├── pages/ # Your application pages (START HERE)
61
+ │ └── home/ # Home page - edit to build your app
62
+ ├── components/ # 47 Modus wrapper components (use as-is)
63
+ ├── demos/ # 46 component demos (reference only)
64
+ │ ├── display/ # Avatar, Badge, Icon, Logo, Pagination...
65
+ │ ├── feedback/ # Alert, Loader, Modal, Progress, Toast...
66
+ │ ├── forms/ # Button, Checkbox, Input, Select, Slider...
67
+ │ ├── layout/ # Accordion, Card, Collapse, Panel
68
+ │ ├── navigation/ # Breadcrumbs, Menu, Navbar, Tabs...
69
+ │ └── system/ # Theme Switcher
70
+ ├── dev/ # Dev Panel infrastructure
71
+ │ ├── dev-panel/ # Floating panel UI
72
+ │ └── theme-switcher-dropdown/
73
+ ├── dev-pages/ # Reference pages (dev only)
74
+ │ ├── color-palette/ # Design system colors
75
+ │ ├── icons/ # 700+ icons browser
76
+ │ └── components-gallery/
77
+ ├── services/ # Theme service with localStorage persistence
78
+ └── data/ # Shared data (icons list, etc.)
27
79
  ```
28
80
 
29
- ## Building
81
+ ### Where to Build Your App
82
+
83
+ | Directory | Action | Description |
84
+ | --------------------- | --------- | ------------------------------- |
85
+ | `src/app/pages/` | **WRITE** | Add your application pages here |
86
+ | `src/app/components/` | READ | Use wrapper components as-is |
87
+ | `src/app/demos/` | READ | Reference for component usage |
88
+
89
+ ---
90
+
91
+ ## Dev Panel
92
+
93
+ Toggle with <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>D</kbd> (or <kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>D</kbd> on Mac)
94
+
95
+ ### Features
96
+
97
+ | Tab | Description |
98
+ | -------------- | ------------------------------------------------------------------ |
99
+ | **Themes** | Switch between 6 Modus themes (Classic/Modern/Connect, Light/Dark) |
100
+ | **Colors** | View the 9-color design system palette with CSS variables |
101
+ | **Icons** | Browse 700+ Modus icons with click-to-copy functionality |
102
+ | **Components** | Gallery of all 47 wrapped components |
103
+ | **Demos** | 46 interactive component demos |
104
+
105
+ ### Dev Routes
106
+
107
+ | Route | Description |
108
+ | ----------------- | -------------------------- |
109
+ | `/dev/colors` | Color palette reference |
110
+ | `/dev/icons` | Icon library browser |
111
+ | `/dev/components` | Component gallery |
112
+ | `/dev/demos/*` | Individual component demos |
113
+
114
+ > **Note:** Dev Panel and dev routes are automatically excluded from production builds.
115
+
116
+ ---
117
+
118
+ ## Available Components
119
+
120
+ ### Display (9)
121
+
122
+ | Component | Selector | Description |
123
+ | ---------- | -------------------- | ---------------------------------- |
124
+ | Avatar | `<modus-avatar>` | User avatar with image or initials |
125
+ | Badge | `<modus-badge>` | Status indicators and counters |
126
+ | Chip | `<modus-chip>` | Tags and filter chips |
127
+ | Icon | `<modus-icon>` | 700+ Modus icons |
128
+ | Logo | `<modus-logo>` | Trimble logo variants |
129
+ | Pagination | `<modus-pagination>` | Page navigation |
130
+ | Skeleton | `<modus-skeleton>` | Loading placeholders |
131
+ | Stepper | `<modus-stepper>` | Multi-step indicators |
132
+ | Table | `<modus-table>` | Data tables |
133
+
134
+ ### Feedback (10)
135
+
136
+ | Component | Selector | Description |
137
+ | -------------- | ------------------------ | -------------------------- |
138
+ | Alert | `<modus-alert>` | Notifications and messages |
139
+ | Handle | `<modus-handle>` | Resize handles |
140
+ | Input Feedback | `<modus-input-feedback>` | Form validation messages |
141
+ | Input Label | `<modus-input-label>` | Form labels |
142
+ | Loader | `<modus-loader>` | Loading spinners |
143
+ | Modal | `<modus-modal>` | Dialog windows |
144
+ | Progress | `<modus-progress>` | Progress bars |
145
+ | Rating | `<modus-rating>` | Star ratings |
146
+ | Toast | `<modus-toast>` | Temporary notifications |
147
+ | Tooltip | `<modus-tooltip>` | Hover tooltips |
148
+
149
+ ### Forms (15)
150
+
151
+ | Component | Selector | Description |
152
+ | ------------- | ----------------------- | ----------------------- |
153
+ | Autocomplete | `<modus-autocomplete>` | Search with suggestions |
154
+ | Button | `<modus-button>` | Action buttons |
155
+ | Button Group | `<modus-button-group>` | Grouped buttons |
156
+ | Checkbox | `<modus-checkbox>` | Checkbox inputs |
157
+ | Date | `<modus-date>` | Date picker |
158
+ | Dropdown Menu | `<modus-dropdown-menu>` | Dropdown selections |
159
+ | File Dropzone | `<modus-file-dropzone>` | File upload area |
160
+ | Number Input | `<modus-number-input>` | Numeric inputs |
161
+ | Radio | `<modus-radio>` | Radio buttons |
162
+ | Select | `<modus-select>` | Select dropdowns |
163
+ | Slider | `<modus-slider>` | Range sliders |
164
+ | Switch | `<modus-switch>` | Toggle switches |
165
+ | Text Input | `<modus-text-input>` | Text fields |
166
+ | Textarea | `<modus-textarea>` | Multi-line text |
167
+ | Time Input | `<modus-time-input>` | Time picker |
168
+
169
+ ### Layout (4)
170
+
171
+ | Component | Selector | Description |
172
+ | ------------- | ----------------------- | -------------------- |
173
+ | Accordion | `<modus-accordion>` | Collapsible sections |
174
+ | Card | `<modus-card>` | Content cards |
175
+ | Collapse | `<modus-collapse>` | Expandable content |
176
+ | Utility Panel | `<modus-utility-panel>` | Slide-out panels |
177
+
178
+ ### Navigation (6)
179
+
180
+ | Component | Selector | Description |
181
+ | --------------- | ------------------------- | ------------------ |
182
+ | Breadcrumbs | `<modus-breadcrumbs>` | Navigation trail |
183
+ | Menu | `<modus-menu>` | Dropdown menus |
184
+ | Navbar | `<modus-navbar>` | Top navigation bar |
185
+ | Side Navigation | `<modus-side-navigation>` | Sidebar navigation |
186
+ | Tabs | `<modus-tabs>` | Tabbed content |
187
+ | Toolbar | `<modus-toolbar>` | Action toolbars |
188
+
189
+ ### System (1)
190
+
191
+ | Component | Selector | Description |
192
+ | -------------- | ------------------------ | --------------- |
193
+ | Theme Switcher | `<modus-theme-switcher>` | Theme selection |
194
+
195
+ ---
196
+
197
+ ## Design System
198
+
199
+ ### 9-Color Palette
200
+
201
+ #### Base Colors
202
+
203
+ | Color | Tailwind Class | Usage |
204
+ | ---------- | ----------------- | ------------------ |
205
+ | Background | `bg-background` | Page backgrounds |
206
+ | Card | `bg-card` | Card surfaces |
207
+ | Muted | `bg-muted` | Muted backgrounds |
208
+ | Secondary | `bg-secondary` | Secondary surfaces |
209
+ | Foreground | `text-foreground` | Primary text |
210
+
211
+ #### Status Colors
212
+
213
+ | Color | Tailwind Class | Usage |
214
+ | ------- | ----------------------------- | ---------------------------- |
215
+ | Primary | `bg-primary` / `text-primary` | Primary actions, info states |
216
+ | Success | `bg-success` / `text-success` | Success states |
217
+ | Warning | `bg-warning` / `text-warning` | Warning states |
218
+ | Error | `bg-error` / `text-error` | Error states |
219
+
220
+ ### Usage Example
221
+
222
+ ```html
223
+ <!-- Correct: Design system colors -->
224
+ <div class="bg-background text-foreground p-4">
225
+ <div class="bg-card rounded-lg p-4 border-default">
226
+ <div class="text-primary font-semibold">Title</div>
227
+ <div class="text-muted-foreground">Description</div>
228
+ </div>
229
+ </div>
230
+
231
+ <!-- Wrong: Generic Tailwind colors (will fail lint) -->
232
+ <div class="bg-gray-100 text-gray-900"></div>
233
+ ```
30
234
 
31
- To build the project run:
235
+ ### Opacity Utilities
32
236
 
33
- ```bash
34
- ng build
237
+ Use custom opacity classes instead of Tailwind's `/80` syntax:
238
+
239
+ ```html
240
+ <!-- Correct -->
241
+ <div class="text-foreground-80">80% opacity text</div>
242
+
243
+ <!-- Wrong (doesn't work with CSS variables) -->
244
+ <div class="text-foreground/80"></div>
35
245
  ```
36
246
 
37
- This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.
247
+ ---
38
248
 
39
- ## Running unit tests
249
+ ## Commands
40
250
 
41
- To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
251
+ ### Development
42
252
 
43
- ```bash
44
- ng test
253
+ | Command | Description |
254
+ | --------------- | ------------------------------------ |
255
+ | `npm start` | Start dev server on `localhost:4200` |
256
+ | `npm run build` | Production build to `dist/` |
257
+ | `npm test` | Run unit tests with Karma |
258
+ | `npm run watch` | Build with watch mode |
259
+
260
+ ### Linting
261
+
262
+ | Command | Description |
263
+ | ------------------------- | ---------------------------- |
264
+ | `npm run lint:all` | Run all design system checks |
265
+ | `npm run type-check` | TypeScript validation |
266
+ | `npm run lint:colors` | Check color compliance |
267
+ | `npm run lint:styles` | Check for inline styles |
268
+ | `npm run lint:borders` | Check border patterns |
269
+ | `npm run lint:opacity` | Check opacity utilities |
270
+ | `npm run lint:icons` | Check icon library usage |
271
+ | `npm run lint:icon-names` | Validate icon names (700+) |
272
+
273
+ ### Pre-commit Hooks
274
+
275
+ All lint commands run automatically on `git commit` via Husky. Commits are blocked if any check fails.
276
+
277
+ ---
278
+
279
+ ## Getting Started
280
+
281
+ ### 1. Build Your App
282
+
283
+ Edit `src/app/pages/home/home.component.ts` to start building:
284
+
285
+ ```typescript
286
+ import { Component, ChangeDetectionStrategy } from '@angular/core';
287
+ import { ModusButtonComponent } from '@/app/components';
288
+
289
+ @Component({
290
+ selector: 'app-home',
291
+ imports: [ModusButtonComponent],
292
+ template: `
293
+ <div class="bg-background text-foreground p-8">
294
+ <div class="text-2xl font-bold mb-4">My App</div>
295
+ <modus-button color="primary" (buttonClick)="handleClick()"> Get Started </modus-button>
296
+ </div>
297
+ `,
298
+ changeDetection: ChangeDetectionStrategy.OnPush,
299
+ })
300
+ export class HomeComponent {
301
+ handleClick() {
302
+ console.log('Button clicked!');
303
+ }
304
+ }
45
305
  ```
46
306
 
47
- ## Running end-to-end tests
307
+ ### 2. Use Components
48
308
 
49
- For end-to-end (e2e) testing, run:
309
+ Import from `@/app/components`:
50
310
 
51
- ```bash
52
- ng e2e
311
+ ```typescript
312
+ import {
313
+ ModusButtonComponent,
314
+ ModusAlertComponent,
315
+ ModusIconComponent,
316
+ ModusCardComponent,
317
+ } from '@/app/components';
318
+ ```
319
+
320
+ ### 3. Test All Themes
321
+
322
+ Use the Dev Panel (<kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>D</kbd>) to test your UI in all 6 themes:
323
+
324
+ - Modus Classic Light / Dark
325
+ - Modus Modern Light / Dark
326
+ - Connect Light / Dark
327
+
328
+ ---
329
+
330
+ ## Deployment
331
+
332
+ ### AWS Amplify
333
+
334
+ Pre-configured `amplify.yml` included:
335
+
336
+ ```yaml
337
+ version: 1
338
+ frontend:
339
+ phases:
340
+ preBuild:
341
+ commands:
342
+ - npm ci
343
+ build:
344
+ commands:
345
+ - npm run build
346
+ artifacts:
347
+ baseDirectory: dist/modus-angular-app/browser
348
+ files:
349
+ - '**/*'
350
+ cache:
351
+ paths:
352
+ - node_modules/**/*
53
353
  ```
54
354
 
55
- Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
355
+ **Important:** Configure rewrite rules in Amplify Console for Angular routing:
356
+
357
+ | Source | Target | Type |
358
+ | ------ | ------------- | ------------- |
359
+ | `/<*>` | `/index.html` | 200 (Rewrite) |
56
360
 
57
- ## Deployment to AWS Amplify
361
+ ---
58
362
 
59
- This project includes an `amplify.yml` configuration file for AWS Amplify deployment.
363
+ ## AI-Powered Development
60
364
 
61
- ### Setup Steps
365
+ ### Cursor/Copilot Rules
62
366
 
63
- 1. **Build Configuration**: The `amplify.yml` file is already configured with:
367
+ 52 development rules in `.cursor/rules/` covering:
64
368
 
65
- - Build commands: `npm ci` → `npm run build`
66
- - Output directory: `dist/angular-vite/browser`
67
- - Caching for `node_modules`
369
+ - Component patterns and state management
370
+ - Design system compliance
371
+ - Angular 20 best practices
372
+ - Known issues and workarounds
68
373
 
69
- 2. **Redirect Rules** (Important for Angular Routing):
374
+ ### AGENTS.MD
70
375
 
71
- After deploying to AWS Amplify, you **must** configure redirect rules in the Amplify Console for client-side routing to work:
376
+ Comprehensive guide for AI agents in `AGENTS.MD`:
72
377
 
73
- - Go to your Amplify app in the AWS Console
74
- - Navigate to **App settings** → **Rewrites and redirects**
75
- - Add a redirect rule:
76
- - **Source**: `/<*>`
77
- - **Target**: `/index.html`
78
- - **Type**: `200 (Rewrite)`
378
+ - Commands reference
379
+ - Design system rules
380
+ - Critical bug fixes
381
+ - Boundaries (Always/Ask/Never)
382
+
383
+ ### MCP Servers
384
+
385
+ Pre-configured Model Context Protocol servers:
386
+
387
+ | Server | Purpose |
388
+ | ------------ | ---------------------------------- |
389
+ | `modus-docs` | Modus component documentation |
390
+ | `context7` | Angular, Tailwind, dependency docs |
391
+
392
+ ---
393
+
394
+ ## Angular 20 Patterns
395
+
396
+ This boilerplate uses modern Angular patterns:
397
+
398
+ ```typescript
399
+ // Signal-based inputs (not @Input decorator)
400
+ readonly color = input<ButtonColor>('primary');
401
+
402
+ // Signal-based outputs (not @Output decorator)
403
+ readonly buttonClick = output<MouseEvent>();
404
+
405
+ // inject() for DI (not constructor)
406
+ private readonly service = inject(MyService);
407
+
408
+ // Modern control flow (not *ngIf/*ngFor)
409
+ @if (isVisible()) {
410
+ <div>Content</div>
411
+ }
412
+ @for (item of items(); track item.id) {
413
+ <div>{{ item.name }}</div>
414
+ }
415
+
416
+ // OnPush change detection (required)
417
+ changeDetection: ChangeDetectionStrategy.OnPush
418
+ ```
79
419
 
80
- This ensures all routes (like `/theme-demo`, `/button-demo`) are handled by Angular's client-side router.
420
+ ---
81
421
 
82
- ### Build Output
422
+ ## Resources
83
423
 
84
- The build outputs to `dist/angular-vite/browser/` with:
424
+ | Resource | Description |
425
+ | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
426
+ | [Modus 2 Web Components](https://trimble-oss.github.io/modus-wc-2.0/main/?path=/docs/documentation-getting-started--docs) | Official component documentation |
427
+ | [Modus Design System](https://modus.trimble.com/) | Design guidelines and patterns |
428
+ | [Angular Signals](https://angular.dev/guide/signals) | Signal-based reactivity guide |
429
+ | [Tailwind CSS v4](https://tailwindcss.com/docs) | Utility-first CSS framework |
85
430
 
86
- - Production-optimized bundles
87
- - Hashed filenames for caching
88
- - Static assets from `public/` directory
431
+ ---
89
432
 
90
- ## Additional Resources
433
+ ## License
91
434
 
92
- For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
435
+ MIT