@kmlckj/licos-ai-cli 0.0.24 → 0.0.25
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/lib/__templates__/taro/AGENTS.md +25 -25
- package/lib/cli.js +1 -1
- package/package.json +1 -1
|
@@ -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
|
-
-
|
|
419
|
-
-
|
|
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
|
-
**
|
|
450
|
+
**Input/Textarea 样式**:页面必须使用 UI 封装组件,原生 Input/Textarea 的兼容包装已经在 `src/components/ui` 内处理
|
|
448
451
|
|
|
449
452
|
```tsx
|
|
450
|
-
|
|
451
|
-
|
|
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
|
-
// ✅
|
|
458
|
-
<
|
|
459
|
-
|
|
460
|
-
|
|
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
|
-
**
|
|
464
|
+
**Input + Button Flex 布局**:flex 放外层 `View`,控件使用 UI 封装组件
|
|
464
465
|
|
|
465
466
|
```tsx
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
<View
|
|
472
|
-
<
|
|
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
|
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.
|
|
2110
|
+
var version = "0.0.25";
|
|
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";
|