isomorfeus-installer 1.0.0.delta4 → 1.0.0.delta5

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: a9f3de9a3999445ae6d8e6a83ac0a3ee219d248bd7ba35d53aae9e7dbb12e044
4
- data.tar.gz: 8d7556c94f6e1fdabb7fad5006d9f2e81303b278e9a23eae0c378e3468b1e7fe
3
+ metadata.gz: 89fd88f2efa8426050297e4c76008dc3a39f2da525de0f6ba5a981028fc91789
4
+ data.tar.gz: 3f4b2280ad497b22bbffbe5086e10a8b8250c0f5f122bbc39daa867e1ae3ac64
5
5
  SHA512:
6
- metadata.gz: 5c2f308f17c9857a689f7b86188fd4831407c65f4dda6f307cbb1de4a1e167ba6428ca3b915bfc2c6c7c0702e28d911ce212e281596079909a9cf0dbba41c00b
7
- data.tar.gz: 57b6e511e8bb7d744efad79be36ee95b347dd05bbc7e7336b0fb5748d4822dfee36a2f7fc0e786f33cf143e86bf5d6f6d2a66ae0db689525b1dcf75ec18915d0
6
+ metadata.gz: d471eec7ed038d9d4ebd373574f4b85015e569d2a51f42aae99bdd9f5842737fd2a369ed4296bdc06f6bfdec8685ce31f7649b7d315278c2a76ee46618539af1
7
+ data.tar.gz: 3738a536c30151c8c1fff80132c5e92a279266ca0eccdef0f409029214ca2b353ea99cbc429e71b72e9050b5377eb65a951cd0b1029b856a6681799a5811378b
@@ -31,8 +31,7 @@ module Isomorfeus
31
31
  Isomorfeus::Installer.install_js_entries
32
32
  Isomorfeus::Installer.install_isomorfeus_entries
33
33
 
34
- Isomorfeus::Installer.create_toplevel
35
- Isomorfeus::Installer.create_component
34
+ Isomorfeus::Installer.create_components
36
35
  Isomorfeus::Installer.create_spec
37
36
 
38
37
  Isomorfeus::Installer.transport&.install(root)
@@ -8,17 +8,21 @@ gem 'roda', '~> 3.19.0'
8
8
 
9
9
  gem 'opal', github: 'janbiedermann/opal', branch: 'es6_modules_1_1'
10
10
  gem 'opal-activesupport', github: 'janbiedermann/opal-activesupport', branch: 'relax'
11
- gem 'opal-webpack-loader', '~> 0.8.4'
11
+ gem 'opal-webpack-loader', '~> 0.8.8'
12
12
 
13
13
  gem 'opal-autoloader', '~> 0.0.3'
14
- gem 'isomorfeus-redux', '~> 4.0.3'
15
- gem 'isomorfeus-react', '~> 16.6.6'
14
+ gem 'isomorfeus-redux', '~> 4.0.4'
15
+ gem 'isomorfeus-react', '~> 16.6.7'
16
16
  #<%= transport_gems %>
17
17
  #<%= database_gems %>
18
18
  #<%= policy_gems %>
19
19
  #<%= operation_gems %>
20
20
  #<%= i18n_gems %>
21
21
 
22
+ group :development do
23
+ gem 'auto_reloader'
24
+ end
25
+
22
26
  group :test do
23
27
  gem 'rspec', '~> 3.6.0'
24
28
  gem 'isomorfeus-puppetmaster', '~> 0.2.7'
@@ -1,13 +1,15 @@
1
- require './app_loader'
2
- require './owl_init'
1
+ require_relative 'app_loader'
2
+ require_relative 'owl_init'
3
3
  <%= isomorfeus_config %>
4
4
  <% if use_transport %><%= transport_config %><% end %>
5
5
 
6
6
  class <%= app_class %> < Roda
7
7
  include OpalWebpackLoader::ViewHelper
8
+ include Isomorfeus::ReactViewHelper
9
+
8
10
  plugin :public, root: 'public'
9
11
 
10
- def default_content
12
+ def page_content(location)
11
13
  <<~HTML
12
14
  <html>
13
15
  <head>
@@ -15,7 +17,7 @@ class <%= app_class %> < Roda
15
17
  #{owl_script_tag 'application.js'}
16
18
  </head>
17
19
  <body>
18
- <div></div>
20
+ #{mount_component('<%= app_class %>', location: location)}
19
21
  </body>
20
22
  </html>
21
23
  HTML
@@ -23,13 +25,17 @@ class <%= app_class %> < Roda
23
25
 
24
26
  route do |r|
25
27
  r.root do
26
- default_content
28
+ page_content('/')
27
29
  end
28
30
 
29
31
  r.public
30
32
 
33
+ r.get 'favicon.ico' do
34
+ r.public
35
+ end
36
+
31
37
  r.get do
32
- default_content
38
+ page_content(env['REQUEST_PATH'])
33
39
  end
34
40
  end
35
41
  end
@@ -1,13 +1,9 @@
1
1
  require 'bundler/setup'
2
- if ENV['<%= project_env %>'] && ENV['<%= project_env %>'] == 'production'
3
- ENV['OWL_ENV'] = 'production'
2
+ if ENV['RACK_ENV'] && ENV['RACK_ENV'] == 'production'
4
3
  Bundler.require(:default, :production)
5
- elsif ENV['<%= project_env %>'] && ENV['<%= project_env %>'] == 'test'
6
- ENV['OWL_ENV'] = 'production'
4
+ elsif ENV['RACK_ENV'] && ENV['RACK_ENV'] == 'test'
7
5
  Bundler.require(:default, :test)
8
6
  else
9
- ENV['OWL_ENV'] = 'development'
10
7
  Bundler.require(:default, :development)
11
8
  end
12
-
13
9
  Opal.append_path(File.expand_path('isomorfeus'))
@@ -3,13 +3,15 @@
3
3
  import '../styles/application.css';
4
4
 
5
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
-
6
+ import ReactDOM from 'react-dom';
7
+ global.ReactDOM = ReactDOM;
8
+ import { BrowserRouter, Link, NavLink, Route, Switch } from 'react-router-dom';
9
+ // global.History = History;
10
+ global.BrowserRouter = BrowserRouter;
11
+ global.Link = Link;
12
+ global.NavLink = NavLink;
13
+ global.Route = Route;
14
+ global.Switch = Switch;
13
15
  // import modules common to browser and server side rendering (ssr)
14
16
  // environments from application_common.js
15
17
  import './application_common.js';
@@ -1,23 +1,11 @@
1
+ // import javascript modules common to browser and server side rendering environments
1
2
  import * as Redux from 'redux';
3
+ global.Redux = Redux;
2
4
  import React from 'react';
3
- import ReactDOM from 'react-dom';
4
- // import * as History from 'history';
5
+ global.React = React;
5
6
  import * as ReactRouter from 'react-router';
6
7
  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
8
  global.ReactRouter = ReactRouter;
15
9
  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
10
 
23
11
  if (module.hot) { module.hot.accept(); }
@@ -1,18 +1,21 @@
1
1
  // entry file for the server side rendering environment (ssr)
2
2
  // import npm modules that are only valid to use in the server side rendering environment
3
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
-
4
+ import ReactDOMServer from 'react-dom/server';
5
+ global.ReactDOMServer = ReactDOMServer;
6
+ import { StaticRouter, Link, NavLink, Route, Switch } from 'react-router-dom';
7
+ // global.History = History;
8
+ global.StaticRouter = StaticRouter;
9
+ global.Link = Link;
10
+ global.NavLink = NavLink;
11
+ global.Route = Route;
12
+ global.Switch = Switch;
10
13
  // import modules common to browser and server side rendering (ssr)
11
14
  // environments from application_common.js
12
15
  import './application_common.js';
13
16
 
14
17
  import init_app from 'isomorfeus_loader.rb';
15
18
  init_app();
16
- Opal.load('isomorfeus_loader');
19
+ global.Opal.load('isomorfeus_loader');
17
20
 
18
21
  if (module.hot) { module.hot.accept(); }
@@ -1,3 +1,4 @@
1
+ // import modules for webworkers
1
2
  import init_app from 'isomorfeus_web_worker_loader.rb';
2
3
  init_app();
3
4
  Opal.load('isomorfeus_web_worker_loader');
@@ -0,0 +1,16 @@
1
+ if ENV['RACK_ENV'] != 'development'
2
+ require_relative '<%= app_require %>'
3
+ run <%= app_class %>.app
4
+ else
5
+ require 'auto_reloader'
6
+ AutoReloader.activate reloadable_paths: [__dir__], delay: 1
7
+ run ->(env) do
8
+ AutoReloader.reload! do |unloaded|
9
+ # by default, AutoReloader only unloads constants when a watched file changes;
10
+ # when it unloads code before calling this block, the value for unloaded will be true.
11
+ ActiveSupport::Dependencies.clear if unloaded && defined?(ActiveSupport::Dependencies)
12
+ require_relative '<%= app_require %>'
13
+ <%= app_class %>.call env
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,6 @@
1
+ class HelloComponent < LucidComponent::Base
2
+ render do
3
+ DIV "Hello World!"
4
+ NavigationLinks()
5
+ end
6
+ end
@@ -15,3 +15,5 @@ require 'isomorfeus-transport'
15
15
  <% if use_database %>require_tree 'models'<% end %>
16
16
  <% if use_operation %>require_tree 'operations'<% end %>
17
17
  require_tree 'components'
18
+
19
+ Isomorfeus.start_app!
@@ -1,17 +1,10 @@
1
1
  class <%= app_class %> < LucidApp::Base
2
2
  render do
3
- # here may be a router for example:
4
- # DIV do
5
- # BrowserRouter do
6
- # Switch do
7
- # Route(path: '/fun/:count', exact: true, component: <%= component_name %>.JS[:react_component])
8
- # end
9
- # end
10
- # end
11
-
12
- # or a component:
13
- DIV do
14
- <%= component_name %>()
3
+ LucidRouter 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
+ end
15
8
  end
16
9
  end
17
10
  end
@@ -0,0 +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
9
+ end
@@ -2,7 +2,7 @@
2
2
  "name": "<%= application_name %>",
3
3
  "private": true,
4
4
  "dependencies": {
5
- "opal-webpack-loader": "^0.8.4",
5
+ "opal-webpack-loader": "^0.8.8",
6
6
  "react": "16.6",
7
7
  "react-dom": "16.6",
8
8
  "react-router": "^4.3.1",
@@ -23,13 +23,13 @@
23
23
  "file-loader": "^1.1.11",
24
24
  "jsdom": "14.0.0",
25
25
  "node-sass": "^4.12.0",
26
- "puppeteer": "1.14.0",
26
+ "puppeteer": "1.16.0",
27
27
  "sass-loader": "^7.1.0",
28
28
  "style-loader": "^0.23.1",
29
29
  "terser-webpack-plugin": "^1.2.3",
30
30
  "webpack": "^4.30.0",
31
+ "webpack-assets-manifest": "^3.1.1",
31
32
  "webpack-cli": "^3.3.0",
32
- "webpack-dev-server": "^3.3.1",
33
- "webpack-manifest-plugin": "^2.0.4"
33
+ "webpack-dev-server": "^3.3.1"
34
34
  }
35
35
  }
@@ -1,5 +1,5 @@
1
1
  ENV['NODE_PATH'] = File.join(File.expand_path('..', __dir__), 'node_modules')
2
- ENV['<%= project_env %>'] = 'production'
2
+ ENV['RACK_ENV'] = 'production'
3
3
  require 'bundler/setup'
4
4
  require 'rspec'
5
5
  require 'rspec/expectations'
@@ -0,0 +1,6 @@
1
+ class WelcomeComponent < LucidComponent::Base
2
+ render do
3
+ DIV "Welcome!"
4
+ NavigationLinks()
5
+ end
6
+ end
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  module Installer
3
- VERSION = '1.0.0.delta4'
3
+ VERSION = '1.0.0.delta5'
4
4
  end
5
5
  end
@@ -34,14 +34,12 @@ module Isomorfeus
34
34
  # application options
35
35
  attr_reader :app_class
36
36
  attr_reader :app_require
37
- attr_reader :component_name
38
37
  attr_accessor :database
39
38
  attr_accessor :framework
40
39
  attr_accessor :i18n
41
40
  attr_accessor :operation
42
41
  attr_accessor :policy
43
42
  attr_reader :project_dir
44
- attr_reader :project_env
45
43
  attr_reader :project_name
46
44
  attr_accessor :rack_server
47
45
  attr_accessor :rack_server_name
@@ -57,8 +55,6 @@ module Isomorfeus
57
55
  @project_name = pro_dir.underscore
58
56
  @app_class = @project_name.camelize + 'App'
59
57
  @app_require = @project_name + '_app'
60
- @component_name = @app_class + 'Component'
61
- @project_env = @project_name.upcase + '_ENV'
62
58
  end
63
59
 
64
60
  def self.options=(options)
@@ -205,9 +201,8 @@ module Isomorfeus
205
201
  use_transport_rack_app: use_transport_rack_app? }
206
202
  create_file_from_template('app.rb.erb', "#{@project_name}_app.rb", data_hash)
207
203
  data_hash = { app_require: app_require, app_class: app_class }
208
- create_file_from_template('config_ru.erb', 'config.ru', data_hash)
209
- data_hash = { project_env: @project_env }
210
- create_file_from_template(File.join('app_loader.rb.erb'), 'app_loader.rb', data_hash)
204
+ create_file_from_template('config.ru.erb', 'config.ru', data_hash)
205
+ create_file_from_template(File.join('app_loader.rb.erb'), 'app_loader.rb', {})
211
206
  end
212
207
 
213
208
  def self.install_isomorfeus_entries
@@ -277,10 +272,16 @@ module Isomorfeus
277
272
  create_file_from_template('Gemfile.erb', 'Gemfile', data_hash)
278
273
  end
279
274
 
280
- def self.create_component
281
- data_hash = { component_name: component_name }
282
- create_file_from_template('my_component.rb.erb',
283
- File.join(isomorfeus_path, 'components', component_name.underscore + '.rb'), data_hash)
275
+ def self.create_components
276
+ data_hash = { app_class: app_class }
277
+ create_file_from_template('my_app.rb.erb',
278
+ File.join(isomorfeus_path, 'components', app_class.underscore + '.rb'), data_hash)
279
+ create_file_from_template('hello_component.rb.erb',
280
+ File.join(isomorfeus_path, 'components', 'hello_component.rb'), {})
281
+ create_file_from_template('navigation_links.rb.erb',
282
+ File.join(isomorfeus_path, 'components', 'navigation_links.rb'), {})
283
+ create_file_from_template('welcome_component.rb.erb',
284
+ File.join(isomorfeus_path, 'components', 'welcome_component.rb'), {})
284
285
  end
285
286
 
286
287
  def self.create_middlewares
@@ -310,17 +311,11 @@ module Isomorfeus
310
311
  end
311
312
 
312
313
  def self.create_spec
313
- data_hash = { app_class: app_class, app_require: app_require, project_env: project_env, rack_server: rack_server_name }
314
+ data_hash = { app_class: app_class, app_require: app_require, rack_server: rack_server_name }
314
315
  create_file_from_template('spec_helper.rb.erb', File.join('spec', 'spec_helper.rb'), data_hash)
315
316
  create_file_from_template('test_spec.rb.erb', File.join('spec', 'test_spec.rb'), {})
316
317
  end
317
318
 
318
- def self.create_toplevel
319
- data_hash = { app_class: app_class, component_name: component_name }
320
- create_file_from_template('my_app.rb.erb',
321
- File.join(isomorfeus_path, 'components', app_class.underscore + '.rb'), data_hash)
322
- end
323
-
324
319
  def self.use_asset_bundler?
325
320
  options.has_key?('asset_bundler')
326
321
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-installer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.delta4
4
+ version: 1.0.0.delta5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-23 00:00:00.000000000 Z
11
+ date: 2019-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.8.3
47
+ version: 0.8.8
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.8.3
54
+ version: 0.8.8
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: thor
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -157,18 +157,19 @@ files:
157
157
  - lib/isomorfeus/installer/templates/application_debug.js.erb
158
158
  - lib/isomorfeus/installer/templates/application_ssr.js.erb
159
159
  - lib/isomorfeus/installer/templates/application_web_worker.js.erb
160
- - lib/isomorfeus/installer/templates/config_ru.erb
160
+ - lib/isomorfeus/installer/templates/config.ru.erb
161
+ - lib/isomorfeus/installer/templates/hello_component.rb.erb
161
162
  - lib/isomorfeus/installer/templates/isomorfeus_loader.rb.erb
162
163
  - lib/isomorfeus/installer/templates/isomorfeus_web_worker_loader.rb.erb
163
164
  - lib/isomorfeus/installer/templates/my_app.rb.erb
164
- - lib/isomorfeus/installer/templates/my_component.rb.erb
165
+ - lib/isomorfeus/installer/templates/navigation_links.rb.erb
165
166
  - lib/isomorfeus/installer/templates/package.json.erb
166
167
  - lib/isomorfeus/installer/templates/spec_helper.rb.erb
167
168
  - lib/isomorfeus/installer/templates/test_spec.rb.erb
169
+ - lib/isomorfeus/installer/templates/welcome_component.rb.erb
168
170
  - lib/isomorfeus/installer/transport_stores/redis.rb
169
171
  - lib/isomorfeus/installer/transports/actioncable.rb
170
172
  - lib/isomorfeus/installer/version.rb
171
- - readme.md
172
173
  homepage: http://isomorfeus.com
173
174
  licenses:
174
175
  - MIT
@@ -1,3 +0,0 @@
1
- require './<%= app_require %>'
2
-
3
- run <%= app_class %>.app
@@ -1,12 +0,0 @@
1
- class <%= component_name %> < LucidComponent::Base
2
- render do
3
- # when coming from the router example, get the count param:
4
- # props.match.count.to_i.times do |i|
5
- # # showing the conveniently short 'string param syntax':
6
- # DIV "Hello World!"
7
- # end
8
-
9
- # showing the 'block param syntax':
10
- DIV { "Hello World!" }
11
- end
12
- end
data/readme.md DELETED
@@ -1,66 +0,0 @@
1
- # Isomorfeus Framework Installer
2
-
3
- Create new isomorfeus applications with ease.
4
-
5
- ### Community and Support
6
- At the [Isomorfeus Framework Project](http://isomorfeus.com)
7
-
8
- #### Supported Isomorfeus modules
9
- - isomorfeus-react
10
- - isomorfeus-redux
11
-
12
- #### Supported asset bundlers
13
- - webpack with opal-webpack-loader
14
-
15
- ## Installation
16
- ```bash
17
- gem install isomorfeus-installer
18
- ```
19
-
20
- ## Creating new applications
21
- After running the installer execute:
22
- ```bash
23
- bundle install
24
- yarn install
25
- ```
26
- to install all gems and npms.
27
-
28
- ### Options
29
- ```bash
30
- isomorfeus -h
31
- ```
32
- ```
33
- Usage: isomorfeus options...
34
-
35
- Required:
36
- -n, --new=NAME Create new project with NAME and install isomorfeus.
37
-
38
- Also required in any case is:
39
- -f, --framework=FRAMEWORK Select base Framework, one of: cuba, rails, roda, sinatra.
40
-
41
- Other options:
42
- -a, --asset-bundler=BUNDLER Select asset bundler, one of: owl. (optional)
43
-
44
- -h, --help Prints this help
45
- ```
46
- ### Examples
47
- Creating a **Cuba** app with opal-webpack-loader as asset bundler:
48
- ```bash
49
- isomorfeus --new=my_app --framework=cuba --asset-bundler=owl
50
- ```
51
- Short form:
52
- ```bash
53
- isomorfeus -nmy_app -fcuba -aowl
54
- ```
55
- Creating a **Rails** app with opal-webpack-loader as asset bundler:
56
- ```bash
57
- isomorfeus --new=my_app --framework=rails --asset-bundler=owl
58
- ```
59
- Creating a **Roda** app with opal-webpack-loader as asset bundler:
60
- ```bash
61
- isomorfeus --new=my_app --framework=roda --asset-bundler=owl
62
- ```
63
- Creating a **Sinatra** app with opal-webpack-loader as asset bundler:
64
- ```bash
65
- isomorfeus --new=my_app --framework=rsinatra --asset-bundler=owl
66
- ```