vite_ruby 1.2.20 → 2.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 +4 -4
 - data/default.vite.json +1 -0
 - data/lib/vite_ruby.rb +2 -2
 - data/lib/vite_ruby/manifest.rb +26 -12
 - data/lib/vite_ruby/version.rb +1 -1
 - metadata +6 -6
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 0c26998dc918c671c6391420dffcf2c2ebf944c4f649b36dd572a042cf3e2e8f
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: d222ac8c8acc48ab19102252194321f942a4e014791d735a209c4bf59cc2acf5
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 89d0be14f7a230e73bb822d140f0207a21415c76c5e7c44cb496c736c17cf3d704ac5b86f621a23c77b05d0d79c7a1725de27f44e7587f1151da8886a6595b88
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 1c3129ee66e118382b5247d16b863da6c43aee23d0bc8aa987ddb7aaa3b04f0b91c356b9b36358fddbb3e39e7145463471afed210ed8d6e727b5dc1f1fc9251a
         
     | 
    
        data/default.vite.json
    CHANGED
    
    
    
        data/lib/vite_ruby.rb
    CHANGED
    
    | 
         @@ -18,8 +18,8 @@ class ViteRuby 
     | 
|
| 
       18 
18 
     | 
    
         
             
              ENV_PREFIX = 'VITE_RUBY'
         
     | 
| 
       19 
19 
     | 
    
         | 
| 
       20 
20 
     | 
    
         
             
              # Internal: Versions used by default when running `vite install`.
         
     | 
| 
       21 
     | 
    
         
            -
              DEFAULT_VITE_VERSION = '^2. 
     | 
| 
       22 
     | 
    
         
            -
              DEFAULT_PLUGIN_VERSION = '^ 
     | 
| 
      
 21 
     | 
    
         
            +
              DEFAULT_VITE_VERSION = '^2.5.0-beta.2'
         
     | 
| 
      
 22 
     | 
    
         
            +
              DEFAULT_PLUGIN_VERSION = '^3.0.0-beta.1'
         
     | 
| 
       23 
23 
     | 
    
         | 
| 
       24 
24 
     | 
    
         
             
              # Internal: Companion libraries for Vite Ruby, and their target framework.
         
     | 
| 
       25 
25 
     | 
    
         
             
              COMPANION_LIBRARIES = {
         
     | 
    
        data/lib/vite_ruby/manifest.rb
    CHANGED
    
    | 
         @@ -66,8 +66,8 @@ protected 
     | 
|
| 
       66 
66 
     | 
    
         
             
              # Internal: Strict version of lookup.
         
     | 
| 
       67 
67 
     | 
    
         
             
              #
         
     | 
| 
       68 
68 
     | 
    
         
             
              # Returns a relative path for the asset, or raises an error if not found.
         
     | 
| 
       69 
     | 
    
         
            -
              def lookup!( 
     | 
| 
       70 
     | 
    
         
            -
                lookup( 
     | 
| 
      
 69 
     | 
    
         
            +
              def lookup!(name, **options)
         
     | 
| 
      
 70 
     | 
    
         
            +
                lookup(name, **options) || missing_entry_error(name, **options)
         
     | 
| 
       71 
71 
     | 
    
         
             
              end
         
     | 
| 
       72 
72 
     | 
    
         | 
| 
       73 
73 
     | 
    
         
             
              # Internal: Computes the path for a given Vite asset using manifest.json.
         
     | 
| 
         @@ -77,10 +77,10 @@ protected 
     | 
|
| 
       77 
77 
     | 
    
         
             
              # Example:
         
     | 
| 
       78 
78 
     | 
    
         
             
              #   manifest.lookup('calendar.js')
         
     | 
| 
       79 
79 
     | 
    
         
             
              #   => { "file" => "/vite/assets/calendar-1016838bab065ae1e122.js", "imports" => [] }
         
     | 
| 
       80 
     | 
    
         
            -
              def lookup(name,  
     | 
| 
      
 80 
     | 
    
         
            +
              def lookup(name, **options)
         
     | 
| 
       81 
81 
     | 
    
         
             
                @build_mutex.synchronize { builder.build } if should_build?
         
     | 
| 
       82 
82 
     | 
    
         | 
| 
       83 
     | 
    
         
            -
                find_manifest_entry( 
     | 
| 
      
 83 
     | 
    
         
            +
                find_manifest_entry resolve_entry_name(name, **options)
         
     | 
| 
       84 
84 
     | 
    
         
             
              end
         
     | 
| 
       85 
85 
     | 
    
         | 
| 
       86 
86 
     | 
    
         
             
            private
         
     | 
| 
         @@ -98,9 +98,9 @@ private 
     | 
|
| 
       98 
98 
     | 
    
         
             
              # Internal: Finds the specified entry in the manifest.
         
     | 
| 
       99 
99 
     | 
    
         
             
              def find_manifest_entry(name)
         
     | 
| 
       100 
100 
     | 
    
         
             
                if dev_server_running?
         
     | 
| 
       101 
     | 
    
         
            -
                  { 'file' => prefix_vite_asset(name 
     | 
| 
      
 101 
     | 
    
         
            +
                  { 'file' => prefix_vite_asset(name) }
         
     | 
| 
       102 
102 
     | 
    
         
             
                else
         
     | 
| 
       103 
     | 
    
         
            -
                  manifest[name 
     | 
| 
      
 103 
     | 
    
         
            +
                  manifest[name]
         
     | 
| 
       104 
104 
     | 
    
         
             
                end
         
     | 
| 
       105 
105 
     | 
    
         
             
              end
         
     | 
| 
       106 
106 
     | 
    
         | 
| 
         @@ -140,12 +140,26 @@ private 
     | 
|
| 
       140 
140 
     | 
    
         
             
                end
         
     | 
| 
       141 
141 
     | 
    
         
             
              end
         
     | 
| 
       142 
142 
     | 
    
         | 
| 
      
 143 
     | 
    
         
            +
              # Internal: Resolves the manifest entry name for the specified resource.
         
     | 
| 
      
 144 
     | 
    
         
            +
              def resolve_entry_name(name, type: nil)
         
     | 
| 
      
 145 
     | 
    
         
            +
                name = with_file_extension(name.to_s, type)
         
     | 
| 
      
 146 
     | 
    
         
            +
                name = name[1..-1] if name.start_with?('/')
         
     | 
| 
      
 147 
     | 
    
         
            +
             
     | 
| 
      
 148 
     | 
    
         
            +
                # Prefix scripts and stylesheets with the entrypoints dir.
         
     | 
| 
      
 149 
     | 
    
         
            +
                if (type || File.dirname(name) == '.') && !name.start_with?(config.entrypoints_dir)
         
     | 
| 
      
 150 
     | 
    
         
            +
                  File.join(config.entrypoints_dir, name)
         
     | 
| 
      
 151 
     | 
    
         
            +
                else
         
     | 
| 
      
 152 
     | 
    
         
            +
                  name
         
     | 
| 
      
 153 
     | 
    
         
            +
                end
         
     | 
| 
      
 154 
     | 
    
         
            +
              end
         
     | 
| 
      
 155 
     | 
    
         
            +
             
     | 
| 
       143 
156 
     | 
    
         
             
              # Internal: Adds a file extension to the file name, unless it already has one.
         
     | 
| 
       144 
157 
     | 
    
         
             
              def with_file_extension(name, entry_type)
         
     | 
| 
       145 
     | 
    
         
            -
                 
     | 
| 
       146 
     | 
    
         
            -
             
     | 
| 
       147 
     | 
    
         
            -
                 
     | 
| 
       148 
     | 
    
         
            -
             
     | 
| 
      
 158 
     | 
    
         
            +
                if File.extname(name).empty? && (ext = extension_for_type(entry_type))
         
     | 
| 
      
 159 
     | 
    
         
            +
                  "#{ name }.#{ ext }"
         
     | 
| 
      
 160 
     | 
    
         
            +
                else
         
     | 
| 
      
 161 
     | 
    
         
            +
                  name
         
     | 
| 
      
 162 
     | 
    
         
            +
                end
         
     | 
| 
       149 
163 
     | 
    
         
             
              end
         
     | 
| 
       150 
164 
     | 
    
         | 
| 
       151 
165 
     | 
    
         
             
              # Internal: Allows to receive :javascript and :stylesheet as :type in helpers.
         
     | 
| 
         @@ -159,9 +173,9 @@ private 
     | 
|
| 
       159 
173 
     | 
    
         
             
              end
         
     | 
| 
       160 
174 
     | 
    
         | 
| 
       161 
175 
     | 
    
         
             
              # Internal: Raises a detailed message when an entry is missing in the manifest.
         
     | 
| 
       162 
     | 
    
         
            -
              def missing_entry_error(name,  
     | 
| 
      
 176 
     | 
    
         
            +
              def missing_entry_error(name, **options)
         
     | 
| 
       163 
177 
     | 
    
         
             
                raise ViteRuby::MissingEntrypointError, OpenStruct.new(
         
     | 
| 
       164 
     | 
    
         
            -
                  file_name:  
     | 
| 
      
 178 
     | 
    
         
            +
                  file_name: resolve_entry_name(name, **options),
         
     | 
| 
       165 
179 
     | 
    
         
             
                  last_build: builder.last_build_metadata,
         
     | 
| 
       166 
180 
     | 
    
         
             
                  manifest: @manifest,
         
     | 
| 
       167 
181 
     | 
    
         
             
                  config: config,
         
     | 
    
        data/lib/vite_ruby/version.rb
    CHANGED
    
    
    
        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:  
     | 
| 
      
 4 
     | 
    
         
            +
              version: 2.0.0.beta.1
         
     | 
| 
       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: 2021- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2021-08-11 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: dry-cli
         
     | 
| 
         @@ -198,8 +198,8 @@ homepage: https://github.com/ElMassimo/vite_ruby 
     | 
|
| 
       198 
198 
     | 
    
         
             
            licenses:
         
     | 
| 
       199 
199 
     | 
    
         
             
            - MIT
         
     | 
| 
       200 
200 
     | 
    
         
             
            metadata:
         
     | 
| 
       201 
     | 
    
         
            -
              source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@ 
     | 
| 
       202 
     | 
    
         
            -
              changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@ 
     | 
| 
      
 201 
     | 
    
         
            +
              source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@2.0.0.beta.1/vite_ruby
         
     | 
| 
      
 202 
     | 
    
         
            +
              changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@2.0.0.beta.1/vite_ruby/CHANGELOG.md
         
     | 
| 
       203 
203 
     | 
    
         
             
            post_install_message:
         
     | 
| 
       204 
204 
     | 
    
         
             
            rdoc_options: []
         
     | 
| 
       205 
205 
     | 
    
         
             
            require_paths:
         
     | 
| 
         @@ -211,9 +211,9 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       211 
211 
     | 
    
         
             
                  version: '2.4'
         
     | 
| 
       212 
212 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       213 
213 
     | 
    
         
             
              requirements:
         
     | 
| 
       214 
     | 
    
         
            -
              - - " 
     | 
| 
      
 214 
     | 
    
         
            +
              - - ">"
         
     | 
| 
       215 
215 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       216 
     | 
    
         
            -
                  version:  
     | 
| 
      
 216 
     | 
    
         
            +
                  version: 1.3.1
         
     | 
| 
       217 
217 
     | 
    
         
             
            requirements: []
         
     | 
| 
       218 
218 
     | 
    
         
             
            rubygems_version: 3.1.4
         
     | 
| 
       219 
219 
     | 
    
         
             
            signing_key:
         
     |