-
Notifications
You must be signed in to change notification settings - Fork 74
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
feat: support select template from templates dir #1370
Conversation
Warning Rate limit exceeded@kiner-tang has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 36 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. Walkthrough这次更改主要集中在 Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant Inquirer
participant FileSystem
User->>CLI: 启动CLI
CLI->>Inquirer: 提示用户输入项目名称和模板类型
Inquirer-->>User: 显示提示
User-->>Inquirer: 提供项目名称和模板类型
Inquirer-->>CLI: 返回用户输入的项目名称和模板类型
CLI->>FileSystem: 根据模板创建项目
FileSystem-->>CLI: 返回创建结果
CLI-->>User: 显示创建成功信息
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- packages/create-mako/mako-project/index.ts (1 hunks)
- packages/create-mako/src/cli.ts (2 hunks)
Files skipped from review due to trivial changes (1)
- packages/create-mako/mako-project/index.ts
Additional comments not posted (5)
packages/create-mako/src/cli.ts (5)
4-4
: 导入QuestionCollection
类型导入
QuestionCollection
类型是为了支持新的模板选择功能。
8-8
: 添加baseTemplatesPath
常量添加
baseTemplatesPath
常量使代码更灵活,可以动态确定模板目录的路径。
10-10
: 添加InitOptions
类型
InitOptions
类型用于结构化init
函数的参数。
51-51
: 添加InitQuestion
类型
InitQuestion
类型用于用户提示。
57-57
: 改进用户交互,但需要验证用户提示逻辑
main
函数的更改改进了用户交互,允许动态输入项目名称和模板选择。确保提示逻辑正确实现。建议验证用户提示逻辑以确保功能正常工作。
Verification successful
用户提示逻辑已正确实现
main
函数中的更改改进了用户交互,允许动态输入项目名称和模板选择。questions
数组和inquirer.prompt
的使用确保了当未提供参数时,脚本会提示用户输入必要的信息。
questions
数组定义在main
函数中,包含项目名称和模板选择的提示。Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify user prompt logic for project name and template selection. # Test: Run the script and check if it prompts for project name and template correctly. node packages/create-mako/src/cli.tsLength of output: 110
Script:
#!/bin/bash # Search for the usage of `inquirer` in the `cli.ts` file to verify the prompt logic. ast-grep --lang typescript --pattern 'import $_ from "inquirer"' && rg 'inquirer.prompt' packages/create-mako/src/cli.tsLength of output: 280
Script:
#!/bin/bash # Search for the definition and contents of the `questions` array in `packages/create-mako/src/cli.ts`. rg 'const questions' -A 10 packages/create-mako/src/cli.tsLength of output: 60
Script:
#!/bin/bash # Search for the keyword `questions` throughout the `cli.ts` file to find the prompt definitions. rg 'questions' packages/create-mako/src/cli.ts -A 20 -B 5Length of output: 1023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- packages/create-mako/src/cli.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/create-mako/src/cli.ts
@sorrycc 大佬,有空帮忙看看这个 PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it conflicts, please merge master first.
ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- packages/create-mako/src/cli.ts (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/create-mako/src/cli.ts
@kiner-tang https://makojs.dev/docs/feedback#contributing |
yarn create mako demo --template=vue3
yarn create mako
Summary by CodeRabbit
InitOptions
,init
函数现在接受包含projectName
和template
属性的对象。inquirer
提示用户输入项目名称和模板选择。