kaze 0.11.0 → 0.13.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: 801eeb176444975c22103b1c30236940bc4f039cbd78247f0dd953adceb14e2a
4
- data.tar.gz: 7a0023977ffddbcdc64c30969fcbfe7f467df905636196433eb39f0adc65dda0
3
+ metadata.gz: d4c1c801693af9fede14200800169897e887342421d94b5910436217b4aac242
4
+ data.tar.gz: 8468cd9b25d02154257e3e049400e76aceef199e452ed78f3cfe043afe8578dd
5
5
  SHA512:
6
- metadata.gz: 9e69b526a0219cb6bad9268ccf6f312fe81a020f6925988eb4eb4d7733f5264bd02167c9b4f13c96daf1dcb0bece48eef41c2fa68a27b80b2b9ad8f917f37d8a
7
- data.tar.gz: d683e46426ef76a6356343ade5d5e6026c5a05020daa3fc599e4279e73c31c09d1b18eae029bb9d8324f89fc429c4368beedf1089d273173e74c567ee76a412e
6
+ metadata.gz: 01d69cf3549d24c7aa3d70af1e5ef6cf8fbca90a34bf4cb0aa2fab64809e8cdc8ce16641256af10e988d267a3cb82f9bdd1b85218db2e72bd91916101dd0c710
7
+ data.tar.gz: 55e0a82ff2f5bbfcac353c0b43ba798b5fbe0fb842cc53ebb5ade893777f3cbadfc9e857c9e1108627785a65c8de5ad7aac19321c2722b3251fb0e8d4bef946f
data/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) Cuong Giang
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/bin/kaze CHANGED
@@ -3,7 +3,7 @@
3
3
  require "kaze"
4
4
 
5
5
  begin
6
- Kaze::Commands::InstallCommand.start(ARGV)
6
+ Kaze::Commands::App.start(ARGV)
7
7
  rescue => e
8
8
  puts " \e[31mERROR (#{e.class}): #{e.message}\e[0m"
9
9
  puts e.backtrace if ENV["VERBOSE"]
@@ -1,25 +1,4 @@
1
- require 'bundler'
2
- require 'fileutils'
3
- require 'open3'
4
- require 'thor'
5
-
6
- class Kaze::Commands::InstallCommand < Thor
7
- include Kaze::Commands::InstallsHotwireStack
8
- include Kaze::Commands::InstallsInertiaStacks
9
-
10
- desc 'install [STACK]', 'Install the Kaze controllers and resources. Supported stacks: hotwire, react, vue.'
11
- def install(stack = 'hotwire')
12
- return say 'Kaze must be run in a new Rails application.', :red unless File.exist?("#{Dir.pwd}/bin/rails")
13
-
14
- return install_hotwire_stack if stack == 'hotwire'
15
-
16
- return install_inertia_react_stack if stack == 'react'
17
-
18
- return install_inertia_vue_stack if stack == 'vue'
19
-
20
- say 'Invalid stack. Supported stacks are [hotwire], [react], [vue].', :red
21
- end
22
-
1
+ module Kaze::Commands::Utils
23
2
  private
24
3
 
25
4
  def install_gems(gems = [], group = nil)
data/lib/kaze/commands.rb CHANGED
@@ -1,2 +1,38 @@
1
+ require 'bundler'
2
+ require 'fileutils'
3
+ require 'open3'
4
+ require 'thor'
5
+
1
6
  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
38
  end
data/lib/kaze/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kaze
2
- VERSION = '0.11.0'
2
+ VERSION = '0.13.0'
3
3
  end
@@ -29,6 +29,6 @@
29
29
  <p>Regards,<br>
30
30
  <%= ENV.fetch("APP_NAME", "Rails") %></p>
31
31
  <!-- Subcopy -->
32
- <% content_for :subcopy do %>
32
+ <% content_for(:subcopy) do %>
33
33
  <p>If you're having trouble clicking the "Reset Password" button, copy and paste the URL below into your web browser: <span class="break-all"><%= link_to @reset_url, @reset_url %><span></p>
34
34
  <% end %>
@@ -28,6 +28,6 @@
28
28
  <p>Regards,<br>
29
29
  <%= ENV.fetch("APP_NAME", "Rails") %></p>
30
30
  <!-- Subcopy -->
31
- <% content_for :subcopy do %>
31
+ <% content_for(:subcopy) do %>
32
32
  <p>If you're having trouble clicking the "Verify Email Address" button, copy and paste the URL below into your web browser: <span class="break-all"><%= link_to @verification_url, @verification_url %><span></p>
33
33
  <% end %>
@@ -6,8 +6,6 @@ class CreateUsers < ActiveRecord::Migration
6
6
  table.timestamp :email_verified_at
7
7
  table.string :password_digest, null: false
8
8
  table.string :remember_token
9
- table.integer :current_team_id
10
- table.string :profile_photo_path, limit: 2048
11
9
  table.timestamps
12
10
  end
13
11
  end
@@ -22,7 +22,7 @@ class ProfileController < ApplicationController
22
22
  def destroy
23
23
  @delete_user_form = DeleteUserForm.new(params.permit(:password))
24
24
 
25
- return render partial: 'profile/partials/delete_user_form', status: :unprocessable_entity if @delete_user_form.invalid?
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?
26
26
 
27
27
  user = Current.auth.user
28
28
 
@@ -0,0 +1,25 @@
1
+ <div id="confirm_user_deletion_modal">
2
+ <%= render(ModalComponent.new({ name: "confirm-user-deletion", show: @delete_user_form.error_messages.has_key?(:password), focusable: true })) do %>
3
+ <%= form_with model: @delete_user_form, url: profile_destroy_path, method: "delete", class: "p-6" do %>
4
+ <h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
5
+ Are you sure you want to delete your account?
6
+ </h2>
7
+ <p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
8
+ Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.
9
+ </p>
10
+ <div class="mt-6">
11
+ <%= render(InputLabelComponent.new({ for: "password", value: "Password", class: "sr-only" })) %>
12
+ <%= render(TextInputComponent.new({ id: "password", class: "mt-1 block w-3/4", type: "password", name: "password", placeholder: "Password" })) %>
13
+ <%= render(InputErrorComponent.new({ class: "mt-2", message: @delete_user_form.error_messages[:password] })) %>
14
+ </div>
15
+ <div class="mt-6 flex justify-end">
16
+ <%= render(SecondaryButtonComponent.new({ "x-on:click": "$dispatch('close')" })) do %>
17
+ Cancel
18
+ <% end %>
19
+ <%= render(DangerButtonComponent.new({ class: "ms-3" })) do %>
20
+ Delete Account
21
+ <% end %>
22
+ </div>
23
+ <% end %>
24
+ <% end %>
25
+ </div>
@@ -10,29 +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(ModalComponent.new({ name: "confirm-user-deletion", show: @delete_user_form.error_messages.has_key?(:password), focusable: true })) do %>
14
- <turbo-frame id="delete_user_form">
15
- <%= form_with model: @delete_user_form, url: profile_destroy_path, method: "delete", class: "p-6" do %>
16
- <h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
17
- Are you sure you want to delete your account?
18
- </h2>
19
- <p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
20
- Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.
21
- </p>
22
- <div class="mt-6">
23
- <%= render(InputLabelComponent.new({ for: "password", value: "Password", class: "sr-only" })) %>
24
- <%= render(TextInputComponent.new({ id: "password", class: "mt-1 block w-3/4", type: "password", name: "password", placeholder: "Password" })) %>
25
- <%= render(InputErrorComponent.new({ class: "mt-2", message: @delete_user_form.error_messages[:password] })) %>
26
- </div>
27
- <div class="mt-6 flex justify-end">
28
- <%= render(SecondaryButtonComponent.new({ "x-on:click": "$dispatch('close')" })) do %>
29
- Cancel
30
- <% end %>
31
- <%= render(DangerButtonComponent.new({ class: "ms-3" })) do %>
32
- Delete Account
33
- <% end %>
34
- </div>
35
- <% end %>
36
- </turbo-frame>
37
- <% end %>
13
+ <%= render 'profile/partials/confirm_user_deletion_modal' %>
38
14
  </section>
@@ -3,7 +3,6 @@
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <meta name="turbo-visit-control" content="reload">
7
6
  <title><%= content_for(:title) || "Rails" %></title>
8
7
  <%= csrf_meta_tags %>
9
8
  <%= csp_meta_tag %>
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.11.0
4
+ version: 0.13.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-06-25 00:00:00.000000000 Z
11
+ date: 2024-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.2'
19
+ version: '1.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.2'
26
+ version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: zeitwerk
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.5'
33
+ version: '2.6'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '2.5'
40
+ version: '2.6'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: railties
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -60,14 +60,14 @@ executables:
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
+ - LICENSE.md
63
64
  - README.md
64
65
  - bin/kaze
65
66
  - lib/kaze.rb
66
67
  - lib/kaze/commands.rb
67
- - lib/kaze/commands/install_command.rb
68
68
  - lib/kaze/commands/installs_hotwire_stack.rb
69
69
  - lib/kaze/commands/installs_inertia_stacks.rb
70
- - lib/kaze/commands/version_command.rb
70
+ - lib/kaze/commands/utils.rb
71
71
  - lib/kaze/version.rb
72
72
  - stubs/default/Procfile.dev
73
73
  - stubs/default/app/assets/stylesheets/application.css
@@ -150,6 +150,7 @@ files:
150
150
  - stubs/hotwire/app/views/layouts/application.html.erb
151
151
  - stubs/hotwire/app/views/layouts/guest.html.erb
152
152
  - stubs/hotwire/app/views/profile/edit.html.erb
153
+ - stubs/hotwire/app/views/profile/partials/_confirm_user_deletion_modal.html.erb
153
154
  - stubs/hotwire/app/views/profile/partials/_delete_user_form.html.erb
154
155
  - stubs/hotwire/app/views/profile/partials/_update_password_form.html.erb
155
156
  - stubs/hotwire/app/views/profile/partials/_update_profile_information_form.html.erb
@@ -270,5 +271,6 @@ requirements: []
270
271
  rubygems_version: 3.5.9
271
272
  signing_key:
272
273
  specification_version: 4
273
- summary: Minimal Rails authentication scaffolding with Hotwire, Vue, or React + Tailwind.
274
+ summary: Opinionated minimal Rails authentication scaffolding with Hotwire, React,
275
+ or Vue + Tailwind.
274
276
  test_files: []
@@ -1,6 +0,0 @@
1
- class Kaze::Commands::VersionCommand < Thor
2
- desc 'version', 'Show Kaze version'
3
- def version
4
- puts Kaze::VERSION
5
- end
6
- end