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 +4 -4
- data/README.md +24 -8
- data/lib/nodo/railtie.rb +0 -1
- data/lib/nodo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 421dba598b565369d200c90c8b095786f7b0a98de7c97e88c6927b59b64591a0
|
4
|
+
data.tar.gz: c6ba40e8873c90713edf4cc0887dcf64c3e7b9ea4629f4d97e3fc3c8c58218b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
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
|
-
|
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
data/lib/nodo/version.rb
CHANGED