Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
85 changes: 85 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Changelog

All notable changes to Expose will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

---

## [Unreleased]
### Planned for v0.2.0

### Planned for v0.2.0
- ngrok provider support
- Custom subdomains
- HTTPS support

## [v0.2.0] - 2025-11-29

### Added
- **Cloudflare Tunnel** support (`expose tunnel -P cloudflare`) [#21]
- `--provider/-P` flag (localtunnel, cloudflare)
- test coverage for provider + service layers

### Changed
- Bump version to v0.2.0
- Update README with providers table + examples
## [v0.2.0] - 2025-11-29

### Added
- **Cloudflare Tunnel** support (`expose tunnel -P cloudflare`) [#12]
- `--provider/-P` flag (localtunnel, cloudflare)
- Full test coverage for provider + service layers

### Changed
- Bump version to v0.2.0
- Update README with providers table + examples

---

## [0.1.2] - 2025-11-10

### Added
- Config management commands (`config list`, `config get`)
- Service layer with thread-safe tunnel management
- `--version` flag with commit and build date metadata

### Changed
- Improved error messages for tunnel lifecycle
- Better context cancellation handling

### Fixed
- Race conditions in Service.Start()
- Graceful shutdown on Ctrl+C

---

## [0.1.1] - 2025-11-09

### Added
- LocalTunnel provider integration
- 6 unit tests for Service layer (75%+ coverage)
- Provider interface for extensibility

### Changed
- Refactored tunnel command to use Service layer
- Separated CLI logic from business logic

---

## [0.1.0] - 2025-11-07

### Added
- Initial release
- `expose init` - Create `.expose.yml` config
- `expose tunnel` - Start local reverse proxy
- Cobra CLI framework
- GitHub Actions CI/CD (test.yml)
- Basic test coverage (tunnel package)

---

[v0.1.2]: https://github.com/kernelshard/expose/compare/v0.2.0...v0.1.2
[0.1.1]: https://github.com/kernelshard/expose/releases/tag/v0.1.1
[0.1.0]: https://github.com/kernelshard/expose/releases/tag/v0.1.0
167 changes: 167 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# Contributing to Expose

Thanks for your interest in contributing! This guide will help you get started.

---

## Development Setup

### Prerequisites
- Go 1.23+
- Git

### Clone and Build

```
git clone https://github.com/kernelshard/expose.git
cd expose
go mod download
go build -o expose ./cmd/expose
./expose --version
```

---

## Workflow

### Branch Strategy

1. **Always branch from `develop`** (not `main`)
```
git checkout develop
git pull origin develop
git checkout -b feature/your-feature-name
```

2. **Branch naming:**
- Features: `feat/add-ngrok-provider`
- Fixes: `fix/config-load-error`
- Docs: `docs/update-readme`
- Tests: `test/add-provider-tests`

3. **Create PR to `develop`** (not `main`)
- Base branch: `develop`
- Title: Use commit prefix (`feat:`, `fix:`, `docs:`, `test:`)
- Description: Reference issue number, explain changes

4. **After merge:** We merge `develop` → `main` only for releases

---

## Code Standards

### Commit Messages

Follow [Conventional Commits](https://www.conventionalcommits.org/):

```
feat: add ngrok provider support
fix: resolve config file not found error
docs: update installation instructions
test: add tunnel service tests
```

### Testing Requirements

- ✅ Write tests for new features
- ✅ Minimum **75% coverage**
- ✅ Run with race detector: `go test -race ./...`
- ✅ Use table-driven tests for multiple cases

**Example:**

```
func TestConfigLoad(t *testing.T) {
tests := []struct {
name string
config string
wantErr bool
}{
{"valid config", "port: 3000", false},
{"invalid yaml", "port:", true},
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
// test body
})
}
}
```

### Code Style

- Run `go fmt` before committing
- Follow [Effective Go](https://golang.org/doc/effective_go)
- Keep CLI layer thin (delegate to service layer)
- Export struct fields only when needed (YAML marshaling)
- Return errors early

**File organization:**

```
internal/
├── cli/ # Cobra commands (newXXXCmd() factory pattern)
├── config/ # Config CRUD operations
├── provider/ # Provider implementations
├── tunnel/ # Service layer (business logic)
└── version/ # Version metadata
```

---

## Running Tests

```
# All tests with race detector
go test ./... -v -race -cover

# Specific package coverage
go test ./internal/config -cover
go test ./internal/tunnel -cover

# Coverage report
go test ./... -coverprofile=coverage.out
go tool cover -html=coverage.out
```

---

## Testing Locally

```
# Build
go build -o expose ./cmd/expose

# Run tunnel
./expose tunnel

# Test with HTTP server
python3 -m http.server 3000 # Terminal 1
./expose tunnel # Terminal 2
curl <public-url> # Terminal 3
```

---

## Pull Request Checklist

Before submitting:

- [ ] Tests pass: `go test ./... -race -cover`
- [ ] Code formatted: `go fmt ./...`
- [ ] Coverage ≥ 75%
- [ ] Commit messages follow convention
- [ ] PR description includes issue reference
- [ ] Branch is up to date with `develop`

---

## Need Help?

- **Issues:** [github.com/kernelshard/expose/issues](https://github.com/kernelshard/expose/issues)
- **Discussions:** Comment on relevant issue

---

**Made with ❤️ by contributors like you.**
Loading