Skip to content

Commit

Permalink
fix(main): add maxItems option to scope prompt
Browse files Browse the repository at this point in the history
Fixed glitch on small height screen for long scopes list. Base on @clack/[email protected] via bombshell-dev/clack#174
  • Loading branch information
exdeniz committed May 8, 2024
1 parent 8754f52 commit 9488292
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
"main": "dist/index.js",
"bin": {
"better-commits-init": "./dist/init.js",
"better-commits": "./dist/index.js",
"better-commits": "./dist/sindex.js",
"better-branch": "./dist/branch.js",
"bcommits": "./dist/index.js",
"git-bc": "./dist/index.js"
},
"license": "MIT",
"dependencies": {
"@clack/core": "^0.3.1",
"@clack/prompts": "^0.6.2",
"@clack/prompts": "^0.7.0",
"configstore": "^5.0.1",
"picocolors": "^1.0.0",
"valibot": "^0.30.0"
Expand Down
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ Better-commits (& better-branch) are highly flexible with sane defaults. These o
"enable": true,
"custom_scope": false,
"initial_value": "app",
"max_items": Infinity
"options": [
{
"value": "app",
Expand Down Expand Up @@ -292,6 +293,7 @@ Expand to see explanations and possible values
| `commit_scope.enable` | If true include commit scope |
| `commit_scope.custom_scope` | If true allow custom scope at run-time |
| `commit_scope.initial_value` | Default commit scope selected |
| `commit_scope.max_items` | Maximum number of scope displayed on the screen |
| `commit_scope.options.value` | Commit scope value |
| `commit_scope.options.label` | Commit scope label |
| `check_ticket.infer_ticket` | If true infer ticket from branch name |
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export async function main(config: Output<typeof Config>) {
let commit_scope = await p.select({
message: "Select a commit scope",
initialValue: config.commit_scope.initial_value,
maxItems: config.commit_scope.max_items,
options: config.commit_scope.options,
});
if (p.isCancel(commit_scope)) process.exit(0);
Expand Down
1 change: 1 addition & 0 deletions src/valibot-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const Config = v.object({
{
enable: v.optional(v.boolean(), true),
custom_scope: v.optional(v.boolean(), false),
max_items: v.optional(v.number(), Infinity),
initial_value: v.optional(v.string(), "app"),
options: v.optional(
v.array(
Expand Down

0 comments on commit 9488292

Please sign in to comment.