hanami-cli 3.0.0.rc1 → 3.0.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: 38ac5ab30e64a9471ad60f858b4d0131a1909871b422b13526f520169bddc0d5
4
- data.tar.gz: 1714ec1452959aaebdb78f6252324fb90a0a19722b4a1a90fd5c21a8fe64dabd
3
+ metadata.gz: d930695e6875be0d52ee95ce15d97011d783a60c3562a6f4398481a4b8949044
4
+ data.tar.gz: 93bb49dfcbe4832f1350c931967de2bcbbaecb163d820ae1b6f4d637d1cc1bb4
5
5
  SHA512:
6
- metadata.gz: 45a42295cf181115a14ad073a48cae13539966c5f85350a5faf4ca5a33935ebf3a804f41650a3cb43f72727d889037e330e41d27e143aca1e07bcad81325e2f6
7
- data.tar.gz: e851af6f7c47ba168adab4e4f471b49a32d169ab4a17ed2861644577731b93b475569381b863f6a3fcfb1af0b337cba95ab1d07d42bc2ad8411881e4bfc0c3e5
6
+ metadata.gz: ef84ad935a2acde8e55e7dea7c5999c6b320f2bed3288c7fc68c98e9873d1263f06c1d62ba13d6eeabc7e58f7228b0884be27b372b9f5a058acc89af38fa1be0
7
+ data.tar.gz: '049e72c74949e4cc03898fdb6831fdb9b686b4d879dfe9b5067b1adeb2bdc5167c1ac8a004d8241d9e0c722179058e75efbac961391a4af088f0c8c01b2e720f'
data/CHANGELOG.md CHANGED
@@ -19,7 +19,43 @@ and this project adheres to [Break Versioning](https://www.taoensso.com/break-ve
19
19
 
20
20
  ### Security
21
21
 
22
- [Unreleased]: https://github.com/hanami/cli/compare/v3.0.0.rc1...HEAD
22
+ [Unreleased]: https://github.com/hanami/cli/compare/v3.0.0...HEAD
23
+
24
+ ## [3.0.0] - 2026-06-30
25
+
26
+ ### Added
27
+
28
+ - Include `hanami-mailer` in the default `Gemfile`, include sample mailer env vars in `.env`, and generate a base `Mailer` class for the app and each slice (`app/mailer.rb` and `mailer.rb` in slices). Use `hanami new --skip-mailer` to opt out. (@timriley in #420, #425)
29
+ - Add `generate mailer` command. (@timriley in #426)
30
+ - Add `i18n` gem to the default `Gemfile`, and generate a placeholder `config/i18n/en.yml` for the app and each generated slice. (@timriley in #409)
31
+ - Add `--name` option to `hanami new`, to specify a custom module namespace while using the positional argument as the directory path. For example, `hanami new my_bookshelf --name=bookshelf` creates the app in `my_bookshelf/` with `Bookshelf` as the module name. (@aaronmallen in #387)
32
+ - Add `--test` option to `hanami new` to specify which test framework to use. Supports `rspec` (default) and `minitest`. (@timriley in #399)
33
+ - Add `generate provider` command. (@timriley in #419)
34
+ - Add `--template-engine` option to `hanami generate` and `hanami new` to specify which template engine should be used for generated template files. Supports `erb`, `haml` and `slim`. (@katafrakt in #280, #389, #390)
35
+ - Add `--force` option to all generators (except migration), which will override existing files instead of exiting early (@katafrakt in #397)
36
+ - Add a `--skip-test-db` flag to `hanami db` commands. By default, running a `db` command in development also re-runs against the test database to keep the two in sync; passing `--skip-test-db` operates on the development database only. (@adamlassek in #430)
37
+
38
+ ### Changed
39
+
40
+ - In generated `Gemfile`, depend on dry-validation rather than hanami-validations. Hanami Validations will no longer be used; Hanami Action now checks for Dry Validation directly. (@timriley in #401)
41
+ - In generated `package.json`, include `esbuild` as a direct dependency. `esbuild` is now a peer dependency of `hanami-assets`, which requires the app to depend on it directly. (@timriley in #428)
42
+ - Check for the hanami-action gem rather than hanami-controller (now retired) across various commands. (@cllns in #402)
43
+ - Include rouge gem in generated `Gemfile` to enable SQL syntax highlighting in logs. (@kyleplump in #405)
44
+ - When `--gem-source=gem.coop` is used, Hanami and Dry gems are installed from their respective namespaces on gem.coop (@katafrakt in #424)
45
+ - Require Puma 7.1 or later, and remove unneeded `preload_app!` in generated `config/puma.rb`. Preloading is now enabled by default in Puma's cluster mode. (@joshuay03 in #372)
46
+ - In generated `.env`, include a link the guide explaining how these files are loaded. (@timriley in #425)
47
+ - In generated files, update all guides.hanamirb.org links to hanakai.org. (@yosangwon in #407)
48
+ - Require dry-cli 1.4 or later, allowing for simplified argument handling in hanami-rspec callback methods. (@timriley in #408)
49
+ - Link to new hanakai.org site in generated `README.md`. (@katafrakt in #423)
50
+ - Require Ruby 3.3 or newer.
51
+
52
+ ### Fixed
53
+
54
+ - Skip generating duplicate routes when running `generate action`. (@sandbergja in #417)
55
+ - Don't overwrite libpq ENV vars with empty strings derived from certain DATABASE_URLs. (@StantonMatt in #414)
56
+ - Remove duplicate text in `middleware` and `routes` command usage output. (@katafrakt in #406)
57
+
58
+ [3.0.0]: https://github.com/hanami/cli/compare/v2.3.5...v3.0.0
23
59
 
24
60
  ## [3.0.0.rc1] - 2026-06-16
25
61
 
@@ -52,7 +88,7 @@ and this project adheres to [Break Versioning](https://www.taoensso.com/break-ve
52
88
 
53
89
  - Skip generating duplicate routes when running `generate action`. (@sandbergja in #417)
54
90
  - Don't overwrite libpq ENV vars with empty strings derived from certain DATABASE_URLs. (@StantonMatt in #414)
55
- - Remove duplicate text in `middleware` and `routes` command usage output. (@katafrakt in #406
91
+ - Remove duplicate text in `middleware` and `routes` command usage output. (@katafrakt in #406)
56
92
 
57
93
  [3.0.0.rc1]: https://github.com/hanami/cli/compare/v2.3.5...v3.0.0.rc1
58
94
 
@@ -14,6 +14,42 @@ module Hanami
14
14
  # @since 2.2.0
15
15
  # @api private
16
16
  class Command < App::Command
17
+ # Overloads {Hanami::CLI::Commands::App::DB::Command#call} to allow skipping test
18
+ # database operations
19
+ #
20
+ # Adds `--skip-test-db` option flag
21
+ #
22
+ # @since 3.0.0
23
+ # @api private
24
+ module SkipTestDB
25
+ # @since 3.0.0
26
+ # @api private
27
+ def self.prepended(klass)
28
+ # This module is included each time the class is inherited
29
+ # Without this check, the --skip-test-db option is duplicated each time
30
+ unless klass.options.map(&:name).include?(:skip_test_db)
31
+ klass.option :skip_test_db, type: :flag, default: false, desc: "Skip test database operations"
32
+ end
33
+ end
34
+
35
+ # @since 3.0.0
36
+ # @api private
37
+ def call(*args, **opts)
38
+ if opts[:skip_test_db]
39
+ ENV["HANAMI_CLI_DB_COMMAND_RE_RUN_IN_TEST"] = "false"
40
+ end
41
+
42
+ super
43
+ end
44
+ end
45
+
46
+ # @since 3.0.0
47
+ # @api private
48
+ def self.inherited(klass)
49
+ super
50
+ klass.prepend(SkipTestDB)
51
+ end
52
+
17
53
  option :app, required: false, type: :flag, default: false, desc: "Use app database"
18
54
  option :slice, required: false, desc: "Use database for slice"
19
55
 
@@ -179,6 +215,9 @@ module Hanami
179
215
  # Re-runs in test are for development-env commands only.
180
216
  return unless Hanami.env == :development
181
217
 
218
+ # Re-runs have been intentionally switched off
219
+ return if ENV.fetch("HANAMI_CLI_DB_COMMAND_RE_RUN_IN_TEST", "true") != "true"
220
+
182
221
  cmd = $0
183
222
  cmd = "bundle exec #{cmd}" if ENV.key?("BUNDLE_BIN_PATH")
184
223
 
@@ -192,7 +231,7 @@ module Hanami
192
231
  end
193
232
 
194
233
  def re_running_in_test?
195
- ENV.key?("HANAMI_CLI_DB_COMMAND_RE_RUN_IN_TEST")
234
+ ENV["HANAMI_CLI_DB_COMMAND_RE_RUN_IN_TEST"] == "true"
196
235
  end
197
236
 
198
237
  # Returns the `ARGV` with every option argument included, but the `-e` or `--env` args
@@ -71,7 +71,13 @@ module Hanami
71
71
  parent_class_name: "Hanami::Mailer",
72
72
  requires: ["hanami/mailer"],
73
73
  auto_register: false,
74
- body: ["# Add common mailer behavior here. See https://hanakai.org/learn/hanami/mailers for details."]
74
+ body: [
75
+ "# Add common mailer behavior here, such as a default sender:",
76
+ "#",
77
+ '# from "noreply@example.com"',
78
+ "#",
79
+ "# See https://hanakai.org/learn/hanami/mailers for details."
80
+ ]
75
81
  ).create
76
82
 
77
83
  fs.create("app/mailers/.keep", t("keep.erb", context))
@@ -6,6 +6,6 @@ module Hanami
6
6
  #
7
7
  # @api public
8
8
  # @since 2.0.0
9
- VERSION = "3.0.0.rc1"
9
+ VERSION = "3.0.0"
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.rc1
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hanakai team