You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/contribute/README.md
+30-29Lines changed: 30 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -22,57 +22,58 @@ Feel free to take a look at other examples and copy their structure!
22
22
Note: We will not approve pull requests that introduce new concepts or components without documentation. Same goes for existing concepts & components.
23
23
If you change the behavior of an existing part of this project, make sure to also update the corresponding part of the documentation!
24
24
25
-
## Core Components
25
+
## Setup
26
26
27
-
Core Components are an essential part of the `matestack-ui-core` gem.
28
-
If you are planning to contribute to Matestack you can start doing that by creating a core component. To help you getting started you can use the Core Component Generator.
27
+
Assuming you have ruby and bundler already installed.
29
28
30
-
The generator will create a matestack core component to `app/concepts/matestack/ui/core`.
2. Install [chromedriver](https://sites.google.com/a/chromium.org/chromedriver/) (needed for running tests)
31
+
* on Mac it can be installed via `brew cask install chromedriver`, when you get an error about version mismatch like `Chrome version must be between X and Y (Driver info: chromedriver=X.Y.Z)` you should be able to update it via `rails app:webdrivers:chromedriver:update`
32
+
* on Linux you need to check the package name, on Ubuntu it's `sudo apt-get install chromium-chromedriver`
33
+
3. Install [sqlite](https://www.sqlite.org/) (needed for test execution against a rails app)
31
34
32
-
Example:
33
35
34
36
```bash
35
-
rails generate matestack:core:component div
37
+
bundle install
38
+
yarn install
39
+
cd spec/dummy
40
+
yarn install # dependencies for the dummy app in testing
41
+
cd ../..
42
+
43
+
bundle exec rake db:create
44
+
bundle exec rake db:schema:load
36
45
```
37
46
38
-
This will create a component for the HTML `<div>` tag and will generate the following files:
39
-
40
-
```bash
41
-
app/concepts/matestack/ui/core/div/div.haml
42
-
app/concepts/matestack/ui/core/div/div.rb
43
-
spec/usage/components/div_spec.rb
44
-
docs/components/div.md
45
-
```
46
-
47
-
48
47
## Tests
49
48
50
49
To assure this project is and remains in great condition, we heavily rely on automated tests. Tests are defined in `/spec` folder and can be executed by running:
51
50
52
51
```shell
53
-
bundle execrspec
52
+
be rspec spec/lib/ spec/usage/
54
53
```
55
54
56
55
Tests follow quite the same rules as the documentation: Make sure to either add relevant tests (when introducing new concepts or components) or change existing ones to fit your changes (updating existing concepts and components). Pull requests that add/change concepts & components and do not come with corresponding tests will not be approved.
57
56
58
-
### Note: Running tests on macOS
59
-
60
-
Make sure you have installed `chromedriver` on your machine. You can install `chromedriver` via `brew` with
57
+
## Core Components
61
58
62
-
```shell
63
-
brew cask install chromedriver
64
-
```
59
+
Core Components are an essential part of the `matestack-ui-core` gem.
60
+
If you are planning to contribute to Matestack you can start doing that by creating a core component. To help you getting started you can use the Core Component Generator.
65
61
66
-
You can then run your the testsuite with `bundle exec rspec`.
62
+
The generator will create a matestack core component to `app/concepts/matestack/ui/core`.
67
63
68
-
If you get an error about a version mismatch similar to this one:
64
+
Example:
69
65
70
-
`Chrome version must be between X and Y (Driver info: chromedriver=X.Y.Z)`
66
+
```bash
67
+
rails generate matestack:core:component div
68
+
```
71
69
72
-
Make sure you update your chromedriver by executing this command in the project root:
70
+
This will create a component for the HTML `<div>` tag and will generate the following files:
0 commit comments