vite_hanami 0.5.0 → 3.0.0.beta.1

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: 8bed5de3195c146f3e7826478b064fdcc2356e76b37ae4f828592babc50a5e79
4
- data.tar.gz: 1ad190f5198116cfdc4227221f07ee948d6651a069c68c3c377108aee2fa60be
3
+ metadata.gz: 53bdbde4ed7a76a63b9f0fed2cdd2670ba49c46de75e20237fb1c5598ef3189d
4
+ data.tar.gz: 678309030b9a0100f8bf2573b66ce2f5cb111c78dee5b9810e009b75daf4c45f
5
5
  SHA512:
6
- metadata.gz: b522acfcb73ec7206b497d57ab2dd999e8ad7034bdcc963dbb21b8f2ef72c9e23f5b87ff6fa04fc1735d1b61b90ab2460e432c23d9b289e9850aef1d4c30a1d5
7
- data.tar.gz: 2660390dbef9a773ce0cc566663a22178d197fb33c5fa3073ee28f7a81850f16acd4cb9fb04655a14cb229a721ab61ed94ad0bb94a71d6eda764fea409dedaac
6
+ metadata.gz: ca265a6e81e7263d6d9d33c5e696f22066d813b6727c51022197a926421e04cf404bdcb558dc90237cbe7e9ab560e1624ff858b9629e4e7ac2f116e5ae49da4d
7
+ data.tar.gz: 36aeaff98ab2203363028925175a273fbddb189515a1ec44add565b75bb62dd7725fd736bd260cd62901d6f669c817397b24e9dfe559a1dc2a67ebf197563bc1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
- ## Vite Hanami 1.0.0 (2020-02-09)
1
+ ## [0.5.3](https://github.com/ElMassimo/vite_ruby/compare/vite_hanami@0.5.2...vite_hanami@0.5.3) (2021-04-21)
2
+
3
+
4
+ ### Features
5
+
6
+ * Add helpers to enable HMR when using @vitejs/plugin-react-refresh ([a80f286](https://github.com/ElMassimo/vite_ruby/commit/a80f286d4305bbae29ea7cea42a4329a530f43fa))
7
+
8
+
9
+
10
+ ## [0.5.2](https://github.com/ElMassimo/vite_ruby/compare/vite_hanami@0.5.1...vite_hanami@0.5.2) (2021-03-07)
11
+
12
+ - Add a bounded requirement to `vite_ruby` dependency.
13
+
14
+ ## Vite Hanami 0.5.1 (2020-02-10)
15
+
16
+ - Install rake tasks in Rakefile by default.
17
+
18
+ ## Vite Hanami 0.5.0 (2020-02-09)
2
19
 
3
20
  - Initial release, includes installation samples and tag helpers.
data/README.md CHANGED
@@ -1,56 +1,67 @@
1
1
  <h1 align="center">
2
- <a href="https://vite-rails.netlify.app/">
3
- <img src="https://raw.githubusercontent.com/ElMassimo/vite_rails/main/docs/public/logo.svg" width="120px"/>
2
+ <a href="https://vite-ruby.netlify.app/">
3
+ <img src="https://raw.githubusercontent.com/ElMassimo/vite_ruby/main/docs/public/logo.svg" width="120px"/>
4
4
  </a>
5
5
 
6
6
  <br>
7
7
 
8
- <a href="https://vite-rails.netlify.app/">
8
+ <a href="https://vite-ruby.netlify.app/">
9
9
  Vite Hanami
10
10
  </a>
11
11
 
12
12
  <br>
13
13
 
14
14
  <p align="center">
15
- <a href="https://github.com/ElMassimo/vite_rails/actions">
16
- <img alt="Build Status" src="https://github.com/ElMassimo/vite_rails/workflows/build/badge.svg"/>
15
+ <a href="https://github.com/ElMassimo/vite_ruby/actions">
16
+ <img alt="Build Status" src="https://github.com/ElMassimo/vite_ruby/workflows/build/badge.svg"/>
17
17
  </a>
18
- <a href="https://codeclimate.com/github/ElMassimo/vite_rails">
19
- <img alt="Maintainability" src="https://codeclimate.com/github/ElMassimo/vite_rails/badges/gpa.svg"/>
18
+ <a href="https://codeclimate.com/github/ElMassimo/vite_ruby">
19
+ <img alt="Maintainability" src="https://codeclimate.com/github/ElMassimo/vite_ruby/badges/gpa.svg"/>
20
20
  </a>
21
- <a href="https://codeclimate.com/github/ElMassimo/vite_rails">
22
- <img alt="Test Coverage" src="https://codeclimate.com/github/ElMassimo/vite_rails/badges/coverage.svg"/>
21
+ <a href="https://codeclimate.com/github/ElMassimo/vite_ruby">
22
+ <img alt="Test Coverage" src="https://codeclimate.com/github/ElMassimo/vite_ruby/badges/coverage.svg"/>
23
23
  </a>
24
24
  <a href="https://rubygems.org/gems/vite_hanami">
25
25
  <img alt="Gem Version" src="https://img.shields.io/gem/v/vite_hanami.svg?colorB=e9573f"/>
26
26
  </a>
27
- <a href="https://github.com/ElMassimo/vite_rails/blob/master/LICENSE.txt">
27
+ <a href="https://github.com/ElMassimo/vite_ruby/blob/master/LICENSE.txt">
28
28
  <img alt="License" src="https://img.shields.io/badge/license-MIT-428F7E.svg"/>
29
29
  </a>
30
30
  </p>
31
31
  </h1>
32
32
 
33
- [website]: https://vite-rails.netlify.app/
34
- [configuration reference]: https://vite-rails.netlify.app/config/
35
- [features]: https://vite-rails.netlify.app/guide/introduction.html
36
- [guides]: https://vite-rails.netlify.app/guide/
37
- [config]: https://vite-rails.netlify.app/config/
38
- [vite_rails]: https://github.com/ElMassimo/vite_rails
33
+ [website]: https://vite-ruby.netlify.app/
34
+ [configuration reference]: https://vite-ruby.netlify.app/config/
35
+ [features]: https://vite-ruby.netlify.app/guide/introduction.html
36
+ [guides]: https://vite-ruby.netlify.app/guide/
37
+ [config]: https://vite-ruby.netlify.app/config/
38
+ [vite_rails]: https://github.com/ElMassimo/vite_ruby
39
39
  [webpacker]: https://github.com/rails/webpacker
40
40
  [vite]: http://vitejs.dev/
41
- [config file]: https://github.com/ElMassimo/vite_rails/blob/main/vite-plugin-ruby/default.vite.json
41
+ [config file]: https://github.com/ElMassimo/vite_ruby/blob/main/vite-plugin-ruby/default.vite.json
42
42
  [example app]: https://github.com/ElMassimo/pingcrm-vite
43
43
  [heroku]: https://pingcrm-vite.herokuapp.com/
44
- [Issues]: https://github.com/ElMassimo/vite_rails/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
45
- [Discussions]: https://github.com/ElMassimo/vite_rails/discussions
46
- [vite_rails]: https://github.com/ElMassimo/vite_rails/tree/main/vite_rails
47
- [vite_ruby]: https://github.com/ElMassimo/vite_rails/tree/main/vite_ruby
48
- [vite_hanami]: https://github.com/ElMassimo/vite_rails/tree/main/vite_hanami
49
-
44
+ [Issues]: https://github.com/ElMassimo/vite_ruby/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
45
+ [Discussions]: https://github.com/ElMassimo/vite_ruby/discussions
46
+ [vite_rails]: https://github.com/ElMassimo/vite_ruby/tree/main/vite_rails
47
+ [vite_ruby]: https://github.com/ElMassimo/vite_ruby/tree/main/vite_ruby
48
+ [vite_hanami]: https://github.com/ElMassimo/vite_ruby/tree/main/vite_hanami
49
+ [no bundling]: https://vitejs.dev/guide/why.html#the-problems
50
+ [bundling]: https://vitejs.dev/guide/why.html#why-bundle-for-production
50
51
 
51
52
  [Vite] is to frontend tooling as Ruby to programming, pure joy! 😍
52
53
 
53
- This library provides specific installation scripts for Hanami, as well as idiomatic tag helpers.
54
+ [__Vite Hanami__][vite_hanami] provides easy setup for Hanami web apps, as well as idiomatic tag helpers.
55
+
56
+ ## Why Vite? 🤔
57
+
58
+ Vite [does not bundle your code during development][no bundling], which means the
59
+ dev server is extremely __fast to start__, and your changes will be __updated instantly__.
60
+
61
+ In production, Vite [bundles your code][bundling]
62
+ with tree-shaking, lazy-loading, and common chunk splitting out of the box, to achieve optimal loading performance.
63
+
64
+ It also provides great defaults, and is easier to configure than similar tools like webpack.
54
65
 
55
66
  ## Features ⚡️
56
67
 
@@ -97,6 +108,7 @@ Please use [Issues] to report bugs you find, and [Discussions] to make feature r
97
108
 
98
109
  Don't hesitate to _⭐️ star the project_ if you find it useful!
99
110
 
111
+ Using it in production? Always love to hear about it! 😃
100
112
 
101
113
  ## Special Thanks 🙏
102
114
 
@@ -16,10 +16,14 @@ module ViteHanami::Installation
16
16
  # Allow @vite/client to hot reload changes in development
17
17
  security.content_security_policy(
18
18
  security.content_security_policy
19
- .sub('script-src', "script-src 'unsafe-eval'")
19
+ .sub('script-src', "script-src 'unsafe-eval' 'unsafe-inline'")
20
20
  .sub('connect-src', "connect-src ws://\#{ ViteRuby.config.host_with_port }")
21
21
  )
22
22
  CSP
23
+ append root.join('Rakefile'), <<~RAKE
24
+ require 'vite_hanami'
25
+ ViteRuby.install_tasks
26
+ RAKE
23
27
  end
24
28
 
25
29
  # Override: Inject the vite client and sample script to the default HTML template.
@@ -9,6 +9,12 @@ module ViteHanami::TagHelpers
9
9
  html.script(src: src, type: 'module')
10
10
  end
11
11
 
12
+ # Public: Renders a script tag to enable HMR with React Refresh.
13
+ def vite_react_refresh
14
+ tag = vite_manifest.react_refresh_preamble
15
+ raw(tag) if tag
16
+ end
17
+
12
18
  # Public: Resolves the path for the specified Vite asset.
13
19
  #
14
20
  # Example:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ViteHanami
4
- VERSION = '0.5.0'
4
+ VERSION = '3.0.0.beta.1'
5
5
  end
metadata CHANGED
@@ -1,71 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vite_hanami
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 3.0.0.beta.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Máximo Mussini
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-10 00:00:00.000000000 Z
11
+ date: 2021-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: vite_ruby
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 3.0.0.beta.1
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'
27
- - !ruby/object:Gem::Dependency
28
- name: bundler
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 1.3.0
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: 1.3.0
41
- - !ruby/object:Gem::Dependency
42
- name: rubocop
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: rubocop-performance
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
26
+ version: 3.0.0.beta.1
69
27
  description:
70
28
  email:
71
29
  - maximomussini@gmail.com
@@ -74,7 +32,6 @@ extensions: []
74
32
  extra_rdoc_files: []
75
33
  files:
76
34
  - CHANGELOG.md
77
- - CONTRIBUTING.md
78
35
  - LICENSE.txt
79
36
  - README.md
80
37
  - lib/vite_hanami.rb
@@ -82,12 +39,12 @@ files:
82
39
  - lib/vite_hanami/tag_helpers.rb
83
40
  - lib/vite_hanami/version.rb
84
41
  - templates/config/hanami-vite.json
85
- homepage: https://github.com/ElMassimo/vite_rails
42
+ homepage: https://github.com/ElMassimo/vite_ruby
86
43
  licenses:
87
44
  - MIT
88
45
  metadata:
89
- source_code_uri: https://github.com/ElMassimo/vite_rails/tree/vite_hanami@0.5.0/vite_hanami
90
- changelog_uri: https://github.com/ElMassimo/vite_rails/blob/vite_hanami@0.5.0/vite_hanami/CHANGELOG.md
46
+ source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_hanami@3.0.0.beta.1/vite_hanami
47
+ changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_hanami@3.0.0.beta.1/vite_hanami/CHANGELOG.md
91
48
  post_install_message:
92
49
  rdoc_options: []
93
50
  require_paths:
@@ -99,9 +56,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
56
  version: '2.5'
100
57
  required_rubygems_version: !ruby/object:Gem::Requirement
101
58
  requirements:
102
- - - ">="
59
+ - - ">"
103
60
  - !ruby/object:Gem::Version
104
- version: '0'
61
+ version: 1.3.1
105
62
  requirements: []
106
63
  rubygems_version: 3.1.4
107
64
  signing_key:
data/CONTRIBUTING.md DELETED
@@ -1,33 +0,0 @@
1
- ## Setting Up a Development Environment
2
-
3
- 1. Install [Yarn](https://yarnpkg.com/)
4
-
5
- 2. Run the following commands to set up the development environment.
6
-
7
- ```
8
- bundle install
9
- ```
10
-
11
- ## Making sure your changes pass all tests
12
- There are a number of automated checks which run on GitHub Actions when a pull request is created.
13
- You can run those checks on your own locally to make sure that your changes would not break the CI build.
14
-
15
- ### 1. Check the code for JavaScript style violations
16
- ```
17
- yarn lint
18
- ```
19
-
20
- ### 2. Check the code for Ruby style violations
21
- ```
22
- bundle exec rubocop
23
- ```
24
-
25
- ### 3. Run the JavaScript test suite
26
- ```
27
- yarn test
28
- ```
29
-
30
- ### 4. Run the Ruby test suite
31
- ```
32
- bundle exec rake test
33
- ```