Skip to content

fix: support Windows initial independent releases#64

Open
LouisMazel wants to merge 14 commits intomainfrom
fix/windows-support
Open

fix: support Windows initial independent releases#64
LouisMazel wants to merge 14 commits intomainfrom
fix/windows-support

Conversation

@LouisMazel
Copy link
Copy Markdown
Owner

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code style/UI update (formatting, renaming, etc; no functional changes)
  • Refactor (no functional changes, code improvements)
  • Documentation update
  • Tests (adding missing tests or correcting existing tests)
  • Build/CI related changes
  • Dependencies update
  • Performance improvements
  • Other (please describe):

Related Issues

ruan-cat and others added 13 commits March 24, 2026 19:25
…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.
@LouisMazel LouisMazel self-assigned this Apr 13, 2026
@LouisMazel LouisMazel changed the title Fix/windows support fix: support Windows initial independent releases Apr 13, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 93.02326% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.96%. Comparing base (334fc7b) to head (1fbdd06).

Files with missing lines Patch % Lines
src/core/npm.ts 50.00% 0 Missing and 2 partials ⚠️
src/core/tags.ts 96.77% 0 Missing and 1 partial ⚠️
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     
Flag Coverage Δ
unit 79.96% <93.02%> (+2.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LouisMazel LouisMazel force-pushed the fix/windows-support branch 5 times, most recently from 96d5ba2 to a8967ef Compare April 13, 2026 17:20
@LouisMazel
Copy link
Copy Markdown
Owner Author

🚀 Release published

  • Version: 1.3.0-beta.01.3.0-canary.a8967ef.0
  • Dist-tag: canary
  • Date: 2026-04-13 17:21 UTC
  • Branch: fix/windows-support

Packages

Package Version
relizy 1.3.0-beta.01.3.0-canary.a8967ef.0

Installation

pnpm add relizy@1.3.0-canary.a8967ef.0

or using the canary dist-tag:

pnpm add relizy@canary

@LouisMazel LouisMazel force-pushed the fix/windows-support branch from a8967ef to 547f03e Compare April 13, 2026 17:22
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants