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,110 +0,0 @@
1
- // require requirements used below
2
- const path = require('path');
3
- const webpack = require('webpack');
4
- const OwlResolver = require('opal-webpack-loader/resolver'); // to resolve ruby files
5
- const ExtraWatchWebpackPlugin = require('extra-watch-webpack-plugin'); // to watch for added ruby files
6
-
7
- const common_config = {
8
- target: 'web',
9
- context: path.resolve(__dirname, '../app'),
10
- mode: "development",
11
- optimization: {
12
- removeAvailableModules: false,
13
- removeEmptyChunks: false,
14
- minimize: false // dont minimize in development, to speed up hot reloads
15
- },
16
- performance: {
17
- maxAssetSize: 20000000,
18
- maxEntrypointSize: 20000000
19
- },
20
- devtool: false,
21
- output: {
22
- filename: '[name].js',
23
- path: path.resolve(__dirname, '../public/assets'),
24
- publicPath: 'http://localhost:3035/assets/'
25
- },
26
- externals: { crypto: 'Crypto' },
27
- resolve: { plugins: [new OwlResolver('resolve', 'resolved')] }, // resolve ruby files
28
- plugins: [
29
- // both for hot reloading
30
- new webpack.HotModuleReplacementPlugin(),
31
- // watch for added files in app dir
32
- new ExtraWatchWebpackPlugin({ dirs: [ path.resolve(__dirname, '../app') ] })
33
- ],
34
- module: {
35
- rules: [
36
- {
37
- test: /\.s[ac]ss$/,
38
- use: [ "style-loader" , "css-loader",
39
- {
40
- loader: "sass-loader",
41
- options: {
42
- sassOptions: { includePaths: [path.resolve(__dirname, '../app/styles')] },
43
- sourceMap: false
44
- }
45
- }
46
- ]
47
- },
48
- {
49
- test: /\.css$/,
50
- use: ["style-loader", "css-loader"]
51
- },
52
- {
53
- test: /\.(png|svg|jpg|gif|woff|woff2|eot|ttf|otf)$/,
54
- use: ["file-loader"]
55
- },
56
- {
57
- test: /(\.js)?\.rb$/,
58
- use: [
59
- {
60
- loader: 'opal-webpack-loader', // opal-webpack-loader will compile and include ruby files in the pack
61
- options: {
62
- sourceMap: false,
63
- hmr: true,
64
- hmrHook: 'Opal.Isomorfeus.$force_render()'
65
- }
66
- }
67
- ]
68
- }
69
- ]
70
- },
71
- // configuration for webpack-dev-server
72
- devServer: {
73
- open: false,
74
- lazy: false,
75
- port: 3035,
76
- hot: true,
77
- // hotOnly: true,
78
- inline: true,
79
- https: false,
80
- disableHostCheck: true,
81
- headers: {
82
- "Access-Control-Allow-Origin": "*",
83
- "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
84
- "Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization"
85
- },
86
- watchOptions: {
87
- // in case of problems with hot reloading uncomment the following two lines:
88
- // aggregateTimeout: 250,
89
- // poll: 50,
90
- ignored: /\bnode_modules\b/
91
- },
92
- contentBase: path.resolve(__dirname, 'public'),
93
- useLocalIp: false
94
- }
95
- };
96
-
97
- const browser_config = {
98
- entry: { application: [path.resolve(__dirname, '../app/imports/application.js')] }
99
- };
100
-
101
- //const web_worker_config = {
102
- // target: 'webworker',
103
- // entry: { web_worker: [path.resolve(__dirname, '../app/imports/application_web_worker.js')] },
104
- // externals: { crypto: 'Crypto' }
105
- //};
106
-
107
- const browser = Object.assign({}, common_config, browser_config);
108
- // const web_worker = Object.assign({}, common_config, web_worker_config);
109
-
110
- module.exports = [ browser ];
@@ -1,115 +0,0 @@
1
- // require requirements used below
2
- const path = require('path');
3
- const webpack = require('webpack');
4
- const OwlResolver = require('opal-webpack-loader/resolver'); // to resolve ruby files
5
- const ExtraWatchWebpackPlugin = require('extra-watch-webpack-plugin'); // to watch for added ruby files
6
-
7
- const common_config = {
8
- target: 'node',
9
- context: path.resolve(__dirname, '../app'),
10
- mode: "development",
11
- optimization: {
12
- removeAvailableModules: false,
13
- removeEmptyChunks: false,
14
- minimize: false // dont minimize in development, to speed up hot reloads
15
- },
16
- performance: {
17
- maxAssetSize: 20000000,
18
- maxEntrypointSize: 20000000
19
- },
20
- devtool: false,
21
- output: {
22
- // webpack-dev-server keeps the output in memory
23
- filename: '[name].js',
24
- path: path.resolve(__dirname, '../public/assets'),
25
- publicPath: 'http://localhost:3036/assets/'
26
- },
27
- resolve: {
28
- plugins: [
29
- // this makes it possible for webpack to find ruby files
30
- new OwlResolver('resolve', 'resolved')
31
- ]
32
- },
33
- plugins: [
34
- // dont split ssr asset in chunks
35
- new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1 }),
36
- // watch for added files in app dir
37
- new ExtraWatchWebpackPlugin({ dirs: [ path.resolve(__dirname, '../app') ] })
38
- ],
39
- module: {
40
- rules: [
41
- {
42
- // loader for .scss files
43
- // test means "test for for file endings"
44
- test: /\.s[ac]ss$/,
45
- use: [ "style-loader", "css-loader",
46
- {
47
- loader: "sass-loader",
48
- options: {
49
- sassOptions: { includePaths: [path.resolve(__dirname, '../app/styles')] },
50
- sourceMap: false
51
- }
52
- }
53
- ]
54
- },
55
- {
56
- // loader for .css files
57
- test: /\.css$/,
58
- use: [ "style-loader", "css-loader" ]
59
- },
60
- {
61
- test: /\.(png|svg|jpg|gif|woff|woff2|eot|ttf|otf)$/,
62
- use: [ "file-loader" ]
63
- },
64
- {
65
- // opal-webpack-loader will compile and include ruby files in the pack
66
- test: /(\.js)?\.rb$/,
67
- use: [
68
- {
69
- loader: 'opal-webpack-loader',
70
- options: {
71
- sourceMap: false,
72
- hmr: false,
73
- hmrHook: 'Opal.Isomorfeus.$force_render()'
74
- }
75
- }
76
- ]
77
- }
78
- ]
79
- },
80
- // configuration for webpack-dev-server
81
- devServer: {
82
- open: false,
83
- lazy: false,
84
- port: 3036,
85
- hot: false,
86
- inline: true,
87
- https: false,
88
- disableHostCheck: true,
89
- headers: {
90
- "Access-Control-Allow-Origin": "*",
91
- "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
92
- "Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization"
93
- },
94
- watchOptions: {
95
- // in case of problems with hot reloading uncomment the following two lines:
96
- // aggregateTimeout: 250,
97
- // poll: 50,
98
- ignored: /\bnode_modules\b/
99
- },
100
- contentBase: path.resolve(__dirname, 'public'),
101
- useLocalIp: false
102
- }
103
- };
104
-
105
- const ssr_config = {
106
- entry: { application_ssr: [path.resolve(__dirname, '../app/imports/application_ssr.js')] }
107
- };
108
-
109
- const mail_components_config = {
110
- entry: { mail_components: [path.resolve(__dirname, '../app/imports/mail_components.js')] }
111
- };
112
-
113
- const ssr = Object.assign({}, common_config, ssr_config);
114
- const mail_components = Object.assign({}, common_config, mail_components_config);
115
- module.exports = [ ssr, mail_components ];
@@ -1,14 +0,0 @@
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
-
5
- Iodine.on_state(:enter_child) do
6
- Isomorfeus.connect_to_arango if Isomorfeus.arango_configured?
7
- end
8
-
9
- if ENV['REDIS_URL']
10
- Iodine::PubSub.default = Iodine::PubSub::Redis.new(ENV['REDIS_URL'])
11
- puts "* Using Redis for pub/sub."
12
- else
13
- puts "* Using Iodine for pub/sub within the process cluster."
14
- end
@@ -1,23 +0,0 @@
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
- import ReactDOMServer from 'react-dom/server';
5
- global.ReactDOMServer = ReactDOMServer;
6
-
7
- import WebSocket from 'ws';
8
- global.WebSocket = WebSocket;
9
-
10
- import * as Redux from 'redux';
11
- global.Redux = Redux;
12
-
13
- import React from 'react';
14
- global.React = React;
15
-
16
- import * as ReactJSS from 'react-jss';
17
- global.ReactJSS = ReactJSS;
18
-
19
- import init_mail_components from 'mail_components_loader.rb';
20
- init_mail_components();
21
- global.Opal.load('mail_components_loader');
22
-
23
- if (module.hot) { module.hot.accept(); }
@@ -1,43 +0,0 @@
1
- {
2
- "name": "<%= application_name %>",
3
- "private": true,
4
- "dependencies": {
5
- "opal-webpack-loader": "^0.9.10",
6
- "react": "^16.12.0",
7
- "react-deep-force-update": "^2.1.3",
8
- "react-dom": "^16.12.0",
9
- "react-jss": "^10.0.0",
10
- "react-router": "^5.1.2",
11
- "react-router-dom": "^5.1.2",
12
- "redux": "^4.0.5",
13
- "ws": "^7.2.0"
14
- },
15
- "scripts": {
16
- "build": "parallel-webpack --config=webpack/production.js",
17
- "debug": "webpack-dev-server --config=webpack/debug.js",
18
- "development": "webpack-dev-server --config=webpack/development.js",
19
- "development_ssr": "webpack-dev-server --config=webpack/development_ssr.js",
20
- "production_build": "parallel-webpack --config=webpack/production.js"
21
- },
22
- "devDependencies": {
23
- "compression-webpack-plugin": "^3.0.0",
24
- "css-loader": "^3.2.0",
25
- "extra-watch-webpack-plugin": "^1.0.3",
26
- "file-loader": "^4.2.0",
27
- "jsdom": "15.2.1",
28
- "node-sass": "^4.13.0",
29
- "parallel-webpack": "^2.4.0",
30
- "puppeteer": "2.0.0",
31
- "sass-loader": "^8.0.0",
32
- "style-loader": "^1.0.0",
33
- "terser-webpack-plugin": "^2.2.1",
34
- "webpack": "^4.41.2",
35
- "webpack-assets-manifest": "^3.1.1",
36
- "webpack-cli": "^3.3.10",
37
- "webpack-dev-server": "^3.9.0"
38
- },
39
- "optionalDependencies": {
40
- "bufferutil": "^4.0.1",
41
- "utf-8-validate": "^5.0.2"
42
- }
43
- }
@@ -1,100 +0,0 @@
1
- const path = require('path');
2
- const OwlResolver = require('opal-webpack-loader/resolver');
3
- const CompressionPlugin = require("compression-webpack-plugin"); // for gzipping the packs
4
- const TerserPlugin = require('terser-webpack-plugin'); // for minifying the packs
5
- const WebpackAssetsManifest = require('webpack-assets-manifest');
6
-
7
- const common_config = {
8
- context: path.resolve(__dirname, '../app'),
9
- mode: "production",
10
- optimization: {
11
- minimize: true, // minimize
12
- minimizer: [new TerserPlugin({ parallel: true, cache: true, terserOptions: { output: { comments: false }}})]
13
- },
14
- performance: {
15
- maxAssetSize: 20000000,
16
- maxEntrypointSize: 20000000
17
- },
18
- output: {
19
- filename: '[name]-[chunkhash].js', // include fingerprint in file name, so browsers get the latest
20
- path: path.resolve(__dirname, '../public/assets'),
21
- publicPath: '/assets/'
22
- },
23
- resolve: { plugins: [new OwlResolver('resolve', 'resolved')] }, // resolve ruby files
24
- module: {
25
- rules: [
26
- {
27
- test: /\.s[ac]ss$/,
28
- use: ["style-loader", "css-loader",
29
- {
30
- loader: "sass-loader",
31
- options: {
32
- sassOptions: { includePaths: [path.resolve(__dirname, '../app/styles')] },
33
- sourceMap: false
34
- }
35
- }
36
- ]
37
- },
38
- {
39
- test: /\.css$/,
40
- use: ["style-loader", "css-loader"]
41
- },
42
- {
43
- test: /\.(png|svg|jpg|gif|woff|woff2|eot|ttf|otf)$/,
44
- use: ["file-loader"]
45
- },
46
- {
47
- test: /(\.js)?\.rb$/,
48
- use: [
49
- {
50
- loader: 'opal-webpack-loader', // opal-webpack-loader will compile and include ruby files in the pack
51
- options: { sourceMap: false, hmr: false }
52
- }
53
- ]
54
- }
55
- ]
56
- }
57
- };
58
-
59
- const browser_config = {
60
- target: 'web',
61
- entry: { application: [path.resolve(__dirname, '../app/imports/application.js')] },
62
- plugins: [
63
- new CompressionPlugin({ test: /^((?!application_ssr).)*$/, cache: true }), // gzip compress, exclude application_ssr.js
64
- new WebpackAssetsManifest({ publicPath: true, merge: true }) // generate manifest
65
- ],
66
- externals: { crypto: 'Crypto' }
67
- };
68
-
69
- const ssr_config = {
70
- target: 'node',
71
- entry: { application_ssr: [path.resolve(__dirname, '../app/imports/application_ssr.js')] },
72
- plugins: [
73
- new WebpackAssetsManifest({ publicPath: true, merge: true }) // generate manifest
74
- ]
75
- };
76
-
77
- const mail_components_config = {
78
- target: 'node',
79
- entry: { mail_components: [path.resolve(__dirname, '../app/imports/mail_components.js')] },
80
- plugins: [
81
- new WebpackAssetsManifest({ publicPath: true, merge: true }) // generate manifest
82
- ]
83
- };
84
-
85
- //const web_worker_config = {
86
- // target: 'webworker',
87
- // entry: { web_worker: [path.resolve(__dirname, '../app/imports/application_web_worker.js')] },
88
- // plugins: [
89
- // new CompressionPlugin({ test: /^((?!application_ssr).)*$/, cache: true }), // gzip compress, exclude application_ssr.js
90
- // new WebpackAssetsManifest({ publicPath: true, merge: true }) // generate manifest
91
- // ],
92
- // externals: { crypto: 'Crypto' }
93
- //};
94
-
95
- const browser = Object.assign({}, common_config, browser_config);
96
- const ssr = Object.assign({}, common_config, ssr_config);
97
- const mail_components = Object.assign({}, common_config, mail_components_config);
98
- // const web_worker = Object.assign({}, common_config, web_worker_config);
99
-
100
- module.exports = [ browser, ssr, mail_components ];