kaze 0.13.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4c1c801693af9fede14200800169897e887342421d94b5910436217b4aac242
4
- data.tar.gz: 8468cd9b25d02154257e3e049400e76aceef199e452ed78f3cfe043afe8578dd
3
+ metadata.gz: 76266303b2438a2b8150e105b949336025535af3fd5333a6046b6cc304c1838f
4
+ data.tar.gz: 93c6e63fbd507419b506721869aaf2624057a9e27baf53c111ea6318a8dd9a40
5
5
  SHA512:
6
- metadata.gz: 01d69cf3549d24c7aa3d70af1e5ef6cf8fbca90a34bf4cb0aa2fab64809e8cdc8ce16641256af10e988d267a3cb82f9bdd1b85218db2e72bd91916101dd0c710
7
- data.tar.gz: 55e0a82ff2f5bbfcac353c0b43ba798b5fbe0fb842cc53ebb5ade893777f3cbadfc9e857c9e1108627785a65c8de5ad7aac19321c2722b3251fb0e8d4bef946f
6
+ metadata.gz: 94150da33b21e62478df0c05903f3405e3c15d3753d566f145726dd61e773d5074f9ccd4bd68df1f531ae30fd51390eedd80ec4b1805689b3a432f3513c72f3e
7
+ data.tar.gz: 0d14fa92c8c2929b6d1286acba751e62af9f807389b36ab9564e21b905bde434e186861b053e8367e04f21a26eb335b4aa5360abc876178b28c35241232e348d
@@ -1,4 +1,12 @@
1
- module Kaze::Commands::Utils
1
+ require 'bundler'
2
+ require 'fileutils'
3
+ require 'open3'
4
+
5
+ class Kaze::Commands::App::BaseStack
6
+ def install
7
+ raise NotImplementedError
8
+ end
9
+
2
10
  private
3
11
 
4
12
  def install_gems(gems = [], group = nil)
@@ -31,18 +39,16 @@ module Kaze::Commands::Utils
31
39
  railsVersion = [ versions[0], versions[1] ].join('.')
32
40
 
33
41
  ensure_directory_exists("#{Dir.pwd}/db/migrate")
34
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/default/db/migrate", "#{Dir.pwd}/db/migrate")
35
- Dir.children("#{Dir.pwd}/db/migrate").each do |file|
36
- replace_in_file(/ActiveRecord::Migration$/, "ActiveRecord::Migration[#{railsVersion}]", "#{Dir.pwd}/db/migrate/#{file}")
37
- end
42
+ FileUtils.copy_entry("#{stubs_path}/default/db/migrate", "#{Dir.pwd}/db/migrate")
43
+ Dir.children("#{Dir.pwd}/db/migrate").each { |file| replace_in_file(/ActiveRecord::Migration$/, "ActiveRecord::Migration[#{railsVersion}]", "#{Dir.pwd}/db/migrate/#{file}") }
38
44
  end
39
45
 
40
46
  def install_tests
41
47
  ensure_directory_exists("#{Dir.pwd}/test/factories")
42
48
  ensure_directory_exists("#{Dir.pwd}/test/integration")
43
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/default/test/test_helper.rb", "#{Dir.pwd}/test/test_helper.rb")
44
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/default/test/factories", "#{Dir.pwd}/test/factories")
45
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/default/test/integration", "#{Dir.pwd}/test/integration")
49
+ FileUtils.copy_file("#{stubs_path}/default/test/test_helper.rb", "#{Dir.pwd}/test/test_helper.rb")
50
+ FileUtils.copy_entry("#{stubs_path}/default/test/factories", "#{Dir.pwd}/test/factories")
51
+ FileUtils.copy_entry("#{stubs_path}/default/test/integration", "#{Dir.pwd}/test/integration")
46
52
  end
47
53
 
48
54
  def ensure_directory_exists(path)
@@ -74,4 +80,12 @@ module Kaze::Commands::Utils
74
80
  def run_commands(commands)
75
81
  commands.each { |command| run_command(command) }
76
82
  end
83
+
84
+ def say(message, color = nil)
85
+ THOR.say(message, color)
86
+ end
87
+
88
+ def stubs_path
89
+ "#{File.dirname(__FILE__)}/../../../../stubs"
90
+ end
77
91
  end
@@ -0,0 +1,63 @@
1
+ class Kaze::Commands::App::HotwireStack < Kaze::Commands::App::BaseStack
2
+ def install
3
+ # Gems...
4
+ return unless remove_gems([ 'sprockets-rails', 'stimulus-rails' ])
5
+ return unless install_gems([ 'propshaft', 'view_component', 'tailwindcss-rails', 'turbo-rails', 'dotenv', 'bcrypt' ])
6
+ return unless install_gems([ 'hotwire-livereload' ], 'development')
7
+ return unless install_gems([ 'factory_bot_rails', 'faker' ], 'development, test')
8
+
9
+ # Controllers...
10
+ FileUtils.copy_entry("#{stubs_path}/hotwire/app/controllers", "#{Dir.pwd}/app/controllers")
11
+
12
+ # Models...
13
+ FileUtils.copy_entry("#{stubs_path}/default/app/models", "#{Dir.pwd}/app/models")
14
+
15
+ # Forms...
16
+ ensure_directory_exists("#{Dir.pwd}/app/forms")
17
+ FileUtils.copy_entry("#{stubs_path}/default/app/forms", "#{Dir.pwd}/app/forms")
18
+
19
+ # Validators...
20
+ ensure_directory_exists("#{Dir.pwd}/app/validators")
21
+ FileUtils.copy_entry("#{stubs_path}/default/app/validators", "#{Dir.pwd}/app/validators")
22
+
23
+ # Mailers...
24
+ ensure_directory_exists("#{Dir.pwd}/app/mailers")
25
+ FileUtils.copy_entry("#{stubs_path}/default/app/mailers", "#{Dir.pwd}/app/mailers")
26
+
27
+ # Views...
28
+ ensure_directory_exists("#{Dir.pwd}/app/views/layouts")
29
+ ensure_directory_exists("#{Dir.pwd}/app/views/user_mailer")
30
+ FileUtils.copy_entry("#{stubs_path}/hotwire/app/views", "#{Dir.pwd}/app/views")
31
+ FileUtils.copy_file("#{stubs_path}/default/app/views/layouts/mailer.html.erb", "#{Dir.pwd}/app/views/layouts/mailer.html.erb")
32
+ FileUtils.copy_file("#{stubs_path}/default/app/views/layouts/mailer.text.erb", "#{Dir.pwd}/app/views/layouts/mailer.text.erb")
33
+ FileUtils.copy_entry("#{stubs_path}/default/app/views/user_mailer", "#{Dir.pwd}/app/views/user_mailer")
34
+
35
+ # View Components + Alpine...
36
+ ensure_directory_exists("#{Dir.pwd}/app/components")
37
+ FileUtils.copy_entry("#{stubs_path}/hotwire/app/components", "#{Dir.pwd}/app/components")
38
+ ensure_directory_exists("#{Dir.pwd}/app/javascript")
39
+ FileUtils.copy_file("#{stubs_path}/hotwire/app/javascript/application.js", "#{Dir.pwd}/app/javascript/application.js")
40
+ FileUtils.copy_file("#{stubs_path}/hotwire/app/javascript/alpinejs.stub", "#{Dir.pwd}/app/javascript/alpinejs.js")
41
+ FileUtils.copy_file("#{stubs_path}/hotwire/config/importmap.rb", "#{Dir.pwd}/config/importmap.rb")
42
+
43
+ # Tests...
44
+ install_tests
45
+
46
+ # Routes...
47
+ FileUtils.copy_file("#{stubs_path}/default/config/routes.rb", "#{Dir.pwd}/config/routes.rb")
48
+
49
+ # Migrations...
50
+ install_migrations
51
+
52
+ # Tailwind...
53
+ FileUtils.copy_file("#{stubs_path}/default/app/assets/stylesheets/application.css", "#{Dir.pwd}/app/assets/stylesheets/application.css")
54
+ FileUtils.copy_file("#{stubs_path}/default/app/assets/stylesheets/application.tailwind.css", "#{Dir.pwd}/app/assets/stylesheets/application.tailwind.css")
55
+ FileUtils.copy_file("#{stubs_path}/hotwire/config/tailwind.config.js", "#{Dir.pwd}/config/tailwind.config.js")
56
+ FileUtils.copy_file("#{stubs_path}/default/bin/dev", "#{Dir.pwd}/bin/dev")
57
+ FileUtils.copy_file("#{stubs_path}/default/Procfile.dev", "#{Dir.pwd}/Procfile.dev")
58
+ run_command("#{Dir.pwd}/bin/rails tailwindcss:build")
59
+
60
+ say ''
61
+ say 'Kaze scaffolding installed successfully.', :green
62
+ end
63
+ end
@@ -0,0 +1,81 @@
1
+ class Kaze::Commands::App::InertiaReactStack < Kaze::Commands::App::BaseStack
2
+ def install
3
+ # Gems...
4
+ return unless remove_gems([ 'sprockets-rails', 'turbo-rails', 'stimulus-rails' ])
5
+ return unless install_gems([ 'propshaft', 'tailwindcss-rails', 'inertia_rails', 'vite_rails', 'dotenv', 'bcrypt', 'js-routes' ])
6
+ return unless install_gems([ 'factory_bot_rails', 'faker' ], 'development, test')
7
+
8
+ # NPM Packages...
9
+ FileUtils.copy_file("#{stubs_path}/inertia-react-ts/package.json", "#{Dir.pwd}/package.json")
10
+
11
+ # Controllers...
12
+ FileUtils.copy_entry("#{stubs_path}/inertia-common/app/controllers", "#{Dir.pwd}/app/controllers")
13
+
14
+ # Models...
15
+ FileUtils.copy_entry("#{stubs_path}/default/app/models", "#{Dir.pwd}/app/models")
16
+
17
+ # Forms...
18
+ ensure_directory_exists("#{Dir.pwd}/app/forms")
19
+ FileUtils.copy_entry("#{stubs_path}/default/app/forms", "#{Dir.pwd}/app/forms")
20
+
21
+ # Validators...
22
+ ensure_directory_exists("#{Dir.pwd}/app/validators")
23
+ FileUtils.copy_entry("#{stubs_path}/default/app/validators", "#{Dir.pwd}/app/validators")
24
+
25
+ # Mailers...
26
+ ensure_directory_exists("#{Dir.pwd}/app/mailers")
27
+ FileUtils.copy_entry("#{stubs_path}/default/app/mailers", "#{Dir.pwd}/app/mailers")
28
+
29
+ # Views...
30
+ ensure_directory_exists("#{Dir.pwd}/app/views/layouts")
31
+ ensure_directory_exists("#{Dir.pwd}/app/views/user_mailer")
32
+ FileUtils.copy_file("#{stubs_path}/inertia-react-ts/app/views/layouts/application.html.erb", "#{Dir.pwd}/app/views/layouts/application.html.erb")
33
+ FileUtils.copy_file("#{stubs_path}/default/app/views/layouts/mailer.html.erb", "#{Dir.pwd}/app/views/layouts/mailer.html.erb")
34
+ FileUtils.copy_file("#{stubs_path}/default/app/views/layouts/mailer.text.erb", "#{Dir.pwd}/app/views/layouts/mailer.text.erb")
35
+ FileUtils.copy_entry("#{stubs_path}/default/app/views/user_mailer", "#{Dir.pwd}/app/views/user_mailer")
36
+
37
+ # Components + Pages...
38
+ ensure_directory_exists("#{Dir.pwd}/app/javascript")
39
+ FileUtils.copy_entry("#{stubs_path}/inertia-react-ts/app/javascript", "#{Dir.pwd}/app/javascript")
40
+
41
+ # Tests...
42
+ install_tests
43
+ FileUtils.copy_entry("#{stubs_path}/inertia-common/test/integration", "#{Dir.pwd}/test/integration")
44
+
45
+ # Routes...
46
+ FileUtils.copy_file("#{stubs_path}/default/config/routes.rb", "#{Dir.pwd}/config/routes.rb")
47
+
48
+ # Migrations...
49
+ install_migrations
50
+
51
+ # Tailwind / Vite...
52
+ FileUtils.copy_file("#{stubs_path}/default/app/assets/stylesheets/application.css", "#{Dir.pwd}/app/assets/stylesheets/application.css")
53
+ FileUtils.copy_file("#{stubs_path}/default/app/assets/stylesheets/application.tailwind.css", "#{Dir.pwd}/app/assets/stylesheets/application.tailwind.css")
54
+ FileUtils.copy_file("#{stubs_path}/inertia-react-ts/config/tailwind.config.js", "#{Dir.pwd}/config/tailwind.config.js")
55
+ FileUtils.copy_file("#{stubs_path}/inertia-common/config/vite.json", "#{Dir.pwd}/config/vite.json")
56
+ FileUtils.copy_file("#{stubs_path}/inertia-react-ts/tsconfig.json", "#{Dir.pwd}/tsconfig.json")
57
+ FileUtils.copy_file("#{stubs_path}/inertia-react-ts/vite.config.ts", "#{Dir.pwd}/vite.config.ts")
58
+ FileUtils.copy_file("#{stubs_path}/default/bin/dev", "#{Dir.pwd}/bin/dev")
59
+ FileUtils.copy_file("#{stubs_path}/inertia-common/bin/vite", "#{Dir.pwd}/bin/vite")
60
+ FileUtils.copy_file("#{stubs_path}/default/Procfile.dev", "#{Dir.pwd}/Procfile.dev")
61
+ File.write("#{Dir.pwd}/Procfile.dev", "#{File.read("#{Dir.pwd}/Procfile.dev")}\nvite: bin/vite dev\n")
62
+ run_command("#{Dir.pwd}/bin/rails generate js_routes:middleware")
63
+ run_command("#{Dir.pwd}/bin/rails tailwindcss:build")
64
+
65
+ say ''
66
+ say 'Installing and building Node dependencies.', :magenta
67
+
68
+ if File.exist?("#{Dir.pwd}/pnpm-lock.yaml")
69
+ run_commands([ 'pnpm install', 'pnpm run build' ])
70
+ elsif File.exist?("#{Dir.pwd}/yarn.lock")
71
+ run_commands([ 'yarn install', 'yarn build' ])
72
+ elsif File.exist?("#{Dir.pwd}/bun.lockb")
73
+ run_commands([ 'bun install', 'bun run build' ])
74
+ else
75
+ run_commands([ 'npm install', 'npm run build' ])
76
+ end
77
+
78
+ say ''
79
+ say 'Kaze scaffolding installed successfully.', :green
80
+ end
81
+ end
@@ -0,0 +1,81 @@
1
+ class Kaze::Commands::App::InertiaVueStack < Kaze::Commands::App::BaseStack
2
+ def install
3
+ # Gems...
4
+ return unless remove_gems([ 'sprockets-rails', 'turbo-rails', 'stimulus-rails' ])
5
+ return unless install_gems([ 'propshaft', 'tailwindcss-rails', 'inertia_rails', 'vite_rails', 'dotenv', 'bcrypt', 'js-routes' ])
6
+ return unless install_gems([ 'factory_bot_rails', 'faker' ], 'development, test')
7
+
8
+ # NPM Packages...
9
+ FileUtils.copy_file("#{stubs_path}/inertia-vue-ts/package.json", "#{Dir.pwd}/package.json")
10
+
11
+ # Controllers...
12
+ FileUtils.copy_entry("#{stubs_path}/inertia-common/app/controllers", "#{Dir.pwd}/app/controllers")
13
+
14
+ # Models...
15
+ FileUtils.copy_entry("#{stubs_path}/default/app/models", "#{Dir.pwd}/app/models")
16
+
17
+ # Forms...
18
+ ensure_directory_exists("#{Dir.pwd}/app/forms")
19
+ FileUtils.copy_entry("#{stubs_path}/default/app/forms", "#{Dir.pwd}/app/forms")
20
+
21
+ # Validators...
22
+ ensure_directory_exists("#{Dir.pwd}/app/validators")
23
+ FileUtils.copy_entry("#{stubs_path}/default/app/validators", "#{Dir.pwd}/app/validators")
24
+
25
+ # Views...
26
+ ensure_directory_exists("#{Dir.pwd}/app/views/layouts")
27
+ ensure_directory_exists("#{Dir.pwd}/app/views/user_mailer")
28
+ FileUtils.copy_file("#{stubs_path}/inertia-vue-ts/app/views/layouts/application.html.erb", "#{Dir.pwd}/app/views/layouts/application.html.erb")
29
+ FileUtils.copy_file("#{stubs_path}/default/app/views/layouts/mailer.html.erb", "#{Dir.pwd}/app/views/layouts/mailer.html.erb")
30
+ FileUtils.copy_file("#{stubs_path}/default/app/views/layouts/mailer.text.erb", "#{Dir.pwd}/app/views/layouts/mailer.text.erb")
31
+ FileUtils.copy_file("#{stubs_path}/default/app/views/user_mailer/reset_password.html.erb", "#{Dir.pwd}/app/views/user_mailer/reset_password.html.erb")
32
+
33
+ # Mailers...
34
+ ensure_directory_exists("#{Dir.pwd}/app/mailers")
35
+ FileUtils.copy_entry("#{stubs_path}/default/app/mailers", "#{Dir.pwd}/app/mailers")
36
+
37
+ # Components + Pages...
38
+ ensure_directory_exists("#{Dir.pwd}/app/javascript")
39
+ FileUtils.copy_entry("#{stubs_path}/inertia-vue-ts/app/javascript", "#{Dir.pwd}/app/javascript")
40
+
41
+ # Tests...
42
+ install_tests
43
+ FileUtils.copy_entry("#{stubs_path}/inertia-common/test/integration", "#{Dir.pwd}/test/integration")
44
+
45
+ # Routes...
46
+ FileUtils.copy_file("#{stubs_path}/default/config/routes.rb", "#{Dir.pwd}/config/routes.rb")
47
+
48
+ # Migrations...
49
+ install_migrations
50
+
51
+ # Tailwind / Vite...
52
+ FileUtils.copy_file("#{stubs_path}/default/app/assets/stylesheets/application.css", "#{Dir.pwd}/app/assets/stylesheets/application.css")
53
+ FileUtils.copy_file("#{stubs_path}/default/app/assets/stylesheets/application.tailwind.css", "#{Dir.pwd}/app/assets/stylesheets/application.tailwind.css")
54
+ FileUtils.copy_file("#{stubs_path}/inertia-vue-ts/config/tailwind.config.js", "#{Dir.pwd}/config/tailwind.config.js")
55
+ FileUtils.copy_file("#{stubs_path}/inertia-common/config/vite.json", "#{Dir.pwd}/config/vite.json")
56
+ FileUtils.copy_file("#{stubs_path}/inertia-vue-ts/tsconfig.json", "#{Dir.pwd}/tsconfig.json")
57
+ FileUtils.copy_file("#{stubs_path}/inertia-vue-ts/vite.config.ts", "#{Dir.pwd}/vite.config.ts")
58
+ FileUtils.copy_file("#{stubs_path}/default/bin/dev", "#{Dir.pwd}/bin/dev")
59
+ FileUtils.copy_file("#{stubs_path}/inertia-common/bin/vite", "#{Dir.pwd}/bin/vite")
60
+ FileUtils.copy_file("#{stubs_path}/default/Procfile.dev", "#{Dir.pwd}/Procfile.dev")
61
+ File.write("#{Dir.pwd}/Procfile.dev", "#{File.read("#{Dir.pwd}/Procfile.dev")}\nvite: bin/vite dev\n")
62
+ run_command("#{Dir.pwd}/bin/rails generate js_routes:middleware")
63
+ run_command("#{Dir.pwd}/bin/rails tailwindcss:build")
64
+
65
+ say ''
66
+ say 'Installing and building Node dependencies.', :magenta
67
+
68
+ if File.exist?("#{Dir.pwd}/pnpm-lock.yaml")
69
+ run_commands([ 'pnpm install', 'pnpm run build' ])
70
+ elsif File.exist?("#{Dir.pwd}/yarn.lock")
71
+ run_commands([ 'yarn install', 'yarn build' ])
72
+ elsif File.exist?("#{Dir.pwd}/bun.lockb")
73
+ run_commands([ 'bun install', 'bun run build' ])
74
+ else
75
+ run_commands([ 'npm install', 'npm run build' ])
76
+ end
77
+
78
+ say ''
79
+ say 'Kaze scaffolding installed successfully.', :green
80
+ end
81
+ end
@@ -0,0 +1,13 @@
1
+ class Kaze::Commands::App::StackFactory
2
+ def self.make(stack)
3
+ available_stacks = {
4
+ hotwire: 'hotwire',
5
+ react: 'inertia_react',
6
+ vue: 'inertia_vue'
7
+ }
8
+
9
+ raise Kaze::Commands::InvalidStackError, "Invalid stack. Supported stacks are #{available_stacks.keys.map { |k| "[#{k}]" }.join(', ')}." unless available_stacks.key?(stack)
10
+
11
+ Object.const_get("Kaze::Commands::App::#{available_stacks[stack].split(/_/).map(&:capitalize).join}Stack").new
12
+ end
13
+ end
@@ -0,0 +1,21 @@
1
+ require 'thor'
2
+
3
+ THOR = Thor.new
4
+
5
+ class Kaze::Commands::App < Thor
6
+ def self.exit_on_failure?() true end
7
+
8
+ desc 'install [STACK]', 'Install the Kaze controllers and resources. Supported stacks: hotwire, react, vue.'
9
+ def install(stack = 'hotwire')
10
+ return say 'Kaze must be run in a new Rails application.', :red unless File.exist?("#{Dir.pwd}/bin/rails")
11
+
12
+ StackFactory.make(stack.to_sym).install
13
+ rescue => e
14
+ say e.message, :red
15
+ end
16
+
17
+ desc 'version', 'Show Kaze version'
18
+ def version
19
+ puts Kaze::VERSION
20
+ end
21
+ end
data/lib/kaze/commands.rb CHANGED
@@ -1,38 +1,3 @@
1
- require 'bundler'
2
- require 'fileutils'
3
- require 'open3'
4
- require 'thor'
5
-
6
1
  module Kaze::Commands
7
- class App < Thor
8
- include InstallsHotwireStack
9
- include InstallsInertiaStacks
10
- include Utils
11
-
12
- def self.exit_on_failure?() true end
13
-
14
- desc 'install [STACK]', 'Install the Kaze controllers and resources. Supported stacks: hotwire, react, vue.'
15
- def install(stack = 'hotwire')
16
- return say 'Kaze must be run in a new Rails application.', :red unless File.exist?("#{Dir.pwd}/bin/rails")
17
-
18
- return say "Invalid stack. Supported stacks are #{available_stacks.keys.map { |k| "[#{k}]" }.join(', ')}.", :red unless available_stacks.key?(stack.to_sym)
19
-
20
- send("install_#{available_stacks[stack.to_sym]}_stack")
21
- end
22
-
23
- desc 'version', 'Show Kaze version'
24
- def version
25
- puts Kaze::VERSION
26
- end
27
-
28
- private
29
-
30
- def available_stacks
31
- {
32
- hotwire: 'hotwire',
33
- react: 'inertia_react',
34
- vue: 'inertia_vue'
35
- }
36
- end
37
- end
2
+ class InvalidStackError < StandardError; end
38
3
  end
data/lib/kaze/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kaze
2
- VERSION = '0.13.0'
2
+ VERSION = '0.14.0'
3
3
  end
@@ -57,7 +57,6 @@ class ProfileTest < ActionDispatch::IntegrationTest
57
57
  password: 'wrong-password'
58
58
  }
59
59
 
60
- assert_response :unprocessable_entity
61
60
  assert_not_nil user.reload
62
61
  end
63
62
  end
@@ -16,13 +16,13 @@ class ProfileController < ApplicationController
16
16
 
17
17
  @update_profile_information_form.update
18
18
 
19
- redirect_to profile_edit_path, flash: { status: 'profile-updated' }
19
+ redirect_back_or_to profile_edit_path, flash: { status: 'profile-updated' }
20
20
  end
21
21
 
22
22
  def destroy
23
23
  @delete_user_form = DeleteUserForm.new(params.permit(:password))
24
24
 
25
- return render turbo_stream: turbo_stream.replace('confirm_user_deletion_modal', partial: 'profile/partials/confirm_user_deletion_modal'), status: :unprocessable_entity if @delete_user_form.invalid?
25
+ return turbo_stream if @delete_user_form.invalid?
26
26
 
27
27
  user = Current.auth.user
28
28
 
@@ -0,0 +1,3 @@
1
+ <%= turbo_stream.replace 'confirm_user_deletion_modal' do %>
2
+ <%= render 'profile/partials/confirm_user_deletion_modal' %>
3
+ <% end %>
@@ -10,5 +10,5 @@
10
10
  <%= render(DangerButtonComponent.new({"x-data": "", "x-on:click.prevent": "$dispatch('open-modal', 'confirm-user-deletion')"})) do %>
11
11
  Delete Account
12
12
  <% end %>
13
- <%= render 'profile/partials/confirm_user_deletion_modal' %>
14
13
  </section>
14
+ <%= render 'profile/partials/confirm_user_deletion_modal' %>
@@ -1,4 +1,4 @@
1
- <turbo-frame id="update_password_form">
1
+ <%= turbo_frame_tag 'update_password_form' do %>
2
2
  <section>
3
3
  <header>
4
4
  <h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
@@ -42,4 +42,4 @@
42
42
  </div>
43
43
  <% end %>
44
44
  </section>
45
- </turbo-frame>
45
+ <% end %>
@@ -1,4 +1,4 @@
1
- <turbo-frame id="update_profile_information_form">
1
+ <%= turbo_frame_tag 'update_profile_information_form' do %>
2
2
  <section>
3
3
  <header>
4
4
  <h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
@@ -54,4 +54,4 @@
54
54
  </div>
55
55
  <% end %>
56
56
  </section>
57
- </turbo-frame>
57
+ <% end %>
@@ -1,4 +1,4 @@
1
- import { useState, createContext, useContext, Fragment, PropsWithChildren, Dispatch, SetStateAction } from 'react'
1
+ import { useState, createContext, useContext, PropsWithChildren, Dispatch, SetStateAction } from 'react'
2
2
  import { Link, InertiaLinkProps } from '@inertiajs/react'
3
3
  import { Transition } from '@headlessui/react'
4
4
 
@@ -43,11 +43,7 @@ const Content = ({
43
43
  width = '48',
44
44
  contentClasses = 'py-1 bg-white dark:bg-gray-700',
45
45
  children,
46
- }: PropsWithChildren<{
47
- align?: 'left' | 'right'
48
- width?: '48'
49
- contentClasses?: string
50
- }>) => {
46
+ }: PropsWithChildren<{ align?: 'left' | 'right'; width?: '48'; contentClasses?: string }>) => {
51
47
  const { open, setOpen } = useContext(DropDownContext)
52
48
 
53
49
  let alignmentClasses = 'origin-top'
@@ -67,7 +63,6 @@ const Content = ({
67
63
  return (
68
64
  <>
69
65
  <Transition
70
- as={Fragment}
71
66
  show={open}
72
67
  enter="transition ease-out duration-200"
73
68
  enterFrom="opacity-0 scale-95"
@@ -1,5 +1,5 @@
1
- import { Fragment, PropsWithChildren } from 'react'
2
- import { Dialog, Transition } from '@headlessui/react'
1
+ import { PropsWithChildren } from 'react'
2
+ import { Dialog, DialogPanel, Transition, TransitionChild } from '@headlessui/react'
3
3
 
4
4
  export default function Modal({
5
5
  children,
@@ -28,15 +28,14 @@ export default function Modal({
28
28
  }[maxWidth]
29
29
 
30
30
  return (
31
- <Transition show={show} as={Fragment} leave="duration-200">
31
+ <Transition show={show} leave="duration-200">
32
32
  <Dialog
33
33
  as="div"
34
34
  id="modal"
35
35
  className="fixed inset-0 flex overflow-y-auto px-4 py-6 sm:px-0 items-center z-50 transform transition-all"
36
36
  onClose={close}
37
37
  >
38
- <Transition.Child
39
- as={Fragment}
38
+ <TransitionChild
40
39
  enter="ease-out duration-300"
41
40
  enterFrom="opacity-0"
42
41
  enterTo="opacity-100"
@@ -45,10 +44,9 @@ export default function Modal({
45
44
  leaveTo="opacity-0"
46
45
  >
47
46
  <div className="absolute inset-0 bg-gray-500/75 dark:bg-gray-900/75" />
48
- </Transition.Child>
47
+ </TransitionChild>
49
48
 
50
- <Transition.Child
51
- as={Fragment}
49
+ <TransitionChild
52
50
  enter="ease-out duration-300"
53
51
  enterFrom="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
54
52
  enterTo="opacity-100 translate-y-0 sm:scale-100"
@@ -56,12 +54,12 @@ export default function Modal({
56
54
  leaveFrom="opacity-100 translate-y-0 sm:scale-100"
57
55
  leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
58
56
  >
59
- <Dialog.Panel
57
+ <DialogPanel
60
58
  className={`mb-6 bg-white dark:bg-gray-800 rounded-lg overflow-hidden shadow-xl transform transition-all sm:w-full sm:mx-auto ${maxWidthClass}`}
61
59
  >
62
60
  {children}
63
- </Dialog.Panel>
64
- </Transition.Child>
61
+ </DialogPanel>
62
+ </TransitionChild>
65
63
  </Dialog>
66
64
  </Transition>
67
65
  )
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaze
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cuong Giang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-01 00:00:00.000000000 Z
11
+ date: 2024-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -65,9 +65,12 @@ files:
65
65
  - bin/kaze
66
66
  - lib/kaze.rb
67
67
  - lib/kaze/commands.rb
68
- - lib/kaze/commands/installs_hotwire_stack.rb
69
- - lib/kaze/commands/installs_inertia_stacks.rb
70
- - lib/kaze/commands/utils.rb
68
+ - lib/kaze/commands/app.rb
69
+ - lib/kaze/commands/app/base_stack.rb
70
+ - lib/kaze/commands/app/hotwire_stack.rb
71
+ - lib/kaze/commands/app/inertia_react_stack.rb
72
+ - lib/kaze/commands/app/inertia_vue_stack.rb
73
+ - lib/kaze/commands/app/stack_factory.rb
71
74
  - lib/kaze/version.rb
72
75
  - stubs/default/Procfile.dev
73
76
  - stubs/default/app/assets/stylesheets/application.css
@@ -149,6 +152,7 @@ files:
149
152
  - stubs/hotwire/app/views/layouts/_navigation.html.erb
150
153
  - stubs/hotwire/app/views/layouts/application.html.erb
151
154
  - stubs/hotwire/app/views/layouts/guest.html.erb
155
+ - stubs/hotwire/app/views/profile/destroy.turbo_stream.erb
152
156
  - stubs/hotwire/app/views/profile/edit.html.erb
153
157
  - stubs/hotwire/app/views/profile/partials/_confirm_user_deletion_modal.html.erb
154
158
  - stubs/hotwire/app/views/profile/partials/_delete_user_form.html.erb
@@ -268,7 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
268
272
  - !ruby/object:Gem::Version
269
273
  version: '0'
270
274
  requirements: []
271
- rubygems_version: 3.5.9
275
+ rubygems_version: 3.5.14
272
276
  signing_key:
273
277
  specification_version: 4
274
278
  summary: Opinionated minimal Rails authentication scaffolding with Hotwire, React,
@@ -1,65 +0,0 @@
1
- module Kaze::Commands::InstallsHotwireStack
2
- private
3
-
4
- def install_hotwire_stack
5
- # Gems...
6
- return unless remove_gems([ 'sprockets-rails', 'stimulus-rails' ])
7
- return unless install_gems([ 'propshaft', 'view_component', 'tailwindcss-rails', 'turbo-rails', 'dotenv', 'bcrypt' ])
8
- return unless install_gems([ 'hotwire-livereload' ], 'development')
9
- return unless install_gems([ 'factory_bot_rails', 'faker' ], 'development, test')
10
-
11
- # Controllers...
12
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/hotwire/app/controllers", "#{Dir.pwd}/app/controllers")
13
-
14
- # Models...
15
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/default/app/models", "#{Dir.pwd}/app/models")
16
-
17
- # Forms...
18
- ensure_directory_exists("#{Dir.pwd}/app/forms")
19
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/default/app/forms", "#{Dir.pwd}/app/forms")
20
-
21
- # Validators...
22
- ensure_directory_exists("#{Dir.pwd}/app/validators")
23
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/default/app/validators", "#{Dir.pwd}/app/validators")
24
-
25
- # Mailers...
26
- ensure_directory_exists("#{Dir.pwd}/app/mailers")
27
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/default/app/mailers", "#{Dir.pwd}/app/mailers")
28
-
29
- # Views...
30
- ensure_directory_exists("#{Dir.pwd}/app/views/layouts")
31
- ensure_directory_exists("#{Dir.pwd}/app/views/user_mailer")
32
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/hotwire/app/views", "#{Dir.pwd}/app/views")
33
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/default/app/views/layouts/mailer.html.erb", "#{Dir.pwd}/app/views/layouts/mailer.html.erb")
34
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/default/app/views/layouts/mailer.text.erb", "#{Dir.pwd}/app/views/layouts/mailer.text.erb")
35
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/default/app/views/user_mailer", "#{Dir.pwd}/app/views/user_mailer")
36
-
37
- # Components + Pages...
38
- ensure_directory_exists("#{Dir.pwd}/app/components")
39
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/hotwire/app/components", "#{Dir.pwd}/app/components")
40
- ensure_directory_exists("#{Dir.pwd}/app/javascript")
41
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/hotwire/app/javascript/application.js", "#{Dir.pwd}/app/javascript/application.js")
42
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/hotwire/app/javascript/alpinejs.stub", "#{Dir.pwd}/app/javascript/alpinejs.js")
43
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/hotwire/config/importmap.rb", "#{Dir.pwd}/config/importmap.rb")
44
-
45
- # Tests...
46
- install_tests
47
-
48
- # Routes...
49
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/default/config/routes.rb", "#{Dir.pwd}/config/routes.rb")
50
-
51
- # Migrations...
52
- install_migrations
53
-
54
- # Tailwind...
55
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/default/app/assets/stylesheets/application.css", "#{Dir.pwd}/app/assets/stylesheets/application.css")
56
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/default/app/assets/stylesheets/application.tailwind.css", "#{Dir.pwd}/app/assets/stylesheets/application.tailwind.css")
57
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/hotwire/config/tailwind.config.js", "#{Dir.pwd}/config/tailwind.config.js")
58
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/default/bin/dev", "#{Dir.pwd}/bin/dev")
59
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/default/Procfile.dev", "#{Dir.pwd}/Procfile.dev")
60
- run_command("#{Dir.pwd}/bin/rails tailwindcss:build")
61
-
62
- say ''
63
- say 'Kaze scaffolding installed successfully.', :green
64
- end
65
- end
@@ -1,163 +0,0 @@
1
- module Kaze::Commands::InstallsInertiaStacks
2
- private
3
-
4
- def install_inertia_react_stack
5
- # Gems...
6
- return unless remove_gems([ 'sprockets-rails', 'turbo-rails', 'stimulus-rails' ])
7
- return unless install_gems([ 'propshaft', 'tailwindcss-rails', 'inertia_rails', 'vite_rails', 'dotenv', 'bcrypt', 'js-routes' ])
8
- return unless install_gems([ 'factory_bot_rails', 'faker' ], 'development, test')
9
-
10
- # NPM Packages...
11
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/inertia-react-ts/package.json", "#{Dir.pwd}/package.json")
12
-
13
- # Controllers...
14
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/inertia-common/app/controllers", "#{Dir.pwd}/app/controllers")
15
-
16
- # Models...
17
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/default/app/models", "#{Dir.pwd}/app/models")
18
-
19
- # Forms...
20
- ensure_directory_exists("#{Dir.pwd}/app/forms")
21
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/default/app/forms", "#{Dir.pwd}/app/forms")
22
-
23
- # Validators...
24
- ensure_directory_exists("#{Dir.pwd}/app/validators")
25
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/default/app/validators", "#{Dir.pwd}/app/validators")
26
-
27
- # Mailers...
28
- ensure_directory_exists("#{Dir.pwd}/app/mailers")
29
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/default/app/mailers", "#{Dir.pwd}/app/mailers")
30
-
31
- # Views...
32
- ensure_directory_exists("#{Dir.pwd}/app/views/layouts")
33
- ensure_directory_exists("#{Dir.pwd}/app/views/user_mailer")
34
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/inertia-react-ts/app/views/layouts/application.html.erb", "#{Dir.pwd}/app/views/layouts/application.html.erb")
35
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/default/app/views/layouts/mailer.html.erb", "#{Dir.pwd}/app/views/layouts/mailer.html.erb")
36
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/default/app/views/layouts/mailer.text.erb", "#{Dir.pwd}/app/views/layouts/mailer.text.erb")
37
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/default/app/views/user_mailer", "#{Dir.pwd}/app/views/user_mailer")
38
-
39
- # Components + Pages...
40
- ensure_directory_exists("#{Dir.pwd}/app/javascript")
41
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/inertia-react-ts/app/javascript", "#{Dir.pwd}/app/javascript")
42
-
43
- # Tests...
44
- install_tests
45
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/inertia-common/test/integration", "#{Dir.pwd}/test/integration")
46
-
47
- # Routes...
48
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/default/config/routes.rb", "#{Dir.pwd}/config/routes.rb")
49
-
50
- # Migrations...
51
- install_migrations
52
-
53
- # Tailwind / Vite...
54
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/default/app/assets/stylesheets/application.css", "#{Dir.pwd}/app/assets/stylesheets/application.css")
55
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/default/app/assets/stylesheets/application.tailwind.css", "#{Dir.pwd}/app/assets/stylesheets/application.tailwind.css")
56
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/inertia-react-ts/config/tailwind.config.js", "#{Dir.pwd}/config/tailwind.config.js")
57
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/inertia-common/config/vite.json", "#{Dir.pwd}/config/vite.json")
58
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/inertia-react-ts/tsconfig.json", "#{Dir.pwd}/tsconfig.json")
59
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/inertia-react-ts/vite.config.ts", "#{Dir.pwd}/vite.config.ts")
60
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/default/bin/dev", "#{Dir.pwd}/bin/dev")
61
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/inertia-common/bin/vite", "#{Dir.pwd}/bin/vite")
62
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/default/Procfile.dev", "#{Dir.pwd}/Procfile.dev")
63
- File.write("#{Dir.pwd}/Procfile.dev", "#{File.read("#{Dir.pwd}/Procfile.dev")}\nvite: bin/vite dev\n")
64
- run_command("#{Dir.pwd}/bin/rails generate js_routes:middleware")
65
- run_command("#{Dir.pwd}/bin/rails tailwindcss:build")
66
-
67
- say ''
68
- say 'Installing and building Node dependencies.', :magenta
69
-
70
- if File.exist?("#{Dir.pwd}/pnpm-lock.yaml")
71
- run_commands([ 'pnpm install', 'pnpm run build' ])
72
- elsif File.exist?("#{Dir.pwd}/yarn.lock")
73
- run_commands([ 'yarn install', 'yarn build' ])
74
- elsif File.exist?("#{Dir.pwd}/bun.lockb")
75
- run_commands([ 'bun install', 'bun run build' ])
76
- else
77
- run_commands([ 'npm install', 'npm run build' ])
78
- end
79
-
80
- say ''
81
- say 'Kaze scaffolding installed successfully.', :green
82
- end
83
-
84
- def install_inertia_vue_stack
85
- # Gems...
86
- return unless remove_gems([ 'sprockets-rails', 'turbo-rails', 'stimulus-rails' ])
87
- return unless install_gems([ 'propshaft', 'tailwindcss-rails', 'inertia_rails', 'vite_rails', 'dotenv', 'bcrypt', 'js-routes' ])
88
- return unless install_gems([ 'factory_bot_rails', 'faker' ], 'development, test')
89
-
90
- # NPM Packages...
91
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/inertia-vue-ts/package.json", "#{Dir.pwd}/package.json")
92
-
93
- # Controllers...
94
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/inertia-common/app/controllers", "#{Dir.pwd}/app/controllers")
95
-
96
- # Models...
97
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/default/app/models", "#{Dir.pwd}/app/models")
98
-
99
- # Forms...
100
- ensure_directory_exists("#{Dir.pwd}/app/forms")
101
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/default/app/forms", "#{Dir.pwd}/app/forms")
102
-
103
- # Validators...
104
- ensure_directory_exists("#{Dir.pwd}/app/validators")
105
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/default/app/validators", "#{Dir.pwd}/app/validators")
106
-
107
- # Views...
108
- ensure_directory_exists("#{Dir.pwd}/app/views/layouts")
109
- ensure_directory_exists("#{Dir.pwd}/app/views/user_mailer")
110
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/inertia-vue-ts/app/views/layouts/application.html.erb", "#{Dir.pwd}/app/views/layouts/application.html.erb")
111
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/default/app/views/layouts/mailer.html.erb", "#{Dir.pwd}/app/views/layouts/mailer.html.erb")
112
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/default/app/views/layouts/mailer.text.erb", "#{Dir.pwd}/app/views/layouts/mailer.text.erb")
113
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/default/app/views/user_mailer/reset_password.html.erb", "#{Dir.pwd}/app/views/user_mailer/reset_password.html.erb")
114
-
115
- # Mailers...
116
- ensure_directory_exists("#{Dir.pwd}/app/mailers")
117
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/default/app/mailers", "#{Dir.pwd}/app/mailers")
118
-
119
- # Components + Pages...
120
- ensure_directory_exists("#{Dir.pwd}/app/javascript")
121
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/inertia-vue-ts/app/javascript", "#{Dir.pwd}/app/javascript")
122
-
123
- # Tests...
124
- install_tests
125
- FileUtils.copy_entry("#{File.dirname(__FILE__)}/../../../stubs/inertia-common/test/integration", "#{Dir.pwd}/test/integration")
126
-
127
- # Routes...
128
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/default/config/routes.rb", "#{Dir.pwd}/config/routes.rb")
129
-
130
- # Migrations...
131
- install_migrations
132
-
133
- # Tailwind / Vite...
134
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/default/app/assets/stylesheets/application.css", "#{Dir.pwd}/app/assets/stylesheets/application.css")
135
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/default/app/assets/stylesheets/application.tailwind.css", "#{Dir.pwd}/app/assets/stylesheets/application.tailwind.css")
136
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/inertia-vue-ts/config/tailwind.config.js", "#{Dir.pwd}/config/tailwind.config.js")
137
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/inertia-common/config/vite.json", "#{Dir.pwd}/config/vite.json")
138
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/inertia-vue-ts/tsconfig.json", "#{Dir.pwd}/tsconfig.json")
139
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/inertia-vue-ts/vite.config.ts", "#{Dir.pwd}/vite.config.ts")
140
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/default/bin/dev", "#{Dir.pwd}/bin/dev")
141
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/inertia-common/bin/vite", "#{Dir.pwd}/bin/vite")
142
- FileUtils.copy_file("#{File.dirname(__FILE__)}/../../../stubs/default/Procfile.dev", "#{Dir.pwd}/Procfile.dev")
143
- File.write("#{Dir.pwd}/Procfile.dev", "#{File.read("#{Dir.pwd}/Procfile.dev")}\nvite: bin/vite dev\n")
144
- run_command("#{Dir.pwd}/bin/rails generate js_routes:middleware")
145
- run_command("#{Dir.pwd}/bin/rails tailwindcss:build")
146
-
147
- say ''
148
- say 'Installing and building Node dependencies.', :magenta
149
-
150
- if File.exist?("#{Dir.pwd}/pnpm-lock.yaml")
151
- run_commands([ 'pnpm install', 'pnpm run build' ])
152
- elsif File.exist?("#{Dir.pwd}/yarn.lock")
153
- run_commands([ 'yarn install', 'yarn build' ])
154
- elsif File.exist?("#{Dir.pwd}/bun.lockb")
155
- run_commands([ 'bun install', 'bun run build' ])
156
- else
157
- run_commands([ 'npm install', 'npm run build' ])
158
- end
159
-
160
- say ''
161
- say 'Kaze scaffolding installed successfully.', :green
162
- end
163
- end