Skip to content

Commit 795b94a

Browse files
committed
Merge branch 'master' into prepare_0.7.4_release
2 parents a6699b2 + 1b50277 commit 795b94a

File tree

8 files changed

+140
-48
lines changed

8 files changed

+140
-48
lines changed

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
![](https://github.com/matestack/matestack-ui-core/workflows/specs/badge.svg)
22
[![Gitter](https://badges.gitter.im/basemate/community.svg)](https://gitter.im/basemate/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
33
[![Gem Version](https://badge.fury.io/rb/matestack-ui-core.svg)](https://badge.fury.io/rb/matestack-ui-core)
4+
[![Docs](https://img.shields.io/badge/docs-matestack-blue.svg)](https://www.matestack.org/docs/install)
45

56
![matestack logo](./logo.png)
67

@@ -21,7 +22,7 @@ dynamic Web-App.
2122

2223
### Current State:
2324

24-
We love to see more and more people using and contributing to matestack-ui-core. Our current version is 0.7.3 and it's not perfect yet. We recommend you to start using matestack-ui-core in a side project and report issues as this helps us to push matestack-ui-core towards a production ready 1.0.0. At basemate, we already use matestack-ui-core in production as we know how to handle current issues and bypass them with deep insights of the core implementation. We plan to invest time and money (yes, we're hiring) on following improvements:
25+
We love to see more and more people using and contributing to matestack-ui-core. Our current version is 0.7.4 and it's not perfect yet. We recommend you to start using matestack-ui-core in a side project and report issues as this helps us to push matestack-ui-core towards a production ready 1.0.0. At matestack, we already use matestack-ui-core in production as we know how to handle current issues and bypass them with deep insights of the core implementation. We plan to invest time and money (yes, we're hiring) on following improvements:
2526

2627
* debugging and error handling
2728
* core refactoring, increased core maintainability and code quality

docs/components/async.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ end
5454

5555
### Hide_after
5656

57-
The `hide_after` option lets us define a timespan after which the component gets hidden.
57+
The `hide_after` option lets us define a timespan in milliseconds after which the component gets hidden.
5858

5959
```ruby
6060
async hide_after: 1000 do
@@ -103,7 +103,7 @@ end
103103
```
104104

105105
#### delayed defer
106-
`defer: 2000` means that the content of the `async` component gets requested within a separate GET request `2000ms` after initial page load is done.
106+
`defer: 2000` means that the content of the `async` component gets requested within a separate GET request 2000 milliseconds after initial page load is done.
107107
```ruby
108108
async defer: 2000 do
109109
div id: 'my-div' do
@@ -290,7 +290,7 @@ end
290290

291291
### Example 4: Hide after show on event
292292

293-
On our example page, we wrap a simple timestamp in an async component and tell it to show up when the event `my_event` gets triggered and be hidden after 1000ms.
293+
On our example page, we wrap a simple timestamp in an async component and tell it to show up when the event `my_event` gets triggered and be hidden after 1000 milliseconds.
294294

295295
```ruby
296296
class ExamplePage < Matestack::Ui::Page

docs/concepts/component.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -219,26 +219,19 @@ This gets rendered into HTML as shown below. Notice that the `@foo` from the com
219219
To use *component instance scope slots*, first define slots within a static component:
220220

221221
```ruby
222-
class Components::Some::Component < Matestack::Ui::StaticComponent
222+
class Components::Other::Component < Matestack::Ui::StaticComponent
223223

224224
def prepare
225-
@foo = "foo from component"
225+
@foo = "foo from other component"
226226
end
227227

228228
def response
229229
components {
230-
div id: "my-component" do
231-
custom_other_component slots: {
232-
my_slot_from_component: my_slot_from_component,
233-
my_slot_from_page: @options[:my_slot_from_page]
234-
}
235-
end
236-
}
237-
end
238-
239-
def my_slot_from_component
240-
slot {
241-
span id: "my-slot-from-component" do
230+
div id: "my-other-component" do
231+
slot @options[:slots][:my_slot_from_component]
232+
br
233+
slot @options[:slots][:my_slot_from_page]
234+
br
242235
plain @foo
243236
end
244237
}
@@ -247,22 +240,29 @@ class Components::Some::Component < Matestack::Ui::StaticComponent
247240
end
248241
```
249242

250-
And another component:
243+
and also in some component:
251244

252245
```ruby
253-
class Components::Other::Component < Matestack::Ui::StaticComponent
246+
class Components::Some::Component < Matestack::Ui::StaticComponent
254247

255248
def prepare
256-
@foo = "foo from other component"
249+
@foo = "foo from component"
257250
end
258251

259252
def response
260253
components {
261-
div id: "my-other-component" do
262-
slot @options[:slots][:my_slot_from_component]
263-
br
264-
slot @options[:slots][:my_slot_from_page]
265-
br
254+
div id: "my-component" do
255+
custom_other_component slots: {
256+
my_slot_from_component: my_slot_from_component,
257+
my_slot_from_page: @options[:my_slot_from_page]
258+
}
259+
end
260+
}
261+
end
262+
263+
def my_slot_from_component
264+
slot {
265+
span id: "my-slot-from-component" do
266266
plain @foo
267267
end
268268
}
@@ -271,7 +271,7 @@ class Components::Other::Component < Matestack::Ui::StaticComponent
271271
end
272272
```
273273

274-
Then, put both components to use on the example page:
274+
Then, put both components (note that some component uses other component so that's how they're both in here) to use on the example page:
275275

276276
```ruby
277277
class Pages::ExamplePage < Matestack::Ui::Page
@@ -367,7 +367,7 @@ Not a fancy example, but this is the result:
367367
<div id="div-on-page">
368368
<div id="my-component">
369369
foo from page
370-
</div>
370+
</div>
371371
</div>
372372
```
373373

docs/contribute/README.md

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ 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+
2526
## Dockerized Core Dev
2627

2728
We dockerized the core development in order to make it as convenient as possible to contribute to matestack-ui-core.
@@ -93,13 +94,6 @@ Otherwise the generated files will be owned by the `root` user and are only writ
9394

9495
## Core Components Generator
9596

96-
Core Components are an essential part of the `matestack-ui-core` gem.
97-
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.
98-
99-
The generator will create a matestack core component to `app/concepts/matestack/ui/core`.
100-
101-
Example:
102-
10397
```bash
10498
CURRENT_UID=$(id -u):$(id -g) docker-compose run --rm dummy bash
10599
rails generate matestack:core:component div
@@ -116,34 +110,49 @@ docs/components/div.md
116110

117111
## Dockerized Test Env
118112

113+
bundle install
114+
yarn install
115+
cd spec/dummy
116+
yarn install # dependencies for the dummy app in testing
117+
cd ../..
118+
119+
bundle exec rake db:create
120+
bundle exec rake db:schema:load
121+
```
122+
123+
## Tests
124+
119125
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:
120126
121127
```shell
122128
docker-compose run --rm test bash
123129
bundle exec rake db:setup #once initially
124130
bundle exec rspec spec/usage/components
131+
125132
```
126133

127134
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.
128135

129-
### Note: Running tests on macOS
130-
131-
Make sure you have installed `chromedriver` on your machine. You can install `chromedriver` via `brew` with
136+
## Core Components
132137

133-
```shell
134-
brew cask install chromedriver
135-
```
138+
Core Components are an essential part of the `matestack-ui-core` gem.
139+
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.
136140

137-
You can then run your the testsuite with `bundle exec rspec`.
141+
The generator will create a matestack core component to `app/concepts/matestack/ui/core`.
138142

139-
If you get an error about a version mismatch similar to this one:
143+
Example:
140144

141-
`Chrome version must be between X and Y (Driver info: chromedriver=X.Y.Z)`
145+
```bash
146+
rails generate matestack:core:component div
147+
```
142148

143-
Make sure you update your chromedriver by executing this command in the project root:
149+
This will create a component for the HTML `<div>` tag and will generate the following files:
144150

145-
```shell
146-
rails app:webdrivers:chromedriver:update
151+
```bash
152+
app/concepts/matestack/ui/core/div/div.haml
153+
app/concepts/matestack/ui/core/div/div.rb
154+
spec/usage/components/div_spec.rb
155+
docs/components/div.md
147156
```
148157

149158
## Release

docs/install/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,9 @@ Rails.application.config.assets.paths << Rails.root.join('app/matestack/componen
145145
## Websocket Integration
146146

147147
If you want to use websockets, please read [this guide](/docs/integrations/websockets.md)
148+
149+
## That's it!
150+
151+
That's all you need to setup matestack!
152+
153+
For your next steps in learning matestack we recommend you check out the basics [concepts](/docs/concepts/README.md) and follow the [hello world guide](/guides/10_hello_world.md) which shows you how to create your first matestack app!

guides/10_hello_world.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ All we got left to do is to start Rails by entering `rails server` in the consol
9797

9898
We have successfully installed the `Matestack UI Core gem` to a Rails application and can now write our views in pure Ruby!
9999

100-
Even though we have only seen static content in this hello world example, you may already see the potential in this approach - if not, go ahead and see how we can add client side dynamic with other Matestack components!
100+
Even though we have only seen static content in this hello world example, you may already see the potential in this approach - if not, go ahead and see how we can add client side dynamic with [other Matestack components](/docs/components#dynamic-core-components)!
101101

102102
## Next steps
103103

logo.png

2.69 KB
Loading

0 commit comments

Comments
 (0)