Skip to content

Commit 50c3795

Browse files
authored
Merge pull request #27 from sean-yeoh/dev
Release v0.1.19
2 parents 5a9c288 + f1ac8f0 commit 50c3795

File tree

181 files changed

+27689
-3874
lines changed

Some content is hidden

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

181 files changed

+27689
-3874
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
strategy:
3030
fail-fast: false
3131
matrix:
32-
ruby: ['3.3', '3.4', 'head']
32+
ruby: ['3.4', 'head']
3333
steps:
3434
- uses: actions/checkout@v4
3535
- uses: ruby/setup-ruby@v1
@@ -38,14 +38,15 @@ jobs:
3838
bundler: latest
3939
bundler-cache: true
4040
- name: Run tests
41+
env:
42+
TZ: UTC
4143
run: bundle exec rake test
4244

4345
user-install:
4446
strategy:
4547
fail-fast: false
4648
matrix:
4749
plat: ['ubuntu', 'macos']
48-
# plat: ['ubuntu', 'windows', 'macos']
4950
runs-on: ${{matrix.plat}}-latest
5051
steps:
5152
- uses: actions/checkout@v4
@@ -56,6 +57,21 @@ jobs:
5657
- run: test/integration/user_install_test.sh
5758
shell: bash
5859

60+
user-upgrade:
61+
strategy:
62+
fail-fast: false
63+
matrix:
64+
plat: ['ubuntu', 'macos']
65+
runs-on: ${{matrix.plat}}-latest
66+
steps:
67+
- uses: actions/checkout@v4
68+
- uses: ruby/setup-ruby@v1
69+
with:
70+
ruby-version: '3.4'
71+
bundler: latest
72+
- run: test/integration/user_upgrade_test.sh
73+
shell: bash
74+
5975
check-release-version:
6076
if: github.head_ref == 'dev' && github.base_ref == 'main'
6177
runs-on: ubuntu-latest

CHANGELOG.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
## [Unreleased] - YYYY-MM-DD
1+
## [Unreleased] - 2025-08-01
2+
23
### Added
4+
5+
- Upgrade task
6+
- Ability to configure components
7+
38
### Changed
4-
### Deprecated
5-
### Removed
6-
### Fixed
7-
### Security
9+
10+
- Stimulus controllers initialization
811

912
## [0.1.17] - 2025-07-08
1013

1114
### Fixed
1215

1316
- Combobox search_placeholder_text
1417

15-
1618
## [0.1.16] - 2025-07-08
1719

1820
### Fixed

CLAUDE.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
This is a Ruby gem called `shadcn_phlexcomponents` - a UI component library for Ruby on Rails that provides Shadcn-style components built with Phlex. The library includes interactive JavaScript controllers using Stimulus and Tailwind CSS for styling.
8+
9+
## Architecture
10+
11+
### Core Structure
12+
- **Ruby Components**: Located in `lib/shadcn_phlexcomponents/components/` - each component inherits from `Base` class
13+
- **JavaScript Controllers**: Located in `app/javascript/controllers/` - Stimulus controllers that provide interactivity
14+
- **Stylesheets**: Located in `app/javascript/stylesheets/` - component-specific CSS
15+
- **Base Component**: `lib/shadcn_phlexcomponents/components/base.rb` provides common functionality including:
16+
- Phlex::HTML integration
17+
- TailwindMerge for class merging
18+
- Sanitization helpers for SVG icons
19+
- Class variants system
20+
- Lucide Rails icon integration
21+
22+
### Component Pattern
23+
Components follow a dual-layer architecture:
24+
1. Ruby Phlex components for HTML structure and styling
25+
2. Stimulus controllers for JavaScript behavior and interactivity
26+
27+
### Key Dependencies
28+
- **Class Variants** (~> 1.1): For configuring different variants of css classes
29+
- **Phlex Rails** (~> 2.1): For component rendering
30+
- **Lucide Rails** (~> 0.5.1): For icons
31+
- **TailwindMerge** (~> 1.0): For CSS class merging
32+
- **Rails** (~> 8.0): Host framework
33+
34+
## Development Commands
35+
36+
### Testing
37+
```bash
38+
rake test # Run all tests
39+
```
40+
41+
### Linting
42+
```bash
43+
rake rubocop # Run RuboCop linter
44+
rubocop # Direct RuboCop execution
45+
```
46+
47+
### Development Setup
48+
```bash
49+
bin/setup # Install dependencies
50+
bin/console # Interactive Ruby console
51+
```
52+
53+
### Gem Management
54+
```bash
55+
bundle exec rake install # Install gem locally
56+
bundle exec rake release # Release new version
57+
rake # Default task (test + rubocop)
58+
```
59+
60+
## Component Development
61+
62+
### Adding New Components
63+
1. Create Ruby component in `lib/shadcn_phlexcomponents/components/`
64+
2. If interactive, create corresponding Stimulus controller in `app/javascript/controllers/`
65+
3. Add any component-specific CSS to `app/javascript/stylesheets/`
66+
4. Components should inherit from `ShadcnPhlexcomponents::Base`
67+
68+
### Styling Guidelines
69+
- Use Tailwind CSS classes
70+
- Leverage the `TAILWIND_MERGER` for class merging
71+
- Follow existing component patterns for consistency
72+
- Use `class_variants` system for component variations
73+
74+
### JavaScript Controllers
75+
- Use Stimulus framework
76+
- Controllers should be named `[component_name]_controller.ts`
77+
- Follow existing controller patterns for data attributes and targets

Gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ gem "rubocop-minitest", "~> 0.37.0", require: false
1313
gem "rubocop-shopify", "~> 2.16", require: false
1414
gem "debug", platforms: [:mri, :windows]
1515
gem "phlex-rails", "~> 2.1"
16-
gem "rails", "~> 8.0"
1716
gem "lucide-rails", "~> 0.5.1"
1817
gem "tailwind_merge", "~> 1.0"
18+
gem "class_variants", "~> 1.1"
19+
gem "rails", "~> 8.0"
20+
gem "nokogiri", "~> 1.0"

0 commit comments

Comments
 (0)