Repository: rails/rails
File: railties/lib/rails/generators/app_base.rb (Ruby)

Code before:
        else
          remove_file("Gemfile")
          remove_file("Gemfile.lock")
        end
      end

      def run_bundle
        bundle_command("install --quiet", "BUNDLE_IGNORE_MESSAGES" => "1") if bundle_install?
      end

      def run_javascript
        return if options[:skip_javascript] || !bundle_install?

        case options[:javascript]
        when "importmap"                           then rails_command "importmap:install"
        when "webpack", "bun", "esbuild", "rollup" then rails_command "javascript:install:#{options[:javascript]}"
        end
      end

      def run_hotwire
        return if options[:skip_hotwire] || !bundle_install?

        rails_command "turbo:install stimulus:install"
      end

      def run_css
        return if !options[:css] || !bundle_install?

        if !using_js_runtime? && options[:css] == "tailwind"
          rails_command "tailwindcss:install"
        elsif !using_js_runtime? && options[:css] == "sass"
          rails_command "dartsass:install"
        else
          rails_command "css:install:#{options[:css]}"
        end
      end

      def run_kamal
        return if options[:skip_kamal] || !bundle_install?

        bundle_command "binstubs kamal"
        bundle_command "exec kamal init"

        template "kamal-secrets.tt", ".kamal/secrets", force: true
        template "config/deploy.yml", force: true
      end

      def run_solid
        return if skip_solid? || !bundle_install?

        commands = "solid_cache:install solid_queue:install"

Review comment (security):
Should `.kamal/secrets` (or the whole `.kamal`) also be added to the [gitignore](https://github.com/rails/rails/blob/main/railties/lib/rails/generators/rails/app/templates/gitignore.tt) and [dockerignore](https://github.com/rails/rails/blob/main/railties/lib/rails/generators/rails/app/templates/dockerignore.tt) templates as well?

And potentially remove the `.env/.env.erb` lines now that there is no more an explicit template for it.

Code after:

      def run_hotwire
        return if options[:skip_hotwire] || !bundle_install?

        rails_command "turbo:install stimulus:install"
      end

      def run_css
        return if !options[:css] || !bundle_install?

        if !using_js_runtime? && options[:css] == "tailwind"
          rails_command "tailwindcss:install"
        elsif !using_js_runtime? && options[:css] == "sass"
          rails_command "dartsass:install"
        else
          rails_command "css:install:#{options[:css]}"
        end
      end

      def run_kamal
        return if options[:skip_kamal] || !bundle_install?

        bundle_command "binstubs kamal"
        bundle_command "exec kamal init"

        template "kamal-secrets.tt", ".kamal/secrets", force: true
        template "config/deploy.yml", force: true
      end

      def run_solid
        return if skip_solid? || !bundle_install?

        commands = "solid_cache:install solid_queue:install"
        commands += " solid_cable:install" unless skip_action_cable?

        rails_command commands
      end

      def add_bundler_platforms
        if bundle_install?
          # The vast majority of Rails apps will be deployed on `x86_64-linux`.
          bundle_command("lock --add-platform=x86_64-linux")

          # Users that develop on M1 mac may use docker and would need `aarch64-linux` as well.
          bundle_command("lock --add-platform=aarch64-linux") if RUBY_PLATFORM.start_with?("arm64")
        end
      end

      def generate_bundler_binstub
        if bundle_install?
          bundle_command("binstubs bundler")