diff --git a/.github/workflows/check-asset-sync.yml b/.github/workflows/check-asset-sync.yml new file mode 100644 index 0000000..5590cbe --- /dev/null +++ b/.github/workflows/check-asset-sync.yml @@ -0,0 +1,29 @@ +name: Check asset sync + +on: + pull_request: + paths: + - "src/ui-ux-pro-max/**" + - "cli/assets/**" + - "cli/scripts/sync-assets.mjs" + - ".github/workflows/check-asset-sync.yml" + push: + branches: [main] + paths: + - "src/ui-ux-pro-max/**" + - "cli/assets/**" + +jobs: + check-assets: + name: cli/assets must match src/ui-ux-pro-max + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + # check:assets runs `node scripts/sync-assets.mjs --check`, which uses only + # node builtins (no npm install needed) and normalizes CRLF/LF before + # hashing, so it compares content rather than line endings. + - name: Check CLI assets are in sync with source of truth + run: npm --prefix cli run check:assets diff --git a/CLAUDE.md b/CLAUDE.md index 364647c..f541cbf 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -77,9 +77,9 @@ When modifying files: 3. **CLI Assets** - Run sync before publishing: ```bash - cp -r src/ui-ux-pro-max/data/* cli/assets/data/ - cp -r src/ui-ux-pro-max/scripts/* cli/assets/scripts/ - cp -r src/ui-ux-pro-max/templates/* cli/assets/templates/ + cd cli + npm run sync:assets + npm run check:assets ``` 4. **Reference Folders** - No manual sync needed. The CLI generates these from templates during `uipro init`. diff --git a/README.md b/README.md index 6a1f1ad..1df7180 100755 --- a/README.md +++ b/README.md @@ -154,7 +154,7 @@ Each rule includes: - **161 Color Palettes** - Industry-specific palettes aligned 1:1 with the 161 product types - **57 Font Pairings** - Curated typography combinations with Google Fonts imports - **25 Chart Types** - Recommendations for dashboards and analytics -- **16 Tech Stacks** - React, Next.js, Astro, Vue, Nuxt.js, Nuxt UI, Svelte, SwiftUI, React Native, Flutter, HTML+Tailwind, shadcn/ui, Jetpack Compose, Angular, Laravel, JavaFX +- **17 Tech Stacks** - React, Next.js, Astro, Vue, Nuxt.js, Nuxt UI, Svelte, SwiftUI, React Native, Flutter, HTML+Tailwind, shadcn/ui, Jetpack Compose, Angular, Laravel, Three.js, JavaFX - **99 UX Guidelines** - Best practices, anti-patterns, and accessibility rules - **161 Reasoning Rules** - Industry-specific design system generation (NEW in v2.0) @@ -304,8 +304,8 @@ uipro init --ai cursor --global # Install to ~/.cursor/skills/ ```bash uipro versions # List available versions -uipro update # Update to latest version -uipro init --offline # Skip GitHub download, use bundled assets +uipro update # Refresh skill files from installed CLI package +uipro init --offline # Compatibility flag; installs bundled templates uipro uninstall # Remove skill (auto-detect platform) uipro uninstall --ai claude # Remove specific platform uipro uninstall --global # Remove from global install @@ -386,7 +386,7 @@ The skill provides stack-specific guidelines for: | **Vue Ecosystem** | Vue, Nuxt.js, Nuxt UI | | **Angular** | Angular | | **PHP** | Laravel (Blade, Livewire, Inertia.js) | -| **Other Web** | Svelte, Astro | +| **Other Web** | Svelte, Astro, Three.js | | **Desktop** | JavaFX | | **iOS** | SwiftUI | | **Android** | Jetpack Compose | @@ -468,7 +468,7 @@ npm install -g uipro-cli uipro init --ai ``` -This ensures you get the latest templates and correct file structure for your AI assistant. +This ensures you get the latest templates bundled with the installed CLI package and the correct file structure for your AI assistant. Update the npm package first when a new release is published. ### For Contributors @@ -491,12 +491,12 @@ cli/ # CLI installer (generates files from templates) # - templates/ → Platform-specific templates # 4. Sync to CLI and test locally -cp -r src/ui-ux-pro-max/data/* cli/assets/data/ -cp -r src/ui-ux-pro-max/scripts/* cli/assets/scripts/ -cp -r src/ui-ux-pro-max/templates/* cli/assets/templates/ +cd cli +npm run sync:assets +npm run check:assets # 5. Build and test CLI -cd cli && bun run build +bun run build node dist/index.js init --ai claude --offline # Test in a temp folder # 6. Create PR (never push directly to main) diff --git a/cli/README.md b/cli/README.md index 2321ba3..40c7866 100644 --- a/cli/README.md +++ b/cli/README.md @@ -28,12 +28,12 @@ uipro init --ai continue # Continue (Skills) uipro init --ai all # All assistants # Options -uipro init --offline # Skip GitHub download, use bundled assets only +uipro init --offline # Compatibility flag; installs bundled templates uipro init --force # Overwrite existing files # Other commands uipro versions # List available versions -uipro update # Update to latest version +uipro update # Refresh skill files from installed CLI package ``` ## GitHub Authentication @@ -63,9 +63,12 @@ uipro init ## How It Works -By default, `uipro init` tries to download the latest release from GitHub to ensure you get the most up-to-date version. If the download fails (network error, rate limit), it automatically falls back to the bundled assets included in the CLI package. +`uipro init` generates assistant-specific files from the templates bundled with the installed CLI package. To get newer templates and data, update the package first: -Use `--offline` to skip the GitHub download and use bundled assets directly. +```bash +npm install -g uipro-cli@latest +uipro init --ai codex +``` ## Development @@ -79,6 +82,12 @@ bun run src/index.ts --help # Build bun run build +# Sync bundled CLI assets from the source skill +npm run sync:assets + +# Verify bundled assets are current before publishing +npm run check:assets + # Link for local testing bun link ``` diff --git a/cli/assets/data/app-interface.csv b/cli/assets/data/app-interface.csv index 636284c..f34c3cd 100644 --- a/cli/assets/data/app-interface.csv +++ b/cli/assets/data/app-interface.csv @@ -1,31 +1,31 @@ No,Category,Issue,Keywords,Platform,Description,Do,Don't,Code Example Good,Code Example Bad,Severity -1,Accessibility,Icon Button Labels,icon button aria-label,Web,Icon-only buttons must have accessible names,Add aria-label to icon buttons,Icon button without label,"","",Critical -2,Accessibility,Form Control Labels,form input label aria,Web,All form controls need labels or aria-label,Use label element or aria-label,Input without accessible name,"","",Critical -3,Accessibility,Keyboard Handlers,keyboard onclick onkeydown,Web,Interactive elements must support keyboard interaction,Add onKeyDown alongside onClick,Click-only interaction,"
","
",High -4,Accessibility,Semantic HTML,semantic button a label,Web,Use semantic HTML before ARIA attributes,Use button/a/label elements,Div with role attribute,"","
Submit
",High -5,Accessibility,Aria Live,aria-live polite async,Web,Async updates need aria-live for screen readers,Add aria-live='polite' for dynamic content,Silent async updates,"
{status}
","
{status}
// no announcement",Medium -6,Accessibility,Decorative Icons,aria-hidden decorative icon,Web,Decorative icons should be hidden from screen readers,Add aria-hidden='true' to decorative icons,Decorative icon announced,"