npm package: @loudevuno/version-changelog-updater
Description: Automated version management and changelog generation for loudog.uno apps
Author: loudog.uno
Latest version: 0.1.2

# @loudoguno/version-changelog-updater

Automated version management and changelog generation for loudog.uno applications.

## Features

- **Automated SemVer**: Analyzes Conventional Commits to determine version bumps
- **Privacy Protection**: Validates commit messages against forbidden patterns
- **Build Stamps**: Tracks SHA, build number, and timestamp
- **Raycast-Inspired UI**: Beautiful dark-themed changelog components
- **GitHub Actions Ready**: Automated workflow templates included

## Installation

```bash
npm install --save-dev @loudoguno/version-changelog-updater
```

Or install from GitHub:

```bash
npm install --save-dev github:loudoguno/version-changelog-updater
```

## Quick Start

### 1. Create Config File

Create `changelog.config.ts` in your project root:

```typescript
import { defineConfig } from '@loudoguno/version-changelog-updater';

export default defineConfig({
  appSlug: 'your-app-name',
  privacy: {
    forbiddenPatterns: [
      /api[_-]?key/i,
      /secret/i,
      /password/i,
      /token/i,
    ],
    failOnMatch: true,
  },
  sections: {
    showMaintenance: false,
    showDocs: false,
    showChore: false,
  },
});
```

### 2. Generate Changelog

```bash
npx version-changelog-updater generate --appSlug your-app-name
```

### 3. Use React Components

```tsx
import { ChangelogPage } from '@loudoguno/version-changelog-updater/react';

export function Changelog() {
  return <ChangelogPage appSlug="your-app-name" />;
}
```

## CLI Commands

### Generate Changelog

```bash
# Generate changelog and version files
npx version-changelog-updater generate --appSlug my-app

# Dry run (preview without writing)
npx version-changelog-updater generate --appSlug my-app --dryRun

# Process last N commits
npx version-changelog-updater generate --appSlug my-app --maxCommits 100
```

## Conventional Commit Types

- `feat:` → 💎 Improvements (MINOR bump)
- `fix:` → 🐞 Fixes (PATCH bump)
- `perf:` → 💎 Improvements (MINOR bump)
- `refactor:` → 🔧 Maintenance (PATCH bump)
- `docs:` → 📝 Docs (PATCH bump)
- `chore:` → 🧹 Chore (PATCH bump)
- `changelog:` → Excluded from changelog

### Breaking Changes

Add `!` to trigger MAJOR version bump:

```
feat(auth)!: remove legacy login API
```

Or use footer:

```
feat(auth): update authentication flow

BREAKING CHANGE: Legacy login API has been removed.
```

## Output Files

The generator creates:

- `changelog/version.json` - Current version + build metadata
- `changelog/index.json` - Full changelog index
- `changelog/latest.json` - Latest version metadata
- `changelog/entries/vX.Y.Z.json` - Individual release entries

## GitHub Actions Integration

See `templates/changelog.yml` for a complete GitHub Actions workflow example.

## Privacy Validation

Configure forbidden patterns to prevent leaking sensitive information:

```typescript
privacy: {
  forbiddenPatterns: [
    /sk-[a-zA-Z0-9]+/, // OpenAI keys
    /supabase\.co\/[^\/]+/, // Supabase project URLs
    /192\.168\.\d+\.\d+/, // Private IPs
  ],
  failOnMatch: true, // Fail CI if pattern detected
}
```

## License

MIT

## Contributing

Issues and pull requests welcome at [github.com/loudoguno/version-changelog-updater](https://github.com/loudoguno/version-changelog-updater)