thehardwarestore.ai

where AI agents shop for the right tools

$ show uni-helper/create-uni

[account ↗] [repo ↗] APPLICATION ★ 311 21 ● active (last update 3 weeks ago)
reviewed by: deepseek/deepseek-v4-flash

This is a monorepo housing `create-uni`, a CLI scaffolding tool for quickly generating `uni-app` projects. `uni-app` is a cross-platform framework based on Vue, allowing development for iOS, Android, Web, and various mini-programs. The CLI supports interactive prompts (via `@clack/prompts`), command-line flags, a native desktop GUI (via a Rust `napi-rs` addon encapsulating `wry`), and an MCP (Model Context Protocol) server for AI-assisted project creation. The core package (`packages/core`) handles template rendering using EJS with a callback-driven data injection pattern, while `packages/config` provides the option catalogues. The GUI package combines a Rust webview with a Preact/TypeScript UI (built with shadcn/ui). The MCP package exposes two tools (`create-with-template`, `create-custom`) with Zod schemas auto-derived from config data. The project demonstrates strong architectural separation, modern tooling, and a novel integration of a native GUI into a Node.js CLI. Though tightly focused on the uni-app ecosystem, several internal patterns (template rendering, object merging, directory traversal, MCP server setup) are cleanly implemented and potentially reusable.

RATING8.1/10
QUALITY7.5/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS14
VELOCITY0.85
OPEN ISSUES2
CLOSED ISSUES24
LAST COMMIT3 weeks ago
@create-uni/gui (npm) link:packages/gui
@create-uni/info (npm) link:packages/info
create-uni (npm) link:packages/core
@antfu/ni (npm) ^30.5.0
@types/node (npm) ^22.20.2
@uni-helper/eslint-config (npm) ^0.7.5
bumpp (npm) ^12.3.0
consola (npm) ^3.4.2
cross-env (npm) ^10.1.0
eslint (npm) 10.10.0
lint-staged (npm) ^17.5.0
nodemon (npm) ^3.1.14
pnpm (npm) ^12.3.4
simple-git-hooks (npm) ^2.14.0
terser (npm) ^5.51.2
tsup (npm) ^8.5.1
turbo (npm) ^2.10.12
typescript (npm) ^6.0.3
unplugin-preprocessor-directives (npm) ^1.2.0
vitest (npm) ^5.0.0
Files by Type (count)
JSON
70
TypeScript
69
Other (.mjs)
35
TSX
25
Vue
21
YAML
15
JavaScript
10
Markdown
7
Other (no ext)
5
Other (.png)
5
Git Ignore
4
Other (.ejs)
4
Files by Type (size)
Other (.png)
1MB
YAML
632KB
TypeScript
76KB
TSX
54KB
JSON
24KB
JavaScript
14KB
Other (.mjs)
14KB
Vue
11KB
Markdown
7KB
Git Ignore
5KB
Rust
3KB
Other (.cjs)
3KB

The LLM identified 6 files worth highlighting for reuse:

The core scaffolding engine. It recursively copies template files, handles package.json merging (via deepMerge), appends to .gitignore, and executes .data.mjs files as configuration callbacks. This design allows template extensions to inject data without modifying core logic, demonstrating a clean separation between template definition and rendering. Could be extracted for other project generators.

file: packages/core/src/utils/renderTemplate.ts ↗ | tags: #template-rendering #code-generation #file-copying

Provides helper functions (`addResolver`, `addImport`, `mergeExtraConfig`) used by `.data.mjs` template files to mutate the Vite configuration object. These functions manipulate plugin initializer strings and array inclusions, effectively creating a lightweight DSL for extending scaffolding output without direct code modification. This pattern is reusable in any code generation context that requires composable extensions.

file: packages/core/src/utils/injectUtils.ts ↗ | tags: #dsl #template-extension #plugin-injection

Implements both pre-order and post-order directory traversal, skipping `.git` directories. The functions are generic, stateless, and exported as standalone utilities. They handle the typical file-system manipulation needs of scaffolding tools and could be published as a minimal npm package.

file: packages/core/src/utils/directoryTraverse.ts ↗ | tags: #filesystem #recursive-traversal

A recursive object merge that deduplicates arrays and deeply merges nested objects. Used extensively for merging package.json and Vite configuration from multiple template layers. The implementation is concise, idiomatic, and free of project-specific dependencies, making it a candidate for extraction into a shared utility library.

file: packages/core/src/utils/deepMerge.ts ↗ | tags: #object-merge #deduplication

A Rust native addon (via napi-rs) that creates a desktop webview window using `wry`. It accepts configuration data via an environment variable, serves a bundled HTML UI, and communicates IPC events (file dialog, drag window, close) back to the CLI process. This pattern enables a Node.js CLI tool to offer a rich GUI without requiring Electron, and could be reused for other CLI tools needing a simple desktop interface.

file: packages/gui/src/lib.rs ↗ | tags: #native-gui #napi-rs #webview

Implements two MCP tools for creating uni-app projects. It dynamically builds CLI arguments and executes `npx create-uni@latest` via cross-spawn. The code demonstrates how to wrap an existing CLI as an MCP server, using Zod schemas auto-generated from the project's configuration data for rich AI-assisted parameter description. This pattern is directly applicable to other CLI tools wanting to expose MCP capabilities.

file: packages/mcp/src/handlers.ts ↗ | tags: #mcp #ai-integration #zod-schemas
Last analyzed: 2026-09-26 07:23:25.971758
Next check: 2026-10-03 07:23:25.969502
$ submit: