Hanami Command Line Interface
- [Tim Riley] Run a bundle install inside
hanami install
. Combined with first-party extension gems modifying the new app'sGemfile
via abefore "install"
command hook, this ensures that all necessary gems are installed duringthehanami new
command. (#269)
- [Tim Riley] Allow
hanami new
to be called with--skip-db
(#266)
- [Kyle Plump] Add
--gateway
optiopn togenerate relation
(#261) - [Tim Riley] Depend on stable release of dry-operation in new app
Gemfile
(#262) - [Tim Riley] Depend on newser dry-types with a simpler version constraint in new app
Gemfile
(#263) - [Adam Lassek] Point to Hanami's own migrations guide from generated migration files (#264)
- [Tim Riley, François Beausoleil] Generate a
config/db/seeds.rb
file in new apps (#255, #256)
- [Tim Riley] Add
--env
and-e
options to all app commands, for setting the Hanami env (#246) - [Tim Riley] Keep test database in sync by applying
hanami db
commands to both development and test databases when invoked in development environment (#247) - [Kyle Plump] Add
--skip-route
flag togenerate action
andgenerate slice
commands (#227) - [Tim Riley] Include a
change do
block in generated migrations (#254) - [Tim Riley] Generate MySQL database URL in
.env
that works with standard Homebrew MySQL installation (#249) - [Tim Riley, Adam Lassek] Remove ROM extension boilerplate in operations generated by
hanami new
andgenerate operation
(this is now applied automatically) (#240, #252) - [François Beausoleil] Print a warning when running
db seed
but expected seeds files could not be found (#256) - [Seb Wilgosz] Only register
generate
subcommands if the relevant gems are bundled (#242) - [Anderson Saunders] When both IRB and pry are loaded, use IRB as the default engine for
hanami console
(#182)
- [Tim Riley] Fix error dumping structure when there are no migrations (#244)
- [Tim Riley] Stop erroneous misconfigured DB warnings from
hanami db
commands when a database is configured once but shared across sliaces (#253)
- [Tim Riley] MySQL support for
db
commands (#226) - [Tim Riley] Support for multiple gateways in
db
commands (#232, #234, #237, #238)
- [Kyle Plump, Tim Riley] Delete
.keep
files when generating new files into previously empty directory (#224) - [Sean Collins] Add
db/*.sqlite
to the.gitignore
in new apps (#210) - [Sean Collins] Print warnings for misconfigured databases when running
db
commands (#211)
- [Sean Collins] Generate db files in
hanami new
andgenerate slice
- [Tim Riley] Add
db
commands:create
,drop
,migrate
,structure dump
structure load
,seed
prepare
,version
- [Tim Riley] Support SQLite and Postgres for
db
commands - [Sean Collins] Add
generate
commands for db components:generate migration
,generate relation
,generate repo
,generate struct
- [Krzysztof] Add
generate component
command - [Sean Collins] Add
generate operation
command
- Drop support for Ruby 3.0
- [Ryan Bigg] Properly pass INT signal to child processes when interrupting
hanami assets watch
command
- [Tim Riley] Underscore slice names in
public/assets/
to avoid naming conflicts with nested asset entry points. In this arrangement, an "admin" slice will have its assets compiled intopublic/assets/_admin/
.
- [Tim Riley] For
hanami assets
commands, run a separate assets compilation process per slice (in parallel). - [Tim Riley] Generate compiled assets into separate folders per slice, each with its own
assets.js
manifest file:public/assets/
for the app, andpublic/assets/[slice_name]/
for each slice. - [Tim Riley] For
hanami assets
commands, directly detect and invoke theconfig/assets.js
files. Look for this file within each slice, and fall back to the app-level file. - [Tim Riley] Do not generate
"scripts": {"assets": "..."}
section in new app'spackage.json
. - [Tim Riley] Subclasses of
Hanami::CLI::Command
receive default args to their#initialize
methods, and do not need to re-declare default args themselves. - [Philip Arndt] Alphabetically sort hanami gems in the new app
Gemfile
.
- [Nishiki (錦華)] Strip invalid characters from module name when generating new app.
- [Tim Riley] Add
--skip-tests
forhanami generate
commands. This CLI option will skip tests generation.
- [Tim Riley] Set
"type": "module"
in package.json, enabling ES modules by default - [Tim Riley] Rename
config/assets.mjs
toconfig/assets.js
(use a plain.js
file extension)
- [Tim Riley] Use correct helper names in generated app layout
- [Luca Guidi] Ensure to generate apps with correct pre-release version of
hanami-assets
NPM package - [Sean Collins] Print to stderr NPM installation errors when running
hanami install
- [Sean Collins] Ensure to install missing gems after
hanami install
is ran
- [Tim Riley]
hanami new
to generatebin/dev
as configuration forhanami dev
- [Luca Guidi] Introducing
hanami generate part
to generate view parts
- [Luca Guidi]
hanami new
generates a fully documented Puma configuration inconfig/puma.rb
- [Tim Riley]
hanami new
generates aconfig/assets.mjs
as Assets configuration - [Tim Riley]
hanami new
generates a leanerpackage.json
- [Tim Riley]
hanami new
doesn't generate a default root route anymore - [Aaron Moodie & Tim Riley]
hanami new
to generate a redesigned 404 and 500 error pages - [Luca Guidi] When generating a RESTful action, skip
create
, ifnew
is present, andupdate
, ifedit
is present
- [Luca Guidi]
hanami new
generatesProcfile.dev
- [Luca Guidi]
hanami new
generates basic app assets, ifhanami-assets
is bundled by the app - [Luca Guidi]
hanami new
accepts--head
to generate the app using Hanami HEAD version from GitHub - [Luca Guidi]
hanami generate slice
generates basic slice assets, ifhanami-assets
is bundled by the app - [Ryan Bigg]
hanami generate action
generates corresponding view, ifhanami-view
is bundled by the app - [Luca Guidi]
hanami assets compile
to compile assets at the deploy time - [Luca Guidi]
hanami assets watch
to watch and compile assets at the development time - [Luca Guidi]
hanami dev
to start the processes inProcfile.dev
- [Luca Guidi]
hanami new
generates aGemfile
withhanami-webconsole
in:development
group - [Luca Guidi]
hanami new
generates aGemfile
with versionedhanami-webconsole
,hanami-rspec
, andhanami-reloader
- [Tim Riley]
hanami new
to generate default views, templates, and helpers - [Tim Riley]
hanami generate slice
to generate default views, templates, and helpers - [Tim Riley]
hanami generate action
to generate associated view and template - [Tim Riley] Introduced
hanami generate view
- [Tim Riley]
hanami new
to generateGemfile
withhanami-view
andhanami-webconsole
gems - [Tim Riley]
hanami new
to generate default error pages for404
and500
HTTP errors
- [Philip Arndt]
hanami server
to start only one Puma worker by default
- [Luca Guidi] Generate a default
.gitignore
when usinghanami new
- [dsisnero] Ensure to run automatically bundle gems when using
hanami new
on Windows - [Luca Guidi] Ensure to generate the correct action identifier in routes when using
hanami generate action
with deeply nested action name
- [Luca Guidi] Official support for Ruby 3.2
- [Luca Guidi] Ensure to load
.env
files during CLI commands execution - [Luca Guidi] Ensure
hanami server
to respect HTTP port used in.env
or the value given as CLI argument (--port
)
- [Tim Riley] Use Zeitwerk to autoload the gem
- [Luca Guidi] In case of internal exception, don't print the stack trace to stderr, print the error message, exit with 1.
- [Tim Riley] Ensure to be able to run
hanami
CLI in Hanami app subdirectories. - [Sean Collins] Return an error when trying to run
hanami new
with an existing target path (file or directory)
- [Sean Collins] Show output when generating files (e.g. in
hanami new
) (#49) - [Luca Guidi] Advertise Bundler and Hanami install steps when running
hanami new
(#54)
- [Luca Guidi] New applications to support Puma server out of the box. Add the
puma
gem toGemfile
and generateconfig/puma.rb
. - [Luca Guidi] New applications to support code reloading for
hanami server
viahanami-reloader
. This gem is added to app'sGemfile
. - [Marc Busqué] Introduce code reloading for
hanami console
via#reload
method to be invoked within the console context.
- [Luca Guidi] Respect plural when generating code via
hanami new
andhanami generate
. Example:hanami new code_insights
=>CodeInsights
instead ofCodeInsight
- [Luca Guidi] Ensure
hanami generate action
to not crash when invoked with non-RESTful action names. Example:hanami generate action talent.apply
- [Piotr Solnica]
hanami generate action
to add routes toconfig/routes.rb
without thedefine
block context. See hanami/hanami#1208
- [Luca Guidi] Added
hanami generate slice
command, for generating a new slice [#32] - [Luca Guidi] Added
hanami generate action
command, for generating a new action in the app or a slice [#33] - [Marc Busqué] Added
hanami middlewares
command, for listing middleware configed in app and/or inconfig/routes.rb
[#30]
- [Marc Busqué, Tim Riley]
hanami
command will detect the app even when called inside nested subdirectories [#34] - [Seb Wilgosz] Include hanami-validations in generated app’s
Gemfile
, allowing action classes to specify.params
[#31] - [Tim Riley] Include dry-types in generated app’s
Gemfile
, which is used by the types module defined inlib/[app_name]/types.rb
(dry-types is no longer a hard dependency of the hanami gem as of 2.0.0.beta2) [#29] - [Tim Riley] Include dotenv in generated app’s
Gemfile
, allowingENV
values to be loaded from.env*
files [#29]
- [Luca Guidi] Implemented
hanami new
to generate a new Hanami app - [Piotr Solnica] Implemented
hanami console
to start an interactive console (REPL) - [Marc Busqué] Implemented
hanami server
to start a HTTP server based on Rack - [Marc Busqué] Implemented
hanami routes
to print app routes - [Luca Guidi] Implemented
hanami version
to print app Hanami version
- [Tim Riley] Ensure CLI starts properly by fixing use of
Slice.slice_name
- [Andrew Croome] Respect HANAMI_ENV env var to set Hanami env if no
--env
option is supplied - [Lucas Mendelowski] Ensure Sequel migrations extension is loaded before related
db
commands are run
- [Tim Riley] [Internal] Update console slice readers to work with new
Hanami::Application.slices
API
- [Viet Tran] Ensure
hanami db
commands to work withhanami
v2.0.0.alpha6
- [Luca Guidi] Official support for Ruby: MRI 3.1
- [Luca Guidi] Drop support for Ruby: MRI 2.6, and 2.7
- [Tim Riley] Display a custom prompt when using irb-based console (consistent with pry-based console)
- [Phil Arndt] Support
postgresql://
URL schemes (in addition to existingpostgres://
support) fordb
subcommands
- [Tim Riley] Ensure slice helper methods work in console (e.g. top-level
main
method will returnMain::Slice
if an app has a "main" slice defined)
No changes.
- [Luca Guidi] Official support for Ruby: MRI 3.0
- [Luca Guidi] Dynamically change the set of available commands depending on the context (outside or inside an Hanami app)
- [Luca Guidi] Dynamically change the set of available commands depending on Hanami app architecture
- [Luca Guidi] Implemented
hanami version
(available both outside and inside an Hanami app) - [Piotr Solnica] Implemented
db *
commands (available both outside and inside an Hanami app) (sqlite and postgres only for now) - [Piotr Solnica] Implemented
console
command with support forIRB
andPry
(pry
is auto-detected)
- [Luca Guidi] Changed the purpose of this gem: the CLI Ruby framework has been extracted into
dry-cli
gem.hanami-cli
is now thehanami
command line. - [Luca Guidi] Drop support for Ruby: MRI 2.5.
- [Luca Guidi] Inheritng from subclasses of
Hanami::CLI::Command
, allows to inherit arguments, options, description, and examples. - [Luca Guidi] Allow to use
super
from#call
- [Luca Guidi] Drop support for Ruby: MRI 2.3, and 2.4.
- [Luca Guidi] Official support for Ruby: MRI 2.6
- [Luca Guidi] Support
bundler
2.0+
- [Anton Davydov & Alfonso Uceda] Introduce array type for arguments (
foo exec test spec/bookshelf/entities spec/bookshelf/repositories
) - [Anton Davydov & Alfonso Uceda] Introduce array type for options (
foo generate config --apps=web,api
) - [Alfonso Uceda] Introduce variadic arguments (
foo run ruby:latest -- ruby -v
) - [Luca Guidi] Official support for JRuby 9.2.0.0
- [Anton Davydov] Print informative message when unknown or wrong option is passed (
"test" was called with arguments "--framework=unknown"
)
- [Anton Davydov & Luca Guidi] Support objects as callbacks
- [Anton Davydov & Luca Guidi] Ensure callbacks' context of execution (aka
self
) to be the command that is being executed
- [Anton Davydov] Register
before
/after
callbacks for commands
- [Luca Guidi] Official support for Ruby: MRI 2.5
- [Alfonso Uceda] Ensure default values for arguments to be sent to commands
- [Alfonso Uceda] Ensure to fail when a missing required argument isn't provider, but an option is provided instead
- [Alfonso Uceda] Allow default value for arguments
- [Alfonso Uceda, Luca Guidi] Commands banner and usage - [Alfonso Uceda] Added support for subcommands
- [Alfonso Uceda] Validations for arguments and options
- [Alfonso Uceda] Commands arguments and options
- [Alfonso Uceda] Commands description
- [Alfonso Uceda, Oana Sipos] Commands aliases
- [Luca Guidi] Exit on unknown command
- [Luca Guidi, Alfonso Uceda, Oana Sipos] Command lookup
- [Luca Guidi, Tim Riley] Trie based registry to register commands and allow third-parties to override/add commands