webpack_driver 0.2.0 → 0.2.1

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
  SHA1:
3
- metadata.gz: 2f323c56cf0e293177fec824035df08310a3ee7c
4
- data.tar.gz: d4c5a165ca89887ee598ff1d7cf30fe299e7c94b
3
+ metadata.gz: 44ba342eead35d1724a2bca92475e051e606bdcc
4
+ data.tar.gz: 01bf6577333fd5b749a815812ed840d000cca105
5
5
  SHA512:
6
- metadata.gz: 9b08b2724c2db81e8c84a88d8389951be28d6dfb7b60e090a40ec70339a813f9070f3495cc2ace7827ffcfa643c924c82deaeaad4340a22490795115089d7a54
7
- data.tar.gz: fe31afa752611b232bf55b1ea5cbd49cc8ec1a1703ac60e0a409b50c6b9b1600cb2b6858182d1619f998f7b2a8d1e7169e30f5daad32eab079d9bf2596178d3d
6
+ metadata.gz: e1fe4ad83a82af9fdc95258a0f22575bb2841f26c0ce4edf0caf8d71e8a79827f84467da153e0e45294b9c675b0b7e180252a06c85f215261f790227f5f0a63f
7
+ data.tar.gz: 40356b5bab34e82640968b84048a3b25a023f923eed7268c9ea697bf52b144a301053b65d2d9fa70c1e01b0e415bdac99abe4b44549cf51b95c7205e5557c2d9
data/Gemfile CHANGED
@@ -3,4 +3,4 @@ source 'https://rubygems.org'
3
3
 
4
4
  gemspec
5
5
 
6
- gem "knitter", git: "https://github.com/nathanstitt/knitter", branch: 'master'
6
+ # gem "knitter", git: "https://github.com/nathanstitt/knitter", branch: 'master'
data/README.md CHANGED
@@ -29,30 +29,38 @@ Or install it yourself as:
29
29
  Initialization will create a `package.json`, `yarn.lock`, a bare-bones `webpack.config.js` and then run yarn install (via the [Knitter](https://github.com/nathanstitt/knitter) gem).
30
30
 
31
31
  ```ruby
32
-
33
- config = WebpackDriver::Configuration.new(
34
- WebpackDriver::Configuration.new('/path/to/my/webpack.config.js')
35
- )
32
+ config = WebpackDriver::Configuration.new('/path/to/my/webpack.config.js')
36
33
  config.generate!
37
34
  ```
38
35
 
39
- Production compilation (TODO):
36
+ Production compilation:
40
37
  ```ruby
41
- compiler = WebpackDriver::Compiler.new
42
- compiler.generate
43
- p compiler.files
38
+ config = WebpackDriver::Configuration.new('/path/to/my/webpack.config.js')
39
+ compiler = WebpackDriver::Compile.new(config)
40
+ compiler.start
41
+ sleep 1 while compiler.alive?
42
+ p compiler.assets
44
43
  ```
45
44
 
46
45
  Dev server:
47
-
48
46
  ```ruby
49
- process = WebpackDriver::DevServer.new
50
- process.start
51
- fail("failed to start webpack #{process.output}") unless process.alive?
52
- puts "Webpack dev server running on port #{process.detected_port} url=#{process.detected_url}"
53
- p process.assets.map{|asset| asset.file }
54
- sleep 30
55
- process.stop
47
+ config = WebpackDriver::Configuration.new('/path/to/my/webpack.config.js', {
48
+ port: 8333
49
+ })
50
+ server = WebpackDriver::DevServer.new(config)
51
+ server.start
52
+ fail("failed to start webpack #{server.output}") unless server.alive?
53
+
54
+ # wait for server to compile startup assets
55
+ sleep 1 until server.valid?
56
+
57
+ puts "Webpack dev server running on port #{server.port} url=#{server.url}"
58
+
59
+ p server.assets.map{|asset| asset.file }
60
+ sleep 30 # do other stuff
61
+ server.stop
62
+ fail("failed to stop webpack #{server.output}") if server.alive?
63
+
56
64
  ```
57
65
 
58
66
 
data/Rakefile CHANGED
@@ -7,4 +7,12 @@ Rake::TestTask.new do |t|
7
7
  end
8
8
  desc "Run tests"
9
9
 
10
+ task :console do
11
+ require 'irb'
12
+ require 'irb/completion'
13
+ require_relative './lib/webpack_driver'
14
+ ARGV.clear
15
+ IRB.start
16
+ end
17
+
10
18
  task :default => :test
@@ -1,3 +1,5 @@
1
+ require 'logger'
2
+ require 'pathname'
1
3
  require_relative 'configuration/generated'
2
4
  require_relative 'configuration/example'
3
5
 
@@ -25,8 +25,6 @@ module WebpackDriver
25
25
  @proc.environment.merge!(
26
26
  config.environment
27
27
  )
28
- puts "ENV"
29
- p config.environment
30
28
  @proc.cwd = config.directory
31
29
  end
32
30
 
@@ -1,3 +1,3 @@
1
1
  module WebpackDriver
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ["lib"]
32
32
 
33
- spec.add_dependency 'knitter', '~> 0.1.2'
33
+ spec.add_dependency 'knitter', '~> 0.2.0'
34
34
  spec.add_dependency 'thor', '~> 0.19'
35
35
  spec.add_dependency 'concurrent-ruby', '~> 1.0.4'
36
36
  spec.add_dependency 'childprocess', '~> 0.5'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webpack_driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Stitt
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.1.2
19
+ version: 0.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.1.2
26
+ version: 0.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: thor
29
29
  requirement: !ruby/object:Gem::Requirement