qb 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/qb/version.rb +1 -1
- data/roles/qb.meteor_react_component/defaults/main.yml +3 -1
- data/roles/qb.meteor_react_component/meta/qb.yml +20 -3
- data/roles/qb.meteor_react_component/tasks/main.yml +14 -11
- data/roles/qb.meteor_react_component/templates/component.jsx.j2 +7 -7
- data/roles/qb.meteor_react_component/templates/style.import.less.j2 +2 -2
- metadata +1 -2
- data/roles/qb.meteor_react_component/library/component_facts.py +0 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 352d78a052f07a71c9e99e5cbfdc58024d720fce
|
4
|
+
data.tar.gz: 68a8aef9f041c5670c580a962d3961f9147d106b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7813746292a10f1a1d710379a4c7e524b92b295b6c8ce5d84d4c777a8f6e0a7f32838b2eb68691172314f4e8ad596f9ce4061e7fbc7833ceb990a047e4d6ddb1
|
7
|
+
data.tar.gz: 053bda3ec3198f7dd15d7b237560f0adf085568b7e6925f2e65ebe8670d981fcf7e4cde14d9683d84a2b5c352248ebd54cb4e512e0f418c4dfb23d06ae3acc15
|
data/lib/qb/version.rb
CHANGED
@@ -20,12 +20,18 @@ vars:
|
|
20
20
|
# required: false
|
21
21
|
# type: boolean # boolean (default) | string
|
22
22
|
# short: e
|
23
|
-
- name:
|
24
|
-
description:
|
23
|
+
- name: dir
|
24
|
+
description: directory under imports/ui that the component goes in
|
25
25
|
required: true
|
26
26
|
type: string
|
27
27
|
short: p
|
28
28
|
|
29
|
+
- name: class
|
30
|
+
description: component class name
|
31
|
+
required: true
|
32
|
+
type: string
|
33
|
+
short: c
|
34
|
+
|
29
35
|
- name: data
|
30
36
|
description: add ReactDataMixin
|
31
37
|
required: false
|
@@ -48,4 +54,15 @@ vars:
|
|
48
54
|
description: overwrite existing file
|
49
55
|
required: false
|
50
56
|
type: boolean
|
51
|
-
short: f
|
57
|
+
short: f
|
58
|
+
|
59
|
+
- name: index_import
|
60
|
+
description: create an export * line for this component in imports/ui/index.js
|
61
|
+
required: false
|
62
|
+
type: boolean
|
63
|
+
|
64
|
+
- name: default
|
65
|
+
description: if true exports the component as the default from the module
|
66
|
+
required: false
|
67
|
+
type: boolean
|
68
|
+
|
@@ -1,41 +1,44 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
- name: set logger name
|
3
|
+
set_fact:
|
4
|
+
component_logger_name: "imports:ui:{{ component_dir | regex_replace('/', ':')}}:{{ component_class }}"
|
5
|
+
component_path: "{{ qb_dir }}/imports/ui/{{ component_dir }}/{{ component_class }}.jsx"
|
6
|
+
component_style_path: "{{ qb_dir }}/client/styles/{{ component_dir }}/{{ component_class }}.import.less"
|
5
7
|
|
6
8
|
- name: create component directory
|
7
9
|
file:
|
8
|
-
path: "{{
|
10
|
+
path: "{{ component_path | dirname }}"
|
9
11
|
state: directory
|
10
12
|
recurse: true
|
11
13
|
|
12
|
-
- name: "create {{
|
14
|
+
- name: "create {{ component_class }} component"
|
13
15
|
template:
|
14
16
|
src: component.jsx.j2
|
15
|
-
dest: "{{
|
17
|
+
dest: "{{ component_path }}"
|
16
18
|
force: "{{ component_force }}"
|
17
19
|
|
18
20
|
- name: add import line to imports/ui/index.js
|
19
21
|
lineinfile:
|
20
22
|
dest: "{{ qb_dir }}/imports/ui/index.js"
|
21
|
-
line: "export * from './{{ component_dir }}/{{
|
22
|
-
|
23
|
+
line: "export * from './{{ component_dir }}/{{ component_class }}.jsx';"
|
24
|
+
create: true
|
25
|
+
when: component_index_import
|
23
26
|
|
24
27
|
- name: create styles directory
|
25
28
|
file:
|
26
|
-
path: "{{
|
29
|
+
path: "{{ component_style_path | dirname }}"
|
27
30
|
state: directory
|
28
31
|
recurse: true
|
29
32
|
|
30
33
|
- name: create a stylesheet for it
|
31
34
|
template:
|
32
35
|
src: style.import.less.j2
|
33
|
-
dest: "{{
|
36
|
+
dest: "{{ component_style_path }}"
|
34
37
|
force: "{{ component_force }}"
|
35
38
|
|
36
39
|
- name: add import line to client/styles/index.less
|
37
40
|
lineinfile:
|
38
41
|
dest: "{{ qb_dir }}/client/styles/index.less"
|
39
|
-
line: '@import "{{ component_dir }}/{{
|
42
|
+
line: '@import "{{ component_dir }}/{{ component_class }}.import.less";'
|
40
43
|
create: true
|
41
44
|
|
@@ -20,7 +20,7 @@ import * as Util from '/imports/util';
|
|
20
20
|
|
21
21
|
const log = Util.logger('{{ component_logger_name }}');
|
22
22
|
|
23
|
-
export default class {{
|
23
|
+
export {% if component_default %}default{% endif %} class {{ component_class }} extends Component {
|
24
24
|
constructor() {
|
25
25
|
super();
|
26
26
|
} // constructor()
|
@@ -47,7 +47,7 @@ export default class {{ component_class_name }} extends Component {
|
|
47
47
|
|
48
48
|
render() {
|
49
49
|
return (
|
50
|
-
<{{ component_root }} className="{{
|
50
|
+
<{{ component_root }} className="{{ component_class }}">
|
51
51
|
{ this.renderContent() }
|
52
52
|
</{{ component_root }}>
|
53
53
|
);
|
@@ -56,20 +56,20 @@ export default class {{ component_class_name }} extends Component {
|
|
56
56
|
// hook methods
|
57
57
|
// ===========
|
58
58
|
|
59
|
-
} // {{
|
59
|
+
} // {{ component_class }}
|
60
60
|
|
61
|
-
{{
|
61
|
+
{{ component_class }}.propTypes = {
|
62
62
|
|
63
63
|
} // propTypes
|
64
64
|
|
65
65
|
{% if component_data -%}
|
66
66
|
// mixin that calls `component.getMeteorData()`
|
67
|
-
reactMixin({{
|
67
|
+
reactMixin({{ component_class}}.prototype, ReactDataMixin);
|
68
68
|
{% endif %}
|
69
69
|
|
70
70
|
{% if component_blaze -%}
|
71
71
|
// register component globally to be used by Blaze
|
72
|
-
Template.registerHelper('{{
|
73
|
-
return {{
|
72
|
+
Template.registerHelper('{{ component_class}}', () => {
|
73
|
+
return {{ component_class }};
|
74
74
|
});
|
75
75
|
{% endif %}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nrser
|
@@ -153,7 +153,6 @@ files:
|
|
153
153
|
- roles/qb.install_gem/meta/qb.yml
|
154
154
|
- roles/qb.install_gem/tasks/main.yml
|
155
155
|
- roles/qb.meteor_react_component/defaults/main.yml
|
156
|
-
- roles/qb.meteor_react_component/library/component_facts.py
|
157
156
|
- roles/qb.meteor_react_component/meta/main.yml
|
158
157
|
- roles/qb.meteor_react_component/meta/qb.yml
|
159
158
|
- roles/qb.meteor_react_component/tasks/main.yml
|
@@ -1,39 +0,0 @@
|
|
1
|
-
#!/usr/bin/python
|
2
|
-
|
3
|
-
import os
|
4
|
-
|
5
|
-
def main():
|
6
|
-
module = AnsibleModule(
|
7
|
-
argument_spec = dict(
|
8
|
-
path = dict(required=True, type='str'),
|
9
|
-
),
|
10
|
-
supports_check_mode = False,
|
11
|
-
)
|
12
|
-
|
13
|
-
|
14
|
-
facts = {}
|
15
|
-
changed = False
|
16
|
-
|
17
|
-
path = module.params.get('path')
|
18
|
-
path_parts = path.split('/')
|
19
|
-
|
20
|
-
dir = os.path.join(*path_parts[:-1])
|
21
|
-
dashed = "-".join(path_parts)
|
22
|
-
class_name = "".join([s.capitalize() for s in path_parts])
|
23
|
-
|
24
|
-
facts['component_dir'] = dir
|
25
|
-
facts['component_dashed'] = dashed
|
26
|
-
facts['component_class_name'] = class_name
|
27
|
-
facts['component_logger_name'] = ":".join(['imports', 'ui'] + path_parts)
|
28
|
-
|
29
|
-
module.exit_json(
|
30
|
-
changed = changed,
|
31
|
-
ansible_facts = facts,
|
32
|
-
)
|
33
|
-
|
34
|
-
# import module snippets
|
35
|
-
from ansible.module_utils.basic import *
|
36
|
-
from ansible.module_utils.known_hosts import *
|
37
|
-
|
38
|
-
if __name__ == '__main__':
|
39
|
-
main()
|