isomorfeus-installer 1.0.0.delta1 → 1.0.0.delta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +21 -0
- data/bin/isomorfeus +8 -122
- data/lib/isomorfeus/installer/cli.rb +26 -0
- data/lib/isomorfeus/installer/databases/arangodb.rb +4 -1
- data/lib/isomorfeus/installer/databases/mysql.rb +18 -2
- data/lib/isomorfeus/installer/databases/neo4j.rb +7 -2
- data/lib/isomorfeus/installer/databases/postgresql.rb +18 -2
- data/lib/isomorfeus/installer/databases/sqlite.rb +22 -0
- data/lib/isomorfeus/installer/new_project.rb +56 -0
- data/lib/isomorfeus/installer/options_mangler.rb +49 -0
- data/lib/isomorfeus/installer/other_modules.rb +11 -0
- data/lib/isomorfeus/installer/rack_servers.rb +19 -0
- data/{Gemfile → lib/isomorfeus/installer/templates/.gitkeep.erb} +0 -0
- data/lib/isomorfeus/installer/templates/Gemfile.erb +18 -8
- data/lib/isomorfeus/installer/templates/Procfile.erb +2 -2
- data/lib/isomorfeus/installer/templates/ProcfileDebug.erb +2 -0
- data/lib/isomorfeus/installer/templates/actioncable/actioncable_ru.erb +3 -0
- data/lib/isomorfeus/installer/templates/app.rb.erb +35 -0
- data/lib/isomorfeus/installer/templates/app_loader.rb.erb +13 -0
- data/lib/isomorfeus/installer/{spectre.rb → templates/application.css.erb} +0 -0
- data/lib/isomorfeus/installer/templates/application.js.erb +15 -23
- data/lib/isomorfeus/installer/templates/application_common.js.erb +23 -0
- data/lib/isomorfeus/installer/templates/application_debug.js.erb +9 -0
- data/lib/isomorfeus/installer/templates/application_ssr.js.erb +18 -0
- data/lib/isomorfeus/installer/templates/application_web_worker.js.erb +5 -0
- data/lib/isomorfeus/installer/templates/config_ru.erb +3 -0
- data/lib/isomorfeus/installer/templates/isomorfeus_loader.rb.erb +11 -2
- data/lib/isomorfeus/installer/templates/isomorfeus_web_worker_loader.rb.erb +2 -0
- data/lib/isomorfeus/installer/templates/my_app.rb.erb +1 -1
- data/lib/isomorfeus/installer/templates/package.json.erb +20 -6
- data/lib/isomorfeus/installer/templates/spec_helper.rb.erb +19 -0
- data/lib/isomorfeus/installer/templates/test_spec.rb.erb +13 -0
- data/lib/isomorfeus/installer/transport_stores/redis.rb +14 -0
- data/lib/isomorfeus/installer/transports/actioncable.rb +33 -1
- data/lib/isomorfeus/installer.rb +250 -130
- data/readme.md +2 -5
- metadata +125 -30
- data/isomorfeus-installer.gemspec +0 -19
- data/lib/isomorfeus/installer/asset_bundlers/opal_webpack_loader.rb +0 -103
- data/lib/isomorfeus/installer/databases/none.rb +0 -11
- data/lib/isomorfeus/installer/frameworks/cuba.rb +0 -26
- data/lib/isomorfeus/installer/frameworks/rails.rb +0 -78
- data/lib/isomorfeus/installer/frameworks/roda.rb +0 -26
- data/lib/isomorfeus/installer/frameworks/sinatra.rb +0 -26
- data/lib/isomorfeus/installer/templates/cuba/config_ru.erb +0 -48
- data/lib/isomorfeus/installer/templates/owl/development.js.erb +0 -145
- data/lib/isomorfeus/installer/templates/owl/production.js.erb +0 -93
- data/lib/isomorfeus/installer/templates/owl/test.js.erb +0 -0
- data/lib/isomorfeus/installer/templates/rails/application.html.erb.head +0 -6
- data/lib/isomorfeus/installer/templates/rails/application.html.erb.tail +0 -6
- data/lib/isomorfeus/installer/templates/rails/application_controller.rb +0 -5
- data/lib/isomorfeus/installer/templates/rails/application_helper.rb.erb +0 -3
- data/lib/isomorfeus/installer/templates/rails/assets.rb.erb +0 -1
- data/lib/isomorfeus/installer/templates/rails/basic-react.rb +0 -453
- data/lib/isomorfeus/installer/templates/rails/index.html +0 -1
- data/lib/isomorfeus/installer/templates/rails/routes.rb +0 -5
- data/lib/isomorfeus/installer/templates/roda/config_ru.erb +0 -39
- data/lib/isomorfeus/installer/templates/sinatra/config_ru.erb +0 -38
- data/lib/isomorfeus/installer/transport.rb +0 -0
- data/lib/isomorfeus/installer/transport_store.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69bf8e8210b4bb44900fb5caf50d46837bf730d9dddc574dd7a61c8bba96d656
|
4
|
+
data.tar.gz: 6ce7bb28e49a70321329f578afb616e27b2a39e542646908cf6f87fff2c1aab3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e9e2fc43e32dc72989749e9ec32f333a0a17c0db1d74e059625fd8c40b27dc0d42028fef6e3f9589942ee02416211d08e3d3cdb41dc0cc4c7c799ce8fed0094
|
7
|
+
data.tar.gz: bbfc5a95134c9474452beb5061b3e9c53c0a298139bc1fec37a994ba25b3fc4b802b99d090787fa3f14a3530748438e70689484955a202aa566bde57b273cec3
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2018, 2019 Jan Biedermann
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/bin/isomorfeus
CHANGED
@@ -1,10 +1,14 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require 'optparse'
|
4
3
|
require 'erb'
|
5
4
|
require 'active_support/core_ext/string'
|
6
|
-
|
5
|
+
require 'thor'
|
6
|
+
require 'opal-webpack-loader/installer_cli'
|
7
7
|
require_relative '../lib/isomorfeus/installer'
|
8
|
+
require_relative '../lib/isomorfeus/installer/rack_servers'
|
9
|
+
require_relative '../lib/isomorfeus/installer/other_modules'
|
10
|
+
require_relative '../lib/isomorfeus/installer/options_mangler'
|
11
|
+
require_relative '../lib/isomorfeus/installer/new_project'
|
8
12
|
|
9
13
|
Isomorfeus::Installer.module_directories.each do |mod_dir|
|
10
14
|
mod_path = File.realpath(File.join(Isomorfeus::Installer.base_path, mod_dir))
|
@@ -14,124 +18,6 @@ Isomorfeus::Installer.module_directories.each do |mod_dir|
|
|
14
18
|
end
|
15
19
|
end
|
16
20
|
|
17
|
-
|
18
|
-
sorted_frameworks = Isomorfeus::Installer.frameworks.keys.sort
|
19
|
-
sorted_asset_bundlers = Isomorfeus::Installer.asset_bundlers.keys
|
20
|
-
sorted_databases = Isomorfeus::Installer.databases.keys.sort
|
21
|
-
sorted_transports = Isomorfeus::Installer.transports.keys
|
22
|
-
|
23
|
-
OptionParser.new do |opts|
|
24
|
-
opts.banner = 'Usage: isomorfeus options...'
|
25
|
-
opts.separator ''
|
26
|
-
opts.separator 'Required:'
|
27
|
-
opts.on('-nNAME', '--new=NAME', String, "Create new project with NAME and install isomorfeus.") do |v|
|
28
|
-
options[:new] = v
|
29
|
-
end
|
30
|
-
# opts.on('-e', '--existing', "Install Isomorfeus into existing project.") do |v|
|
31
|
-
# options[:existing] = v
|
32
|
-
# end
|
33
|
-
opts.separator ''
|
34
|
-
opts.separator 'Also required in any case is:'
|
35
|
-
opts.on('-fNAME', '--framework=FRAMEWORK', String, :REQUIRED, "Select base Framework, one of: #{sorted_frameworks.join(', ')}.") do |v|
|
36
|
-
if sorted_frameworks.include?(v)
|
37
|
-
options[:framework] = v
|
38
|
-
Isomorfeus::Installer.framework = Isomorfeus::Installer.frameworks[v]&.fetch(:installer)
|
39
|
-
else
|
40
|
-
puts "Framework #{v} not available!"
|
41
|
-
exit 1
|
42
|
-
end
|
43
|
-
end
|
44
|
-
opts.separator ''
|
45
|
-
opts.separator 'Other options:'
|
46
|
-
opts.on('-aBUNDLER', '--asset-bundler=BUNDLER', String, "Select asset bundler, one of: #{sorted_asset_bundlers.join(', ')}. (optional)") do |v|
|
47
|
-
if sorted_asset_bundlers.include?(v)
|
48
|
-
options[:asset_bundler] = v
|
49
|
-
Isomorfeus::Installer.asset_bundler = Isomorfeus::Installer.asset_bundlers[v]&.fetch(:installer)
|
50
|
-
else
|
51
|
-
puts "Asset bundler #{v} not available!"
|
52
|
-
exit 1
|
53
|
-
end
|
54
|
-
end
|
55
|
-
# opts.on('-dDATABASE', '--database=DATABASE', String, "Select database, one of: #{sorted_databases.join(', ')}. (optional, default: none)") do |v|
|
56
|
-
# if sorted_frameworks.include?(v)
|
57
|
-
# options[:database] = v
|
58
|
-
# else
|
59
|
-
# puts "Database #{v} not available!"
|
60
|
-
# exit 1
|
61
|
-
# end
|
62
|
-
# end
|
63
|
-
# opts.on('-tTRANSPORT', '--transport=TRANSPORT', String, "Select transport, one of: #{sorted_transports.join(', ')}. (optional, default: actioncable)") do |v|
|
64
|
-
# if sorted_frameworks.include?(v)
|
65
|
-
# options[:database] = v
|
66
|
-
# else
|
67
|
-
# puts "Database #{v} not available!"
|
68
|
-
# exit 1
|
69
|
-
# end
|
70
|
-
# end
|
71
|
-
|
72
|
-
opts.separator ''
|
73
|
-
opts.on("-h", "--help", "Prints this help") do
|
74
|
-
puts opts
|
75
|
-
exit
|
76
|
-
end
|
77
|
-
end.parse!
|
78
|
-
|
79
|
-
Isomorfeus::Installer.options = options
|
80
|
-
Isomorfeus::Installer.structure= Isomorfeus::Installer.frameworks[options[:framework]][:structure]
|
81
|
-
|
82
|
-
if options[:new] && options[:existing]
|
83
|
-
puts "Either choose a new installation (-n), or installation into a existing project (-e), both won't work!"
|
84
|
-
end
|
85
|
-
if !options[:new] && !options[:existing]
|
86
|
-
puts "Don't know what to do! Either choose a new installation (-n), or installation into a existing project (-e)."
|
87
|
-
end
|
21
|
+
require_relative '../lib/isomorfeus/installer/cli'
|
88
22
|
|
89
|
-
|
90
|
-
begin
|
91
|
-
if Isomorfeus::Installer.framework.respond_to?(:create_project)
|
92
|
-
Isomorfeus::Installer.framework.create_project(options[:new])
|
93
|
-
else
|
94
|
-
Dir.mkdir(options[:new])
|
95
|
-
end
|
96
|
-
Dir.chdir(options[:new])
|
97
|
-
rescue
|
98
|
-
puts "Directory #{options[:new]} could not be created!"
|
99
|
-
exit 1
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
root = Dir.open('.')
|
104
|
-
|
105
|
-
begin
|
106
|
-
Isomorfeus::Installer.create_directories
|
107
|
-
Isomorfeus::Installer.framework.install(root)
|
108
|
-
Isomorfeus::Installer.asset_bundler&.install(root)
|
109
|
-
|
110
|
-
camelized_dir = if options[:new]
|
111
|
-
options[:new].camelize
|
112
|
-
else
|
113
|
-
File.split(File.realpath(Dir.new('.'))).last.camelize
|
114
|
-
end
|
115
|
-
|
116
|
-
app_name = camelized_dir + 'App'
|
117
|
-
component_name = camelized_dir + 'Component'
|
118
|
-
|
119
|
-
Isomorfeus::Installer.create_loader(app_name)
|
120
|
-
Isomorfeus::Installer.create_toplevel(app_name, component_name)
|
121
|
-
Isomorfeus::Installer.create_component(component_name)
|
122
|
-
|
123
|
-
Isomorfeus::Installer.create_entrypoint
|
124
|
-
Isomorfeus::Installer.create_package_json
|
125
|
-
Isomorfeus::Installer.create_gemfile(Isomorfeus::Installer.frameworks[options[:framework]][:gems],
|
126
|
-
Isomorfeus::Installer.asset_bundlers[options[:asset_bundler]]&.fetch(:gems))
|
127
|
-
Isomorfeus::Installer.create_procfile
|
128
|
-
|
129
|
-
puts 'Installation finished, make your dreams come true :)'
|
130
|
-
puts
|
131
|
-
puts 'But first execute in the project directory:'
|
132
|
-
puts 'bundle install'
|
133
|
-
puts 'yarn install (or npm install)'
|
134
|
-
rescue Exception => e
|
135
|
-
puts e.backtrace.join("\n")
|
136
|
-
puts "Installation failed: #{e.message}"
|
137
|
-
end
|
23
|
+
Isomorfeus::Installer::CLI.start(ARGV)
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Isomorfeus
|
2
|
+
module Installer
|
3
|
+
class CLI < Thor
|
4
|
+
|
5
|
+
desc "new project_name", "create a new isomorfeus project with project_name"
|
6
|
+
|
7
|
+
option :database, required: false, aliases: '-d',
|
8
|
+
desc: "Select database, one of: #{Isomorfeus::Installer.sorted_databases.join(', ')}. (optional, requires transport)"
|
9
|
+
option :i18n, default: false, type: :boolean, aliases: '-i', desc: "Use i18n module. (optional, requires transport)"
|
10
|
+
option :operation, default: false, type: :boolean, aliases: '-o', desc: "Use operation module. (optional, requires transport)"
|
11
|
+
option :policy, default: false, type: :boolean, aliases: '-p', desc: "Use policy module. (optional, requires transport)"
|
12
|
+
option :rack_server, default: 'puma', aliases: '-r',
|
13
|
+
desc: "Select rack server, one of: #{Isomorfeus::Installer.sorted_rack_servers.join(', ')}. (optional, default: puma)"
|
14
|
+
option :transport, required: false, aliases: '-t',
|
15
|
+
desc: "Select transport, one of: #{Isomorfeus::Installer.sorted_transports.join(', ')}. (optional if no other features that depend on a transport are used)"
|
16
|
+
option :transport_store, required: false, aliases: '-e',
|
17
|
+
desc: "Select transport store, one of: #{Isomorfeus::Installer.sorted_transport_stores.join(', ')}. (optional with no transport, required if a transport is used)"
|
18
|
+
|
19
|
+
def new(project_name)
|
20
|
+
Isomorfeus::Installer.set_project_names(project_name)
|
21
|
+
Isomorfeus::Installer.options = options
|
22
|
+
Isomorfeus::Installer::NewProject.execute
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -8,4 +8,7 @@ module Isomorfeus
|
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
-
Isomorfeus::Installer.add_database('arangodb',
|
11
|
+
Isomorfeus::Installer.add_database('arangodb',
|
12
|
+
gems: [ { name: 'isomorfeus-record', version: "~> #{Isomorfeus::Installer::VERSION}" },
|
13
|
+
{ name: 'isomorfeus-record-arango', version: "~> #{Isomorfeus::Installer::VERSION}" } ],
|
14
|
+
installer: Isomorfeus::Installer::Databases::ArangoDB)
|
@@ -2,10 +2,26 @@ module Isomorfeus
|
|
2
2
|
module Installer
|
3
3
|
module Databases
|
4
4
|
module MySQL
|
5
|
-
|
5
|
+
def self.configuration
|
6
|
+
<<~CONFIG
|
7
|
+
Isomorfeus.activerecord_connection = {
|
8
|
+
adapter: 'mysql',
|
9
|
+
database: '#{Installer.project_name}_development',
|
10
|
+
username: '#{Installer.project_name}_user',
|
11
|
+
password: '#{Installer.project_name}_password',
|
12
|
+
host: 'localhost',
|
13
|
+
encoding: 'utf8',
|
14
|
+
pool: 5
|
15
|
+
}
|
16
|
+
CONFIG
|
17
|
+
end
|
6
18
|
end
|
7
19
|
end
|
8
20
|
end
|
9
21
|
end
|
10
22
|
|
11
|
-
Isomorfeus::Installer.add_database('mysql',
|
23
|
+
Isomorfeus::Installer.add_database('mysql',
|
24
|
+
gems: [ { name: 'mysql2', version: '~> 0.5.2' },
|
25
|
+
{ name: 'isomorfeus-record', version: "~> #{Isomorfeus::Installer::VERSION}" },
|
26
|
+
{ name: 'isomorfeus-record-activerecord', version: "~> #{Isomorfeus::Installer::VERSION}" } ],
|
27
|
+
installer: Isomorfeus::Installer::Databases::MySQL)
|
@@ -2,10 +2,15 @@ module Isomorfeus
|
|
2
2
|
module Installer
|
3
3
|
module Databases
|
4
4
|
module Neo4j
|
5
|
-
|
5
|
+
def self.configuration
|
6
|
+
"Isomorfeus.neo4j_connection_uri = 'http://neo4j:neo4j@localhost:7474'"
|
7
|
+
end
|
6
8
|
end
|
7
9
|
end
|
8
10
|
end
|
9
11
|
end
|
10
12
|
|
11
|
-
Isomorfeus::Installer.add_database('neo4j',
|
13
|
+
Isomorfeus::Installer.add_database('neo4j',
|
14
|
+
gems: [ { name: 'isomorfeus-record', version: "~> #{Isomorfeus::Installer::VERSION}" },
|
15
|
+
{ name: 'isomorfeus-record-neo4j', version: "~> #{Isomorfeus::Installer::VERSION}" } ],
|
16
|
+
installer: Isomorfeus::Installer::Databases::Neo4j)
|
@@ -2,10 +2,26 @@ module Isomorfeus
|
|
2
2
|
module Installer
|
3
3
|
module Databases
|
4
4
|
module PostgreSQL
|
5
|
-
|
5
|
+
def self.configuration
|
6
|
+
<<~CONFIG
|
7
|
+
Isomorfeus.activerecord_connection = {
|
8
|
+
adapter: 'postgres',
|
9
|
+
database: '#{Installer.project_name}_development',
|
10
|
+
username: '#{Installer.project_name}_user',
|
11
|
+
password: '#{Installer.project_name}_password',
|
12
|
+
host: 'localhost',
|
13
|
+
encoding: 'utf8',
|
14
|
+
pool: 5
|
15
|
+
}
|
16
|
+
CONFIG
|
17
|
+
end
|
6
18
|
end
|
7
19
|
end
|
8
20
|
end
|
9
21
|
end
|
10
22
|
|
11
|
-
Isomorfeus::Installer.add_database('postgresql',
|
23
|
+
Isomorfeus::Installer.add_database('postgresql',
|
24
|
+
gems: [ { name: 'postgres', version: '~> 0.8.1' },
|
25
|
+
{ name: 'isomorfeus-record', version: "~> #{Isomorfeus::Installer::VERSION}" },
|
26
|
+
{ name: 'isomorfeus-record-activerecord', version: "~> #{Isomorfeus::Installer::VERSION}" } ],
|
27
|
+
installer: Isomorfeus::Installer::Databases::PostgreSQL)
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Isomorfeus
|
2
|
+
module Installer
|
3
|
+
module Databases
|
4
|
+
module SQLite
|
5
|
+
def self.configuration
|
6
|
+
<<~CONFIG
|
7
|
+
Isomorfeus.activerecord_connection = {
|
8
|
+
adapter: 'sqlite3',
|
9
|
+
database: '#{Installer.project_name}_development.db'
|
10
|
+
}
|
11
|
+
CONFIG
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
Isomorfeus::Installer.add_database('sqlite',
|
19
|
+
gems: [ { name: 'sqlite3', version: '~> 1.3.13' },
|
20
|
+
{ name: 'isomorfeus-record', version: "~> #{Isomorfeus::Installer::VERSION}" },
|
21
|
+
{ name: 'isomorfeus-record-activerecord', version: "~> #{Isomorfeus::Installer::VERSION}" } ],
|
22
|
+
installer: Isomorfeus::Installer::Databases::SQLite)
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'opal-webpack-loader/installer_cli'
|
2
|
+
require 'opal-webpack-loader/version'
|
3
|
+
|
4
|
+
module Isomorfeus
|
5
|
+
module Installer
|
6
|
+
class NewProject
|
7
|
+
attr_reader :installer
|
8
|
+
|
9
|
+
def self.installer
|
10
|
+
Isomorfeus::Installer
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.execute
|
14
|
+
begin
|
15
|
+
Dir.mkdir(installer.project_name)
|
16
|
+
Dir.chdir(installer.project_name)
|
17
|
+
rescue
|
18
|
+
puts "Directory #{installer.project_name} could not be created!"
|
19
|
+
exit 1
|
20
|
+
end
|
21
|
+
|
22
|
+
root = Dir.open('.')
|
23
|
+
|
24
|
+
begin
|
25
|
+
Isomorfeus::Installer.create_directories
|
26
|
+
Isomorfeus::Installer.install_framework
|
27
|
+
|
28
|
+
OpalWebpackLoader::Installer::CLI.start(['iso'])
|
29
|
+
|
30
|
+
Isomorfeus::Installer.install_styles
|
31
|
+
Isomorfeus::Installer.install_js_entries
|
32
|
+
Isomorfeus::Installer.install_isomorfeus_entries
|
33
|
+
|
34
|
+
Isomorfeus::Installer.create_toplevel
|
35
|
+
Isomorfeus::Installer.create_component
|
36
|
+
Isomorfeus::Installer.create_spec
|
37
|
+
|
38
|
+
Isomorfeus::Installer.transport&.install(root)
|
39
|
+
|
40
|
+
Isomorfeus::Installer.create_package_json
|
41
|
+
Isomorfeus::Installer.create_gemfile
|
42
|
+
Isomorfeus::Installer.create_procfile
|
43
|
+
|
44
|
+
`bundle install`
|
45
|
+
`yarn install`
|
46
|
+
|
47
|
+
Dir.chdir('..')
|
48
|
+
puts 'Installation finished, make your dreams come true :)'
|
49
|
+
rescue Exception => e
|
50
|
+
puts e.backtrace.join("\n")
|
51
|
+
puts "Installation failed: #{e.message}"
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module Isomorfeus
|
2
|
+
module Installer
|
3
|
+
module OptionsMangler
|
4
|
+
def self.installer
|
5
|
+
Isomorfeus::Installer
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.mangle_options(options)
|
9
|
+
if options.key?(:database)
|
10
|
+
if installer.sorted_databases.include?(options[:database])
|
11
|
+
installer.database = installer.databases[options[:database]]&.fetch(:installer)
|
12
|
+
else
|
13
|
+
puts "Database #{options[:database]} not available!"; exit 1
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
if options.key?(:transport) && !options.key?(:transport_store)
|
18
|
+
puts "A transport store (-s) is required when using a transport."
|
19
|
+
exit 1
|
20
|
+
elsif options.key?(:transport_store) && !options.key?(:transport)
|
21
|
+
puts "A transport (-t) is required when using a transport store."
|
22
|
+
exit 1
|
23
|
+
end
|
24
|
+
|
25
|
+
if options.key?(:transport_store)
|
26
|
+
if installer.sorted_transport_stores.include?(options[:transport_store])
|
27
|
+
installer.transport_store = installer.transport_stores[options[:transport_store]]&.fetch(:installer)
|
28
|
+
else
|
29
|
+
puts "Transport store #{options[:transport_store]} not available!"; exit 1
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
if options.key?(:transport)
|
34
|
+
if installer.sorted_transports.include?(options[:transport])
|
35
|
+
installer.transport = installer.transports[options[:transport]]&.fetch(:installer)
|
36
|
+
else
|
37
|
+
puts "Transport #{options[:transport]} not available!"; exit 1
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
if options.key?(:rack_server) && installer.sorted_rack_servers.include?(options[:rack_server])
|
42
|
+
installer.rack_server = installer.rack_servers[options[:rack_server]]
|
43
|
+
else
|
44
|
+
installer.rack_server = installer.rack_servers['puma']
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Isomorfeus::Installer.add_i18n_module('i18n', {
|
2
|
+
gems: [ { name: 'isomorfeus-i18n', version: "~> #{Isomorfeus::Installer::VERSION}" } ]
|
3
|
+
})
|
4
|
+
|
5
|
+
Isomorfeus::Installer.add_operation_module('operation', {
|
6
|
+
gems: [ { name: 'isomorfeus-operation', version: "~> #{Isomorfeus::Installer::VERSION}" } ]
|
7
|
+
})
|
8
|
+
|
9
|
+
Isomorfeus::Installer.add_policy_module('policy', {
|
10
|
+
gems: [ { name: 'isomorfeus-policy', version: "~> #{Isomorfeus::Installer::VERSION}" } ]
|
11
|
+
})
|
@@ -0,0 +1,19 @@
|
|
1
|
+
Isomorfeus::Installer.add_rack_server('agoo', {
|
2
|
+
gems: [ { name: 'agoo', version: "~> 2.8.3" } ],
|
3
|
+
start_command: 'bundle exec rackup -s agoo'
|
4
|
+
})
|
5
|
+
|
6
|
+
Isomorfeus::Installer.add_rack_server('falcon', {
|
7
|
+
gems: [ { name: 'falcon', version: "~> 0.30.0", require: false } ],
|
8
|
+
start_command: 'bundle exec falcon serve'
|
9
|
+
})
|
10
|
+
|
11
|
+
Isomorfeus::Installer.add_rack_server('iodine', {
|
12
|
+
gems: [ { name: 'falcon', version: "~> 0.7.31", require: false } ],
|
13
|
+
start_command: 'bundle exec iodine'
|
14
|
+
})
|
15
|
+
|
16
|
+
Isomorfeus::Installer.add_rack_server('puma', {
|
17
|
+
gems: [ { name: 'puma', version: "~> 3.12.1", require: false } ],
|
18
|
+
start_command: 'bundle exec puma'
|
19
|
+
})
|
File without changes
|
@@ -1,15 +1,25 @@
|
|
1
|
-
<% if !defined? skip_header %>
|
2
1
|
source 'https://rubygems.org'
|
3
2
|
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
4
|
-
<% end %>
|
5
3
|
|
6
|
-
<%=
|
7
|
-
gem 'foreman'
|
4
|
+
<%= rack_server_gems %>
|
5
|
+
gem 'foreman', require: false
|
8
6
|
|
9
|
-
gem '
|
7
|
+
gem 'roda', '~> 3.19.0'
|
10
8
|
|
11
|
-
|
9
|
+
gem 'opal', github: 'janbiedermann/opal', branch: 'es6_modules_1_1'
|
10
|
+
gem 'opal-activesupport', github: 'janbiedermann/opal-activesupport', branch: 'relax'
|
11
|
+
gem 'opal-webpack-loader', '~> 0.8.3'
|
12
12
|
|
13
13
|
gem 'opal-autoloader', '~> 0.0.3'
|
14
|
-
gem 'isomorfeus-redux', '~> 4.0.
|
15
|
-
gem 'isomorfeus-react', '~> 16.6.
|
14
|
+
gem 'isomorfeus-redux', '~> 4.0.2'
|
15
|
+
gem 'isomorfeus-react', '~> 16.6.3'
|
16
|
+
#<%= transport_gems %>
|
17
|
+
#<%= database_gems %>
|
18
|
+
#<%= policy_gems %>
|
19
|
+
#<%= operation_gems %>
|
20
|
+
#<%= i18n_gems %>
|
21
|
+
|
22
|
+
group :test do
|
23
|
+
gem 'rspec', '~> 3.6.0'
|
24
|
+
gem 'isomorfeus-puppetmaster', '~> 0.2.2'
|
25
|
+
end
|
@@ -1,2 +1,2 @@
|
|
1
|
-
web: <%=
|
2
|
-
|
1
|
+
web: <%= rack_server_start_command %>
|
2
|
+
webpack: bundle exec yarn run development
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require './app_loader'
|
2
|
+
require './owl_init'
|
3
|
+
<%= isomorfeus_config %>
|
4
|
+
<% if use_transport %><%= transport_config %><% end %>
|
5
|
+
|
6
|
+
class <%= app_class %> < Roda
|
7
|
+
include OpalWebpackLoader::ViewHelper
|
8
|
+
plugin :public, root: 'public'
|
9
|
+
|
10
|
+
def default_content
|
11
|
+
<<~HTML
|
12
|
+
<html>
|
13
|
+
<head>
|
14
|
+
<title>Welcome to <%= app_class %></title>
|
15
|
+
#{owl_script_tag 'application.js'}
|
16
|
+
</head>
|
17
|
+
<body>
|
18
|
+
<div></div>
|
19
|
+
</body>
|
20
|
+
</html>
|
21
|
+
HTML
|
22
|
+
end
|
23
|
+
|
24
|
+
route do |r|
|
25
|
+
r.root do
|
26
|
+
default_content
|
27
|
+
end
|
28
|
+
|
29
|
+
r.public
|
30
|
+
|
31
|
+
r.get do
|
32
|
+
default_content
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'bundler/setup'
|
2
|
+
if ENV['<%= project_env %>'] && ENV['<%= project_env %>'] == 'production'
|
3
|
+
ENV['OWL_ENV'] = 'production'
|
4
|
+
Bundler.require(:default, :production)
|
5
|
+
elsif ENV['<%= project_env %>'] && ENV['<%= project_env %>'] == 'test'
|
6
|
+
ENV['OWL_ENV'] = 'production'
|
7
|
+
Bundler.require(:default, :test)
|
8
|
+
else
|
9
|
+
ENV['OWL_ENV'] = 'development'
|
10
|
+
Bundler.require(:default, :development)
|
11
|
+
end
|
12
|
+
|
13
|
+
Opal.append_path(File.expand_path('isomorfeus'))
|
File without changes
|
@@ -1,29 +1,21 @@
|
|
1
|
-
|
2
|
-
import
|
3
|
-
import
|
4
|
-
// import * as History from 'history';
|
5
|
-
import * as ReactRouter from 'react-router';
|
6
|
-
import * as ReactRouterDOM from 'react-router-dom';
|
7
|
-
import { BrowserRouter, Link, NavLink, Route, Switch } from 'react-router-dom';
|
1
|
+
// entry file for the browser environment
|
2
|
+
// import stylesheets here
|
3
|
+
import '../styles/application.css';
|
8
4
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
//
|
13
|
-
|
14
|
-
|
15
|
-
global.
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
5
|
+
// import npm modules that are valid to use only in the browser
|
6
|
+
// for example modules which depend on the window or document objects of the browser
|
7
|
+
//
|
8
|
+
// example:
|
9
|
+
//
|
10
|
+
// import ReactDOM from 'react-dom';
|
11
|
+
// global.ReactDOM = ReactDOM;
|
12
|
+
|
13
|
+
// import modules common to browser and server side rendering (ssr)
|
14
|
+
// environments from application_common.js
|
15
|
+
import './application_common.js';
|
20
16
|
|
21
17
|
import init_app from 'isomorfeus_loader.rb';
|
22
18
|
init_app();
|
23
19
|
Opal.load('isomorfeus_loader');
|
24
20
|
|
25
|
-
if (module.hot) {
|
26
|
-
module.hot.accept('./application.js', function() {
|
27
|
-
console.log('Accepting the updated application.js!');
|
28
|
-
})
|
29
|
-
}
|
21
|
+
if (module.hot) { module.hot.accept(); }
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import * as Redux from 'redux';
|
2
|
+
import React from 'react';
|
3
|
+
import ReactDOM from 'react-dom';
|
4
|
+
// import * as History from 'history';
|
5
|
+
import * as ReactRouter from 'react-router';
|
6
|
+
import * as ReactRouterDOM from 'react-router-dom';
|
7
|
+
import { BrowserRouter, Link, NavLink, Route, Switch } from 'react-router-dom';
|
8
|
+
<% if use_transport %><%= transport_import %><% end %>
|
9
|
+
|
10
|
+
global.Redux = Redux;
|
11
|
+
global.React = React;
|
12
|
+
global.ReactDOM = ReactDOM;
|
13
|
+
// global.History = History;
|
14
|
+
global.ReactRouter = ReactRouter;
|
15
|
+
global.ReactRouterDOM = ReactRouterDOM;
|
16
|
+
global.BrowserRouter = BrowserRouter;
|
17
|
+
global.Link = Link;
|
18
|
+
global.NavLink = NavLink;
|
19
|
+
global.Route = Route;
|
20
|
+
global.Switch = Switch;
|
21
|
+
<% if use_transport %><%= transport_global %><% end %>
|
22
|
+
|
23
|
+
if (module.hot) { module.hot.accept(); }
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// entry file for the server side rendering environment (ssr)
|
2
|
+
// import npm modules that are only valid to use in the server side rendering environment
|
3
|
+
// for example modules which depend on objects provided by node js
|
4
|
+
//
|
5
|
+
// example:
|
6
|
+
//
|
7
|
+
// import ReactDOMServer from 'react-dom/server';
|
8
|
+
// global.ReactDOMServer = ReactDOMServer;
|
9
|
+
|
10
|
+
// import modules common to browser and server side rendering (ssr)
|
11
|
+
// environments from application_common.js
|
12
|
+
import './application_common.js';
|
13
|
+
|
14
|
+
import init_app from 'isomorfeus_loader.rb';
|
15
|
+
init_app();
|
16
|
+
Opal.load('isomorfeus_loader');
|
17
|
+
|
18
|
+
if (module.hot) { module.hot.accept(); }
|