Skip to content

Commit

Permalink
feat: release增加指定包能力
Browse files Browse the repository at this point in the history
  • Loading branch information
xuasir committed Mar 22, 2021
1 parent 5189654 commit a42c9a7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/plugin-cmd-roll-lib/src/modify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export function modifyConfig(
resolvedConfig: IResolvedConfig,
api: IPluginAPI
) {
rc.preserveEntrySignatures('strict')
// node resolve commonjs
rc.plugin('nodeResolve').use(nodeResolve, {
mainFields: ['jsnext:main', 'module', 'main'],
Expand Down
2 changes: 0 additions & 2 deletions packages/plugin-cmd-roll-lib/src/resolveConfig/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ export async function generateBuildOps(
buildLogger.debug(`rollup config input `, rollupConfig.input)
buildLogger.debug(`resolved config input `, resolvedConfig.entry)
const { output, ...inputOps } = rollupConfig
// TODO: support from rollup-chain
inputOps.preserveEntrySignatures = 'strict'
// input to absolute
if (!inputOps.input && !resolvedConfig.entry) {
const fileMeta = getFileMeta({
Expand Down
12 changes: 10 additions & 2 deletions packages/preset-built-in/src/plugin/command/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export default createPlugin({
desc: 'a command for release package',
usage: `xus release --tag pkgname@1.1.1`,
options: {
'--tag': 'point release tag'
'--tag': 'point release tag',
'--pkgs': 'point release pkgs'
}
},
async (args) => {
Expand All @@ -39,7 +40,14 @@ export default createPlugin({
...releaseConfig
}
if (isLerna) {
const pkgs = api.getLernaPkgs()
let pkgs = api.getLernaPkgs()
if (args?.pkgs) {
const points = (args.pkgs as string).split(',')
pkgs = pkgs
.map((p) => relative(ops.packageRoot, p))
.filter((p) => points.includes(p))
.map((p) => join(ops.packageRoot, p))
}
await release(pkgs, ops)
} else {
await release([api.cwd], ops)
Expand Down

0 comments on commit a42c9a7

Please sign in to comment.