isomorfeus 1.0.0.zeta25 → 2.0.0.rc1

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.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +21 -21
  3. data/README.md +26 -31
  4. data/bin/ismos +2 -2
  5. data/bin/isomorfeus +2 -3
  6. data/lib/isomorfeus/cli.rb +118 -31
  7. data/lib/isomorfeus/command.rb +29 -31
  8. data/lib/isomorfeus/console.rb +21 -21
  9. data/lib/isomorfeus/installer/bundle.rb +13 -0
  10. data/lib/isomorfeus/installer/dsl.rb +67 -0
  11. data/lib/isomorfeus/installer/gemfile.rb +39 -0
  12. data/lib/isomorfeus/installer/install_targets.rb +29 -0
  13. data/lib/isomorfeus/installer/new_project.rb +19 -56
  14. data/lib/isomorfeus/installer/options_mangler.rb +16 -16
  15. data/lib/isomorfeus/installer/rack_servers.rb +5 -11
  16. data/lib/isomorfeus/installer/target/web.rb +54 -0
  17. data/lib/isomorfeus/installer/templates/.gitignore.erb +25 -25
  18. data/lib/isomorfeus/installer/templates/Gemfile.erb +20 -36
  19. data/lib/isomorfeus/installer/templates/anonymous_policy.rb.erb +3 -3
  20. data/lib/isomorfeus/installer/templates/app_loader.rb.erb +8 -8
  21. data/lib/isomorfeus/installer/templates/config.ru.erb +23 -23
  22. data/lib/isomorfeus/installer/templates/hello_component.rb.erb +5 -5
  23. data/lib/isomorfeus/installer/templates/iodine.rb.erb +5 -0
  24. data/lib/isomorfeus/installer/templates/isomorfeus_loader.rb.erb +16 -16
  25. data/lib/isomorfeus/installer/templates/isomorfeus_web_worker_loader.rb.erb +2 -2
  26. data/lib/isomorfeus/installer/templates/{mail_components_loader.rb.erb → mail_loader.rb.erb} +18 -18
  27. data/lib/isomorfeus/installer/templates/mail_preview.mustache.erb +14 -0
  28. data/lib/isomorfeus/installer/templates/my_app.rb.erb +10 -10
  29. data/lib/isomorfeus/installer/templates/navigation_links.rb.erb +8 -8
  30. data/lib/isomorfeus/installer/templates/not_found_404_component.rb.erb +6 -6
  31. data/lib/isomorfeus/installer/templates/roda_app.rb.erb +71 -0
  32. data/lib/isomorfeus/installer/templates/spec_helper.rb.erb +19 -22
  33. data/lib/isomorfeus/installer/templates/web.mustache.erb +15 -0
  34. data/lib/isomorfeus/installer/templates/{test_spec.rb.erb → web_spec.rb.erb} +12 -12
  35. data/lib/isomorfeus/installer/templates/welcome_component.rb.erb +5 -5
  36. data/lib/isomorfeus/installer/test_app_files.rb +24 -0
  37. data/lib/isomorfeus/installer/upgrade.rb +11 -0
  38. data/lib/isomorfeus/installer.rb +57 -261
  39. data/lib/isomorfeus/version.rb +3 -3
  40. data/lib/isomorfeus.rb +10 -8
  41. metadata +68 -63
  42. data/bin/yandle +0 -9
  43. data/lib/isomorfeus/installer/databases/arangodb.rb +0 -13
  44. data/lib/isomorfeus/installer/templates/Procfile.erb +0 -1
  45. data/lib/isomorfeus/installer/templates/ProcfileDebug.erb +0 -3
  46. data/lib/isomorfeus/installer/templates/ProcfileDev.erb +0 -3
  47. data/lib/isomorfeus/installer/templates/app.rb.erb +0 -57
  48. data/lib/isomorfeus/installer/templates/application.css.erb +0 -0
  49. data/lib/isomorfeus/installer/templates/application.js.erb +0 -25
  50. data/lib/isomorfeus/installer/templates/application_common.js.erb +0 -17
  51. data/lib/isomorfeus/installer/templates/application_ssr.js.erb +0 -23
  52. data/lib/isomorfeus/installer/templates/application_web_worker.js.erb +0 -6
  53. data/lib/isomorfeus/installer/templates/arango_config.rb.erb +0 -20
  54. data/lib/isomorfeus/installer/templates/debug.js.erb +0 -131
  55. data/lib/isomorfeus/installer/templates/development.js.erb +0 -110
  56. data/lib/isomorfeus/installer/templates/development_ssr.js.erb +0 -115
  57. data/lib/isomorfeus/installer/templates/iodine_config.rb.erb +0 -14
  58. data/lib/isomorfeus/installer/templates/mail_components.js.erb +0 -23
  59. data/lib/isomorfeus/installer/templates/package.json.erb +0 -43
  60. data/lib/isomorfeus/installer/templates/production.js.erb +0 -100
@@ -1,11 +1,5 @@
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('iodine', {
7
- gems: [ { name: 'iodine', version: "~> 0.7.38", require: true } ],
8
- start_command: 'bundle exec iodine',
9
- init_template: 'iodine_config.rb.erb',
10
- rack_server_init: "require_relative 'iodine_config'"
11
- })
1
+ Isomorfeus::Installer.add_rack_server('iodine', {
2
+ gems: [ { name: 'iodine', version: "~> 0.7.44", require: true } ],
3
+ start_command: 'bundle exec iodine',
4
+ config_template: 'iodine.rb.erb'
5
+ })
@@ -0,0 +1,54 @@
1
+ module Isomorfeus
2
+ module Installer
3
+ module Target
4
+ class Web
5
+ extend Isomorfeus::Installer::DSL
6
+
7
+ class << self
8
+ def execute
9
+ install_roda_app
10
+ install_configuration
11
+ install_web_loaders
12
+ install_web_layouts
13
+ install_web_specs unless Isomorfeus::Installer.project_name == 'test_app'
14
+ end
15
+
16
+ # DSL
17
+
18
+ def install_roda_app
19
+ data_hash = { roda_app_class: Isomorfeus::Installer.roda_app_class, app_class: Isomorfeus::Installer.app_class }
20
+ create_file_from_template(templates_path, 'roda_app.rb.erb', File.join('app', 'server', Isomorfeus::Installer.roda_app_path + '.rb'), data_hash)
21
+ data_hash = { roda_app_class: Isomorfeus::Installer.roda_app_class, roda_app_path: Isomorfeus::Installer.roda_app_path }
22
+ create_file_from_template(templates_path, 'config.ru.erb', 'config.ru', data_hash)
23
+ create_file_from_template(templates_path, File.join('app_loader.rb.erb'), 'app_loader.rb', {})
24
+ create_file_from_template(templates_path, File.join('.gitignore.erb'), '.gitignore', {})
25
+ end
26
+
27
+ def install_configuration
28
+ create_file_from_template(templates_path, Isomorfeus::Installer.rack_server[:config_template], config_path(Isomorfeus::Installer.rack_server[:config_template][0..-5]), {})
29
+ data_hash = { app_class: Isomorfeus::Installer.app_class }
30
+ end
31
+
32
+ def install_web_layouts
33
+ copy_file(File.join(templates_path, 'web.mustache.erb'), File.join('app', 'layouts', 'web.mustache'))
34
+ copy_file(File.join(templates_path, 'mail_preview.mustache.erb'), File.join('app', 'layouts', 'mail_preview.mustache'))
35
+ end
36
+
37
+ def install_web_loaders
38
+ create_file_from_template(templates_path, 'isomorfeus_loader.rb.erb', File.join('app', 'isomorfeus_loader.rb'), {})
39
+ # create_file_from_template(templates_path, 'web_worker_loader.rb.erb', File.join('app', 'web_worker_loader.rb'), {})
40
+ create_file_from_template(templates_path, 'mail_loader.rb.erb', File.join('app', 'mail_loader.rb'), {})
41
+ end
42
+
43
+ def install_web_specs
44
+ create_file_from_template(templates_path, 'web_spec.rb.erb', File.join('spec', 'web_spec.rb'), {})
45
+ end
46
+
47
+ def templates_path
48
+ Isomorfeus::Installer.templates_path
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -1,25 +1,25 @@
1
- # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
- #
3
- # If you find yourself ignoring temporary files generated by your text editor
4
- # or operating system, you probably want to add a global ignore instead:
5
- # git config --global core.excludesfile '~/.gitignore_global'
6
-
7
- # Ignore bundler config.
8
- /.bundle
9
-
10
- # Ignore all logfiles and tempfiles.
11
- /log/*
12
- /tmp/*
13
- !/log/.keep
14
- !/tmp/.keep
15
-
16
- node_modules
17
- public/assets
18
-
19
- .byebug_history
20
-
21
- yarn-error.log
22
- yarn-debug.log*
23
- .yarn-integrity
24
-
25
- .DS_Store
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore all logfiles and tempfiles.
11
+ /log/*
12
+ /tmp/*
13
+ !/log/.keep
14
+ !/tmp/.keep
15
+
16
+ node_modules
17
+ public/assets
18
+
19
+ .byebug_history
20
+
21
+ yarn-error.log
22
+ yarn-debug.log*
23
+ .yarn-integrity
24
+
25
+ .DS_Store
@@ -1,36 +1,20 @@
1
- source 'https://rubygems.org'
2
- git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3
-
4
- <%= rack_server_gems %>
5
- gem 'foreman', require: false
6
-
7
- gem 'roda', '~> 3.27.0'
8
- gem 'opal', github: 'janbiedermann/opal', branch: 'es6_modules_1_1'
9
-
10
- <% if isomorfeus_version %>
11
- gem 'isomorfeus', <%= isomorfeus_version %>
12
- <% else %>
13
- gem 'isomorfeus-redux', '~> 4.0.22'
14
- gem 'isomorfeus-react', '>= 16.13.0'
15
- gem 'isomorfeus-policy', <%= isomorfeus_policy %>
16
- gem 'isomorfeus-transport', <%= isomorfeus_transport %>
17
- gem 'isomorfeus-i18n', <%= isomorfeus_i18n %>
18
- gem 'isomorfeus-data', <%= isomorfeus_data %>
19
- gem 'isomorfeus-operation', <%= isomorfeus_operation %>
20
- gem 'isomorfeus-mailer', <%= isomorfeus_mailer %>
21
- gem 'isomorfeus', <%= isomorfeus %>
22
- <% end %>
23
-
24
- group :development do
25
- gem 'debase'
26
- gem 'ruby-debug-ide'
27
- gem 'pry', '~> 0.12.2'
28
- gem 'pry-nav'
29
- gem 'pry-rescue'
30
- gem 'pry-stack_explorer'
31
- end
32
-
33
- group :test do
34
- gem 'rspec', '~> 3.8.0'
35
- gem 'isomorfeus-puppetmaster', '~> 0.3.5'
36
- end
1
+ source 'https://rubygems.org'
2
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3
+
4
+ gem 'wdm', '>= 0.1.1' if Gem.win_platform?
5
+ <%= rack_server_gems %>
6
+ gem 'roda', '~> 3.49.0'
7
+ gem 'opal', '~> 1.3.0'
8
+
9
+ <%= isomorfeus_gems %>
10
+
11
+ group :development do
12
+ gem 'pry', '~> 0.14.1'
13
+ gem 'pry-rescue'
14
+ gem 'pry-stack_explorer'
15
+ end
16
+
17
+ group :test do
18
+ gem 'rspec', '~> 3.8.0'
19
+ gem 'isomorfeus-puppetmaster', '~> 0.5.3'
20
+ end
@@ -1,3 +1,3 @@
1
- class AnonymousPolicy < LucidPolicy::Base
2
- allow all
3
- end
1
+ class AnonymousPolicy < LucidPolicy::Base
2
+ allow all
3
+ end
@@ -1,8 +1,8 @@
1
- require 'bundler/setup'
2
- if ENV['RACK_ENV'] && ENV['RACK_ENV'] == 'production'
3
- Bundler.require(:default, :production)
4
- elsif ENV['RACK_ENV'] && ENV['RACK_ENV'] == 'test'
5
- Bundler.require(:default, :test)
6
- else
7
- Bundler.require(:default, :development)
8
- end
1
+ require 'bundler/setup'
2
+ if ENV['RACK_ENV'] && ENV['RACK_ENV'] == 'production'
3
+ Bundler.require(:default, :production)
4
+ elsif ENV['RACK_ENV'] && ENV['RACK_ENV'] == 'test'
5
+ Bundler.require(:default, :test)
6
+ else
7
+ Bundler.require(:default, :development)
8
+ end
@@ -1,23 +1,23 @@
1
- require_relative '<%= app_require %>'
2
-
3
- if !Isomorfeus.development?
4
- Isomorfeus.zeitwerk.setup
5
- Isomorfeus.zeitwerk.eager_load
6
-
7
- run <%= app_class %>.freeze.app
8
- else
9
- Isomorfeus.zeitwerk.enable_reloading
10
- Isomorfeus.zeitwerk.setup
11
- Isomorfeus.zeitwerk.eager_load
12
-
13
- run ->(env) do
14
- write_lock = Isomorfeus.zeitwerk_lock.try_write_lock
15
- if write_lock
16
- Isomorfeus.zeitwerk.reload
17
- Isomorfeus.zeitwerk_lock.release_write_lock
18
- end
19
- Isomorfeus.zeitwerk_lock.with_read_lock do
20
- <%= app_class %>.call env
21
- end
22
- end
23
- end
1
+ require_relative 'app_loader'
2
+
3
+ if !Isomorfeus.development?
4
+ Isomorfeus.zeitwerk.setup
5
+ Isomorfeus.zeitwerk.eager_load
6
+
7
+ run <%= roda_app_class %>.freeze.app
8
+ else
9
+ Isomorfeus.zeitwerk.enable_reloading
10
+ Isomorfeus.zeitwerk.setup
11
+ Isomorfeus.zeitwerk.eager_load
12
+
13
+ run ->(env) do
14
+ write_lock = Isomorfeus.zeitwerk_lock.try_write_lock
15
+ if write_lock
16
+ Isomorfeus.zeitwerk.reload
17
+ Isomorfeus.zeitwerk_lock.release_write_lock
18
+ end
19
+ Isomorfeus.zeitwerk_lock.with_read_lock do
20
+ <%= roda_app_class %>.call env
21
+ end
22
+ end
23
+ end
@@ -1,6 +1,6 @@
1
- class HelloComponent < LucidComponent::Base
2
- render do
3
- DIV "Hello World!"
4
- NavigationLinks()
5
- end
1
+ class HelloComponent < LucidComponent::Base
2
+ render do
3
+ DIV "Hello World!"
4
+ NavigationLinks()
5
+ end
6
6
  end
@@ -0,0 +1,5 @@
1
+ require 'etc'
2
+ Iodine.threads = ENV['THREADS'] ? ENV['THREADS'].to_i : 4
3
+ Iodine.workers = ENV['WORKERS'] ? ENV['WORKERS'].to_i : Etc.nprocessors
4
+ Iodine::DEFAULT_SETTINGS[:address] = '127.0.0.1' if Gem.win_platform?
5
+ Iodine.patch_rack
@@ -1,16 +1,16 @@
1
- require 'opal'
2
- require 'isomorfeus-redux'
3
- require 'isomorfeus-react'
4
- require 'isomorfeus-policy'
5
- require 'isomorfeus-transport'
6
- require 'isomorfeus-data'
7
- require 'isomorfeus-i18n'
8
- require 'isomorfeus-operation'
9
-
10
- require_tree 'policies', :autoload
11
- require_tree 'channels', :autoload
12
- require_tree 'data', :autoload
13
- require_tree 'operations', :autoload
14
- require_tree 'components', :autoload
15
-
16
- Isomorfeus.start_app!
1
+ require 'opal'
2
+ require 'isomorfeus-redux'
3
+ require 'isomorfeus-preact'
4
+ require 'isomorfeus-policy'
5
+ require 'isomorfeus-transport'
6
+ require 'isomorfeus-data'
7
+ require 'isomorfeus-i18n'
8
+ require 'isomorfeus-operation'
9
+
10
+ require_tree 'policies', autoload: true
11
+ require_tree 'channels', autoload: true
12
+ require_tree 'data', autoload: true
13
+ require_tree 'operations', autoload: true
14
+ require_tree 'components', autoload: true
15
+
16
+ Isomorfeus.start_app!
@@ -1,2 +1,2 @@
1
- require 'opal'
2
- require 'zeitwerk'
1
+ require 'opal'
2
+ require 'zeitwerk'
@@ -1,18 +1,18 @@
1
- require 'opal'
2
- require 'isomorfeus-redux'
3
- require 'isomorfeus-react-material-ui'
4
- require 'isomorfeus-policy'
5
- require 'isomorfeus-transport'
6
- require 'isomorfeus-data'
7
- require 'isomorfeus-i18n'
8
- require 'isomorfeus-operation'
9
-
10
- require_tree 'policies', :autoload
11
- require_tree 'channels', :autoload
12
- require_tree 'data', :autoload
13
- require_tree 'operations', :autoload
14
- require_tree 'mail_components', :autoload
15
-
16
- Isomorfeus.zeitwerk.push_dir('mail_components')
17
-
18
- Isomorfeus.start_app!
1
+ require 'opal'
2
+ require 'isomorfeus-redux'
3
+ require 'isomorfeus-preact'
4
+ require 'isomorfeus-policy'
5
+ require 'isomorfeus-transport'
6
+ require 'isomorfeus-data'
7
+ require 'isomorfeus-i18n'
8
+ require 'isomorfeus-operation'
9
+
10
+ require_tree 'policies', autoload: true
11
+ require_tree 'channels', autoload: true
12
+ require_tree 'data', autoload: true
13
+ require_tree 'operations', autoload: true
14
+ require_tree 'mail_components', autoload: true
15
+
16
+ Isomorfeus.zeitwerk.push_dir('mail_components')
17
+
18
+ Isomorfeus.start_app!
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Mail preview of {{ component_class }}</title>
5
+ <meta charset="utf-8"/>
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+ <style id="jss-server-side" type="text/css">
8
+ {{& ssr_styles }}
9
+ </style>
10
+ </head>
11
+ <body>
12
+ {{& content }}
13
+ </body>
14
+ </html>
@@ -1,11 +1,11 @@
1
- class <%= app_class %> < LucidApp::Base
2
- render do
3
- Router(location: props.location) do
4
- Switch do
5
- Route(path: '/', exact: true, component: HelloComponent.JS[:react_component])
6
- Route(path: '/welcome', exact: true, component: WelcomeComponent.JS[:react_component])
7
- Route(component: NotFound404Component.JS[:react_component])
8
- end
9
- end
10
- end
1
+ class <%= app_class %> < LucidApp::Base
2
+ render do
3
+ Router(hook: Preact.location_hook(props.location)) do
4
+ Switch do
5
+ Route(path: '/', component: HelloComponent.JS[:preact_component])
6
+ Route(path: '/welcome', component: WelcomeComponent.JS[:preact_component])
7
+ Route(component: NotFound404Component.JS[:preact_component])
8
+ end
9
+ end
10
+ end
11
11
  end
@@ -1,9 +1,9 @@
1
- class NavigationLinks < LucidComponent::Base
2
- render do
3
- P do
4
- Link(to: '/') { 'Hello World!' }
5
- SPAN " | "
6
- Link(to: '/welcome') { 'Welcome!' }
7
- end
8
- end
1
+ class NavigationLinks < LucidComponent::Base
2
+ render do
3
+ P do
4
+ Link(to: '/') { 'Hello World!' }
5
+ SPAN " | "
6
+ Link(to: '/welcome') { 'Welcome!' }
7
+ end
8
+ end
9
9
  end
@@ -1,7 +1,7 @@
1
- class NotFound404Component < LucidComponent::Base
2
- render do
3
- Isomorfeus.ssr_response_status = 404 # keep
4
- P "Oops, page not found!"
5
- NavigationLinks()
6
- end
1
+ class NotFound404Component < LucidComponent::Base
2
+ render do
3
+ Isomorfeus.ssr_response_status = 404 # keep
4
+ P "Oops, page not found!"
5
+ NavigationLinks()
6
+ end
7
7
  end
@@ -0,0 +1,71 @@
1
+ Isomorfeus.load_configuration(File.expand_path(File.join(__dir__, '..', '..', 'config')))
2
+
3
+ class <%= roda_app_class %> < Roda
4
+ extend Isomorfeus::Transport::Middlewares
5
+ include Isomorfeus::PreactViewHelper
6
+
7
+ use_isomorfeus_middlewares
8
+
9
+ plugin :public, root: 'public', gzip: true
10
+
11
+ @@templates = {}
12
+ @@templates_path = File.expand_path(File.join(__dir__, '..', 'layouts'))
13
+
14
+ def locale
15
+ env.http_accept_language.preferred_language_from(Isomorfeus.available_locales) ||
16
+ env.http_accept_language.compatible_language_from(Isomorfeus.available_locales) ||
17
+ Isomorfeus.locale
18
+ end
19
+
20
+ def page_content(env, location)
21
+ if Isomorfeus.development?
22
+ req = Rack::Request.new(env)
23
+ skip_ssr = req.params.key?("skip_ssr") ? true : false
24
+ else
25
+ skip_ssr = false
26
+ end
27
+ mount_component('<%= app_class %>',{ location_host: env['HTTP_HOST'], location: location, locale: locale }, 'ssr.js', skip_ssr: skip_ssr)
28
+ end
29
+
30
+ def render(template_name, locals: {})
31
+ @@templates.delete(template_name) if Isomorfeus.development? # cause reloading of template in development environment
32
+ unless @@templates.key?(template_name)
33
+ @@templates[template_name] = Iodine::Mustache.new(File.join(@@templates_path, "#{template_name}.mustache"))
34
+ end
35
+ @@templates[template_name].render(locals)
36
+ end
37
+
38
+ route do |r|
39
+ r.root do
40
+ content = page_content(env, '/')
41
+ response.status = ssr_response_status
42
+ render('web', locals: { content: content, script_tag: script_tag('web.js'), ssr_styles: ssr_styles, title: 'Welcome to <%= app_class %>' })
43
+ end
44
+
45
+ r.public
46
+
47
+ r.get 'favicon.ico' do
48
+ r.public
49
+ end
50
+
51
+ r.get 'robots.txt' do
52
+ r.public
53
+ end
54
+
55
+ unless Isomorfeus.production?
56
+ r.on 'mail_preview', String do |component_name|
57
+ component_class = component_name.camelize
58
+ props = { location_host: env['HTTP_HOST'], location: '/mail_preview', locale: locale }.merge(r.params)
59
+ content = mount_component(component_class, props, 'mail_components.js')
60
+ response.status = ssr_response_status
61
+ render('mail_preview', locals: { content: content, component_class: component_class, ssr_styles: ssr_styles })
62
+ end
63
+ end
64
+
65
+ r.get do
66
+ content = page_content(env, env['PATH_INFO'])
67
+ response.status = ssr_response_status
68
+ render('web', locals: { content: content, script_tag: script_tag('web.js'), ssr_styles: ssr_styles, title: 'Welcome to <%= app_class %>' })
69
+ end
70
+ end
71
+ end
@@ -1,22 +1,19 @@
1
- ENV['NODE_PATH'] = File.join(File.expand_path('..', __dir__), 'node_modules')
2
- ENV['RACK_ENV'] = 'test'
3
- require 'bundler/setup'
4
- require 'rspec'
5
- require 'rspec/expectations'
6
- require 'isomorfeus-puppetmaster'
7
- require_relative '../<%= app_require %>'
8
-
9
- Isomorfeus.zeitwerk.setup
10
- Isomorfeus.zeitwerk.eager_load
11
-
12
- ASSETS_COMPILED ||= system('yarn run production_build')
13
-
14
- Isomorfeus::Puppetmaster.download_path = File.join(Dir.pwd, 'download_path_tmp')
15
- Isomorfeus::Puppetmaster.driver = :chromium
16
- Isomorfeus::Puppetmaster.server = :<%= rack_server %>
17
- Isomorfeus::Puppetmaster.app = <%= app_class %>
18
- Isomorfeus::Puppetmaster.boot_app
19
-
20
- RSpec.configure do |config|
21
- config.include Isomorfeus::Puppetmaster::DSL
22
- end
1
+ ENV['NODE_PATH'] = File.join(File.expand_path('..', __dir__), 'node_modules')
2
+ ENV['RACK_ENV'] = 'test'
3
+ require_relative '../app_loader'
4
+ require 'rspec'
5
+ require 'rspec/expectations'
6
+ require 'isomorfeus-puppetmaster'
7
+ require_relative '../app/server/<%= roda_app_path %>'
8
+
9
+ Isomorfeus.zeitwerk.setup
10
+ Isomorfeus.zeitwerk.eager_load
11
+
12
+ Isomorfeus::Puppetmaster.download_path = File.join(Dir.pwd, 'download_path_tmp')
13
+ Isomorfeus::Puppetmaster.driver = :chromium
14
+ Isomorfeus::Puppetmaster.app = <%= roda_app_class %>
15
+ Isomorfeus::Puppetmaster.boot_app
16
+
17
+ RSpec.configure do |config|
18
+ config.include Isomorfeus::Puppetmaster::DSL
19
+ end
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>{{ title }}</title>
5
+ <meta charset="utf-8"/>
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+ <style id="jss-server-side" type="text/css">
8
+ {{& ssr_styles }}
9
+ </style>
10
+ {{& script_tag }}
11
+ </head>
12
+ <body>
13
+ {{& content }}
14
+ </body>
15
+ </html>
@@ -1,13 +1,13 @@
1
- require 'spec_helper'
2
-
3
- RSpec.describe 'opal-webpack-loader compiled successfully' do
4
- it 'and opal code can be executed in the browser' do
5
- doc = visit('/')
6
- expect(doc.evaluate_script('1 + 4')).to eq(5)
7
- expect(doc.evaluate_script('typeof Opal')).to include('object')
8
- result = doc.evaluate_ruby do
9
- 1 + 5
10
- end
11
- expect(result).to eq(6)
12
- end
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe 'isomorfeus compiled successfully' do
4
+ it 'and opal code can be executed in the browser' do
5
+ doc = visit('/')
6
+ expect(doc.evaluate_script('1 + 4')).to eq(5)
7
+ expect(doc.evaluate_script('typeof Opal')).to include('object')
8
+ result = doc.evaluate_ruby do
9
+ 1 + 5
10
+ end
11
+ expect(result).to eq(6)
12
+ end
13
13
  end
@@ -1,6 +1,6 @@
1
- class WelcomeComponent < LucidComponent::Base
2
- render do
3
- DIV "Welcome!"
4
- NavigationLinks()
5
- end
1
+ class WelcomeComponent < LucidComponent::Base
2
+ render do
3
+ DIV "Welcome!"
4
+ NavigationLinks()
5
+ end
6
6
  end
@@ -0,0 +1,24 @@
1
+ module Isomorfeus
2
+ module Installer
3
+ module TestAppFiles
4
+ extend Isomorfeus::Installer::DSL
5
+
6
+ class << self
7
+ def execute
8
+ copy_test_app_files if Isomorfeus::Installer.source_dir
9
+ end
10
+
11
+ def copy_test_app_files
12
+ Dir.glob("#{Isomorfeus::Installer.source_dir}/**/*").each do |file|
13
+ if File.file?(file)
14
+ target_file = file[(Isomorfeus::Installer.source_dir.size+1)..-1]
15
+ target_dir = File.dirname(target_file)
16
+ Dir.mkdir(target_dir) unless Dir.exist?(target_dir)
17
+ copy_file(file, target_file)
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,11 @@
1
+ module Isomorfeus
2
+ module Installer
3
+ class Upgrade
4
+ class << self
5
+ def execute
6
+
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end