{"id":50846809,"url":"https://github.com/hughcube/dev-toolkit","last_synced_at":"2026-06-14T10:30:23.749Z","repository":{"id":359592307,"uuid":"1246754569","full_name":"hughcube/dev-toolkit","owner":"hughcube","description":"UniApp 与微信、支付宝小程序开发工具包：版本管理、代码上传、开发配置自动化的命令行工具集 (CLI)","archived":false,"fork":false,"pushed_at":"2026-05-22T16:21:20.000Z","size":1133,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-22T19:46:25.704Z","etag":null,"topics":["alipay","cli","dcloud","developer-tools","mini-program","miniprogram","nodejs","toolkit","uniapp","upload","version-management","wechat","weixin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@hughcube/dev-toolkit","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hughcube.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-22T14:16:14.000Z","updated_at":"2026-05-22T16:21:24.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/hughcube/dev-toolkit","commit_stats":null,"previous_names":["hughcube/dev-toolkit"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/hughcube/dev-toolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hughcube%2Fdev-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hughcube%2Fdev-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hughcube%2Fdev-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hughcube%2Fdev-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hughcube","download_url":"https://codeload.github.com/hughcube/dev-toolkit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hughcube%2Fdev-toolkit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34318523,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["alipay","cli","dcloud","developer-tools","mini-program","miniprogram","nodejs","toolkit","uniapp","upload","version-management","wechat","weixin"],"created_at":"2026-06-14T10:30:22.835Z","updated_at":"2026-06-14T10:30:23.744Z","avatar_url":"https://github.com/hughcube.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @hughcube/dev-toolkit\n\n一套完整的开发工具集，包含小程序版本管理、代码上传、开发配置等功能。\n\n## 🚀 功能特性\n\n- **UniApp版本管理**: 自动更新manifest.json中的版本号和版本代码\n- **支付宝小程序上传**: 使用minidev自动上传代码到支付宝开放平台\n- **微信小程序上传**: 使用miniprogram-ci自动上传代码到微信公众平台\n- **UniApp支付宝开发助手**: 自动生成支付宝小程序开发配置文件，支持导出页面配置\n- **UniApp首页配置器**: 根据AppID自动配置小程序启动首页\n- **跨平台支持**: 支持Windows、macOS、Linux\n- **环境变量支持**: 支持通过环境变量配置参数\n\n## 📦 安装\n\n### 全局安装（推荐）\n\n```bash\nnpm install -g @hughcube/dev-toolkit\n```\n\n### 项目本地安装\n\n```bash\nnpm install @hughcube/dev-toolkit --save-dev\n```\n\n## 🛠 命令行工具\n\n安装后可以使用以下命令行工具：\n\n### 1. UniApp版本更新器 `hctoolkit-uniapp-version-updater`\n\n更新manifest.json中的版本信息：\n\n```bash\n# 更新版本号\nhctoolkit-uniapp-version-updater --version v1.2.3\n\n# 支持多位版本号\nhctoolkit-uniapp-version-updater --version v1.2.3.4\n```\n\n### 2. 支付宝小程序上传 `hctoolkit-mp-alipay-uploader`\n\n上传代码到支付宝开放平台：\n\n```bash\nhctoolkit-mp-alipay-uploader \\\n  --app-id 2021005160675311 \\\n  --dist-dir ./dist/build/mp-alipay \\\n  --version v1.2.3 \\\n  --config ./minidev-config.json\n```\n\n### 3. 微信小程序上传 `hctoolkit-mp-weixin-uploader`\n\n上传代码到微信公众平台：\n\n```bash\nhctoolkit-mp-weixin-uploader \\\n  --app-id wx650d85ca4330d458 \\\n  --dist-dir ./dist/build/mp-weixin \\\n  --version v1.2.3 \\\n  --private-key ./private.wx.key\n```\n\n### 4. UniApp支付宝开发助手 `hctoolkit-uniapp-mp-alipay-dev-helper`\n\n生成支付宝小程序开发配置：\n\n```bash\n# 开发模式 + 监听\nhctoolkit-uniapp-mp-alipay-dev-helper --mode dev --watch\n\n# 构建模式\nhctoolkit-uniapp-mp-alipay-dev-helper --mode build\n\n# 导出页面配置到compileMode.json\nhctoolkit-uniapp-mp-alipay-dev-helper --mode dev --dump-pages --watch\n```\n\n### 5. UniApp首页配置器 `hctoolkit-uniapp-homepage-configurator`\n\n配置小程序启动首页：\n\n```bash\n# 根据AppID自动查找\nhctoolkit-uniapp-homepage-configurator --app-id wx650d85ca4330d458 --platform mp-weixin\n\n# 直接指定页面路径\nhctoolkit-uniapp-homepage-configurator --page-path pages/home/index  \n```\n\n## 📋 环境变量\n\n所有工具都支持通过环境变量配置参数，优先级为：命令行参数 \u003e 环境变量 \u003e 默认值\n\n### 支付宝小程序上传环境变量\n\n```bash\nexport ALIMP_APP_ID=\"2021005160675311\"\nexport ALIMP_DIST_DIR=\"./dist/build/mp-alipay\"\nexport ALIMP_VERSION=\"v1.2.3\"\nexport ALIMP_MINIDEV_CONFIG_FILE=\"./minidev-config.json\"\nexport ALIMP_VERSION_DESCRIBE=\"版本描述\"\n```\n\n### 微信小程序上传环境变量\n\n```bash\nexport WXMP_APP_ID=\"wx650d85ca4330d458\"\nexport WXMP_DIST_DIR=\"./dist/build/mp-weixin\"\nexport WXMP_VERSION=\"v1.2.3\"\nexport WXMP_PRIVATE_KEY_PATH=\"./private.wx.key\"\nexport WXMP_VERSION_DESCRIBE=\"版本描述\"\nexport WXMP_ROBOT=\"1\"\n```\n\n## 🔧 编程接口\n\n也可以在Node.js代码中使用：\n\n```javascript\nconst { UniappVersionUpdater, MpAlipayUploader, MpWeixinUploader } = require('@hughcube/dev-toolkit');\n\n// UniApp版本更新\nconst versionUpdater = new UniappVersionUpdater();\nconst result = versionUpdater.updateManifest('v1.2.3');\nconsole.log(result); // { versionName: 'v1.2.3', versionCode: 1002003 }\n\n// 支付宝上传\nconst alipayUploader = new MpAlipayUploader({\n  appId: '2021005160675311',\n  distDir: './dist/build/mp-alipay',\n  version: 'v1.2.3',\n  minidevConfig: './minidev-config.json'\n});\nawait alipayUploader.run();\n\n// 向后兼容的方式（建议使用新的类名）\nconst { VersionUpdater } = require('@hughcube/dev-toolkit');\n```\n\n## 📄 前置条件\n\n### 支付宝小程序\n\n1. 安装minidev依赖：`npm install minidev`\n2. 准备minidev配置文件，包含私钥和工具ID\n3. 确保构建产物目录存在\n\n配置文件格式 (minidev-config.json):\n```json\n{\n  \"alipay\": {\n    \"authentication\": {\n      \"privateKey\": \"-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----\",\n      \"toolId\": \"your-tool-id\"\n    }\n  }\n}\n```\n\n### 微信小程序\n\n1. 安装miniprogram-ci依赖：`npm install miniprogram-ci`\n2. 从微信公众平台下载代码上传密钥\n3. 确保构建产物目录存在\n\n获取私钥文件：\n1. 登录微信公众平台 https://mp.weixin.qq.com\n2. 进入开发 → 开发管理 → 开发设置 → 小程序代码上传\n3. 生成并下载代码上传密钥\n\n## 🤝 贡献\n\n欢迎提交Issue和Pull Request！\n\n## 📄 许可证\n\nMIT License\n\n## 🔗 相关链接\n\n- [支付宝开放平台](https://open.alipay.com/)\n- [微信公众平台](https://mp.weixin.qq.com/)\n- [uni-app官网](https://uniapp.dcloud.net.cn/)\n- [GitHub仓库](https://github.com/hughcube-js/dev-toolkit) ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhughcube%2Fdev-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhughcube%2Fdev-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhughcube%2Fdev-toolkit/lists"}