
Security News
New React Server Components Vulnerabilities: DoS and Source Code Exposure
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.
@miles_wang/create-myapp-cli
Advanced tools
一个用于快速创建干净、完善的 React/Vue 项目的 CLI 脚手架工具。
npx @miles_wang/create-myapp-cli my-app
运行脚手架命令
# 发布后使用(推荐)
npx @miles_wang/create-myapp-cli my-app
# 本地开发测试(npm link 后)
create-myapp-cli my-app
交互式配置 脚手架会引导你完成以下配置:
安装依赖
cd my-app
npm install # 或 yarn install / pnpm install
启动开发服务器
npm run dev # 或 yarn dev / pnpm dev
my-app/
├── public/ # 静态资源目录
├── src/
│ ├── components/ # 组件目录
│ │ └── Welcome/ # 欢迎组件示例
│ ├── lib/ # 工具函数
│ ├── App.tsx # 根组件
│ ├── main.tsx # 入口文件
│ ├── index.css # 全局样式
│ └── vite-env.d.ts # Vite 类型定义
├── index.html # HTML 模板
├── .eslintrc.cjs # ESLint 配置
├── .prettierrc # Prettier 配置
├── .gitignore # Git 忽略配置
├── .nvmrc # Node.js 版本
├── package.json # 项目配置
├── tsconfig.json # TypeScript 配置
├── vite.config.ts # Vite 配置
├── tailwind.config.js # Tailwind CSS 配置
└── README.md # 项目说明
my-app/
├── public/ # 静态资源目录
├── src/
│ ├── components/ # 组件目录
│ │ └── Welcome/ # 欢迎组件示例
│ ├── views/ # 页面组件
│ │ └── Home.vue # 首页示例
│ ├── router/ # 路由配置
│ │ └── index.ts
│ ├── stores/ # Pinia 状态管理
│ │ └── counter.ts # 示例 store
│ ├── App.vue # 根组件
│ ├── main.ts # 入口文件
│ ├── index.css # 全局样式
│ └── vite-env.d.ts # Vite 类型定义
├── index.html # HTML 模板
├── .eslintrc.cjs # ESLint 配置
├── .prettierrc # Prettier 配置
├── .gitignore # Git 忽略配置
├── .nvmrc # Node.js 版本
├── package.json # 项目配置
├── tsconfig.json # TypeScript 配置
├── vite.config.ts # Vite 配置
├── tailwind.config.js # Tailwind CSS 配置
└── README.md # 项目说明
核心框架:
样式方案:
开发工具:
可选功能:
核心框架:
UI 库:
状态管理与路由:
样式方案:
开发工具:
可选功能:
生成的项目中包含以下 npm scripts:
npm run dev - 启动开发服务器npm run build - 构建生产版本npm run preview - 预览生产构建npm run lint - 运行 ESLint 检查npm run format - 格式化代码npm run type-check - TypeScript 类型检查npm run test - 运行单元测试npm run test:ui - 运行测试 UI(Vitest)npm run test:e2e - 运行 E2E 测试npm run test:e2e:ui - 运行 E2E 测试 UInpm run test:e2e:install - 安装 Playwright 浏览器create-myapp-cli/
├── bin/ # 可执行文件
│ └── create-myapp-cli.js # CLI 入口
├── lib/ # 核心逻辑
│ ├── createProject.js # 项目创建逻辑
│ ├── prompts.js # 交互式选项
│ └── utils.js # 工具函数
├── templates/ # 项目模板
│ ├── react-template/ # React 项目模板
│ │ ├── prepare-template.cjs # 模板预处理脚本
│ │ └── ...
│ └── vue-template/ # Vue 项目模板
│ ├── prepare-template.cjs # 模板预处理脚本
│ └── ...
├── package.json
└── README.md
克隆项目
git clone <repository-url>
cd create-myapp-cli
安装依赖
npm install
链接到全局(用于本地测试)
npm link
测试脚手架
# npm link 后,使用 bin 字段定义的命令名(create-myapp-cli)
create-myapp-cli test-app
# 注意:不要使用包名 @miles_wang/create-myapp-cli
# 包名只在发布后通过 npx 或 npm install 时使用
模板项目本身可以直接运行,用于测试和开发:
# React 模板
cd templates/react-template
npm install # 会自动执行 prepare 脚本处理模板变量
npm run dev
# Vue 模板
cd templates/vue-template
npm install # 会自动执行 prepare 脚本处理模板变量
npm run dev
脚手架会根据你选择的包管理器(npm/yarn/pnpm)自动配置相应的脚本命令。
如果选择包含 E2E 测试,会添加:
如果选择包含 Git Hooks,会添加:
npm install(或 yarn/pnpm)安装依赖.nvmrc 文件方便版本管理{{projectName}} 作为占位符,在生成项目时会自动替换欢迎提交 Issue 和 Pull Request!
MIT
FAQs
A CLI tool to create clean React/Vue projects
We found that @miles_wang/create-myapp-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.