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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc905e9a4c70a7d7a12882fd09bf28fba4bde598f1af95cb9c3b104ce1433fb3
4
- data.tar.gz: b3aa37ce650bf20272af8c8c50dde2601e7c383daa7dd9ef5ace9963a51101bf
3
+ metadata.gz: 4ec9a7130fc2ba0bacd0c1b530e0862b07d5203d851e0f317944ea9272540d95
4
+ data.tar.gz: bb4ee1f43d8ea230b8f5f00d5407e99aee14b74d3f6de3f3cc4bb6a25e3cf4e1
5
5
  SHA512:
6
- metadata.gz: d5953f56cec9a6cad6ac459959374000fba270da5d43223580c9a061ae535724a13a1c7f853023ec817c1da18baddf8947de8ad99d0d818d130ba501ec5235dd
7
- data.tar.gz: 8d066cc33874e2bd182408eb168ee08ae3df6203fb7bdd469dcf2bb9ba928721825ef0e479d8ecb6cce47f7c9515e370c5670ee7b35ca88a87dec6a6457b6813
6
+ metadata.gz: 7c53f567599587c5b2bd8500c35847cd0c551b02a12691ae29e7f318afa5f59066f37c6993248d0ccbc78e7b8ab1f3759302d405fd2416c4e6c4b4985bf7389f
7
+ data.tar.gz: 200fbafc54543f738da1649519ae6b2c7901de491c6861a2bd1148644eb8a1f1d0d8fb1abc5024c740b2aa316351b4a5233b497caf3dbe4cd17631deee31e116
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.3.0] - 2023-12-10
4
+ - Add installer
5
+
3
6
  ## [0.2.0] - 2023-12-04
4
7
  - Fix gems not being required
5
8
  - Add zestui-lucide-rails as dependency
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zestui
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
data/lib/zestui.rb CHANGED
@@ -7,5 +7,4 @@ require "tailwind_merge"
7
7
  require "zestui-lucide-rails"
8
8
 
9
9
  module Zestui
10
- class Error < StandardError; end
11
10
  end
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.2.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-04 00:00:00.000000000 Z
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