1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/lib/rails/tasks
Kevin Dew f443aac340
Run yarn install relative to Rails.root
We may not always have binstubs relative to the directory we are running
the rake task from. The particular case for this is with a mountable
Rails engine and dummy app that is created to test it. This sets all the
tasks up to run under an `app` namespace in
railties/lib/rails/tasks/engine.rake

This change resolves a problem whereby running `app🧶install` would
have no effect as it would try to run in the plugins bin directory
rather than the test/dummy/bin. This also means that it installs from
test/dummy/package.json and into test/dummy/node_modules which is
behaviour consistent with a normal Rails app.

On a rails engine:

```
➜  tmp rails plugin new rails-plugin --mountable
➜  tmp cd rails-plugin
```

Before this change:

```
➜  rails-plugin rake app🧶install
➜  rails-plugin
```

After this change:

```
➜  rails-plugin rake app🧶install
yarn install v1.9.4
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
  Done in 0.07s.
```

When this change is ran against a normal rails install there is not a
behavioural change:

```
➜  tmp rails new full-app
➜  tmp cd full-app
➜  full-app git:(master) ✗ rake yarn:install
yarn install v1.9.4
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
  Done in 0.09s.
```
2018-09-07 22:11:10 +01:00
..
annotations.rake Respect config setting when output deprecation notice in rake tasks 2018-09-04 20:06:54 +09:00
dev.rake Respect config setting when output deprecation notice in rake tasks 2018-09-04 20:06:54 +09:00
engine.rake Remove DB naming ambiguity 2017-11-26 11:37:48 +01:00
framework.rake Don't generate assets' initializer in app:update task if sprockets is skipped 2018-05-05 13:27:55 +09:00
initializers.rake Respect config setting when output deprecation notice in rake tasks 2018-09-04 20:06:54 +09:00
log.rake Enable Layout/EmptyLinesAroundBlockBody to reduce review cost in the future 2018-07-12 21:29:48 +09:00
middleware.rake Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
misc.rake Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
restart.rake Make restart and dev:cache tasks work when customizing pid file path 2017-08-21 05:44:11 +09:00
routes.rake Make rake routes deprecate before deleting 2018-08-20 08:47:29 +09:00
statistics.rake [Railties] require_relative => require 2017-10-21 22:48:26 +09:00
tmp.rake Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
yarn.rake Run yarn install relative to Rails.root 2018-09-07 22:11:10 +01:00