{"_id":"@edgeone/framework-detect","_rev":"13-0b0ed988e3750e03a8b35bfc44ae9fb6","name":"@edgeone/framework-detect","dist-tags":{"latest":"0.2.0"},"versions":{"0.0.1":{"name":"@edgeone/framework-detect","version":"0.0.1","keywords":["framework","detection","web","next","react","vue","angular","svelte","astro","gatsby","remix"],"author":{"name":"zephyr"},"license":"ISC","_id":"@edgeone/framework-detect@0.0.1","maintainers":[{"name":"shirlyyang","email":"shirlyyang@tencent.com"},{"name":"sagacheng","email":"sagacheng@tencent.com"},{"name":"tencent-player","email":"vincentlli@tencent.com"}],"dist":{"shasum":"0c66b528d033360d21663d777904f721050c66a7","tarball":"https://registry.npmjs.org/@edgeone/framework-detect/-/framework-detect-0.0.1.tgz","fileCount":22,"integrity":"sha512-nAGDRpSRkJp3+wasJMxs5arrt6t3zbom6CAfNwRCWUNX4OUIZ7cW4/FYcIygt3YldnMtJ1n3E80WfkJ44Zifxw==","signatures":[{"sig":"MEYCIQCDYqiuKyOdaOG+N7M/Fydltf8gSYbSv2vOflMC0de3YwIhALhWmNhbKpFyl3MH+bezX1OgAA2kIcO+HwkLu3oOjMdD","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1876231},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"3aaf44f5bc1417445a9b014042061d18cd57c5cf","private":false,"scripts":{"dev":"rollup -c -w","test":"tsx test.ts","build":"rollup -c","type-check":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"tencent-player","email":"vincentlli@tencent.com"},"_npmVersion":"10.9.0","description":"A framework detection library for web projects","directories":{},"_nodeVersion":"22.11.0","dependencies":{"axios":"^1.11.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.4","tslib":"^2.8.1","rollup":"^3.0.0","typescript":"^5.3.3","@types/node":"^20.10.5","@rollup/plugin-json":"^6.1.0","@rollup/plugin-commonjs":"^25.0.0","@rollup/plugin-typescript":"^11.1.6","@rollup/plugin-node-resolve":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/framework-detect_0.0.1_1756968092385_0.7309410504018863","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@edgeone/framework-detect","version":"0.0.2","keywords":["framework","detection","web","next","react","vue","angular","svelte","astro","gatsby","remix"],"author":{"name":"zephyr"},"license":"ISC","_id":"@edgeone/framework-detect@0.0.2","maintainers":[{"name":"shirlyyang","email":"shirlyyang@tencent.com"},{"name":"sagacheng","email":"sagacheng@tencent.com"},{"name":"tencent-player","email":"vincentlli@tencent.com"},{"name":"simxin","email":"simxin@tencent.com"}],"dist":{"shasum":"fb8db72e38804f491f842b07273bf447a51150c2","tarball":"https://registry.npmjs.org/@edgeone/framework-detect/-/framework-detect-0.0.2.tgz","fileCount":22,"integrity":"sha512-UfG2c2CvzLHfC7r4GkRAqTp4QekILOyU7WNhXOkhm3bHT+RBWxcECO+r3jBxhHsvYac8qjk5QHT7/ODNtQe0vQ==","signatures":[{"sig":"MEQCIDM9mWao9PL1tfe+ETjnBe84HHeMgcru8bZKazu/McwvAiBifsl30Xk1uCginzhL0/oaW4aSr7ppYzln7XMjnXOCvQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3427788},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"16f09fe5c5a7a5459c99b62ec27fa69bf42f33e2","scripts":{"dev":"rollup -c -w","test":"tsx test.ts","build":"rollup -c","type-check":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"simxin","email":"simxin@tencent.com"},"_npmVersion":"10.9.2","description":"A framework detection library for web projects","directories":{},"_nodeVersion":"22.14.0","dependencies":{"acorn":"^8.15.0","axios":"^1.11.0","acorn-walk":"^8.3.4"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.4","tslib":"^2.8.1","rollup":"^3.0.0","typescript":"^5.3.3","@types/node":"^20.10.5","@rollup/plugin-json":"^6.1.0","@rollup/plugin-commonjs":"^25.0.0","@rollup/plugin-typescript":"^11.1.6","@rollup/plugin-node-resolve":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/framework-detect_0.0.2_1758080207839_0.048834679155419725","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@edgeone/framework-detect","version":"0.1.0","keywords":["framework","detection","web","next","react","vue","angular","svelte","astro","gatsby","remix"],"author":{"name":"zephyr"},"license":"ISC","_id":"@edgeone/framework-detect@0.1.0","maintainers":[{"name":"xiaban","email":"980892894@qq.com"},{"name":"shirlyyang","email":"shirlyyang@tencent.com"},{"name":"sagacheng","email":"sagacheng@tencent.com"},{"name":"tencent-player","email":"vincentlli@tencent.com"},{"name":"simxin","email":"simxin@tencent.com"}],"dist":{"shasum":"cc264dd30e128ee6e4ef01235fe7b05a3be08673","tarball":"https://registry.npmjs.org/@edgeone/framework-detect/-/framework-detect-0.1.0.tgz","fileCount":34,"integrity":"sha512-JkiD/HBUFJt6kIz/6yyycey4cInVOxon8RAm9bfHdTPq5mFvAMOXrg3OLpvc0jU8eASomgEhuM3WfqZoe54H3A==","signatures":[{"sig":"MEUCIQCjvs4bstJLlLnnfoLycIYY27aZJBWLfghEBoDnSqd5xwIgFImcNmtwLpZyeDM+3HypjbCWdOy2cNYRW+XyRGVL8N8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1792397},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"2b07d7554d466b01f01f22ddd2f25a73a4c064bd","private":false,"scripts":{"dev":"rollup -c -w","test":"tsx test.ts","build":"rollup -c","type-check":"tsc --noEmit","publish:major":"npm version major && npm publish","publish:minor":"npm version minor && npm publish","publish:patch":"npm version patch && npm publish","version:major":"npm version major","version:minor":"npm version minor","version:patch":"npm version patch","prepublishOnly":"npm run build"},"_npmUser":{"name":"xiaban","email":"980892894@qq.com"},"_npmVersion":"10.8.2","description":"A framework detection library for web projects","directories":{},"_nodeVersion":"20.19.3","dependencies":{"axios":"^1.11.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.4","tslib":"^2.8.1","rollup":"^3.0.0","typescript":"^5.3.3","@types/node":"^20.10.5","@rollup/plugin-json":"^6.1.0","@rollup/plugin-commonjs":"^25.0.0","@rollup/plugin-typescript":"^11.1.6","@rollup/plugin-node-resolve":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/framework-detect_0.1.0_1761565607152_0.7602507963943954","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@edgeone/framework-detect","version":"0.2.0","keywords":["framework","detection","web","next","react","vue","angular","svelte","astro","gatsby","remix"],"author":{"name":"zephyr"},"license":"ISC","_id":"@edgeone/framework-detect@0.2.0","maintainers":[{"name":"xiaban","email":"980892894@qq.com"},{"name":"tomcomtang","email":"364786053@qq.com"},{"name":"shirlyyang","email":"shirlyyang@tencent.com"},{"name":"sagacheng","email":"sagacheng@tencent.com"},{"name":"venzil","email":"q153877011@gmail.com"},{"name":"shiyangchen","email":"shiyangchen@tencent.com"},{"name":"tencent-player","email":"vincentlli@tencent.com"},{"name":"simxin","email":"simxin@tencent.com"}],"dist":{"shasum":"3913fc64402a82452d230e8f503194ad3ed2f6a5","tarball":"https://registry.npmjs.org/@edgeone/framework-detect/-/framework-detect-0.2.0.tgz","fileCount":36,"integrity":"sha512-2Dy6Ft/KPFb5Pp7YeESEwMrgogl5yRqF9CmRd2bJDdnSr60r65Fv2DoUU9XnkbNbG6ynYFUOFkdHL2+MhKdkSw==","signatures":[{"sig":"MEYCIQCz2/9PSubbkQ7ymynMS32AM0hSs2vhRMEe7jHN42GtrgIhALq/KW3tggmdGELT1N4tsFsIrPS4aMs4PkY/GfFmwFq4","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1819404},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"07d2423b842e2b3890cdf030653e0fdc0164d4d0","private":false,"scripts":{"dev":"rollup -c -w","test":"tsx test.ts","build":"rollup -c","type-check":"tsc --noEmit","publish:major":"npm version major && npm publish","publish:minor":"npm version minor && npm publish","publish:patch":"npm version patch && npm publish","version:major":"npm version major","version:minor":"npm version minor","version:patch":"npm version patch","prepublishOnly":"npm run build"},"_npmUser":{"name":"xiaban","email":"980892894@qq.com"},"_npmVersion":"10.8.2","description":"A framework detection library for web projects","directories":{},"_nodeVersion":"20.19.3","dependencies":{"axios":"^1.11.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.4","tslib":"^2.8.1","rollup":"^3.0.0","typescript":"^5.3.3","@types/node":"^20.10.5","@rollup/plugin-json":"^6.1.0","@rollup/plugin-commonjs":"^25.0.0","@rollup/plugin-typescript":"^11.1.6","@rollup/plugin-node-resolve":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/framework-detect_0.2.0_1766977146219_0.8947965499978281","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-09-04T06:41:32.250Z","modified":"2026-09-15T06:26:54.772Z","0.0.1":"2025-09-04T06:41:32.611Z","0.0.2":"2025-09-17T03:36:48.074Z","0.1.0":"2025-10-27T11:46:47.392Z","0.2.0":"2025-12-29T02:59:06.383Z"},"author":{"name":"zephyr"},"license":"ISC","keywords":["framework","detection","web","next","react","vue","angular","svelte","astro","gatsby","remix"],"description":"A framework detection library for web projects","maintainers":[{"email":"980892894@qq.com","name":"xiaban"},{"email":"364786053@qq.com","name":"tomcomtang"},{"email":"corbinlin@tencent.com","name":"corbinlin"},{"email":"shirlyyang@tencent.com","name":"shirlyyang"},{"email":"sagacheng@tencent.com","name":"sagacheng"},{"email":"q153877011@gmail.com","name":"venzil"},{"email":"shiyangchen@tencent.com","name":"shiyangchen"},{"email":"vincentlli@tencent.com","name":"tencent-player"},{"email":"zhaodanzhao@tencent.com","name":"zhaodanzhao"},{"email":"xindeli@tencent.com","name":"xindeli"},{"email":"drogbaqb@gmail.com","name":"drogbaqu"},{"email":"946834832@qq.com","name":"xingchenhe"},{"email":"simxin@tencent.com","name":"simxin"}],"readme":"# framework-detect\n\n一个用于检测 Web 项目框架的 TypeScript 库，支持本地检测和远程仓库检测。\n\n## 安装\n\n```bash\ntnpm install @tencent/framework-detect\n```\n\n## 使用方法\n\n### 本地检测\n\n```typescript\nimport { describeFramework } from '@tencent/framework-detect';\n\n// 检测项目框架\nconst frameworkInfo = await describeFramework('./my-project');\nconsole.log(frameworkInfo);\n```\n\n### 远程仓库检测\n\n支持 GitHub、Gitee、GitLab、Bitbucket 四大平台的远程仓库检测。\n\n#### GitHub\n\n```typescript\nimport { describeFrameworkRemote } from '@tencent/framework-detect';\n\n// 公开仓库（无认证，有速率限制）\nconst result = await describeFrameworkRemote({\n  Provider: \"Github\",\n  Namespace: \"vercel\",\n  RepoName: \"next.js\",\n  RootDir: \"examples/blog\",\n});\n\n// 私有仓库（需要 Token）\nconst result = await describeFrameworkRemote({\n  Provider: \"Github\",\n  Namespace: \"your-org\",\n  RepoName: \"your-repo\",\n}, {\n  Token: \"ghp_xxxxx\", // GitHub Personal Access Token\n});\n```\n\n#### Gitee\n\n```typescript\nconst result = await describeFrameworkRemote({\n  Provider: \"Gitee\",\n  Namespace: \"oschina\",\n  RepoName: \"gitee\",\n}, {\n  Token: \"your_gitee_token\",\n});\n```\n\n#### GitLab\n\n```typescript\n// 支持 gitlab.com 和自建实例\nconst result = await describeFrameworkRemote({\n  Provider: \"Gitlab\",\n  Namespace: \"gitlab-org\",\n  RepoName: \"gitlab\",\n  Branch: \"master\",\n}, {\n  Token: \"glpat-xxxxx\",\n  BaseUrl: \"https://gitlab.com\", // 自建实例请修改此 URL\n});\n```\n\n#### Bitbucket\n\n```typescript\n// Bitbucket Cloud\nconst result = await describeFrameworkRemote({\n  Provider: \"Bitbucket\",\n  Namespace: \"atlassian\",\n  RepoName: \"stash-example-plugin\",\n  Branch: \"master\",\n}, {\n  Token: \"your_app_password\", // App Password 或 OAuth Token\n});\n\n// Bitbucket Data Center（自建）\nconst result = await describeFrameworkRemote({\n  Provider: \"Bitbucket\",\n  Namespace: \"PROJECT_KEY\",\n  RepoName: \"repo-slug\",\n}, {\n  Token: \"your_personal_access_token\",\n  BaseUrl: \"https://bitbucket.example.com\",\n});\n```\n\n详细的 Bitbucket 集成指南请查看 [BITBUCKET_GUIDE.md](./BITBUCKET_GUIDE.md)\n\n## API\n\n### `describeFramework(projectRoot: string): Promise<FrameworkInfo>`\n\n检测指定目录中的 Web 项目框架。\n\n**参数:**\n- `projectRoot` (string): 项目根目录路径\n\n**返回值:**\n- `Promise<FrameworkInfo>`: 框架信息对象\n\n### `describeFrameworkRemote(body: GitProviderBody, auth?: any): Promise<FrameworkInfo>`\n\n检测远程 Git 仓库中的 Web 项目框架。\n\n**参数:**\n- `body` (GitProviderBody): 仓库信息\n  - `Provider`: `\"Github\"` | `\"Gitee\"` | `\"Gitlab\"` | `\"Bitbucket\"`\n  - `Namespace`: 用户名/组织名/Workspace ID/Project Key\n  - `RepoName`: 仓库名称\n  - `RootDir?`: 根目录（可选）\n  - `Branch?`: 分支名（可选）\n- `auth?` (any): 认证信息（可选）\n  - GitHub: `{ Token: \"ghp_xxxxx\" }` 或 Octokit 实例\n  - Gitee: `{ Token: \"your_token\" }`\n  - GitLab: `{ Token: \"glpat-xxxxx\", BaseUrl?: \"https://gitlab.com\" }`\n  - Bitbucket: `{ Token: \"your_token\", BaseUrl?: \"https://api.bitbucket.org\" }`\n\n**返回值:**\n- `Promise<FrameworkInfo>`: 框架信息对象\n\n**返回对象结构:**\n```typescript\ninterface FrameworkInfo {\n  Framework: string;    // 框架名称\n  BuildCmd: string;     // 构建命令\n  InstallCmd: string;   // 安装命令\n  OutputDir: string;    // 输出目录\n  IconPath?: string;    // 图标路径（可选）\n}\n```\n\n## 支持的框架\n\n- Next.js\n- Gatsby\n- Remix\n- React Router\n- Astro\n- Hexo\n- Eleventy\n- Docusaurus\n- Solid\n- Vue\n- Angular\n- Svelte\n- React\n- Nuxt\n- Qwik\n- Hono\n- Vite\n\n## 支持的 Git 平台\n\n| 平台 | 公开仓库 | 私有仓库 | 自建实例 | 认证方式 |\n|------|---------|---------|---------|----------|\n| **GitHub** | ✅ | ✅ | ✅ | Personal Access Token |\n| **Gitee** | ✅ | ✅ | ❌ | Personal Access Token |\n| **GitLab** | ✅ | ✅ | ✅ | Personal Access Token |\n| **Bitbucket** | ✅ | ✅ | ✅ | OAuth 2.0 / App Password / PAT |\n\n## 开发\n\n```bash\n# 安装依赖\nnpm install\n\n# 构建\nnpm run build\n\n# 运行测试\nnpm run test\n\n# 测试远程检测\nbun testRemote.ts\n```","readmeFilename":"README.md"}