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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 822cc3c17c118abe445b06166b676238c722060af7379ba7620ac7e38603810f
4
- data.tar.gz: 84923f26838b78d83c79c50d4703c6a19f6c49c1bc9048345332286813d2e178
3
+ metadata.gz: 1c8579754eee9ff09aacd11cd34ec2226db30119240a65c76828abef617afe8a
4
+ data.tar.gz: 16ae0929960bec81e1117dce6c8dee35331680706283f189dfb982dea66317b2
5
5
  SHA512:
6
- metadata.gz: 077a258b9306c9b53bf17ca7d2d969f18369c43ce39c01d29dc1db7befc3d5cbf9fa8d0a69946b9fe242cfe4bba6d1e3c5627329741ec91fe5408fe4191e4446
7
- data.tar.gz: c9265785646fe4bed96d999d21c75042be26e72f97cffaf2bade4427c084dd55e3453b2593dfcf2a0ce0c227b233b13f6937567729e03187216a3d1451ffae67
6
+ metadata.gz: 9511ab49084de3324e0a065a468c2940d6fc27e8dd1e7ef6a602a03a22db9ca9a79b0110903869a0acf3b591e0493ed329284f8bdc6b7e2d48116a06c6e239a3
7
+ data.tar.gz: 546f6339a8ac3c5fd6b7661bdbce6befe0a9efd98dd1d3d1fac821ec5b5ff22d5d3a4b7be84b1d8bbba60ce0ceda4599bc62fde01fab6275abf7113d54ce0d41
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- souls (0.15.5)
4
+ souls (0.15.9)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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 for Microservices on Multi Cloud Platform such as Google Cloud Platform, Amazon Web Services, and Alibaba Cloud. Auto deploy with scalable condition. You can focus on business logic. No more infra problems.
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 4 types of framework.
29
+ SOULs creates 5 types of framework.
27
30
 
28
- 1. Service - gRPC Serverless Scalable Service (Ruby)
29
- 2. API - GraphQL to call gRPC (Ruby)
30
- 3. Media Web Client - Media web client with SSG (TypeScript)
31
- 4. Admin Web Client - Admin Console and CMS (TypeScript)
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. Service
70
- 2. API
71
- 3. Media Web
72
- 4. Admin Web
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
- Version Check
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
- $ souls -v
86
+ # Install xcode
87
+ $ xcode-select --install
79
88
 
80
- Init Proto Files
89
+ # Install PostgreSQL (Mac env)
90
+ $ brew install postgresql
81
91
 
82
- $ souls p `service_name`
92
+ # Install redis
93
+ $ brew install redis
83
94
 
84
- Run Server
95
+ # Version Check
96
+ $ souls -v
85
97
 
86
- $ souls s
98
+ # Init SOULs App
99
+ $ souls new app_name
100
+ $ cd app_name
101
+ $ bundle
87
102
 
88
- Run Console
103
+ # Run Dev & Test DB
104
+ $ souls i run_psql
89
105
 
90
- $ souls c
106
+ # Create DB
107
+ $ souls db:create
91
108
 
92
- Run Infra Command
109
+ # Migrate DB
110
+ $ souls db:migrate
93
111
 
94
- $ souls i `method_name`
112
+ # Create Test DB
113
+ $ souls db:seed
95
114
 
96
- Deploy
115
+ # Development (localhost:3000/playground)
116
+ $ souls s
97
117
 
98
- $ souls i deploy
118
+ # Development with Worker (localhost:3000/playground; localhost:3000/sidekiq)
119
+ $ foreman start -f Procfile.dev
99
120
 
100
- ※Only Initial
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. 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: "
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 Souls.. \n") : raise(StandardError, "Choose Number 1..5")
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
- `foreman start -f Procfile.dev`
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"
@@ -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 ["Aleady Exist!"] if File.exist? file_path
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 ["Aleady Exist!"] if File.exist? file_path
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 ["Aleady Exist!"] if File.exist? file_path
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
- return ["Aleady Exist!"] if File.exist? "./spec/factories/#{class_name.singularize}"
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[:resovler].each { |line| puts line }
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
@@ -1,3 +1,3 @@
1
1
  module Souls
2
- VERSION = "0.15.6"
2
+ VERSION = "0.16.1"
3
3
  end
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.15.6
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI