Skip to content

Commit 20578d2

Browse files
authored
Merge pull request #334 from matestack/improve-contribution-setup
Improve Setup instructions for Contributions
2 parents d25399b + 66cf994 commit 20578d2

File tree

1 file changed

+30
-29
lines changed

1 file changed

+30
-29
lines changed

docs/contribute/README.md

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22,57 +22,58 @@ Feel free to take a look at other examples and copy their structure!
2222
Note: We will not approve pull requests that introduce new concepts or components without documentation. Same goes for existing concepts & components.
2323
If you change the behavior of an existing part of this project, make sure to also update the corresponding part of the documentation!
2424

25-
## Core Components
25+
## Setup
2626

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.
2928

30-
The generator will create a matestack core component to `app/concepts/matestack/ui/core`.
29+
1. [Install yarn](https://legacy.yarnpkg.com/lang/en/docs/install/)
30+
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)
3134

32-
Example:
3335

3436
```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
3645
```
3746

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-
4847
## Tests
4948

5049
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:
5150

5251
```shell
53-
bundle exec rspec
52+
be rspec spec/lib/ spec/usage/
5453
```
5554

5655
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.
5756

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
6158

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.
6561

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`.
6763

68-
If you get an error about a version mismatch similar to this one:
64+
Example:
6965

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+
```
7169

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:
7371

74-
```shell
75-
rails app:webdrivers:chromedriver:update
72+
```bash
73+
app/concepts/matestack/ui/core/div/div.haml
74+
app/concepts/matestack/ui/core/div/div.rb
75+
spec/usage/components/div_spec.rb
76+
docs/components/div.md
7677
```
7778

7879
## Release

0 commit comments

Comments
 (0)