zestui 0.2.0 → 0.4.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: 6d326c0147dc12550dbb08a2720dc6b55a61684e3425b9677c0e94466ba112a4
4
+ data.tar.gz: 443c20d688cfa9007142c410714fa7528bce441d5c26b039a4d5b8167773eccf
5
5
  SHA512:
6
- metadata.gz: d5953f56cec9a6cad6ac459959374000fba270da5d43223580c9a061ae535724a13a1c7f853023ec817c1da18baddf8947de8ad99d0d818d130ba501ec5235dd
7
- data.tar.gz: 8d066cc33874e2bd182408eb168ee08ae3df6203fb7bdd469dcf2bb9ba928721825ef0e479d8ecb6cce47f7c9515e370c5670ee7b35ca88a87dec6a6457b6813
6
+ metadata.gz: 65cc61d997a32a88df13bb020d64a56b1d428d558b496ae18d46af052bedc26661d903717ff2d516100e845d9706e63627615487e0d7516ae87ea2bd4ea01573
7
+ data.tar.gz: '091d49b9e17165b7c7ead04d6575e3b10206a3d4feffc2019f41c0b345f797be123f9d45b623b453dbb9e6b98f1618b907eef3a25879a5178358df3def318f0d'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.4.0] - 2024-02-11
4
+ - Provide information when tailwind config files are not found
5
+
6
+ ## [0.3.0] - 2023-12-10
7
+ - Add installer
8
+
3
9
  ## [0.2.0] - 2023-12-04
4
10
  - Fix gems not being required
5
11
  - Add zestui-lucide-rails as dependency
@@ -0,0 +1,85 @@
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("config/tailwind.config.js")
7
+ TAILWIND_STYLESHEET_PATH = Rails.root.join("app/assets/stylesheets/application.tailwind.cs")
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
+ unless File.exist?(TAILWIND_CONFIGURATION_PATH)
34
+ say "\n"
35
+ say "************" * 10
36
+ say "\n"
37
+ say "#{TAILWIND_CONFIGURATION_PATH} not found", :red
38
+ say "Please follow the manual installation instructions at https://zestui.com/docs/installation#manual-tailwind-config", :yellow
39
+ say "\n"
40
+ say "************" * 10
41
+ say "\n"
42
+ return
43
+ end
44
+
45
+
46
+ prepend_to_file TAILWIND_CONFIGURATION_PATH do
47
+ "const zestuiPreset = require('./config/zestui/tailwind/preset');\n\n"
48
+ end
49
+
50
+ inject_into_file TAILWIND_CONFIGURATION_PATH, "\n presets: [zestuiPreset],\n", after: /module\.exports = \{$/
51
+
52
+ insert_into_file TAILWIND_CONFIGURATION_PATH, after: "content: [" do
53
+ "\n './app/views/**/*.rb'," \
54
+ "\n './app/components/**/*.rb',"
55
+ end
56
+ end
57
+
58
+ def configure_tailwind_stylesheet
59
+ unless File.exist?(TAILWIND_STYLESHEET_PATH)
60
+ say "\n"
61
+ say "************" * 10
62
+ say "\n"
63
+ say "#{TAILWIND_STYLESHEET_PATH} not found", :red
64
+ say "Please follow the manual installation instructions at https://zestui.com/docs/installation#manual-tailwind-css-config", :yellow
65
+ say "\n"
66
+ say "************" * 10
67
+ say "\n"
68
+ return
69
+ end
70
+
71
+ gsub_file TAILWIND_STYLESHEET_PATH, /@tailwind (base|components|utilities);/, ''
72
+
73
+ append_to_file TAILWIND_STYLESHEET_PATH do
74
+ "@import 'tailwindcss/base';\n" \
75
+ "@import 'tailwindcss/components';\n" \
76
+ "@import 'tailwindcss/utilities';\n" \
77
+ "\n\n @import './zui/index.css'; \n"
78
+ end
79
+ end
80
+
81
+ def after_install_message
82
+ say "Visit https://zestui.com/docs/installation for next steps.\n\n", :yellow
83
+ end
84
+ end
85
+ 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.4.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.4.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: 2024-02-11 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