@kmlckj/licos-ai-cli 0.0.24 → 0.0.26

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.
@@ -164,6 +164,9 @@ CRITICAL:
164
164
  - 默认先写 `className`,再考虑 `style`。
165
165
  - 颜色、间距、圆角、边框、阴影、排版、flex/grid、宽高等常规样式必须收敛在 Tailwind 类名中。
166
166
  - 禁止使用 `w-[340px]`、`text-[14px]`、`p-[16px]` 这类带 `px` 的 Tailwind 任意值。
167
+ - 禁止使用颜色不透明度简写,例如 `bg-primary/10`、`text-slate-500/70`、`border-white/20`;小程序端 opacity 容易丢失,必须拆成基础颜色类和 `bg-opacity-*` / `text-opacity-*` / `border-opacity-*`。
168
+ - 禁止使用小数值类名,例如 `space-y-1.5`、`w-0.5`、`h-2.5`;统一改成整数刻度,例如 `space-y-2`、`w-1`、`h-3`。
169
+ - 禁止使用 `peer-*`、`group-*`、`has-*`、复杂任意选择器和属性选择器类名;这些写法在小程序构建或上传时容易失败。
167
170
  - 禁止使用 `style={{ width: '200px' }}`、`fontSize: '14px'` 这类硬编码尺寸。
168
171
  - Taro 会通过 `pxtransform` 将尺寸转换为跨端单位(小程序 `rpx`、H5 `rem`),业务代码里直接写 `px` 容易导致不同端显示不一致。
169
172
  - `style` 只允许用于少量跨端兼容修正;`.css` 只用于 Tailwind 明显不适合的场景,且范围必须最小。
@@ -415,8 +418,8 @@ const { avatar_url } = res.data; // 报错或 undefined
415
418
  ### 跨端规则速查表
416
419
 
417
420
  - Taro 原生 Text 换行/白屏:小程序 block 正常,H5 inline 白屏 → 垂直 Text 添加 `block` 类 + 平台检 测直接判断
418
- - Taro 原生 Input 样式:H5 inline 导致样式失效 View 包裹,样式放外层
419
- - Taro 原生 Input/Button Flex:H5 不支持 flex View 包装,flex 放 View 上
421
+ - 输入框/多行输入:页面中使用 `@/components/ui/input` `@/components/ui/textarea`,不要直接从 `@tarojs/components` 导入原生 `Input` / `Textarea`
422
+ - 输入框和按钮组合:使用 `@/components/ui/input`、`@/components/ui/button` 和外层 `View` 布局;原生 Input/Button 只能出现在 `src/components/ui` 封装内部
420
423
  - Fixed + Flex:H5 Tailwind 失效 → 必须 `style={{ position: 'fixed', display: 'flex' }}`
421
424
  - 底部 TabBar 重叠 → 底部固定元素 `bottom: 50`+,列表加底部内边距
422
425
  - 原生组件:H5 不可用 → `Taro.getEnv() === WEAPP` + H5 降级
@@ -444,39 +447,36 @@ useEffect(() => { setIsWeapp(Taro.getEnv() === Taro.ENV_TYPE.WEAPP) }, [])
444
447
  <Text className="block text-sm text-gray-500">说明</Text>
445
448
  ```
446
449
 
447
- **Taro 原生 Input/Textarea 样式**:必须 View 包裹,样式放 View 上(H5 端 Input inline 元素)
450
+ **Input/Textarea 样式**:页面必须使用 UI 封装组件,原生 Input/Textarea 的兼容包装已经在 `src/components/ui` 内处理
448
451
 
449
452
  ```tsx
450
- // 正确:View 包裹
451
- <View className="bg-gray-50 rounded-xl px-4 py-3">
452
- <Input className="w-full bg-transparent" placeholder="请输入内容" />
453
- </View>
454
- // ❌ 错误:H5 端样式不生效
455
- <Input className="bg-gray-50 rounded-xl px-4 py-3 w-full" />
453
+ import { Input } from '@/components/ui/input'
454
+ import { Textarea } from '@/components/ui/textarea'
456
455
 
457
- // ✅ Textarea 同理
458
- <View className="bg-gray-50 rounded-2xl p-4 mb-4">
459
- <Textarea style={{ width: '100%', minHeight: '100px', backgroundColor: 'transparent' }} placeholder="请输入详细描述..." maxlength={500} />
460
- </View>
456
+ // ✅ 正确:使用 UI 封装
457
+ <Input className="bg-gray-50" placeholder="请输入内容" />
458
+ <Textarea className="bg-gray-50" placeholder="请输入详细描述..." maxlength={500} />
459
+
460
+ // ❌ 错误:页面直接使用原生 Input/Textarea 会被 pnpm validate 拦截
461
+ // import { Input, Textarea } from '@tarojs/components'
461
462
  ```
462
463
 
463
- **Taro 原生 Input + Button Flex 布局**:flex View,Input `width: 100%`
464
+ **Input + Button Flex 布局**:flex 放外层 `View`,控件使用 UI 封装组件
464
465
 
465
466
  ```tsx
466
- // 正确:View 包装 + inline style
467
- <View style={{ display: 'flex', flexDirection: 'row', gap: '8px', padding: '12px' }}>
468
- <View style={{ flex: 1, backgroundColor: '#f5f5f5', borderRadius: '20px', padding: '8px 12px' }}>
469
- <Input style={{ width: '100%', fontSize: '14px' }} placeholder="输入消息..." />
470
- </View>
471
- <View style={{ flexShrink: 0 }}>
472
- <Button size="mini" type="primary">发送</Button>
467
+ import { Button } from '@/components/ui/button'
468
+ import { Input } from '@/components/ui/input'
469
+
470
+ // 正确:外层布局 + UI 组件
471
+ <View className="flex flex-row gap-2 p-3">
472
+ <View className="flex-1">
473
+ <Input placeholder="输入消息..." />
473
474
  </View>
474
- </View>
475
- // ❌ 错误:H5 端 Input 不支持 flex
476
- <View style={{ display: 'flex', flexDirection: 'row', gap: '8px' }}>
477
- <Input style={{ flex: 1 }} placeholder="输入消息..." />
478
475
  <Button>发送</Button>
479
476
  </View>
477
+
478
+ // ❌ 错误:页面直接使用原生 Input/Button 会被 pnpm validate 拦截
479
+ // import { Button, Input } from '@tarojs/components'
480
480
  ```
481
481
 
482
482
  **Fixed + Flex 布局**:必须 inline style(Tailwind fixed+flex 在 H5 失效),`bottom: 50` 避开 TabBar
@@ -65,6 +65,7 @@
65
65
  "@babel/preset-react": "^7.24.1",
66
66
  "@eslint/eslintrc": "^3.3.1",
67
67
  "@tailwindcss/postcss": "^4.1.18",
68
+ "@tarojs/binding-linux-x64-musl": "4.1.9",
68
69
  "@tarojs/cli": "4.1.9",
69
70
  "@tarojs/plugin-generator": "4.1.9",
70
71
  "@tarojs/plugin-mini-ci": "^4.1.9",
@@ -89,6 +89,9 @@ importers:
89
89
  '@tailwindcss/postcss':
90
90
  specifier: ^4.1.18
91
91
  version: 4.1.18
92
+ '@tarojs/binding-linux-x64-musl':
93
+ specifier: 4.1.9
94
+ version: 4.1.9
92
95
  '@tarojs/cli':
93
96
  specifier: 4.1.9
94
97
  version: 4.1.9(@types/node@22.19.6)
@@ -3090,7 +3093,7 @@ packages:
3090
3093
  resolution: {integrity: sha512-dXn3FZhPv0US+7dtJsIi2R+c7qWYiReoEh5zUntWCf4oSpMNib8FDhSoed6m3QyZdx5hK7iLFkYk3rNxwt8vTA==}
3091
3094
 
3092
3095
  '@kmlckj/licos-platform-sdk@0.6.1':
3093
- resolution: {integrity: sha512-8i+MCc7RYLK42NhT+JGF7wG0ddUQtSfcT05WqUtNnEn7SdHewoNLi/JqK4ZJM3DQB+/azOxqqM/To72B9DkIsA==}
3096
+ resolution: {integrity: sha512-eADWtycsGKxO37QZKsHNNI91XDmHZrrbQGZUrR576v8rxASZBLV8X3j/02W8nIwIkfcKK7XC63DOE2IIDDsuuQ==}
3094
3097
 
3095
3098
  '@langchain/core@1.1.16':
3096
3099
  resolution: {integrity: sha512-2XKQKxvQdeQiuIo0tacAmDVojhSVAci8D2WDdmmyN+6CqDusLHEHyIDaOt4o+UBvpkyHXbCdrljzDTQY/AKeqg==}
@@ -3905,6 +3908,13 @@ packages:
3905
3908
  os: [linux]
3906
3909
  libc: [glibc]
3907
3910
 
3911
+ '@tarojs/binding-linux-x64-musl@4.1.9':
3912
+ resolution: {integrity: sha512-2KCACju/AUpw5FxPqVKTpkCLSWu8tYToRn4glqR85hOwDmumTssh7aohxST60b0rtxtDg77tjJAAN1hNprcixQ==}
3913
+ engines: {node: '>= 18'}
3914
+ cpu: [x64]
3915
+ os: [linux]
3916
+ libc: [musl]
3917
+
3908
3918
  '@tarojs/binding-win32-x64-msvc@4.1.9':
3909
3919
  resolution: {integrity: sha512-QHvWPJNZwbggonVxxj/ejVvujE251VNZVqCy/B60AUgubYDe4K7kh5xRCV24J5jmpX09K3l+NgfqU9/I827Pzw==}
3910
3920
  engines: {node: '>= 18'}
@@ -15045,6 +15055,9 @@ snapshots:
15045
15055
  '@tarojs/binding-linux-x64-gnu@4.1.9':
15046
15056
  optional: true
15047
15057
 
15058
+ '@tarojs/binding-linux-x64-musl@4.1.9':
15059
+ optional: true
15060
+
15048
15061
  '@tarojs/binding-win32-x64-msvc@4.1.9':
15049
15062
  optional: true
15050
15063
 
@@ -15055,6 +15068,7 @@ snapshots:
15055
15068
  '@tarojs/binding-darwin-arm64': 4.1.9
15056
15069
  '@tarojs/binding-darwin-x64': 4.1.9
15057
15070
  '@tarojs/binding-linux-x64-gnu': 4.1.9
15071
+ '@tarojs/binding-linux-x64-musl': 4.1.9
15058
15072
  '@tarojs/binding-win32-x64-msvc': 4.1.9
15059
15073
 
15060
15074
  '@tarojs/cli@4.1.9(@types/node@22.19.6)':
package/lib/cli.js CHANGED
@@ -2107,7 +2107,7 @@ const EventBuilder = {
2107
2107
  };
2108
2108
 
2109
2109
  var name = "@kmlckj/licos-ai-cli";
2110
- var version = "0.0.24";
2110
+ var version = "0.0.26";
2111
2111
  var description = "LICOS AI coding workspace CLI - project template engine and dev tools";
2112
2112
  var license = "MIT";
2113
2113
  var author = "kmlckj";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmlckj/licos-ai-cli",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "description": "LICOS AI coding workspace CLI - project template engine and dev tools",
5
5
  "license": "MIT",
6
6
  "author": "kmlckj",