nodo 1.5.6 → 1.6.0

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
  SHA256:
3
- metadata.gz: 650d220075d68a34268a03f2e68587b1caab13f47707c8b44f7cb7d05f5a5588
4
- data.tar.gz: 0b73f0cd827a1ab364975d3559f64f2d9c49afe265759715f92d23f133bab10c
3
+ metadata.gz: 421dba598b565369d200c90c8b095786f7b0a98de7c97e88c6927b59b64591a0
4
+ data.tar.gz: c6ba40e8873c90713edf4cc0887dcf64c3e7b9ea4629f4d97e3fc3c8c58218b9
5
5
  SHA512:
6
- metadata.gz: 0c1049cd1e574c0a7ec503ef01ae735d7b3ca33d21695a1a76c4c8f5c92f0914db58b59136a7ea0bcf17b83f9c6776817b8b4890061e6c442e414c5476d80037
7
- data.tar.gz: d5fd39f74f9ebfabaec0463dbf7234e6da34a73b3167f2580fb6ac276f52f6aef433156ef0917b4a5c9c344f1dfc6d0f28e7c1af1bfe329829c5c87068d932dd
6
+ metadata.gz: 58410d1f53c78f40314ae24ea5f6e7d2aeca99f37aeeb6495ccdf0ee8a1fe903c956ad23462cba48ad38132df5614b3f354ee6c09638f52d47fe78e1e90d3064
7
+ data.tar.gz: 8374444cbbc7257b206fb17abd3470df3488885ae843e414bca3e645cf6c9f9e9d91d6de6f354e5f7fe4a1a98d780f04562df89752286851f8727d86e3c88aa9
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
- [![Gem Version](https://badge.fury.io/rb/nodo.svg)](http://badge.fury.io/rb/nodo) [![build](https://github.com/mtgrosser/nodo/actions/workflows/build.yml/badge.svg)](https://github.com/mtgrosser/nodo/actions/workflows/build.yml)
1
+ [![Gem Version](https://badge.fury.io/rb/nodo.svg)](http://badge.fury.io/rb/nodo)
2
+ [![build](https://github.com/mtgrosser/nodo/actions/workflows/build.yml/badge.svg)](https://github.com/mtgrosser/nodo/actions/workflows/build.yml)
2
3
 
3
4
  # Nōdo – call Node.js from Ruby
4
5
 
@@ -107,13 +108,7 @@ To set a custom path:
107
108
  Nodo.modules_root = 'path/to/node_modules'
108
109
  ```
109
110
 
110
- For Rails applications, it will be set to `vendor/node_modules`.
111
- To use the Rails 6 default of putting `node_modules` to `RAILS_ROOT`:
112
-
113
- ```ruby
114
- # config/initializers/nodo.rb
115
- Nodo.modules_root = Rails.root.join('node_modules')
116
- ```
111
+ Also see: [Clean your Rails root](#Clean-your-Rails-root)
117
112
 
118
113
  ### Defining JS constants
119
114
 
@@ -201,6 +196,7 @@ Nodo.logger = Logger.new('nodo.log')
201
196
 
202
197
  In Rails applications, `Rails.logger` will automatically be set.
203
198
 
199
+
204
200
  ### Debugging
205
201
 
206
202
  To get verbose debug output, set
@@ -211,3 +207,23 @@ Nodo.debug = true
211
207
 
212
208
  before instantiating any worker instances. The debug mode will be active during
213
209
  the current process run.
210
+
211
+
212
+ #### Clean your Rails root
213
+
214
+ For Rails applications, Nodo enables you to move `node_modules`, `package.json` and
215
+ `yarn.lock` into your application's `vendor` folder by setting the `NODE_PATH` in
216
+ an initializer:
217
+
218
+ ```ruby
219
+ # config/initializers/nodo.rb
220
+ Nodo.modules_root = Rails.root.join('vendor', 'node_modules')
221
+ ```
222
+
223
+ The rationale behind this is NPM modules being external vendor dependencies, which
224
+ should not clutter the application root directory.
225
+
226
+ With this new default, all `yarn` operations should be done after `cd`ing to `vendor`.
227
+
228
+ This repo provides an [adapted version](https://github.com/mtgrosser/nodo/blob/master/install/yarn.rake)
229
+ of the `yarn:install` rake task which will automatically take care of the vendored module location.
data/lib/nodo/railtie.rb CHANGED
@@ -3,7 +3,6 @@ require 'active_support'
3
3
 
4
4
  class Nodo::Railtie < Rails::Railtie
5
5
  initializer 'nodo' do |app|
6
- Nodo.modules_root = Rails.root.join('vendor', 'node_modules')
7
6
  Nodo.env['NODE_ENV'] = Rails.env.to_s
8
7
  Nodo.logger = Rails.logger
9
8
  end
data/lib/nodo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Nodo
2
- VERSION = '1.5.6'
2
+ VERSION = '1.6.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nodo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.6
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthias Grosser