feat(cli): split commit and release into target-based workflows
This commit is contained in:
@@ -35,13 +35,11 @@ export class ReleaseConfig {
|
||||
public async load(): Promise<void> {
|
||||
const smartconfigInstance = new plugins.smartconfig.Smartconfig(this.cwd);
|
||||
const gitzoneConfig = smartconfigInstance.dataFor<any>('@git.zone/cli', {});
|
||||
|
||||
// Also check szci for backward compatibility
|
||||
const szciConfig = smartconfigInstance.dataFor<any>('@ship.zone/szci', {});
|
||||
const npmTarget = gitzoneConfig?.release?.targets?.npm || {};
|
||||
|
||||
this.config = {
|
||||
registries: gitzoneConfig?.release?.registries || [],
|
||||
accessLevel: gitzoneConfig?.release?.accessLevel || szciConfig?.npmAccessLevel || 'public',
|
||||
registries: npmTarget.registries || [],
|
||||
accessLevel: npmTarget.accessLevel || 'public',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -68,9 +66,18 @@ export class ReleaseConfig {
|
||||
smartconfigData['@git.zone/cli'].release = {};
|
||||
}
|
||||
|
||||
if (!smartconfigData['@git.zone/cli'].release.targets) {
|
||||
smartconfigData['@git.zone/cli'].release.targets = {};
|
||||
}
|
||||
|
||||
if (!smartconfigData['@git.zone/cli'].release.targets.npm) {
|
||||
smartconfigData['@git.zone/cli'].release.targets.npm = {};
|
||||
}
|
||||
|
||||
// Update registries and accessLevel
|
||||
smartconfigData['@git.zone/cli'].release.registries = this.config.registries;
|
||||
smartconfigData['@git.zone/cli'].release.accessLevel = this.config.accessLevel;
|
||||
smartconfigData['@git.zone/cli'].release.targets.npm.enabled = this.config.registries.length > 0;
|
||||
smartconfigData['@git.zone/cli'].release.targets.npm.registries = this.config.registries;
|
||||
smartconfigData['@git.zone/cli'].release.targets.npm.accessLevel = this.config.accessLevel;
|
||||
|
||||
// Write back to file
|
||||
await plugins.smartfs
|
||||
|
||||
Reference in New Issue
Block a user