qb 0.1.39 → 0.1.40

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6207437cc02ce11da7b368a69409b8c8e6db027f
4
- data.tar.gz: 7883329101be0289c09981a39bec698ff8fbf89a
3
+ metadata.gz: 8947f23f3e005dc71ede5abc97f15394b02052e6
4
+ data.tar.gz: 5f4eeb97562d35dc25787ded0445709f4d9e8b9f
5
5
  SHA512:
6
- metadata.gz: 9407784735ecbc1fc00c6b205710981b3b8aceb36bb7dd0fef9a0545ed138bd1d5cc9e6f2e1f598a57aecbca39151e8cd44b67a9a9cb0c2017c5a3ea9251874d
7
- data.tar.gz: a361762772045fe1ea6e39430adb5bee64ef7717243655e0539b5a5a690e982db27e3487cd5dbb0af2bb31a16c81e1524f5b395ecc7e73927c055220ef8442fe
6
+ metadata.gz: a9b6b27776df0984e2ca5a9583a511639bc53bf4e8c727c24ccf5b4863f81e60174414aece50ebcd2780ab80301b244cca14c70649f62bb2ddcd2bea439df54f
7
+ data.tar.gz: e29f2cc20bbb730c01d0e38e429850987949b16f060e919ec643c538142ad1d48502c0701cb4f561500d67a1732e4528b615c5cd4cf04703aa27915d0a8b3e1e
@@ -0,0 +1,5 @@
1
+ scratch work.
2
+
3
+ for playing around with ideas, testing things out, etc. i find it useful to keep this stuff around so i can refer back to it, though this directory should be cleaned up from time to time to remove long outdated code.
4
+
5
+ generally, work should be put in it's own directory (unless it's just a single file) so it's clear what belongs to what.
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem "slop"
@@ -0,0 +1,13 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ slop (4.4.1)
5
+
6
+ PLATFORMS
7
+ ruby
8
+
9
+ DEPENDENCIES
10
+ slop
11
+
12
+ BUNDLED WITH
13
+ 1.11.2
@@ -0,0 +1,3 @@
1
+ want to be able to support option names having aliases. because sometimes it's hard to remember exactly what the option is called, and qb aims to make things as stupid fast and easy from the command line as possible (at the expense of more complexity in the code).
2
+
3
+ driven at the moment by wanting the qb option `-H` / `--HOSTS` to be available as `-I` / `--INVENTORY` (the ansible name for it) as well as `--HOST`, so that's what the initial example at least will focus on.
@@ -0,0 +1,32 @@
1
+ require 'optparse'
2
+ require 'yaml'
3
+
4
+ opts = {}
5
+
6
+ parser = OptionParser.new do |parser|
7
+ parser.banner = "hey there"
8
+
9
+ parser.on(
10
+ '-X VALUE',
11
+ 'x',
12
+ ) do |value|
13
+ opts['x'] = value
14
+ end
15
+
16
+ parser.on(
17
+ '-I INVENTORY', '-H INVENTORY',
18
+ '--INVENTORY=INVENTORY', '--HOSTS=INVENTORY',
19
+ Array,
20
+ "inventory",
21
+ ) do |value|
22
+ opts['hosts'] = value
23
+ end
24
+
25
+ parser.on_tail('-h') do
26
+ puts parser
27
+ end
28
+ end
29
+
30
+ parser.parse! ARGV
31
+
32
+ puts YAML.dump(opts)
@@ -0,0 +1 @@
1
+ deal with option type declarations in role `meta/qb.yml` files and parsing those values in conjunction with the cli option parser.
@@ -0,0 +1,13 @@
1
+ ---
2
+ - name: array_of_int
3
+ description: an array of integers
4
+ type:
5
+ array_of: integer
6
+
7
+ - name: scope
8
+ description: can be string or false
9
+ type:
10
+ one_of:
11
+ - type: string
12
+ - false
13
+
@@ -0,0 +1,104 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+
5
+ require 'pp'
6
+ require 'slop'
7
+ require 'yaml'
8
+
9
+ opt_defs = YAML.load File.read(File.join(File.dirname(__FILE__), 'opts.yml'))
10
+
11
+ pp opt_defs
12
+
13
+ # ARGV = ARGV + ['--array', 'T,F,T', '--no-bool', 'F']
14
+
15
+ def make_option type
16
+ Slop.string_to_option_class(config[:type_config]).new([], '')
17
+ end
18
+
19
+ class Slop::ArrayOfOption < Slop::ArrayOption
20
+ # def initialize flags, desc, **config, &block
21
+ # super flags, desc, **config, &block
22
+ # @item_option =
23
+ # end
24
+
25
+ def call value
26
+ super(value).map {|string|
27
+ make_option(config[:type_config]).call string
28
+ }
29
+ end
30
+ end
31
+
32
+ class Slop::ValueOption < Slop::Option
33
+ def initialize flags, desc, **config, &block
34
+ super flags, desc, **config, &block
35
+ @value = config.fetch :type_config
36
+ end
37
+
38
+ def call value
39
+ unless value == @value
40
+ raise "bad value: #{ value.inspect }, should be #{ @value }"
41
+ end
42
+
43
+ value
44
+ end
45
+ end
46
+
47
+ class Slop::OneOfOption < Slop::Option
48
+ def initialize flags, desc, **config, &block
49
+ super flags, desc, **config, &block
50
+ @types = config.fetch(:type_config).map {|spec|
51
+ case spec
52
+ when Hash
53
+ make_option(spec['type'])
54
+ else
55
+ make_option('value', type_config: spec)
56
+ end
57
+ }
58
+ end
59
+
60
+ def call value
61
+
62
+ end
63
+ end
64
+
65
+ opts = Slop.parse(ARGV) do |o|
66
+ # o.string '-h', '--host', 'a hostname'
67
+ # o.integer '--port', 'custom port', default: 80
68
+ # o.bool '-v', '--verbose', 'enable verbose mode'
69
+ # o.bool '-q', '--quiet', 'suppress output (quiet mode)'
70
+ # o.bool '-c', '--check-ssl-certificate', 'check SSL certificate for host'
71
+ # o.on '--version', 'print the version' do
72
+ # puts Slop::VERSION
73
+ # exit
74
+ # end
75
+
76
+ # o.array_of '--array', 'an array of integers', item_type: 'integer'
77
+
78
+ opt_defs.each do |opt_def|
79
+ config = case opt_def['type']
80
+ when String
81
+ {type: opt_def['type']}
82
+ when Hash
83
+ {
84
+ type: opt_def['type'].keys[0],
85
+ type_config: opt_def['type'].values[0],
86
+ }
87
+ else
88
+ raise "HERE"
89
+ end
90
+
91
+ pp config
92
+
93
+ o.on "--#{ opt_def['name'] }",
94
+ opt_def['description'],
95
+ **config
96
+ end
97
+
98
+ o.on '-h', 'help' do
99
+ puts o
100
+ exit
101
+ end
102
+ end
103
+
104
+ pp opts.to_hash
data/exe/qb CHANGED
@@ -13,11 +13,7 @@ require 'qb'
13
13
  # constants
14
14
  # =========
15
15
 
16
- ROOT = QB::ROOT
17
- ROLES_DIR = QB::ROLES_DIR
18
- ROLES = Pathname.glob(ROLES_DIR + 'qb.*').map {|path| path.basename.to_s}
19
16
  DEBUG_ARGS = ['-D', '--DEBUG']
20
- TMP_DIR = ROOT + 'tmp'
21
17
 
22
18
  # globals
23
19
  # =======
@@ -154,72 +150,76 @@ def main args
154
150
 
155
151
  cwd = Dir.getwd
156
152
 
157
- # get the target dir
158
- dir = case args.length
159
- when 0
160
- # in this case, a dir has not been provided
161
- #
162
- # in some cases (like projects) the dir can be figured out in other ways:
163
- #
164
- QB.get_default_dir role, cwd, options
153
+ dir = nil
154
+
155
+ unless role.meta['default_dir'] == false
156
+ # get the target dir
157
+ dir = case args.length
158
+ when 0
159
+ # in this case, a dir has not been provided
160
+ #
161
+ # in some cases (like projects) the dir can be figured out in other ways:
162
+ #
163
+ QB.get_default_dir role, cwd, options
164
+
165
+ when 1
166
+ # there is a single positional arg, which is used as dir
167
+ args[0]
168
+
169
+ else
170
+ # there are multiple positional args, which is not allowed
171
+ raise "can't supply more than one argument: #{ args.inspect }"
172
+
173
+ end
165
174
 
166
- when 1
167
- # there is a single positional arg, which is used as dir
168
- args[0]
175
+ debug "input_dir", dir
169
176
 
170
- else
171
- # there are multiple positional args, which is not allowed
172
- raise "can't supply more than one argument: #{ args.inspect }"
177
+ # normalize to expanded path (has no trailing slash)
178
+ dir = File.expand_path dir
173
179
 
174
- end
175
-
176
- debug "input_dir", dir
177
-
178
- # normalize to expanded path (has no trailing slash)
179
- dir = File.expand_path dir
180
-
181
- debug "normalized_dir", dir
182
-
183
- # create the dir if it doesn't exist (so don't have to cover this in
184
- # every role)
185
- if role.mkdir
186
- FileUtils.mkdir_p dir unless File.exists? dir
187
- end
188
-
189
- saved_options_path = Pathname.new(dir) + '.qb-options.yml'
190
-
191
- saved_options = if saved_options_path.exist?
192
- # convert old _ separated names to - separated
193
- YAML.load(saved_options_path.read).map {|role_options_key, role_options|
194
- [
195
- role_options_key,
196
- role_options.map {|name, value|
197
- [QB::Options.cli_ize_name(name), value]
198
- }.to_h
199
- ]
200
- }.to_h.tap {|saved_options|
201
- debug "found saved options", saved_options
202
- }
203
- else
204
- debug "no saved options"
205
- {}
206
- end
180
+ debug "normalized_dir", dir
181
+
182
+ # create the dir if it doesn't exist (so don't have to cover this in
183
+ # every role)
184
+ if role.mkdir
185
+ FileUtils.mkdir_p dir unless File.exists? dir
186
+ end
207
187
 
208
- if saved_options.key? role.options_key
209
- role_saved_options = saved_options[role.options_key]
188
+ saved_options_path = Pathname.new(dir) + '.qb-options.yml'
210
189
 
211
- debug "found saved options for role", role_saved_options
190
+ saved_options = if saved_options_path.exist?
191
+ # convert old _ separated names to - separated
192
+ YAML.load(saved_options_path.read).map {|role_options_key, role_options|
193
+ [
194
+ role_options_key,
195
+ role_options.map {|name, value|
196
+ [QB::Options.cli_ize_name(name), value]
197
+ }.to_h
198
+ ]
199
+ }.to_h.tap {|saved_options|
200
+ debug "found saved options", saved_options
201
+ }
202
+ else
203
+ debug "no saved options"
204
+ {}
205
+ end
212
206
 
213
- role_saved_options.each do |option_cli_name, value|
214
- option = options[option_cli_name]
207
+ if saved_options.key? role.options_key
208
+ role_saved_options = saved_options[role.options_key]
215
209
 
216
- if option.value.nil?
217
- debug "setting from saved options", option: option, value: value
210
+ debug "found saved options for role", role_saved_options
211
+
212
+ role_saved_options.each do |option_cli_name, value|
213
+ option = options[option_cli_name]
218
214
 
219
- option.value = value
215
+ if option.value.nil?
216
+ debug "setting from saved options", option: option, value: value
217
+
218
+ option.value = value
219
+ end
220
220
  end
221
221
  end
222
- end
222
+ end # unless default_dir == false
223
223
 
224
224
  # check that required options are present
225
225
  missing = options.values.select {|option|
@@ -242,6 +242,7 @@ def main args
242
242
  # depreciated due to mass potential for conflict
243
243
  'dir' => dir,
244
244
  'qb_cwd' => cwd,
245
+ 'qb_user_roles_dir' => QB::USER_ROLES_DIR.to_s,
245
246
  }
246
247
 
247
248
  set_options.values.each do |option|
@@ -296,10 +297,10 @@ def main args
296
297
  ).join(':')
297
298
 
298
299
  ansible_library_path = [
299
- ROOT + 'library',
300
+ QB::ROOT + 'library',
300
301
  ].join(':')
301
302
 
302
- ansible_filter_plugins_path = ROOT.join 'plugins', 'filter_plugins'
303
+ ansible_filter_plugins_path = QB::ROOT.join 'plugins', 'filter_plugins'
303
304
 
304
305
  template = []
305
306
  template << "ANSIBLE_ROLES_PATH=<%= roles_path %>"
@@ -363,6 +364,7 @@ def main args
363
364
 
364
365
  # save the options back
365
366
  if (
367
+ dir &&
366
368
  # we set some options that we can save
367
369
  set_options.values.select {|o| o.save? }.length > 0 &&
368
370
  # the role says to save options
data/lib/qb.rb CHANGED
@@ -7,7 +7,8 @@ require "qb/ansible_module"
7
7
 
8
8
  module QB
9
9
  ROOT = (Pathname.new(__FILE__).dirname + '..').expand_path
10
- ROLES_DIR = ROOT + 'roles'
10
+ GEM_ROLES_DIR = ROOT + 'roles'
11
+ USER_ROLES_DIR = Pathname.new(ENV['HOME']).join '.ansible', 'roles'
11
12
  MIN_ANSIBLE_VERSION = Gem::Version.new '2.1.2'
12
13
 
13
14
  class Error < StandardError
@@ -106,6 +107,6 @@ module QB
106
107
  end
107
108
  end
108
109
 
109
- # needs QB::ROLES_DIR
110
+ # needs QB::*_ROLES_DIR
110
111
  require 'qb/role'
111
112
  require 'qb/options'
@@ -74,9 +74,38 @@ module QB
74
74
  ]
75
75
  end
76
76
 
77
+ # places to look for qb role directories. these paths are also included
78
+ # when qb runs a playbook.
79
+ #
80
+ # TODO resolution order:
81
+ #
82
+ # 1. paths specific to this run:
83
+ # a. TODO paths provided on the cli.
84
+ # 2. paths specific to the current directory:
85
+ # a. paths specified in ./ansible.cfg (if it exists)
86
+ # b. ./roles
87
+ # c. ./roles/tmp
88
+ # - used for roles that are downloaded but shouldn't be included
89
+ # in source control.
90
+ # d. paths specified in ./ansible/ansible.cfg (if it exists)
91
+ # e. ./ansible/roles
92
+ # f. ./ansible/roles/tmp
93
+ # - used for roles that are downloaded but shouldn't be included
94
+ # in source control.
95
+ # g. paths specified in ./dev/ansible.cfg (if it exists)
96
+ # h. ./dev/roles
97
+ # i. ./dev/roles/tmp
98
+ # - used for roles that are downloaded but shouldn't be included
99
+ # in source control.
100
+ # 3.
101
+ #
77
102
  # @return [Array<Pathname>] places to look for role dirs.
103
+ #
78
104
  def self.search_path
79
- [QB::ROLES_DIR] + [
105
+ [
106
+ QB::USER_ROLES_DIR,
107
+ QB::GEM_ROLES_DIR
108
+ ] + [
80
109
  QB::Util.resolve,
81
110
  QB::Util.resolve('ansible'),
82
111
  QB::Util.resolve('dev'),
@@ -99,7 +128,7 @@ module QB
99
128
  flatten.
100
129
  # should allow uniq to remove dups
101
130
  map {|role_dir| role_dir.realpath }.
102
- # needed when qb is run from the qb repo since QB::ROLES_DIR and
131
+ # needed when qb is run from the qb repo since QB::GEM_ROLES_DIR and
103
132
  # ./roles are the same dir
104
133
  uniq.
105
134
  map {|role_dir|
@@ -209,8 +238,8 @@ module QB
209
238
  def initialize path
210
239
  @path = path
211
240
 
212
- @rel_path = if path.to_s.start_with? QB::ROLES_DIR.to_s
213
- path.sub(QB::ROLES_DIR.to_s + '/', '')
241
+ @rel_path = if path.to_s.start_with? QB::GEM_ROLES_DIR.to_s
242
+ path.sub(QB::GEM_ROLES_DIR.to_s + '/', '')
214
243
  elsif path.to_s.start_with? Dir.getwd
215
244
  path.sub(Dir.getwd + '/', './')
216
245
  else
@@ -1,7 +1,7 @@
1
1
  module QB
2
2
  GEM_NAME = 'qb'
3
3
 
4
- VERSION = "0.1.39"
4
+ VERSION = "0.1.40"
5
5
 
6
6
  def self.gemspec
7
7
  Gem.loaded_specs[GEM_NAME]
@@ -17,12 +17,12 @@ def gemspec_path(dir):
17
17
  return paths[0]
18
18
 
19
19
  def is_gem(dir):
20
- return bool(gemspec_path(dir))
20
+ return dir and bool(gemspec_path(dir))
21
21
 
22
22
  def main():
23
23
  module = AnsibleModule(
24
24
  argument_spec = dict(
25
- qb_dir = dict(require = True, type = 'path'),
25
+ qb_dir = dict(require = False, type = 'path'),
26
26
  ),
27
27
  supports_check_mode = False,
28
28
  )
@@ -0,0 +1,9 @@
1
+ ---
2
+ # defaults file for qb.install
3
+
4
+ install_path: "{{ qb_user_roles_dir }}"
5
+ install_src: "{{ install_name.split('.')[0] }}/ansible-{{ install_name }}"
6
+ install_version: master
7
+ install_force: false
8
+ install_update: false
9
+ install_link: false
@@ -0,0 +1,8 @@
1
+ ---
2
+ # meta file for qb.install
3
+
4
+ allow_duplicates: yes
5
+
6
+ dependencies: []
7
+ # - role: role-name
8
+
@@ -1,5 +1,5 @@
1
1
  ---
2
- # meta/qb.yml file for nrser.js
2
+ # meta/qb.yml file for qb.install
3
3
  #
4
4
  # qb settings for this role. see README.md for more info.
5
5
  #
@@ -16,8 +16,10 @@ var_prefix: null
16
16
  #
17
17
  # options:
18
18
  #
19
- # - null
19
+ # - null (default)
20
20
  # - require the value on the command line.
21
+ # - false
22
+ # - don't provide qb_dir (means doesn't load or save options either)
21
23
  # - git_root
22
24
  # - use the git root fof the directory that the `qb` command is invoked
23
25
  # from. useful for 'project-centric' commands so they can be invoked
@@ -28,13 +30,13 @@ var_prefix: null
28
30
  # - invoke an execuable, passing a JSON serialization of the options
29
31
  # mapping their CLI names to values. path can be relative to role
30
32
  # directory.
31
- default_dir: null
33
+ default_dir: false
32
34
 
33
35
  # default user to become for play
34
36
  default_user: null
35
37
 
36
38
  # set to false to not save options in .qb-options.yml files
37
- save_options: true
39
+ save_options: false
38
40
 
39
41
  options:
40
42
  # - name: example
@@ -43,15 +45,44 @@ options:
43
45
  # type: boolean # boolean (default) | string
44
46
  # short: e
45
47
 
46
- - name: install
47
- description: run npm or yarn install
48
+ - name: name
49
+ description: name of role to install.
50
+ required: true
51
+ type: string
52
+ short: n
53
+
54
+ - name: src
55
+ description: where to get the role.
56
+ required: false
57
+ type: string
58
+ short: s
59
+
60
+ - name: version
61
+ description: version of the role to install.
62
+ required: false
63
+ type: boolean
64
+ short: v
65
+
66
+ - name: path
67
+ description: path to isntall roles at.
68
+ required: false
69
+ type: string
70
+ short: p
71
+
72
+ - name: force
73
+ description: force the install.
74
+ required: false
48
75
  type: boolean
49
- short: i
76
+ short: f
50
77
 
51
- - name: yarn
52
- description: use yarn node package manager instead of npm
78
+ - name: update
79
+ description: update the role.
80
+ required: false
53
81
  type: boolean
54
- short: y
82
+ short: u
55
83
 
56
- - include: qb.npm_package
57
- as: package
84
+ - name: link
85
+ description: symlink to src (which must be a file path)
86
+ required: false
87
+ type: boolean
88
+ short: l
@@ -0,0 +1,15 @@
1
+ ---
2
+ - name: |
3
+ clone
4
+
5
+ git@github.com:{{ install_src }}.git@{{ install_version }}
6
+
7
+ to
8
+
9
+ {{ install_path }}/{{ install_name }}
10
+ git:
11
+ repo: "git@github.com:{{ install_src }}.git"
12
+ dest: "{{ install_path }}/{{ install_name }}"
13
+ version: "{{ install_version }}"
14
+ force: "{{ install_force }}"
15
+ update: "{{ install_update }}"
@@ -0,0 +1,27 @@
1
+ ---
2
+ # symlink to src directory
3
+
4
+ - name: |
5
+ remove destination
6
+
7
+ {{ install_path }}/{{ install_name }}
8
+
9
+ prior to linking.
10
+ file:
11
+ path: "{{ install_path }}/{{ install_name }}"
12
+ state: absent
13
+ when: "{{ install_force }}"
14
+
15
+ - name: |
16
+ symlink
17
+
18
+ {{ install_path }}/{{ install_name }}
19
+
20
+ to
21
+
22
+ {{ install_src | realpath }}
23
+ file:
24
+ src: "{{ install_src | realpath }}"
25
+ dest: "{{ install_path }}/{{ install_name }}"
26
+ state: link
27
+
@@ -0,0 +1,9 @@
1
+ ---
2
+ # tasks file for qb.install
3
+
4
+ - include: git.yml
5
+ when: not install_link
6
+
7
+ - include: link.yml
8
+ when: install_link
9
+
@@ -18,6 +18,8 @@ var_prefix: null
18
18
  #
19
19
  # - null
20
20
  # - require the value on the command line.
21
+ # - false
22
+ # - don't provide qb_dir (means doesn't load or save options either).
21
23
  # - git_root
22
24
  # - use the git root fof the directory that the `qb` command is invoked
23
25
  # from. useful for 'project-centric' commands so they can be invoked
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.39
4
+ version: 0.1.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - nrser
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-07 00:00:00.000000000 Z
11
+ date: 2016-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -159,6 +159,7 @@ files:
159
159
  - dev/ansible.cfg
160
160
  - dev/hosts
161
161
  - dev/requirements.yml
162
+ - dev/scratch/README.md
162
163
  - dev/scratch/ansible_module/defaults/main.yml
163
164
  - dev/scratch/ansible_module/library/test
164
165
  - dev/scratch/ansible_module/meta/main.yml
@@ -169,6 +170,13 @@ files:
169
170
  - dev/scratch/empty/meta/main.yml
170
171
  - dev/scratch/empty/meta/qb.yml
171
172
  - dev/scratch/empty/tasks/main.yml
173
+ - dev/scratch/options/Gemfile
174
+ - dev/scratch/options/Gemfile.lock
175
+ - dev/scratch/options/aliases/README.md
176
+ - dev/scratch/options/aliases/optparse.rb
177
+ - dev/scratch/options/types/README.md
178
+ - dev/scratch/options/types/opts.yml
179
+ - dev/scratch/options/types/slop.rb
172
180
  - dev/scratch/stateSpec.js
173
181
  - dev/scratch/stdio/defaults/main.yml
174
182
  - dev/scratch/stdio/library/test
@@ -522,6 +530,12 @@ files:
522
530
  - roles/qb.hack_npm/tasks/create.yml
523
531
  - roles/qb.hack_npm/tasks/main.yml
524
532
  - roles/qb.hack_npm/vars/main.yml
533
+ - roles/qb.install/defaults/main.yml
534
+ - roles/qb.install/meta/main.yml
535
+ - roles/qb.install/meta/qb.yml
536
+ - roles/qb.install/tasks/git.yml
537
+ - roles/qb.install/tasks/link.yml
538
+ - roles/qb.install/tasks/main.yml
525
539
  - roles/qb.install_gem/defaults/main.yml
526
540
  - roles/qb.install_gem/meta/main.yml
527
541
  - roles/qb.install_gem/meta/qb.yml
@@ -530,16 +544,6 @@ files:
530
544
  - roles/qb.npm_package/meta/main.yml
531
545
  - roles/qb.npm_package/meta/qb.yml
532
546
  - roles/qb.npm_package/tasks/main.yml
533
- - roles/qb.nrser_js/.qb-options.yml
534
- - roles/qb.nrser_js/defaults/main.yml
535
- - roles/qb.nrser_js/files/.babelrc
536
- - roles/qb.nrser_js/files/.flowconfig
537
- - roles/qb.nrser_js/files/.gitkeep
538
- - roles/qb.nrser_js/files/gulpfile.js
539
- - roles/qb.nrser_js/meta/main.yml
540
- - roles/qb.nrser_js/meta/qb.yml
541
- - roles/qb.nrser_js/tasks/main.yml
542
- - roles/qb.nrser_js/vars/main.yml
543
547
  - roles/qb.project/.qb-options.yml
544
548
  - roles/qb.project/defaults/main.yml
545
549
  - roles/qb.project/files/ansible.cfg
@@ -1,6 +0,0 @@
1
- ---
2
- qb.qb_role:
3
- defaults: true
4
- files: true
5
- templates: false
6
- vars: true
@@ -1,4 +0,0 @@
1
- ---
2
- # defaults file for qb.nrser_js
3
- nrser_js_install: true
4
- nrser_js_yarn: true
@@ -1,69 +0,0 @@
1
- {
2
- "passPerPreset": true,
3
-
4
- "presets": [
5
- "stage-2",
6
- "react",
7
- "es2015"
8
- ],
9
-
10
- "env": {
11
- "development": {
12
- "plugins": [
13
- ["metalog", {
14
- "strip": {
15
- "labels": {
16
- "trace": false
17
- }
18
- },
19
- "extraLabels": [
20
- "errorRefs",
21
- "warnRefs",
22
- "infoRefs",
23
- "debugRefs",
24
- "traceRefs",
25
- "notif",
26
- "errorNotif",
27
- "warnNotif",
28
- "infoNotif",
29
- "debugNotif",
30
- "traceNotif"
31
- ]
32
- }],
33
- "syntax-flow",
34
- "transform-export-extensions",
35
- ["tcomb", {
36
- "skipAsserts": true
37
- }],
38
- "transform-flow-strip-types"
39
- ]
40
- },
41
-
42
- "production": {
43
- "plugins": [
44
- ["metalog", {
45
- "strip": true,
46
- "extraLabels": [
47
- "errorRefs",
48
- "warnRefs",
49
- "infoRefs",
50
- "debugRefs",
51
- "traceRefs",
52
- "notif",
53
- "errorNotif",
54
- "warnNotif",
55
- "infoNotif",
56
- "debugNotif",
57
- "traceNotif"
58
- ]
59
- }],
60
- "syntax-flow",
61
- "transform-export-extensions",
62
- ["tcomb", {
63
- "skipAsserts": true
64
- }],
65
- "transform-flow-strip-types"
66
- ]
67
- }
68
- }
69
- }
@@ -1,18 +0,0 @@
1
- [ignore]
2
-
3
- [include]
4
-
5
- [libs]
6
-
7
- [options]
8
- # support babel-plugin-transform-class-properties (in stage 2 preset)
9
- esproposal.class_static_fields=enable
10
-
11
- # support babel-plugin-transform-export-extensions
12
- esproposal.export_star_as=enable
13
-
14
- # it sucks not to able to use getters and setters... safety be damned.
15
- unsafe.enable_getters_and_setters=true
16
-
17
- # uncomment if you need dynamic requires
18
- # module.ignore_non_literal_requires=true
File without changes
@@ -1,8 +0,0 @@
1
- const gulp = require('gulp');
2
- const Ugh = require('@nrser/ugh').Ugh;
3
-
4
- const ugh = new Ugh({gulp, packageDir: __dirname});
5
-
6
- ugh.autoTasks();
7
-
8
- module.exports = ugh;
@@ -1,12 +0,0 @@
1
- ---
2
- # meta file for nrser.js
3
-
4
- allow_duplicates: yes
5
-
6
- dependencies:
7
- - role: nrser.state_mate
8
-
9
- - role: qb.npm_package
10
- npm_package_main: lib/index.js
11
- npm_package_scripts: "{{ nrser_js_package_scripts }}"
12
-
@@ -1,72 +0,0 @@
1
- ---
2
- # tasks file for nrser.js
3
-
4
- - name: add deps to package.json
5
- state:
6
- json:
7
- key: "{{ npm_package_json_path }}:dependencies:{{ item.key }}"
8
- init: "{{ item.value }}"
9
- create: true
10
- with_dict: "{{ nrser_js_deps }}"
11
-
12
- - name: add dev deps to package.json
13
- state:
14
- json:
15
- key: "{{ npm_package_json_path }}:devDependencies:{{ item.key }}"
16
- init: "{{ item.value }}"
17
- create: true
18
- with_dict: "{{ nrser_js_dev_deps }}"
19
-
20
- - name: "create {{ item }} dir"
21
- file:
22
- dest: "{{ qb_dir }}/{{ item }}"
23
- state: directory
24
- with_items:
25
- - src
26
- - test/src
27
-
28
- - name: "create {{ item }} file"
29
- copy:
30
- dest: "{{ qb_dir }}/{{ item }}"
31
- content: ''
32
- with_items:
33
- - src/index.js
34
- - test/src/index.tests.js
35
-
36
- - name: add .babelrc
37
- copy:
38
- src: .babelrc
39
- dest: "{{ qb_dir }}/.babelrc"
40
-
41
- - name: add gulpfile.js
42
- copy:
43
- src: gulpfile.js
44
- dest: "{{ qb_dir }}/gulpfile.js"
45
-
46
- - name: "ignore {{ item }}"
47
- lineinfile:
48
- line: "{{ item }}"
49
- dest: "{{ qb_dir }}/.gitignore"
50
- with_items:
51
- - /lib
52
- - /test/lib
53
-
54
- - name: add .flowconfig
55
- copy:
56
- src: .flowconfig
57
- dest: "{{ qb_dir }}/.flowconfig"
58
-
59
- - name: npm install
60
- when: "{{ nrser_js_install == true and nrser_js_yarn == false }}"
61
- command: npm install
62
- args:
63
- chdir: "{{ qb_dir }}"
64
- creates: "{{ qb_dir }}/node_modules"
65
-
66
- - name: yarn install
67
- when: "{{ nrser_js_install == true and nrser_js_yarn == true}}"
68
- command: yarn
69
- args:
70
- chdir: "{{ qb_dir }}"
71
- creates: "{{ qb_dir }}/node_modules"
72
-
@@ -1,36 +0,0 @@
1
- ---
2
- # vars file for nrser.js
3
-
4
- nrser_js_deps:
5
- lodash: "^4.16.2"
6
- nrser: "^0.5.0"
7
- tcomb: "^3.2.15"
8
-
9
- nrser_js_dev_deps:
10
- "@nrser/ugh": "^0.1.6"
11
- babel-cli: "^6.16.0"
12
- babel-core: "^6.17.0"
13
- babel-plugin-metalog: "^0.1.0"
14
- babel-plugin-tcomb: "^0.3.13"
15
- babel-plugin-transform-export-extensions: "^6.8.0"
16
- babel-polyfill: "^6.13.0"
17
- babel-preset-es2015: "^6.14.0"
18
- babel-preset-react: "^6.16.0"
19
- babel-preset-stage-2: "^6.17.0"
20
- chai: "^3.5.0"
21
- flow-bin: "^0.33.0"
22
- gulp: "^3.9.1"
23
- gulp-babel: "^6.1.2"
24
- gulp-spawn-mocha: "^3.1.0"
25
- gulp-util: "^3.0.7"
26
- istanbul: "^0.4.5"
27
- kexec: "^3.0.0"
28
- mocha: "^3.1.2"
29
- node-notifier: "^4.6.1"
30
-
31
- nrser_js_package_scripts:
32
- clean: gulp clean
33
- build: "gulp build:this"
34
- build-all: gulp build
35
- test: gulp mocha
36
- watch: gulp watch