npm-pipeline-rails 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +7 -0
- data/lib/npm-pipeline-rails/version.rb +1 -1
- data/npm-pipeline-rails.gemspec +1 -1
- metadata +1 -7
- data/docs/brunch.md +0 -67
- data/docs/gulp.md +0 -67
- data/docs/motivation.md +0 -35
- data/docs/screenshots/build.png +0 -0
- data/docs/screenshots/full.png +0 -0
- data/docs/screenshots/server.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33f1c5e32f28a8965aa36c2d1ce2cec54a3b22c3
|
4
|
+
data.tar.gz: 75670cfba6475b6b21419611ff6857f838562810
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e778eaaaaaf92b9a3252f5e07b89719c40089c8540fed1f116940e4760c6b227d27cea3d81c7d6f8f7ac7a4033af3ad7b49c06cf42568a1a76419ca3a50e9fc
|
7
|
+
data.tar.gz: b52b034e540931e69619cabd59a0986b9a31c1853d09e6de05c2a862dea72fb39b7f767b9e6f61ef3610d765accf401bf43a23e0a70b6857ec6d34d57cd960b6
|
data/HISTORY.md
CHANGED
data/npm-pipeline-rails.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.homepage = 'https://github.com/rstacruz/npm-pipeline-rails'
|
15
15
|
spec.license = 'MIT'
|
16
16
|
|
17
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(examples|test|spec|features)/}) }
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(docs|examples|test|spec|features)/}) }
|
18
18
|
spec.bindir = 'exe'
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ['lib']
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: npm-pipeline-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rico Sta. Cruz
|
@@ -106,12 +106,6 @@ files:
|
|
106
106
|
- Gemfile
|
107
107
|
- HISTORY.md
|
108
108
|
- README.md
|
109
|
-
- docs/brunch.md
|
110
|
-
- docs/gulp.md
|
111
|
-
- docs/motivation.md
|
112
|
-
- docs/screenshots/build.png
|
113
|
-
- docs/screenshots/full.png
|
114
|
-
- docs/screenshots/server.png
|
115
109
|
- lib/generators/npm_pipeline/brunch/brunch-config.js
|
116
110
|
- lib/generators/npm_pipeline/brunch/package.json
|
117
111
|
- lib/generators/npm_pipeline/brunch_generator.rb
|
data/docs/brunch.md
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
# Brunch integration
|
2
|
-
|
3
|
-
Run this to set your project up with a simple Brunch config.
|
4
|
-
|
5
|
-
```sh
|
6
|
-
./bin/rails generate npm_pipeline:brunch
|
7
|
-
```
|
8
|
-
|
9
|
-
## Manual setup
|
10
|
-
|
11
|
-
If you don't want to use the generator, here's what it does.
|
12
|
-
|
13
|
-
#### package.json
|
14
|
-
|
15
|
-
> Set it up with `brunch` and some basic plugins.
|
16
|
-
|
17
|
-
_See:_ [sample package.json](../lib/generators/npm_pipeline/brunch/package.json)
|
18
|
-
|
19
|
-
#### brunch-config.js
|
20
|
-
|
21
|
-
> Set it up to watch source files in `app/brunch`, then put built files into `vendor/assets`.
|
22
|
-
|
23
|
-
_See:_ [sample brunch-config.js](../lib/generators/npm_pipeline/brunch/brunch-config.js)
|
24
|
-
|
25
|
-
#### .gitignore
|
26
|
-
|
27
|
-
> Set it up to ignore Brunch's built files.
|
28
|
-
|
29
|
-
```
|
30
|
-
/node_modules
|
31
|
-
/vendor/assets/stylesheets/brunch
|
32
|
-
/vendor/assets/javascripts/brunch
|
33
|
-
```
|
34
|
-
|
35
|
-
#### app/assets/stylesheets/application.css
|
36
|
-
|
37
|
-
> Set it up to include Brunch's built files. This will load from `vendor/assets/stylesheets/brunch/app.css`, as built by Brunch.
|
38
|
-
|
39
|
-
```css
|
40
|
-
/*
|
41
|
-
*= require brunch/app
|
42
|
-
*/
|
43
|
-
```
|
44
|
-
|
45
|
-
#### app/assets/javascripts/application.js
|
46
|
-
|
47
|
-
> Set it up to include Brunch's built files. This will load from `vendor/assets/javascripts/brunch/app.js`, as built by Brunch.
|
48
|
-
|
49
|
-
```css
|
50
|
-
//= require brunch/app
|
51
|
-
```
|
52
|
-
|
53
|
-
#### app/brunch/
|
54
|
-
|
55
|
-
> Put your source files into `app/brunch`. For instance:
|
56
|
-
|
57
|
-
* `app/brunch/example.css`
|
58
|
-
|
59
|
-
```css
|
60
|
-
* { color: blue }
|
61
|
-
```
|
62
|
-
|
63
|
-
* `app/brunch/example.js`
|
64
|
-
|
65
|
-
```js
|
66
|
-
alert('it works!')
|
67
|
-
```
|
data/docs/gulp.md
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
# Gulp integration
|
2
|
-
|
3
|
-
Run this to set your project up with a simple Gulp config.
|
4
|
-
|
5
|
-
```sh
|
6
|
-
./bin/rails generate npm_pipeline:gulp
|
7
|
-
```
|
8
|
-
|
9
|
-
## Manual setup
|
10
|
-
|
11
|
-
If you don't want to use the generator, here's what it does.
|
12
|
-
|
13
|
-
#### package.json
|
14
|
-
|
15
|
-
> Set up `gulp`, `gulp-cli`, and some basic Gulp plugins.
|
16
|
-
|
17
|
-
_See:_ [sample package.json](../lib/generators/npm_pipeline/gulp/package.json)
|
18
|
-
|
19
|
-
#### gulpfile.js
|
20
|
-
|
21
|
-
> Set it up to watch source files in `app/gulp`, then put built files into `vendor/assets`.
|
22
|
-
|
23
|
-
_See:_ [sample gulpfile.js](../lib/generators/npm_pipeline/gulp/gulpfile.js)
|
24
|
-
|
25
|
-
#### .gitignore
|
26
|
-
|
27
|
-
> Set it up to ignore Gulp's built files.
|
28
|
-
|
29
|
-
```
|
30
|
-
/node_modules
|
31
|
-
/vendor/assets/stylesheets/gulp
|
32
|
-
/vendor/assets/javascripts/gulp
|
33
|
-
```
|
34
|
-
|
35
|
-
#### app/assets/stylesheets/application.css
|
36
|
-
|
37
|
-
> Set it up to include Gulp's built files. This will load from `vendor/assets/stylesheets/gulp/app.css`, as built by Gulp.
|
38
|
-
|
39
|
-
```css
|
40
|
-
/*
|
41
|
-
*= require gulp/app
|
42
|
-
*/
|
43
|
-
```
|
44
|
-
|
45
|
-
#### app/assets/javascripts/application.js
|
46
|
-
|
47
|
-
> Set it up to include Gulp's built files. This will load from `vendor/assets/javascripts/gulp/app.js`, as built by Gulp.
|
48
|
-
|
49
|
-
```css
|
50
|
-
//= require gulp/app
|
51
|
-
```
|
52
|
-
|
53
|
-
#### app/gulp/
|
54
|
-
|
55
|
-
> Put your source files into `app/gulp`. For instance:
|
56
|
-
|
57
|
-
* `app/gulp/example.css`
|
58
|
-
|
59
|
-
```css
|
60
|
-
* { color: blue }
|
61
|
-
```
|
62
|
-
|
63
|
-
* `app/gulp/example.js`
|
64
|
-
|
65
|
-
```js
|
66
|
-
alert('it works!')
|
67
|
-
```
|
data/docs/motivation.md
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
# Motivation
|
2
|
-
|
3
|
-
Rails's asset pipeline was a great step forward for Rails 3. For today's requirements however, it doesn't always come with all the tools you need. Here's a portrait of Rails's shortcomings with respect to CSS/JS development in 2016:
|
4
|
-
|
5
|
-
* __npm assets:__ Frontend packages are now usually hosted in [npm], but there's no easy solution to integrate npm with Rails. Putting files into `vendor/assets` should be a thing of the past.
|
6
|
-
|
7
|
-
* __Auto-reload:__ Automatic CSS reloading can be done with [guard-livereload], but is unwieldy at best. They require too much configuration and mental overhead to maintain.
|
8
|
-
|
9
|
-
* __Modern CSS tools:__ Integrating modern CSS tools like [libsass] and [postcss] can be done, but is hackish and slow. It has to invoke a separate Node.js process for each CSS file rather than keeping those tools running in the background. Some newer CSS pre/post processors like [Myth](http://www.myth.io/) don't have production-grade integrations with Rails.
|
10
|
-
|
11
|
-
* __Modern JS tools:__ Working with complex frontends typically need [Webpack] or [Browserify]. While integrations for these exist, they can be slow and unreliable.
|
12
|
-
|
13
|
-
## Using Node.js
|
14
|
-
|
15
|
-
npm-pipeline-rails lets you outsource asset building complexities to Node.js-based tools, which is the gold stardard for asset tooling nowadays.
|
16
|
-
|
17
|
-
It doesn't lock you into one specific solution; you can use npm-pipeline-rails for any task manager. I recommend [Brunch] for its ease-of-use and familiarity with Rails's asset pipeline's features. [Gulp] and [Grunt] are also popular choices.
|
18
|
-
|
19
|
-
## Brunch
|
20
|
-
|
21
|
-
You can use [Brunch] with Rails with ease using npm-pipeline-rails. With Brunch, you get [automatic code reloading][auto-reload-brunch], easier integration with [postcss][postcss-brunch], `require()` support, and more. You may even hook [Browserify][browserify-brunch] if you need it.
|
22
|
-
|
23
|
-
[guard-livereload]: http://rubygems.org/gems/guard-livereload
|
24
|
-
[npm]: http://npmjs.com/
|
25
|
-
[libsass]: http://sass-lang.com/libsass
|
26
|
-
[postcss]: https://github.com/postcss/postcss
|
27
|
-
[auto-reload-brunch]: https://www.npmjs.com/package/auto-reload-brunch
|
28
|
-
[postcss-brunch]: https://www.npmjs.com/package/postcss-brunch
|
29
|
-
[browserify-brunch]: https://www.npmjs.com/package/browserify-brunch
|
30
|
-
[Grunt]: http://gruntjs.com/
|
31
|
-
[Webpack]: https://webpack.github.io/
|
32
|
-
[Brunch]: http://brunch.io/
|
33
|
-
[Browserify]: http://browserify.org/
|
34
|
-
[Gulp]: http://gulpjs.com/
|
35
|
-
[Grunt]: http://gruntjs.com/
|
data/docs/screenshots/build.png
DELETED
Binary file
|
data/docs/screenshots/full.png
DELETED
Binary file
|
data/docs/screenshots/server.png
DELETED
Binary file
|