{"id":13603928,"url":"https://github.com/didilinkin/elf-taro","last_synced_at":"2025-04-07T05:34:13.482Z","repository":{"id":39491667,"uuid":"167798931","full_name":"didilinkin/elf-taro","owner":"didilinkin","description":"Taro 小程序 脚手架 (Taro 3 + Dva + Typescript + Immer) - 内置 Redux 计数器, 异步数据请求 与 腾讯小程序地图 demo","archived":false,"fork":false,"pushed_at":"2023-03-27T10:18:13.000Z","size":2536,"stargazers_count":68,"open_issues_count":0,"forks_count":16,"subscribers_count":4,"default_branch":"2.x","last_synced_at":"2025-02-12T17:03:47.280Z","etag":null,"topics":["cz-customizable","dvajs","immer","lodash","taro","taro-ui","tencent-map-sdk","typescript","wechat-mini-program"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/didilinkin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-27T11:00:38.000Z","updated_at":"2024-08-16T08:21:59.000Z","dependencies_parsed_at":"2024-07-26T15:28:47.964Z","dependency_job_id":"0a82666d-9063-4735-a7e2-b47b783e88a3","html_url":"https://github.com/didilinkin/elf-taro","commit_stats":null,"previous_names":["didilinkin/tarojs-ts-cli"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/didilinkin%2Felf-taro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/didilinkin%2Felf-taro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/didilinkin%2Felf-taro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/didilinkin%2Felf-taro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/didilinkin","download_url":"https://codeload.github.com/didilinkin/elf-taro/tar.gz/refs/heads/2.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601378,"owners_count":20964861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cz-customizable","dvajs","immer","lodash","taro","taro-ui","tencent-map-sdk","typescript","wechat-mini-program"],"created_at":"2024-08-01T19:00:36.671Z","updated_at":"2025-04-07T05:34:08.463Z","avatar_url":"https://github.com/didilinkin.png","language":"TypeScript","funding_links":[],"categories":["示例项目"],"sub_categories":["Taro 3"],"readme":"# elf-taro\n\nElf 基于 Taro 的 小程序 脚手架\n\n## 必要依赖\n\u003e 不要轻易升级 `package.json`内的依赖\n\n* ### Node\n  version: v14.14.0, 通过 `nvm`更改 Node 版本:\n  ```bash\n  nvm install 14.14.0   # 安装 v14.14.0\n  nvm use 14.14.0       # 切换为 v14.14.0\n\n  node -v               # 查看 切换是否成功\n  # =\u003e v14.14.0\n  ```\n\n\n* ### Yarn\n  version: v1.22.19\n\n  请务必使用 `Yarn` 安装依赖! 不要使用 其他安装工具, 有几率报错\n  \n  本项目使用的 源: `https://registry.yarnpkg.com/`\n  \n  未使用 taobao源, 推荐 `nrm`工具切换源\n\n\n* ### taro-cli\n  version: v3.0.0-rc.6, 需要将工具切换版本\n  ```bash\n  yarn global add @tarojs/cli@3.0.0-rc.6\n\n  taro -v               # 查看 切换是否成功\n  # =\u003e 3.0.0-rc.6\n  ```\n\n## 主要功能\n\n- dva\n- 异步请求\n- 腾讯地图 示例\n- Typescript\n\n## 预览项目\n\n```bash\n# 全局安装taro脚手架\nnpm install -g @tarojs/cli\n# 安装依赖\nyarn install\n\n# 小程序 预览模式 =\u003e 用 小程序开发工具 打开 ./dist 文件夹 即可预览\nyarn dev:weapp\n```\n\n## 打包项目\n\n```bash\n# 打包完成的小程序 文件在 ./dist 文件夹内\nyarn build:weapp\n```\n\n## 注意事项\n\n- 本项目拉取到本地后， “小程序开发工具” 请打开 “不校验合法域名”！ 方便查看 请求效果\n\n## 常见错误\n\n1. 开发环境版本不相同\n\n   [Taro 版本升级权威指南](https://aotu.io/notes/2020/08/31/taro-versions/index.html)\n\n   [taro update self 的更新好像不管用](https://github.com/NervJS/taro/issues/297)\n\n# 目录结构\n\n    ├── dist/                       // 微信小程序编译结果目录\n    ├── config/                     // Taro 配置目录\n    │   ├── dev.js                  // 开发时配置\n    │   ├── index.js                // 默认配置\n    │   └── prod.js                 // 打包时配置\n    ├── src/                        // 源码目录\n    │   ├── components/             // 公共组件\n    │   └── dvaCore/                // dva-core 配置\n    │       └── index.ts\n    │   └── models/                 // 全局 models\n    │       └── index.ts\n    │   ├── pages                   // 页面文件目录\n    │   │   └── index\n    │   │       ├── model/          // 业务逻辑 (Dva model)\n    │   │       ├── index.tsx       // 页面逻辑\n    │   │       └── index.styl      // 页面样式\n    │   ├── services/               // 全局模块请求\n    │   ├── utils                   // 常用工具类\n    │   ├── app.js                  // 入口文件\n    │   └── index.html\n    ├── global.d.ts                 // 全局类型配置\n    └── package.json                // 项目依赖\n\n## TODO\n\n- 用户信息读取\n- components 功能\n- dva-model-extend\n\n## 已配置的依赖\n\n| 名称    | 库名称                                                                   | 用途                                  |\n| ------- | ------------------------------------------------------------------------ | ------------------------------------- |\n| Taro    | [@tarojs/taro](https://taro-docs.jd.com/taro/docs/README/index.html)     | 基础库                                |\n| Taro-UI | [taro-ui](https://taro-ui.jd.com/#/docs/introduction)                    | 样式库                                |\n| Dva     | [dva-core](https://dvajs.com/guide/)                                     | 基于 redux 和 redux-saga 的数据流方案 |\n| Immer   | [dva-immer](https://github.com/dvajs/dva/tree/master/packages/dva-immer) | immer 不可变结构                      |\n| Lodash  | [lodash](https://lodash.com/docs/4.17.15)                                | 函数库                                |\n\n## 开发环境的依赖\n\n| 名称            | 库名称                                                           | 用途              |\n| --------------- | ---------------------------------------------------------------- | ----------------- |\n| Typescript      | [typescript](https://www.typescriptlang.org/docs)                | JS 超集语言       |\n| ESLint          | [eslint](https://eslint.org/docs/user-guide/getting-started)     | 规范检查          |\n| Prettier        | [prettier](https://prettier.io/docs/en/index.html)               | 代码格式化        |\n| cz-customizable | [cz-customizable](https://www.npmjs.com/package/cz-customizable) | Git commit 规范化 |\n\n## 特别鸣谢\n\n| 库名称                                                   | 用途                                                    |\n| -------------------------------------------------------- | ------------------------------------------------------- |\n| [taro-request](https://github.com/TigerHee/taro-request) | 封装 Taro.request（拦截器，url 配置，Authorization 等） |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdidilinkin%2Felf-taro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdidilinkin%2Felf-taro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdidilinkin%2Felf-taro/lists"}