webpacker 6.0.0.beta.5 → 6.0.0.beta.6

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
  SHA256:
3
- metadata.gz: eee103ac302f31dfd3aab8246c08b6f38409be2bb226c9980b2f3ab55d8222bf
4
- data.tar.gz: 6bd2f9be419e82dbbcc2a3142bd1f2f9c0ff7ea80373143f0eb60dd1fc118a7c
3
+ metadata.gz: 3e389b1e654d5e3b6e50adb6a908c94cb1039e978b119f32c49c07813f0733ca
4
+ data.tar.gz: 4843befc313e31f85996e36ce59c994f8c3842e82034da51872a2a4f8cb0e5d7
5
5
  SHA512:
6
- metadata.gz: 98cb1515161e7787a62a2c53cc617a5ae7b754a8d47bbecd32bf55f5707c5238437ef5df64fbe9798183825e1b209ed918095ed0bcf59566ab9a55fbcfdfdd27
7
- data.tar.gz: c1cde3f92061eb6f1fe1c23506c0f2299b7a4c0c7d1b046a168630fd15e7c217ab4dbdfdabef8acb39e743058b41b1912eb3ede1320b07aa945ea4e7ea59a319
6
+ metadata.gz: 8238ffb0c0b369bbffdf26766a237ca9ab059989aa79c9fa752fe8f217a79ee2985d00ec52861b7320fe2a5610d5df48941ddb597995bf95c846b381a3f7544d
7
+ data.tar.gz: ce30d8500790565854a174e2ab67598a4fa7ff90eb67a226fb182861baba8d4bb7446958c0457c9b22aedaf345438f69f6542f52a672a6fa2204882220d5d277
data/6_0_upgrade.md CHANGED
@@ -7,7 +7,7 @@ straightforward.
7
7
  ## Preparation
8
8
 
9
9
  1. If your `source_path` is `app/javascript`, rename it to `app/packs`
10
- 2. If your `source_entry_path` is `app/javascript/packs`, rename it to `app/packs/entrypoints`
10
+ 2. If your `source_entry_path` is `packs`, rename it to `entrypoints`
11
11
  3. Rename `config/webpack` to `config/webpack_old`
12
12
  4. Rename `config/webpacker.yml` to `config/webpacker_old.yml`
13
13
  5. Uninstall the current version of `webpack-dev-server`: `yarn remove webpack-dev-server`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- webpacker (6.0.0.beta.5)
4
+ webpacker (6.0.0.beta.6)
5
5
  activesupport (>= 5.2)
6
6
  rack-proxy (>= 0.6.1)
7
7
  railties (>= 5.2)
data/README.md CHANGED
@@ -36,7 +36,6 @@ in which case you may not even need the asset pipeline. This is mostly relevant
36
36
  - [Resolved](#resolved)
37
37
  - [Watched](#watched)
38
38
  - [Deployment](#deployment)
39
- - [Docs](#docs)
40
39
  - [Contributing](#contributing)
41
40
  - [License](#license)
42
41
 
@@ -130,11 +129,11 @@ app/packs:
130
129
  └── logo.svg
131
130
  ```
132
131
 
133
- You can then link the JavaScript pack in Rails views using the `javascript_pack_tag` helper. If you have styles imported in your pack file, you can link them by using `stylesheet_packs_with_chunks_tag`:
132
+ You can then link the JavaScript pack in Rails views using the `javascript_pack_tag` helper. If you have styles imported in your pack file, you can link them by using `stylesheet_pack_tag`:
134
133
 
135
134
  ```erb
136
135
  <%= javascript_pack_tag 'application' %>
137
- <%= stylesheet_packs_with_chunks_tag 'application' %>
136
+ <%= stylesheet_pack_tag 'application' %>
138
137
  ```
139
138
 
140
139
  If you want to link a static asset for `<img />` tag, you can use the `asset_pack_path` helper:
@@ -341,6 +340,24 @@ Add tsconfig.json
341
340
  }
342
341
  ```
343
342
 
343
+ Babel won’t perform any type-checking on TypeScript code. To optionally use type-checking run:
344
+
345
+ ```bash
346
+ yarn add fork-ts-checker-webpack-plugin
347
+ ```
348
+
349
+ Then modify the webpack config to use it as a plugin:
350
+
351
+ ```js
352
+ // config/webpack/base.js
353
+ const { webpackConfig, merge } = require("@rails/webpacker");
354
+ const ForkTSCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
355
+
356
+ module.exports = merge(webpackConfig, {
357
+ plugins: [new ForkTSCheckerWebpackPlugin()],
358
+ });
359
+ ```
360
+
344
361
  #### CSS
345
362
 
346
363
  To enable CSS support in your application, add following packages:
@@ -4,7 +4,7 @@
4
4
  // a relevant structure within app/packs and only use these pack files to reference
5
5
  // that code so it'll be compiled.
6
6
  //
7
- // To reference this file, add <%= javascript_packs_with_chunks_tag 'application' %> to the appropriate
7
+ // To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate
8
8
  // layout file, like app/views/layouts/application.html.erb
9
9
 
10
10
  // Uncomment to copy all static images under ../images to the output folder and reference
@@ -92,7 +92,7 @@ class Webpacker::Manifest
92
92
  # When the user provides a name with a file extension, we want to try to strip it off.
93
93
  def manifest_name(name, pack_type)
94
94
  return name if File.extname(name.to_s).empty?
95
- File.basename(name, pack_type)
95
+ File.basename(name, ".#{pack_type}")
96
96
  end
97
97
 
98
98
  def manifest_type(pack_type)
@@ -1,4 +1,4 @@
1
1
  module Webpacker
2
2
  # Change the version in package.json too, please!
3
- VERSION = "6.0.0.beta.5".freeze
3
+ VERSION = "6.0.0.beta.6".freeze
4
4
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rails/webpacker",
3
- "version": "6.0.0-beta.5",
3
+ "version": "6.0.0-beta.6",
4
4
  "description": "Use webpack to manage app-like JavaScript modules in Rails",
5
5
  "main": "package/index.js",
6
6
  "files": [
@@ -8,7 +8,7 @@ const {
8
8
  const { isProduction } = require('../env')
9
9
 
10
10
  module.exports = {
11
- test: /\.(js|jsx|mjs|ts|tsx)?(\.erb)?$/,
11
+ test: /\.(js|jsx|mjs|ts|tsx|coffee)?(\.erb)?$/,
12
12
  include: [sourcePath, ...additionalPaths].map((p) => {
13
13
  try {
14
14
  return realpathSync(p)
@@ -8,7 +8,7 @@ const {
8
8
  } = require('../config')
9
9
 
10
10
  module.exports = canProcess('stylus-loader', (resolvedPath) =>
11
- getStyleRule(/\.(styl)(\.erb)?$/i, [
11
+ getStyleRule(/\.(styl(us)?)(\.erb)?$/i, [
12
12
  {
13
13
  loader: resolvedPath,
14
14
  options: {
@@ -25,6 +25,14 @@ class ManifestTest < Minitest::Test
25
25
  assert_equal Webpacker.manifest.lookup!("bootstrap.js"), "/packs/bootstrap-300631c4f0e0f9c865bc.js"
26
26
  end
27
27
 
28
+ def test_lookup_with_chunks_without_extension_success!
29
+ assert_equal Webpacker.manifest.lookup_pack_with_chunks!("bootstrap", type: :javascript), ["/packs/bootstrap-300631c4f0e0f9c865bc.js"]
30
+ end
31
+
32
+ def test_lookup_with_chunks_with_extension_success!
33
+ assert_equal Webpacker.manifest.lookup_pack_with_chunks!("bootstrap.js", type: :javascript), ["/packs/bootstrap-300631c4f0e0f9c865bc.js"]
34
+ end
35
+
28
36
  def test_lookup_nil
29
37
  assert_nil Webpacker.manifest.lookup("foo.js")
30
38
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webpacker
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0.beta.5
4
+ version: 6.0.0.beta.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-02-03 00:00:00.000000000 Z
12
+ date: 2021-02-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -253,8 +253,8 @@ homepage: https://github.com/rails/webpacker
253
253
  licenses:
254
254
  - MIT
255
255
  metadata:
256
- source_code_uri: https://github.com/rails/webpacker/tree/v6.0.0.beta.5
257
- changelog_uri: https://github.com/rails/webpacker/blob/v6.0.0.beta.5/CHANGELOG.md
256
+ source_code_uri: https://github.com/rails/webpacker/tree/v6.0.0.beta.6
257
+ changelog_uri: https://github.com/rails/webpacker/blob/v6.0.0.beta.6/CHANGELOG.md
258
258
  post_install_message:
259
259
  rdoc_options: []
260
260
  require_paths: