| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
HapperCI is a local-first CI application that lets you define CI/CD workflows using TypeScript instead of YAML. Run the same build process locally as you would on a hosted CI service.
# Clone and build
git clone https://github.com/pythonandchips/happerci.git
cd happerci
go build -o bin/happerci ./cmd/happerci
# Add to PATH (optional)
export PATH="$PATH:$(pwd)/bin"cd your-project
# Create package.json if needed
npm init -y
# Install the SDK
npm install @happerci/sdk
# Create tsconfig.json
cat > tsconfig.json << 'EOF'
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"esModuleInterop": true
}
}
EOFCreate workflow.ts:
import { step } from '@happerci/sdk';
step('install', 'npm install');
step('lint', 'npm run lint');
step('test', 'npm test');
step('build', 'npm run build');happerci run workflow.tsOutput:
HapperCI - Running workflow Step: install Output: added 150 packages in 2s ✓ PASSED Step: lint Output: No linting errors ✓ PASSED Step: test Output: All 42 tests passed ✓ PASSED Step: build Output: Build completed ✓ PASSED Build: PASSED (4/4 steps)
Traditional CI systems use YAML for configuration:
# Hard to read, no IDE support, easy to make mistakes
steps:
- name: Install
run: npm install
- name: Test
run: npm test
- name: Build
if: github.ref == 'refs/heads/main'
run: npm run buildWith HapperCI, you use TypeScript:
import { step } from '@happerci/sdk';
step('install', 'npm install');
step('test', 'npm test');
// Real programming language = real power
if (process.env.BRANCH === 'main') {
step('build', 'npm run build');
}Benefits:
HapperCI uses a host-guest architecture inspired by Pulumi:
┌─────────────────────┐ ┌─────────────────────┐ │ HapperCI CLI │ gRPC │ TypeScript SDK │ │ (Go Engine) │◄────────►│ (User Workflow) │ │ │ │ │ │ - Starts server │ │ - Registers steps │ │ - Spawns ts-node │ │ - Signals complete │ │ - Executes steps │ │ │ │ - Reports results │ │ │ └─────────────────────┘ └─────────────────────┘
The Go engine handles execution while TypeScript handles workflow definition. This separation provides:
happerci/ ├── cmd/happerci/ # CLI entry point ├── internal/ │ ├── engine/ # Workflow execution engine │ ├── runner/ # Step command runner │ └── proto/ # Generated gRPC code ├── proto/ # Protocol buffer definitions ├── sdk/typescript/ # TypeScript SDK ├── examples/ # Example workflows ├── docs/ # Documentation └── test/e2e/ # End-to-end tests
# Build CLI
go build -o bin/happerci ./cmd/happerci
# Build TypeScript SDK
cd sdk/typescript
npm install
npm run build# Run Go tests
go test ./...
# Run TypeScript tests
cd sdk/typescript && npm test
# Run E2E tests
go test ./test/e2e/...If you modify proto/happerci.proto:
protoc --go_out=. --go-grpc_out=. proto/happerci.proto
mv github.com/pythonandchips/happerci/internal/proto/*.go internal/proto/
rm -rf github.comContributions are welcome! Please feel free to submit a Pull Request.
MIT
This project is inspired by Pulumi's multi-language architecture, which demonstrates how to build developer tools that support multiple programming languages through a common engine.
| Back | FazBrowse Home | New Git URL |