Commit fb165300 authored by hewenhao's avatar hewenhao

chore: document setup and constrain Node.js versions

parent 14a721e2
# GeekLearnMathWeapp 开发约定
## 1. Setup
- Node.js:`^22.16.0`,以 `package.json#engines.node` 为准;安装依赖和启动前用 `node -v` 确认版本。
- 项目类型:Taro + Preact / TypeScript 小程序。
- 包管理器:Yarn 3.6.4(以 `package.json#packageManager` 为准)。安装依赖:`yarn install --immutable`。
- 开发启动:`yarn dev`。
- Lint:`yarn lint`;该命令可能自动修复文件,执行后检查差异。
- 开发命令调用 `scripts/compile.js --watch`,默认目标为微信小程序;读取 `.env.development`,其中需配置 `WEAPP_ID`。编译输出 `dist/`,用微信开发者工具导入根目录(`project.config.json` 指向 `dist/`)。
- 监听模式同时启动 mock 服务;脚本会按环境更新 `project.config.json`。
## 2. 代码规范
- `.eslintrc.js` 继承 `standard`、`taro/preact` 和 React JSX runtime 规则;JSX 属性使用双引号,尾逗号及多行三元表达式规则已放宽。
- `.editorconfig`:2 空格缩进、UTF-8、移除行尾空格、文件末尾换行。
- `tsconfig.json` 使用 TypeScript 与 TSX,启用 `strictNullChecks`、未使用局部变量/参数检查,允许 JS;路径别名 `@/*` 指向 `src/*`。
## 3. 埋点规范
- 所有可点击元素添加 `data-name="元素标识"`,自定义组件透传到实际点击节点。
- 标识使用稳定、可读的“页面-动作”,不含个人信息。
示例:
```jsx
<View data-name="order-submit" onClick={handleSubmit}>提交</View>
```
@AGENTS.md
{ {
"engines": {
"node": "^22.16.0"
},
"name": "learn-math-weapp", "name": "learn-math-weapp",
"version": "1.1.12", "version": "1.1.12",
"private": true, "private": true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment