souls 2.0.4 → 3.0.2
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/README.md +6 -28
- data/lib/souls/app/utils/firebase_id_token.rb +1 -1
- data/lib/souls/cli/create/index.rb +0 -62
- data/lib/souls/cli/db/create_migration.rb +0 -1
- data/lib/souls/cli/db/index.rb +0 -2
- data/lib/souls/cli/delete/application.rb +2 -18
- data/lib/souls/cli/delete/job.rb +0 -1
- data/lib/souls/cli/delete/manager.rb +0 -1
- data/lib/souls/cli/delete/migration_file.rb +0 -1
- data/lib/souls/cli/gcloud/iam/index.rb +17 -19
- data/lib/souls/cli/gcloud/sql/index.rb +2 -0
- data/lib/souls/cli/generate/application.rb +2 -27
- data/lib/souls/cli/generate/job.rb +0 -1
- data/lib/souls/cli/generate/manager.rb +0 -1
- data/lib/souls/cli/generate/mutation.rb +2 -2
- data/lib/souls/cli/init/index.rb +0 -9
- data/lib/souls/cli/update/index.rb +0 -7
- data/lib/souls/cli/upgrade/index.rb +0 -1
- data/lib/souls/cli.rb +2 -20
- data/lib/souls/utils/index.rb +0 -13
- 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
- metadata +5 -26
- data/lib/souls/cli/db/create_migration_rbs.rb +0 -25
- data/lib/souls/cli/db/model_rbs.rb +0 -22
- data/lib/souls/cli/delete/connection_rbs.rb +0 -16
- data/lib/souls/cli/delete/edge_rbs.rb +0 -15
- data/lib/souls/cli/delete/job_rbs.rb +0 -22
- data/lib/souls/cli/delete/manager_rbs.rb +0 -17
- data/lib/souls/cli/delete/mutation_rbs.rb +0 -15
- data/lib/souls/cli/delete/query_rbs.rb +0 -16
- data/lib/souls/cli/delete/resolver_rbs.rb +0 -16
- data/lib/souls/cli/delete/type_rbs.rb +0 -16
- data/lib/souls/cli/generate/connection_rbs.rb +0 -25
- data/lib/souls/cli/generate/edge_rbs.rb +0 -28
- data/lib/souls/cli/generate/job_rbs.rb +0 -40
- data/lib/souls/cli/generate/manager_rbs.rb +0 -32
- data/lib/souls/cli/generate/mutation_rbs.rb +0 -241
- data/lib/souls/cli/generate/query_rbs.rb +0 -38
- data/lib/souls/cli/generate/resolver_rbs.rb +0 -42
- data/lib/souls/cli/generate/type_rbs.rb +0 -56
- data/lib/souls/cli/update/mutation_rbs.rb +0 -126
- data/lib/souls/cli/update/type_rbs.rb +0 -44
- data/lib/souls/cli/upgrade/submodule.rb +0 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ea9e81a5be437072444963dddf1db155d22dedd554cef2672cbd1434c3474315
|
|
4
|
+
data.tar.gz: e3f1c4282ce26557cac726ed499f7f32428ab197b4d5c64efd5a86c633450686
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8202aebea137646209eb74899b3cc13905bb04affaac8f34fdd197c8bdcdda7d8839fd27b55c8040b8eb3ff4af31dbb7e8a9247fbad99c3325d3786e335339d3
|
|
7
|
+
data.tar.gz: 409193f29cd8cba0ec0021e0febae5eb4cef35de9a50841a0402edbaea202b60dceedbab5b7f2114fc3a5886c5fd57753e550d3b1339f3ed67037f9b67f1d987
|
data/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
[](https://souls.elsoul.nl)
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
4
|
<a aria-label="Ruby logo" href="https://el-soul.com">
|
|
5
5
|
<img src="https://badgen.net/badge/icon/Made%20by%20ELSOUL?icon=ruby&label&color=black&labelColor=black">
|
|
6
6
|
</a>
|
|
7
|
-
<a href="https://twitter.com/intent/follow?screen_name=
|
|
8
|
-
<img src="https://img.shields.io/twitter/follow/
|
|
7
|
+
<a href="https://twitter.com/intent/follow?screen_name=ELSOUL_LABO2">
|
|
8
|
+
<img src="https://img.shields.io/twitter/follow/ELSOUL_LABO2.svg?label=Follow%20@ELSOUL_LABO2" alt="Follow @ELSOUL_LABO2" />
|
|
9
9
|
</a>
|
|
10
10
|
<br/>
|
|
11
11
|
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
<p>
|
|
35
35
|
<a aria-label="Ruby Serverless Application Framework SOULs Document" href="https://souls.elsoul.nl/">
|
|
36
|
-
<img src="https://
|
|
36
|
+
<img src="https://storage.googleapis.com/souls-bucket/imgs/souls-new-video.gif">
|
|
37
37
|
</a>
|
|
38
38
|
</p>
|
|
39
39
|
|
|
@@ -44,13 +44,13 @@ Ruby Serverless Framework 'SOULs'.
|
|
|
44
44
|
The SOULs project was launched with the goal of reducing software development, operation and maintenance costs.
|
|
45
45
|
|
|
46
46
|
Build Serverless Apps faster like Rails.
|
|
47
|
-
Powered by Ruby GraphQL,
|
|
47
|
+
Powered by Ruby GraphQL, Active Record, RSpec, RuboCop, and Google Cloud.
|
|
48
48
|
|
|
49
49
|
- Focus on business logic in serverless environment
|
|
50
50
|
- Maximize development efficiency with CI / CD standard schema-driven Scaffold
|
|
51
51
|
- Achieve global scale with lower management costs
|
|
52
52
|
|
|
53
|
-

|
|
54
54
|
|
|
55
55
|
SOULs creates 3 types of App.
|
|
56
56
|
|
|
@@ -58,23 +58,6 @@ SOULs creates 3 types of App.
|
|
|
58
58
|
2. Worker - Google Pub/Sub Messaging Worker API (Ruby) - Cloud Run
|
|
59
59
|
3. Functions - Google Cloud Functions
|
|
60
60
|
|
|
61
|
-
## Ruby type checking
|
|
62
|
-
The SOULs framework uses RBS / Steep, which appeared in Ruby 3.0.
|
|
63
|
-
|
|
64
|
-
- [RBS](https://github.com/ruby/rbs/)
|
|
65
|
-
- [Steep](https://github.com/soutaro/steep/)
|
|
66
|
-
|
|
67
|
-
As a result, typos, column types, etc.
|
|
68
|
-
|
|
69
|
-
It is a development environment where you can immediately notice the mistakes that occur frequently.
|
|
70
|
-
|
|
71
|
-
<p>
|
|
72
|
-
<a aria-label="RBS Demo" href="https://souls.elsoul.nl/ja/docs/guides/basic/type-check/">
|
|
73
|
-
<img src="https://souls.elsoul.nl/imgs/gifs/rbs-video.gif">
|
|
74
|
-
</a>
|
|
75
|
-
</p>
|
|
76
|
-
|
|
77
|
-
|
|
78
61
|
## Dependency
|
|
79
62
|
|
|
80
63
|
- [Google SDK](https://cloud.google.com/sdk/docs)
|
|
@@ -123,11 +106,6 @@ And Create Your APP
|
|
|
123
106
|
|
|
124
107
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `souls t` to run the tests. You can also run `souls c` for an interactive prompt that will allow you to experiment.
|
|
125
108
|
|
|
126
|
-
You need to add submodule
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
git submodule add -f https://github.com/ruby/gem_rbs_collection.git vendor/rbs/gem_rbs_collection
|
|
130
|
-
```
|
|
131
109
|
|
|
132
110
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org/gems/souls).
|
|
133
111
|
|
|
@@ -18,8 +18,6 @@ module SOULs
|
|
|
18
18
|
procfile(worker_name:, port:)
|
|
19
19
|
mother_procfile(worker_name:)
|
|
20
20
|
souls_config_init(worker_name:)
|
|
21
|
-
steepfile(worker_name:)
|
|
22
|
-
souls_helper_rbs(worker_name:)
|
|
23
21
|
system("cd #{file_dir} && bundle")
|
|
24
22
|
system("cd #{file_dir} && mv .env.sample .env")
|
|
25
23
|
souls_worker_credit(worker_name:)
|
|
@@ -29,25 +27,6 @@ module SOULs
|
|
|
29
27
|
|
|
30
28
|
private
|
|
31
29
|
|
|
32
|
-
def steepfile(worker_name: "worker-mailer")
|
|
33
|
-
file_path = "./Steepfile"
|
|
34
|
-
|
|
35
|
-
write_txt = ""
|
|
36
|
-
File.open(file_path, "r") do |f|
|
|
37
|
-
f.each_line do |line|
|
|
38
|
-
if line.strip.to_s == "end"
|
|
39
|
-
["app", "db/seeds.rb", "constants", "app.rb"].each do |path|
|
|
40
|
-
write_txt += " check \"apps/#{worker_name}/#{path}\"\n"
|
|
41
|
-
end
|
|
42
|
-
write_txt += "end\n"
|
|
43
|
-
else
|
|
44
|
-
write_txt += line
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
File.open(file_path, "w") { |f| f.write(write_txt) }
|
|
49
|
-
end
|
|
50
|
-
|
|
51
30
|
def procfile(worker_name: "worker-mailer", port: 123)
|
|
52
31
|
file_path = "apps/#{worker_name}/Procfile.dev"
|
|
53
32
|
File.open(file_path, "w") do |f|
|
|
@@ -235,47 +214,6 @@ end
|
|
|
235
214
|
end
|
|
236
215
|
end
|
|
237
216
|
|
|
238
|
-
def souls_helper_rbs(worker_name: "worker-mailer")
|
|
239
|
-
file_dir = "./sig/#{worker_name}/app/utils"
|
|
240
|
-
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
|
241
|
-
file_path = "#{file_dir}/souls_helper.rbs"
|
|
242
|
-
File.open(file_path, "w") do |f|
|
|
243
|
-
f.write(<<~TEXT)
|
|
244
|
-
module SOULsHelper
|
|
245
|
-
def self.export_csv: (untyped model_name) -> (String? | StandardError )
|
|
246
|
-
def self.export_model_to_csv: (untyped model_name) -> (untyped | StandardError )
|
|
247
|
-
def self.upload_to_gcs: (String file_path, String upload_path) -> untyped
|
|
248
|
-
def self.get_selenium_driver: (?:chrome mode) -> untyped
|
|
249
|
-
end
|
|
250
|
-
module CSV
|
|
251
|
-
def self.open: (*untyped){(untyped) -> nil} -> untyped
|
|
252
|
-
end
|
|
253
|
-
module Selenium
|
|
254
|
-
module WebDriver
|
|
255
|
-
def self.for: (*untyped) -> untyped
|
|
256
|
-
module Chrome
|
|
257
|
-
module Options
|
|
258
|
-
def self.new: ()-> untyped
|
|
259
|
-
end
|
|
260
|
-
end
|
|
261
|
-
module Remote
|
|
262
|
-
module Capabilities
|
|
263
|
-
def self.firefox: ()-> untyped
|
|
264
|
-
end
|
|
265
|
-
end
|
|
266
|
-
end
|
|
267
|
-
end
|
|
268
|
-
module Google
|
|
269
|
-
module Cloud
|
|
270
|
-
module Storage
|
|
271
|
-
def self.new: ()-> untyped
|
|
272
|
-
end
|
|
273
|
-
end
|
|
274
|
-
end
|
|
275
|
-
TEXT
|
|
276
|
-
end
|
|
277
|
-
end
|
|
278
|
-
|
|
279
217
|
def download_worker(worker_name: "worker-mailer")
|
|
280
218
|
version = SOULs.get_latest_version_txt(service_name: "worker").join(".")
|
|
281
219
|
file_name = "worker-v#{version}.tgz"
|
|
@@ -6,7 +6,6 @@ module SOULs
|
|
|
6
6
|
singularized_class_name = class_name.underscore.singularize
|
|
7
7
|
SOULs::DB.new.invoke(:model, [singularized_class_name], {})
|
|
8
8
|
SOULs::DB.new.invoke(:rspec_model, [singularized_class_name], {})
|
|
9
|
-
SOULs::DB.new.invoke(:model_rbs, [singularized_class_name], {})
|
|
10
9
|
SOULs::Painter.create_file("")
|
|
11
10
|
system("rake db:create_migration NAME=create_#{pluralized_class_name}")
|
|
12
11
|
file_path = Dir["db/migrate/*create_#{pluralized_class_name}.rb"].first
|
data/lib/souls/cli/db/index.rb
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
module SOULs
|
|
2
2
|
class Delete < Thor
|
|
3
3
|
desc "scaffold [CLASS_NAME]", "Delete Scaffold"
|
|
4
|
-
method_option :rbs, type: :boolean, aliases: "--rbs", default: false, desc: "Deletes Only RBS Files"
|
|
5
4
|
def scaffold(class_name)
|
|
6
5
|
singularized_class_name = class_name.singularize
|
|
7
|
-
|
|
8
|
-
run_rbs_scaffold(class_name: singularized_class_name)
|
|
9
|
-
else
|
|
10
|
-
run_scaffold(class_name: singularized_class_name)
|
|
11
|
-
end
|
|
6
|
+
run_scaffold(class_name: singularized_class_name)
|
|
12
7
|
true
|
|
13
8
|
end
|
|
14
9
|
|
|
15
10
|
desc "scaffold_all", "Delete Scaffold All Tables from schema.rb"
|
|
16
|
-
method_option :rbs, type: :boolean, aliases: "--rbs", default: false, desc: "Deletes Only RBS Files"
|
|
17
11
|
def scaffold_all
|
|
18
12
|
puts(Paint["Delete All Scaffold Files!\n", :cyan])
|
|
19
13
|
SOULs.get_tables.each do |table|
|
|
20
|
-
SOULs::Delete.new.invoke(:scaffold, [table.singularize], {
|
|
14
|
+
SOULs::Delete.new.invoke(:scaffold, [table.singularize], {})
|
|
21
15
|
end
|
|
22
16
|
true
|
|
23
17
|
end
|
|
@@ -35,16 +29,6 @@ module SOULs
|
|
|
35
29
|
rspec_mutation(class_name)
|
|
36
30
|
rspec_query(class_name)
|
|
37
31
|
rspec_resolver(class_name)
|
|
38
|
-
run_rbs_scaffold(class_name:)
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def run_rbs_scaffold(class_name: "user")
|
|
42
|
-
type_rbs(class_name)
|
|
43
|
-
query_rbs(class_name)
|
|
44
|
-
mutation_rbs(class_name)
|
|
45
|
-
edge_rbs(class_name)
|
|
46
|
-
connection_rbs(class_name)
|
|
47
|
-
resolver_rbs(class_name)
|
|
48
32
|
end
|
|
49
33
|
end
|
|
50
34
|
end
|
data/lib/souls/cli/delete/job.rb
CHANGED
|
@@ -9,7 +9,6 @@ module SOULs
|
|
|
9
9
|
|
|
10
10
|
FileUtils.rm_f(file_path)
|
|
11
11
|
SOULs::Painter.delete_file(file_path.to_s)
|
|
12
|
-
SOULs::Delete.new.invoke(:manager_rbs, [singularized_class_name], { mutation: options[:mutation] })
|
|
13
12
|
SOULs::Delete.new.invoke(:rspec_manager, [singularized_class_name], { mutation: options[:mutation] })
|
|
14
13
|
file_path
|
|
15
14
|
end
|
|
@@ -8,7 +8,6 @@ module SOULs
|
|
|
8
8
|
file_paths = {
|
|
9
9
|
model_file_path: "./apps/api/app/models/#{singularized_class_name}.rb",
|
|
10
10
|
rspec_file_path: "./apps/api/spec/models/#{singularized_class_name}_spec.rb",
|
|
11
|
-
rbs_file_path: "./sig/api/app/models/#{singularized_class_name}.rbs",
|
|
12
11
|
migration_file_path: Dir["db/migrate/*create_#{pluralized_class_name}.rb"].first
|
|
13
12
|
}
|
|
14
13
|
file_paths.each do |_k, v|
|
|
@@ -2,25 +2,23 @@ module SOULs
|
|
|
2
2
|
class Iam < Thor
|
|
3
3
|
desc "setup_key", "Create Google Cloud IAM Service Account Key And Set All Permissions"
|
|
4
4
|
def setup_key
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export_key_to_console
|
|
23
|
-
end
|
|
5
|
+
SOULs::Painter.sync("Setting up credentials and permissions...")
|
|
6
|
+
region = SOULs.configuration.region
|
|
7
|
+
SOULs::Gcloud.new.auth_login
|
|
8
|
+
SOULs::Upgrade.new.config
|
|
9
|
+
create_service_account
|
|
10
|
+
create_service_account_key
|
|
11
|
+
SOULs::Gcloud.new.enable_permissions
|
|
12
|
+
add_permissions
|
|
13
|
+
begin
|
|
14
|
+
system("gcloud app create --region=#{region} --quiet")
|
|
15
|
+
rescue StandardError, error
|
|
16
|
+
puts("gcloud app region is Already exist! - SOULs::Gcloud::Iam.setup_key")
|
|
17
|
+
end
|
|
18
|
+
begin
|
|
19
|
+
set_gh_secret_json
|
|
20
|
+
rescue StandardError
|
|
21
|
+
export_key_to_console
|
|
24
22
|
end
|
|
25
23
|
SOULs::Painter.success("You're all set!")
|
|
26
24
|
true
|
|
@@ -68,6 +68,7 @@ module SOULs
|
|
|
68
68
|
SOULS_DB_PW=#{db_password}
|
|
69
69
|
SOULS_DB_USER=postgres
|
|
70
70
|
SOULS_GCP_PROJECT_ID=#{project_id}
|
|
71
|
+
SOULS_FB_PROJECT_ID=#{project_id}
|
|
71
72
|
SOULS_SECRET_KEY_BASE='#{SecureRandom.base64(64)}'
|
|
72
73
|
TZ="#{region_to_timezone(region:)}"
|
|
73
74
|
TEXT
|
|
@@ -84,6 +85,7 @@ module SOULs
|
|
|
84
85
|
SOULS_DB_USER=postgres
|
|
85
86
|
SOULS_APP_NAME=#{app_name}
|
|
86
87
|
SOULS_GCP_PROJECT_ID=#{project_id}
|
|
88
|
+
SOULS_FB_PROJECT_ID=#{project_id}
|
|
87
89
|
SOULS_GCP_REGION=#{region}
|
|
88
90
|
SOULS_GCLOUDSQL_INSTANCE="#{project_id}:#{region}:#{instance_name}"
|
|
89
91
|
SOULS_SECRET_KEY_BASE='#{SecureRandom.base64(64)}'
|
|
@@ -1,27 +1,17 @@
|
|
|
1
1
|
module SOULs
|
|
2
2
|
class Generate < Thor
|
|
3
3
|
desc "scaffold [CLASS_NAME]", "Generate Scaffold from schema.rb"
|
|
4
|
-
method_option :rbs, type: :boolean, aliases: "--rbs", default: false, desc: "Generates Only RBS Files"
|
|
5
4
|
def scaffold(class_name)
|
|
6
5
|
singularized_class_name = class_name.singularize
|
|
7
|
-
|
|
8
|
-
run_rbs_scaffold(singularized_class_name)
|
|
9
|
-
else
|
|
10
|
-
run_scaffold(singularized_class_name)
|
|
11
|
-
end
|
|
6
|
+
run_scaffold(singularized_class_name)
|
|
12
7
|
true
|
|
13
8
|
end
|
|
14
9
|
|
|
15
10
|
desc "scaffold_all", "Generate Scaffold All Tables from schema.rb"
|
|
16
|
-
method_option :rbs, type: :boolean, aliases: "--rbs", default: false, desc: "Generates Only RBS All Schema Files"
|
|
17
11
|
def scaffold_all
|
|
18
12
|
puts(Paint["Let's Go SOULs AUTO CRUD Assist!\n", :cyan])
|
|
19
13
|
SOULs.get_tables.each do |table|
|
|
20
|
-
|
|
21
|
-
SOULs::Generate.new.invoke(:scaffold, [table.singularize], { rbs: options[:rbs] })
|
|
22
|
-
else
|
|
23
|
-
SOULs::Generate.new.invoke(:scaffold, [table.singularize], {})
|
|
24
|
-
end
|
|
14
|
+
SOULs::Generate.new.invoke(:scaffold, [table.singularize], {})
|
|
25
15
|
end
|
|
26
16
|
true
|
|
27
17
|
end
|
|
@@ -30,32 +20,17 @@ module SOULs
|
|
|
30
20
|
|
|
31
21
|
def run_scaffold(class_name)
|
|
32
22
|
type(class_name)
|
|
33
|
-
type_rbs(class_name)
|
|
34
23
|
query(class_name)
|
|
35
|
-
query_rbs(class_name)
|
|
36
24
|
mutation(class_name)
|
|
37
|
-
mutation_rbs(class_name)
|
|
38
25
|
edge(class_name)
|
|
39
|
-
edge_rbs(class_name)
|
|
40
26
|
connection(class_name)
|
|
41
|
-
connection_rbs(class_name)
|
|
42
27
|
resolver(class_name)
|
|
43
|
-
resolver_rbs(class_name)
|
|
44
28
|
rspec_factory(class_name)
|
|
45
29
|
rspec_mutation(class_name)
|
|
46
30
|
rspec_query(class_name)
|
|
47
31
|
rspec_resolver(class_name)
|
|
48
32
|
end
|
|
49
33
|
|
|
50
|
-
def run_rbs_scaffold(class_name)
|
|
51
|
-
type_rbs(class_name)
|
|
52
|
-
query_rbs(class_name)
|
|
53
|
-
mutation_rbs(class_name)
|
|
54
|
-
edge_rbs(class_name)
|
|
55
|
-
connection_rbs(class_name)
|
|
56
|
-
resolver_rbs(class_name)
|
|
57
|
-
end
|
|
58
|
-
|
|
59
34
|
def generated_paths(class_name)
|
|
60
35
|
singularized_class_name = class_name.singularize.underscore
|
|
61
36
|
pluralized_class_name = class_name.pluralize.underscore
|
|
@@ -10,7 +10,6 @@ module SOULs
|
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
create_manager(class_name, options[:mutation])
|
|
13
|
-
SOULs::Generate.new.invoke(:manager_rbs, [singularized_class_name], { mutation: options[:mutation] })
|
|
14
13
|
SOULs::Generate.new.invoke(:rspec_manager, [singularized_class_name], { mutation: options[:mutation] })
|
|
15
14
|
end
|
|
16
15
|
|
|
@@ -24,7 +24,7 @@ module SOULs
|
|
|
24
24
|
file_dir = "./app/graphql/mutations/base/#{singularized_class_name}"
|
|
25
25
|
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
|
26
26
|
file_path = "#{file_dir}/create_#{singularized_class_name}.rb"
|
|
27
|
-
raise(Thor::Error, "Mutation
|
|
27
|
+
raise(Thor::Error, "Mutation already exist! #{file_path}") if File.exist?(file_path)
|
|
28
28
|
|
|
29
29
|
params = SOULs.get_relation_params(class_name: singularized_class_name, col: "mutation")
|
|
30
30
|
File.open(file_path, "a") do |f|
|
|
@@ -92,7 +92,7 @@ module SOULs
|
|
|
92
92
|
file_dir = "./app/graphql/mutations/base/#{singularized_class_name}"
|
|
93
93
|
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
|
94
94
|
file_path = "#{file_dir}/update_#{singularized_class_name}.rb"
|
|
95
|
-
raise(Thor::Error, "Mutation
|
|
95
|
+
raise(Thor::Error, "Mutation already exist! #{file_path}") if File.exist?(file_path)
|
|
96
96
|
|
|
97
97
|
params = SOULs.get_relation_params(class_name: singularized_class_name, col: "mutation")
|
|
98
98
|
File.open(file_path, "w") do |f|
|
data/lib/souls/cli/init/index.rb
CHANGED
|
@@ -25,7 +25,6 @@ module SOULs
|
|
|
25
25
|
initial_config_init(app_name:, service_name:)
|
|
26
26
|
system("cd #{app_name}/apps/api && mv .env.sample .env")
|
|
27
27
|
system("cd #{app_name} && git init --initial-branch=main")
|
|
28
|
-
system("cd #{app_name} && rbs collection init && rbs collection install")
|
|
29
28
|
souls_api_credit(app_name)
|
|
30
29
|
end
|
|
31
30
|
|
|
@@ -136,7 +135,6 @@ module SOULs
|
|
|
136
135
|
gem "sinatra-activerecord", "2.0.25"
|
|
137
136
|
gem "solargraph", "0.44.3"
|
|
138
137
|
#{souls_gem}
|
|
139
|
-
gem "steep", "0.49.0"
|
|
140
138
|
gem "thor", "1.2.1"
|
|
141
139
|
gem "tty-prompt", "0.23.1"
|
|
142
140
|
gem "whirly", "0.3.0"
|
|
@@ -155,21 +153,14 @@ module SOULs
|
|
|
155
153
|
system("tar -zxvf ./#{file_name} -C #{app_name}/apps/")
|
|
156
154
|
FileUtils.rm(file_name)
|
|
157
155
|
|
|
158
|
-
sig_name = "sig.tgz"
|
|
159
|
-
url = "#{@bucket_url}/sig/#{sig_name}"
|
|
160
|
-
system("curl -OL #{url}")
|
|
161
|
-
system("tar -zxvf ./#{sig_name} -C #{app_name}")
|
|
162
|
-
|
|
163
156
|
system("cd #{app_name} && curl -OL #{@bucket_url}/rubocop.yml && mv rubocop.yml .rubocop.yml")
|
|
164
157
|
get_latest_gem(app_name)
|
|
165
158
|
system("cd #{app_name} && curl -OL #{@bucket_url}/Procfile.dev")
|
|
166
159
|
system("cd #{app_name} && curl -OL #{@bucket_url}/Procfile")
|
|
167
|
-
system("cd #{app_name} && curl -OL #{@bucket_url}/Steepfile")
|
|
168
160
|
system("cd #{app_name} && curl -OL #{@bucket_url}/gitignore")
|
|
169
161
|
system("cd #{app_name} && mv gitignore .gitignore")
|
|
170
162
|
system("cd #{app_name} && bundle")
|
|
171
163
|
system("cd #{app_name}/apps/api && bundle")
|
|
172
|
-
FileUtils.rm(sig_name)
|
|
173
164
|
end
|
|
174
165
|
|
|
175
166
|
def souls_api_credit(app_name)
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
require_relative "./mutation"
|
|
2
|
-
require_relative "./mutation_rbs"
|
|
3
2
|
require_relative "./resolver"
|
|
4
3
|
require_relative "./type"
|
|
5
|
-
require_relative "./type_rbs"
|
|
6
4
|
require_relative "./rspec_factory"
|
|
7
5
|
require_relative "./rspec_mutation"
|
|
8
6
|
require_relative "./rspec_resolver"
|
|
@@ -18,11 +16,6 @@ module SOULs
|
|
|
18
16
|
rspec_factory(class_name)
|
|
19
17
|
rspec_mutation(class_name)
|
|
20
18
|
rspec_resolver(class_name)
|
|
21
|
-
Dir.chdir(SOULs.get_mother_path.to_s) do
|
|
22
|
-
create_mutation_rbs(class_name)
|
|
23
|
-
update_mutation_rbs(class_name)
|
|
24
|
-
type_rbs(class_name)
|
|
25
|
-
end
|
|
26
19
|
end
|
|
27
20
|
end
|
|
28
21
|
end
|
data/lib/souls/cli.rb
CHANGED
|
@@ -50,27 +50,9 @@ module SOULs
|
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
desc "test", "Run Rspec & Rubocop"
|
|
53
|
-
method_option :all, type: :boolean, aliases: "--all", default: false, desc: "Run (Rspec & steep check & Rubocop)"
|
|
54
53
|
def test
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
system("steep check")
|
|
58
|
-
end
|
|
59
|
-
Dir.chdir(SOULs.get_api_path.to_s) do
|
|
60
|
-
system("rubocop -A")
|
|
61
|
-
system("bundle exec rspec")
|
|
62
|
-
end
|
|
63
|
-
else
|
|
64
|
-
system("rubocop -A")
|
|
65
|
-
system("bundle exec rspec")
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
desc "check", "Run steep check"
|
|
70
|
-
def check
|
|
71
|
-
Dir.chdir(SOULs.get_mother_path.to_s) do
|
|
72
|
-
system("steep check")
|
|
73
|
-
end
|
|
54
|
+
system("rubocop -A")
|
|
55
|
+
system("bundle exec rspec")
|
|
74
56
|
end
|
|
75
57
|
|
|
76
58
|
def self.exit_on_failure?
|
data/lib/souls/utils/index.rb
CHANGED
|
@@ -28,19 +28,6 @@ module SOULs
|
|
|
28
28
|
}[type.to_sym]
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
-
def rbs_type_check(type)
|
|
32
|
-
{
|
|
33
|
-
bigint: "Integer",
|
|
34
|
-
string: "String",
|
|
35
|
-
float: "Float",
|
|
36
|
-
text: "String",
|
|
37
|
-
datetime: "String",
|
|
38
|
-
date: "String",
|
|
39
|
-
boolean: "bool",
|
|
40
|
-
integer: "Integer"
|
|
41
|
-
}[type.to_sym]
|
|
42
|
-
end
|
|
43
|
-
|
|
44
31
|
def get_type_and_name(line)
|
|
45
32
|
line.split(",")[0].gsub("\"", "").scan(/((?<=t\.).+(?=\s)) (.+)/)[0]
|
|
46
33
|
end
|
data/lib/souls/version.rb
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
3.0.2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
3.0.2
|