souls 0.25.16 → 0.25.20

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: 4e8b0af25e3d9a42b03bba36beefe296a3ad4071e42afdba29bdb611f45bc4c5
4
- data.tar.gz: ae642be3d64d0d5da50c0547de050e7d5e58d55bbcdf991ba0e8c7e90063f2f1
3
+ metadata.gz: 66e0b6654b29ea6a361da6bece2be252de22550bb07c844ad7790fcd548a2ff5
4
+ data.tar.gz: e29b9acf01284142e562e8889743fd696fcf56600aed6c116c7bdb9aa4f3e7d2
5
5
  SHA512:
6
- metadata.gz: 95a0d969315e1a81c5ed126fba58d5929aa78ad9311d89dd8671472b07bf98da92b7f7047843b4a50ac2601a01eec41228ca4707e3e64222c41a7aceb2fd6dec
7
- data.tar.gz: c693b388d8b5123ff9ac3b6610fe8cbe661158d5bcde0a7781c0b9dffe4a84fa4c2df1a639e84b8b42ceb8e035bb81148694220be68fcaf477092ae8c0a52735
6
+ metadata.gz: cfd541e08f629d71834914a18ee30c87bf1b25464897e4f6d8b82130d5fcedfbcab9b9ac972f693ee8f0c355b168b097289e82d3bd16bfd79606e529a6532b71
7
+ data.tar.gz: abd69b5e9843eb059268d584830ba7892a583566791f4f77537473df3c5c156cf1c5c345ed625e9f639f1c6c24978f0094be6eb03b301ec7c855c24fd2d2142c
data/README.md CHANGED
@@ -22,19 +22,16 @@
22
22
  Welcome to SOULs Serverless Application Framework!
23
23
 
24
24
  SOULs is a Serverless Application Framework with Ruby GraphQL.
25
- SOULs has six strains, API, Worker, Console, Admin, Media, Doc, and can be used in combination according to the purpose. SOULs Backend GraphQL Ruby & Frontend Relay are Scalable and Easy to deploy to Google Cloud. No more routing for Backends!
26
- You can focus on your business logic. No more infra problems.
25
+ SOULs has 3 strains, API, Worker, and Frontend. It can be used in combination according to the purpose. SOULs Backend GraphQL Ruby & Frontend Relay are Scalable and Easy to deploy to Google Cloud. No more routing for Backends!
26
+ You can focus on your business logic.
27
27
 
28
28
  ![画像](https://storage.googleapis.com/souls-bucket/imgs/souls-structure.jpg)
29
29
 
30
- SOULs creates 6 types of framework.
30
+ SOULs creates 3 types of framework.
31
31
 
32
32
  1. API - GraphQL (Ruby) - Simple API - Cloud Run
33
33
  2. Worker - Google Pub/Sub Worker API (Ruby) - Cloud Run
34
- 3. Console Web Client - User Console and CMS (TypeScript)
35
- 4. Admin Web Client - Admin Console and CMS (TypeScript)
36
- 5. Media Web Client - Media web client with SSG (TypeScript)
37
- 6. Doc Web Client - Doc web client with SSG (TypeScript)
34
+ 3. Frontend - React Application (TypeScript) - Firebase
38
35
 
39
36
  ## Dependency
40
37
 
@@ -81,10 +78,7 @@ And Create Your APP
81
78
  Select Strain:
82
79
  1. SOULs GraphQL API
83
80
  2. SOULs Worker
84
- 3. SOULs Console Web
85
- 4. SOULs Admin Web
86
- 5. SOULs Media Web
87
- 6. SOULs Doc Web
81
+ 3. SOULs Frontend Web
88
82
 
89
83
 
90
84
  ## Gemfile 自動更新アップデート
data/exe/souls CHANGED
@@ -9,32 +9,8 @@ begin
9
9
  souls_command = ARGV[0]
10
10
  case souls_command
11
11
  when "new"
12
- STRAINS = %w[api worker console admin media doc].freeze
13
- app_name = ARGV[1]
14
- if app_name.nil?
15
- puts(Paint["you need to specify your app name", :red])
16
- puts(Paint["`souls new app_name`", :yellow])
17
- exit
18
- end
19
-
20
- prompt = TTY::Prompt.new
21
- choices = [
22
- "1. SOULs GraphQL API",
23
- "2. SOULs Pub/Sub Worker",
24
- "3. SOULs Console Web",
25
- "4. SOULs Admin Web",
26
- "5. SOULs Media Web",
27
- "6. SOULs Doc Web"
28
- ]
29
- choice_num = prompt.select(Paint["Select Strain: ", :cyan], choices)[0].to_i
30
- case choice_num
31
- when 1, 2
32
- service_name = (STRAINS[choice_num.to_i - 1]).to_s
33
- Souls::Init.download_souls(app_name: app_name, service_name: service_name)
34
- Souls::Init.initial_config_init(app_name: app_name, service_name: service_name)
35
- else
36
- puts(Paint["Coming Soon...", :blue])
37
- end
12
+ args = ARGV
13
+ Souls::Init.return_method(args)
38
14
  when "s", "server"
39
15
  strain = Souls.configuration.strain
40
16
  case strain
@@ -184,7 +160,7 @@ begin
184
160
  system("rm -rf ../#{other_app}/db/*")
185
161
  system("cp -r ./db/* ../#{other_app}/db/*")
186
162
  when "t", "test"
187
- system("rubocop -a")
163
+ system("rubocop -A")
188
164
  system("bundle exec rspec")
189
165
  when "run"
190
166
  system("docker build . -t souls -f Dockerfile.dev")
@@ -53,6 +53,8 @@ module Souls
53
53
  when "update"
54
54
  Souls::Generate.update_delete(class_name: class_name)
55
55
  Souls::Generate.migrate(class_name: class_name)
56
+ when "worker"
57
+ Souls::Init.download_worker
56
58
  else
57
59
  "SOULs!"
58
60
  end
@@ -12,7 +12,7 @@ module Souls
12
12
  module Mutations
13
13
  module Base::#{singularized_class_name.camelize}
14
14
  class Create#{singularized_class_name.camelize} < BaseMutation
15
- field :#{singularized_class_name}_edge, Types::#{singularized_class_name.camelize}.edge_type, null: false
15
+ field :#{singularized_class_name}_edge, Types::#{singularized_class_name.camelize}Type.edge_type, null: false
16
16
  field :error, String, null: true
17
17
 
18
18
  TEXT
@@ -104,9 +104,9 @@ module Souls
104
104
  File.open(file_path, "w") do |new_line|
105
105
  new_line.write(<<~TEXT)
106
106
  module Mutations
107
- module #{class_name.camelize}
107
+ module Base::#{class_name.camelize}
108
108
  class Update#{class_name.camelize} < BaseMutation
109
- field :#{class_name}_edge, Types::#{class_name.camelize}.edge_type, null: false
109
+ field :#{class_name}_edge, Types::#{class_name.camelize}Type.edge_type, null: false
110
110
 
111
111
  argument :id, String, required: true
112
112
  TEXT
@@ -211,7 +211,7 @@ module Souls
211
211
  File.open(file_path, "w") do |f|
212
212
  f.write(<<~TEXT)
213
213
  module Mutations
214
- module #{class_name.camelize}
214
+ module Base::#{class_name.camelize}
215
215
  class Delete#{class_name.camelize} < BaseMutation
216
216
  field :#{class_name}, Types::#{class_name.camelize}Type, null: false
217
217
  argument :id, String, required: true
@@ -240,7 +240,7 @@ module Souls
240
240
  File.open(file_path, "w") do |f|
241
241
  f.write(<<~TEXT)
242
242
  module Mutations
243
- module #{class_name.camelize}
243
+ module Base::#{class_name.camelize}
244
244
  class DestroyDelete#{class_name.camelize} < BaseMutation
245
245
  field :#{class_name}, Types::#{class_name.camelize}Type, null: false
246
246
  argument :id, String, required: true
data/lib/souls/init.rb CHANGED
@@ -10,13 +10,15 @@ module Souls
10
10
  end
11
11
 
12
12
  def self.initial_config_init(app_name: "souls", service_name: "api")
13
- FileUtils.touch("./#{app_name}/#{service_name}/config/souls.rb")
14
- file_path = "./#{app_name}/#{service_name}/config/souls.rb"
13
+ config_dir = "./#{app_name}/apps/#{service_name}/config"
14
+ FileUtils.mkdir_p(config_dir) unless Dir.exist?(config_dir)
15
+ FileUtils.touch("#{config_dir}/souls.rb")
16
+ file_path = "#{config_dir}/souls.rb"
15
17
  File.open(file_path, "w") do |f|
16
18
  f.write(<<~TEXT)
17
19
  Souls.configure do |config|
18
20
  config.app = "#{app_name}"
19
- config.project_id = "souls-api"
21
+ config.project_id = "souls-app"
20
22
  config.strain = "#{service_name}"
21
23
  config.worker_endpoint = "https://worker.com"
22
24
  config.fixed_gems = ["excluded_gem"]
@@ -27,13 +29,59 @@ module Souls
27
29
  puts(e)
28
30
  end
29
31
 
32
+ def self.mother_config_init(app_name: "souls-app")
33
+ config_dir = "./#{app_name}/config"
34
+ FileUtils.mkdir_p(config_dir) unless Dir.exist?(config_dir)
35
+ FileUtils.touch("#{config_dir}/souls.rb")
36
+ file_path = "#{config_dir}/souls.rb"
37
+ File.open(file_path, "w") do |f|
38
+ f.write(<<~TEXT)
39
+ Souls.configure do |config|
40
+ config.app = "#{app_name}"
41
+ config.project_id = "souls-app"
42
+ config.strain = "mother"
43
+ config.api = true
44
+ config.worker = false
45
+ config.frontend = false
46
+ config.worker_endpoint = ""
47
+ config.fixed_gems = ["excluded_gem"]
48
+ end
49
+ TEXT
50
+ end
51
+ rescue StandardError => e
52
+ puts(e)
53
+ end
54
+
55
+ def self.return_method(args)
56
+ strains = %w[api worker console admin media doc].freeze
57
+ app_name = args[1]
58
+ if app_name.nil?
59
+ puts(Paint["you need to specify your app name", :red])
60
+ puts(Paint["`souls new souls-app`", :yellow])
61
+ exit
62
+ end
63
+
64
+ prompt = TTY::Prompt.new
65
+ choices = ["1. SOULs GraphQL API", "2. SOULs Pub/Sub Worker", "3. SOULs Frontend Web"]
66
+ choice_num = prompt.select(Paint["Select Strain: ", :cyan], choices)[0].to_i
67
+ case choice_num
68
+ when 1, 2
69
+ service_name = (strains[choice_num.to_i - 1]).to_s
70
+ Souls::Init.download_souls(app_name: app_name, service_name: service_name)
71
+ Souls::Init.mother_config_init(app_name: app_name)
72
+ Souls::Init.initial_config_init(app_name: app_name, service_name: service_name)
73
+ else
74
+ puts(Paint["Coming Soon...", :blue])
75
+ end
76
+ end
77
+
30
78
  def self.download_souls(app_name: "souls", service_name: "api")
31
79
  version = Souls.get_latest_version_txt(service_name: service_name).join(".")
32
80
  file_name = "#{service_name}-v#{version}.tgz"
33
81
  url = "https://storage.googleapis.com/souls-bucket/boilerplates/#{service_name.pluralize}/#{file_name}"
34
82
  system("curl -OL #{url}")
35
- system("mkdir -p #{app_name}/#{service_name}")
36
- system("tar -zxvf ./#{file_name} -C #{app_name}/")
83
+ system("mkdir -p #{app_name}/apps/#{service_name}")
84
+ system("tar -zxvf ./#{file_name} -C #{app_name}/apps/")
37
85
  FileUtils.rm(file_name)
38
86
  line = Paint["====================================", :yellow]
39
87
  puts("\n")
@@ -59,8 +107,53 @@ module Souls
59
107
  puts(line)
60
108
  endroll = <<~TEXT
61
109
  Easy to Run
62
- $ cd #{app_name}/#{service_name}
110
+ $ cd #{app_name}/app/#{service_name}
111
+ $ bundle
112
+ $ souls s
113
+ Go To : http://localhost:4000
114
+
115
+ Doc: https://souls.elsoul.nl
116
+ TEXT
117
+ cd = Paint[endroll, :white]
118
+ puts(cd)
119
+ puts(line)
120
+ end
121
+
122
+ def self.download_worker
123
+ version = Souls.get_latest_version_txt(service_name: "worker").join(".")
124
+ file_name = "worker-v#{version}.tgz"
125
+ url = "https://storage.googleapis.com/souls-bucket/boilerplates/workers/#{file_name}"
126
+ system("curl -OL #{url}")
127
+ system("mkdir -p ./apps/worker")
128
+ system("tar -zxvf ./#{file_name} -C ./apps/worker")
129
+ FileUtils.rm(file_name)
130
+ line = Paint["====================================", :yellow]
131
+ puts("\n")
132
+ puts(line)
133
+ txt2 = <<~TEXT
134
+ _____ ____ __ ____#{' '}
135
+ / ___// __ \\/ / / / / %{red1}
136
+ \\__ \\/ / / / / / / / %{red2}
137
+ ___/ / /_/ / /_/ / /___%{red3}#{' '}
138
+ /____/\\____/\\____/_____%{red4}#{' '}
139
+ TEXT
140
+ red1 = ["_____", :red]
141
+ red2 = ["/ ___/", :red]
142
+ red3 = ["(__ )", :red]
143
+ red4 = ["/____/", :red]
144
+ ms = Paint % [txt2, :cyan, { red1: red1, red2: red2, red3: red3, red4: red4 }]
145
+ puts(ms)
146
+ puts(line)
147
+ welcome = Paint["SOULs Worker Activated!", :white]
148
+ puts(welcome)
149
+ souls_ver = Paint["SOULs Version: #{Souls::VERSION}", :white]
150
+ puts(souls_ver)
151
+ puts(line)
152
+ endroll = <<~TEXT
153
+ Easy to Run
154
+ $ cd ./apps/worker
63
155
  $ bundle
156
+ $ souls model:update
64
157
  $ souls s
65
158
  Go To : http://localhost:3000
66
159
 
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.25.16".freeze
2
+ VERSION = "0.25.20".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.4.19
1
+ 0.4.23
@@ -1 +1 @@
1
- 0.4.19
1
+ 0.4.23
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.25.16
4
+ version: 0.25.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI
@@ -10,8 +10,36 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-07-28 00:00:00.000000000 Z
13
+ date: 2021-08-03 00:00:00.000000000 Z
14
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: activesupport
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - '='
20
+ - !ruby/object:Gem::Version
21
+ version: 6.1.4
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - '='
27
+ - !ruby/object:Gem::Version
28
+ version: 6.1.4
29
+ - !ruby/object:Gem::Dependency
30
+ name: dotenv
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - '='
34
+ - !ruby/object:Gem::Version
35
+ version: 2.7.6
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - '='
41
+ - !ruby/object:Gem::Version
42
+ version: 2.7.6
15
43
  - !ruby/object:Gem::Dependency
16
44
  name: paint
17
45
  requirement: !ruby/object:Gem::Requirement
@@ -55,9 +83,10 @@ dependencies:
55
83
  - !ruby/object:Gem::Version
56
84
  version: 0.3.0
57
85
  description: |-
58
- SOULs is a Serverless Application Framework.
59
- SOULs has four strains, API, Worker, Console, Media, and can be used in combination according to the purpose.
60
- SOULs Backend GraphQL Ruby & Frontend Relay are Scalable and Easy to deploy to Google Cloud and Amazon Web Services
86
+ SOULs is a Serverless Application Framework with Ruby GraphQL.
87
+ SOULs has 3 strains, API, Worker, and Frontend. It can be used in combination according to the purpose.
88
+ SOULs Ruby GraphQL API / Worker and Easy to deploy to Google Cloud. No more routing for Backends!
89
+ You can focus on your business logic.
61
90
  email:
62
91
  - f.kawasaki@elsoul.nl
63
92
  - s.kishi@elsoul.nl
@@ -123,8 +152,8 @@ requirements: []
123
152
  rubygems_version: 3.2.22
124
153
  signing_key:
125
154
  specification_version: 4
126
- summary: SOULs is a Serverless Application Framework. SOULs has four strains, API,
127
- Worker, Console, Media, and can be used in combination according to the purpose.
128
- SOULs Backend GraphQL Ruby & Frontend Relay are Scalable and Easy to deploy to Google
129
- Cloud and Amazon Web Services
155
+ summary: SOULs is a Serverless Application Framework with Ruby GraphQL. SOULs has
156
+ 3 strains, API, Worker, and Frontend. It can be used in combination according to
157
+ the purpose. SOULs Ruby GraphQL API / Worker and Easy to deploy to Google Cloud.
158
+ No more routing for Backends! You can focus on your business logic.
130
159
  test_files: []