npm-pipeline-rails 1.7.0 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,36 @@
1
+ require 'rails/generators/base'
2
+
3
+ module NpmPipeline
4
+ module Generators
5
+ class WebpackGenerator < Rails::Generators::Base
6
+ desc 'Adds Webpack configuration via npm-pipeline-rails'
7
+ source_root File.expand_path('../webpack', __FILE__)
8
+
9
+ def copy_files
10
+ [
11
+ 'package.json',
12
+ 'yarn.lock',
13
+ 'webpack.config.js',
14
+ 'app/webpack/css/app.js',
15
+ 'app/webpack/css/components/example.scss',
16
+ 'app/webpack/js/app.js',
17
+ 'app/webpack/js/behaviors/example.js'
18
+ ].each { |f| template f, f }
19
+ end
20
+
21
+ def update_assets
22
+ append_to_file 'app/assets/stylesheets/application.css',
23
+ "/*\n *= require webpack/app\n */\n"
24
+ append_to_file 'app/assets/javascripts/application.js',
25
+ "//= require webpack/app\n"
26
+ end
27
+
28
+ def update_gitignore
29
+ append_to_file '.gitignore',
30
+ "\n/node_modules" +
31
+ "\n/vendor/assets/stylesheets/webpack" +
32
+ "\n/vendor/assets/javascripts/webpack\n"
33
+ end
34
+ end
35
+ end
36
+ end
@@ -1,3 +1,3 @@
1
1
  module NpmPipelineRails
2
- VERSION = '1.7.0'
2
+ VERSION = '1.8.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: npm-pipeline-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rico Sta. Cruz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-20 00:00:00.000000000 Z
11
+ date: 2017-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -125,6 +125,15 @@ files:
125
125
  - lib/generators/npm_pipeline/gulp/gulpfile.js
126
126
  - lib/generators/npm_pipeline/gulp/package.json
127
127
  - lib/generators/npm_pipeline/gulp_generator.rb
128
+ - lib/generators/npm_pipeline/webpack/app/webpack/css/app.js
129
+ - lib/generators/npm_pipeline/webpack/app/webpack/css/components/example.scss
130
+ - lib/generators/npm_pipeline/webpack/app/webpack/js/app.js
131
+ - lib/generators/npm_pipeline/webpack/app/webpack/js/behaviors/example.js
132
+ - lib/generators/npm_pipeline/webpack/package.json
133
+ - lib/generators/npm_pipeline/webpack/simple-webpack.config.js
134
+ - lib/generators/npm_pipeline/webpack/webpack.config.js
135
+ - lib/generators/npm_pipeline/webpack/yarn.lock
136
+ - lib/generators/npm_pipeline/webpack_generator.rb
128
137
  - lib/npm-pipeline-rails.rb
129
138
  - lib/npm-pipeline-rails/railtie.rb
130
139
  - lib/npm-pipeline-rails/version.rb