{"_id":"@beforegolive/contour","_rev":"2-7342354a53dc4ddf3b5577fb8cb795c1","name":"@beforegolive/contour","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@beforegolive/contour","version":"0.1.0","license":"MIT","_id":"@beforegolive/contour@0.1.0","maintainers":[{"name":"beforegolive","email":"beforegolive@gmail.com"}],"dist":{"shasum":"d5df05af6dc8fb8eaa8b2e9a2ba42e9c932e1b18","tarball":"https://registry.npmjs.org/@beforegolive/contour/-/contour-0.1.0.tgz","fileCount":17,"integrity":"sha512-mJmKkEVcm7IXvKclO8lODbgvXm6l6eVbWC+j6MJf+L7VssXb/a7to/bjYIWlCYy6XXz6GV3xN0aXuRBz7KVu7Q==","signatures":[{"sig":"MEUCIAWeNvY8nD4EsO37e6jhmGXfEwI0WFZtduQL7DCl6mbjAiEAxIlj75htIIk1vxzYV4FlGqOJ3TuM4xQSEBauaR+cnog=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":747456},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./phaser":{"types":"./dist/phaser.d.ts","import":"./dist/phaser.js","default":"./dist/phaser.js","require":"./dist/phaser.cjs"},"./package.json":"./package.json"},"gitHead":"6df3f62595889d5986fea73a69be9c6a1495e4bf","scripts":{"test":"jest","build":"tsup","release":"npm run build && npm publish --registry=https://registry.npmjs.org/","typecheck":"tsc --noEmit","test:contour":"jest __tests__/contourCore.test.ts -t '端到端 export' --no-coverage","test:contour:update":"tsx scripts/runSnapshot.ts update","test:contour:verify":"tsx scripts/runSnapshot.ts verify"},"_npmUser":{"name":"beforegolive","email":"beforegolive@gmail.com"},"_npmVersion":"11.7.0","description":"图片轮廓提取 + 物理 hull 生成库（从游戏项目 contour/ 提取的独立 npm 包）。纯算法核心零运行时依赖，Phaser 适配层独立入口。","directories":{},"_nodeVersion":"20.19.1","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.22.4","jest":"^29.7.0","tsup":"^8.0.0","canvas":"^3.2.3","phaser":"^4.1.0","@swc/jest":"^0.2.39","pixelmatch":"^6.0.0","typescript":"^5.9.3","@types/jest":"^29.5.14","@types/node":"^20.14.5","@types/pixelmatch":"^5.2.6","jest-environment-jsdom":"^30.0.2"},"peerDependencies":{"phaser":">=4.0.0"},"peerDependenciesMeta":{"phaser":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/contour_0.1.0_1785908944014_0.014892150627549006","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@beforegolive/contour","version":"0.1.1","description":"图片轮廓提取 + 物理 hull 生成库（从游戏项目 contour/ 提取的独立 npm 包）。纯算法核心零运行时依赖，Phaser 适配层独立入口。","license":"MIT","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js"},"./phaser":{"types":"./dist/phaser.d.ts","import":"./dist/phaser.js","require":"./dist/phaser.cjs","default":"./dist/phaser.js"},"./package.json":"./package.json"},"peerDependencies":{"phaser":">=4.0.0"},"peerDependenciesMeta":{"phaser":{"optional":true}},"scripts":{"build":"tsup","typecheck":"tsc --noEmit","test":"jest","test:contour":"jest __tests__/contourCore.test.ts -t '端到端 export' --no-coverage","test:contour:update":"tsx scripts/runSnapshot.ts update","test:contour:verify":"tsx scripts/runSnapshot.ts verify","release":"npm run build && npm publish --registry=https://registry.npmjs.org/"},"devDependencies":{"@swc/jest":"^0.2.39","@types/jest":"^29.5.14","@types/node":"^20.14.5","@types/pixelmatch":"^5.2.6","canvas":"^3.2.3","jest":"^29.7.0","jest-environment-jsdom":"^30.0.2","phaser":"^4.1.0","pixelmatch":"^6.0.0","tsup":"^8.0.0","tsx":"^4.22.4","typescript":"^5.9.3"},"gitHead":"6df3f62595889d5986fea73a69be9c6a1495e4bf","_id":"@beforegolive/contour@0.1.1","_nodeVersion":"20.19.1","_npmVersion":"11.7.0","dist":{"integrity":"sha512-Cb6rs2VmXaPpujvXiT6/0kEAL9ePR4tDn+gF+/Tevx75MZFTV5CdrNXdmLAePIZRgEStD4bW+40lZMn3CSx5Ug==","shasum":"c9113b7c694681e6c627d27f68355e356b4bf2d5","tarball":"https://registry.npmjs.org/@beforegolive/contour/-/contour-0.1.1.tgz","fileCount":17,"unpackedSize":747456,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDmrs4gDig3eMyjoSEJiv6Ics41h4wJmN9phRIOoF3V6gIgC7OHAycI0owBe8LrRcQhDLjvju8kTUq0OWr61ZUZJII="}]},"_npmUser":{"name":"beforegolive","email":"beforegolive@gmail.com"},"directories":{},"maintainers":[{"name":"beforegolive","email":"beforegolive@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/contour_0.1.1_1785909169915_0.09158777669789409"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-05T05:49:03.796Z","modified":"2026-08-05T05:52:50.243Z","0.1.0":"2026-08-05T05:49:04.177Z","0.1.1":"2026-08-05T05:52:50.085Z"},"license":"MIT","description":"图片轮廓提取 + 物理 hull 生成库（从游戏项目 contour/ 提取的独立 npm 包）。纯算法核心零运行时依赖，Phaser 适配层独立入口。","maintainers":[{"name":"beforegolive","email":"beforegolive@gmail.com"}],"readme":"# @beforegolive/contour\n\n图片轮廓提取 + 物理 hull 生成库（从游戏项目 `contour/` 模块提取的独立 npm 包）。\n\n## 双入口\n\n| 入口 | 内容 | 依赖 |\n|---|---|---|\n| `@beforegolive/contour`（主入口） | 纯算法核心：Sobel / RDP / 凸包 / 物理 hull / PolygonDecomposer / withOffset / withScale | 零运行时依赖，可用于任意 JS 环境（含微信小游戏） |\n| `@beforegolive/contour/phaser` | Phaser 适配层：`readPixelsFromTexture` / `extractContourViaCPU` / `extractors` / `runtimeContourRegistry` | 需要 `phaser`（optional peerDependency） |\n\n## 用法\n\n```ts\n// 纯核心（无 Phaser）\nimport { decomposeFromContour, PhysicsPoint } from '@beforegolive/contour'\n\n// Phaser 适配层\nimport { extractContour, getRuntimeContour } from '@beforegolive/contour/phaser'\n```\n\n## 开发\n\n```bash\nnpm install\nnpm run build       # tsup → dist/{index,phaser}.{js,cjs,d.ts}\nnpm run typecheck   # tsc --noEmit\nnpm test            # jest 全量\nnpm run test:contour:verify  # 端到端 snapshot 回归（13 图 + JSON baseline）\nnpm run test:contour:update  # 预期变化时重刷 baseline\nnpm run release     # build + publish（固定官方 registry）\n```\n\n## 目录\n\n```\nsrc/          # 源码（index.ts 核心入口 / phaser.ts 适配入口）\n__tests__/    # jest 测试 + .test-output-baseline/（snapshot 基线）\nscripts/      # runSnapshot / snapshotCompare / snapshotUpdate\nassets/       # 测试 fixture 图片（13 张 images + row_boat sprites）\n```\n","readmeFilename":"README.md"}