Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3ce58f6
fix: prevent visible CMD windows when spawning Codex on Windows
jakenuts Nov 14, 2025
f8a1fc2
fix: resolve WebSocket race condition causing missed first messages
jakenuts Nov 14, 2025
91a2801
docs: add comprehensive technical architecture documentation
jakenuts Nov 14, 2025
62e70f1
chore(deps): add package-lock.json and update yarn.lock
jakenuts Nov 14, 2025
1517b79
feat: add Codex subprocess health monitoring and auto-reconnection
jakenuts Nov 14, 2025
162f13b
feat: add timeout handling for MCP operations and permissions
jakenuts Nov 14, 2025
1155c7f
chore: bump version to 0.11.3-preview.1 for testing
jakenuts Nov 14, 2025
28aa2f1
fix: handle missing tar dependency during npm install from git
jakenuts Nov 15, 2025
ef0b865
chore: bump version to 0.11.3-preview.2
jakenuts Nov 15, 2025
6d3d011
fix: make postinstall script more resilient to missing files
jakenuts Nov 17, 2025
7c28ba5
fix: add prepare script to ensure dist is built on npm install from git
jakenuts Nov 17, 2025
1ffe9f3
feat(preview-release): add preview release package 'happy-next' with …
jakenuts Nov 17, 2025
a78f082
feat(sync-upstream): add automated daily sync from upstream repo
jakenuts Nov 17, 2025
8962d2e
feat: rename package to happy-next for side-by-side installation
jakenuts Nov 17, 2025
2e861a3
docs: update README for happy-next fork
jakenuts Nov 17, 2025
7c25414
fix: use native Node.js APIs for cross-platform build script
jakenuts Nov 17, 2025
35aeccd
fix: skip type checking during GitHub install
jakenuts Nov 17, 2025
f22a445
chore: commit dist folder for GitHub installs
jakenuts Nov 17, 2025
976a7f6
fix: skip build entirely when dist exists during GitHub install
jakenuts Nov 17, 2025
9aa7e3e
chore: bump version to 0.11.3-preview.6
jakenuts Nov 17, 2025
9fffd16
ci: add GitHub Actions for automated dist building and testing
jakenuts Nov 17, 2025
e645d92
chore: bump version to 0.11.3-preview.7 [skip-build]
jakenuts Nov 17, 2025
76187bc
fix: rename bin files to match happy-next command names
jakenuts Nov 17, 2025
42bd27b
chore: disable automatic upstream sync, manual trigger only
jakenuts Nov 17, 2025
abd29c7
fix: update start script to use happy-next.mjs
jakenuts Nov 17, 2025
23bcc66
feat(bin): add Windows CMD launcher scripts for happy-next
jakenuts Nov 17, 2025
6f0e1c8
chore(build): rename build output files to new hashed names
jakenuts Nov 17, 2025
3486ccf
ci: add automated npm publishing workflows
jakenuts Nov 18, 2025
135048a
docs: add publishing guide for npm automation
jakenuts Nov 18, 2025
fa92b16
ci: add automatic preview publishing workflow
jakenuts Nov 18, 2025
9b700ed
docs: update README with automatic preview publishing info
jakenuts Nov 18, 2025
98e0906
ci: fix preview publish by installing dependencies before build/test
jakenuts Nov 18, 2025
049dc6f
docs: add publishing guide for npm automation
jakenuts Nov 18, 2025
7cca295
test: trigger auto-publish
jakenuts Nov 18, 2025
e650177
Merge smoke test fixes from main
jakenuts Nov 18, 2025
e306f2e
ci: fix CI checks for happy-next binary names
jakenuts Nov 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
213 changes: 213 additions & 0 deletions .github/PUBLISHING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
# Publishing Guide

This document explains how the automated publishing system works for `happy-next`.

## Overview

**Every push to the preview branch automatically publishes to npm!** No manual steps needed.

For stable releases, the package is automatically published to npm when the version changes.

## Automated Workflows

### 1. Automatic Preview Publishing (`publish-preview.yml`) ⭐ NEW

**Triggers on every push to preview branches!**

**What it does:**
- Generates unique version: `<version>-preview.<timestamp>.<commit-hash>`
- Installs dependencies
- Runs build and tests
- Publishes to npm with `@preview` tag

**Installation:**
```bash
# Get the latest preview (recommended)
npm install -g happy-next@preview

# Or install a specific preview version
npm install -g happy-next@0.11.3-preview.20251118120000.abc1234
```

**No manual intervention needed!** Just push your changes and wait 2-3 minutes.

### 2. Version Bumping (`bump-version.yml`)

Manually trigger this workflow to bump the version:

**Via GitHub UI:**
1. Go to Actions → Bump Version
2. Click "Run workflow"
3. Select bump type: `prerelease`, `patch`, `minor`, or `major`
4. Click "Run workflow"

**What it does:**
- Bumps the version in `package.json`
- Builds the project (updates `dist/`)
- Commits changes with `[skip-build]` tag
- Creates and pushes git tag (`v0.11.3-preview.8`, etc.)
- Updates `latest-preview` tag for prerelease versions

### 3. Publishing to NPM (`publish-npm.yml`)

Automatically triggers when:
- Version in `package.json` changes on `main` branch
- Manually triggered via workflow_dispatch

**What it does:**
- Detects version change
- Builds the project
- Publishes to npm with `--access public`
- Creates GitHub release
- Adds install instructions to release notes

**Note:** For preview/development work, use the automatic preview publishing instead!

## Publishing a New Version

### For Preview Releases (Automatic!) ⭐

**Just push your changes!** That's it.

```bash
git add .
git commit -m "your changes"
git push
# Wait 2-3 minutes - your changes are now published to npm!
```

Install with: `npm install -g happy-next@preview`

### For Named Preview Releases (Manual)

If you want a specific preview version number:

```bash
# Option 1: Use GitHub Actions
# Go to Actions → Bump Version → Run workflow → Select "prerelease"

# Option 2: Manually
npm version prerelease --preid=preview
git push
git push --tags
# Publishing happens automatically
```

### For Stable Releases

```bash
# Option 1: Use GitHub Actions (Recommended)
# Go to Actions → Bump Version → Run workflow → Select "patch/minor/major"

# Option 2: Manually
npm version patch # or minor, major
git push
git push --tags
# Publishing happens automatically
```

## Installation After Publishing

Once published to npm, users can install with:

```bash
# Latest stable version
npm install -g happy-next

# Latest preview version
npm install -g happy-next@preview

# Specific version
npm install -g happy-next@0.11.3-preview.7
```

## Benefits of NPM Publishing

✅ **No GitHub install issues** - Works perfectly with NVM
✅ **No path problems** - npm handles bin wrappers automatically
✅ **Faster installs** - Pre-built dist, no compilation needed
✅ **Better caching** - npm registry is more reliable than GitHub
✅ **Works like original** - Same experience as `happy-coder`

## NPM Token Setup

The `NPM_TOKEN` secret is already configured in the repository:
- **Location:** Repository Settings → Secrets and variables → Actions
- **Name:** `NPM_TOKEN`
- **Used by:** `publish-npm.yml` workflow

To regenerate the token:
1. Go to https://www.npmjs.com/settings/YOUR_USERNAME/tokens
2. Generate new token (Automation type)
3. Update the `NPM_TOKEN` secret in GitHub

## Distribution Tags

The package uses npm distribution tags:

- `latest` - Stable releases (default when running `npm install -g happy-next`)
- `preview` - Preview/beta releases (install with `npm install -g happy-next@preview`)

Prerelease versions automatically get the `preview` tag.

## Troubleshooting

### Publish Failed - Version Already Exists

If you try to publish a version that already exists on npm:
1. Bump the version: `npm version prerelease --preid=preview`
2. Commit and push
3. Publishing will retry automatically

### Publish Failed - Authentication Error

Check that the `NPM_TOKEN` secret is valid:
1. Go to Repository Settings → Secrets
2. Update `NPM_TOKEN` with a fresh token from npmjs.com

### Build Failed During Publish

The build must succeed before publishing:
1. Run `npm run build` locally to check for errors
2. Fix any TypeScript or build issues
3. Commit and push fixes
4. Workflow will retry

## Manual Publishing (Emergency)

If you need to publish manually:

```bash
# Build the project
npm run build

# Login to npm (first time only)
npm login

# Publish
npm publish --access public

# For preview releases, also tag as preview
npm dist-tag add happy-next@0.11.3-preview.7 preview
```

## Checking Published Versions

```bash
# View all published versions
npm view happy-next versions

# View latest version
npm view happy-next version

# View all dist-tags
npm view happy-next dist-tags
```

## Next Steps

After setting up publishing:
1. Merge this branch to `main`
2. Use "Bump Version" workflow to create first npm release
3. Update documentation to use `npm install -g happy-next`
4. Announce to users that they can now install from npm!
79 changes: 79 additions & 0 deletions .github/workflows/build-dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Build and Commit Dist

on:
push:
branches:
- main
- new/**
- feature/**
- fix/**
paths-ignore:
- 'dist/**'
- '**.md'
- '.github/**'

workflow_dispatch:

jobs:
build-dist:
runs-on: ubuntu-latest

# Prevent infinite loops - skip if commit message contains [skip-build]
if: "!contains(github.event.head_commit.message, '[skip-build]')"

steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Check for dist changes
id: check-changes
run: |
git add dist
if git diff --cached --quiet; then
echo "has_changes=false" >> $GITHUB_OUTPUT
echo "No changes to dist folder"
else
echo "has_changes=true" >> $GITHUB_OUTPUT
echo "Dist folder has changes"
fi

- name: Commit and push dist
if: steps.check-changes.outputs.has_changes == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

git add dist
git commit -m "chore: update dist folder [skip-build]

Built from commit ${{ github.sha }}

This commit was automatically generated by GitHub Actions."

git push

- name: Summary
run: |
echo "## Build Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

if [ "${{ steps.check-changes.outputs.has_changes }}" == "true" ]; then
echo "✅ Dist folder updated and committed" >> $GITHUB_STEP_SUMMARY
else
echo "ℹ️ No changes to dist folder" >> $GITHUB_STEP_SUMMARY
fi
91 changes: 91 additions & 0 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Bump Version

on:
workflow_dispatch:
inputs:
bump_type:
description: 'Version bump type'
required: true
type: choice
options:
- prerelease
- patch
- minor
- major

jobs:
bump-version:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Bump version
id: bump
run: |
OLD_VERSION=$(node -p "require('./package.json').version")
echo "old_version=$OLD_VERSION" >> $GITHUB_OUTPUT

# Bump version based on input
if [ "${{ inputs.bump_type }}" = "prerelease" ]; then
npm version prerelease --preid=preview --no-git-tag-version
else
npm version ${{ inputs.bump_type }} --no-git-tag-version
fi

NEW_VERSION=$(node -p "require('./package.json').version")
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT

echo "Bumped version: $OLD_VERSION → $NEW_VERSION"

- name: Build
run: |
npm ci
npm run build

- name: Commit changes
run: |
git add package.json package-next.json dist
git commit -m "chore: bump version to ${{ steps.bump.outputs.new_version }} [skip-build]

Automated version bump: ${{ steps.bump.outputs.old_version }} → ${{ steps.bump.outputs.new_version }}

🤖 Generated by GitHub Actions"

git push

- name: Create and push tag
run: |
TAG="v${{ steps.bump.outputs.new_version }}"
git tag -a "$TAG" -m "Release $TAG"
git push origin "$TAG"

# Update latest-preview tag if this is a prerelease
if [[ "${{ steps.bump.outputs.new_version }}" == *"preview"* ]]; then
git tag -f latest-preview
git push origin latest-preview -f
fi

- name: Summary
run: |
echo "## 🏷️ Version Bumped" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Old Version:** ${{ steps.bump.outputs.old_version }}" >> $GITHUB_STEP_SUMMARY
echo "**New Version:** ${{ steps.bump.outputs.new_version }}" >> $GITHUB_STEP_SUMMARY
echo "**Bump Type:** ${{ inputs.bump_type }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "The publish workflow will automatically publish this to npm." >> $GITHUB_STEP_SUMMARY
Loading
Loading