Skip to content

Commit 9815353

Browse files
author
zhisai.szs
committed
fix: npm publish
1 parent e784e96 commit 9815353

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

src/built-in-plugins/command-build/plugin/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pri.commands.registerCommand({
2929
description: 'Skip lint',
3030
},
3131
skipEnsureFiles: {
32-
description: 'Skip skipEnsureFiles',
32+
description: 'Skip ensureFiles',
3333
},
3434
},
3535
description: text.commander.build.description,

src/built-in-plugins/command-publish/plugin/run-publish.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ import { README_FILE } from '../../../utils/constants';
2121

2222
export const publish = async (options: PublishOption) => {
2323
const currentBranchName = options.branch ? options.branch : await getCurrentBranchName();
24-
const isDevelopBranch = ['master', 'develop'].includes(currentBranchName);
24+
const developBranchConfig = _.get(pri.projectConfig, 'customEnv.developBranchConfig.publishBranch', []);
25+
const isDevelopBranch = ['master', 'develop', ...developBranchConfig].includes(currentBranchName);
2526

2627
switch (pri.sourceConfig.type) {
2728
case 'component':
@@ -404,7 +405,7 @@ async function moveSourceFilesToTempFolderAndPublish(
404405
finalTag = 'beta';
405406
}
406407

407-
await exec(`${targetConfig.npmClient} publish ${tempRoot} --ignore-scripts --silent --tag ${finalTag}`, {
408+
await exec(`${targetConfig.npmClient} publish ${tempRoot} --ignore-scripts --tag ${finalTag}`, {
408409
cwd: tempRoot,
409410
});
410411

src/utils/define.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,11 @@ export class ProjectConfig {
352352
* Disable dashboard ui
353353
*/
354354
public disableDashboard: boolean;
355+
356+
/**
357+
* Publish config for npm publish
358+
*/
359+
public publishConfig?: IPublishConfig;
355360
}
356361

357362
export type SetPipe = (pipeName: string, callback: PipeCallback) => void;
@@ -396,3 +401,8 @@ export type IDevDllList = (list: string[]) => string[];
396401
export type IJestConfigPipe = (options: any) => any;
397402

398403
export type IAfterTestRun = (result?: any) => any;
404+
405+
export interface IPublishConfig {
406+
// Allow publish branch
407+
publishBranch?: string;
408+
}

0 commit comments

Comments
 (0)