souls 0.15.8 → 0.16.3

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: 438b9ee41acbb2e5830f28093be1d7a92bb6afcf3714cbfe23bf400e124ce396
4
- data.tar.gz: fc449a96bd06555a98588c3e7bb0c20c7fc345d0f1e52df6851328dd56125c2a
3
+ metadata.gz: 95c7d5667fa4486a23b0feb0cd5f394baaf90940b9926afde3ac6f28aecff6d9
4
+ data.tar.gz: cc1486ff2c54dc5050e1f190fa0dd7ddac28db4f3c1e849013aee46d6a8ee686
5
5
  SHA512:
6
- metadata.gz: b35950640af120716478c6b558e12f4c635161a25642bee2956a97616168c69837320b1d3d0dd59b9421b3238aa8f8e6fdd2cfd63a4d2befa98eb1900aea5b96
7
- data.tar.gz: ca59f3e1c0bc92a76c6448b9f411f5e160eafa3bec9e210e50a8ce7db489dc541af4cd95e67cadbc4214010a9bffe7f0c50dbcf7040ab5d91f524a1ef1c0b37b
6
+ metadata.gz: 9cb1991fa03238cc123023aed9e147b97f978138cb1f3bd0560fa652dabe4af39379e22f38fea51d5de17817eadb5e050309fec5c4d5acbd14801a828ed981bc
7
+ data.tar.gz: 70284bcb318f210b8b1010d03c70c65e13b966dd25b0801e531a68e4f18674b37eb41bb9ff9f9e2e83f09be76f72fb578c41da790d0c3ee9284225571c53e16b
data/.irbrc CHANGED
@@ -0,0 +1 @@
1
+ require "./lib/souls"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- souls (0.15.7)
4
+ souls (0.16.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -19,13 +19,13 @@ GEM
19
19
  concurrent-ruby (1.1.8)
20
20
  diff-lcs (1.4.4)
21
21
  ffi (1.14.2)
22
- i18n (1.8.8)
22
+ i18n (1.8.9)
23
23
  concurrent-ruby (~> 1.0)
24
24
  language_server-protocol (3.15.0.1)
25
25
  listen (3.4.1)
26
26
  rb-fsevent (~> 0.10, >= 0.10.3)
27
27
  rb-inotify (~> 0.9, >= 0.9.10)
28
- minitest (5.14.3)
28
+ minitest (5.14.4)
29
29
  parallel (1.20.1)
30
30
  parser (2.7.2.0)
31
31
  ast (~> 2.4.1)
@@ -34,8 +34,8 @@ GEM
34
34
  rb-fsevent (0.10.4)
35
35
  rb-inotify (0.10.1)
36
36
  ffi (~> 1.0)
37
- rbs (1.0.4)
38
- regexp_parser (2.0.3)
37
+ rbs (1.0.6)
38
+ regexp_parser (2.1.1)
39
39
  rexml (3.2.4)
40
40
  rspec (3.1.0)
41
41
  rspec-core (~> 3.1.0)
@@ -76,7 +76,7 @@ GEM
76
76
  zeitwerk (2.4.2)
77
77
 
78
78
  PLATFORMS
79
- ruby
79
+ x86_64-darwin-20
80
80
 
81
81
  DEPENDENCIES
82
82
  activesupport (= 6.1.0)
@@ -87,4 +87,4 @@ DEPENDENCIES
87
87
  steep (= 0.39.0)
88
88
 
89
89
  BUNDLED WITH
90
- 2.2.4
90
+ 2.2.11
data/README.md CHANGED
@@ -76,72 +76,10 @@ And Create Your APP
76
76
  4. Media Web
77
77
  5. Admin Web
78
78
 
79
- ## Usage - 1. GraphQL API
80
79
 
81
- ```bash
82
- # Ruby version (using rbenv)
83
- $ ruby -v
84
- ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
80
+ ## SOULs Document
85
81
 
86
- # Install xcode
87
- $ xcode-select --install
88
-
89
- # Install PostgreSQL (Mac env)
90
- $ brew install postgresql
91
-
92
- # Install redis
93
- $ brew install redis
94
-
95
- # Version Check
96
- $ souls -v
97
-
98
- # Init SOULs App
99
- $ souls new app_name
100
- $ cd app_name
101
- $ bundle
102
-
103
- # Run Dev & Test DB
104
- $ souls i run_psql
105
-
106
- # Create DB
107
- $ souls db:create
108
-
109
- # Migrate DB
110
- $ souls db:migrate
111
-
112
- # Create Test DB
113
- $ souls db:seed
114
-
115
- # Development (localhost:3000/playground)
116
- $ souls s
117
-
118
- # Development with Worker (localhost:3000/playground; localhost:3000/sidekiq)
119
- $ foreman start -f Procfile.dev
120
-
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
- ```
82
+ - [SOULs Document](https://elsoul.github.io/souls_doc/)
145
83
 
146
84
 
147
85
 
data/exe/souls CHANGED
@@ -25,7 +25,7 @@ begin
25
25
  when "service"
26
26
  system "bundle exec rake run_server"
27
27
  else
28
- `bundle exec puma -p 3000 -e development`
28
+ system "foreman start -f Procfile.dev"
29
29
  end
30
30
  when "c", "console"
31
31
  strain = Souls.configuration.strain
@@ -33,7 +33,7 @@ begin
33
33
  when "media", "admin"
34
34
  system "yarn dev"
35
35
  else
36
- `bundle exec irb`
36
+ system "bundle exec irb"
37
37
  end
38
38
  when "i", "infra"
39
39
  Souls.send ARGV[1]
@@ -66,7 +66,7 @@ begin
66
66
  when "migrate_all"
67
67
  Souls::Init.migrate_all
68
68
  when "migration"
69
- STDOUT.write `rake db:create_migration NAME=#{ARGV[2]}`
69
+ system "rake db:create_migration NAME=create_#{ARGV[2]}"
70
70
  when "rspec_factory"
71
71
  Souls::Init.rspec_factory class_name: ARGV[2]
72
72
  when "rspec_model"
@@ -82,23 +82,25 @@ begin
82
82
  else
83
83
  "SOULs!"
84
84
  end
85
+ when "d"
86
+ Souls::Init.delete_all class_name: ARGV[1]
85
87
  when "db:create"
86
- STDOUT.write `rake db:create && rake db:create RACK_ENV=test`
88
+ system "rake db:create && rake db:create RACK_ENV=test"
87
89
  when "db:migrate"
88
- STDOUT.write `rake db:migrate && rake db:migrate RACK_ENV=test`
90
+ system "rake db:migrate && rake db:migrate RACK_ENV=test"
89
91
  when "db:seed"
90
- STDOUT.write `rake db:seed`
92
+ system "rake db:seed"
91
93
  when "db:migrate:reset"
92
- STDOUT.write `rake db:migrate:reset && rake db:migrate:reset RACK_ENV=test`
94
+ system "rake db:migrate:reset && rake db:migrate:reset RACK_ENV=test"
93
95
  when "t", "test"
94
- STDOUT.write `rubocop`
95
- STDOUT.write `bundle exec rspec`
96
+ system "rubocop -a"
97
+ system "bundle exec rspec"
96
98
  when "run"
97
- STDOUT.write `docker build . -t souls:latest`
98
- STDOUT.write `docker run --rm -p 3000:3000 souls:latest`
99
+ system "docker build . -t souls:latest"
100
+ system "docker run --rm -p 3000:3000 souls:latest"
99
101
  when "deploy"
100
102
  project_id = Souls.configuration.project_id
101
- STDOUT.write `gcloud builds submit --config=cloudbuild.yml --project #{project_id}`
103
+ system "gcloud builds submit --config=cloudbuild.yml --project #{project_id}"
102
104
  else
103
105
  puts "Welcome to SOULs!"
104
106
  end
data/lib/souls.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  require "souls/version"
2
+ require "active_support/core_ext/string/inflections"
2
3
  require "souls/init"
3
4
  require "souls/generate"
4
5
  require "json"
5
- require "active_support/core_ext/string/inflections"
6
6
  require "fileutils"
7
7
 
8
8
  module Souls
@@ -135,7 +135,7 @@ module Souls
135
135
  EOS
136
136
  else
137
137
  new_line.write <<-EOS
138
- let(:#{class_name}) { FactoryBot.create(:#{class_name}, #{@relation_params.join(", ")}) }
138
+ let!(:#{class_name}) { FactoryBot.create(:#{class_name}, #{@relation_params.join(", ")}) }
139
139
 
140
140
  let(:query) do
141
141
  %(query {
@@ -280,6 +280,26 @@ end
280
280
  rspec_resolver_params class_name: singularized_class_name
281
281
  rspec_resolver_end class_name: singularized_class_name
282
282
  end
283
+
284
+ def delete_all class_name: "souls"
285
+ singularized_class_name = class_name.singularize.underscore
286
+ pluralized_class_name = class_name.pluralize.underscore
287
+ FileUtils.rm "./app/models/#{singularized_class_name}.rb"
288
+ FileUtils.rm_rf "./app/graphql/mutations/#{singularized_class_name}"
289
+ FileUtils.rm "./app/graphql/queries/#{singularized_class_name}.rb"
290
+ FileUtils.rm "./app/graphql/queries/#{pluralized_class_name}.rb"
291
+ FileUtils.rm "./app/graphql/resolvers/#{singularized_class_name}_search.rb"
292
+ FileUtils.rm "./app/graphql/types/#{singularized_class_name}_type.rb"
293
+ FileUtils.rm "./app/graphql/types/#{singularized_class_name}_node_type.rb"
294
+ FileUtils.rm "./spec/factories/#{pluralized_class_name}.rb"
295
+ FileUtils.rm "./spec/mutations/#{singularized_class_name}_spec.rb"
296
+ FileUtils.rm "./spec/models/#{singularized_class_name}_spec.rb"
297
+ FileUtils.rm "./spec/queries/#{singularized_class_name}_spec.rb"
298
+ FileUtils.rm "./spec/resolvers/#{singularized_class_name}_search_spec.rb"
299
+ puts "deleted #{class_name.camelize} CRUD!"
300
+ rescue StandardError => error
301
+ puts error
302
+ end
283
303
  end
284
304
  end
285
305
  end
data/lib/souls/init.rb CHANGED
@@ -1219,6 +1219,9 @@ module Souls
1219
1219
  " field :update_#{singularized_class_name}, mutation: Mutations::#{singularized_class_name.camelize}::Update#{singularized_class_name.camelize}",
1220
1220
  " field :delete_#{singularized_class_name}, mutation: Mutations::#{singularized_class_name.camelize}::Delete#{singularized_class_name.camelize}",
1221
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"
1222
1225
  ]
1223
1226
  ]
1224
1227
  end
@@ -1248,6 +1251,10 @@ module Souls
1248
1251
  result[0][:add_query_type].each do |path|
1249
1252
  puts path
1250
1253
  end
1254
+ puts "\n ## Resolvers\n\n"
1255
+ result[0][:add_resolver].each do |path|
1256
+ puts path
1257
+ end
1251
1258
  puts "\n ## Connection Type\n\n"
1252
1259
  puts " def #{class_name.pluralize}"
1253
1260
  puts " #{class_name.singularize.camelize}.all.order(id: :desc)"
@@ -1346,6 +1353,12 @@ module Souls
1346
1353
  path[:add_query_type].each { |line| puts line }
1347
1354
  end
1348
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
1349
1362
  puts "\n ## Connection Type\n\n"
1350
1363
  get_tables.each do |class_name|
1351
1364
  puts " def #{class_name.pluralize}"
data/lib/souls/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Souls
2
- VERSION = "0.15.8"
2
+ VERSION = "0.16.3"
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.8
4
+ version: 0.16.3
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-02-15 00:00:00.000000000 Z
13
+ date: 2021-03-01 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: SOULS is a Web Application Framework for Microservices on Multi Cloud
16
16
  Platform such as Google Cloud Platform, Amazon Web Services, and Alibaba Cloud.