k_director 0.10.4 → 0.11.3

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
  SHA256:
3
- metadata.gz: 698c7a115b9641c2e43e67a9687dc5915a4db15a01804213e8d9b032cc343989
4
- data.tar.gz: 8c7fe44606d3d30bab53f338c40f9891673adc1758389cf26938946b936b7ae2
3
+ metadata.gz: 30dd3c3e965fcfffe2f5a1bed60503f7bce7d81ebbb6e8222a839cdb12158a00
4
+ data.tar.gz: 3dc4f966e719adf8bb9c360034484dbb9592d3738a4a1bfc5d11cfd40c310619
5
5
  SHA512:
6
- metadata.gz: 89dde4df4e1e0560b05e73155cb22c508b299a7be4d43d6fea261f5fc26cd52ef62d13413f95638cb5832e259ff92aa5afead9ee48ec4d5a67bf815d2747b364
7
- data.tar.gz: 37d154d3cf14db3b63eb83c9110851ff50cddc335d326bbf3676b74afd07c6e38b3a3bb34729f26c25024167a8fa2b6c243aa284b4e9764ce4ce1c424054047b
6
+ metadata.gz: 4a6b899015103ceb4781ddffb7027e8f854dbc9a004bb8f4a5b28f1192e6bf53bedbd6d4a0dea501caa7afb047fbbf6b6c9e65462ddf24ba94e879d01c8e5e87
7
+ data.tar.gz: a87a0fe0a07591a0f39a244e7287e21999bea92e819382a2f6e3899af73a917d348f13917c1fd7918d53cc5047f768b40b459722aac1e3ad1e8bbc2a5ae04bb3
data/docs/CHANGELOG.md CHANGED
@@ -1,3 +1,32 @@
1
+ ## [0.11.2](https://github.com/klueless-io/k_director/compare/v0.11.1...v0.11.2) (2022-02-08)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add typed_dom to base_director ([22ee75d](https://github.com/klueless-io/k_director/commit/22ee75da20cd00fe1f48f7027775b59dcf1c17a5))
7
+ * move add, oadd, tadd, fadd from blueprint_director to base_director ([82f6aa0](https://github.com/klueless-io/k_director/commit/82f6aa02311ec04b9cb716846630274700deefb5))
8
+
9
+ ## [0.11.1](https://github.com/klueless-io/k_director/compare/v0.11.0...v0.11.1) (2022-02-07)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * move add, oadd, tadd, fadd from blueprint_director to base_director ([caab926](https://github.com/klueless-io/k_director/commit/caab92618406a072c3e326a3a640f7c6a4b71f03))
15
+
16
+ # [0.11.0](https://github.com/klueless-io/k_director/compare/v0.10.4...v0.11.0) (2022-02-07)
17
+
18
+
19
+ ### Features
20
+
21
+ * move github, blueprint and package_json fluent accessors onto BaseDirector ([88fa3fd](https://github.com/klueless-io/k_director/commit/88fa3fd0df530bef3731f0b4a62369d925df2fa5))
22
+
23
+ ## [0.10.4](https://github.com/klueless-io/k_director/compare/v0.10.3...v0.10.4) (2022-02-07)
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * add active option so that child directors can be suppressed or executed ([8a57617](https://github.com/klueless-io/k_director/commit/8a57617eea20dd9a020aec329bd994b3c444f087))
29
+
1
30
  ## [0.10.3](https://github.com/klueless-io/k_director/compare/v0.10.2...v0.10.3) (2022-02-06)
2
31
 
3
32
 
@@ -51,6 +51,10 @@ module KDirector
51
51
  builder.dom
52
52
  end
53
53
 
54
+ def typed_dom
55
+ builder.build
56
+ end
57
+
54
58
  # Used by child directors to inherit options from parent
55
59
  def inherited_opts(**opts)
56
60
  {
@@ -89,6 +93,37 @@ module KDirector
89
93
  @options.on_action
90
94
  end
91
95
 
96
+ # Add a single file into the code base
97
+ #
98
+ # This is a wrapper around add_file that will add the file to the codebase using template path rules
99
+ #
100
+ # @param [String] output_filename The output file name, this can be a relative path
101
+ # @param [Hash] **opts The options
102
+ # @option opts [String] :template_filename Template filename can be set or it will default to the same value as the output file name
103
+ # @option opts [String] :template_subfolder Template subfolder
104
+ def add(output_file, **opts)
105
+ template_file = opts[:template_file] || output_file
106
+ template_parts = [template_base_folder, opts[:template_subfolder], template_file].reject(&:blank?)
107
+ template_path = File.join(*template_parts)
108
+
109
+ # maybe template_file should be renamed to template_path in k_builder
110
+ opts[:template_file] = template_path
111
+
112
+ add_file(output_file, **opts)
113
+ end
114
+
115
+ def oadd(name, **opts)
116
+ add(name, **{ open: true }.merge(opts))
117
+ end
118
+
119
+ def tadd(name, **opts)
120
+ add(name, **{ open_template: true }.merge(opts))
121
+ end
122
+
123
+ def fadd(name, **opts)
124
+ add(name, **{ on_exist: :write }.merge(opts))
125
+ end
126
+
92
127
  # Add a file to target folder
93
128
  def add_file(file, **opts)
94
129
  opts = {
@@ -133,6 +168,29 @@ module KDirector
133
168
  k_builder.play_actions(builder.actions)
134
169
  end
135
170
 
171
+ # Common child directors
172
+
173
+ def github(**opts, &block)
174
+ github = KDirector::Dsls::Children::Github.new(self, **opts)
175
+ github.instance_eval(&block) if github.active? && block_given?
176
+
177
+ self
178
+ end
179
+
180
+ def package_json(**opts, &block)
181
+ package_json = KDirector::Dsls::Children::PackageJson.new(self, **opts)
182
+ package_json.instance_eval(&block) if package_json.active? && block_given?
183
+
184
+ self
185
+ end
186
+
187
+ def blueprint(**opts, &block)
188
+ blueprint = KDirector::Dsls::Children::Blueprint.new(self, **opts)
189
+ blueprint.instance_eval(&block) if blueprint.active? && block_given?
190
+
191
+ self
192
+ end
193
+
136
194
  def debug
137
195
  debug_options
138
196
  debug_dom
@@ -7,35 +7,6 @@ module KDirector
7
7
  #
8
8
  # A blueprint is a recipe that you can follow to build out assets on the target application
9
9
  class Blueprint < KDirector::Directors::ChildDirector
10
- # Add a single file into the code base
11
- #
12
- # @param [String] output_filename The output file name, this can be a relative path
13
- # @param [Hash] **opts The options
14
- # @option opts [String] :template_filename Template filename can be set or it will default to the same value as the output file name
15
- # @option opts [String] :template_subfolder Template subfolder
16
- def add(output_file, **opts)
17
- template_file = opts[:template_file] || output_file
18
- template_parts = [template_base_folder, opts[:template_subfolder], template_file].reject(&:blank?)
19
- template_path = File.join(*template_parts)
20
-
21
- # maybe template_file should be renamed to template_path in k_builder
22
- opts[:template_file] = template_path
23
-
24
- add_file(output_file, **opts)
25
- end
26
-
27
- def oadd(name, **opts)
28
- add(name, **{ open: true }.merge(opts))
29
- end
30
-
31
- def tadd(name, **opts)
32
- add(name, **{ open_template: true }.merge(opts))
33
- end
34
-
35
- def fadd(name, **opts)
36
- add(name, **{ on_exist: :write }.merge(opts))
37
- end
38
-
39
10
  # def template_content(template_file, **opts)
40
11
  # template_parts = [template_base_folder, opts[:template_subfolder], template_file].reject(&:blank?)
41
12
  # template_file = File.join(*template_parts)
@@ -8,27 +8,6 @@ module KDirector
8
8
  'nuxt3'
9
9
  end
10
10
 
11
- def github(**opts, &block)
12
- github = KDirector::Dsls::Children::Github.new(self, **opts)
13
- github.instance_eval(&block) if github.active? && block_given?
14
-
15
- self
16
- end
17
-
18
- def package_json(**opts, &block)
19
- package_json = KDirector::Dsls::Children::PackageJson.new(self, **opts)
20
- package_json.instance_eval(&block) if package_json.active? && block_given?
21
-
22
- self
23
- end
24
-
25
- def blueprint(**opts, &block)
26
- blueprint = KDirector::Dsls::Children::Blueprint.new(self, **opts)
27
- blueprint.instance_eval(&block) if blueprint.active? && block_given?
28
-
29
- self
30
- end
31
-
32
11
  # def app(**opts, &block)
33
12
  # app = Dsl::Nuxt3App.new(self, **opts)
34
13
  # app.instance_eval(&block)
@@ -8,26 +8,26 @@ module KDirector
8
8
  'ruby/gem'
9
9
  end
10
10
 
11
- def github(**opts, &block)
12
- github = KDirector::Dsls::Children::Github.new(self, **opts)
13
- github.instance_eval(&block) if block_given?
11
+ # def github(**opts, &block)
12
+ # github = KDirector::Dsls::Children::Github.new(self, **opts)
13
+ # github.instance_eval(&block) if github.active? && block_given?
14
14
 
15
- self
16
- end
15
+ # self
16
+ # end
17
17
 
18
- def package_json(**opts, &block)
19
- package_json = KDirector::Dsls::Children::PackageJson.new(self, **opts)
20
- package_json.instance_eval(&block) if block_given?
18
+ # def package_json(**opts, &block)
19
+ # package_json = KDirector::Dsls::Children::PackageJson.new(self, **opts)
20
+ # package_json.instance_eval(&block) if package_json.active? && block_given?
21
21
 
22
- self
23
- end
22
+ # self
23
+ # end
24
24
 
25
- def blueprint(**opts, &block)
26
- blueprint = KDirector::Dsls::Children::Blueprint.new(self, **opts)
27
- blueprint.instance_eval(&block) if block_given?
25
+ # def blueprint(**opts, &block)
26
+ # blueprint = KDirector::Dsls::Children::Blueprint.new(self, **opts)
27
+ # blueprint.instance_eval(&block) if blueprint.active? && block_given?
28
28
 
29
- self
30
- end
29
+ # self
30
+ # end
31
31
  end
32
32
  end
33
33
  end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KDirector
4
+ module Dsls
5
+ # BasicDsl is a DSL for generating basic projects.
6
+ class BasicDsl < KDirector::Directors::BaseDirector
7
+ def default_template_base_folder
8
+ 'basic'
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KDirector
4
- VERSION = '0.10.4'
4
+ VERSION = '0.11.3'
5
5
  end
data/lib/k_director.rb CHANGED
@@ -17,6 +17,7 @@ require_relative 'k_director/dsls/children/package_json_configuration'
17
17
  require_relative 'k_director/dsls/children/package_json'
18
18
  require_relative 'k_director/dsls/nuxt3_dsl'
19
19
  require_relative 'k_director/dsls/ruby_gem_dsl'
20
+ require_relative 'k_director/dsls/simple_dsl'
20
21
 
21
22
  module KDirector
22
23
  # raise KDirector::Error, 'Sample message'
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "k_director",
3
- "version": "0.10.4",
3
+ "version": "0.11.3",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "k_director",
9
- "version": "0.10.4",
9
+ "version": "0.11.3",
10
10
  "devDependencies": {
11
11
  "@klueless-js/semantic-release-rubygem": "github:klueless-js/semantic-release-rubygem",
12
12
  "@semantic-release/changelog": "^6.0.1",
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "k_director",
3
- "version": "0.10.4",
3
+ "version": "0.11.3",
4
4
  "description": "Command line and CI/CD tools for k_director",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: k_director
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.4
4
+ version: 0.11.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-07 00:00:00.000000000 Z
11
+ date: 2022-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: k_config
@@ -122,6 +122,7 @@ files:
122
122
  - lib/k_director/dsls/children/package_json_configuration.rb
123
123
  - lib/k_director/dsls/nuxt3_dsl.rb
124
124
  - lib/k_director/dsls/ruby_gem_dsl.rb
125
+ - lib/k_director/dsls/simple_dsl.rb
125
126
  - lib/k_director/version.rb
126
127
  - package-lock.json
127
128
  - package.json