Commits
Defines a `TabFunction` that all entrypoints export, such that we
consistently support the same call signature.
Adds completion config support and moves some things to the shared
module.
There will be a better way to share logic between these two even more
but it hasn't yet clicked in my head.
* chore: upgrade eslint config to flat config
Migrates the config to be a flat config file (`eslint.config.js`).
To facilitate this, also updates a couple of packages:
- `typescript-eslint` (and drops the `@typescript-eslint/*` packages)
- prettier
- prettier ESLint config
We also removed `eslint-plugin-prettier` since the `format:check` script
achieves the same, and the ESLint config disables all stylistic rules.
* pnpm install
* demo.citty
* using void operator
---------
Co-authored-by: AmirSa12 <amirhosseinpr184@gmail.com>
Adds the ability to pass a config object to the citty entry point in
order to specify handlers for options/commands.
Defining them inline like this means you no longer have to iterate the
parsed commands/options.
It also means you can safely have options named the same for different
sub-commands, and have separate handlers.
tsup currently (and correctly) warns that our `types` exports come after
our module exports, so are never read.
If we place them first, they will be resolved for both the import and
require, and the warnings will go away.
Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>
The `type-check` script expectes `tsc` to exist, but we don't actually
install typescript yet as a direct dependency.
This adds typescript as a dev dependency so the type-check script works
again.
CI somehow does discover `tsc` before this change, but local installs do
not.
* feat: add short flag support for CLI options and enhance completion handling
Defines a `TabFunction` that all entrypoints export, such that we
consistently support the same call signature.
* chore: upgrade eslint config to flat config
Migrates the config to be a flat config file (`eslint.config.js`).
To facilitate this, also updates a couple of packages:
- `typescript-eslint` (and drops the `@typescript-eslint/*` packages)
- prettier
- prettier ESLint config
We also removed `eslint-plugin-prettier` since the `format:check` script
achieves the same, and the ESLint config disables all stylistic rules.
* pnpm install
* demo.citty
* using void operator
---------
Co-authored-by: AmirSa12 <amirhosseinpr184@gmail.com>
Adds the ability to pass a config object to the citty entry point in
order to specify handlers for options/commands.
Defining them inline like this means you no longer have to iterate the
parsed commands/options.
It also means you can safely have options named the same for different
sub-commands, and have separate handlers.