@proteus-vue/create-proteus 0.3.0-beta.18 → 0.3.0-beta.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proteus-vue/create-proteus",
3
- "version": "0.3.0-beta.18",
3
+ "version": "0.3.0-beta.23",
4
4
  "description": "Proteus 脚手架:npm create @proteus-vue/proteus my-app —— 一键生成 Web + 微信小程序(Skyline)双端工程",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -13,16 +13,16 @@
13
13
  "proteus": "proteus"
14
14
  },
15
15
  "dependencies": {
16
- "@proteus-vue/router": "0.3.0-beta.12",
17
- "@proteus-vue/runtime": "0.3.0-beta.13",
18
- "@proteus-vue/shared": "0.3.0-beta.11",
16
+ "@proteus-vue/router": "0.3.0-beta.23",
17
+ "@proteus-vue/runtime": "0.3.0-beta.23",
18
+ "@proteus-vue/shared": "0.3.0-beta.23",
19
19
  "vue": "^3.4.0"
20
20
  },
21
21
  "devDependencies": {
22
- "@proteus-vue/cli": "0.3.0-beta.17",
23
- "@proteus-vue/compiler": "0.3.0-beta.15",
22
+ "@proteus-vue/cli": "0.3.0-beta.23",
23
+ "@proteus-vue/compiler": "0.3.0-beta.23",
24
24
  "@proteus-vue/devtools-runtime": "0.3.0-beta.11",
25
- "@proteus-vue/plugin-vite": "0.3.0-beta.17",
25
+ "@proteus-vue/plugin-vite": "0.3.0-beta.23",
26
26
  "@types/node": "^20.0.0",
27
27
  "@vitejs/plugin-vue": "^5.0.0",
28
28
  "tsx": "^4.0.0",
@@ -1,12 +1,36 @@
1
1
  // proteus.config.ts —— Proteus 统一配置(★#418:唯一配置文件——vite 配置由框架组装,不再有 vite.config.ts)
2
+ // ★★★2026-10-08 配置模型 v4(决策 #641):**按端分区**——目标端 = 键(web/mp/ios/android/harmony),
3
+ // 各端自持配置;跨端共享面(pagesDir/router/budget/vite/audit/gates/compiler/layout/app)留顶层。
2
4
  import type { ProteusConfig } from '@proteus-vue/plugin-vite'
3
5
 
4
6
  const config: ProteusConfig = {
5
- platform: 'mp-weixin',
6
- skyline: true,
7
- appid: 'wx0000000000', // 替换为真实 AppID
7
+ version: 4,
8
+ targets: {
9
+ mp: {
10
+ appid: 'wx0000000000', // 替换为真实 AppID
11
+ renderer: 'skyline',
12
+ // ★底线循环 ①③:规则覆盖(改这里立即改变编译行为)
13
+ rules: {
14
+ disabled: [],
15
+ mapping: {},
16
+ customTags: {}, // 例:{ 'my-widget': 'view' } —— 新增标签映射
17
+ },
18
+ setDataBridge: {
19
+ batchWindow: 16, // ~1 帧
20
+ perComponent: true,
21
+ },
22
+ style: {
23
+ px2rpx: true,
24
+ rpxRatio: 2,
25
+ },
26
+ },
27
+ // ★App 三端(可选):原生工程身份(包名/Bundle ID/版本),由 `proteus build --package` 注入原生文件
28
+ // ios: { bundleId: 'com.example.app' },
29
+ // android: { applicationId: 'com.example.app' },
30
+ // harmony: { bundleName: 'com.example.app' },
31
+ },
8
32
  pagesDir: 'src/pages',
9
- // ★#492 项目级路由管理:路由相关配置统一在 router 段(结构 + tabBar + meta)
33
+ // ★#492 项目级路由管理:路由相关配置统一在 router 段(结构 + tabBar + pages)
10
34
  router: {
11
35
  // 路由表产物路径(编译期 gen-routes 生成)
12
36
  routesOutput: 'src/router/auto-routes.ts',
@@ -19,22 +43,8 @@ const config: ProteusConfig = {
19
43
  scaleDown: 'node_modules/@proteus-vue/router/src/presets/scaleDown.ts',
20
44
  },
21
45
  },
22
- // 集中式 meta(可选):精确路径 > 目录前缀 > 默认
23
- // meta: { 'index': { title: '首页', isTab: true } },
24
- },
25
- // ★底线循环 ①③:规则覆盖(改这里立即改变编译行为)
26
- rules: {
27
- disabled: [],
28
- mapping: {},
29
- customTags: {}, // 例:{ 'my-widget': 'view' } —— 新增标签映射
30
- },
31
- setDataBridge: {
32
- batchWindow: 16, // ~1 帧
33
- perComponent: true,
34
- },
35
- style: {
36
- px2rpx: true,
37
- rpxRatio: 2,
46
+ // 集中式页面配置(可选):精确路径 > 目录前缀 > 默认
47
+ // pages: { 'index': { title: '首页', isTab: true } },
38
48
  },
39
49
  // vite 透传(可选):完全兼容 vite 的字段——plugins / server / resolve / build 等按需追加。
40
50
  // 例:server: { port: 5173 }, plugins: [myVitePlugin()]
@@ -0,0 +1,12 @@
1
+ // src/shims/import-meta.d.ts —— vite 注入的 import.meta.env 类型声明
2
+ // shared 包是「源码直发」(消费者经 alias/源引用),但 packages/* 自身的 tsc(声明构建)
3
+ // 也要过:web-adapter 用 import.meta.env.BASE_URL 读子路径 base(PROTEUS_BASE 注入,
4
+ // 构建期被 vite 内联为字面量)——无此声明 tsc 报 TS2339。
5
+ interface ImportMeta {
6
+ readonly env?: {
7
+ readonly BASE_URL?: string
8
+ readonly MODE?: string
9
+ readonly DEV?: boolean
10
+ readonly PROD?: boolean
11
+ }
12
+ }