Skip to content

Commit

Permalink
fix: 修复release在单包模式下路径错误
Browse files Browse the repository at this point in the history
  • Loading branch information
xuasir committed Mar 22, 2021
1 parent 9a38f69 commit 65ba8b1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions packages/cli-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
"dependencies": {
"@xus/cli-shared": "^0.3.1",
"@xus/core": "^0.3.1",
"@xus/rollup-chain": "^0.2.6",
"@xus/rollup-chain": "^0.3.1",
"esbuild": "^0.9.2",
"webpack-chain": "^6.5.1"
},
"devDependencies": {
"postcss": "^8.2.8"
}
}
}
4 changes: 2 additions & 2 deletions packages/preset-built-in/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@xus/cli-shared": "^0.3.1",
"@xus/core": "^0.3.1",
"@xus/plugin-cmd-roll-lib": "^0.3.1",
"@xus/rollup-chain": "^0.2.6",
"@xus/rollup-chain": "^0.3.1",
"conventional-changelog": "^3.1.24",
"release-it": "^14.4.1",
"rollup": "^2.41.1",
Expand All @@ -39,4 +39,4 @@
"devDependencies": {
"@types/conventional-changelog": "^3.1.0"
}
}
}
6 changes: 2 additions & 4 deletions packages/preset-built-in/src/plugin/command/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,7 @@ async function ensureVersion(pkgRoot: string, ops: IReleaseOps) {
if (!semver.valid(targetVersion)) {
throw new Error(`version: ${targetVersion} is invalid!`)
}
const pkgdir = ops.isLerna
? relative(ops.packageRoot, pkgRoot)
: '../packages'
const pkgdir = ops.isLerna ? relative(ops.packageRoot, pkgRoot) : '../'
pkgdir2version[pkgdir] = targetVersion
pkgname2pkgdir[pkgJson.name] = pkgdir
pkgdir2pkgname[pkgdir] = pkgJson.name
Expand Down Expand Up @@ -271,7 +269,7 @@ function updateVersion(ops: IReleaseOps) {
.map((p) => relative(ops.packageRoot, p))
.forEach((pkgDir) => updatePackage(pkgDir, ops))
} else {
updatePackage('../packages', ops)
updatePackage('../', ops)
}
}

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3176,10 +3176,10 @@
stylelint-no-unsupported-browser-features "^4.1.4"
stylelint-order "^4.1.0"

"@xus/rollup-chain@^0.2.6":
version "0.2.6"
resolved "https://registry.yarnpkg.com/@xus/rollup-chain/-/rollup-chain-0.2.6.tgz#826b48b6737cfe9437a417ec5c3c3ca0b337f29c"
integrity sha512-0fso6+HTPrh7vxOTDgs8E6eV0sox95GHNpIYvA9Ct6fWIlGd9cKsP0jrwS2Yb66JSKRTlY5Z/NYZWRgTH2Jbzg==
"@xus/rollup-chain@^0.3.1":
version "0.3.1"
resolved "https://registry.yarnpkg.com/@xus/rollup-chain/-/rollup-chain-0.3.1.tgz#eb2bb9aa80fa68da72ba050a541dfdd1ddf748c6"
integrity sha512-mG8zDtF0OqQYAOrh+rK6xAL3mwIO66XCUcvI2mzmO3Gt5I5Rk+csxi+EuKESvSifnPQWGyQs4YsfYNePxSGB1Q==

"@zkochan/cmd-shim@^3.1.0":
version "3.1.0"
Expand Down

0 comments on commit 65ba8b1

Please sign in to comment.