Commit da3edc54 authored by hewenhao's avatar hewenhao

chore: document setup and constrain Node.js versions

parent 57016295
# mall-webview 开发约定
Vue 3 + Vue CLI + TypeScript 的奖励金 H5 项目。
## Setup
- Node.js:`^22.16.0`,以 `package.json#engines.node` 为准;安装依赖和启动前用 `node -v` 确认版本。
- 使用 `package.json` 指定的 Yarn 1.22.22;先用 `yarn --version` 确认版本。
- 安装现有依赖:`yarn install --frozen-lockfile`;有意变更依赖时使用 Yarn 并同步 `yarn.lock`。
- 仓库虽有 `package-lock.json`,且旧 README 示例使用 npm,当前以 `packageManager` 的 Yarn 1 配置为准。
- 开发服务:`yarn run dev` 或 `yarn run serve`。
- Lint:`yarn run lint`(带 `--fix`,会写入修改);单元测试:`yarn run test:unit`。
## 代码规范
- `.eslintrc.js` 继承 Vue 3 essential、Vue Standard、TypeScript recommended。
- 生产环境 console / debugger 为警告;显式 any、组件多词命名检查已关闭。
- `.editorconfig` 使用 2 空格、LF、清除尾空格、文件末尾换行,建议行宽 100;未发现独立 Prettier 配置。
- `tsconfig.json` 开启 strict 与文件名大小写一致性检查,`@/*` 映射到 `src/*`。
- 保持现有 TypeScript 路由与 Vue 组件模式;涉及微信 JSBridge 的 H5 页面仍按 Web 埋点规范处理。
## 埋点规范
- 所有可点击元素添加 `name="元素标识"`,自定义组件透传到实际点击节点,保留已有业务 name。
- 标识使用稳定、可读的“页面-动作”,不含个人信息。
示例:
```vue
<button name="order-submit" @click="handleSubmit">提交</button>
```
@AGENTS.md
{ {
"engines": {
"node": "^22.16.0"
},
"packageManager": "yarn@1.22.22", "packageManager": "yarn@1.22.22",
"name": "mall-webview", "name": "mall-webview",
"version": "0.1.0", "version": "0.1.0",
......
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