vite_rails 2.0.2 → 2.0.8

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: 3af3f9fbccd64b18370496ed29bf4314468c29c3cc357439686dca4cb2d7b583
4
- data.tar.gz: 1ff2bff5ec79f12b1fa6b08822327b1402900833c9331746427d973d997f7470
3
+ metadata.gz: 30fdc63419b31c6d5faf32121634478cc3582de69228b47f93e40e9423503269
4
+ data.tar.gz: 744dd1d598d4ba58490327c5222254e08ddf348902fad7aae442ae95713cebb2
5
5
  SHA512:
6
- metadata.gz: eea23ceec95f3a623a2812a81f28738343e79d43bdf80581a2dbcb8a4e1e2aa95a93b33de17e25170b037695a775a386ad7c151885ba9dd27c398b772b9caf8a
7
- data.tar.gz: 5eeb0f3be3d39d8e03b4e9870ac52777641010c672061cf7033ade3120560a0feaf0b9f0755b0136801b8cea44cdb780b24ec8f72e5866a282a4b54a7cceea9d
6
+ metadata.gz: 3ca858f997afb1187b3add558be808279da6e9fdd460da7ba61045b3b6223b2060f8093febb85ad5bd2300172f0c52fe8c3ea4ff69721d1ddb5cff757bc9691f
7
+ data.tar.gz: c47305f7b880f8e22600744b28cafa5d9d87bfaee6a5919622006c59ccc646afeca9ff0c33d03ac5866b072ed2d37281431b22ae5cecb5446c8eb6be3227c1b5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,47 @@
1
+ ## [2.0.8](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@2.0.7...vite_rails@2.0.8) (2021-03-20)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Simplify installation of build dependencies by using package manager flags ([5c8bb62](https://github.com/ElMassimo/vite_ruby/commit/5c8bb625926f2ab1788a3e3a22aeafd7104984cb))
7
+
8
+
9
+
10
+ ## [2.0.7](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@2.0.6...vite_rails@2.0.7) (2021-03-19)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * Typo typecript -> typescript in tag helpers ([#38](https://github.com/ElMassimo/vite_ruby/issues/38)) ([3d375df](https://github.com/ElMassimo/vite_ruby/commit/3d375df8553c8542966ac912a38fe70b7d59ba74))
16
+
17
+
18
+
19
+ ## [2.0.6](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@2.0.5...vite_rails@2.0.6) (2021-03-18)
20
+
21
+ * Add more help text in the example entrypoints ([87d6f14](https://github.com/ElMassimo/vite_ruby/commit/87d6f14a59bba2667089bb952960dce059f36592))
22
+
23
+ ## [2.0.5](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@2.0.4...vite_rails@2.0.5) (2021-03-18)
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * Using a .jsx extension in a tag helper in development ([a56491b](https://github.com/ElMassimo/vite_ruby/commit/a56491b96720ae537b6b6305aa7efa70cf19e4ee))
29
+
30
+
31
+
32
+ ## [2.0.4](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@2.0.3...vite_rails@2.0.4) (2021-03-09)
33
+
34
+
35
+ ### Features
36
+
37
+ * Detect installations of the latest version of Webpacker (app/packs) ([e9a3bc0](https://github.com/ElMassimo/vite_ruby/commit/e9a3bc02475dbadac77e58b3980a4af8df5aaa02))
38
+
39
+
40
+
41
+ ## [2.0.3](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@2.0.2...vite_rails@2.0.3) (2021-03-07)
42
+
43
+ - Add a bounded requirement to `vite_ruby` dependency.
44
+
1
45
  ## Vite Rails 2.0.2 (2020-02-11)
2
46
 
3
47
  - Automatically infer `app/javascript` as the `sourceCodeDir` if it exists.
data/README.md CHANGED
@@ -59,8 +59,11 @@ dev server is extremely __fast to start__, and your changes will be __updated in
59
59
  In production, Vite [bundles your code][bundling]
60
60
  with tree-shaking, lazy-loading, and common chunk splitting out of the box, to achieve optimal loading performance.
61
61
 
62
- Check [this video comparison with webpack](https://github.com/ElMassimo/pingcrm-vite/pull/1)
63
- which demonstrates the difference in speed during development.
62
+ It also provides great defaults, and is easier to configure than similar tools like webpack.
63
+
64
+ Check [this video comparison with webpack](https://github.com/ElMassimo/jumpstart-vite)
65
+ which demonstrates the difference in boot time, or [this one](https://github.com/ElMassimo/pingcrm-vite/pull/1)
66
+ with the difference in speed during development.
64
67
 
65
68
  ## Features ⚡️
66
69
 
@@ -79,7 +82,7 @@ Visit the [documentation website][website] to check out the [guides] and searcha
79
82
  Add this line to your application's Gemfile:
80
83
 
81
84
  ```ruby
82
- gem 'vite_rails'
85
+ gem 'vite_rails' # vite_rails_legacy if using Rails 4
83
86
  ```
84
87
 
85
88
  Then, run:
@@ -107,6 +110,7 @@ Please use [Issues] to report bugs you find, and [Discussions] to make feature r
107
110
 
108
111
  Don't hesitate to _⭐️ star the project_ if you find it useful!
109
112
 
113
+ Using it in production? Always love to hear about it! 😃
110
114
 
111
115
  ## Special Thanks 🙏
112
116
 
data/lib/tasks/vite.rake CHANGED
@@ -2,16 +2,3 @@
2
2
 
3
3
  require 'vite_ruby'
4
4
  ViteRuby.install_tasks
5
-
6
- namespace :vite_rails do
7
- desc 'Fixes Rails management of node dev dependencies (build dependencies)'
8
- task :set_node_env do
9
- ENV['NODE_ENV'] = 'development'
10
- end
11
- end
12
-
13
- # Set NODE_ENV before installation, so that Rails installs JS build dependencies
14
- # on servers that precompile assets.
15
- ['yarn:install', 'webpacker:yarn_install'].each do |name|
16
- Rake::Task[name].enhance([:'vite_rails:set_node_env']) if Rake::Task.task_defined?(name)
17
- end
@@ -10,8 +10,8 @@ module ViteRails::Installation
10
10
  # Override: Setup a typical apps/web Hanami app to use Vite.
11
11
  def setup_app_files
12
12
  cp RAILS_TEMPLATES.join('config/rails-vite.json'), config.config_path
13
- if root.join('app/javascript').exist?
14
- Dry::CLI::Utils::Files.replace_first_line config.config_path, 'app/frontend', %( "sourceCodeDir": "app/javascript",)
13
+ if dir = %w[app/javascript app/packs].find { |path| root.join(path).exist? }
14
+ Dry::CLI::Utils::Files.replace_first_line config.config_path, 'app/frontend', %( "sourceCodeDir": "#{ dir }",)
15
15
  end
16
16
  setup_content_security_policy root.join('config/initializers/content_security_policy.rb')
17
17
  end
@@ -44,6 +44,15 @@ module ViteRails::Installation
44
44
  inject_line_before layout_file, '</head>', <<-HTML
45
45
  <%= vite_client_tag %>
46
46
  <%= vite_javascript_tag 'application' %>
47
+ <!--
48
+ If using a TypeScript entrypoint file:
49
+ vite_typescript_tag 'application'
50
+
51
+ If using a .jsx or .tsx entrypoint, add the extension:
52
+ vite_javascript_tag 'application.jsx'
53
+
54
+ Visit the guide for more information: https://vite-ruby.netlify.app/guide/rails
55
+ -->
47
56
  HTML
48
57
  end
49
58
  end
@@ -26,7 +26,7 @@ module ViteRails::TagHelpers
26
26
  crossorigin: 'anonymous',
27
27
  **options)
28
28
  entries = vite_manifest.resolve_entries(*names, type: asset_type)
29
- tags = javascript_include_tag(*entries.fetch(:scripts), crossorigin: crossorigin, type: type, **options)
29
+ tags = javascript_include_tag(*entries.fetch(:scripts), crossorigin: crossorigin, type: type, extname: false, **options)
30
30
  tags << vite_preload_tag(*entries.fetch(:imports), crossorigin: crossorigin) unless skip_preload_tags
31
31
  tags << stylesheet_link_tag(*entries.fetch(:stylesheets)) unless skip_style_tags
32
32
  tags
@@ -34,7 +34,7 @@ module ViteRails::TagHelpers
34
34
 
35
35
  # Public: Renders a <script> tag for the specified Vite entrypoints.
36
36
  def vite_typescript_tag(*names, **options)
37
- vite_javascript_tag(*names, asset_type: :typescript, extname: false, **options)
37
+ vite_javascript_tag(*names, asset_type: :typescript, **options)
38
38
  end
39
39
 
40
40
  # Public: Renders a <link> tag for the specified Vite entrypoints.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ViteRails
4
- VERSION = '2.0.2'
4
+ VERSION = '2.0.8'
5
5
  end
@@ -5,6 +5,14 @@
5
5
  // <%= vite_javascript_tag 'application' %>
6
6
  console.log('Vite ⚡️ Rails')
7
7
 
8
+ // If using a TypeScript entrypoint file:
9
+ // <%= vite_typescript_tag 'application.jsx' %>
10
+ //
11
+ // If you want to use .jsx or .tsx, add the extension:
12
+ // <%= vite_javascript_tag 'application.jsx' %>
13
+
14
+ console.log('Visit the guide for more information: ', 'https://vite-ruby.netlify.app/guide/rails')
15
+
8
16
  // Example: Load Rails libraries in Vite.
9
17
  //
10
18
  // import '@rails/ujs'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vite_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.8
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-11 00:00:00.000000000 Z
11
+ date: 2021-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -17,6 +17,9 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '5.1'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '8'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -24,76 +27,37 @@ dependencies:
24
27
  - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '5.1'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '8'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: vite_ruby
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - ">="
37
+ - - "~>"
32
38
  - !ruby/object:Gem::Version
33
- version: '0'
39
+ version: '1.0'
34
40
  type: :runtime
35
41
  prerelease: false
36
42
  version_requirements: !ruby/object:Gem::Requirement
37
43
  requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: bundler
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: 1.3.0
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
44
+ - - "~>"
53
45
  - !ruby/object:Gem::Version
54
- version: 1.3.0
46
+ version: '1.0'
55
47
  - !ruby/object:Gem::Dependency
56
- name: rubocop
48
+ name: spring
57
49
  requirement: !ruby/object:Gem::Requirement
58
50
  requirements:
59
- - - ">="
51
+ - - "~>"
60
52
  - !ruby/object:Gem::Version
61
- version: '0'
53
+ version: '2.1'
62
54
  type: :development
63
55
  prerelease: false
64
56
  version_requirements: !ruby/object:Gem::Requirement
65
57
  requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: rubocop-minitest
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: rubocop-performance
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
58
+ - - "~>"
95
59
  - !ruby/object:Gem::Version
96
- version: '0'
60
+ version: '2.1'
97
61
  description:
98
62
  email:
99
63
  - maximomussini@gmail.com
@@ -102,7 +66,6 @@ extensions: []
102
66
  extra_rdoc_files: []
103
67
  files:
104
68
  - CHANGELOG.md
105
- - CONTRIBUTING.md
106
69
  - LICENSE.txt
107
70
  - README.md
108
71
  - lib/tasks/vite.rake
@@ -118,8 +81,8 @@ homepage: https://github.com/ElMassimo/vite_ruby
118
81
  licenses:
119
82
  - MIT
120
83
  metadata:
121
- source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_rails@2.0.2/vite_rails
122
- changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_rails@2.0.2/vite_rails/CHANGELOG.md
84
+ source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_rails@2.0.8/vite_rails
85
+ changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_rails@2.0.8/vite_rails/CHANGELOG.md
123
86
  post_install_message:
124
87
  rdoc_options: []
125
88
  require_paths:
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
- ```