engine_pack 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.tool-versions +1 -0
- data/Gemfile.lock +1 -1
- data/README.md +37 -3
- data/lib/engine_pack/version.rb +1 -1
- data/lib/generators/engine_pack/install_generator.rb +26 -0
- data/lib/generators/templates/POST_INSTALL +8 -0
- data/lib/generators/templates/initializer.rb +6 -0
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55cf65d9502f706e9b94fac87dc958775805d62e57514434493e28981940cd25
|
4
|
+
data.tar.gz: a4925f67e6109284050bdc87777ec074051ce4b93f59f10461fbfc645a4f6b00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d567eb2e14598458d11a8c788e905803ba7d39800acc4807ffb6683243201ede18a6fc67fca6ed3718911b27ca2a9dd13331034741c9b6479876f8e57c3acd93
|
7
|
+
data.tar.gz: 382366d354be4cadc32b937818fcd286a3ab36977ab96cfecb8c0ed5f5967b60e40aafb166b6ce7757e00efec1f5b403eea700b8a2ff861be18829b592d3ca9e
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 2.5.8
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -14,13 +14,47 @@ And then execute:
|
|
14
14
|
|
15
15
|
$ bundle install
|
16
16
|
|
17
|
-
|
17
|
+
Finally, run the generator:
|
18
18
|
|
19
|
-
$
|
19
|
+
$ rails generate engine_pack:install
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
|
23
|
+
It works by hooking into the JavaScript package managers preinstall hook via a Rake task. The Rake task copies the `files` specified in the `package.json` to a temporary directory and then install that directory as a local package.
|
24
|
+
|
25
|
+
### Configuration
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
require 'engine_pack'
|
29
|
+
|
30
|
+
EnginePack.configure do |config|
|
31
|
+
config.package_manager = :npm
|
32
|
+
config.engines = %w[
|
33
|
+
engine1
|
34
|
+
engine2
|
35
|
+
]
|
36
|
+
end
|
37
|
+
|
38
|
+
```
|
39
|
+
|
40
|
+
#### Configuration Options
|
41
|
+
|
42
|
+
Option/Method | Description
|
43
|
+
--- | ---
|
44
|
+
`package_manager` | The package manager you are using with your application. Currently supports `:npm` and `:yarn`. (default: `:npm`)
|
45
|
+
`engine` | An array of the names of the gems/engines to include.
|
46
|
+
|
47
|
+
### Preinstall Hook
|
48
|
+
|
49
|
+
You'll need to add the `preinstall` script to your applications `package.json` in the `scripts` property.
|
50
|
+
|
51
|
+
```json
|
52
|
+
{
|
53
|
+
"scripts": {
|
54
|
+
"preinstall": "bundle exec rails engine_pack:preinstall"
|
55
|
+
}
|
56
|
+
}
|
57
|
+
```
|
24
58
|
|
25
59
|
## Development
|
26
60
|
|
data/lib/engine_pack/version.rb
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails/generators/named_base'
|
4
|
+
|
5
|
+
module EnginePack
|
6
|
+
module Generators
|
7
|
+
class InstallGenerator < Rails::Generators::Base
|
8
|
+
source_root File.expand_path('../templates', __dir__)
|
9
|
+
|
10
|
+
desc 'Generates configuration for EnginePack.'
|
11
|
+
|
12
|
+
class_option :package_manager,
|
13
|
+
desc: 'Specify the JavaScript package manager to configure. (yarn, npm)',
|
14
|
+
type: :string,
|
15
|
+
default: 'npm'
|
16
|
+
|
17
|
+
def copy_initializer
|
18
|
+
template 'initializer.rb', 'config/initializers/engine_pack.rb'
|
19
|
+
end
|
20
|
+
|
21
|
+
def show_post_install
|
22
|
+
readme 'POST_INSTAll'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
|
2
|
+
===============================================================================
|
3
|
+
|
4
|
+
Add the following to your package.json scripts:
|
5
|
+
|
6
|
+
"preinstall": "bundle exec rails engine_pack:preinstall"
|
7
|
+
|
8
|
+
===============================================================================
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: engine_pack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaric Pittman
|
@@ -110,6 +110,7 @@ files:
|
|
110
110
|
- ".devcontainer/devcontainer.json"
|
111
111
|
- ".gitignore"
|
112
112
|
- ".rspec"
|
113
|
+
- ".tool-versions"
|
113
114
|
- ".travis.yml"
|
114
115
|
- CHANGELOG.md
|
115
116
|
- CODE_OF_CONDUCT.md
|
@@ -135,6 +136,9 @@ files:
|
|
135
136
|
- lib/engine_pack/railtie.rb
|
136
137
|
- lib/engine_pack/tasks/preinstall.rake
|
137
138
|
- lib/engine_pack/version.rb
|
139
|
+
- lib/generators/engine_pack/install_generator.rb
|
140
|
+
- lib/generators/templates/POST_INSTALL
|
141
|
+
- lib/generators/templates/initializer.rb
|
138
142
|
homepage: https://github.com/aaricpittman/engine-pack
|
139
143
|
licenses:
|
140
144
|
- MIT
|