souls 0.15.6 → 0.16.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/Gemfile.lock +1 -1
- data/README.md +68 -26
- data/exe/souls +5 -3
- data/lib/souls/generate.rb +5 -4
- data/lib/souls/init.rb +16 -2
- data/lib/souls/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c8579754eee9ff09aacd11cd34ec2226db30119240a65c76828abef617afe8a
|
4
|
+
data.tar.gz: 16ae0929960bec81e1117dce6c8dee35331680706283f189dfb982dea66317b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9511ab49084de3324e0a065a468c2940d6fc27e8dd1e7ef6a602a03a22db9ca9a79b0110903869a0acf3b591e0493ed329284f8bdc6b7e2d48116a06c6e239a3
|
7
|
+
data.tar.gz: 546f6339a8ac3c5fd6b7661bdbce6befe0a9efd98dd1d3d1fac821ec5b5ff22d5d3a4b7be84b1d8bbba60ce0ceda4599bc62fde01fab6275abf7113d54ce0d41
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -21,14 +21,18 @@
|
|
21
21
|
|
22
22
|
Welcome to SOULs Framework!
|
23
23
|
|
24
|
-
SOULS is a Web Application Framework
|
24
|
+
SOULS is a Web Application Framework based on GraphQL Relay ( Ruby )
|
25
|
+
This is Cloud Based APP Framework. Easy Deployment.
|
26
|
+
Microservices on Multi Cloud Platform such as Google Cloud Platform, Amazon Web Services, and Alibaba Cloud. Auto deploy with scalable condition.
|
27
|
+
You can focus on business logic. No more infra problems.
|
25
28
|
|
26
|
-
SOULs creates
|
29
|
+
SOULs creates 5 types of framework.
|
27
30
|
|
28
|
-
1.
|
29
|
-
2. API - GraphQL to call gRPC (Ruby)
|
30
|
-
3.
|
31
|
-
4.
|
31
|
+
1. API - GraphQL (Ruby) - Simple API
|
32
|
+
2. API - GraphQL to call gRPC (Ruby) - for heavy task processes
|
33
|
+
3. Service - gRPC Serverless Scalable Service (Ruby)
|
34
|
+
4. Media Web Client - Media web client with SSG (TypeScript)
|
35
|
+
5. Admin Web Client - Admin Console and CMS (TypeScript)
|
32
36
|
|
33
37
|
## Dependency
|
34
38
|
|
@@ -66,42 +70,80 @@ And Create Your APP
|
|
66
70
|
|
67
71
|
### Choose SOULs Type:
|
68
72
|
|
69
|
-
1.
|
70
|
-
2. API
|
71
|
-
3.
|
72
|
-
4.
|
73
|
+
1. API
|
74
|
+
2. API - gRPC
|
75
|
+
3. Service
|
76
|
+
4. Media Web
|
77
|
+
5. Admin Web
|
73
78
|
|
74
|
-
## Usage
|
79
|
+
## Usage - 1. GraphQL API
|
75
80
|
|
76
|
-
|
81
|
+
```bash
|
82
|
+
# Ruby version (using rbenv)
|
83
|
+
$ ruby -v
|
84
|
+
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
|
77
85
|
|
78
|
-
|
86
|
+
# Install xcode
|
87
|
+
$ xcode-select --install
|
79
88
|
|
80
|
-
|
89
|
+
# Install PostgreSQL (Mac env)
|
90
|
+
$ brew install postgresql
|
81
91
|
|
82
|
-
|
92
|
+
# Install redis
|
93
|
+
$ brew install redis
|
83
94
|
|
84
|
-
|
95
|
+
# Version Check
|
96
|
+
$ souls -v
|
85
97
|
|
86
|
-
|
98
|
+
# Init SOULs App
|
99
|
+
$ souls new app_name
|
100
|
+
$ cd app_name
|
101
|
+
$ bundle
|
87
102
|
|
88
|
-
Run
|
103
|
+
# Run Dev & Test DB
|
104
|
+
$ souls i run_psql
|
89
105
|
|
90
|
-
|
106
|
+
# Create DB
|
107
|
+
$ souls db:create
|
91
108
|
|
92
|
-
|
109
|
+
# Migrate DB
|
110
|
+
$ souls db:migrate
|
93
111
|
|
94
|
-
|
112
|
+
# Create Test DB
|
113
|
+
$ souls db:seed
|
95
114
|
|
96
|
-
|
115
|
+
# Development (localhost:3000/playground)
|
116
|
+
$ souls s
|
97
117
|
|
98
|
-
|
118
|
+
# Development with Worker (localhost:3000/playground; localhost:3000/sidekiq)
|
119
|
+
$ foreman start -f Procfile.dev
|
99
120
|
|
100
|
-
|
121
|
+
# Test
|
122
|
+
$ bundle exec rspec
|
123
|
+
|
124
|
+
# Deploy (Edit: ./cloudbuild.yml)
|
125
|
+
$ souls deploy
|
126
|
+
|
127
|
+
# Run Infra Command
|
128
|
+
$ souls i `method_name`
|
129
|
+
```
|
130
|
+
|
131
|
+
## SOULs Scaffold
|
132
|
+
SOULs Scaffold creates CRUD API from `./db/schema.rb`
|
133
|
+
|
134
|
+
```bash
|
135
|
+
# Create migration file
|
136
|
+
$ souls g migration user
|
137
|
+
|
138
|
+
# Edit migration file
|
139
|
+
# Migrate DB
|
140
|
+
$ souls db:migrate
|
141
|
+
|
142
|
+
# SOULs Scaffold
|
143
|
+
$ souls g migrate user
|
144
|
+
```
|
101
145
|
|
102
|
-
Update
|
103
146
|
|
104
|
-
$ souls i update
|
105
147
|
|
106
148
|
## Development
|
107
149
|
|
data/exe/souls
CHANGED
@@ -13,9 +13,9 @@ begin
|
|
13
13
|
puts "you need to specify your app name \n `souls new app_name`"
|
14
14
|
exit
|
15
15
|
end
|
16
|
-
puts "Which framework: \n 1.
|
16
|
+
puts "Which framework: \n 1. SOULs GraphQL API \n 2. SOULs GraphQL API gRPC compatible \n 3. SOULs gRPC Service \n 4. SOULs Media Web \n 5. SOULs Admin Web \n Enter Number: "
|
17
17
|
strain = STDIN.gets.chomp.to_i
|
18
|
-
(1..5).include?(strain) ? puts("Generating
|
18
|
+
(1..5).include?(strain) ? puts("Generating SOULs.. \n") : raise(StandardError, "Choose Number 1..5")
|
19
19
|
Souls::Init.create_souls strain: strain, app_name: ARGV[1]
|
20
20
|
when "s", "server"
|
21
21
|
strain = Souls.configuration.strain
|
@@ -25,7 +25,7 @@ begin
|
|
25
25
|
when "service"
|
26
26
|
system "bundle exec rake run_server"
|
27
27
|
else
|
28
|
-
`
|
28
|
+
`bundle exec puma -p 3000 -e development`
|
29
29
|
end
|
30
30
|
when "c", "console"
|
31
31
|
strain = Souls.configuration.strain
|
@@ -86,6 +86,8 @@ begin
|
|
86
86
|
STDOUT.write `rake db:create && rake db:create RACK_ENV=test`
|
87
87
|
when "db:migrate"
|
88
88
|
STDOUT.write `rake db:migrate && rake db:migrate RACK_ENV=test`
|
89
|
+
when "db:seed"
|
90
|
+
STDOUT.write `rake db:seed`
|
89
91
|
when "db:migrate:reset"
|
90
92
|
STDOUT.write `rake db:migrate:reset && rake db:migrate:reset RACK_ENV=test`
|
91
93
|
when "t", "test"
|
data/lib/souls/generate.rb
CHANGED
@@ -18,7 +18,7 @@ module Souls
|
|
18
18
|
def resolver class_name: "souls"
|
19
19
|
FileUtils.mkdir_p "./app/graphql/resolvers" unless Dir.exist? "./app/graphql/resolvers"
|
20
20
|
file_path = "./app/graphql/resolvers/#{class_name.singularize}_search.rb"
|
21
|
-
return ["
|
21
|
+
return ["Resolver already exist! #{file_path}"] if File.exist? file_path
|
22
22
|
File.open(file_path, "w") do |f|
|
23
23
|
f.write <<~EOS
|
24
24
|
module Resolvers
|
@@ -80,7 +80,7 @@ module Souls
|
|
80
80
|
|
81
81
|
def job class_name: "send_mail"
|
82
82
|
file_path = "./app/jobs/#{class_name.singularize}_job.rb"
|
83
|
-
return ["
|
83
|
+
return ["Job already exist! #{file_path}"] if File.exist? file_path
|
84
84
|
File.open(file_path, "w") do |f|
|
85
85
|
f.write <<~EOS
|
86
86
|
class #{class_name.camelize}
|
@@ -99,6 +99,7 @@ module Souls
|
|
99
99
|
|
100
100
|
def rspec_resolver_head class_name: "souls"
|
101
101
|
file_path = "./spec/resolvers/#{class_name.singularize}_search_spec.rb"
|
102
|
+
puts file_path
|
102
103
|
File.open(file_path, "w") do |f|
|
103
104
|
f.write <<~EOS
|
104
105
|
RSpec.describe \"#{class_name.camelize}Search Resolver テスト\" do
|
@@ -134,7 +135,7 @@ module Souls
|
|
134
135
|
EOS
|
135
136
|
else
|
136
137
|
new_line.write <<-EOS
|
137
|
-
let(:#{class_name}) { FactoryBot.create(:#{class_name}, #{@relation_params.join(", ")}) }
|
138
|
+
let!(:#{class_name}) { FactoryBot.create(:#{class_name}, #{@relation_params.join(", ")}) }
|
138
139
|
|
139
140
|
let(:query) do
|
140
141
|
%(query {
|
@@ -273,7 +274,7 @@ end
|
|
273
274
|
def rspec_resolver class_name: "souls"
|
274
275
|
singularized_class_name = class_name.singularize
|
275
276
|
file_path = "#{Dir.pwd}/spec/resolvers/#{singularized_class_name}_search_spec.rb"
|
276
|
-
return ["
|
277
|
+
return ["Resolver already exist! #{file_path}"] if File.exist? file_path
|
277
278
|
rspec_resolver_head class_name: singularized_class_name
|
278
279
|
rspec_resolver_after_head class_name: singularized_class_name
|
279
280
|
rspec_resolver_params class_name: singularized_class_name
|
data/lib/souls/init.rb
CHANGED
@@ -724,7 +724,8 @@ module Souls
|
|
724
724
|
end
|
725
725
|
|
726
726
|
def rspec_factory class_name: "souls"
|
727
|
-
|
727
|
+
file_path = "./spec/factories/#{class_name.pluralize}.rb"
|
728
|
+
return ["Factory aleady exist! #{file_path}"] if File.exist? file_path
|
728
729
|
singularized_class_name = class_name.singularize
|
729
730
|
rspec_factory_head class_name: singularized_class_name
|
730
731
|
rspec_factory_params class_name: singularized_class_name
|
@@ -1218,6 +1219,9 @@ module Souls
|
|
1218
1219
|
" field :update_#{singularized_class_name}, mutation: Mutations::#{singularized_class_name.camelize}::Update#{singularized_class_name.camelize}",
|
1219
1220
|
" field :delete_#{singularized_class_name}, mutation: Mutations::#{singularized_class_name.camelize}::Delete#{singularized_class_name.camelize}",
|
1220
1221
|
" field :destroy_delete_#{singularized_class_name}, mutation: Mutations::#{singularized_class_name.camelize}::DestroyDelete#{singularized_class_name.camelize}"
|
1222
|
+
],
|
1223
|
+
add_resolver: [
|
1224
|
+
" field :#{singularized_class_name}_search, resolver: Resolvers::#{singularized_class_name.camelize}Search"
|
1221
1225
|
]
|
1222
1226
|
]
|
1223
1227
|
end
|
@@ -1247,6 +1251,10 @@ module Souls
|
|
1247
1251
|
result[0][:add_query_type].each do |path|
|
1248
1252
|
puts path
|
1249
1253
|
end
|
1254
|
+
puts "\n ## Resolvers\n\n"
|
1255
|
+
result[0][:add_resolver].each do |path|
|
1256
|
+
puts path
|
1257
|
+
end
|
1250
1258
|
puts "\n ## Connection Type\n\n"
|
1251
1259
|
puts " def #{class_name.pluralize}"
|
1252
1260
|
puts " #{class_name.singularize.camelize}.all.order(id: :desc)"
|
@@ -1282,7 +1290,7 @@ module Souls
|
|
1282
1290
|
puts "\n============== Resolver =======================\n\n"
|
1283
1291
|
paths.each do |class_name|
|
1284
1292
|
class_name.each do |path|
|
1285
|
-
path[:
|
1293
|
+
path[:resolver].each { |line| puts line }
|
1286
1294
|
end
|
1287
1295
|
end
|
1288
1296
|
puts "\n============== NodeType =======================\n\n"
|
@@ -1345,6 +1353,12 @@ module Souls
|
|
1345
1353
|
path[:add_query_type].each { |line| puts line }
|
1346
1354
|
end
|
1347
1355
|
end
|
1356
|
+
puts "\n ## Resolvers\n\n"
|
1357
|
+
paths.each do |class_name|
|
1358
|
+
class_name.each do |path|
|
1359
|
+
path[:add_resolver].each { |line| puts line }
|
1360
|
+
end
|
1361
|
+
end
|
1348
1362
|
puts "\n ## Connection Type\n\n"
|
1349
1363
|
get_tables.each do |class_name|
|
1350
1364
|
puts " def #{class_name.pluralize}"
|
data/lib/souls/version.rb
CHANGED