@proteus-vue/create-proteus
Proteus 脚手架:npm create @proteus-vue/proteus my-app —— 一键生成 Web + 微信小程序(Skyline)双端工程
3,448
| Install | |
|---|---|
npm install @proteus-vue/create-proteus@0.2.0 |
|
| Latest Version: | 0.2.0 |
| License: | Apache-2.0 |
| Last Updated: | Oct 9, 2026 |
| Links: | npm |
Maintainer: kviewui163
@proteus-vue/create-proteus —— Proteus 脚手架
npm create @proteus-vue/proteus my-app—— 一键生成 Web + 微信小程序(Skyline)双端工程。
使用
npm create @proteus-vue/proteus my-app
cd my-app
npm install
npm run dev:web # Web 端(浏览器打开 Vite 提示地址)
npm run build:mp # 小程序端(微信开发者工具导入 dist/mp-weixin,替换 proteus.config.ts 的 appid)
生成内容(32 个文件)
- 编译管线:
vite.config.ts+vite-plugin-mp-transform.ts(薄适配层,依赖 npm 包@proteus-vue/compiler)+scripts/gen-routes.ts(路由/app.json/page.json 生成器)+scripts/mp-entry-stub.ts - 框架本体(src/ 快照):
router(Router/RouterView/guards/skyline/presets)+platform(adapter 双端)+runtime(setData 桥接/生命周期/app 骨架)+shims(wx 类型) - 应用骨架:
src/main.ts(Web 入口)/src/main.mp.ts(★极简入口:不写 App(),骨架自动生成)/src/App.vue/src/pages/index.vue(首页,含<route>块) - 配置:
proteus.config.ts(platform/skyline/appid/rules 规则覆盖…)
模板维护(★与主仓库同步)
模板 = 主仓库快照 + 手写模板,scripts/snapshot-template.ts 负责同步:
tsx scripts/snapshot-template.ts
- 自动快照:
src/platform/src/runtime/src/shims/src/router/(除 auto-routes.ts)scripts/(除 snapshot 自身)vite-plugin-mp-transform.ts(import 替换为@proteus-vue/compiler)tsconfig.jsonindex.html(入口替换为 src/main.ts) - 手写模板(改主仓时手动同步):
package.json(含{{name}}占位)/proteus.config.ts/vite.config.ts/src/main.ts/src/main.mp.ts/src/App.vue/src/pages/index.vue/src/router/auto-routes.ts(仅首页占位,首次 build 时 gen-routes 重新生成)
⚠
@proteus-vue/compiler未发布 npm 前,生成工程安装会 404;临时用npm install <仓库>/packages/compiler或 npm link。
发布
npm run build -w @proteus-vue/create-proteus # esbuild 单文件(dist/index.js + shebang)
npm publish # files: dist + templates
Related Packages
@proteus-vue/renderer-app
Proteus App 渲染器(app-plan B1):Vue createRenderer 自定义 host config(Native...
1,735
Version History
| Version | Released | License |
|---|---|---|
| 0.2.0 | Apache-2.0 |
Pre-releases (20)
| Version | Released | License |
|---|---|---|
| 0.3.0-beta.33 | Apache-2.0 | |
| 0.3.0-beta.32 | Apache-2.0 | |
| 0.3.0-beta.30 | Apache-2.0 | |
| 0.3.0-beta.28 | Apache-2.0 | |
| 0.3.0-beta.27 | Apache-2.0 | |
| 0.3.0-beta.25 | Apache-2.0 | |
| 0.3.0-beta.23 | Apache-2.0 | |
| 0.3.0-beta.20 | Apache-2.0 | |
| 0.3.0-beta.18 | Apache-2.0 | |
| 0.3.0-beta.16 | Apache-2.0 | |
| 0.3.0-beta.14 | Apache-2.0 | |
| 0.3.0-beta.13 | Apache-2.0 | |
| 0.3.0-beta.11 | Apache-2.0 | |
| 0.3.0-beta.10 | Apache-2.0 | |
| 0.3.0-beta.9 | Apache-2.0 | |
| 0.3.0-beta.8 | Apache-2.0 | |
| 0.3.0-beta.7 | Apache-2.0 | |
| 0.2.1-beta.2 | Apache-2.0 | |
| 0.2.1-beta.1 | Apache-2.0 | |
| 0.2.1-beta.0 | Apache-2.0 |