webpacker_cli 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +51 -0
- data/.travis.yml +25 -0
- data/Gemfile +6 -0
- data/LICENSE +165 -0
- data/README.md +69 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/bin/webpacker-cli +51 -0
- data/lib/webpacker_cli.rb +78 -0
- data/lib/webpacker_cli/rails_template.rb +51 -0
- data/lib/webpacker_cli/version.rb +3 -0
- data/webpacker_cli.gemspec +33 -0
- metadata +157 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 30cce711cba89de6d347532e552ed09a38b731edceaad7743d6a9063f3ff34ce
|
4
|
+
data.tar.gz: fefb60f7b2a7c130f5cbb6cc258a8db97aa4474fec0737eeb64d10a7278bbb8a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c707cc54c6f6ae04e4fe5b6cee5b101d64f02460aa55427c81e1e74ee5e891ada179690441b7bc1c59f6d4552dee1d04ecb30bc47b59dce07e08e944f9225d30
|
7
|
+
data.tar.gz: fb09b4004d5b557648503661204527762ecb1c3ec6902923bffe73af33fdcd3475a64f6462ac1ea1d59ae3387da2e38e33ec24549434f949c0b188783c8caf9d
|
data/.gitignore
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
*.swp
|
4
|
+
/.config
|
5
|
+
/coverage/
|
6
|
+
/InstalledFiles
|
7
|
+
/pkg/
|
8
|
+
/spec/reports/
|
9
|
+
/spec/examples.txt
|
10
|
+
/test/tmp/
|
11
|
+
/test/version_tmp/
|
12
|
+
/tmp/
|
13
|
+
|
14
|
+
# Used by dotenv library to load environment variables.
|
15
|
+
# .env
|
16
|
+
|
17
|
+
## Specific to RubyMotion:
|
18
|
+
.dat*
|
19
|
+
.repl_history
|
20
|
+
build/
|
21
|
+
*.bridgesupport
|
22
|
+
build-iPhoneOS/
|
23
|
+
build-iPhoneSimulator/
|
24
|
+
|
25
|
+
## Specific to RubyMotion (use of CocoaPods):
|
26
|
+
#
|
27
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
28
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
29
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
30
|
+
#
|
31
|
+
# vendor/Pods/
|
32
|
+
|
33
|
+
## Documentation cache and generated files:
|
34
|
+
/.yardoc/
|
35
|
+
/_yardoc/
|
36
|
+
/doc/
|
37
|
+
/rdoc/
|
38
|
+
|
39
|
+
## Environment normalization:
|
40
|
+
/.bundle/
|
41
|
+
/vendor/bundle
|
42
|
+
/lib/bundler/man/
|
43
|
+
|
44
|
+
# for a library or gem, you might want to ignore these files since the code is
|
45
|
+
# intended to run in multiple environments; otherwise, check them in:
|
46
|
+
Gemfile.lock
|
47
|
+
.ruby-version
|
48
|
+
.ruby-gemset
|
49
|
+
|
50
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
51
|
+
.rvmrc
|
data/.travis.yml
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 2.3.8
|
4
|
+
- 2.4.5
|
5
|
+
- 2.5.3
|
6
|
+
|
7
|
+
os:
|
8
|
+
- linux
|
9
|
+
- osx
|
10
|
+
|
11
|
+
cache:
|
12
|
+
bundler: true
|
13
|
+
|
14
|
+
before_install:
|
15
|
+
- ruby --version
|
16
|
+
- ruby -e 'require "pp"; pp RbConfig::CONFIG'
|
17
|
+
|
18
|
+
install:
|
19
|
+
- nvm install node
|
20
|
+
- node -v
|
21
|
+
- npm i -g yarn
|
22
|
+
|
23
|
+
script:
|
24
|
+
- bundle install
|
25
|
+
- bundle exec rake test
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,165 @@
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
2
|
+
Version 3, 29 June 2007
|
3
|
+
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
6
|
+
of this license document, but changing it is not allowed.
|
7
|
+
|
8
|
+
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
11
|
+
License, supplemented by the additional permissions listed below.
|
12
|
+
|
13
|
+
0. Additional Definitions.
|
14
|
+
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
17
|
+
General Public License.
|
18
|
+
|
19
|
+
"The Library" refers to a covered work governed by this License,
|
20
|
+
other than an Application or a Combined Work as defined below.
|
21
|
+
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
25
|
+
of using an interface provided by the Library.
|
26
|
+
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
28
|
+
Application with the Library. The particular version of the Library
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
30
|
+
Version".
|
31
|
+
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
35
|
+
based on the Application, and not on the Linked Version.
|
36
|
+
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
38
|
+
object code and/or source code for the Application, including any data
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
41
|
+
|
42
|
+
1. Exception to Section 3 of the GNU GPL.
|
43
|
+
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
46
|
+
|
47
|
+
2. Conveying Modified Versions.
|
48
|
+
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
51
|
+
that uses the facility (other than as an argument passed when the
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
53
|
+
version:
|
54
|
+
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
56
|
+
ensure that, in the event an Application does not supply the
|
57
|
+
function or data, the facility still operates, and performs
|
58
|
+
whatever part of its purpose remains meaningful, or
|
59
|
+
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
61
|
+
this License applicable to that copy.
|
62
|
+
|
63
|
+
3. Object Code Incorporating Material from Library Header Files.
|
64
|
+
|
65
|
+
The object code form of an Application may incorporate material from
|
66
|
+
a header file that is part of the Library. You may convey such object
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
68
|
+
material is not limited to numerical parameters, data structure
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
71
|
+
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
73
|
+
Library is used in it and that the Library and its use are
|
74
|
+
covered by this License.
|
75
|
+
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
77
|
+
document.
|
78
|
+
|
79
|
+
4. Combined Works.
|
80
|
+
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
82
|
+
taken together, effectively do not restrict modification of the
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
85
|
+
the following:
|
86
|
+
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
88
|
+
the Library is used in it and that the Library and its use are
|
89
|
+
covered by this License.
|
90
|
+
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
92
|
+
document.
|
93
|
+
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
95
|
+
execution, include the copyright notice for the Library among
|
96
|
+
these notices, as well as a reference directing the user to the
|
97
|
+
copies of the GNU GPL and this license document.
|
98
|
+
|
99
|
+
d) Do one of the following:
|
100
|
+
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
102
|
+
License, and the Corresponding Application Code in a form
|
103
|
+
suitable for, and under terms that permit, the user to
|
104
|
+
recombine or relink the Application with a modified version of
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
107
|
+
Corresponding Source.
|
108
|
+
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
111
|
+
a copy of the Library already present on the user's computer
|
112
|
+
system, and (b) will operate properly with a modified version
|
113
|
+
of the Library that is interface-compatible with the Linked
|
114
|
+
Version.
|
115
|
+
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
117
|
+
be required to provide such information under section 6 of the
|
118
|
+
GNU GPL, and only to the extent that such information is
|
119
|
+
necessary to install and execute a modified version of the
|
120
|
+
Combined Work produced by recombining or relinking the
|
121
|
+
Application with a modified version of the Linked Version. (If
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
126
|
+
for conveying Corresponding Source.)
|
127
|
+
|
128
|
+
5. Combined Libraries.
|
129
|
+
|
130
|
+
You may place library facilities that are a work based on the
|
131
|
+
Library side by side in a single library together with other library
|
132
|
+
facilities that are not Applications and are not covered by this
|
133
|
+
License, and convey such a combined library under terms of your
|
134
|
+
choice, if you do both of the following:
|
135
|
+
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
137
|
+
on the Library, uncombined with any other library facilities,
|
138
|
+
conveyed under the terms of this License.
|
139
|
+
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
141
|
+
is a work based on the Library, and explaining where to find the
|
142
|
+
accompanying uncombined form of the same work.
|
143
|
+
|
144
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
145
|
+
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
148
|
+
versions will be similar in spirit to the present version, but may
|
149
|
+
differ in detail to address new problems or concerns.
|
150
|
+
|
151
|
+
Each version is given a distinguishing version number. If the
|
152
|
+
Library as you received it specifies that a certain numbered version
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
154
|
+
applies to it, you have the option of following the terms and
|
155
|
+
conditions either of that published version or of any later version
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
160
|
+
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
164
|
+
permanent authorization for you to choose that version for the
|
165
|
+
Library.
|
data/README.md
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/webpacker_cli.svg)](http://badge.fury.io/rb/webpacker_cli)
|
2
|
+
[![Build Status](https://travis-ci.org/danielpclark/webpacker-cli.svg)](https://travis-ci.org/danielpclark/webpacker-cli)
|
3
|
+
|
4
|
+
# WebpackerCli
|
5
|
+
|
6
|
+
Bringing the impressive work of the Rails' **Webpacker** project **to be available for frameworks
|
7
|
+
other than Rails**. This is done by mocking the minimal amount of Rails for the Webpacker's
|
8
|
+
Rake commands to be able to run.
|
9
|
+
|
10
|
+
Webpacker itself takes Webpack, which has a primary focus for pre-processing JavaScript related
|
11
|
+
code, and make pre-processing other kinds of files such as Css, Sass, Images, Vue, React,
|
12
|
+
CoffeeScript, and other similar content as simple as a couple very minor edits. Without Webpacker
|
13
|
+
you would need to go through quite a bit of extra work to get Webpack to handle non JS items.
|
14
|
+
|
15
|
+
This project makes asset packing and cache invalidation easy for any web framework by bringing
|
16
|
+
Webpacker's tooling to the command line. This cli tool is not meant to be used in a Rails project
|
17
|
+
_(at least not until it's designed to not overwrite a few files that exist in Rails)_.
|
18
|
+
|
19
|
+
## Installation
|
20
|
+
|
21
|
+
Install it yourself as:
|
22
|
+
|
23
|
+
$ gem install webpacker_cli
|
24
|
+
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
General help is found with
|
28
|
+
|
29
|
+
$ webpacker-cli --help
|
30
|
+
|
31
|
+
The help menu will change after initialization within the project directory.
|
32
|
+
|
33
|
+
And get started using it in your target project with:
|
34
|
+
|
35
|
+
$ webpacker-cli init
|
36
|
+
|
37
|
+
This creates the minimum files for Webpacker to work and runs `bundle` & `rake webpacker:install`.
|
38
|
+
From here you have your configuration files for Webpack/Webpacker in the `config` directory.
|
39
|
+
|
40
|
+
To compile your assets you may now run:
|
41
|
+
|
42
|
+
$ webpacker-cli compile
|
43
|
+
|
44
|
+
To add support for another file type you can add a file to the `config/webpack/loaders`
|
45
|
+
directory. Then load it from `config/webpack/environment.js` and lastly add the file extension
|
46
|
+
to the `config/webpacker.yml` under `default.extensions`. Be sure to add the JS package with
|
47
|
+
a command like `yarn add`.
|
48
|
+
|
49
|
+
> Server Tip: It is recommended to compile your assets upon deploy rather than per web request.
|
50
|
+
|
51
|
+
Once your assets are compiled for deployment you will need to have your web application route
|
52
|
+
the assets by the file stored in `public/packs/manifest.json` which will look similar to:
|
53
|
+
|
54
|
+
{
|
55
|
+
"application.js": "/packs/application-9578bdd78b657fa4358f.js",
|
56
|
+
"application.js.map": "/packs/application-9578bdd78b657fa4358f.js.map"
|
57
|
+
}
|
58
|
+
|
59
|
+
This way Webpacker handles cache invalidation for you whenever you make changes to your assets.
|
60
|
+
So the `manifest.json` is the key-value pair of data used to be substitued in your web page views
|
61
|
+
for the `src` references.
|
62
|
+
|
63
|
+
## Contributing
|
64
|
+
|
65
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/danielpclark/webpacker-cli
|
66
|
+
|
67
|
+
## License
|
68
|
+
|
69
|
+
The gem is available as open source under the terms of the [GNU Lesser General Public License version 3](https://opensource.org/licenses/LGPL-3.0).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "webpacker/cli"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/bin/webpacker-cli
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
|
4
|
+
|
5
|
+
require 'tty/command'
|
6
|
+
require 'webpacker_cli'
|
7
|
+
|
8
|
+
def init_menu
|
9
|
+
<<~INITIAL_MENU
|
10
|
+
To first initialize Webpacker in this project run the following command.
|
11
|
+
|
12
|
+
webpacker-cli init
|
13
|
+
|
14
|
+
This will generate the minimal content to use webpacker.
|
15
|
+
|
16
|
+
Dependencies:
|
17
|
+
* Ruby 2.2+
|
18
|
+
* Node.js 6.14.0+
|
19
|
+
* Yarn 1.x+
|
20
|
+
INITIAL_MENU
|
21
|
+
end
|
22
|
+
|
23
|
+
# For menu creation
|
24
|
+
def rake_webpacker
|
25
|
+
TTY::Command.
|
26
|
+
new(printer: :null).
|
27
|
+
run!('rake webpacker')
|
28
|
+
end
|
29
|
+
|
30
|
+
def usage
|
31
|
+
result = rake_webpacker
|
32
|
+
if result.failure?
|
33
|
+
puts init_menu
|
34
|
+
else
|
35
|
+
puts result.out.gsub(/webpacker:/, "webpacker-cli ")
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
case ARGV[0]
|
40
|
+
when /^(?:--help|-h)$/ then
|
41
|
+
usage
|
42
|
+
when /^init$/
|
43
|
+
puts "INITIALIZING WEBPACKER…"
|
44
|
+
WebpackerCli.init()
|
45
|
+
when /^[a-z:]+$/
|
46
|
+
TTY::Command.
|
47
|
+
new(color: false, uuid: false).
|
48
|
+
run("rake webpacker:#{ARGV.join(' ')}")
|
49
|
+
else
|
50
|
+
usage
|
51
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
require 'webpacker_cli/version'
|
2
|
+
require 'webpacker_cli/rails_template'
|
3
|
+
require 'fileutils'
|
4
|
+
require 'tty/command'
|
5
|
+
require 'bundler'
|
6
|
+
|
7
|
+
module WebpackerCli
|
8
|
+
FILE_MANIFEST = %w[
|
9
|
+
bin
|
10
|
+
bin/rails
|
11
|
+
config
|
12
|
+
config/application.rb
|
13
|
+
config/webpack/development.js
|
14
|
+
config/webpack/environment.js
|
15
|
+
config/webpack/loaders
|
16
|
+
config/webpack/production.js
|
17
|
+
config/webpack/test.js
|
18
|
+
Gemfile
|
19
|
+
Rakefile
|
20
|
+
]
|
21
|
+
|
22
|
+
class << self
|
23
|
+
def init(**opts)
|
24
|
+
dir = opts.fetch(:dir) { Dir.pwd }
|
25
|
+
test = opts.fetch(:test) { !!ENV['WEBPACKER_CLI'].to_s['TEST'] }
|
26
|
+
|
27
|
+
Dir.chdir(dir) do
|
28
|
+
File.open('Gemfile', 'w') {|file|
|
29
|
+
file.write(WebpackerCli::RailsTemplate.gemfile(test))
|
30
|
+
}
|
31
|
+
File.open('Rakefile', 'w') {|file| file.write(WebpackerCli::RailsTemplate.rakefile) }
|
32
|
+
|
33
|
+
FileUtils.mkdir_p('bin')
|
34
|
+
File.open('bin/rails', 'w') {|file| file.write(WebpackerCli::RailsTemplate.bin_rails) }
|
35
|
+
|
36
|
+
FileUtils.mkdir_p('config/webpack/loaders')
|
37
|
+
File.open('config/application.rb', 'w') {|file| file.write(WebpackerCli::RailsTemplate.config_application) }
|
38
|
+
|
39
|
+
env = {
|
40
|
+
BUNDLE_GEMFILE: "#{dir}/Gemfile"
|
41
|
+
}
|
42
|
+
|
43
|
+
if test
|
44
|
+
env.update( {
|
45
|
+
GEM_HOME: ENV["GEM_HOME"],
|
46
|
+
GEM_PATH: ENV["GEM_PATH"],
|
47
|
+
})
|
48
|
+
end
|
49
|
+
|
50
|
+
bundler_env(test) do
|
51
|
+
TTY::Command.
|
52
|
+
new(color: false, uuid: false).
|
53
|
+
run(env, 'bundle install', chdir: dir)
|
54
|
+
|
55
|
+
TTY::Command.
|
56
|
+
new(color: false, uuid: false).
|
57
|
+
run(env, "bundle exec #{executable} install", chdir: dir)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def bundler_env(test)
|
63
|
+
if test
|
64
|
+
Bundler.with_clean_env { yield }
|
65
|
+
else
|
66
|
+
yield
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def executable
|
71
|
+
begin
|
72
|
+
Gem.bin_path("webpacker_cli", "webpacker-cli")
|
73
|
+
rescue
|
74
|
+
File.expand_path('../bin/webpacker-cli', __dir__)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module WebpackerCli
|
2
|
+
module RailsTemplate
|
3
|
+
class << self
|
4
|
+
def gemfile(test = false)
|
5
|
+
%Q$source 'https://rubygems.org'
|
6
|
+
git_source(:github) { |repo| "https://github.com/\#{repo}.git" }
|
7
|
+
|
8
|
+
gem 'rake', '>= 11'
|
9
|
+
gem 'webpacker_cli', '#{WebpackerCli::VERSION}'#{
|
10
|
+
if test; ", path: '#{File.expand_path('../', __dir__)}'" end
|
11
|
+
}
|
12
|
+
$ + gemspec_deps
|
13
|
+
end
|
14
|
+
|
15
|
+
def rakefile
|
16
|
+
%q$require_relative "config/application"
|
17
|
+
|
18
|
+
Rails.application.load_tasks$
|
19
|
+
end
|
20
|
+
|
21
|
+
def config_application
|
22
|
+
%q$require "action_controller/railtie"
|
23
|
+
require "action_view/railtie"
|
24
|
+
require "webpacker"
|
25
|
+
|
26
|
+
module TestApp
|
27
|
+
class Application < ::Rails::Application
|
28
|
+
config.secret_key_base = "abcdef"
|
29
|
+
config.eager_load = true
|
30
|
+
config.webpacker.check_yarn_integrity = false
|
31
|
+
end
|
32
|
+
end$
|
33
|
+
end
|
34
|
+
|
35
|
+
def bin_rails
|
36
|
+
%q$#!/usr/bin/env ruby
|
37
|
+
APP_PATH = File.expand_path('../config/application', __dir__)
|
38
|
+
require 'rails/commands'$
|
39
|
+
end
|
40
|
+
|
41
|
+
def gemspec_deps
|
42
|
+
$LOAD_PATH << File.expand_path('../', __dir__)
|
43
|
+
specs = eval File.read(File.expand_path("../../webpacker_cli.gemspec", __dir__))
|
44
|
+
specs.runtime_dependencies.
|
45
|
+
map {|i| "gem '#{i.name}', '#{i.requirement.requirements.join(' ')}'"}.
|
46
|
+
join("\n")
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
@@ -0,0 +1,33 @@
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require 'webpacker_cli/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'webpacker_cli'
|
7
|
+
spec.version = WebpackerCli::VERSION
|
8
|
+
spec.authors = ['Daniel P. Clark']
|
9
|
+
spec.email = ['6ftdan@gmail.com']
|
10
|
+
|
11
|
+
spec.summary = %q{Bringing Webpacker to any framework.}
|
12
|
+
spec.description = %q{Bringing the impressive work of the Rails' Webpacker project to be available for other frameworks.}
|
13
|
+
spec.license = 'LGPL-3.0'
|
14
|
+
spec.homepage = 'https://github.com/danielpclark/webpacker-cli'
|
15
|
+
spec.required_ruby_version = '>= 2.2'
|
16
|
+
|
17
|
+
# Specify which files should be added to the gem when it is released.
|
18
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
19
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
20
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
21
|
+
end
|
22
|
+
spec.bindir = 'bin'
|
23
|
+
spec.executables = ['webpacker-cli']
|
24
|
+
spec.require_paths = ['lib']
|
25
|
+
|
26
|
+
spec.add_development_dependency 'rake', '>= 11.0'
|
27
|
+
spec.add_development_dependency 'minitest', '~> 5.11'
|
28
|
+
spec.add_development_dependency 'minitest-reporters', '~> 1.1'
|
29
|
+
spec.add_development_dependency 'color_pound_spec_reporter', '~> 0.0.6'
|
30
|
+
spec.add_dependency 'bundler', '~> 1.16'
|
31
|
+
spec.add_dependency 'tty-command', '~> 0.8'
|
32
|
+
spec.add_dependency 'webpacker', '~> 4.0.0.pre.3'
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,157 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: webpacker_cli
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.9.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Daniel P. Clark
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-11-14 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '11.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '11.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: minitest
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '5.11'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '5.11'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest-reporters
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.1'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.1'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: color_pound_spec_reporter
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.0.6
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.0.6
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: bundler
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.16'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.16'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: tty-command
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.8'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.8'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: webpacker
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 4.0.0.pre.3
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 4.0.0.pre.3
|
111
|
+
description: Bringing the impressive work of the Rails' Webpacker project to be available
|
112
|
+
for other frameworks.
|
113
|
+
email:
|
114
|
+
- 6ftdan@gmail.com
|
115
|
+
executables:
|
116
|
+
- webpacker-cli
|
117
|
+
extensions: []
|
118
|
+
extra_rdoc_files: []
|
119
|
+
files:
|
120
|
+
- ".gitignore"
|
121
|
+
- ".travis.yml"
|
122
|
+
- Gemfile
|
123
|
+
- LICENSE
|
124
|
+
- README.md
|
125
|
+
- Rakefile
|
126
|
+
- bin/console
|
127
|
+
- bin/setup
|
128
|
+
- bin/webpacker-cli
|
129
|
+
- lib/webpacker_cli.rb
|
130
|
+
- lib/webpacker_cli/rails_template.rb
|
131
|
+
- lib/webpacker_cli/version.rb
|
132
|
+
- webpacker_cli.gemspec
|
133
|
+
homepage: https://github.com/danielpclark/webpacker-cli
|
134
|
+
licenses:
|
135
|
+
- LGPL-3.0
|
136
|
+
metadata: {}
|
137
|
+
post_install_message:
|
138
|
+
rdoc_options: []
|
139
|
+
require_paths:
|
140
|
+
- lib
|
141
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '2.2'
|
146
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
147
|
+
requirements:
|
148
|
+
- - ">="
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '0'
|
151
|
+
requirements: []
|
152
|
+
rubyforge_project:
|
153
|
+
rubygems_version: 2.7.7
|
154
|
+
signing_key:
|
155
|
+
specification_version: 4
|
156
|
+
summary: Bringing Webpacker to any framework.
|
157
|
+
test_files: []
|