@grunnverk/commands-publish 1.0.0 → 1.5.1

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.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { getDryRunLogger, findDevelopmentBranch, KODRDRIV_DEFAULTS, incrementPatchVersion, incrementMajorVersion, incrementMinorVersion, DEFAULT_TO_COMMIT_ALIAS, Log, DEFAULT_MAX_DIFF_BYTES, Diff, DEFAULT_EXCLUDED_PATTERNS, DEFAULT_OUTPUT_DIRECTORY, toAIConfig, createStorageAdapter, createLoggerAdapter, getOutputPath, getTimestampedResponseFilename, getTimestampedRequestFilename, filterContent, getTimestampedReleaseNotesFilename, improveContentWithLLM, validateReleaseSummary, runGitWithLock, calculateBranchDependentVersion, checkIfTagExists, confirmVersionInteractively, getLogger, ValidationError } from '@grunnverk/core';
2
2
  import { getCurrentBranch, run, localBranchExists, safeJsonParse, validatePackageJson, getDefaultFromRef, remoteBranchExists, runSecure, runWithDryRunSupport, validateGitRef, safeSyncBranchWithRemote, isBranchInSyncWithRemote } from '@grunnverk/git-tools';
3
- import { createStorage, calculateTargetVersion } from '@grunnverk/shared';
3
+ import { createStorage, calculateTargetVersion, incrementPatchVersion as incrementPatchVersion$1 } from '@grunnverk/shared';
4
4
  import path from 'path';
5
5
  import * as Commit from '@grunnverk/commands-git';
6
6
  import { Formatter } from '@riotprompt/riotprompt';
@@ -2413,7 +2413,11 @@ const execute = async (runConfig)=>{
2413
2413
  const currentVer = validatedPkgJson.version;
2414
2414
  // Import incrementPrereleaseVersion from core
2415
2415
  const { incrementPrereleaseVersion } = await import('@grunnverk/core');
2416
- const newVersion = incrementPrereleaseVersion(currentVer, versionTag);
2416
+ // After publishing a release version, we need to increment the patch first,
2417
+ // then add the prerelease tag. This ensures we don't go back to the same dev version.
2418
+ // Example: 1.0.1-dev.0 -> publish 1.0.1 -> increment to 1.0.2-dev.0 (not 1.0.1-dev.0)
2419
+ const incrementedPatchVersion = incrementPatchVersion$1(currentVer);
2420
+ const newVersion = incrementPrereleaseVersion(incrementedPatchVersion, versionTag);
2417
2421
  // Update package.json with new version
2418
2422
  validatedPkgJson.version = newVersion;
2419
2423
  await storage.writeFile('package.json', JSON.stringify(validatedPkgJson, null, 2) + '\n', 'utf-8');