fix: support Windows initial independent releases#64
Open
LouisMazel wants to merge 14 commits intomainfrom
Open
fix: support Windows initial independent releases#64LouisMazel wants to merge 14 commits intomainfrom
LouisMazel wants to merge 14 commits intomainfrom
Conversation
…tching
On Windows, `path.relative()` returns backslash-separated paths (e.g.
`packages\admin`) while `git log --name-status` always outputs forward
slashes (e.g. `packages/admin/src/main.ts`). The `String.includes()`
check therefore always returned `false` on win32, causing every package's
commit list to be empty in independent monorepo mode and relizy to report
"No packages to bump, no relevant commits found".
Fix both affected sites in `isCommitOfTrackedPackages` and `getPackageCommits`
by normalizing the `path.relative()` result with `.split(sep).join('/')`
before the `includes` comparison.
Fixes #52
Add `windows-path-separator.spec.ts` to verify that `getPackageCommits` correctly includes commits whose body contains forward-slash paths (as git always produces) even when `path.relative()` is simulated to return backslash-separated paths (win32 behavior). Four cases are covered: - commit touching the target package IS included - multiple commits touching the target package are all included - commit touching a different package is correctly excluded - commit with empty body (no path) is excluded The test mocks `node:path` so that `sep = '\\'` and `relative()` returns backslash paths, reproducing the exact win32 conditions that caused the "No packages to bump" error described in #52. Fixes #52
Add a new `monorepo.includePrivates` option that lets internal, non-published
packages participate in versioning and changelog generation. Private packages
get bumped alongside public ones, receive their own `CHANGELOG.md`, and their
commits land in the aggregated root changelog.
They remain safely excluded from `publish`, `provider-release`, and
`pr-comment` — versioned and documented, never pushed to a registry or
announced.
## Why
Monorepos often contain internal apps, examples, or private libraries that
still need proper version tracking and changelog history without ever being
published. Until now, relizy filtered those packages out of every pipeline
step. With `includePrivates`, you get full versioning and changelog coverage
for your private packages while keeping them out of the publish flow.
## Usage
Enable it in `relizy.config.ts`:
```ts
export default defineConfig({
monorepo: {
versionMode: 'selective',
packages: ['packages/*', 'apps/*'],
includePrivates: true,
},
})
```
Or from the CLI on `bump`, `changelog`, or `release`:
```bash
relizy release --minor --include-private
```
## Notes
- Opt-in: default behavior is unchanged.
- `ignorePackageNames` still takes precedence over `includePrivates`.
- The bump confirmation prompt marks private packages with a 🔒 badge.
- `publish`, `provider-release`, and `pr-comment` always ignore private
packages — this is a safety guarantee, not a toggle.
When in a prerelease cycle, Relizy now analyzes conventional commits to determine if the base version should increase. Previously, prerelease bumps always incremented the counter (e.g. 1.2.2-beta.0 → 1.2.2-beta.1) regardless of commit types. Now, if a `feat` commit is pushed after a patch-based beta, the base version correctly bumps to the next minor (e.g. 1.2.2-beta.1 → 1.3.0-beta.0). Similarly, a breaking change bumps to the next major (e.g. 1.3.0-beta.1 → 2.0.0-beta.0). The base version only goes up, never down — a `fix` after a minor-level beta simply increments the counter.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #64 +/- ##
===========================================
+ Coverage 77.73% 79.96% +2.22%
===========================================
Files 23 23
Lines 2520 2535 +15
Branches 727 734 +7
===========================================
+ Hits 1959 2027 +68
+ Misses 336 291 -45
+ Partials 225 217 -8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
96d5ba2 to
a8967ef
Compare
Owner
Author
🚀 Release published
Packages
Installationpnpm add relizy@1.3.0-canary.a8967ef.0or using the pnpm add relizy@canary |
a8967ef to
547f03e
Compare
Replace Unix shell pipelines (`grep`, `head`, `sed`) with cross-platform Node.js filtering for git tag lookups and add proper handling for first-release packages that have no baseline tag yet. - Tag resolution now uses a single `git tag --sort=-creatordate` call with in-process filtering and caching - Path separators normalized to POSIX in git commands - `rm` replaced with `fs.unlinkSync` - `process.chdir` removed in favor of `cwd` option - `isYarnBerry` now respects `config.cwd` - New `getBootstrapTag` helper for packages without prior tags - `NEW_PACKAGE_MARKER` handled consistently across changelog, GitHub and GitLab release flows Fixes : #52 #57 Co-authored-by: ruan-cat <1219043956@qq.com>
547f03e to
1fbdd06
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Related Issues