diff --git a/.oxrls/pre.json b/.oxrls/pre.json index 821cd1e..005cd4b 100644 --- a/.oxrls/pre.json +++ b/.oxrls/pre.json @@ -2,7 +2,7 @@ "pre_versions": { "@bdbchgg/oxrls": { "tag": "alpha", - "count": 4 + "count": 5 } } } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ece569..bcb6725 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ ### Patch Changes +- **@bdbchgg/oxrls** (v1.0.0-alpha.5): Fixed a bug where a pre-version would not correctly bump it's version on the first pre-version + +## 2026-05-23 + +### Patch Changes + - **@bdbchgg/oxrls** (v1.0.0-alpha.4): Fixed a bug that caused the binary not to be included with the bundle ## 2026-05-22 diff --git a/Cargo.toml b/Cargo.toml index 9136cd9..30868ab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ authors = ["Dominik Biedebach "] edition = "2024" name = "oxrls" -version = "1.0.0-alpha.4" +version = "1.0.0-alpha.5" [lib] crate-type = ["cdylib", "rlib"] diff --git a/package.json b/package.json index f32b581..8efd450 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bdbchgg/oxrls", - "version": "1.0.0-alpha.4", + "version": "1.0.0-alpha.5", "ava": { "environmentVariables": { "OXC_TSCONFIG_PATH": "./__test__/tsconfig.json" @@ -58,6 +58,12 @@ "aarch64-apple-darwin" ] }, + "optionalDependencies": { + "@bdbchgg/oxrls-darwin-arm64": "1.0.0-alpha.4", + "@bdbchgg/oxrls-darwin-x64": "1.0.0-alpha.4", + "@bdbchgg/oxrls-linux-x64-gnu": "1.0.0-alpha.4", + "@bdbchgg/oxrls-win32-x64-msvc": "1.0.0-alpha.4" + }, "packageManager": "yarn@4.14.1", "publishConfig": { "access": "public", diff --git a/src/bump.rs b/src/bump.rs index 44c80c7..0ea83a7 100644 --- a/src/bump.rs +++ b/src/bump.rs @@ -105,13 +105,24 @@ pub fn build_release_plan( let old_version = pkg.package_json.semver_version()?; // Apply pre-release tag if the package is in pre-mode - // When already in pre-release, keep the base version and just increment the counter + // On the FIRST pre-release bump (count == 1), apply the bump type + // to the base version before adding the pre-release tag. + // Subsequent bumps only increment the pre-release counter. let new_version = if let Some((tag, count)) = resolve_pre_release(pkg_name, config, &mut pre_state, workspace) { - // Strip pre-release suffix, use the base version, then re-apply with new counter - let base = semver::Version::new(old_version.major, old_version.minor, old_version.patch); - apply_pre_release(&base, &tag, count) + if count == 1 { + // First pre-release: bump the base version, then add pre-release tag + let bumped = bump_version(&old_version, *bump_type); + let base = + semver::Version::new(bumped.major, bumped.minor, bumped.patch); + apply_pre_release(&base, &tag, count) + } else { + // Subsequent pre-release: keep the base version, just increment counter + let base = + semver::Version::new(old_version.major, old_version.minor, old_version.patch); + apply_pre_release(&base, &tag, count) + } } else { // Normal bump — not in pre-release mode bump_version(&old_version, *bump_type) @@ -1040,7 +1051,7 @@ Fix bug."#; let core = plan.bumps.get("@scope/core").unwrap(); // Should be 1.2.4-beta.1 instead of 1.2.4 - assert_eq!(core.new_version.to_string(), "1.2.3-beta.1"); + assert_eq!(core.new_version.to_string(), "1.2.4-beta.1"); // Second bump should increment the counter let content2 = r#"--- @@ -1082,7 +1093,7 @@ Breaking change."#; let core = plan.bumps.get("@scope/core").unwrap(); // Major bump from 1.2.3 -> 2.0.0-rc.1 - assert_eq!(core.new_version.to_string(), "1.2.3-rc.1"); + assert_eq!(core.new_version.to_string(), "2.0.0-rc.1"); assert_eq!(core.old_version.to_string(), "1.2.3"); } @@ -1113,7 +1124,7 @@ Multiple changes."#; let plan = build_release_plan(&workspace, &config, &release_dir, false).unwrap(); let core = plan.bumps.get("@scope/core").unwrap(); - assert_eq!(core.new_version.to_string(), "1.2.3-beta.1"); + assert_eq!(core.new_version.to_string(), "1.2.4-beta.1"); let react = plan.bumps.get("@scope/react").unwrap(); assert_eq!(react.new_version.to_string(), "1.1.0"); // no pre-release diff --git a/yarn.lock b/yarn.lock index 5cf60d3..9a7e3cf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,10 +5,42 @@ __metadata: version: 9 cacheKey: 10c0 +"@bdbchgg/oxrls-darwin-arm64@npm:1.0.0-alpha.4": + version: 1.0.0-alpha.4 + resolution: "@bdbchgg/oxrls-darwin-arm64@npm:1.0.0-alpha.4" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@bdbchgg/oxrls-darwin-x64@npm:1.0.0-alpha.4": + version: 1.0.0-alpha.4 + resolution: "@bdbchgg/oxrls-darwin-x64@npm:1.0.0-alpha.4" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@bdbchgg/oxrls-linux-x64-gnu@npm:1.0.0-alpha.4": + version: 1.0.0-alpha.4 + resolution: "@bdbchgg/oxrls-linux-x64-gnu@npm:1.0.0-alpha.4" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@bdbchgg/oxrls-win32-x64-msvc@npm:1.0.0-alpha.4": + version: 1.0.0-alpha.4 + resolution: "@bdbchgg/oxrls-win32-x64-msvc@npm:1.0.0-alpha.4" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@bdbchgg/oxrls@workspace:.": version: 0.0.0-use.local resolution: "@bdbchgg/oxrls@workspace:." dependencies: + "@bdbchgg/oxrls-darwin-arm64": "npm:1.0.0-alpha.4" + "@bdbchgg/oxrls-darwin-x64": "npm:1.0.0-alpha.4" + "@bdbchgg/oxrls-linux-x64-gnu": "npm:1.0.0-alpha.4" + "@bdbchgg/oxrls-win32-x64-msvc": "npm:1.0.0-alpha.4" "@emnapi/core": "npm:^1.5.0" "@emnapi/runtime": "npm:^1.5.0" "@napi-rs/cli": "npm:^3.2.0" @@ -21,6 +53,15 @@ __metadata: tinybench: "npm:^6.0.0" typescript: "npm:^6.0.0" vite-plus: "npm:latest" + dependenciesMeta: + "@bdbchgg/oxrls-darwin-arm64": + optional: true + "@bdbchgg/oxrls-darwin-x64": + optional: true + "@bdbchgg/oxrls-linux-x64-gnu": + optional: true + "@bdbchgg/oxrls-win32-x64-msvc": + optional: true bin: oxrls: ./bin/oxrls.js languageName: unknown