Skip to content

Conversation

@FliPPeDround
Copy link
Member

@FliPPeDround FliPPeDround commented Sep 8, 2025

Description 描述

Linked Issues 关联的 Issues

Additional context 额外上下文

Summary by CodeRabbit

  • New Features

    • Introduced an MCP service to scaffold uni-app projects with “template” and “custom” creation tools.
    • Added a CLI --force (-f) flag to bypass overwrite prompts during project creation.
  • Documentation

    • Added MCP package README with usage instructions and example configuration.
  • Chores

    • Added development dependencies to improve tooling.
    • Updated template UI preset and config package versions (ESLint, @types/node).
    • Created build and release configurations for the MCP package.
    • Refined package descriptions for clarity.

@coderabbitai
Copy link

coderabbitai bot commented Sep 8, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Introduces a new MCP package with server, schemas, handlers, build config, and docs; adds a --force (-f) flag to the core CLI to bypass overwrite prompts; updates several template/manifests and devDependency versions; and adds root devDependencies for @Create-uni tooling.

Changes

Cohort / File(s) Summary
Root tooling devDependencies
package.json
Added devDependencies: @create-uni/gui@^0.0.7, @create-uni/info@^0.1.8, create-uni@^2.3.5.
Core CLI overwrite flag
packages/core/src/index.ts
Added --force/-f CLI flag; overwrite check now auto-confirms when --force is supplied, otherwise prompts as before.
New MCP package
packages/mcp/... (README.md, bump.config.ts, package.json, tsconfig.json, tsup.config.ts, src/index.ts, src/handlers.ts, src/schemas.ts, src/types.ts, src/utils.ts)
Added MCP server exposing tools: create-with-template and create-custom; Zod schemas and TypeScript types; directory check utility; handlers executing npx create-uni@latest; build, release, and TypeScript configs; README.
Template and manifest updates
packages/core/template/UI/skiyee/package.json, packages/core/template/config/lint/package.json, packages/core/template/config/typescript/package.json, packages/shared/package.json
Bumped @skiyee/ui-preset (^0.0.7 → ^0.0.8), eslint (^9.34.0 → ^9.35.0), @types/node (^24.3.0 → ^24.3.1); tweaked shared package description spacing.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Client as MCP Client
  participant Server as MCP Server (@create-uni/mcp)
  participant Handlers as Handlers
  participant Spawn as npx create-uni@latest
  participant FS as File System

  Note over Server: Startup
  Client->>Server: Connect via stdio
  Server-->>Client: Tools registered: create-with-template, create-custom

  rect rgba(227,245,255,0.7)
  Note right of Client: Use preset template
  Client->>Server: callTool(create-with-template, {name, templateType, force})
  Server->>Handlers: createWithTemplate(options)
  Handlers->>FS: checkDirectory(name, force)
  FS-->>Handlers: {canCreate}
  alt canCreate
    Handlers->>Spawn: run with args derived from options
    Spawn-->>Handlers: {success|error}
    alt success
      Handlers-->>Server: CallToolResult (success message)
      Server-->>Client: Result
    else error
      Handlers-->>Server: CallToolResult (error text)
      Server-->>Client: Error
    end
  else blocked
    Handlers-->>Server: CallToolResult (directory not empty)
    Server-->>Client: Info
  end
  end

  rect rgba(232,255,232,0.7)
  Note right of Client: Custom selection
  Client->>Server: callTool(create-custom, {name, flags, lists, force})
  Server->>Handlers: createCustom(options)
  Handlers->>FS: checkDirectory(name, force)
  FS-->>Handlers: {canCreate}
  Handlers->>Spawn: run with constructed args
  Spawn-->>Handlers: {success|error}
  Handlers-->>Server: CallToolResult (summary or error)
  Server-->>Client: Result
  end
Loading
sequenceDiagram
  autonumber
  actor User
  participant CLI as packages/core/src/index.ts
  participant FS as File System

  User->>CLI: create-uni <projectName> [--force|-f]
  alt --force provided
    Note right of CLI: Skip prompt
    CLI->>FS: Overwrite target
    FS-->>CLI: result
  else no --force
    CLI->>User: Prompt: overwrite?
    User-->>CLI: yes/no
    alt yes
      CLI->>FS: Overwrite target
      FS-->>CLI: result
    else no
      CLI-->>User: Abort
    end
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • chore: update deps #125 — Similar dependency bumps across template manifests (eslint, @types/node, @skiyee/ui-preset) in the same paths.
  • chore: update deps #123 — Updates @skiyee/ui-preset in packages/core/template/UI/skiyee/package.json, matching this file’s change.
  • chore: update deps #108 — Bumps eslint and @types/node in template config manifests, overlapping with the same files.

Suggested labels

size/L

Poem

I thump my paw: a server springs,
Two shiny tools with scaffolded wings.
A flag called -f cuts prompts in twain,
While presets hop along the lane.
New tags, new types, and docs to see—
Burrow built with create-uni 🥕✨


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 41e7bb4 and e401ea1.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (16)
  • package.json (1 hunks)
  • packages/core/src/index.ts (2 hunks)
  • packages/core/template/UI/skiyee/package.json (1 hunks)
  • packages/core/template/config/lint/package.json (1 hunks)
  • packages/core/template/config/typescript/package.json (1 hunks)
  • packages/mcp/README.md (1 hunks)
  • packages/mcp/bump.config.ts (1 hunks)
  • packages/mcp/package.json (1 hunks)
  • packages/mcp/src/handlers.ts (1 hunks)
  • packages/mcp/src/index.ts (1 hunks)
  • packages/mcp/src/schemas.ts (1 hunks)
  • packages/mcp/src/types.ts (1 hunks)
  • packages/mcp/src/utils.ts (1 hunks)
  • packages/mcp/tsconfig.json (1 hunks)
  • packages/mcp/tsup.config.ts (1 hunks)
  • packages/shared/package.json (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/update-deps

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@FliPPeDround FliPPeDround merged commit ba5a20f into main Sep 8, 2025
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants