rhino_project_core 0.21.0.beta.16 → 0.21.0.beta.17
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/lib/generators/rhino/dev/setup/setup_generator.rb +5 -19
- data/lib/generators/rhino/dev/setup/templates/{env.server.tt → env.tt} +10 -3
- data/lib/rhino/version.rb +1 -1
- data/lib/tasks/rhino.rake +1 -1
- metadata +2 -4
- data/lib/generators/rhino/dev/setup/templates/env.client.tt +0 -4
- data/lib/generators/rhino/dev/setup/templates/env.root.tt +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc5c199628c33141e7e566807b3bc0df83aa7494660330e66586b51885756b1a
|
4
|
+
data.tar.gz: 91bebe3bfaadbfb349a44fa5f6d32260439313f9156d9a09ea61f60282b078a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fd1e29c9d4fe443341e14a843569c9d83e51fc4e84e69154c1e4008069d62ce52e5e0b9473571432130757c19f9e3552d27370a6317078e6935f17e5e73a48f
|
7
|
+
data.tar.gz: e7d931ec9a4a8b3063011583ad0dba6bcceb50b20fad041afb390ee30c44d2815f71f6429aebee1920aa01bf5099b73eebf32108a84e91526a30538bac5cc935
|
@@ -6,13 +6,11 @@ module Rhino
|
|
6
6
|
# rubocop:disable Metrics/ClassLength
|
7
7
|
class SetupGenerator < ::Rails::Generators::Base
|
8
8
|
DEFAULT_SERVER_PORT = 3000
|
9
|
-
DEFAULT_CLIENT_PORT = DEFAULT_SERVER_PORT + 1
|
10
9
|
|
11
10
|
class_option :prompt, type: :boolean, default: true, desc: "Prompt user for configuration options"
|
12
11
|
class_option :defaults, type: :string, enum: %w[local docker], default: "local", desc: "Use configuration defaults of type DEFAULTS"
|
13
12
|
class_option :skip_existing, type: :boolean, default: false, desc: "Skip existing env files"
|
14
13
|
class_option :server_port, type: :numeric, default: DEFAULT_SERVER_PORT, group: :server, desc: "Server port"
|
15
|
-
class_option :client_port, type: :numeric, default: DEFAULT_CLIENT_PORT, group: :client, desc: "Client port"
|
16
14
|
class_option :db_host, type: :string, group: :database
|
17
15
|
class_option :db_name, type: :string, group: :database
|
18
16
|
class_option :db_port, type: :numeric, default: 5432, group: :database
|
@@ -22,7 +20,6 @@ module Rhino
|
|
22
20
|
class_option :redis_database, type: :numeric, default: 0, group: :redis
|
23
21
|
|
24
22
|
attr_reader :server_port,
|
25
|
-
:client_port,
|
26
23
|
:db_name,
|
27
24
|
:db_host,
|
28
25
|
:db_port,
|
@@ -47,9 +44,7 @@ module Rhino
|
|
47
44
|
|
48
45
|
collect_env_info
|
49
46
|
|
50
|
-
template "env
|
51
|
-
template "env.server", server_file(".env")
|
52
|
-
template "env.client", client_file(".env")
|
47
|
+
template "env", project_file(".env")
|
53
48
|
end
|
54
49
|
|
55
50
|
def install_hooks
|
@@ -63,21 +58,13 @@ module Rhino
|
|
63
58
|
private
|
64
59
|
def project_dir
|
65
60
|
# Up one level from the server directory
|
66
|
-
Rails.root
|
67
|
-
end
|
68
|
-
|
69
|
-
def server_extension
|
70
|
-
Rails.root.basename.to_s.match(/[-_]?server/)[0]
|
61
|
+
Rails.root
|
71
62
|
end
|
72
63
|
|
73
64
|
def server_port_default
|
74
65
|
options[:server_port] || ENV["PORT"]
|
75
66
|
end
|
76
67
|
|
77
|
-
def client_port_default
|
78
|
-
@server_port.to_i + 1
|
79
|
-
end
|
80
|
-
|
81
68
|
def project_name
|
82
69
|
@project_name ||= File.basename(project_dir).sub(/[-_]?mono/, "")
|
83
70
|
end
|
@@ -87,7 +74,7 @@ module Rhino
|
|
87
74
|
|
88
75
|
return db_name if db_name.present?
|
89
76
|
|
90
|
-
File.basename(Rails.root
|
77
|
+
File.basename(Rails.root)
|
91
78
|
end
|
92
79
|
|
93
80
|
def db_host_default
|
@@ -99,7 +86,7 @@ module Rhino
|
|
99
86
|
end
|
100
87
|
|
101
88
|
def db_user_default
|
102
|
-
options[:db_user] || ENV["DB_USERNAME"] || `whoami
|
89
|
+
options[:db_user] || ENV["DB_USERNAME"] || `whoami`.strip
|
103
90
|
end
|
104
91
|
|
105
92
|
def db_password_default
|
@@ -125,8 +112,7 @@ module Rhino
|
|
125
112
|
def collect_env_info
|
126
113
|
collect_docker_info
|
127
114
|
|
128
|
-
@server_port = ask_prompt("
|
129
|
-
@client_port = ask_prompt("Client Port?", client_port_default)
|
115
|
+
@server_port = ask_prompt("Port?", server_port_default)
|
130
116
|
|
131
117
|
collect_database_info
|
132
118
|
collect_redis_info
|
@@ -1,7 +1,8 @@
|
|
1
1
|
PORT=<%= server_port %>
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
# Server
|
4
|
+
ROOT_URL=http://localhost:$PORT
|
5
|
+
FRONT_END_URL=http://localhost:$PORT
|
5
6
|
|
6
7
|
DB_NAME=<%= db_name %>
|
7
8
|
DB_HOST=<%= db_host %>
|
@@ -12,7 +13,10 @@ REDIS_HOST=<%= redis_host %>
|
|
12
13
|
REDIS_PORT=<%= redis_port %>
|
13
14
|
REDIS_DATABASE=<%= redis_database %>
|
14
15
|
|
15
|
-
#
|
16
|
+
# Client
|
17
|
+
VITE_API_ROOT_PATH=$ROOT_URL
|
18
|
+
|
19
|
+
# Production server:
|
16
20
|
SENDGRID_API_KEY=<api-key>
|
17
21
|
|
18
22
|
#AWS_ACCESS_KEY=
|
@@ -31,3 +35,6 @@ SENDGRID_API_KEY=<api-key>
|
|
31
35
|
#AUTH_GOOGLE_OAUTH2_SECRET_KEY=
|
32
36
|
|
33
37
|
ROLLBAR_ACCESS_TOKEN=
|
38
|
+
|
39
|
+
# Production client:
|
40
|
+
VITE_ROLLBAR_ACCESS_TOKEN=
|
data/lib/rhino/version.rb
CHANGED
data/lib/tasks/rhino.rake
CHANGED
@@ -9,7 +9,7 @@ namespace :rhino do
|
|
9
9
|
|
10
10
|
desc "Export Rhino Open API information for client"
|
11
11
|
task open_api_export: :environment do
|
12
|
-
static_file = Rails.root.
|
12
|
+
static_file = Rails.root.join("app", "frontend", "models", "static.js")
|
13
13
|
File.open(static_file, "w") do |f|
|
14
14
|
f.write "const api = #{Rhino::OpenApiInfo.index};\n\n"
|
15
15
|
f.write("export default api;\n")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rhino_project_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.21.0.beta.
|
4
|
+
version: 0.21.0.beta.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JP Rosevear
|
@@ -428,9 +428,7 @@ files:
|
|
428
428
|
- lib/commands/rhino/module/rails_command.rb
|
429
429
|
- lib/commands/rhino/module/test_command.rb
|
430
430
|
- lib/generators/rhino/dev/setup/setup_generator.rb
|
431
|
-
- lib/generators/rhino/dev/setup/templates/env.
|
432
|
-
- lib/generators/rhino/dev/setup/templates/env.root.tt
|
433
|
-
- lib/generators/rhino/dev/setup/templates/env.server.tt
|
431
|
+
- lib/generators/rhino/dev/setup/templates/env.tt
|
434
432
|
- lib/generators/rhino/dev/setup/templates/prepare-commit-msg
|
435
433
|
- lib/generators/rhino/install/install_generator.rb
|
436
434
|
- lib/generators/rhino/install/templates/account.rb
|
@@ -1 +0,0 @@
|
|
1
|
-
COMPOSE_PROJECT_NAME=<%= project_name %>
|