simpacker 1.1.0 → 1.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
  SHA256:
3
- metadata.gz: 91a0259d16d447c35740fe2261d8666a3f014da6e469c64cae1922465351c05f
4
- data.tar.gz: f16ac990f0e689751069256b909afa54e41688638bfbefd5cd409b1ed6dddab9
3
+ metadata.gz: '0139306891348475e95639dd949dc1e4ea13cda119e071747b6ec844779d1baf'
4
+ data.tar.gz: 5947faf436c67d36458bbff49b965c763d22da38e52ebaf8dd3c0ca0c973fbc3
5
5
  SHA512:
6
- metadata.gz: 7f41ace4633df97ef72573dd524b3b47f9d9784b0f81db0ec19d76c5c21c4e86ae6ac0dbce60b36043fa6d346187fe6ccadd9216e5168150f603c501025db69a
7
- data.tar.gz: 321c5eb359a553499b29272ee2067ae8ff663bf46e4171480435b65630342803c7fec06483bbaed556a610bb969efc42e9b203b7fbaa695fa96c3c542ec03a95
6
+ metadata.gz: ed31365cf898b70202c16631f94fc460bd0c1df201ffb45b21c3c874ce3824b0bd6a683c6ad3b508c79bcdccf9904e906abcd174d084864f3b6daba2b6ea3879
7
+ data.tar.gz: d45ffeffacd5c5fe4c68abcae7b30c2ec508aa50596d00fa9898eaa53617092df0183ddcd42262de7587b27f4c8e31756d2c151c05dad080e05496c9d7473742
@@ -0,0 +1 @@
1
+ github: hokaccha
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /spec/reports/
8
8
  /tmp/
9
9
  /Gemfile.lock
10
+ /node_modules/
data/.prettierignore ADDED
@@ -0,0 +1 @@
1
+ **/public/packs/
data/.travis.yml CHANGED
@@ -1 +1,8 @@
1
1
  language: ruby
2
+ cache: bundler
3
+
4
+ rvm:
5
+ - 2.5
6
+ - 2.6
7
+ - 2.7
8
+ - 3.0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## v1.2.0
2
+
3
+ - Add image_pack_url, favicon_pack_tag to helpers #67
4
+
5
+ ## v1.1.2
6
+
7
+ - Set output option to manifest.json in webpack.config.js
8
+
9
+ ## v1.1.1
10
+
11
+ - Fix deprecation warnings for Ruby 2.7 keyword arguments
12
+
1
13
  ## v1.1.0
2
14
 
3
15
  - Allow `Manifest#lookup` to access nested fields.
data/README.md CHANGED
@@ -9,7 +9,7 @@ Simpacker provides the feature to integrate modern JavaScript build system with
9
9
  Create a new rails application without webpacker.
10
10
 
11
11
  ```
12
- $ rails new myapp
12
+ $ rails new myapp --skip-javascript
13
13
  ```
14
14
 
15
15
  Add this line to your application's Gemfile:
@@ -33,7 +33,7 @@ Add `javascript_pack_tag` in view.
33
33
  Run the folloing command to build JavaScript.
34
34
 
35
35
  ```
36
- $ ./node_modules/.bin/wabpack --watch
36
+ $ ./node_modules/.bin/webpack --watch
37
37
  ```
38
38
 
39
39
  ## Examples
@@ -41,14 +41,17 @@ $ ./node_modules/.bin/wabpack --watch
41
41
  - Webpack settings
42
42
  - [webpack-dev-server](https://github.com/hokaccha/simpacker/tree/master/example/webpack-dev-server)
43
43
  - [Multiple Entry Point](https://github.com/hokaccha/simpacker/tree/master/example/multiple-entry-points)
44
+ - [Split Chunks](https://github.com/hokaccha/simpacker/tree/master/example/split-chunks)
44
45
  - Transpilers
45
46
  - [TypeScript](https://github.com/hokaccha/simpacker/tree/master/example/typescript)
46
47
  - [Babel](https://github.com/hokaccha/simpacker/tree/master/example/babel)
47
48
  - Style Sheets
48
49
  - [CSS](https://github.com/hokaccha/simpacker/tree/master/example/css)
49
50
  - [Sass](https://github.com/hokaccha/simpacker/tree/master/example/sass)
51
+ - [PostCSS](https://github.com/hokaccha/simpacker/tree/master/example/postcss)
50
52
  - Frameworks
51
- - [React](https://github.com/hokaccha/simpacker/tree/master/example/react)
53
+ - [React(TypeScript)](https://github.com/hokaccha/simpacker/tree/master/example/react-typescript)
54
+ - [React(Babel)](https://github.com/hokaccha/simpacker/tree/master/example/react-babel)
52
55
  - [Vue.js](https://github.com/hokaccha/simpacker/tree/master/example/vue)
53
56
  - [Angular](https://github.com/hokaccha/simpacker/tree/master/example/angular)
54
57
  - Deployment
@@ -57,7 +60,6 @@ $ ./node_modules/.bin/wabpack --watch
57
60
  - [Docker](https://github.com/hokaccha/simpacker/tree/master/example/docker)
58
61
  - Advanced settings
59
62
  - [Rails Engines](https://github.com/hokaccha/simpacker/tree/master/example/engines)
60
- - [Custom helper](https://github.com/hokaccha/simpacker/tree/master/example/custom-helper)
61
63
  - Bundler
62
64
  - [Parcel](https://github.com/hokaccha/simpacker/tree/master/example/parcel)
63
65
 
@@ -8,15 +8,20 @@ module.exports = {
8
8
  mode: isProd ? "production" : "development",
9
9
  devtool: "source-map",
10
10
  entry: {
11
- application: path.resolve(__dirname, "app/javascript/application.js")
11
+ application: path.resolve(__dirname, "app/javascript/application.js"),
12
12
  },
13
13
  output: {
14
14
  path: path.resolve(__dirname, "public/packs"),
15
15
  publicPath: "/packs/",
16
- filename: isProd ? "[name]-[hash].js" : "[name].js"
16
+ filename: isProd ? "[name]-[hash].js" : "[name].js",
17
17
  },
18
18
  resolve: {
19
- extensions: [".js"]
19
+ extensions: [".js"],
20
20
  },
21
- plugins: [new WebpackAssetsManifest({ publicPath: true })]
21
+ plugins: [
22
+ new WebpackAssetsManifest({
23
+ publicPath: true,
24
+ output: "manifest.json",
25
+ }),
26
+ ],
22
27
  };
@@ -8,7 +8,7 @@ module Simpacker
8
8
 
9
9
  def initialize(root_path: Rails.root, env: Rails.env)
10
10
  config = load_config_file(root_path, env)
11
- @config = Simpacker::Configuration.new(config)
11
+ @config = Simpacker::Configuration.new(**config)
12
12
  @manifest = Simpacker::Manifest.new(@config)
13
13
  end
14
14
 
@@ -16,7 +16,11 @@ module Simpacker
16
16
 
17
17
  def load_config_file(root_path, env)
18
18
  config_path = root_path.join("config/simpacker.yml")
19
- yaml = YAML.load(config_path.read)
19
+ yaml = begin
20
+ YAML.load(config_path.read, aliases: true)
21
+ rescue ArgumentError
22
+ YAML.load(config_path.read)
23
+ end
20
24
  config_env = yaml.fetch(env.to_s)
21
25
  {
22
26
  manifest_path: root_path.join(config_env.fetch('manifest_path')),
@@ -26,6 +26,14 @@ module Simpacker
26
26
  image_tag(asset_path(simpacker_context.manifest.lookup!(name)), **options)
27
27
  end
28
28
 
29
+ def image_pack_url(name, **options)
30
+ asset_url(simpacker_context.manifest.lookup!(name), **options)
31
+ end
32
+
33
+ def favicon_pack_tag(name, **options)
34
+ favicon_link_tag(asset_path(simpacker_context.manifest.lookup!(name)), **options)
35
+ end
36
+
29
37
  def simpacker_context
30
38
  Simpacker.default_context
31
39
  end
@@ -1,3 +1,3 @@
1
1
  module Simpacker
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.1"
3
3
  end
data/package.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "private": true,
3
+ "scripts": {
4
+ "format": "prettier --list-different --write '**/*.{js,ts,jsx,tsx}'"
5
+ },
6
+ "devDependencies": {
7
+ "prettier": "^2.2.1"
8
+ }
9
+ }
data/simpacker.gemspec CHANGED
@@ -21,8 +21,8 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.add_dependency "railties", ">= 4.2"
23
23
 
24
- spec.add_development_dependency "bundler", "~> 1.16"
25
- spec.add_development_dependency "rake", "~> 10.0"
26
- spec.add_development_dependency "rails", "~> 5.2"
27
- spec.add_development_dependency "minitest", "~> 5.1"
24
+ spec.add_development_dependency "bundler", ">= 1.16"
25
+ spec.add_development_dependency "rake", ">= 10.0"
26
+ spec.add_development_dependency "rails", ">= 5.2"
27
+ spec.add_development_dependency "minitest", ">= 5.1"
28
28
  end
data/yarn.lock ADDED
@@ -0,0 +1,8 @@
1
+ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+ # yarn lockfile v1
3
+
4
+
5
+ prettier@^2.2.1:
6
+ version "2.2.1"
7
+ resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5"
8
+ integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simpacker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuhito Hokamura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-03 00:00:00.000000000 Z
11
+ date: 2022-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -28,56 +28,56 @@ dependencies:
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.16'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.16'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '10.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '10.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rails
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '5.2'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '5.2'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: minitest
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '5.1'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '5.1'
83
83
  description: Integrate modern JavaScript build system with Rails.
@@ -87,7 +87,9 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
+ - ".github/FUNDING.yml"
90
91
  - ".gitignore"
92
+ - ".prettierignore"
91
93
  - ".travis.yml"
92
94
  - CHANGELOG.md
93
95
  - Gemfile
@@ -109,7 +111,9 @@ files:
109
111
  - lib/simpacker/railtie.rb
110
112
  - lib/simpacker/version.rb
111
113
  - lib/tasks/simpacker.rake
114
+ - package.json
112
115
  - simpacker.gemspec
116
+ - yarn.lock
113
117
  homepage: https://github.com/hokaccha/simpacker
114
118
  licenses:
115
119
  - MIT