vite_ruby 3.2.0 → 3.2.3

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: 20e13c9793f97870cb77acf0d069ea1c5630df152bdfa5695c4c88c64ab86c08
4
- data.tar.gz: 4bc72e879221969aca00f9dc2302689b69d47d4d636a98e33f198481447d9b6e
3
+ metadata.gz: 2eb40da3695b6913bc4bc0775abbaa3b27445aeec9a6760357fd6fbe0f06abeb
4
+ data.tar.gz: 9f84442f83c42319bff53a02e78104b7b61aabe01354d1bd24b427e4eef02063
5
5
  SHA512:
6
- metadata.gz: b144ad034a9e229b6e340fe522a0511548b37269c842516fc7902f40f102e91efbcc2dd978ac7b420ba6bf7908cab9adfa09359b0c4b5e0af4eeb61d5b7b3b6e
7
- data.tar.gz: 71f9e7cc02cfeac1706d165a49c813573991330dadef2b66d3c61474a1fea20e173df53274b4869ed33aa5c05b1cf3a797ac389dc18e108b796fb142ff3df7a0
6
+ metadata.gz: d69511e5be78c2bb1ac566569f937ae6c113172b533008e6a356a9d1eb85fea36f070cd7a889580ff68a10b2be2df2d92cf226125eb2b4debff099aca3bc92cf
7
+ data.tar.gz: 46cfc3942a503e916a7bb7b21acbab3db31fea3a491e149d2e11a4f20d3a2d8f227c05e52bbbd8ecba30ce94180deb649796d33d7116f4e4d7823700d62ecff0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ ## [3.2.3](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.2.2...vite_ruby@3.2.3) (2022-08-28)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * prevent yarn 2+ error in `assets:precompile` ([#241](https://github.com/ElMassimo/vite_ruby/issues/241)) ([e7e857a](https://github.com/ElMassimo/vite_ruby/commit/e7e857ac763dd053a8bda4b27d26a2090269f6d8))
7
+
8
+
9
+
10
+ ## [3.2.2](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.2.1...vite_ruby@3.2.2) (2022-08-12)
11
+
12
+
13
+ ### Features
14
+
15
+ * allow framework-specific libraries to extend the CLI ([a0ed66f](https://github.com/ElMassimo/vite_ruby/commit/a0ed66fe64fb2549cecc358ccd60c82be44255aa))
16
+
17
+
18
+
19
+ ## [3.2.1](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.2.0...vite_ruby@3.2.1) (2022-08-11)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * require the version after defining namespace (close [#239](https://github.com/ElMassimo/vite_ruby/issues/239)) ([7b92062](https://github.com/ElMassimo/vite_ruby/commit/7b920627f0f551166b3ab321e50b6cee746168c2))
25
+
26
+
27
+
1
28
  # [3.2.0](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.1.7...vite_ruby@3.2.0) (2022-07-13)
2
29
 
3
30
 
data/exe/vite CHANGED
@@ -7,4 +7,6 @@ require 'bundler/setup'
7
7
  require 'vite_ruby'
8
8
 
9
9
  cli = ViteRuby::CLI
10
+ cli.require_framework_libraries
11
+
10
12
  Dry::CLI.new(cli).call
data/lib/tasks/vite.rake CHANGED
@@ -86,5 +86,8 @@ if ARGV.include?('assets:precompile')
86
86
  else
87
87
  ENV['NPM_CONFIG_INCLUDE'] = 'dev'
88
88
  end
89
- ENV['YARN_PRODUCTION'] = 'false'
89
+
90
+ if ViteRuby.commands.legacy_yarn_version?
91
+ ENV['YARN_PRODUCTION'] = 'false'
92
+ end
90
93
  end
@@ -132,8 +132,3 @@ private
132
132
  $stderr = old_stderr
133
133
  end
134
134
  end
135
-
136
- # NOTE: This allows framework-specific variants to extend the installation.
137
- ViteRuby.framework_libraries.each do |_framework, library|
138
- require "#{ library.name.tr('-', '/') }/installation"
139
- end
data/lib/vite_ruby/cli.rb CHANGED
@@ -15,4 +15,16 @@ class ViteRuby::CLI
15
15
  register 'version', Version, aliases: ['v', '-v', '--version', 'info']
16
16
  register 'upgrade', Upgrade, aliases: ['update']
17
17
  register 'upgrade_packages', UpgradePackages, aliases: ['update_packages']
18
+
19
+ # Internal: Allows framework-specific variants to extend the CLI.
20
+ def self.require_framework_libraries(path = 'cli')
21
+ ViteRuby.framework_libraries.each do |_framework, library|
22
+ require [library.name.tr('-', '/').to_s, path].compact.join('/')
23
+ end
24
+ rescue LoadError
25
+ require_framework_libraries 'installation' unless path == 'installation'
26
+ end
18
27
  end
28
+
29
+ # NOTE: This allows framework-specific variants to extend the CLI.
30
+ ViteRuby::CLI.require_framework_libraries('cli')
@@ -71,6 +71,11 @@ class ViteRuby::Commands
71
71
  `npm --version`.to_i < 7 rescue false
72
72
  end
73
73
 
74
+ # Internal: Checks if the yarn version is 1.x.
75
+ def legacy_yarn_version?
76
+ `yarn --version`.to_i < 2 rescue false
77
+ end
78
+
74
79
  # Internal: Verifies if ViteRuby is properly installed.
75
80
  def verify_install
76
81
  unless File.exist?(config.root.join('bin/vite'))
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ViteRuby
4
- VERSION = '3.2.0'
4
+ VERSION = '3.2.3'
5
5
 
6
6
  # Internal: Versions used by default when running `vite install`.
7
7
  DEFAULT_VITE_VERSION = '^3.0.0'
data/lib/vite_ruby.rb CHANGED
@@ -15,8 +15,6 @@ loader.inflector.inflect('ssr' => 'SSR')
15
15
  loader.inflector.inflect('io' => 'IO')
16
16
  loader.setup
17
17
 
18
- require 'vite_ruby/version'
19
-
20
18
  class ViteRuby
21
19
  # Internal: Prefix used for environment variables that modify the configuration.
22
20
  ENV_PREFIX = 'VITE_RUBY'
@@ -142,3 +140,5 @@ class ViteRuby
142
140
  @manifest ||= ViteRuby::Manifest.new(self)
143
141
  end
144
142
  end
143
+
144
+ require 'vite_ruby/version'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vite_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Máximo Mussini
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-13 00:00:00.000000000 Z
11
+ date: 2022-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-cli
@@ -202,8 +202,8 @@ homepage: https://github.com/ElMassimo/vite_ruby
202
202
  licenses:
203
203
  - MIT
204
204
  metadata:
205
- source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@3.2.0/vite_ruby
206
- changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.2.0/vite_ruby/CHANGELOG.md
205
+ source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@3.2.3/vite_ruby
206
+ changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.2.3/vite_ruby/CHANGELOG.md
207
207
  post_install_message: "Thanks for installing Vite Ruby!\n\nIf you upgraded the gem
208
208
  manually, please run:\n\tbundle exec vite upgrade"
209
209
  rdoc_options: []