Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request][bugfix] enableMultipleScopes为true时defaultScope不生效,同时希望defaultScope支持string[]数据类型 #140

Closed
curlykay9527 opened this issue Aug 8, 2023 · 6 comments
Assignees
Labels
enhancement New feature or request next version Plan for next version

Comments

@curlykay9527
Copy link

curlykay9527 commented Aug 8, 2023

💭 Describe the feature

希望prompt.defaultScope在prompt.enableMultipleScopes为true的情况下可以支持scope字符串数组,或者提供prompt.defaultScopes属性
我有一个monorepo项目其中有多个工作空间,在一些联动需求提交时允许选择多个scope,我可以使用git status找到所有的涉及的工作区,减少手动选择工作区操作

💡 Proposed Solution

bugfix

image

实际效果

flow-line 默认未选中

期望效果

多选状态下flow-line 应该默认选中

Feature Request

image

实际效果

终端报错,defaultScope不支持处理string[]

期望效果

scope支持多选时同时defaultScope能支持默认选中多个scope

@curlykay9527 curlykay9527 added the enhancement New feature or request label Aug 8, 2023
@Zhengqbbb
Copy link
Owner

终端报错,defaultScope不支持处理string[]

目前是只有 string 的。且功能目前仅有置顶

image

默认多选 scope,这个feature 是有想过,我不认为这是一个必要功能,scope 不应该过长,且已经有搜索功能,所以我对这个问题保持开放性,不一定会实现,但在后续我将进行尝试

或者提供prompt.defaultScopes属性

是指 defaultScopes 没有正常 work 吗 还有指其他的

@curlykay9527
Copy link
Author

curlykay9527 commented Aug 8, 2023

scope 不应该过长

认同这一点,不过在存在enableMultipleScopes配置的情况下,去寻求defaultScope支持多选,我认为是一种自然的惯性思维。
当前我通过将涉及的暂存区workspack查询出来,并在scopes数组中排到前面。暂时满足了便捷选中scope的需求,如果defaultScope支持多选的话,我认为将会是一个非常好的DX

是指 defaultScopes 没有正常 work 吗 还有指其他的

不需要提供prompt.defaultScopes属性。
实际问题是,在enableMultipleScopes: true的情况下,defaultScope即使赋予了一个scope字符串,在选择scope时也没有出现置顶,见上方[bugfix]图

@Zhengqbbb
Copy link
Owner

Zhengqbbb commented Aug 8, 2023

defaultScope即使赋予了一个scope字符串,在选择scope时也没有出现置顶,见上方[bugfix]图

奇怪,没置顶的话就是 bug了,可以复现吗? 给一下最小化配置例子

.commitlintrc.cjs

/** @type {import('cz-git').UserConfig} */
module.exports = {
  prompt: {
    enableMultipleScopes: true,
    scopes: ['bar', 'foo'],
    defaultScope: 'foo',
  },
}
image

@curlykay9527
Copy link
Author

这是我的问题,确实是置顶了,抱歉。

@Zhengqbbb
Copy link
Owner

很抱歉 久等了,当前功能已实现,已发布预发版本可进行测试 npm install -D cz-git@next

我预计在今晚合并主线,在周末发布版本

CleanShot.2023-12-05.at.16.23.12-converted.mp4

Zhengqbbb added a commit that referenced this issue Dec 5, 2023
… for checkbox mode (#148)

* feat(plugin-inquirer): support item setting checked status on checkbox initial

link #140
@Zhengqbbb
Copy link
Owner

The latest version 🌟(v1.8.0)🌟 should be resolve this issue request , please have a try. 💪
👀 Let me know if there are still any issues. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request next version Plan for next version
Projects
None yet
Development

No branches or pull requests

2 participants