initial commit

This commit is contained in:
2026-01-27 09:55:09 -05:00
commit c2f08e9140
9 changed files with 353 additions and 0 deletions

43
AGENTS.md Normal file
View File

@@ -0,0 +1,43 @@
# Poiesis
## Overview
Go tool that transpiles TypeScript to JavaScript using esbuild API and executes it with goja.
## Build & Test
```bash
go build
go test
golangci-lint run
```
## Project Structure
- `main.go` - Entry point with `executeTypeScript()` function
- `main_test.go` - Test suite using testify assertions
- `test_data/` - Test TypeScript files
- `go.mod` - Dependencies
## Testing Patterns
- **Test framework**: Go's built-in `testing` package
- **Assertions**: `github.com/stretchr/testify/assert`
- **Linting**: `golangci-lint run` - must pass before committing
- **Test organization**: Test files use `_test.go` suffix, test functions prefixed with `Test`
## Dependencies
- `github.com/evanw/esbuild/pkg/api` - TypeScript transpilation
- `github.com/dop251/goja` - JavaScript execution
- `github.com/stretchr/testify/assert` - Test assertions
## Key Functions
- `executeTypeScript(filePath string, stdout, stderr io.Writer) error` - Main transpilation and execution logic
## Code Conventions
- Handle all return values from external functions (enforced by golangci-lint)
- Use `os` package instead of deprecated `io/ioutil`
- Error logging uses `_, _ = fmt.Fprintf(stderr, ...)` pattern