souls 0.54.4 → 0.55.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/exe/souls +0 -1
- data/lib/souls/api/generate/connection_rbs.rb +22 -0
- data/lib/souls/api/generate/manager.rb +1 -1
- data/lib/souls/api/generate/mutation.rb +10 -10
- data/lib/souls/api/generate/query.rb +3 -3
- data/lib/souls/api/index.rb +3 -2
- data/lib/souls/cli/create/index.rb +42 -2
- data/lib/souls/cli/gcloud/index.rb +1 -0
- data/lib/souls/cli/init/index.rb +20 -2
- data/lib/souls/cli.rb +13 -1
- data/lib/souls/version.rb +1 -1
- data/lib/souls/versions/.souls_api_version +1 -1
- data/lib/souls/versions/.souls_worker_version +1 -1
- data/lib/souls/worker/index.rb +3 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73360700bdc37dfbecd749b27fc7130b74ab5e6b09964de3ef3a69b871ca3757
|
4
|
+
data.tar.gz: 7f541d2b5b3f2585e400870d8f10d9668c690823f06febfc82ecf993cf1b8e94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3fb45003722268317046bf1d2888f92f402e27a9320d61ec0466131f281364ce4ffc6408b17b9abffc1d1fb46e923193dfd6f3753137e8b30bb51dea632e809
|
7
|
+
data.tar.gz: 2dbe0bb5b0be9f0430f932d3b83b9cc8708c12bdcfed6d31095c88afa67f18f9f1c0bcfb4c812056f5182de6dbad3546dc48e456f3e7ce52818a080137d5581b
|
data/exe/souls
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
module Souls
|
2
|
+
class Generate < Thor
|
3
|
+
desc "connection [CLASS_NAME]", "Generate GraphQL Connection from schema.rb"
|
4
|
+
def connection(class_name)
|
5
|
+
file_dir = "./app/graphql/types/connections/"
|
6
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
7
|
+
singularized_class_name = class_name.underscore.singularize
|
8
|
+
file_path = "./app/graphql/types/connections/#{singularized_class_name}_connection.rb"
|
9
|
+
File.open(file_path, "w") do |f|
|
10
|
+
f.write(<<~TEXT)
|
11
|
+
class Types::#{singularized_class_name.camelize}Connection < Types::BaseConnection
|
12
|
+
edge_type(Types::#{singularized_class_name.camelize}Edge)
|
13
|
+
end
|
14
|
+
TEXT
|
15
|
+
end
|
16
|
+
puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
|
17
|
+
file_path
|
18
|
+
rescue Thor::Error => e
|
19
|
+
raise(Thor::Error, e)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -55,13 +55,13 @@ module Souls
|
|
55
55
|
if @user_exist
|
56
56
|
new_line.write(<<-TEXT)
|
57
57
|
|
58
|
-
def resolve
|
58
|
+
def resolve args
|
59
59
|
args[:user_id] = context[:user].id
|
60
60
|
TEXT
|
61
61
|
else
|
62
62
|
new_line.write(<<-TEXT)
|
63
63
|
|
64
|
-
def resolve
|
64
|
+
def resolve args
|
65
65
|
TEXT
|
66
66
|
end
|
67
67
|
break
|
@@ -109,7 +109,7 @@ module Souls
|
|
109
109
|
|
110
110
|
{ #{class_name}_edge: { node: data } }
|
111
111
|
rescue StandardError => error
|
112
|
-
GraphQL::ExecutionError.new
|
112
|
+
GraphQL::ExecutionError.new(error.message)
|
113
113
|
end
|
114
114
|
end
|
115
115
|
end
|
@@ -149,14 +149,14 @@ module Souls
|
|
149
149
|
if @user_exist
|
150
150
|
new_line.write(<<-TEXT)
|
151
151
|
|
152
|
-
def resolve
|
152
|
+
def resolve args
|
153
153
|
args[:user_id] = context[:user].id
|
154
154
|
_, args[:id] = SoulsApiSchema.from_global_id(args[:id])
|
155
155
|
TEXT
|
156
156
|
else
|
157
157
|
new_line.write(<<-TEXT)
|
158
158
|
|
159
|
-
def resolve
|
159
|
+
def resolve args
|
160
160
|
_, args[:id] = SoulsApiSchema.from_global_id(args[:id])
|
161
161
|
TEXT
|
162
162
|
end
|
@@ -204,7 +204,7 @@ module Souls
|
|
204
204
|
#{class_name}.update args
|
205
205
|
{ #{class_name}_edge: { node: ::#{class_name.camelize}.find(args[:id]) } }
|
206
206
|
rescue StandardError => error
|
207
|
-
GraphQL::ExecutionError.new
|
207
|
+
GraphQL::ExecutionError.new(error.message)
|
208
208
|
end
|
209
209
|
end
|
210
210
|
end
|
@@ -237,13 +237,13 @@ module Souls
|
|
237
237
|
field :#{class_name}, Types::#{class_name.camelize}Type, null: false
|
238
238
|
argument :id, String, required: true
|
239
239
|
|
240
|
-
def resolve
|
240
|
+
def resolve args
|
241
241
|
_, data_id = SoulsApiSchema.from_global_id args[:id]
|
242
242
|
#{class_name} = ::#{class_name.camelize}.find data_id
|
243
243
|
#{class_name}.update(is_deleted: true)
|
244
244
|
{ #{class_name}: ::#{class_name.camelize}.find(data_id) }
|
245
245
|
rescue StandardError => error
|
246
|
-
GraphQL::ExecutionError.new
|
246
|
+
GraphQL::ExecutionError.new(error.message)
|
247
247
|
end
|
248
248
|
end
|
249
249
|
end
|
@@ -266,13 +266,13 @@ module Souls
|
|
266
266
|
field :#{class_name}, Types::#{class_name.camelize}Type, null: false
|
267
267
|
argument :id, String, required: true
|
268
268
|
|
269
|
-
def resolve
|
269
|
+
def resolve args
|
270
270
|
_, data_id = SoulsApiSchema.from_global_id args[:id]
|
271
271
|
#{class_name} = ::#{class_name.camelize}.find data_id
|
272
272
|
#{class_name}.destroy
|
273
273
|
{ #{class_name}: #{class_name} }
|
274
274
|
rescue StandardError => error
|
275
|
-
GraphQL::ExecutionError.new
|
275
|
+
GraphQL::ExecutionError.new(error.message)
|
276
276
|
end
|
277
277
|
end
|
278
278
|
end
|
@@ -26,7 +26,7 @@ module Souls
|
|
26
26
|
def resolve
|
27
27
|
::#{class_name.camelize}.all
|
28
28
|
rescue StandardError => error
|
29
|
-
GraphQL::ExecutionError.new
|
29
|
+
GraphQL::ExecutionError.new(error.message)
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -49,11 +49,11 @@ module Souls
|
|
49
49
|
type Types::#{class_name.camelize}Type, null: false
|
50
50
|
argument :id, String, required: true
|
51
51
|
|
52
|
-
def resolve
|
52
|
+
def resolve args
|
53
53
|
_, data_id = SoulsApiSchema.from_global_id args[:id]
|
54
54
|
::#{class_name.camelize}.find(data_id)
|
55
55
|
rescue StandardError => error
|
56
|
-
GraphQL::ExecutionError.new
|
56
|
+
GraphQL::ExecutionError.new(error.message)
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|
data/lib/souls/api/index.rb
CHANGED
@@ -9,10 +9,12 @@ module Souls
|
|
9
9
|
raise(StandardError, "Same Worker Already Exist!") if Dir.exist?(file_dir)
|
10
10
|
|
11
11
|
workers = Souls.configuration.workers
|
12
|
+
app = Souls.configuration.app
|
12
13
|
port = 3000 + workers.size
|
14
|
+
souls_worker_name = "souls-#{app}-#{options[:name]}"
|
13
15
|
download_worker(worker_name: options[:name])
|
14
|
-
souls_conf_update(worker_name:
|
15
|
-
souls_conf_update(worker_name:
|
16
|
+
souls_conf_update(worker_name: souls_worker_name)
|
17
|
+
souls_conf_update(worker_name: souls_worker_name, strain: "api")
|
16
18
|
workflow(worker_name: options[:name])
|
17
19
|
procfile(worker_name: options[:name], port: port)
|
18
20
|
mother_procfile(worker_name: options[:name])
|
@@ -220,5 +222,43 @@ end
|
|
220
222
|
system("cp ./apps/api/config/database.yml ./apps/#{worker_name}/config/")
|
221
223
|
FileUtils.rm(file_name)
|
222
224
|
end
|
225
|
+
|
226
|
+
def souls_worker_credit(worker_name: "mailer")
|
227
|
+
line = Paint["====================================", :yellow]
|
228
|
+
puts("\n")
|
229
|
+
puts(line)
|
230
|
+
txt2 = <<~TEXT
|
231
|
+
_____ ____ __ ____#{' '}
|
232
|
+
/ ___// __ \\/ / / / / %{red1}
|
233
|
+
\\__ \\/ / / / / / / / %{red2}
|
234
|
+
___/ / /_/ / /_/ / /___%{red3}#{' '}
|
235
|
+
/____/\\____/\\____/_____%{red4}#{' '}
|
236
|
+
TEXT
|
237
|
+
red1 = ["_____", :red]
|
238
|
+
red2 = ["/ ___/", :red]
|
239
|
+
red3 = ["(__ )", :red]
|
240
|
+
red4 = ["/____/", :red]
|
241
|
+
ms = Paint % [txt2, :cyan, { red1: red1, red2: red2, red3: red3, red4: red4 }]
|
242
|
+
puts(ms)
|
243
|
+
puts(line)
|
244
|
+
welcome = Paint["SOULs Worker is Ready!", :white]
|
245
|
+
puts(welcome)
|
246
|
+
souls_ver = Paint["SOULs Version: #{Souls::VERSION}", :white]
|
247
|
+
puts(souls_ver)
|
248
|
+
puts(line)
|
249
|
+
endroll = <<~TEXT
|
250
|
+
Easy to Run
|
251
|
+
$ cd apps/#{worker_name}
|
252
|
+
$ bundle
|
253
|
+
$ souls sync model
|
254
|
+
$ souls s
|
255
|
+
Go To : http://localhost:3000
|
256
|
+
|
257
|
+
Doc: https://souls.elsoul.nl
|
258
|
+
TEXT
|
259
|
+
cd = Paint[endroll, :white]
|
260
|
+
puts(cd)
|
261
|
+
puts(line)
|
262
|
+
end
|
223
263
|
end
|
224
264
|
end
|
data/lib/souls/cli/init/index.rb
CHANGED
@@ -16,6 +16,16 @@ module Souls
|
|
16
16
|
souls_api_credit(app_name: app_name, service_name: service_name)
|
17
17
|
end
|
18
18
|
|
19
|
+
desc "init", "Run git submodule add RBS collection"
|
20
|
+
def add_submodule
|
21
|
+
system("git submodule add https://github.com/ruby/gem_rbs_collection.git vendor/rbs/gem_rbs_collection")
|
22
|
+
end
|
23
|
+
|
24
|
+
desc "update_submodule", "Run git submodule update --init RBS collection"
|
25
|
+
def update_submodule
|
26
|
+
system("git submodule update --init https://github.com/ruby/gem_rbs_collection.git vendor/rbs/gem_rbs_collection")
|
27
|
+
end
|
28
|
+
|
19
29
|
private
|
20
30
|
|
21
31
|
def get_version(repository_name: "souls_api")
|
@@ -74,7 +84,7 @@ module Souls
|
|
74
84
|
|
75
85
|
def download_github_actions(app_name: "souls-app")
|
76
86
|
file_name = "github.tgz"
|
77
|
-
url = "https://storage.googleapis.com/souls-bucket/github_actions/github.tgz"
|
87
|
+
url = "https://storage.googleapis.com/souls-bucket/boilerplates/github_actions/github.tgz"
|
78
88
|
system("curl -OL #{url}")
|
79
89
|
FileUtils.mkdir_p("#{app_name}/github")
|
80
90
|
system("tar -zxvf ./#{file_name} -C #{app_name}/")
|
@@ -110,11 +120,19 @@ module Souls
|
|
110
120
|
system("curl -OL #{url}")
|
111
121
|
system("mkdir -p #{app_name}/apps/#{service_name}")
|
112
122
|
system("tar -zxvf ./#{file_name} -C #{app_name}/apps/")
|
123
|
+
FileUtils.rm(file_name)
|
124
|
+
|
125
|
+
sig_name = "sig.tgz"
|
126
|
+
url = "https://storage.googleapis.com/souls-bucket/boilerplates/sig/#{sig_name}"
|
127
|
+
system("curl -OL #{url}")
|
128
|
+
system("tar -zxvf ./#{sig_name} -C #{app_name}")
|
129
|
+
|
113
130
|
system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/.rubocop.yml")
|
114
131
|
system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/Gemfile")
|
115
132
|
system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/Procfile.dev")
|
116
133
|
system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/Procfile")
|
117
|
-
|
134
|
+
system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/Steepfile")
|
135
|
+
FileUtils.rm(sig_name)
|
118
136
|
end
|
119
137
|
|
120
138
|
def souls_api_credit(app_name: "souls", service_name: "api")
|
data/lib/souls/cli.rb
CHANGED
@@ -44,12 +44,24 @@ module Souls
|
|
44
44
|
puts(Souls::VERSION)
|
45
45
|
end
|
46
46
|
|
47
|
-
desc "test", "Run Rspec & Rubocop"
|
47
|
+
desc "test", "Run (Rspec & steep check & Rubocop)"
|
48
48
|
def test
|
49
49
|
system("rubocop -A")
|
50
|
+
system("steep check")
|
50
51
|
system("bundle exec rspec")
|
51
52
|
end
|
52
53
|
|
54
|
+
desc "test_all", "Run Rspec & Rubocop"
|
55
|
+
def test_all
|
56
|
+
system("rubocop -A")
|
57
|
+
system("bundle exec rspec")
|
58
|
+
end
|
59
|
+
|
60
|
+
desc "check", "Run steep check"
|
61
|
+
def check
|
62
|
+
system("steep check")
|
63
|
+
end
|
64
|
+
|
53
65
|
def self.exit_on_failure?
|
54
66
|
false
|
55
67
|
end
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.34.1
|
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.34.1
|
data/lib/souls/worker/index.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: souls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.55.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- POPPIN-FUMI
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-09-
|
13
|
+
date: 2021-09-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -129,6 +129,7 @@ files:
|
|
129
129
|
- lib/souls.rb
|
130
130
|
- lib/souls/api/generate/application.rb
|
131
131
|
- lib/souls/api/generate/connection.rb
|
132
|
+
- lib/souls/api/generate/connection_rbs.rb
|
132
133
|
- lib/souls/api/generate/edge.rb
|
133
134
|
- lib/souls/api/generate/index.rb
|
134
135
|
- lib/souls/api/generate/manager.rb
|