shakapacker 6.5.6 → 6.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.eslintrc.js +1 -0
- data/.github/FUNDING.yml +1 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +18 -0
- data/CHANGELOG.md +8 -6
- data/docs/v6_upgrade.md +1 -1
- data/lib/webpacker/instance.rb +3 -1
- data/lib/webpacker/version.rb +1 -1
- data/package/rules/babel.js +11 -11
- data/package/rules/jscommon.js +16 -16
- data/package.json +1 -1
- data/spec/webpacker_spec.rb +22 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 667631baa338ba0105550f29536e148bed8b21475daf816b148ab22be98209f9
|
4
|
+
data.tar.gz: 1f49260d3dd206242d022a07200c8d5dbf370fbc72e1dedf10ab033add63dc52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c830769b5fc9a2c40c0e686848421ee39b6df1ae4866f6ad0f00a60b34e1d3262c2fa7b39012e92cbc5d1a985f200c38a636597a8a4adf339c5961960d457fe2
|
7
|
+
data.tar.gz: 818526e1d7b2f5a355a4ffe86c3b09e30ae1ca957fd077e685475aab512fe1107ce3f548e1100811a226c8cce6ed3a5f5a2e1511a9f822112eee9b091e9704c1
|
data/.eslintrc.js
CHANGED
data/.github/FUNDING.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
github: [shakacode]
|
@@ -0,0 +1,18 @@
|
|
1
|
+
### Summary
|
2
|
+
|
3
|
+
_Remove this paragraph and provide a general description of the code changes in your pull
|
4
|
+
request... were there any bugs you had fixed? If so, mention them. If
|
5
|
+
these bugs have open GitHub issues, be sure to tag them here as well,
|
6
|
+
to keep the conversation linked together._
|
7
|
+
|
8
|
+
### Pull Request checklist
|
9
|
+
_Remove this line after checking all the items here. If the item is not applicable to the PR, both check it out and wrap it by `~`._
|
10
|
+
|
11
|
+
- [ ] Add/update test to cover these changes
|
12
|
+
- [ ] Update documentation
|
13
|
+
- [ ] Update CHANGELOG file
|
14
|
+
_Add the CHANGELOG entry at the top of the file._
|
15
|
+
|
16
|
+
### Other Information
|
17
|
+
|
18
|
+
_Remove this parapraph and mention any other important and relevant information such as benchmarks._
|
data/CHANGELOG.md
CHANGED
@@ -8,18 +8,19 @@ Changes since last non-beta release.
|
|
8
8
|
|
9
9
|
_Please add entries here for your pull requests that are not yet released._
|
10
10
|
|
11
|
-
## [6.
|
11
|
+
## [v6.6.0] - March 7, 2023
|
12
|
+
### Improved
|
13
|
+
- Allow configuration of webpacker.yml through env variable. [PR 254](https://github.com/shakacode/shakapacker/pull/254) by [alecslupu](https://github.com/alecslupu)
|
14
|
+
|
15
|
+
## [v6.5.6] - February 11, 2023
|
12
16
|
### Fixed
|
13
|
-
- Fixed failing to update `bin/setup` file due to different formats of the file in different versions of Rails. [
|
17
|
+
- Fixed failing to update `bin/setup` file due to different formats of the file in different versions of Rails. [PR 229](https://github.com/shakacode/shakapacker/pull/229) by [ahangarha](https://github.com/ahangarha)
|
14
18
|
|
15
19
|
- Upgrade several JS dependencies to fix security issues. [PR 243](https://github.com/shakacode/shakapacker/pull/243) by [ahangarha](https://github.com/ahangarha).
|
16
20
|
|
17
21
|
- Added `prepend_javascript_pack_tag` to helpers. Allows to move an entry to the top of queue. Handy when calling from the layout to make sure an entry goes before the view and partial `append_javascript_pack_tag` entries. [PR 235](https://github.com/shakacode/shakapacker/pull/235) by [paypro-leon](https://github.com/paypro-leon).
|
18
22
|
|
19
23
|
- Fixed [issue](https://github.com/shakacode/shakapacker/issues/208) to support directories under `node_modules/*` in the `additional_paths` property of `webpacker.yml` [PR 238](https://github.com/shakacode/shakapacker/pull/238) by [vaukalak](https://github.com/vaukalak).
|
20
|
-
|
21
|
-
## [6.5.6] - January 15, 2023
|
22
|
-
### Fixed
|
23
24
|
- Remove duplicate yarn installs. [PR 238](https://github.com/shakacode/shakapacker/pull/238) by [justin808](https://github/justin808).
|
24
25
|
- Remove unneeded code related to CSP config for generator. [PR 223](https://github.com/shakacode/shakapacker/pull/223) by [ahangarha](https://github/ahangarha).
|
25
26
|
|
@@ -208,7 +209,8 @@ Note: [Rubygem is 6.3.0.pre.rc.1](https://rubygems.org/gems/shakapacker/versions
|
|
208
209
|
## v5.4.3 and prior changes from rails/webpacker
|
209
210
|
See [CHANGELOG.md in rails/webpacker (up to v5.4.3)](https://github.com/rails/webpacker/blob/master/CHANGELOG.md)
|
210
211
|
|
211
|
-
[Unreleased]: https://github.com/shakacode/shakapacker/compare/v6.
|
212
|
+
[Unreleased]: https://github.com/shakacode/shakapacker/compare/v6.6.0...master
|
213
|
+
[v6.6.0]: https://github.com/shakacode/shakapacker/compare/v6.5.6...v6.6.0
|
212
214
|
[v6.5.6]: https://github.com/shakacode/shakapacker/compare/v6.5.5...v6.5.6
|
213
215
|
[v6.5.5]: https://github.com/shakacode/shakapacker/compare/v6.5.4...v6.5.5
|
214
216
|
[v6.5.4]: https://github.com/shakacode/shakapacker/compare/v6.5.3...v6.5.4
|
data/docs/v6_upgrade.md
CHANGED
@@ -19,7 +19,7 @@ See an example migration here: [PR 27](https://github.com/shakacode/react_on_rai
|
|
19
19
|
1. Remove setting the NODE_ENV in your `bin/webpacker` and `bin/webpacker-dev-server` bin stubs as these are not set in the webpack runner file.
|
20
20
|
|
21
21
|
### Update Steps to v6.0.0 from v6.0.0.rc.6
|
22
|
-
_If you're on webpacker v5, follow
|
22
|
+
_If you're on webpacker v5, follow [how to upgrade to webpacker v6.0.0.rc.6 from v5](#how-to-upgrade-to-webpacker-v600rc6-from-v5) to get to v6.0.0.rc.6 first._
|
23
23
|
|
24
24
|
1. Change the gem name from `webpacker` to `shakapacker` and the NPM package from `@rails/webpacker` to `shakapacker`.
|
25
25
|
1. Install the peer dependencies. Run `yarn add @babel/core @babel/plugin-transform-runtime @babel/preset-env @babel/runtime babel-loader compression-webpack-plugin terser-webpack-plugin webpack webpack-assets-manifest webpack-cli webpack-merge webpack-sources webpack-dev-server`. You may have old versions of libraries. Run `yarn install` and check for warnings like `warning " > shakapacker@6.1.1" has incorrect peer dependency "compression-webpack-plugin@^9.0.0"` and `file-loader@1.1.11" has incorrect peer dependency "webpack@^2.0.0 || ^3.0.0 || ^4.0.0"`. In other words, warnings like these are **serious** and will cause considerable confusion if not respected.
|
data/lib/webpacker/instance.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
require "pathname"
|
1
2
|
class Webpacker::Instance
|
2
3
|
cattr_accessor(:logger) { ActiveSupport::TaggedLogging.new(ActiveSupport::Logger.new(STDOUT)) }
|
3
4
|
|
4
5
|
attr_reader :root_path, :config_path
|
5
6
|
|
6
7
|
def initialize(root_path: Rails.root, config_path: Rails.root.join("config/webpacker.yml"))
|
7
|
-
@root_path
|
8
|
+
@root_path = root_path
|
9
|
+
@config_path = Pathname.new(ENV["WEBPACKER_CONFIG"] || config_path)
|
8
10
|
end
|
9
11
|
|
10
12
|
def env
|
data/lib/webpacker/version.rb
CHANGED
data/package/rules/babel.js
CHANGED
@@ -6,16 +6,16 @@ const { isProduction } = require('../env')
|
|
6
6
|
const jscommon = require('./jscommon')
|
7
7
|
|
8
8
|
module.exports = loaderMatches(webpackLoader, 'babel', () => ({
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
}
|
9
|
+
test: /\.(js|jsx|mjs|ts|tsx|coffee)?(\.erb)?$/,
|
10
|
+
...jscommon,
|
11
|
+
use: [
|
12
|
+
{
|
13
|
+
loader: require.resolve('babel-loader'),
|
14
|
+
options: {
|
15
|
+
cacheDirectory: true,
|
16
|
+
cacheCompression: isProduction,
|
17
|
+
compact: isProduction
|
19
18
|
}
|
20
|
-
|
19
|
+
}
|
20
|
+
]
|
21
21
|
}))
|
data/package/rules/jscommon.js
CHANGED
@@ -1,26 +1,26 @@
|
|
1
1
|
const { resolve } = require('path')
|
2
2
|
const { realpathSync } = require('fs')
|
3
3
|
const {
|
4
|
-
|
5
|
-
|
4
|
+
source_path: sourcePath,
|
5
|
+
additional_paths: additionalPaths
|
6
6
|
} = require('../config')
|
7
7
|
|
8
8
|
const inclusions = [sourcePath, ...additionalPaths].map(p => {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
try {
|
10
|
+
return realpathSync(p)
|
11
|
+
} catch (e) {
|
12
|
+
return resolve(p)
|
13
|
+
}
|
14
14
|
})
|
15
15
|
|
16
16
|
module.exports = {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
17
|
+
include: inclusions,
|
18
|
+
exclude: [
|
19
|
+
{
|
20
|
+
// exclude all node_modules from running through babel-loader
|
21
|
+
and: [resolve('node_modules')],
|
22
|
+
// Do not exclude inclusions, as otherwise these won't be transpiled
|
23
|
+
not: [...inclusions]
|
24
|
+
}
|
25
|
+
]
|
26
26
|
}
|
data/package.json
CHANGED
data/spec/webpacker_spec.rb
CHANGED
@@ -33,6 +33,28 @@ describe "Webpacker" do
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
describe "configurable config" do
|
37
|
+
before do
|
38
|
+
@original_webpacker_config = ENV["WEBPACKER_CONFIG"]
|
39
|
+
end
|
40
|
+
|
41
|
+
after do
|
42
|
+
ENV["WEBPACKER_CONFIG"] = @original_webpacker_config
|
43
|
+
end
|
44
|
+
|
45
|
+
it "allows config file to be changed based on ENV variable" do
|
46
|
+
ENV.delete("WEBPACKER_CONFIG")
|
47
|
+
Webpacker.instance = nil
|
48
|
+
expect(Webpacker.config.config_path.to_s).to eq(Rails.root.join("config/webpacker.yml").to_s)
|
49
|
+
end
|
50
|
+
|
51
|
+
it "allows config file to be changed based on ENV variable" do
|
52
|
+
ENV["WEBPACKER_CONFIG"] = "/some/random/path.yml"
|
53
|
+
Webpacker.instance = nil
|
54
|
+
expect(Webpacker.config.config_path.to_s).to eq("/some/random/path.yml")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
36
58
|
it "has app_autoload_paths cleanup" do
|
37
59
|
expect($test_app_autoload_paths_in_initializer).to eq []
|
38
60
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shakapacker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-
|
13
|
+
date: 2023-03-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -121,8 +121,10 @@ extra_rdoc_files: []
|
|
121
121
|
files:
|
122
122
|
- ".eslintignore"
|
123
123
|
- ".eslintrc.js"
|
124
|
+
- ".github/FUNDING.yml"
|
124
125
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
125
126
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
127
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
126
128
|
- ".github/workflows/jest.yml"
|
127
129
|
- ".github/workflows/js-lint.yml"
|
128
130
|
- ".github/workflows/rubocop.yml"
|
@@ -342,7 +344,7 @@ homepage: https://github.com/shakacode/shakapacker
|
|
342
344
|
licenses:
|
343
345
|
- MIT
|
344
346
|
metadata:
|
345
|
-
source_code_uri: https://github.com/shakacode/shakapacker/tree/v6.
|
347
|
+
source_code_uri: https://github.com/shakacode/shakapacker/tree/v6.6.0
|
346
348
|
post_install_message:
|
347
349
|
rdoc_options: []
|
348
350
|
require_paths:
|