r5 0.4.0.2 → 0.4.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7c312393f6a5800dd98254bad60bc94cfe034cda
4
- data.tar.gz: f8f8cb7203c97a47819b506629c8479c8df0b6cb
3
+ metadata.gz: ae3414e9df9b6b59cdaa4d7878e32d08e2e58204
4
+ data.tar.gz: 4ec373b9a429d70a3e43a27e12792721378206ee
5
5
  SHA512:
6
- metadata.gz: 1d8d58594bc4bc6f5fa680bd3a405cf46a0013164bea63704b46c10a4349b80de6b9c8b191996ab572d9f11b839c53661d6ae8ab986a02031393290997beff85
7
- data.tar.gz: 58c72ce771417e97baabfca476d2609a9aca72bdb085eb9c99acb4fffe39e8d0ded9b1af911acdb0ac98c5644cd66329c135ee4c43f944fa521e2bc41c15ccc1
6
+ metadata.gz: 00321c3a4c01006c5c441763c6392ee24eed975b00ad497cbf82c25beb9bc03972b249ceef4c024d7f484c22cb3e106e420613398fc2da537fdc625614b11804
7
+ data.tar.gz: 977072d4966d971202f3d5dd05566662d73e940a7441feef01538d099146670094b3fae51049f10e0567713c93e0d24f9a4000f54d56153059ac9499989de5fa
@@ -17,6 +17,27 @@ before: "\n//= require_tree ." do <<-TXT
17
17
  TXT
18
18
  end
19
19
 
20
+
21
+ create_file "#{@project_path}/config/webpack/custom.js" do <<-JS
22
+ const webpack = require('webpack')
23
+
24
+ module.exports = {
25
+ resolve: {
26
+ alias: {
27
+ jquery: 'jquery/src/jquery',
28
+ }
29
+ },
30
+ }
31
+
32
+ // config/webpack/development.js
33
+ const merge = require('webpack-merge')
34
+ const environment = require('./environment')
35
+ const customConfig = require('./custom')
36
+
37
+ module.exports = merge(environment.toWebpackConfig(), customConfig)
38
+ JS
39
+ end
40
+
20
41
  insert_into_file "#{@project_path}/app/javascript/packs/application.js",
21
42
  after: "console.log('Hello World from Webpacker')" do <<-JS
22
43
 
@@ -25,32 +46,26 @@ window.jQuery = jQuery
25
46
 
26
47
  let ready;
27
48
  ready = function() {
28
- $(".datepicker").datetimepicker({locale: 'cs', format: 'D. M. YYYY'});
49
+ // $(".datepicker").datetimepicker({locale: 'cs', format: 'D. M. YYYY'});
29
50
  };
30
51
  // Fire javascript after turbolinks event
31
52
  $(document).on('turbolinks:load', ready);
32
53
  JS
33
54
  end
34
55
 
35
- insert_into_file "#{@project_path}/config/webpack/shared.js",
36
- after: "new ManifestPlugin({ fileName: paths.manifest, publicPath, writeToFileEmit: true })
37
- ]," do <<-JS
38
-
39
- resolve: {
40
- alias: {
41
- jquery: "jquery/src/jquery"
42
- }
43
- },
44
- JS
45
- end
46
-
47
- insert_into_file "#{@project_path}/config/webpack/shared.js",
48
- after: "new ExtractTextPlugin(env.NODE_ENV === 'production' ? '[name]-[hash].css' : '[name].css')," do <<-JS
56
+ insert_into_file "#{@project_path}/config/webpack/environment.js",
57
+ after: "const { environment } = require('@rails/webpacker')" do <<-JS
49
58
 
50
- new webpack.ProvidePlugin({
51
- $: 'jquery',
52
- jQuery: 'jquery',
53
- jquery: 'jquery'
54
- }),
59
+ const webpack = require('webpack')
60
+
61
+ // Add an additional plugin of your choosing : ProvidePlugin
62
+ environment.plugins.set(
63
+ 'Provide',
64
+ new webpack.ProvidePlugin({
65
+ $: 'jquery',
66
+ jQuery: 'jquery',
67
+ jquery: 'jquery',
68
+ })
69
+ )
55
70
  JS
56
71
  end
@@ -13,16 +13,21 @@ class Starter < Thor
13
13
  create_config_file
14
14
  end
15
15
 
16
- if `rails -v` =~ /command not found/ or !(`rails -v` =~ /Rails 5.1.*/)
16
+ if (system "rails -v").nil? or (%x[rails -v] =~ /Rails 5.1.*/).nil?
17
17
  say "You didn't install Rails or have version lower than 5.1 Please install proper version.", :red
18
18
  abort
19
19
  end
20
20
 
21
- if `yarn --version` =~ /command not found/
21
+ if (system "yarn --version").nil?
22
22
  say "You need to install yarn on your system to manage javascript assets", :red
23
23
  abort
24
24
  end
25
25
 
26
+ if (system "webpack").nil?
27
+ say "You need to install webpack", :red
28
+ abort
29
+ end
30
+
26
31
  unless Config.check_settings.empty?
27
32
  say Config.check_settings, :green
28
33
  say 'Check structure of your config file - it seems you are missing required options mentioned above', :red
@@ -54,7 +59,7 @@ class Starter < Thor
54
59
  def new project_name
55
60
  @project_name = project_name
56
61
  run "rails new #{@project_name} -T --skip-bundle --webpack"
57
- run 'rake webpacker:install'
62
+ #run 'rake webpacker:install'
58
63
 
59
64
  @project_path = "#{@dir}/#{@project_name}"
60
65
  @project_label = @project_name.capitalize.gsub('_', ' ')
@@ -1,3 +1,3 @@
1
1
  module R5
2
- VERSION = "0.4.0.2"
2
+ VERSION = "0.4.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r5
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0.2
4
+ version: 0.4.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - mousse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-16 00:00:00.000000000 Z
11
+ date: 2017-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler