chore: automatically copy readme when publish

This commit is contained in:
Simon
2025-12-01 20:33:10 +08:00
parent b53d4dd8a5
commit 682a08e0dc
2 changed files with 13 additions and 3 deletions

7
.gitignore vendored
View File

@@ -26,4 +26,9 @@ dist-ssr
#
.env
.env
# Copied files for npm publish (generated by prepublishOnly)
packages/page-agent/README.md
packages/page-agent/README-zh.md
packages/page-agent/LICENSE

View File

@@ -14,7 +14,10 @@
}
},
"files": [
"dist/"
"dist/",
"README.md",
"README-zh.md",
"LICENSE"
],
"description": "AI-powered UI agent for web applications - add intelligent automation to any webpage with a single script tag",
"keywords": [
@@ -39,7 +42,9 @@
"build": "MODE=lib vite build && MODE=umd vite build",
"build:lib": "MODE=lib vite build",
"build:umd": "MODE=umd vite build",
"build:watch": "MODE=lib vite build --watch"
"build:watch": "MODE=lib vite build --watch",
"prepublishOnly": "node -e \"const fs=require('fs');['README.md','README-zh.md','LICENSE'].forEach(f=>fs.copyFileSync('../../'+f,f))\"",
"postpublish": "node -e \"['README.md','README-zh.md','LICENSE'].forEach(f=>{try{require('fs').unlinkSync(f)}catch{}})\""
},
"dependencies": {
"ai-motion": "^0.4.7",