lanes 0.8.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +2 -0
  3. data/Gemfile +2 -3
  4. data/client/lanes/boot.jsx +1 -1
  5. data/client/lanes/index.js +0 -11
  6. data/client/lanes/jest/matchers.js +14 -0
  7. data/{lib/js/jest/mocks.js → client/lanes/jest/mocks/fetch.js} +1 -1
  8. data/client/lanes/models/base.js +0 -32
  9. data/client/lanes/screens/definition.js +7 -8
  10. data/client/lanes/screens/index.js +24 -240
  11. data/client/lanes/workspace/menu.jsx +3 -34
  12. data/client/lanes/workspace/screen.jsx +3 -3
  13. data/config/routes.rb +2 -0
  14. data/config/screens.rb +2 -2
  15. data/lanes.gemspec +10 -7
  16. data/lib/lanes/access/authentication_provider.rb +4 -4
  17. data/lib/lanes/api.rb +1 -0
  18. data/lib/lanes/api/default_routes.rb +1 -1
  19. data/lib/lanes/api/handlers/screens.rb +26 -0
  20. data/lib/lanes/api/helper_methods.rb +5 -4
  21. data/lib/lanes/cli.rb +7 -0
  22. data/lib/lanes/command/app.rb +4 -6
  23. data/lib/lanes/command/client_config.rb +59 -0
  24. data/lib/lanes/command/generate_model.rb +4 -4
  25. data/lib/lanes/command/jest.rb +14 -29
  26. data/lib/lanes/command/model_attribute.rb +6 -1
  27. data/lib/lanes/command/named_command.rb +1 -0
  28. data/lib/lanes/command/puma.rb +56 -0
  29. data/lib/lanes/command/server.rb +21 -18
  30. data/lib/lanes/command/webpack.rb +54 -0
  31. data/lib/lanes/extension.rb +0 -7
  32. data/lib/lanes/guard_tasks.rb +21 -20
  33. data/lib/lanes/rake_tasks.rb +13 -0
  34. data/lib/lanes/reloadable_sinatra.rb +24 -0
  35. data/lib/lanes/screen.rb +15 -6
  36. data/lib/lanes/spec_helper.rb +70 -136
  37. data/lib/lanes/version.rb +1 -1
  38. data/package.json +1 -1
  39. data/spec/server/api/controller_base_spec.rb +61 -53
  40. data/spec/server/spec_helper.rb +37 -45
  41. data/templates/client/models/model.js +17 -0
  42. data/templates/config/database.yml +2 -1
  43. data/templates/config/jest.config.json +14 -0
  44. data/templates/config/jest/babel-transform.js +47 -0
  45. data/templates/config/routes.rb +3 -2
  46. data/templates/config/webpack.config.js +1 -1
  47. data/templates/js/jest.config.json +2 -10
  48. data/templates/spec/client/models/model.spec.js +10 -0
  49. data/templates/spec/client/setup.js +9 -0
  50. data/templates/spec/server/spec_helper.rb +3 -11
  51. metadata +40 -41
  52. data/lib/js/jest.config.json +0 -14
  53. data/lib/js/jest/fileMock.js +0 -1
  54. data/lib/js/jest/setup.js +0 -26
  55. data/lib/js/jest/stubs/screen-definitions.js +0 -0
  56. data/lib/js/jest/styleMock.js +0 -1
  57. data/lib/js/webpack.config.js +0 -93
  58. data/lib/lanes/hot_reload_plugin.rb +0 -47
  59. data/lib/lanes/webpack.rb +0 -73
  60. data/spec/server/api/coffeescript_processor_spec.rb +0 -116
  61. data/templates/client/models/Model.coffee +0 -17
  62. data/templates/spec/client/models/ModelSpec.coffee +0 -5
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lanes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Stitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-03 00:00:00.000000000 Z
11
+ date: 2017-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '5.0'
19
+ version: 5.0.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '5.0'
26
+ version: 5.0.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activerecord
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '5.0'
33
+ version: 5.0.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '5.0'
40
+ version: 5.0.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: actioncable
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '5.0'
47
+ version: 5.0.2
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: '5.0'
54
+ version: 5.0.2
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: mail
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 2.0.0.beta2
75
+ version: 2.0.0.rc1
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 2.0.0.beta2
82
+ version: 2.0.0.rc1
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rack
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 2.0.0.beta2
103
+ version: 2.0.0.rc1
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 2.0.0.beta2
110
+ version: 2.0.0.rc1
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rack-cors
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -220,6 +220,20 @@ dependencies:
220
220
  - - "~>"
221
221
  - !ruby/object:Gem::Version
222
222
  version: '2.13'
223
+ - !ruby/object:Gem::Dependency
224
+ name: rspec-rails
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - "~>"
228
+ - !ruby/object:Gem::Version
229
+ version: '3.5'
230
+ type: :runtime
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - "~>"
235
+ - !ruby/object:Gem::Version
236
+ version: '3.5'
223
237
  - !ruby/object:Gem::Dependency
224
238
  name: guard-jest
225
239
  requirement: !ruby/object:Gem::Requirement
@@ -235,19 +249,19 @@ dependencies:
235
249
  - !ruby/object:Gem::Version
236
250
  version: '0.1'
237
251
  - !ruby/object:Gem::Dependency
238
- name: guard-minitest
252
+ name: guard-rspec
239
253
  requirement: !ruby/object:Gem::Requirement
240
254
  requirements:
241
255
  - - "~>"
242
256
  - !ruby/object:Gem::Version
243
- version: '2.3'
257
+ version: '4.7'
244
258
  type: :runtime
245
259
  prerelease: false
246
260
  version_requirements: !ruby/object:Gem::Requirement
247
261
  requirements:
248
262
  - - "~>"
249
263
  - !ruby/object:Gem::Version
250
- version: '2.3'
264
+ version: '4.7'
251
265
  - !ruby/object:Gem::Dependency
252
266
  name: hashie
253
267
  requirement: !ruby/object:Gem::Requirement
@@ -304,20 +318,6 @@ dependencies:
304
318
  - - "~>"
305
319
  - !ruby/object:Gem::Version
306
320
  version: 4.3.6
307
- - !ruby/object:Gem::Dependency
308
- name: minitest-around
309
- requirement: !ruby/object:Gem::Requirement
310
- requirements:
311
- - - "~>"
312
- - !ruby/object:Gem::Version
313
- version: '0.2'
314
- type: :runtime
315
- prerelease: false
316
- version_requirements: !ruby/object:Gem::Requirement
317
- requirements:
318
- - - "~>"
319
- - !ruby/object:Gem::Version
320
- version: '0.2'
321
321
  - !ruby/object:Gem::Dependency
322
322
  name: oj
323
323
  requirement: !ruby/object:Gem::Requirement
@@ -609,6 +609,8 @@ files:
609
609
  - client/lanes/fonts/fontawesome-webfont.woff2
610
610
  - client/lanes/index.js
611
611
  - client/lanes/index.scss.erb
612
+ - client/lanes/jest/matchers.js
613
+ - client/lanes/jest/mocks/fetch.js
612
614
  - client/lanes/lib/ResizeSensor.js
613
615
  - client/lanes/lib/__mocks__/loader.js
614
616
  - client/lanes/lib/__mocks__/request-assets.js
@@ -784,13 +786,6 @@ files:
784
786
  - docs/welcome.md
785
787
  - lanes.gemspec
786
788
  - lib/generators/lanes/migrations/install_generator.rb
787
- - lib/js/jest.config.json
788
- - lib/js/jest/fileMock.js
789
- - lib/js/jest/mocks.js
790
- - lib/js/jest/setup.js
791
- - lib/js/jest/stubs/screen-definitions.js
792
- - lib/js/jest/styleMock.js
793
- - lib/js/webpack.config.js
794
789
  - lib/lanes.rb
795
790
  - lib/lanes/access.rb
796
791
  - lib/lanes/access/authentication_provider.rb
@@ -821,6 +816,7 @@ files:
821
816
  - lib/lanes/api/formatted_reply.rb
822
817
  - lib/lanes/api/generic_controller.rb
823
818
  - lib/lanes/api/handlers/asset.rb
819
+ - lib/lanes/api/handlers/screens.rb
824
820
  - lib/lanes/api/handlers/user_session.rb
825
821
  - lib/lanes/api/helper_methods.rb
826
822
  - lib/lanes/api/pub_sub.rb
@@ -835,6 +831,7 @@ files:
835
831
  - lib/lanes/cli.rb
836
832
  - lib/lanes/command.rb
837
833
  - lib/lanes/command/app.rb
834
+ - lib/lanes/command/client_config.rb
838
835
  - lib/lanes/command/client_model_update.rb
839
836
  - lib/lanes/command/console.rb
840
837
  - lib/lanes/command/db.rb
@@ -852,11 +849,13 @@ files:
852
849
  - lib/lanes/command/migration_support.rb
853
850
  - lib/lanes/command/model_attribute.rb
854
851
  - lib/lanes/command/named_command.rb
852
+ - lib/lanes/command/puma.rb
855
853
  - lib/lanes/command/server.rb
856
854
  - lib/lanes/command/server.usage
857
855
  - lib/lanes/command/update.rb
858
856
  - lib/lanes/command/update_model.rb
859
857
  - lib/lanes/command/update_model.usage
858
+ - lib/lanes/command/webpack.rb
860
859
  - lib/lanes/components.rb
861
860
  - lib/lanes/concerns/all.rb
862
861
  - lib/lanes/concerns/api_path.rb
@@ -881,7 +880,6 @@ files:
881
880
  - lib/lanes/extension.rb
882
881
  - lib/lanes/extension/definition.rb
883
882
  - lib/lanes/guard_tasks.rb
884
- - lib/lanes/hot_reload_plugin.rb
885
883
  - lib/lanes/job.rb
886
884
  - lib/lanes/job/failure_logger.rb
887
885
  - lib/lanes/lanes_guard_plugin.rb
@@ -892,6 +890,7 @@ files:
892
890
  - lib/lanes/rails_engine.rb
893
891
  - lib/lanes/rake_tasks.rb
894
892
  - lib/lanes/redis.rb
893
+ - lib/lanes/reloadable_sinatra.rb
895
894
  - lib/lanes/screen.rb
896
895
  - lib/lanes/spec_helper.rb
897
896
  - lib/lanes/strings.rb
@@ -900,7 +899,6 @@ files:
900
899
  - lib/lanes/validators/email.rb
901
900
  - lib/lanes/validators/set.rb
902
901
  - lib/lanes/version.rb
903
- - lib/lanes/webpack.rb
904
902
  - lib/lanes/workspace.rb
905
903
  - lib/lanes/workspace/config/screens.rb
906
904
  - log/.gitkeep
@@ -1008,7 +1006,6 @@ files:
1008
1006
  - spec/lanes/screens/DefinitionsSpec.coffee
1009
1007
  - spec/lanes/views/BaseSpec.coffee
1010
1008
  - spec/lanes/views/FormBindingsSpec.coffee
1011
- - spec/server/api/coffeescript_processor_spec.rb
1012
1009
  - spec/server/api/controller_base_spec.rb
1013
1010
  - spec/server/api/pub_sub_spec.rb
1014
1011
  - spec/server/asset_spec.rb
@@ -1043,8 +1040,8 @@ files:
1043
1040
  - templates/client/components/template.html
1044
1041
  - templates/client/extension.js
1045
1042
  - templates/client/index.js
1046
- - templates/client/models/Model.coffee
1047
1043
  - templates/client/models/base.js
1044
+ - templates/client/models/model.js
1048
1045
  - templates/client/screens/BaseScreen.coffee
1049
1046
  - templates/client/screens/Screen.cjsx
1050
1047
  - templates/client/screens/index.js
@@ -1052,6 +1049,8 @@ files:
1052
1049
  - templates/client/styles.scss
1053
1050
  - templates/config.ru
1054
1051
  - templates/config/database.yml
1052
+ - templates/config/jest.config.json
1053
+ - templates/config/jest/babel-transform.js
1055
1054
  - templates/config/lanes.rb
1056
1055
  - templates/config/routes.rb
1057
1056
  - templates/config/screen.rb
@@ -1070,7 +1069,7 @@ files:
1070
1069
  - templates/public/.gitkeep
1071
1070
  - templates/spec/client/Screen.coffee
1072
1071
  - templates/spec/client/components/ComponentSpec.coffee
1073
- - templates/spec/client/models/ModelSpec.coffee
1072
+ - templates/spec/client/models/model.spec.js
1074
1073
  - templates/spec/client/setup.js
1075
1074
  - templates/spec/fixtures/namespace/model.yml
1076
1075
  - templates/spec/server/model_spec.rb
@@ -1,14 +0,0 @@
1
- {
2
- "verbose": true,
3
- "notify": false,
4
- "testMatch": [ "**/?(*.)(spec|test).js?(x)" ],
5
- "moduleFileExtensions": [ "js", "jsx", "json" ],
6
- "transform": {
7
- "^.+\\.jsx?$": "babel-jest"
8
- },
9
- "transformIgnorePatterns": [ "/node_modules/" ],
10
- "moduleNameMapper": {
11
- "\\.(css|less|scss)$": "<rootDir>/lib/js/jest/styleMock.js",
12
- "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/lib/js/jest/fileMock.js"
13
- }
14
- }
@@ -1 +0,0 @@
1
- module.exports = 'test-file-stub';
@@ -1,26 +0,0 @@
1
- const { shallow, mount } = require('enzyme');
2
- const { fetch } = require('./mocks');
3
-
4
- global.shallow = shallow;
5
- global.mount = mount;
6
- global.fetch = fetch;
7
- global.React = require('React');
8
-
9
- jest.addMatchers({
10
-
11
- toHaveRendered() {
12
- return {
13
- compare: (wrapper, selector) => {
14
- const matchCount = wrapper.find(selector).length;
15
- const result = { pass: 1 === matchCount };
16
- if (result.pass) {
17
- result.message = `${selector} was found`;
18
- } else {
19
- result.message = `Expected wrapper to contain '${selector}' only once, but it was found ${matchCount} times`;
20
- }
21
- return result;
22
- },
23
- };
24
- },
25
-
26
- });
File without changes
@@ -1 +0,0 @@
1
- module.exports = {};
@@ -1,93 +0,0 @@
1
- // Responsible for reporting status back to webpack-driver
2
- const HtmlWebpackPlugin = require('html-webpack-plugin');
3
- const webpack = require('webpack');
4
- const path = require('path');
5
- // const roots = process.env.LANES_EXT_ROOTS || './client';
6
- // const controlling_root = process.env.LANES_CONTROLLER_DIR;
7
- // roots.split(',').concat([
8
- // 'node_modules',
9
- // generated_dir,
10
- // ]),
11
-
12
- const config = {
13
- entry: {
14
- lanes: [
15
- 'react-hot-loader/patch',
16
- 'lanes/entry.js',
17
- ],
18
- },
19
- output: {
20
- path: __dirname,
21
- publicPath: '/',
22
- filename: 'lanes.js',
23
- },
24
- resolve: {
25
- modules: process.env.LANES_MODULES.split(':'),
26
- extensions: ['.js', '.jsx'],
27
- },
28
- module: {
29
- rules: [
30
- { test: /\.css$/, use: ['style-loader', 'css-loader'] },
31
- { loader: 'babel-loader', test: /\.jsx?$/, exclude: /node_modules/ },
32
- { test: /\.scss$/,
33
- use: [
34
- 'style-loader',
35
- 'css-loader',
36
- {
37
- loader: 'sass-loader',
38
- options: {
39
- includePaths: [path.resolve('./node_modules')],
40
- },
41
- },
42
- ],
43
- },
44
- ],
45
- },
46
- devtool: 'source-map',
47
- plugins: [
48
- new webpack.optimize.CommonsChunkPlugin({
49
- name: 'vendor', minChunks: Infinity, filename: '[name].[hash].js',
50
- }),
51
- new HtmlWebpackPlugin({
52
- title: 'My App',
53
- filename: 'index.html',
54
- template: `${process.env.GENERATED_CONFIG_DIR}/root-view.tmpl.html`,
55
- }),
56
- new webpack.DefinePlugin({
57
- 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
58
- }),
59
- ],
60
- node: {
61
- fs: 'empty',
62
- },
63
- devServer: {
64
- hot: true,
65
- inline: true,
66
- port: 8889,
67
- historyApiFallback: true,
68
- proxy: [{
69
- context: '/api',
70
- target: 'http://localhost:4567',
71
- }],
72
- stats: {
73
- colors: true,
74
- hash: false,
75
- version: false,
76
- timings: false,
77
- assets: false,
78
- chunks: false,
79
- modules: false,
80
- reasons: false,
81
- children: false,
82
- source: false,
83
- errors: false,
84
- errorDetails: false,
85
- warnings: false,
86
- publicPath: false,
87
- },
88
- },
89
- };
90
-
91
- // console.log(config)
92
-
93
- module.exports = config;
@@ -1,47 +0,0 @@
1
- require 'guard/compat/plugin'
2
- module ::Guard
3
-
4
- class HotReload < Plugin
5
-
6
- def initialize(options = {})
7
- super
8
- api = Lanes.config.api_path
9
- @uri = URI.parse(
10
- "http://localhost:#{options[:port]}#{api}/dev-file-change.json"
11
- )
12
- end
13
-
14
- def run_all
15
- end
16
-
17
- def asset_to_json(file)
18
- file.gsub!(/client\//,'')
19
- if file.match(/\.(js|coffee|cjsx)$/)
20
- file.gsub!(/(.*)\.(js|coffee|cjsx)$/, '\1.js')
21
- comp = file.split('/')#[1..-1]
22
- comp[comp.length-1] = comp.last.gsub(/\.\w+$/,'')
23
- { "type" => "js", "path" => file, "components" => comp }
24
- else
25
- path = if file.match(%r{/screens/.*/\w+\.scss})
26
- file.gsub(%r{/\w+.\w*css},'.css')
27
- else
28
- file
29
- end
30
- { "type" => "css", "path" => path, "trigger" => file }
31
- end
32
-
33
- end
34
-
35
- def run_on_modifications(paths)
36
- post = Net::HTTP::Post.new(@uri.request_uri)
37
- body = paths.map do | file |
38
- asset_to_json(file)
39
- end
40
- post.body = Oj.dump(body)
41
- http = Net::HTTP.new(@uri.host, @uri.port)
42
- http.request(post)
43
- end
44
-
45
- end
46
-
47
- end