zestui 0.2.0 → 0.3.0
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/CHANGELOG.md +3 -0
 - data/lib/generators/zestui/install/install_generator.rb +60 -0
 - data/lib/zestui/version.rb +1 -1
 - data/lib/zestui.rb +0 -1
 - metadata +3 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 4ec9a7130fc2ba0bacd0c1b530e0862b07d5203d851e0f317944ea9272540d95
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: bb4ee1f43d8ea230b8f5f00d5407e99aee14b74d3f6de3f3cc4bb6a25e3cf4e1
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 7c53f567599587c5b2bd8500c35847cd0c551b02a12691ae29e7f318afa5f59066f37c6993248d0ccbc78e7b8ab1f3759302d405fd2416c4e6c4b4985bf7389f
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 200fbafc54543f738da1649519ae6b2c7901de491c6861a2bd1148644eb8a1f1d0d8fb1abc5024c740b2aa316351b4a5233b497caf3dbe4cd17631deee31e116
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    
| 
         @@ -0,0 +1,60 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module Zestui::Generators
         
     | 
| 
      
 2 
     | 
    
         
            +
              class InstallGenerator < Rails::Generators::Base
         
     | 
| 
      
 3 
     | 
    
         
            +
                desc "Copy ZestUI files"
         
     | 
| 
      
 4 
     | 
    
         
            +
                source_root ENV['ZESTUI_PATH']
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
                TAILWIND_CONFIGURATION_PATH = Rails.root.join("tailwind.config.js")
         
     | 
| 
      
 7 
     | 
    
         
            +
                TAILWIND_STYLESHEET_PATH = Rails.root.join("app/assets/stylesheets/application.tailwind.css")
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                def verify_zestui_path
         
     | 
| 
      
 10 
     | 
    
         
            +
                  zestui_path = self.class.source_root
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
                  unless zestui_path && File.directory?(zestui_path)
         
     | 
| 
      
 13 
     | 
    
         
            +
                    say "ZESTUI_PATH is not set or invalid.", :red
         
     | 
| 
      
 14 
     | 
    
         
            +
                    abort
         
     | 
| 
      
 15 
     | 
    
         
            +
                  end
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
                  initializer_path = File.join(zestui_path, 'config/initializers/zui.rb')
         
     | 
| 
      
 18 
     | 
    
         
            +
                  unless File.exist?(initializer_path)
         
     | 
| 
      
 19 
     | 
    
         
            +
                    say "The required file 'config/initializers/zui.rb' is not found in the ZESTUI_PATH. The path is likely invalid.", :red
         
     | 
| 
      
 20 
     | 
    
         
            +
                    abort
         
     | 
| 
      
 21 
     | 
    
         
            +
                  end
         
     | 
| 
      
 22 
     | 
    
         
            +
                end
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
                def copy_zestui
         
     | 
| 
      
 25 
     | 
    
         
            +
                  directory self.class.source_root, Rails.root
         
     | 
| 
      
 26 
     | 
    
         
            +
                end
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
                def update_stimulus_manifest
         
     | 
| 
      
 29 
     | 
    
         
            +
                  rails_command "stimulus:manifest:update"
         
     | 
| 
      
 30 
     | 
    
         
            +
                end
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
                def configure_tailwind_config
         
     | 
| 
      
 33 
     | 
    
         
            +
                  prepend_to_file TAILWIND_CONFIGURATION_PATH do
         
     | 
| 
      
 34 
     | 
    
         
            +
                    "const zestuiPreset = require('./config/zestui/tailwind/preset');\n\n"
         
     | 
| 
      
 35 
     | 
    
         
            +
                  end
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
                  inject_into_file TAILWIND_CONFIGURATION_PATH, "\n  presets: [zestuiPreset],\n", after: /module\.exports = \{$/
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
                  insert_into_file TAILWIND_CONFIGURATION_PATH, after: "content: [" do
         
     | 
| 
      
 40 
     | 
    
         
            +
            				"\n    './app/views/**/*.rb'," \
         
     | 
| 
      
 41 
     | 
    
         
            +
            				"\n    './app/components/**/*.rb',"
         
     | 
| 
      
 42 
     | 
    
         
            +
            			end
         
     | 
| 
      
 43 
     | 
    
         
            +
            		end
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
                def configure_tailwind_stylesheet
         
     | 
| 
      
 46 
     | 
    
         
            +
                  gsub_file TAILWIND_STYLESHEET_PATH, /@tailwind (base|components|utilities);/, ''
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
                  append_to_file TAILWIND_STYLESHEET_PATH do
         
     | 
| 
      
 49 
     | 
    
         
            +
                    "@import 'tailwindcss/base';\n" \
         
     | 
| 
      
 50 
     | 
    
         
            +
                    "@import 'tailwindcss/components';\n" \
         
     | 
| 
      
 51 
     | 
    
         
            +
                    "@import 'tailwindcss/utilities';\n" \
         
     | 
| 
      
 52 
     | 
    
         
            +
                    "\n\n @import './zui/index.css'; \n"
         
     | 
| 
      
 53 
     | 
    
         
            +
                  end
         
     | 
| 
      
 54 
     | 
    
         
            +
                end
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
                def after_install_message
         
     | 
| 
      
 57 
     | 
    
         
            +
                  say "Visit https://zestui.com/docs/installation for next steps.\n\n", :yellow
         
     | 
| 
      
 58 
     | 
    
         
            +
                end
         
     | 
| 
      
 59 
     | 
    
         
            +
              end
         
     | 
| 
      
 60 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/zestui/version.rb
    CHANGED
    
    
    
        data/lib/zestui.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: zestui
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.3.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Manu Janardhanan
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2023-12- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2023-12-10 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: phlex-rails
         
     | 
| 
         @@ -81,6 +81,7 @@ files: 
     | 
|
| 
       81 
81 
     | 
    
         
             
            - Gemfile
         
     | 
| 
       82 
82 
     | 
    
         
             
            - README.md
         
     | 
| 
       83 
83 
     | 
    
         
             
            - Rakefile
         
     | 
| 
      
 84 
     | 
    
         
            +
            - lib/generators/zestui/install/install_generator.rb
         
     | 
| 
       84 
85 
     | 
    
         
             
            - lib/zestui.rb
         
     | 
| 
       85 
86 
     | 
    
         
             
            - lib/zestui/version.rb
         
     | 
| 
       86 
87 
     | 
    
         
             
            - sig/zestui.rbs
         
     |