webpacker 6.0.0.rc.2 → 6.0.0.rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96eeffae92e201748b583ac421869d0e76ec806df6dc750d2f0459b2aad05f62
4
- data.tar.gz: 3ed4f39584aa504dd761c59d160014eacc2e8392f847f3c95d5380c32d449142
3
+ metadata.gz: fc94e50b751a536deec7042b74ce5dd87805d8d4d3a8198fe5425bb5c5a79966
4
+ data.tar.gz: c64f748c55db3a8a6a043cf584737a334bfc7b48e9461007b3b683300d8651f1
5
5
  SHA512:
6
- metadata.gz: d70ec25c9ee0ca7cbbe42f1806a7e3e142f0b7b55a0a9cdcd43d1922cf23bd69346bbdab6e37cd31a1cbb4fc533b951b60ef3fed3d622f36208a3841eccc4ff7
7
- data.tar.gz: 47b10bc8e36c8e0697a2341714f27ffc2d749d465b840d14cea71847f592b30f5e6512325198fcedbb2c406859acbc15384c32a71c3cbc62a0ecd2c26b4f9e62
6
+ metadata.gz: 1fb68f94056bd76bf0cfe3940baf923cea8a1237686c68a354a6b0da777c70454dab195b555ab55821a2817de57855f33edc13c1076b18a5d607311fd92f61f8
7
+ data.tar.gz: 4c7d5d1bd2ea1cd54308805c7635c40b1daca70bc72ac7f0c3476d64bd02ddf563fb9e9dc98c2788a647121e29afd1353c8e5dc417b8463590369de4cdef4262
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- webpacker (6.0.0.rc.2)
4
+ webpacker (6.0.0.rc.3)
5
5
  activesupport (>= 5.2)
6
6
  rack-proxy (>= 0.6.1)
7
7
  railties (>= 5.2)
@@ -10,60 +10,60 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- actioncable (6.1.3.1)
14
- actionpack (= 6.1.3.1)
15
- activesupport (= 6.1.3.1)
13
+ actioncable (6.1.4.1)
14
+ actionpack (= 6.1.4.1)
15
+ activesupport (= 6.1.4.1)
16
16
  nio4r (~> 2.0)
17
17
  websocket-driver (>= 0.6.1)
18
- actionmailbox (6.1.3.1)
19
- actionpack (= 6.1.3.1)
20
- activejob (= 6.1.3.1)
21
- activerecord (= 6.1.3.1)
22
- activestorage (= 6.1.3.1)
23
- activesupport (= 6.1.3.1)
18
+ actionmailbox (6.1.4.1)
19
+ actionpack (= 6.1.4.1)
20
+ activejob (= 6.1.4.1)
21
+ activerecord (= 6.1.4.1)
22
+ activestorage (= 6.1.4.1)
23
+ activesupport (= 6.1.4.1)
24
24
  mail (>= 2.7.1)
25
- actionmailer (6.1.3.1)
26
- actionpack (= 6.1.3.1)
27
- actionview (= 6.1.3.1)
28
- activejob (= 6.1.3.1)
29
- activesupport (= 6.1.3.1)
25
+ actionmailer (6.1.4.1)
26
+ actionpack (= 6.1.4.1)
27
+ actionview (= 6.1.4.1)
28
+ activejob (= 6.1.4.1)
29
+ activesupport (= 6.1.4.1)
30
30
  mail (~> 2.5, >= 2.5.4)
31
31
  rails-dom-testing (~> 2.0)
32
- actionpack (6.1.3.1)
33
- actionview (= 6.1.3.1)
34
- activesupport (= 6.1.3.1)
32
+ actionpack (6.1.4.1)
33
+ actionview (= 6.1.4.1)
34
+ activesupport (= 6.1.4.1)
35
35
  rack (~> 2.0, >= 2.0.9)
36
36
  rack-test (>= 0.6.3)
37
37
  rails-dom-testing (~> 2.0)
38
38
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
39
- actiontext (6.1.3.1)
40
- actionpack (= 6.1.3.1)
41
- activerecord (= 6.1.3.1)
42
- activestorage (= 6.1.3.1)
43
- activesupport (= 6.1.3.1)
39
+ actiontext (6.1.4.1)
40
+ actionpack (= 6.1.4.1)
41
+ activerecord (= 6.1.4.1)
42
+ activestorage (= 6.1.4.1)
43
+ activesupport (= 6.1.4.1)
44
44
  nokogiri (>= 1.8.5)
45
- actionview (6.1.3.1)
46
- activesupport (= 6.1.3.1)
45
+ actionview (6.1.4.1)
46
+ activesupport (= 6.1.4.1)
47
47
  builder (~> 3.1)
48
48
  erubi (~> 1.4)
49
49
  rails-dom-testing (~> 2.0)
50
50
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
51
- activejob (6.1.3.1)
52
- activesupport (= 6.1.3.1)
51
+ activejob (6.1.4.1)
52
+ activesupport (= 6.1.4.1)
53
53
  globalid (>= 0.3.6)
54
- activemodel (6.1.3.1)
55
- activesupport (= 6.1.3.1)
56
- activerecord (6.1.3.1)
57
- activemodel (= 6.1.3.1)
58
- activesupport (= 6.1.3.1)
59
- activestorage (6.1.3.1)
60
- actionpack (= 6.1.3.1)
61
- activejob (= 6.1.3.1)
62
- activerecord (= 6.1.3.1)
63
- activesupport (= 6.1.3.1)
54
+ activemodel (6.1.4.1)
55
+ activesupport (= 6.1.4.1)
56
+ activerecord (6.1.4.1)
57
+ activemodel (= 6.1.4.1)
58
+ activesupport (= 6.1.4.1)
59
+ activestorage (6.1.4.1)
60
+ actionpack (= 6.1.4.1)
61
+ activejob (= 6.1.4.1)
62
+ activerecord (= 6.1.4.1)
63
+ activesupport (= 6.1.4.1)
64
64
  marcel (~> 1.0.0)
65
- mini_mime (~> 1.0.2)
66
- activesupport (6.1.3.1)
65
+ mini_mime (>= 1.1.0)
66
+ activesupport (6.1.4.1)
67
67
  concurrent-ruby (~> 1.0, >= 1.0.2)
68
68
  i18n (>= 1.6, < 2)
69
69
  minitest (>= 5.1)
@@ -72,79 +72,79 @@ GEM
72
72
  ast (2.4.2)
73
73
  builder (3.2.4)
74
74
  byebug (11.1.3)
75
- concurrent-ruby (1.1.8)
75
+ concurrent-ruby (1.1.9)
76
76
  crass (1.0.6)
77
77
  erubi (1.10.0)
78
- globalid (0.4.2)
79
- activesupport (>= 4.2.0)
78
+ globalid (0.5.2)
79
+ activesupport (>= 5.0)
80
80
  i18n (1.8.10)
81
81
  concurrent-ruby (~> 1.0)
82
- loofah (2.9.1)
82
+ loofah (2.12.0)
83
83
  crass (~> 1.0.2)
84
84
  nokogiri (>= 1.5.9)
85
85
  mail (2.7.1)
86
86
  mini_mime (>= 0.1.1)
87
87
  marcel (1.0.1)
88
88
  method_source (1.0.0)
89
- mini_mime (1.0.3)
90
- mini_portile2 (2.5.0)
89
+ mini_mime (1.1.1)
90
+ mini_portile2 (2.6.1)
91
91
  minitest (5.14.4)
92
- nio4r (2.5.7)
93
- nokogiri (1.11.3)
94
- mini_portile2 (~> 2.5.0)
92
+ nio4r (2.5.8)
93
+ nokogiri (1.12.3)
94
+ mini_portile2 (~> 2.6.1)
95
95
  racc (~> 1.4)
96
- parallel (1.20.1)
97
- parser (3.0.1.0)
96
+ parallel (1.20.2)
97
+ parser (3.0.2.0)
98
98
  ast (~> 2.4.1)
99
99
  racc (1.5.2)
100
100
  rack (2.2.3)
101
- rack-proxy (0.6.5)
101
+ rack-proxy (0.7.0)
102
102
  rack
103
103
  rack-test (1.1.0)
104
104
  rack (>= 1.0, < 3)
105
- rails (6.1.3.1)
106
- actioncable (= 6.1.3.1)
107
- actionmailbox (= 6.1.3.1)
108
- actionmailer (= 6.1.3.1)
109
- actionpack (= 6.1.3.1)
110
- actiontext (= 6.1.3.1)
111
- actionview (= 6.1.3.1)
112
- activejob (= 6.1.3.1)
113
- activemodel (= 6.1.3.1)
114
- activerecord (= 6.1.3.1)
115
- activestorage (= 6.1.3.1)
116
- activesupport (= 6.1.3.1)
105
+ rails (6.1.4.1)
106
+ actioncable (= 6.1.4.1)
107
+ actionmailbox (= 6.1.4.1)
108
+ actionmailer (= 6.1.4.1)
109
+ actionpack (= 6.1.4.1)
110
+ actiontext (= 6.1.4.1)
111
+ actionview (= 6.1.4.1)
112
+ activejob (= 6.1.4.1)
113
+ activemodel (= 6.1.4.1)
114
+ activerecord (= 6.1.4.1)
115
+ activestorage (= 6.1.4.1)
116
+ activesupport (= 6.1.4.1)
117
117
  bundler (>= 1.15.0)
118
- railties (= 6.1.3.1)
118
+ railties (= 6.1.4.1)
119
119
  sprockets-rails (>= 2.0.0)
120
120
  rails-dom-testing (2.0.3)
121
121
  activesupport (>= 4.2.0)
122
122
  nokogiri (>= 1.6)
123
- rails-html-sanitizer (1.3.0)
123
+ rails-html-sanitizer (1.4.2)
124
124
  loofah (~> 2.3)
125
- railties (6.1.3.1)
126
- actionpack (= 6.1.3.1)
127
- activesupport (= 6.1.3.1)
125
+ railties (6.1.4.1)
126
+ actionpack (= 6.1.4.1)
127
+ activesupport (= 6.1.4.1)
128
128
  method_source
129
- rake (>= 0.8.7)
129
+ rake (>= 0.13)
130
130
  thor (~> 1.0)
131
131
  rainbow (3.0.0)
132
- rake (13.0.3)
132
+ rake (13.0.6)
133
133
  regexp_parser (2.1.1)
134
134
  rexml (3.2.5)
135
- rubocop (0.93.1)
135
+ rubocop (1.19.1)
136
136
  parallel (~> 1.10)
137
- parser (>= 2.7.1.5)
137
+ parser (>= 3.0.0.0)
138
138
  rainbow (>= 2.2.2, < 4.0)
139
- regexp_parser (>= 1.8)
139
+ regexp_parser (>= 1.8, < 3.0)
140
140
  rexml
141
- rubocop-ast (>= 0.6.0)
141
+ rubocop-ast (>= 1.9.1, < 2.0)
142
142
  ruby-progressbar (~> 1.7)
143
- unicode-display_width (>= 1.4.0, < 2.0)
144
- rubocop-ast (1.4.1)
145
- parser (>= 2.7.1.5)
146
- rubocop-performance (1.10.2)
147
- rubocop (>= 0.90.0, < 2.0)
143
+ unicode-display_width (>= 1.4.0, < 3.0)
144
+ rubocop-ast (1.11.0)
145
+ parser (>= 3.0.1.1)
146
+ rubocop-performance (1.11.5)
147
+ rubocop (>= 1.7.0, < 2.0)
148
148
  rubocop-ast (>= 0.4.0)
149
149
  ruby-progressbar (1.11.0)
150
150
  semantic_range (3.0.0)
@@ -158,8 +158,8 @@ GEM
158
158
  thor (1.1.0)
159
159
  tzinfo (2.0.4)
160
160
  concurrent-ruby (~> 1.0)
161
- unicode-display_width (1.7.0)
162
- websocket-driver (0.7.3)
161
+ unicode-display_width (2.0.0)
162
+ websocket-driver (0.7.5)
163
163
  websocket-extensions (>= 0.1.0)
164
164
  websocket-extensions (0.1.5)
165
165
  zeitwerk (2.4.2)
@@ -174,7 +174,7 @@ DEPENDENCIES
174
174
  rack-proxy
175
175
  rails
176
176
  rake (>= 11.1)
177
- rubocop (= 0.93.1)
177
+ rubocop
178
178
  rubocop-performance
179
179
  semantic_range
180
180
  webpacker!
data/README.md CHANGED
@@ -54,8 +54,8 @@ leaving Webpack responsible solely for app-like JavaScript, or it can be used ex
54
54
 
55
55
  - Ruby 2.4+
56
56
  - Rails 5.2+
57
- - Node.js 12+ || 14+
58
- - Yarn 1.x+ || 2.x+
57
+ - Node.js 12.13.0+ || 14+
58
+ - Yarn
59
59
 
60
60
  ## Features
61
61
 
data/docs/v6_upgrade.md CHANGED
@@ -26,7 +26,7 @@ Example going to a specific version:
26
26
 
27
27
  ```ruby
28
28
  # Gemfile
29
- gem 'webpacker', '6.0.0.rc.2'
29
+ gem 'webpacker', '6.0.0.rc.3'
30
30
  ```
31
31
 
32
32
  ```bash
@@ -34,7 +34,7 @@ Example going to a specific version:
34
34
  ```
35
35
 
36
36
  ```bash
37
- yarn add @rails/webpacker@6.0.0-rc.2 --exact
37
+ yarn add @rails/webpacker@6.0.0-rc.3 --exact
38
38
  ```
39
39
 
40
40
  ```bash
@@ -24,25 +24,26 @@ development:
24
24
  https: false
25
25
  host: localhost
26
26
  port: 3035
27
- public: localhost:3035
28
27
  # Hot Module Replacement updates modules while the application is running without a full reload
29
28
  hmr: false
30
- # Should we show a full-screen overlay in the browser when there are compiler errors or warnings?
31
- overlay: true
29
+ client:
30
+ # Should we show a full-screen overlay in the browser when there are compiler errors or warnings?
31
+ overlay: true
32
+ # May also be a string
33
+ # webSocketURL:
34
+ # hostname: "0.0.0.0"
35
+ # pathname: "/ws"
36
+ # port: 8080
32
37
  # Should we use gzip compression?
33
38
  compress: true
34
39
  # Note that apps that do not check the host are vulnerable to DNS rebinding attacks
35
- disable_host_check: true
36
- # This option lets the browser open with your local IP
37
- use_local_ip: false
38
- # When enabled, nothing except the initial startup information will be written to the console.
39
- # This also means that errors or warnings from webpack are not visible.
40
- quiet: false
40
+ allowed_hosts: "all"
41
41
  pretty: true
42
42
  headers:
43
43
  'Access-Control-Allow-Origin': '*'
44
- watch_options:
45
- ignored: '**/node_modules/**'
44
+ static:
45
+ watch:
46
+ ignored: '**/node_modules/**'
46
47
 
47
48
  test:
48
49
  <<: *default
@@ -17,20 +17,21 @@ class Webpacker::Commands
17
17
  #
18
18
  def clean(count = 2, age = 3600)
19
19
  if config.public_output_path.exist? && config.public_manifest_path.exist?
20
- versions
21
- .sort
22
- .reverse
23
- .each_with_index
24
- .drop_while do |(mtime, _), index|
25
- max_age = [0, Time.now - Time.at(mtime)].max
26
- max_age < age || index < count
20
+ packs
21
+ .map do |paths|
22
+ paths.map { |path| [Time.now - File.mtime(path), path] }
23
+ .sort
24
+ .reject.with_index do |(file_age, _), index|
25
+ file_age < age || index < count
26
+ end
27
+ .map { |_, path| path }
27
28
  end
28
- .each do |(_, files), index|
29
- files.each do |file|
30
- if File.file?(file)
31
- File.delete(file)
32
- logger.info "Removed #{file}"
33
- end
29
+ .flatten
30
+ .compact
31
+ .each do |file|
32
+ if File.file?(file)
33
+ File.delete(file)
34
+ logger.info "Removed #{file}"
34
35
  end
35
36
  end
36
37
  end
@@ -54,12 +55,15 @@ class Webpacker::Commands
54
55
  end
55
56
 
56
57
  private
57
- def versions
58
+ def packs
58
59
  all_files = Dir.glob("#{config.public_output_path}/**/*")
59
60
  manifest_config = Dir.glob("#{config.public_manifest_path}*")
60
61
 
61
62
  packs = all_files - manifest_config - current_version
62
- packs.reject { |file| File.directory?(file) }.group_by { |file| File.mtime(file).utc.to_i }
63
+ packs.reject { |file| File.directory?(file) }.group_by do |path|
64
+ base, _, ext = File.basename(path).scan(/(.*)(-[\da-f]+)(\.\w+)/).flatten
65
+ "#{File.dirname(path)}/#{base}#{ext}"
66
+ end.values
63
67
  end
64
68
 
65
69
  def current_version
@@ -1,4 +1,4 @@
1
1
  module Webpacker
2
2
  # Change the version in package.json too, please!
3
- VERSION = "6.0.0.rc.2".freeze
3
+ VERSION = "6.0.0.rc.3".freeze
4
4
  end
@@ -23,7 +23,7 @@ describe('Development environment', () => {
23
23
  devServer: {
24
24
  host: 'localhost',
25
25
  port: 3035,
26
- injectClient: false
26
+ hot: false
27
27
  }
28
28
  })
29
29
  })
data/package/config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  const { resolve } = require('path')
2
- const { safeLoad } = require('js-yaml')
2
+ const { load } = require('js-yaml')
3
3
  const { readFileSync } = require('fs')
4
4
  const { merge } = require('webpack-merge')
5
5
  const { ensureTrailingSlash } = require('./utils/helpers')
@@ -9,12 +9,12 @@ const configPath = require('./configPath')
9
9
  const defaultConfigPath = require.resolve('../lib/install/config/webpacker.yml')
10
10
 
11
11
  const getDefaultConfig = () => {
12
- const defaultConfig = safeLoad(readFileSync(defaultConfigPath), 'utf8')
12
+ const defaultConfig = load(readFileSync(defaultConfigPath), 'utf8')
13
13
  return defaultConfig[railsEnv] || defaultConfig.production
14
14
  }
15
15
 
16
16
  const defaults = getDefaultConfig()
17
- const app = safeLoad(readFileSync(configPath), 'utf8')[railsEnv]
17
+ const app = load(readFileSync(configPath), 'utf8')[railsEnv]
18
18
 
19
19
  const config = merge(defaults, app)
20
20
  config.outputPath = resolve(config.public_root_path, config.public_output_path)
data/package/env.js CHANGED
@@ -1,4 +1,4 @@
1
- const { safeLoad } = require('js-yaml')
1
+ const { load } = require('js-yaml')
2
2
  const { readFileSync } = require('fs')
3
3
 
4
4
  const NODE_ENVIRONMENTS = ['development', 'production', 'test']
@@ -12,7 +12,7 @@ const nodeEnv
12
12
  const isProduction = nodeEnv === 'production'
13
13
  const isDevelopment = nodeEnv === 'development'
14
14
 
15
- const config = safeLoad(readFileSync(configPath), 'utf8')
15
+ const config = load(readFileSync(configPath), 'utf8')
16
16
  const availableEnvironments = Object.keys(config).join('|')
17
17
  const regex = new RegExp(`^(${availableEnvironments})$`, 'g')
18
18
 
@@ -18,35 +18,41 @@ if (runningWebpackDevServer) {
18
18
  })
19
19
  }
20
20
 
21
- devConfig = merge(devConfig, {
22
- devServer: {
23
- clientLogLevel: 'none',
24
- compress: devServer.compress,
25
- quiet: devServer.quiet,
26
- disableHostCheck: devServer.disable_host_check,
27
- host: devServer.host,
28
- port: devServer.port,
29
- https: devServer.https,
30
- hot: devServer.hmr,
31
- contentBase,
32
- inline: devServer.inline || devServer.hmr,
33
- injectClient: devServer.hmr,
34
- injectHot: devServer.hmr,
35
- useLocalIp: devServer.use_local_ip,
36
- public: devServer.public,
37
- publicPath,
38
- historyApiFallback: { disableDotRule: true },
39
- headers: devServer.headers,
40
- overlay: devServer.overlay,
41
- stats: {
42
- colors: true,
43
- entrypoints: false,
44
- errorDetails: true,
45
- modules: false,
46
- moduleTrace: false
47
- },
48
- watchOptions: devServer.watch_options
21
+ const devServerConfig = {
22
+ devMiddleware: {
23
+ publicPath
24
+ },
25
+ compress: devServer.compress,
26
+ allowedHosts: devServer.allowed_hosts,
27
+ host: devServer.host,
28
+ port: devServer.port,
29
+ https: devServer.https,
30
+ hot: devServer.hmr,
31
+ liveReload: !devServer.hmr,
32
+ historyApiFallback: { disableDotRule: true },
33
+ headers: devServer.headers,
34
+ static: {
35
+ publicPath: contentBase
49
36
  }
37
+ }
38
+
39
+ if (devServer.static) {
40
+ devServerConfig.static = { ...devServerConfig.static, ...devServer.static }
41
+ }
42
+
43
+ if (devServer.client) {
44
+ devServerConfig.client = devServer.client
45
+ }
46
+
47
+ devConfig = merge(devConfig, {
48
+ stats: {
49
+ colors: true,
50
+ entrypoints: false,
51
+ errorDetails: true,
52
+ modules: false,
53
+ moduleTrace: false
54
+ },
55
+ devServer: devServerConfig
50
56
  })
51
57
  }
52
58