-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.cursorrules
60 lines (45 loc) · 1.96 KB
/
.cursorrules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
The goal of this project is to create a component library.
The design system is providered by DaisyUI.
The Component Library is a Rails Engine.
It's build with TailwindCSS and DaisyUI, ViewComponent and Rails.
We take inspiration from the following projects:
https://github.com/primer/design
https://github.com/primer/view_components
This project use Lookbook for documentation
https://github.com/lookbook-hq/lookbook
The preview are in the test/components/previews folder
The docs are in the test/components/docs folder
use Gemfile to manage dependencies no gemspec
Use Minitest and Fixtures for testing
Use Capybara for testing
Create SVG for icons, and use the IconHelper to render them
The IconHelper should not be used in the component, but in the test and the preview, Icon are passed, to the component
DONT delete documentation comments in the code, update them instead
Ruby Style Guide
Style/ClassAndModuleChildren
good:
```ruby
module DaisyComponents
module Actions
class SwapComponentTest < DaisyComponents::ComponentTestCase
end
end
end
```
bad:
```ruby
class DaisyComponents::Actions::SwapComponentTest < DaisyComponents::ComponentTestCase
end
```
Every component preview should have a playground method with all the parameters as options and the description as Lookbook description.
For every component create:
- Ruy class
- html template
- lookbook preview with a playground method and the description as Lookbook description with group and label
- TEST: in the test we test the component behavior and the preview (just the fact that they render). Don't duplicate tests to much, but give precedence to the preview but be sure to test the behavior)
- documentation
For images, use placehold.co to generate placeholder images.
When you want to check the coverage, run:
COVERAGE=true bin/rails test
Read the coverage report by using ./bin/parse_coverage.rb
Every component preview should be organized into groups that separate HTML and Ruby source rendering.