wip2
This commit is contained in:
39
AGENTS.md
39
AGENTS.md
@@ -1,28 +1,46 @@
|
||||
# Poiesis
|
||||
|
||||
## Module Name
|
||||
|
||||
`reichard.io/poiesis`
|
||||
|
||||
## Overview
|
||||
|
||||
Go tool that transpiles TypeScript to JavaScript using esbuild API and executes it with goja.
|
||||
Go tool that transpiles TypeScript to JavaScript using esbuild API and executes it with goja. Features a flexible builtin system for exposing Go functions to TypeScript.
|
||||
|
||||
## Build & Test
|
||||
|
||||
```bash
|
||||
go build
|
||||
go test
|
||||
go build ./cmd/poiesis
|
||||
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
|
||||
```
|
||||
reichard.io/poiesis/
|
||||
├── cmd/poiesis/ # CLI entry point
|
||||
│ └── main.go
|
||||
├── internal/
|
||||
│ ├── builtin/ # Builtin function framework
|
||||
│ │ ├── builtin.go
|
||||
│ │ └── builtin_test.go
|
||||
│ └── runtime/ # TypeScript transpilation + execution
|
||||
│ ├── runtime.go
|
||||
│ └── runtime_test.go
|
||||
└── test_data/ # Test TypeScript files
|
||||
```
|
||||
|
||||
## Key Packages
|
||||
|
||||
- `reichard.io/poiesis/internal/runtime` - Runtime management, TypeScript transpilation, execution
|
||||
- `reichard.io/poiesis/internal/builtin` - Builtin registration and type conversion
|
||||
|
||||
## Testing Patterns
|
||||
|
||||
- **Test framework**: Go's built-in `testing` package
|
||||
- **Assertions**: `github.com/stretchr/testify/assert`
|
||||
- **Assertions**: `github.com/stretchr/testify/assert` and `require`
|
||||
- **Linting**: `golangci-lint run` - must pass before committing
|
||||
- **Test organization**: Test files use `_test.go` suffix, test functions prefixed with `Test`
|
||||
|
||||
@@ -32,12 +50,9 @@ golangci-lint run
|
||||
- `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
|
||||
- Package structure follows standard Go project layout with internal packages
|
||||
|
||||
Reference in New Issue
Block a user