@kmlckj/licos-ai-cli 0.0.40 → 0.0.42

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.
@@ -20,8 +20,10 @@ pnpm remove <package> # 移除依赖
20
20
  - `src/` 下禁止直接使用 `process.env`,不要使用 `__PUBLIC_PATH__`。请求前缀使用全局 `PROJECT_DOMAIN`,构建平台判断使用全局 `LICOS_TARO_ENV`。
21
21
  - 不要在业务代码里使用裸标识符 `TARO_ENV`。如需展示文字 “TARO_ENV”,只作为普通中文/英文说明文本使用,不要把它当作变量读取。
22
22
  - Taro API 只允许单次导入,统一写 `import Taro, { useLoad } from '@tarojs/taro'`,不要同时写 `import { useLoad } from '@tarojs/taro'` 和 `import Taro from '@tarojs/taro'`。
23
+ - 如果页面只使用 `useLoad`,不要导入默认 `Taro` 对象,直接写 `import { useLoad } from '@tarojs/taro'`。只有实际调用 `Taro.xxx()` 时才使用 `import Taro, { useLoad } from '@tarojs/taro'`。
23
24
  - React hooks 必须从 `react` 导入,例如 `import { useMemo, useState } from 'react'`;不要从 `@tarojs/taro` 导入 `useState`、`useEffect`、`useMemo`。
24
25
  - 不要重复导入同一个包。`@tarojs/taro`、`@tarojs/components`、`react`、`lucide-react-taro` 每个文件最多一个 import 语句。
26
+ - 不要在 JSX 属性里写多行 inline 函数。先定义命名函数,再传给属性,例如 `const refreshStatus = () => { ... }` 和 `<Button onClick={refreshStatus}>`,避免 ESLint JSX 对齐错误。
25
27
  - 需要在 `src/` 展示构建环境或项目域名时,直接读取全局常量:`LICOS_TARO_ENV || 'unknown'`、`PROJECT_DOMAIN || ''`,不要写 `process.env.TARO_ENV` 或 `process.env.PROJECT_DOMAIN`。
26
28
  - 需要引用 `src/assets/...` 源码资源时使用 ESM import,例如 `import logoUrl from '@/assets/images/logo.svg'`,不要在 `src/` 中写 CommonJS `require(...)`。
27
29
  - 根目录 `assets/` 是 H5 公开静态目录,不是 `@/assets` 源码别名。放在根 `assets/images/foo.svg` 的文件必须用相对 URL `assets/images/foo.svg`,不要写 `import foo from '@/assets/images/foo.svg'`。只有文件真实存在于 `src/assets/...` 时,才允许从 `@/assets/...` 导入。
@@ -30,17 +32,18 @@ pnpm remove <package> # 移除依赖
30
32
  - 从第三方图标包导入前必须确认导出存在;不确定时优先使用已验证的 `Package`、`Globe`、`Cpu`、`Layers` 等基础图标,避免引入不存在的命名导出导致构建失败。
31
33
  - 禁止输出不完整模板字符串、占位引号或非法 TS 字符串,例如 `"""`、未闭合的引号、未转义的英文单引号。文案中包含引号时使用反引号或正确转义。
32
34
  - 创建或测试小程序时,必须替换默认 `src/pages/index/index.tsx` 为实际首页,或把 `src/app.config.ts` 的第一个页面改为实际入口;不要新增测试页后保留默认占位首页。
35
+ - 完成前必须确认 `src/pages/index/index.tsx` 没有重复 import、未使用 import/变量、未闭合 JSX 或多行 inline 属性导致的格式错误。
33
36
 
34
37
  正确示例:
35
38
 
36
39
  ```tsx
37
40
  import { View, Text, Image } from '@tarojs/components'
38
- import Taro, { useLoad } from '@tarojs/taro'
41
+ import { useLoad } from '@tarojs/taro'
39
42
  import { Textarea } from '@/components/ui/textarea'
40
43
 
41
44
  export default function IndexPage() {
42
45
  useLoad(() => {
43
- Taro.setNavigationBarTitle({ title: '首页' })
46
+ console.log('page loaded')
44
47
  })
45
48
 
46
49
  const envName = LICOS_TARO_ENV || 'unknown'
@@ -78,12 +78,6 @@ const baseRestrictedSyntaxRules = [
78
78
  message:
79
79
  '微信小程序兼容性:禁用 Tailwind 小数值类名(如 mt-0.5、space-y-1.5、w-0.5、h-2.5),请用整数替代(如 mt-1、space-y-2、w-1、h-3)。',
80
80
  },
81
- {
82
- selector:
83
- 'Literal[value=/\\b[a-zA-Z0-9-]+\\-[0-9]+\\/[0-9]+\\b/], TemplateElement[value.raw=/\\b[a-zA-Z0-9-]+\\-[0-9]+\\/[0-9]+\\b/]',
84
- message:
85
- '微信小程序兼容性:禁用 Tailwind 斜杠分数类名(如 h-3/5、w-1/2),请改用整数刻度或明确布局。',
86
- },
87
81
  {
88
82
  selector:
89
83
  'Literal[value=/^(?:\\/|\\.\\.\\/)assets\\//], TemplateElement[value.raw=/^(?:\\/|\\.\\.\\/)assets\\//]',
@@ -177,14 +171,6 @@ const pageRestrictedSyntaxRules = [
177
171
  },
178
172
  ];
179
173
 
180
- const indexPageRestrictedSyntaxRules = [
181
- {
182
- selector: 'JSXText[value=/\\s*应用开发中\\s*/]',
183
- message:
184
- '工程规范:检测到首页 (src/pages/index/index.tsx) 仍为默认占位页面,这会导致用户无法进入新增页面,请根据用户需求开发实际的首页功能与界面。如果已经开发了新的首页,也需要删除旧首页,并更新 src/app.config.ts 文件',
185
- },
186
- ];
187
-
188
174
  export default [
189
175
  ...compat.extends('taro/react'),
190
176
  {
@@ -253,7 +239,6 @@ export default [
253
239
  'error',
254
240
  ...baseRestrictedSyntaxRules,
255
241
  ...pageRestrictedSyntaxRules,
256
- ...indexPageRestrictedSyntaxRules,
257
242
  ],
258
243
  },
259
244
  },
@@ -223,7 +223,7 @@ const ContextMenuItem = React.forwardRef<
223
223
  data-inset={inset ? "" : undefined}
224
224
  data-disabled={disabled ? "" : undefined}
225
225
  className={cn(
226
- "relative flex cursor-default select-none items-center gap-1.5 rounded-md px-2 py-1 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
226
+ "relative flex cursor-default select-none items-center gap-2 rounded-md px-2 py-1 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
227
227
  inset && "pl-7",
228
228
  disabled && "pointer-events-none opacity-50",
229
229
  className
@@ -293,7 +293,7 @@ const ContextMenuCheckboxItem = React.forwardRef<
293
293
  data-disabled={disabled ? "" : undefined}
294
294
  data-state={checked ? "checked" : "unchecked"}
295
295
  className={cn(
296
- "relative flex cursor-default select-none items-center gap-1.5 rounded-md py-1 pr-8 pl-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
296
+ "relative flex cursor-default select-none items-center gap-2 rounded-md py-1 pr-8 pl-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
297
297
  inset && "pl-7",
298
298
  disabled && "pointer-events-none opacity-50",
299
299
  className
@@ -336,7 +336,7 @@ const ContextMenuRadioItem = React.forwardRef<
336
336
  data-disabled={disabled ? "" : undefined}
337
337
  data-state={checked ? "checked" : "unchecked"}
338
338
  className={cn(
339
- "relative flex cursor-default select-none items-center gap-1.5 rounded-md py-1 pr-8 pl-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
339
+ "relative flex cursor-default select-none items-center gap-2 rounded-md py-1 pr-8 pl-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
340
340
  inset && "pl-7",
341
341
  disabled && "pointer-events-none opacity-50",
342
342
  className
@@ -481,7 +481,7 @@ const ContextMenuSubTrigger = React.forwardRef<
481
481
  data-disabled={disabled ? "" : undefined}
482
482
  data-state={subContext?.open ? "open" : "closed"}
483
483
  className={cn(
484
- "relative flex cursor-default select-none items-center gap-1.5 rounded-md px-2 py-1 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
484
+ "relative flex cursor-default select-none items-center gap-2 rounded-md px-2 py-1 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
485
485
  inset && "pl-7",
486
486
  disabled && "pointer-events-none opacity-50",
487
487
  className
@@ -278,7 +278,7 @@ const DropdownMenuItem = React.forwardRef<
278
278
  data-variant={variant}
279
279
  data-disabled={disabled ? "" : undefined}
280
280
  className={cn(
281
- "relative flex cursor-default select-none items-center gap-1.5 rounded-md px-2 py-1 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
281
+ "relative flex cursor-default select-none items-center gap-2 rounded-md px-2 py-1 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
282
282
  "data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive data-[variant=destructive]:focus:bg-opacity-10 data-[variant=destructive]:focus:text-destructive",
283
283
  inset && "pl-7",
284
284
  disabled && "pointer-events-none opacity-50",
@@ -313,7 +313,7 @@ const DropdownMenuCheckboxItem = React.forwardRef<
313
313
  data-disabled={disabled ? "" : undefined}
314
314
  data-state={checked ? "checked" : "unchecked"}
315
315
  className={cn(
316
- "relative flex cursor-default select-none items-center gap-1.5 rounded-md py-1 pr-8 pl-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
316
+ "relative flex cursor-default select-none items-center gap-2 rounded-md py-1 pr-8 pl-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
317
317
  inset && "pl-7",
318
318
  className
319
319
  )}
@@ -354,7 +354,7 @@ const DropdownMenuRadioItem = React.forwardRef<
354
354
  data-disabled={disabled ? "" : undefined}
355
355
  data-state={checked ? "checked" : "unchecked"}
356
356
  className={cn(
357
- "relative flex cursor-default select-none items-center gap-1.5 rounded-md py-1 pr-8 pl-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
357
+ "relative flex cursor-default select-none items-center gap-2 rounded-md py-1 pr-8 pl-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
358
358
  inset && "pl-7",
359
359
  className
360
360
  )}
@@ -432,7 +432,7 @@ const DropdownMenuSubTrigger = React.forwardRef<
432
432
  data-disabled={disabled ? "" : undefined}
433
433
  data-state={subContext?.open ? "open" : "closed"}
434
434
  className={cn(
435
- "relative flex cursor-default select-none items-center gap-1.5 rounded-md px-2 py-1 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
435
+ "relative flex cursor-default select-none items-center gap-2 rounded-md px-2 py-1 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
436
436
  inset && "pl-7",
437
437
  disabled && "pointer-events-none opacity-50",
438
438
  className
@@ -218,7 +218,7 @@ const MenubarItem = React.forwardRef<
218
218
  data-variant={variant}
219
219
  data-disabled={disabled ? "" : undefined}
220
220
  className={cn(
221
- "relative flex cursor-default select-none items-center gap-1.5 rounded-md px-2 py-1 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
221
+ "relative flex cursor-default select-none items-center gap-2 rounded-md px-2 py-1 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
222
222
  "data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive data-[variant=destructive]:focus:bg-opacity-10 data-[variant=destructive]:focus:text-destructive",
223
223
  inset && "pl-7",
224
224
  disabled && "pointer-events-none opacity-50",
@@ -255,7 +255,7 @@ const MenubarCheckboxItem = React.forwardRef<
255
255
  data-disabled={disabled ? "" : undefined}
256
256
  data-state={checked ? "checked" : "unchecked"}
257
257
  className={cn(
258
- "relative flex cursor-default select-none items-center gap-1.5 rounded-md py-1 pr-8 pl-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
258
+ "relative flex cursor-default select-none items-center gap-2 rounded-md py-1 pr-8 pl-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
259
259
  inset && "pl-7",
260
260
  disabled && "pointer-events-none opacity-50",
261
261
  className
@@ -330,7 +330,7 @@ const MenubarRadioItem = React.forwardRef<
330
330
  data-disabled={disabled ? "" : undefined}
331
331
  data-state={checked ? "checked" : "unchecked"}
332
332
  className={cn(
333
- "relative flex cursor-default select-none items-center gap-1.5 rounded-md py-1 pr-8 pl-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
333
+ "relative flex cursor-default select-none items-center gap-2 rounded-md py-1 pr-8 pl-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
334
334
  inset && "pl-7",
335
335
  disabled && "pointer-events-none opacity-50",
336
336
  className
@@ -461,7 +461,7 @@ const MenubarSubTrigger = React.forwardRef<
461
461
  data-disabled={disabled ? "" : undefined}
462
462
  data-state={subContext?.open ? "open" : "closed"}
463
463
  className={cn(
464
- "relative flex cursor-default select-none items-center gap-1.5 rounded-md px-2 py-1 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
464
+ "relative flex cursor-default select-none items-center gap-2 rounded-md px-2 py-1 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
465
465
  inset && "pl-7",
466
466
  disabled && "pointer-events-none opacity-50",
467
467
  className
@@ -257,7 +257,7 @@ const PopoverHeader = React.forwardRef<
257
257
  React.ElementRef<typeof View>,
258
258
  React.ComponentPropsWithoutRef<typeof View>
259
259
  >(({ className, ...props }, ref) => (
260
- <View ref={ref} className={cn("grid gap-1.5", className)} {...props} />
260
+ <View ref={ref} className={cn("grid gap-2", className)} {...props} />
261
261
  ))
262
262
  PopoverHeader.displayName = "PopoverHeader"
263
263
 
package/lib/cli.js CHANGED
@@ -2109,7 +2109,7 @@ const EventBuilder = {
2109
2109
  };
2110
2110
 
2111
2111
  var name = "@kmlckj/licos-ai-cli";
2112
- var version = "0.0.40";
2112
+ var version = "0.0.42";
2113
2113
  var description = "LICOS AI coding workspace CLI - project template engine and dev tools";
2114
2114
  var license = "MIT";
2115
2115
  var author = "kmlckj";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmlckj/licos-ai-cli",
3
- "version": "0.0.40",
3
+ "version": "0.0.42",
4
4
  "description": "LICOS AI coding workspace CLI - project template engine and dev tools",
5
5
  "license": "MIT",
6
6
  "author": "kmlckj",