{"id":48949493,"url":"https://github.com/liangfuliang541-pixel/uniadapter","last_synced_at":"2026-04-17T19:06:14.606Z","repository":{"id":351604265,"uuid":"1148032863","full_name":"liangfuliang541-pixel/uniadapter","owner":"liangfuliang541-pixel","description":"不是框架。一个能在5分钟内为现有项目添加跨平台支持的开源工具。","archived":false,"fork":false,"pushed_at":"2026-04-15T19:13:06.000Z","size":642,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-15T19:15:08.529Z","etag":null,"topics":["adapter","alipay-miniprogram","cross-platform","distributed-system","douyin-miniprogram","frontend","go-microservices","mini-program","mobile-development","react","react-native","typescript","web-development","wechat-miniprogram"],"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/liangfuliang541-pixel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-02T13:55:40.000Z","updated_at":"2026-04-15T19:13:10.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/liangfuliang541-pixel/uniadapter","commit_stats":null,"previous_names":["liangfuliang541-pixel/uniadapter"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/liangfuliang541-pixel/uniadapter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liangfuliang541-pixel%2Funiadapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liangfuliang541-pixel%2Funiadapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liangfuliang541-pixel%2Funiadapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liangfuliang541-pixel%2Funiadapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liangfuliang541-pixel","download_url":"https://codeload.github.com/liangfuliang541-pixel/uniadapter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liangfuliang541-pixel%2Funiadapter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31941875,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["adapter","alipay-miniprogram","cross-platform","distributed-system","douyin-miniprogram","frontend","go-microservices","mini-program","mobile-development","react","react-native","typescript","web-development","wechat-miniprogram"],"created_at":"2026-04-17T19:06:13.945Z","updated_at":"2026-04-17T19:06:14.597Z","avatar_url":"https://github.com/liangfuliang541-pixel.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"iang# UniAdapter 2.0\n\n**用自然语言描述功能，AI 自动生成跨端最优代码。**\n\n一个框架，解决微信/支付宝/抖音/小红书小程序的适配痛点。\n\n[![npm](https://img.shields.io/npm/v/@liangfu/uniadapter?style=flat-square)](https://www.npmjs.com/package/@liangfu/uniadapter)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.0-blue?style=flat-square)](https://www.typescriptlang.org/)\n[![License](https://img.shields.io/badge/license-MIT-green?style=flat-square)](LICENSE)\n\n---\n\n## 安装\n\n```bash\nnpm install @liangfu/uniadapter\n```\n\n## 快速开始\n\n### 方式一：直接使用适配器（无需 AI）\n\n```typescript\nimport { createStorageAdapter, useUniRequest } from '@liangfu/uniadapter'\n\n// 存储 — 自动适配当前平台\nconst storage = await createStorageAdapter()\nawait storage.set('token', 'user_token_123')\nconst token = await storage.get('token')\n\n// HTTP 请求（React Hook）\nfunction UserList() {\n  const { get, post } = useUniRequest()\n  return \u003cbutton onClick={() =\u003e get('/api/users')}\u003e获取\u003c/button\u003e\n}\n```\n\n### 方式二：VibeEngine（AI 代码生成）\n\n```typescript\nimport { VibeEngine } from '@liangfu/uniadapter'\n\nconst engine = new VibeEngine({ platform: 'weapp' })\n\nconst { code } = await engine.generate({\n  prompt: '实现图片上传，支持压缩和进度显示',\n})\n\nconsole.log(code)\n// 自动生成微信小程序最优实现\n```\n\n### 方式三：VibeMCP（Cursor/Claude Code 插件）\n\n在 Cursor/Windsurf 的 MCP 配置中添加：\n\n```json\n{\n  \"mcpServers\": {\n    \"vibemcp\": {\n      \"command\": \"npx\",\n      \"args\": [\"@liangfu/uniadapter\", \"mcp\"]\n    }\n  }\n}\n```\n\n然后直接在 AI 助手中描述需求：\n\n\u003e \"帮我做一个电商小程序，包含商品列表、购物车、支付\"\n\n---\n\n## 支持的平台\n\n| 平台 | Storage | Request | Router | Share | 备注 |\n|------|---------|---------|---------|--------|-------|\n| 微信小程序 | ✅ | ✅ | ✅ | ✅ | 完整实现 |\n| 支付宝小程序 | ✅ | ✅ | ✅ | ⚠️ 部分 | 部分 API 差异 |\n| 抖音小程序 | ✅ | ✅ | ✅ | ✅ | 完整实现 |\n| 小红书小程序 | ✅ | ✅ | ✅ | ⚠️ 部分 | 部分 API 差异 |\n| Web/H5 | ✅ | ✅ | ✅ | ⚠️ 部分 | 浏览器限制 |\n| 高德地图 | ✅ | ✅ | ✅ | — | 原生 API 封装 |\n\n\u003e 标注 ⚠️ 的功能为部分实现，请参考 API 文档确认具体支持情况。\n\n---\n\n## 核心 API\n\n### Storage（存储）\n\n```typescript\nimport { createStorageAdapter } from '@liangfu/uniadapter'\n\nconst storage = await createStorageAdapter()\nawait storage.set(key, value)\nconst val = await storage.get(key)\nawait storage.remove(key)\nawait storage.clear()\n```\n\n### HTTP 请求（React）\n\n```typescript\nimport { useUniRequest } from '@liangfu/uniadapter'\n\nfunction App() {\n  const { get, post, loading } = useUniRequest()\n  return \u003cbutton onClick={() =\u003e get('/api/users')}\u003e加载\u003c/button\u003e\n}\n```\n\n### 平台检测\n\n```typescript\nimport { usePlatform } from '@liangfu/uniadapter'\n\nconst { name, isWeapp, isAlipay, isDouyin } = usePlatform()\n```\n\n---\n\n## VibeEngine 意图识别\n\n| 意图 | 关键词 | 生成内容 |\n|------|--------|---------|\n| storage | 存/取/删/token | Storage API 最优实现 |\n| request | 请求/加载/fetch | 跨平台请求适配代码 |\n| navigation | 跳转/导航/返回 | 页面路由代码 |\n| ui | 显示/列表/弹窗 | UI 组件代码 |\n| system | 分享/登录/定位 | 平台系统能力调用 |\n\n---\n\n## 环境变量\n\n```bash\n# 至少配置一个\nOPENAI_API_KEY=sk-xxx\n# 或\nDEEPSEEK_API_KEY=sk-xxx\n# 或\nANTHROPIC_API_KEY=sk-xxx\n```\n\n---\n\n## 构建发布\n\n```bash\nnpm install\nnpm run build      # 构建所有平台\nnpm run build -- --platform weapp   # 只构建微信小程序\nnpm run test       # 运行测试\nnpm publish        # 发布 npm\n```\n\n---\n\n## License\n\nMIT License © 2026 [liangfuliang541-pixel](https://github.com/liangfuliang541-pixel)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliangfuliang541-pixel%2Funiadapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliangfuliang541-pixel%2Funiadapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliangfuliang541-pixel%2Funiadapter/lists"}