k_director 0.10.0 → 0.10.1

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: 741cb887f450ab36a09fb0a8cbdfae5f3fbb0c61699c0f85b45489f70a370e8a
4
- data.tar.gz: 50bbfab6ae514ffdbcd779519d10a1235aa5df76932f5a0e7d5b67f3eb3b8f5e
3
+ metadata.gz: 431e5c6f071221fcdea319010b83bb17bba62187f835ae595a5453eaffd30956
4
+ data.tar.gz: ebcfe2cda7f2538f0511cd5e6df7bbf9d53bb29834b43286f34054d51521eecd
5
5
  SHA512:
6
- metadata.gz: 2fc8d306520190e022aec53d56750cdff63d70dd56b70041389aaac086d954ad11d370df325cedddaaba428063c61492b71681f36ac3049a05334702bc986bc5
7
- data.tar.gz: baad0f5b9986f35880cb86b1da28670c114b1c307bf04651979968f765f3eaabd7ed106ae848ddc4abec299ca7bbf9221c9ec1d36621dcdb7d2e38295be875d0
6
+ metadata.gz: 725a68f629da441807038726a8899bf19004c0dec43b7e41ac11fccb9124bd2bbcb3dd6babd10938287c9b00394aba3e7588af91cbf5be99f5d8523c29459381
7
+ data.tar.gz: aeca07e40f162c470767a7590865cf7cb41f48c5ffa605dc37cb1f71b538acff734963321b0bd9a7e05d03d716a476cd485baaff595070f5f72b718963384621
@@ -0,0 +1,5 @@
1
+ {
2
+ "cSpell.words": [
3
+ "postcss"
4
+ ]
5
+ }
data/docs/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # [0.10.0](https://github.com/klueless-io/k_director/compare/v0.9.0...v0.10.0) (2022-02-06)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * package_json set key converted to string and stripped ([784b33d](https://github.com/klueless-io/k_director/commit/784b33db2a045e8273e4e5a30747f0b05cc50cfd))
7
+
8
+
9
+ ### Features
10
+
11
+ * add package_json dsl support to nuxt3 and rubygem ([9b4650d](https://github.com/klueless-io/k_director/commit/9b4650d48deaeb158ef25300b12f9de5725bf2c0))
12
+ * add sort package json keys to package_json dsl ([90e2041](https://github.com/klueless-io/k_director/commit/90e2041759714faa1333c51226102e7ab8041a0a))
13
+
1
14
  # [0.9.0](https://github.com/klueless-io/k_director/compare/v0.8.1...v0.9.0) (2022-02-05)
2
15
 
3
16
 
@@ -99,7 +99,7 @@ module KDirector
99
99
  def load
100
100
  raise KDirector::Error, 'package.json does not exist' unless File.exist?(package_file)
101
101
 
102
- puts 'loading...'
102
+ # puts 'loading...'
103
103
 
104
104
  content = File.read(package_file)
105
105
  @package = JSON.parse(content)
@@ -109,7 +109,7 @@ module KDirector
109
109
 
110
110
  # Write the package.json file
111
111
  def write
112
- puts 'writing...'
112
+ # puts 'writing...'
113
113
 
114
114
  content = JSON.pretty_generate(@package)
115
115
 
@@ -120,22 +120,19 @@ module KDirector
120
120
 
121
121
  # Remove a script reference by key
122
122
  def remove_script(key)
123
- load
123
+ remove(key, group: 'scripts')
124
+ # load
124
125
 
125
- @package['scripts']&.delete(key)
126
+ # @package['scripts']&.delete(key)
126
127
 
127
- write
128
+ # write
128
129
 
129
130
  self
130
131
  end
131
132
 
132
133
  # Add a script with key and value (command line to run)
133
134
  def add_script(key, value)
134
- load
135
-
136
- @package['scripts'][key] = value
137
-
138
- write
135
+ set(key, value, group: 'scripts')
139
136
 
140
137
  self
141
138
  end
@@ -166,11 +163,37 @@ module KDirector
166
163
  # ----------------------------------------------------------------------
167
164
 
168
165
  # Set a property value in the package
169
- def set(key, value)
166
+ def set(key, value, group: nil)
167
+ load
168
+
169
+ key = key.to_s.strip
170
+
171
+ if group.nil?
172
+ @package[key] = value
173
+ else
174
+ group = group.to_s.strip
175
+ @package[group] = {} unless @package[group]
176
+ @package[group][key] = value
177
+ end
178
+
179
+ write
180
+
181
+ self
182
+ end
183
+
184
+ def remove(key, group: nil)
170
185
  load
171
186
 
172
187
  key = key.to_s.strip
173
- @package[key] = value
188
+
189
+ if group.nil?
190
+ @package.delete(key)
191
+ else
192
+ group = group.to_s.strip
193
+ @package[group]&.delete(key)
194
+ end
195
+
196
+ @package['scripts']&.delete(key)
174
197
 
175
198
  write
176
199
 
@@ -37,11 +37,34 @@ module KDirector
37
37
 
38
38
  # Setup the default package groups
39
39
  def set_default_package_groups
40
- set_package_group('webpack' , 'Webpack V5' , %w[webpack webpack-cli webpack-dev-server])
41
- set_package_group('swc' , 'SWC Transpiler' , %w[@swc/cli @swc/core swc-loader])
42
- set_package_group('babel' , 'Babel Transpiler' , %w[@babel/core @babel/cli @babel/preset-env babel-loader])
43
- set_package_group('typescript' , 'Typescript' , %w[typescript ts-loader])
44
- set_package_group('semantic-release', 'Semantic Release' , %w[semantic-release github:klueless-js/semantic-release-rubygem @semantic-release/changelog @semantic-release/git])
40
+ set_package_group('webpack' , 'Webpack V5' , %w[webpack webpack-cli webpack-dev-server])
41
+ set_package_group('swc' , 'SWC Transpiler' , %w[@swc/cli @swc/core swc-loader])
42
+ set_package_group('babel' , 'Babel Transpiler' , %w[@babel/core @babel/cli @babel/preset-env babel-loader])
43
+ set_package_group('typescript' , 'Typescript' , %w[typescript ts-loader])
44
+ set_package_group('semver-ruby' , 'Semantic Release for Ruby' , %w[semantic-release github:klueless-js/semantic-release-rubygem @semantic-release/changelog @semantic-release/git])
45
+
46
+ set_package_group('semver-nuxt' , 'Semantic Release for Nuxt' , %w[
47
+ semantic-release
48
+ @semantic-release/changelog
49
+ @semantic-release/git
50
+ ])
51
+
52
+ set_package_group('tailwind-nuxt' , 'TailwindCSS for Nuxt' , %w[
53
+ tailwindcss@latest
54
+ postcss@latest
55
+ autoprefixer@latest
56
+ ])
57
+
58
+ # this does not work yet
59
+ set_package_group('storybook-nuxt' , 'Storybook for (Vite/Nuxt)' , %w[
60
+ @storybook/vue3@6.4.18
61
+ @storybook/addon-docs@6.4.18
62
+ @storybook/addon-essentials@6.4.18
63
+ @storybook/addon-postcss@2.0.0
64
+ @storybook/addon-storysource@6.4.18
65
+ storybook-builder-vite
66
+ ])
67
+ # @storybook/addon-docs
45
68
  end
46
69
 
47
70
  def debug
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KDirector
4
- VERSION = '0.10.0'
4
+ VERSION = '0.10.1'
5
5
  end
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "k_director",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "k_director",
9
- "version": "0.10.0",
9
+ "version": "0.10.1",
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.0",
3
+ "version": "0.10.1",
4
4
  "description": "Command line and CI/CD tools for k_director",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: k_director
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys
@@ -100,6 +100,7 @@ files:
100
100
  - ".releaserc.json"
101
101
  - ".rspec"
102
102
  - ".rubocop.yml"
103
+ - ".vscode/settings.json"
103
104
  - Gemfile
104
105
  - Guardfile
105
106
  - README.md