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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/generators/zestui/install/install_generator.rb +85 -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: 6d326c0147dc12550dbb08a2720dc6b55a61684e3425b9677c0e94466ba112a4
|
4
|
+
data.tar.gz: 443c20d688cfa9007142c410714fa7528bce441d5c26b039a4d5b8167773eccf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65cc61d997a32a88df13bb020d64a56b1d428d558b496ae18d46af052bedc26661d903717ff2d516100e845d9706e63627615487e0d7516ae87ea2bd4ea01573
|
7
|
+
data.tar.gz: '091d49b9e17165b7c7ead04d6575e3b10206a3d4feffc2019f41c0b345f797be123f9d45b623b453dbb9e6b98f1618b907eef3a25879a5178358df3def318f0d'
|
data/CHANGELOG.md
CHANGED
@@ -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
|
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.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:
|
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
|