Skip to content

Commit e7932f8

Browse files
2 parents b470cb4 + 3db5299 commit e7932f8

66 files changed

Lines changed: 4110 additions & 507 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ jobs:
3232
run: |
3333
test -f templates/react/package.json || exit 1
3434
test -f templates/angular/package.json || exit 1
35-
echo "✓ Bundled templates verified"
35+
test -f templates/solidjs/package.json || exit 1
36+
echo "✓ Bundled templates verified (react, angular, solidjs)"
3637
3738
- name: Test CLI commands
3839
run: |

.github/workflows/publish.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ jobs:
9191
fi
9292
echo "✓ Angular bundled template exists"
9393
94+
# Check SolidJS template
95+
if [ ! -f "templates/solidjs/package.json" ]; then
96+
echo "Error: SolidJS bundled template not found"
97+
exit 1
98+
fi
99+
echo "✓ SolidJS bundled template exists"
100+
94101
- name: Run security audit
95102
run: npm audit --audit-level=high
96103

@@ -136,9 +143,11 @@ jobs:
136143
- 🔒 No supply chain risks
137144
138145
### Features
146+
- 🔍 **Prerequisites Check** - Verifies Git, Node.js 18+, npm with platform-specific install guides
139147
- 🎯 **Interactive CLI** - Beautiful interface with framework selection
140148
- ⚛️ **React** - React + Vite + Modus 2.0 Components
141149
- 🅰️ **Angular** - Angular + Modus 2.0 Web Components
150+
- ▲ **SolidJS** - SolidJS + Vite + Modus 2.0 Components
142151
- 📦 **Smart Installation** - Package manager detection
143152
- 🔐 **Secure** - Published with npm provenance
144153
@@ -162,11 +171,12 @@ jobs:
162171
### CLI Options
163172
| Option | Description |
164173
|--------|-------------|
165-
| `--framework <name>` | Specify framework (react, angular) |
174+
| `--framework <name>` | Specify framework (react, angular, solidjs) |
166175
| `--current-folder` | Install in current directory |
167176
| `--dry-run` | Preview without making changes |
168177
| `--verbose` | Enable verbose output |
169178
| `--info` | Show CLI information |
170179
| `--no-install` | Skip dependency installation |
180+
| `--skip-checks` | Skip prerequisite environment checks |
171181
draft: false
172182
prerelease: false
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Template Validation
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'templates/**'
8+
- 'src/**'
9+
pull_request:
10+
branches: [main]
11+
paths:
12+
- 'templates/**'
13+
- 'src/**'
14+
15+
jobs:
16+
validate-react:
17+
name: React Template
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: "20"
26+
cache: "npm"
27+
28+
- name: Install CLI dependencies
29+
run: npm ci
30+
31+
- name: Scaffold React app
32+
run: node bin/create-trimble-app.js test-react-app --framework react --no-install
33+
34+
- name: Install template dependencies
35+
working-directory: test-react-app
36+
run: npm install
37+
38+
- name: Run template lint checks
39+
working-directory: test-react-app
40+
run: npm run lint:all
41+
42+
- name: Build template
43+
working-directory: test-react-app
44+
run: npm run build
45+
46+
validate-solidjs:
47+
name: SolidJS Template
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v4
51+
52+
- name: Setup Node.js
53+
uses: actions/setup-node@v4
54+
with:
55+
node-version: "20"
56+
cache: "npm"
57+
58+
- name: Install CLI dependencies
59+
run: npm ci
60+
61+
- name: Scaffold SolidJS app
62+
run: node bin/create-trimble-app.js test-solidjs-app --framework solidjs --no-install
63+
64+
- name: Install template dependencies
65+
working-directory: test-solidjs-app
66+
run: npm install
67+
68+
- name: Run template lint checks
69+
working-directory: test-solidjs-app
70+
run: npm run lint:all
71+
72+
- name: Build template
73+
working-directory: test-solidjs-app
74+
run: npm run build
75+
76+
validate-angular:
77+
name: Angular Template
78+
runs-on: ubuntu-latest
79+
steps:
80+
- uses: actions/checkout@v4
81+
82+
- name: Setup Node.js
83+
uses: actions/setup-node@v4
84+
with:
85+
node-version: "20"
86+
cache: "npm"
87+
88+
- name: Install CLI dependencies
89+
run: npm ci
90+
91+
- name: Scaffold Angular app
92+
run: node bin/create-trimble-app.js test-angular-app --framework angular --no-install
93+
94+
- name: Install template dependencies
95+
working-directory: test-angular-app
96+
run: npm install
97+
98+
- name: Run template lint checks
99+
working-directory: test-angular-app
100+
run: npm run lint:all
101+
102+
- name: Build template
103+
working-directory: test-angular-app
104+
run: npm run build

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ pids
9898
*.swp
9999
*.swo
100100

101+
# Nx cache
102+
.nx/
103+
101104
# OS generated files
102105
.DS_Store
103106
.DS_Store?

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- **Prerequisites check** - CLI now verifies Git, Node.js (>= 18), and npm are available before scaffolding begins. Shows platform-specific install instructions (macOS: brew/Xcode CLT, Windows: winget, Linux: apt/dnf/pacman) if tools are missing
13+
- **GitHub account prompt** - Asks beginners if they have a GitHub account; if not, displays a guided signup panel with link and steps, then waits for confirmation before continuing. Automatically skipped in CI/non-TTY environments
14+
- **`--skip-checks` flag** - New CLI option to bypass prerequisite environment checks for experienced users
15+
- **Prerequisites test suite** - 18 new tests covering platform detection, version checks, install instruction generators, and GitHub signup info
16+
- **Post-scaffold validation** - CLI now runs `lint:all` after dependency installation to verify template integrity before the developer starts coding
17+
- **Template health report** - `TEMPLATE-HEALTH.md` auto-generated dashboard showing versions, component counts, lint script coverage, and status across all 3 templates. Run `node scripts/generate-template-health.js` to regenerate
18+
- **Template validation CI** - New `template-validation.yml` workflow that scaffolds, installs, lints, and builds all 3 templates on every PR touching `templates/` or `src/`
19+
- **Trimble Identity auth rules** - Cursor rules and commands for adding TID authentication to all 3 templates: React (`@trimble-oss/trimble-id-react`), SolidJS (embedded wrapper around `TIDClient`), and Angular (`@trimble-oss/trimble-id` core SDK with signals-based `AuthService`, functional guard, and HTTP interceptor)
1220
- **SolidJS Template** - New SolidJS + Vite + Modus 2.0 Components template
1321
- SolidJS 1.9.5 with `@solidjs/router` for client-side routing
1422
- Direct Modus web component integration (no wrapper library needed)
@@ -25,11 +33,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2533
- GitHub Actions CI workflow
2634
- Code quality scripts (type-check, icon lint, semantic HTML, etc.)
2735

36+
### Fixed
37+
38+
- **Pre-commit hooks now block on failure** - All 3 templates: added `|| exit 1` to every check so failed lints actually prevent commits (previously hooks always exited 0)
39+
- **Pre-commit hooks run all checks** - React/SolidJS now run 8 checks (added `lint:opacity` and `lint:icon-names`), Angular runs 7
40+
- **`lint:all` runs all checks** - New `run-all-checks.js` script replaces `&&` chaining so all checks run even if some fail, with a summary table at the end
41+
- **SolidJS `<span>` in ModusTooltip** - Changed to `<div>` to pass `lint:semantic` (verified tooltip still works via Playwright)
42+
- **React `<span>` in ModusTooltip** - Same fix as SolidJS
43+
- **Inline styles false positive** - Fixed exclusion path from `src/pages/ColorPalettePage.tsx` to `src/dev-pages/**` in all templates
44+
- **SolidJS scripts said "Vite + React"** - All 8 scripts updated to say "Vite + SolidJS"
45+
- **SolidJS semantic HTML script suggested `className=`** - Fixed to suggest `class=` (SolidJS syntax)
46+
- **Angular semantic HTML script said "Vite + React"** - Fixed to say "Angular", suggestions use `class=`
47+
- **SolidJS GitHub instructions used React patterns** - Rewrote all 5 `.github/instructions/` files with SolidJS patterns (`createSignal`, `onMount`, `class=`, `Component` type, `@solidjs/router`)
48+
- **SolidJS CI missing from template verification** - Added `templates/solidjs/package.json` check to `ci.yml`
49+
2850
### Changed
2951

52+
- CLI scaffold flow now starts with environment prerequisites before framework selection
3053
- CLI now supports three frameworks: React, Angular, and SolidJS
3154
- Framework validation updated to accept `solidjs` as a valid option
3255
- Updated CLI security notice and help text to list all three templates
56+
- CLI architecture now includes step 7 (post-scaffold validation) between dependency install and success message
57+
58+
### Cursor Rules Updated (SolidJS)
59+
60+
- `modus-checkbox-value-inversion-solidjs-short.mdc` - Wrapper prop is `value` not `checked`; use `onValueChange`
61+
- `modus-checkbox-value-inversion-solidjs.mdc` - Added "Use the Wrapper" section with correct API
62+
- `modus-navbar-side-navigation-solidjs-short.mdc` - Added navbar slots and SideNavigation flat-only limitation
63+
- `modus-navbar-side-navigation-solidjs.mdc` - Added custom sidebar guidance for hierarchical navigation
64+
- `modus-solidjs-integration-short.mdc` - Added "Common Wrapper Prop Gotchas" section
65+
- `modus-solidjs-essentials.mdc` - Added TextInput, SideNavigation, Table limitation sections
66+
- `modus-components-reference.mdc` - Added critical notes to Checkbox, TextInput, SideNavigation, Table entries
3367

3468
## [2.0.0] - 2026-01-28
3569

CLAUDE.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,30 +32,35 @@ npm run prepublishOnly
3232
bin/create-trimble-app.js (entry point)
3333
└→ src/cli.js (Commander.js argument parsing)
3434
└→ src/scaffold.js (main orchestration)
35+
├→ src/utils/prerequisites.js (environment checks)
3536
├→ src/frameworks.js (loads templates/config.json)
3637
└→ src/utils/* (file, git, install, logger)
3738
```
3839

3940
### Key Modules
4041

41-
**src/cli.js**: Parses CLI arguments with Commander.js. Validates framework option (react, angular, solidjs). Handles all CLI flags (--framework, --current-folder, --dry-run, --verbose, --info, --no-install). Checks for updates non-blocking.
42+
**src/cli.js**: Parses CLI arguments with Commander.js. Validates framework option (react, angular, solidjs). Handles all CLI flags (--framework, --current-folder, --dry-run, --verbose, --info, --no-install, --skip-checks). Checks for updates non-blocking.
4243

4344
**src/scaffold.js**: Orchestrates the scaffolding flow:
44-
1. Framework selection (interactive or CLI arg)
45-
2. Installation location (current folder or new directory)
46-
3. Project name validation
47-
4. Dry-run preview (if enabled)
48-
5. Template copying
49-
6. package.json name update
50-
7. Dependency installation (optional)
51-
8. Success message
45+
1. Prerequisites check (Git, Node.js >= 18, npm — skippable with `--skip-checks`)
46+
2. GitHub account prompt (interactive only, skipped in CI/non-TTY)
47+
3. Framework selection (interactive or CLI arg)
48+
4. Installation location (current folder or new directory)
49+
5. Project name validation
50+
6. Dry-run preview (if enabled)
51+
7. Template copying
52+
8. package.json name update
53+
9. Dependency installation (optional)
54+
10. Success message
5255

5356
**src/frameworks.js**: Loads `templates/config.json` and returns enabled frameworks. Filters out any with `disabled: true`. Provides `getFrameworkById()` lookup.
5457

5558
**src/utils/file.js**: `validateProjectName()`, `updatePackageJson()`, `getCurrentFolderName()`
5659

5760
**src/utils/git.js**: `copyTemplate()` copies from bundled `templates/` directory to target (local file copy, no git operations despite the filename). Skips `node_modules`, `dist`, `.angular`, `.git`, `coverage`, `.nyc_output` directories and lock files during copy. Renames `dot-npmrc``.npmrc` and `gitignore``.gitignore` (npm strips these during publish). `getDetailedErrorMessage()` transforms errors (EACCES, ENOSPC, etc.) into user-friendly messages.
5861

62+
**src/utils/prerequisites.js**: `runPrerequisites()` checks the development environment before scaffolding: verifies Git is installed (with platform-specific install guide if missing for macOS/Windows/Linux), validates Node.js >= 18 (with nvm/fnm/nodejs.org upgrade instructions), confirms npm is available, and prompts about GitHub account (shows signup guide with boxen if needed). Skipped in CI/non-TTY mode for the GitHub prompt. All checks use `execa` with hardcoded arguments (no user input in commands). Exports individual check functions for testing.
63+
5964
**src/utils/install.js**: Auto-detects package manager from lock files, runs install using execa.
6065

6166
**src/utils/colors.js**: Trimble Brand Blue (#0063a3) with true color/256-color fallback via picocolors. All color functions used throughout the CLI.
@@ -68,6 +73,8 @@ Complete working projects in `templates/react/`, `templates/angular/`, and `temp
6873

6974
`templates/config.json` defines framework metadata (name, description, badge, note) read by `src/frameworks.js`.
7075

76+
All three templates include Trimble Identity (TID) authentication Cursor commands (`.cursor/commands/trimble-id.md`) and rules (`.cursor/rules/add-trimble-identity-auth.mdc`). React uses `@trimble-oss/trimble-id-react`, SolidJS wraps `TIDClient` in a SolidJS context, Angular uses `@trimble-oss/trimble-id` core SDK with signals-based `AuthService`, functional guard, and HTTP interceptor.
77+
7178
#### SolidJS Template
7279

7380
SolidJS 1.9 + Vite + TypeScript + Tailwind CSS 3 + @solidjs/router. Uses `@trimble-oss/moduswebcomponents` (vanilla web components, no React wrapper).
@@ -99,6 +106,7 @@ Vitest tests in `tests/`:
99106
- frameworks.test.js
100107
- utils/file.test.js
101108
- utils/git.test.js
109+
- utils/prerequisites.test.js
102110

103111
30s timeout for integration tests. Coverage excludes src/cli.js.
104112

0 commit comments

Comments
 (0)