-
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: cli support customize project name #1340
Conversation
Walkthrough此次更新在 Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI as CLI Application
participant Inquirer as Inquirer
participant Filesystem
User->>CLI: Run CLI without project name
CLI->>Inquirer: Prompt for project name
Inquirer->>User: Ask for project name
User->>Inquirer: Provide project name
Inquirer->>CLI: Return project name
CLI->>Filesystem: Initialize project with given name
Note over CLI,Filesystem: CLI initializes the project in the given directory.
Poem
Tip AI model upgrade
|
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
Outside diff range and nitpick comments (1)
packages/create-mako/src/cli.ts (1)
Line range hint
7-41
: 建议添加文件操作的错误处理目前的实现缺少对文件操作(如
fs.mkdirSync
和fs.copyFileSync
)的错误处理。如果在创建目录或复制文件时发生错误,程序将崩溃。建议在这些操作中添加错误处理逻辑。- fs.mkdirSync(destDir, { recursive: true }); + try { + fs.mkdirSync(destDir, { recursive: true }); + } catch (err) { + console.error(`Error creating directory ${destDir}:`, err); + process.exit(1); + } - fs.copyFileSync(source, dest); + try { + fs.copyFileSync(source, dest); + } catch (err) { + console.error(`Error copying file from ${source} to ${dest}:`, err); + process.exit(1); + }
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
packages/create-mako/yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
Files selected for processing (3)
- packages/create-mako/package.json (1 hunks)
- packages/create-mako/src/cli.ts (2 hunks)
- packages/create-mako/tsconfig.json (1 hunks)
Files skipped from review due to trivial changes (2)
- packages/create-mako/package.json
- packages/create-mako/tsconfig.json
Additional comments not posted (2)
packages/create-mako/src/cli.ts (2)
Line range hint
7-41
: LGTM!代码实现看起来很好,但请确保在文件操作中添加适当的错误处理逻辑。
43-55
: LGTM!代码实现看起来很好,但请考虑添加注释以提高可读性。
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/.gitignore (1 hunks)
Files skipped from review due to trivial changes (1)
- packages/create-mako/.gitignore
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 ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
Files selected for processing (2)
- packages/create-mako/package.json (1 hunks)
- packages/create-mako/src/cli.ts (2 hunks)
Files skipped from review as they are similar to previous changes (2)
- packages/create-mako/package.json
- packages/create-mako/src/cli.ts
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 (3)
- packages/create-mako/.gitignore (1 hunks)
- packages/create-mako/package.json (1 hunks)
- packages/create-mako/src/cli.ts (2 hunks)
Files skipped from review as they are similar to previous changes (3)
- packages/create-mako/.gitignore
- packages/create-mako/package.json
- packages/create-mako/src/cli.ts
@sorrycc 云谦老师,帮忙再 CR 一下 |
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 ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
Files selected for processing (2)
- packages/create-mako/package.json (1 hunks)
- packages/create-mako/src/cli.ts (2 hunks)
Files skipped from review as they are similar to previous changes (2)
- packages/create-mako/package.json
- packages/create-mako/src/cli.ts
Cli support customize project name:
yarn create mako test-demo
will create new project in 'test-demo'yarn create mako .
will create new project in current directorySummary by CodeRabbit