Skip to content

Commit

Permalink
feat: both adapt deploy&publish
Browse files Browse the repository at this point in the history
  • Loading branch information
chenweigh committed Sep 30, 2024
1 parent a7bb147 commit 991ce81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions sh/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ async function init() {
await run(`pnpm run build:wallet`, pathRoot)
}
//tip: change package.json content
//remove dep, add peer
WalletJsonData.peerDependencies['@xterio-sdk/auth'] = '^' + authVersion.split('.').slice(0, 2).join('.')
delete WalletJsonData.dependencies['@xterio-sdk/auth']
writeJSONSync(pathWalletJson, WalletJsonData, { encoding: 'utf-8', spaces: 2 })
await run('npm publish', pathWallet)
await run(`bash release.sh wallet ${walletVersion}`, pathSh)
Expand All @@ -48,12 +50,13 @@ async function init() {
}
const commitVersionFile = async (_f: string, _v: string) => {
const path = _f === 'auth' ? pathAuth : pathWallet
await run(`git push origin main && git push new-origin main`)
await run(`git push origin main`)
await run(`git add package.json && git commit -m "feat: npm pkg(${_f}) publish(${_v})"`, path)
await run(`git push origin main && git push new-origin main`)
await run(`git push origin main`)
}
const reset = () => {
WalletJsonData.peerDependencies['@xterio-sdk/auth'] = 'workspace:^'
WalletJsonData.dependencies['@xterio-sdk/auth'] = 'workspace:^'
writeJSONSync(pathWalletJson, WalletJsonData, { encoding: 'utf-8', spaces: 2 })
}

Expand Down
3 changes: 2 additions & 1 deletion xterio-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
"ethers": "^5.7.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"viem": "^2.21.2"
"viem": "^2.21.2",
"@xterio-sdk/auth": "workspace:^"
},
"devDependencies": {
"@eslint/js": "^9.9.0",
Expand Down

0 comments on commit 991ce81

Please sign in to comment.