@eldrforge/kodrdriv 1.2.7 → 1.2.10-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,261 +1,280 @@
1
1
  #!/usr/bin/env node
2
2
  import { getDryRunLogger } from '../logging.js';
3
- import { create } from '../util/storage.js';
4
- import { safeJsonParse, validatePackageJson } from '../util/validation.js';
5
- import { run, validateGitRef, runSecure } from '../util/child.js';
6
- import { safeSyncBranchWithRemote, localBranchExists } from '../util/git.js';
7
- import { incrementPatchVersion, incrementMinorVersion, incrementMajorVersion, validateVersionString } from '../util/general.js';
8
- import { ensureMilestoneForVersion } from '../util/github.js';
9
- import { execute as execute$1 } from './commit.js';
3
+ import { run } from '../util/child.js';
4
+ import { getCurrentBranch, localBranchExists } from '../util/git.js';
5
+ import { findDevelopmentBranch } from '../util/general.js';
6
+ import { KODRDRIV_DEFAULTS } from '../constants.js';
10
7
 
11
- /**
12
- * Parse version string to get numeric components for comparison
13
- */ function parseVersion(version) {
14
- const cleanVersion = version.startsWith('v') ? version.slice(1) : version;
15
- const parts = cleanVersion.split('.');
16
- if (parts.length < 3) {
17
- throw new Error(`Invalid version format: ${version}`);
18
- }
19
- const major = parseInt(parts[0], 10);
20
- const minor = parseInt(parts[1], 10);
21
- // Handle patch with potential prerelease
22
- const patchPart = parts[2];
23
- const patchComponents = patchPart.split('-');
24
- const patch = parseInt(patchComponents[0], 10);
25
- const prerelease = patchComponents.length > 1 ? patchComponents.slice(1).join('-') : undefined;
26
- if (isNaN(major) || isNaN(minor) || isNaN(patch)) {
27
- throw new Error(`Invalid version numbers in: ${version}`);
28
- }
29
- return {
30
- major,
31
- minor,
32
- patch,
33
- prerelease
34
- };
35
- }
36
- /**
37
- * Compare two versions to determine if first is greater than second
38
- */ function isVersionGreater(version1, version2) {
39
- const v1 = parseVersion(version1);
40
- const v2 = parseVersion(version2);
41
- if (v1.major !== v2.major) return v1.major > v2.major;
42
- if (v1.minor !== v2.minor) return v1.minor > v2.minor;
43
- if (v1.patch !== v2.patch) return v1.patch > v2.patch;
44
- // If versions are equal up to patch, check prerelease
45
- // No prerelease is considered greater than prerelease
46
- if (!v1.prerelease && v2.prerelease) return true;
47
- if (v1.prerelease && !v2.prerelease) return false;
48
- // Both have prerelease or both don't - consider equal for our purposes
49
- return false;
50
- }
51
- /**
52
- * Create a development version from a release version
53
- */ function createDevelopmentVersion(version, targetVersion = 'patch') {
54
- let baseVersion;
55
- const targetLower = targetVersion.toLowerCase();
56
- if (targetLower === 'patch') {
57
- baseVersion = incrementPatchVersion(version);
58
- } else if (targetLower === 'minor') {
59
- baseVersion = incrementMinorVersion(version);
60
- } else if (targetLower === 'major') {
61
- baseVersion = incrementMajorVersion(version);
62
- } else {
63
- // Assume it's an explicit version string
64
- if (validateVersionString(targetVersion)) {
65
- baseVersion = targetVersion.startsWith('v') ? targetVersion.slice(1) : targetVersion;
66
- } else {
67
- throw new Error(`Invalid target version: ${targetVersion}. Expected "patch", "minor", "major", or a valid version string like "2.1.0"`);
68
- }
69
- }
70
- return `${baseVersion}-dev.0`;
71
- }
72
- /**
73
- * Get current branch name
74
- */ async function getCurrentBranch() {
75
- const { stdout } = await run('git branch --show-current');
76
- return stdout.trim();
77
- }
78
- /**
79
- * Get package.json version from a specific branch
80
- */ async function getVersionFromBranch(branchName) {
81
- try {
82
- // Validate branch name to prevent injection
83
- if (!validateGitRef(branchName)) {
84
- throw new Error(`Invalid branch name: ${branchName}`);
85
- }
86
- const { stdout } = await runSecure('git', [
87
- 'show',
88
- `${branchName}:package.json`
89
- ]);
90
- const packageJson = safeJsonParse(stdout, 'package.json');
91
- const validated = validatePackageJson(packageJson, 'package.json');
92
- return validated.version;
93
- } catch (error) {
94
- throw new Error(`Failed to get version from branch ${branchName}: ${error}`);
95
- }
96
- }
97
- /**
98
- * Analyze current state and determine what actions need to be taken
99
- */ async function analyzeVersionState() {
100
- const currentBranch = await getCurrentBranch();
101
- const workingBranchExists = await localBranchExists('working');
102
- // Get current version from working directory
103
- const storage = create({
104
- log: ()=>{}
105
- });
106
- const packageJsonContents = await storage.readFile('package.json', 'utf-8');
107
- const packageJson = safeJsonParse(packageJsonContents, 'package.json');
108
- const validated = validatePackageJson(packageJson, 'package.json');
109
- const currentVersion = validated.version;
110
- // Get version from main branch
111
- const mainVersion = await getVersionFromBranch('main');
112
- // Get version from working branch if it exists
113
- let workingVersion;
114
- if (workingBranchExists) {
115
- try {
116
- workingVersion = await getVersionFromBranch('working');
117
- } catch {
118
- // Working branch exists but doesn't have package.json or it's malformed
119
- workingVersion = undefined;
120
- }
121
- }
122
- const needsVersionBump = workingBranchExists && workingVersion ? !isVersionGreater(workingVersion, mainVersion) : !isVersionGreater(currentVersion, mainVersion);
123
- return {
124
- currentVersion,
125
- mainVersion,
126
- workingVersion,
127
- needsVersionBump,
128
- isOnMain: currentBranch === 'main',
129
- isOnWorking: currentBranch === 'working',
130
- workingBranchExists
131
- };
132
- }
133
8
  /**
134
9
  * Execute the development command
135
10
  */ const execute = async (runConfig)=>{
136
11
  const isDryRun = runConfig.dryRun || false;
137
12
  const logger = getDryRunLogger(isDryRun);
138
- const storage = create({
139
- log: logger.debug
140
- });
141
- logger.info('🔄 Setting up development environment...');
13
+ logger.info('🔄 Navigating to working branch for active development...');
142
14
  try {
143
15
  var _runConfig_development;
144
- // Analyze current state
145
- const state = await analyzeVersionState();
146
- logger.debug('Version state analysis:', state);
147
- // If we're already on working and everything is set up correctly, do nothing
148
- if (state.isOnWorking && !state.needsVersionBump) {
149
- logger.info('✅ Already on working branch with proper development version');
150
- logger.info(`Current version: ${state.currentVersion}`);
151
- return 'Already on working branch with development version';
16
+ // Get current branch
17
+ const currentBranch = isDryRun ? 'mock-branch' : await getCurrentBranch();
18
+ logger.info(`📍 Currently on branch: ${currentBranch}`);
19
+ // Find the working/development branch from configuration
20
+ let workingBranch = 'working'; // Default fallback
21
+ if (runConfig.branches) {
22
+ const configuredDevBranch = findDevelopmentBranch(runConfig.branches);
23
+ if (configuredDevBranch) {
24
+ workingBranch = configuredDevBranch;
25
+ logger.info(`đŸŽ¯ Found configured working branch: ${workingBranch}`);
26
+ } else {
27
+ logger.info(`đŸŽ¯ No working branch configured, using default: ${workingBranch}`);
28
+ }
29
+ } else {
30
+ logger.info(`đŸŽ¯ No branch configuration found, using default working branch: ${workingBranch}`);
152
31
  }
153
- // If we're on working but need version bump (shouldn't happen in normal workflow)
154
- if (state.isOnWorking && state.needsVersionBump) {
155
- logger.warn('âš ī¸ On working branch but version needs update. This suggests an unusual state.');
156
- logger.info('Proceeding with version bump...');
32
+ // Track what actions are taken to determine the appropriate return message
33
+ let branchCreated = false;
34
+ let branchUpdated = false;
35
+ let alreadyOnBranch = false;
36
+ let mergedDevelopmentIntoWorking = false;
37
+ // Determine prerelease tag and increment level from configuration
38
+ const allBranchConfig = runConfig.branches || KODRDRIV_DEFAULTS.branches;
39
+ let prereleaseTag = 'dev'; // Default
40
+ let incrementLevel = 'patch'; // Default
41
+ // Check for development command specific targetVersion override
42
+ if ((_runConfig_development = runConfig.development) === null || _runConfig_development === void 0 ? void 0 : _runConfig_development.targetVersion) {
43
+ const targetVersion = runConfig.development.targetVersion;
44
+ // Validate targetVersion
45
+ if (![
46
+ 'patch',
47
+ 'minor',
48
+ 'major'
49
+ ].includes(targetVersion) && !/^\d+\.\d+\.\d+$/.test(targetVersion.replace(/^v/, ''))) {
50
+ throw new Error(`Invalid target version: ${targetVersion}. Expected "patch", "minor", "major", or a valid version string like "2.1.0"`);
51
+ }
52
+ incrementLevel = targetVersion;
53
+ } else if (allBranchConfig && allBranchConfig[workingBranch]) {
54
+ const workingBranchConfig = allBranchConfig[workingBranch];
55
+ if (workingBranchConfig.version) {
56
+ if (workingBranchConfig.version.tag) {
57
+ prereleaseTag = workingBranchConfig.version.tag;
58
+ }
59
+ if (workingBranchConfig.version.incrementLevel) {
60
+ incrementLevel = workingBranchConfig.version.incrementLevel;
61
+ }
62
+ }
63
+ }
64
+ logger.info(`đŸˇī¸ Using prerelease tag: ${prereleaseTag}`);
65
+ logger.info(`📈 Using increment level: ${incrementLevel}`);
66
+ // Step 1: Fetch latest remote information
67
+ if (!isDryRun) {
68
+ logger.info('📡 Fetching latest remote information...');
69
+ try {
70
+ await run('git fetch origin');
71
+ logger.info('✅ Fetched latest remote information');
72
+ } catch (error) {
73
+ logger.warn(`âš ī¸ Could not fetch from remote: ${error.message}`);
74
+ }
75
+ } else {
76
+ logger.info('Would fetch latest remote information');
157
77
  }
158
- // Ensure we're on main if not on working, or switch to main to start process
159
- if (!state.isOnWorking) {
78
+ // Special case: If currently on development branch, merge development into working
79
+ if (currentBranch === 'development') {
160
80
  if (!isDryRun) {
161
- logger.info('Switching to main branch...');
162
- await run('git checkout main');
163
- // Sync main with remote to ensure we're up to date
164
- logger.info('Syncing main branch with remote...');
165
- const syncResult = await safeSyncBranchWithRemote('main');
166
- if (!syncResult.success) {
167
- if (syncResult.conflictResolutionRequired) {
168
- throw new Error(`Main branch has diverged from remote and requires manual conflict resolution: ${syncResult.error}`);
169
- }
170
- logger.warn(`Warning: Could not sync main with remote: ${syncResult.error}`);
81
+ logger.info('🔄 Currently on development branch, merging into working...');
82
+ await run(`git checkout ${workingBranch}`);
83
+ await run(`git merge development --no-ff -m "Merge development into working for continued development"`);
84
+ await run('npm install');
85
+ // Check if npm install created any changes and commit them
86
+ const gitStatus = await run('git status --porcelain');
87
+ if (gitStatus.stdout.trim()) {
88
+ await run('git add -A');
89
+ await run('git commit -m "chore: update package-lock.json after merge"');
171
90
  }
91
+ await run('git checkout development');
92
+ mergedDevelopmentIntoWorking = true;
172
93
  } else {
173
- logger.info('Would switch to main branch and sync with remote');
94
+ logger.info('Would merge development into working and switch to development branch');
95
+ mergedDevelopmentIntoWorking = true;
174
96
  }
175
97
  }
176
- // Create working branch if it doesn't exist
177
- if (!state.workingBranchExists) {
178
- if (!isDryRun) {
179
- logger.info('Creating working branch from main...');
180
- await run('git checkout -b working');
98
+ // Step 2: Switch to working branch (create if needed) - skip if we handled development branch case
99
+ if (!isDryRun && !mergedDevelopmentIntoWorking) {
100
+ const workingBranchExists = await localBranchExists(workingBranch);
101
+ if (!workingBranchExists) {
102
+ logger.info(`🌟 Working branch '${workingBranch}' doesn't exist, creating it...`);
103
+ await run(`git checkout -b ${workingBranch}`);
104
+ logger.info(`✅ Created and switched to ${workingBranch}`);
105
+ branchCreated = true;
106
+ } else if (currentBranch !== workingBranch) {
107
+ logger.info(`🔄 Switching to ${workingBranch}...`);
108
+ await run(`git checkout ${workingBranch}`);
109
+ logger.info(`✅ Switched to ${workingBranch}`);
110
+ branchUpdated = true;
181
111
  } else {
182
- logger.info('Would create working branch from main');
112
+ logger.info(`✅ Already on working branch: ${workingBranch}`);
113
+ alreadyOnBranch = true;
183
114
  }
184
- } else {
185
- // Working branch exists, merge main to working
186
- if (!isDryRun) {
187
- logger.info('Switching to working branch...');
188
- await run('git checkout working');
189
- logger.info('Merging main into working branch...');
190
- try {
191
- await run('git merge main --no-ff -m "Merge main into working for development"');
192
- } catch (error) {
193
- throw new Error(`Failed to merge main into working. Please resolve conflicts manually: ${error}`);
194
- }
115
+ } else if (!mergedDevelopmentIntoWorking) {
116
+ // For dry run, we need to mock the logic
117
+ const workingBranchExists = await localBranchExists(workingBranch);
118
+ if (!workingBranchExists) {
119
+ branchCreated = true;
120
+ } else if (currentBranch !== workingBranch) {
121
+ branchUpdated = true;
195
122
  } else {
196
- logger.info('Would switch to working branch and merge main into working');
123
+ alreadyOnBranch = true;
197
124
  }
125
+ logger.info(`Would switch to ${workingBranch} branch (creating if needed)`);
126
+ logger.info(`Would sync ${workingBranch} with remote to avoid conflicts`);
198
127
  }
199
- // Bump version to development version if needed
200
- if (state.needsVersionBump || !state.workingBranchExists) {
201
- var _runConfig_development1, _runConfig_development2;
202
- const targetVersion = ((_runConfig_development1 = runConfig.development) === null || _runConfig_development1 === void 0 ? void 0 : _runConfig_development1.targetVersion) || 'patch';
203
- const newDevVersion = createDevelopmentVersion(state.mainVersion, targetVersion);
204
- logger.info(`Bumping version from ${state.mainVersion} to ${newDevVersion}`);
205
- // Extract the base version for milestone management (e.g., "1.3.2" from "1.3.2-dev.0")
206
- const baseVersion = newDevVersion.split('-')[0];
207
- const milestonesEnabled = !((_runConfig_development2 = runConfig.development) === null || _runConfig_development2 === void 0 ? void 0 : _runConfig_development2.noMilestones);
208
- if (!isDryRun) {
209
- // Update package.json
210
- const packageJsonContents = await storage.readFile('package.json', 'utf-8');
211
- const packageJson = safeJsonParse(packageJsonContents, 'package.json');
212
- const validated = validatePackageJson(packageJson, 'package.json');
213
- validated.version = newDevVersion;
214
- await storage.writeFile('package.json', JSON.stringify(validated, null, 2), 'utf-8');
215
- // Run npm install to update lock files
216
- logger.info('Running npm install to update lock files...');
217
- await run('npm install');
218
- // Handle GitHub milestones if enabled
219
- if (milestonesEnabled) {
220
- logger.info('🏁 Managing GitHub milestones...');
221
- try {
222
- await ensureMilestoneForVersion(baseVersion, state.mainVersion);
223
- } catch (error) {
224
- logger.warn(`âš ī¸ Milestone management failed (continuing): ${error.message}`);
225
- }
128
+ // Step 2.1: Sync with remote working branch to avoid conflicts
129
+ if (!isDryRun) {
130
+ try {
131
+ logger.info(`🔄 Syncing ${workingBranch} with remote to avoid conflicts...`);
132
+ const remoteExists = await run(`git ls-remote --exit-code --heads origin ${workingBranch}`).then(()=>true).catch(()=>false);
133
+ if (remoteExists) {
134
+ await run(`git pull origin ${workingBranch} --no-edit`);
135
+ logger.info(`✅ Synced ${workingBranch} with remote`);
226
136
  } else {
227
- logger.debug('Milestone integration disabled via --no-milestones');
137
+ logger.info(`â„šī¸ No remote ${workingBranch} branch found, will be created on first push`);
228
138
  }
229
- // Commit the changes using kodrdriv commit
230
- logger.info('Committing development version changes...');
231
- const commitSummary = await execute$1({
232
- ...runConfig,
233
- commit: {
234
- ...runConfig.commit,
235
- add: true,
236
- sendit: true
139
+ } catch (error) {
140
+ if (error.message && error.message.includes('CONFLICT')) {
141
+ logger.error(`❌ Merge conflicts detected when syncing ${workingBranch} with remote`);
142
+ logger.error(` Please resolve the conflicts manually and then run:`);
143
+ logger.error(` 1. Resolve conflicts in the files`);
144
+ logger.error(` 2. git add <resolved-files>`);
145
+ logger.error(` 3. git commit`);
146
+ logger.error(` 4. kodrdriv development (to continue)`);
147
+ throw new Error(`Merge conflicts detected when syncing ${workingBranch} with remote. Please resolve conflicts manually.`);
148
+ } else {
149
+ logger.warn(`âš ī¸ Could not sync with remote ${workingBranch}: ${error.message}`);
150
+ }
151
+ }
152
+ }
153
+ // Step 3: Merge latest changes from development branch if it exists
154
+ if (!isDryRun) {
155
+ const developmentBranchExists = await localBranchExists('development');
156
+ if (developmentBranchExists) {
157
+ logger.info('🔄 Merging latest changes from development branch...');
158
+ try {
159
+ await run(`git merge development --no-ff -m "Merge latest development changes into ${workingBranch}"`);
160
+ logger.info('✅ Successfully merged development changes');
161
+ // Run npm install after merge to update dependencies
162
+ logger.info('đŸ“Ļ Running npm install after merge...');
163
+ await run('npm install');
164
+ // Check if npm install created any changes (e.g., package-lock.json)
165
+ const gitStatus = await run('git status --porcelain');
166
+ if (gitStatus.stdout.trim()) {
167
+ logger.info('📝 Committing changes from npm install...');
168
+ await run('git add -A');
169
+ await run(`git commit -m "chore: update package-lock.json after merge"`);
170
+ logger.info('✅ Changes committed');
171
+ }
172
+ } catch (error) {
173
+ if (error.message && error.message.includes('CONFLICT')) {
174
+ logger.error(`❌ Merge conflicts detected when merging development into ${workingBranch}`);
175
+ logger.error(` Please resolve the conflicts manually and then run:`);
176
+ logger.error(` 1. Resolve conflicts in the files`);
177
+ logger.error(` 2. git add <resolved-files>`);
178
+ logger.error(` 3. git commit`);
179
+ logger.error(` 4. npm install`);
180
+ logger.error(` 5. npm version pre${incrementLevel} --preid=${prereleaseTag}`);
181
+ throw new Error(`Merge conflicts detected when merging development into ${workingBranch}. Please resolve conflicts manually.`);
182
+ } else {
183
+ logger.error(`❌ Failed to merge development into ${workingBranch}: ${error.message}`);
184
+ throw error;
237
185
  }
238
- });
239
- logger.debug('Commit result:', commitSummary);
186
+ }
187
+ } else if (!developmentBranchExists) {
188
+ logger.info('â„šī¸ Development branch does not exist, skipping merge step');
240
189
  } else {
241
- logger.info(`Would update package.json version to ${newDevVersion}`);
242
- logger.info('Would run npm install');
243
- if (milestonesEnabled) {
244
- logger.info(`Would manage GitHub milestones for version ${baseVersion}`);
245
- logger.info(`Would ensure milestone: release/${baseVersion}`);
246
- logger.info(`Would move open issues from release/${state.mainVersion} if it exists and is closed`);
190
+ logger.info('â„šī¸ Already merged from development (was on development branch)');
191
+ }
192
+ } else {
193
+ logger.info('Would merge latest changes from development branch if it exists');
194
+ logger.info('Would run npm install after merge');
195
+ logger.info('Would commit any changes from npm install (e.g., package-lock.json)');
196
+ }
197
+ // Step 5: Check if we already have a proper development version
198
+ if (alreadyOnBranch && !mergedDevelopmentIntoWorking) {
199
+ // Check if current version is already a development version with the right tag
200
+ const fs = await import('fs/promises');
201
+ try {
202
+ const packageJson = JSON.parse(await fs.readFile('package.json', 'utf-8'));
203
+ const currentVersion = packageJson.version;
204
+ // If current version already has the dev tag, we're done
205
+ if (currentVersion.includes(`-${prereleaseTag}.`)) {
206
+ logger.info(`✅ Already on working branch with development version ${currentVersion}`);
207
+ return 'Already on working branch with development version';
208
+ }
209
+ } catch (error) {
210
+ logger.debug('Could not check current version, proceeding with version bump');
211
+ }
212
+ }
213
+ // Step 5: Run npm version to bump version with increment level
214
+ let versionCommand;
215
+ if ([
216
+ 'patch',
217
+ 'minor',
218
+ 'major'
219
+ ].includes(incrementLevel)) {
220
+ versionCommand = `pre${incrementLevel}`;
221
+ logger.info(`🚀 Bumping ${incrementLevel} version with prerelease tag '${prereleaseTag}'...`);
222
+ } else {
223
+ // Explicit version like "3.5.0"
224
+ const cleanVersion = incrementLevel.replace(/^v/, '');
225
+ versionCommand = `${cleanVersion}-${prereleaseTag}.0`;
226
+ logger.info(`🚀 Setting explicit version ${versionCommand}...`);
227
+ }
228
+ if (!isDryRun) {
229
+ try {
230
+ const versionResult = [
231
+ 'patch',
232
+ 'minor',
233
+ 'major'
234
+ ].includes(incrementLevel) ? await run(`npm version ${versionCommand} --preid=${prereleaseTag}`) : await run(`npm version ${versionCommand}`);
235
+ const newVersion = versionResult.stdout.trim();
236
+ logger.info(`✅ Version bumped to: ${newVersion}`);
237
+ // Return appropriate message based on what actions were taken
238
+ if (mergedDevelopmentIntoWorking) {
239
+ return 'Merged development into working and switched to development branch';
240
+ } else if (branchCreated) {
241
+ return 'Created working branch with development version';
242
+ } else if (branchUpdated) {
243
+ return 'Updated working branch with development version';
244
+ } else if (alreadyOnBranch) {
245
+ return 'Already on working branch with development version';
247
246
  } else {
248
- logger.info('Would skip milestone management (--no-milestones)');
247
+ return `Ready for development on ${workingBranch} with version ${newVersion}`;
249
248
  }
250
- logger.info('Would commit changes with kodrdriv commit');
249
+ } catch (error) {
250
+ logger.error(`❌ Failed to bump version: ${error.message}`);
251
+ throw new Error(`Failed to bump ${incrementLevel} version: ${error.message}`);
252
+ }
253
+ } else {
254
+ if ([
255
+ 'patch',
256
+ 'minor',
257
+ 'major'
258
+ ].includes(incrementLevel)) {
259
+ logger.info(`Would run: npm version ${versionCommand} --preid=${prereleaseTag}`);
260
+ } else {
261
+ logger.info(`Would run: npm version ${versionCommand}`);
262
+ }
263
+ // Return appropriate message based on what actions were taken
264
+ if (mergedDevelopmentIntoWorking) {
265
+ return 'Merged development into working and switched to development branch';
266
+ } else if (branchCreated) {
267
+ return 'Created working branch with development version';
268
+ } else if (branchUpdated) {
269
+ return 'Updated working branch with development version';
270
+ } else if (alreadyOnBranch) {
271
+ return 'Already on working branch with development version';
272
+ } else {
273
+ return `Ready for development on ${workingBranch} (dry run)`;
251
274
  }
252
275
  }
253
- const finalMessage = state.workingBranchExists ? 'Updated working branch with development version' : 'Created working branch with development version';
254
- logger.info(`✅ ${finalMessage}`);
255
- logger.info(`Development version: ${state.needsVersionBump || !state.workingBranchExists ? createDevelopmentVersion(state.mainVersion, ((_runConfig_development = runConfig.development) === null || _runConfig_development === void 0 ? void 0 : _runConfig_development.targetVersion) || 'patch') : state.currentVersion}`);
256
- return finalMessage;
257
276
  } catch (error) {
258
- logger.error('Failed to set up development environment:', error.message);
277
+ logger.error('Failed to prepare working branch for development:', error.message);
259
278
  throw error;
260
279
  }
261
280
  };