souls 0.15.9 → 0.16.4
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/.irbrc +1 -0
- data/Gemfile.lock +7 -7
- data/README.md +2 -64
- data/exe/souls +19 -12
- data/lib/souls.rb +1 -1
- data/lib/souls/generate.rb +21 -1
- data/lib/souls/init.rb +1 -1
- data/lib/souls/version.rb +1 -1
- data/souls.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a95c2f58d01aa07cecc588a0c9beba4bbce457bd48c45975dc3b5a071a0ee80
|
4
|
+
data.tar.gz: 48959daa9836b8175871e8320acefae6c382e4ec266ca301fd27974175abc4ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8d533843c23355c65d6b2b32f433c04259a34aa83aa04d152f0a2e8d5b216474f676cec996a156b8d370c36739e80a41ead964884b2d4f3b06644ac914531fc
|
7
|
+
data.tar.gz: eef3ca623bc05f8b0577073f928f0a649957dc92ffb263b87c6eb3ce53b9f92cd03d46e97e9903e9370726419843587ffae30039d84210fcc72e9d1d76713f60
|
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.
|
4
|
+
souls (0.16.4)
|
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.
|
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.
|
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.
|
38
|
-
regexp_parser (2.
|
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
|
-
|
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.
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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,30 @@ 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
|
-
|
88
|
+
system "rake db:create && rake db:create RACK_ENV=test"
|
87
89
|
when "db:migrate"
|
88
|
-
|
90
|
+
system "rake db:migrate && rake db:migrate RACK_ENV=test"
|
89
91
|
when "db:seed"
|
90
|
-
|
92
|
+
system "rake db:seed"
|
91
93
|
when "db:migrate:reset"
|
92
|
-
|
94
|
+
case ARGV[1]
|
95
|
+
when "RACK_ENV=production"
|
96
|
+
system "rake db:migrate:reset RACK_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1"
|
97
|
+
else
|
98
|
+
system "rake db:migrate:reset && rake db:migrate:reset RACK_ENV=test"
|
99
|
+
end
|
93
100
|
when "t", "test"
|
94
|
-
|
95
|
-
|
101
|
+
system "rubocop -a"
|
102
|
+
system "bundle exec rspec"
|
96
103
|
when "run"
|
97
|
-
|
98
|
-
|
104
|
+
system "docker build . -t souls:latest"
|
105
|
+
system "docker run --rm -p 3000:3000 souls:latest"
|
99
106
|
when "deploy"
|
100
107
|
project_id = Souls.configuration.project_id
|
101
|
-
|
108
|
+
system "gcloud builds submit --config=cloudbuild.yml --project #{project_id}"
|
102
109
|
else
|
103
110
|
puts "Welcome to SOULs!"
|
104
111
|
end
|
data/lib/souls.rb
CHANGED
data/lib/souls/generate.rb
CHANGED
@@ -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
@@ -1221,7 +1221,7 @@ module Souls
|
|
1221
1221
|
" field :destroy_delete_#{singularized_class_name}, mutation: Mutations::#{singularized_class_name.camelize}::DestroyDelete#{singularized_class_name.camelize}"
|
1222
1222
|
],
|
1223
1223
|
add_resolver: [
|
1224
|
-
" field :#{singularized_class_name}_search, resolver:
|
1224
|
+
" field :#{singularized_class_name}_search, resolver: Resolvers::#{singularized_class_name.camelize}Search"
|
1225
1225
|
]
|
1226
1226
|
]
|
1227
1227
|
end
|
data/lib/souls/version.rb
CHANGED
data/souls.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.description = "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."
|
11
11
|
spec.homepage = "https://github.com/elsoul/souls"
|
12
12
|
spec.license = "Apache-2.0"
|
13
|
-
spec.required_ruby_version = Gem::Requirement.new(">=
|
13
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
|
14
14
|
|
15
15
|
spec.metadata["homepage_uri"] = spec.homepage
|
16
16
|
spec.metadata["source_code_uri"] = "https://github.com/elsoul/souls"
|
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.16.4
|
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-
|
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.
|
@@ -63,7 +63,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
63
63
|
requirements:
|
64
64
|
- - ">="
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version:
|
66
|
+
version: 3.0.0
|
67
67
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
68
|
requirements:
|
69
69
|
- - ">="
|