Skip to content

Commit c8fac31

Browse files
committed
Init project
0 parents  commit c8fac31

152 files changed

Lines changed: 29511 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
go:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out repository
12+
uses: actions/checkout@v4
13+
14+
- name: Set up Go
15+
uses: actions/setup-go@v5
16+
with:
17+
go-version-file: go.mod
18+
cache: true
19+
20+
- name: Test
21+
run: go test ./...
22+
23+
- name: Vet
24+
run: go vet ./...

.github/workflows/release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build-macos:
13+
runs-on: macos-latest
14+
steps:
15+
- name: Check out repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version-file: go.mod
22+
cache: true
23+
24+
- name: Test
25+
run: go test ./...
26+
27+
- name: Build macOS ARM64 binary
28+
run: |
29+
mkdir -p dist
30+
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -trimpath -o dist/narrc ./cmd/narrc
31+
32+
- name: Package binary
33+
run: |
34+
tar -czf dist/narrc-darwin-arm64.tar.gz -C dist narrc
35+
36+
- name: Create release and upload asset
37+
env:
38+
GH_TOKEN: ${{ github.token }}
39+
TAG_NAME: ${{ github.ref_name }}
40+
run: |
41+
gh release view "$TAG_NAME" >/dev/null 2>&1 || \
42+
gh release create "$TAG_NAME" --title "$TAG_NAME" --generate-notes
43+
gh release upload "$TAG_NAME" dist/narrc-darwin-arm64.tar.gz --clobber

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

AGENTS.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Repository Guidelines
2+
3+
## Scope
4+
5+
This repository is implementing `narrc`, a Go CLI for the Narr language.
6+
The language grammar source of truth is `docs/syntax.md`; milestone planning
7+
is tracked in `docs/plans/narrc-go-implementation-plan.md`.
8+
9+
## Build And Test
10+
11+
- Format Go changes with `gofmt`.
12+
- Run `go test ./...` before handing off Go changes.
13+
- Use `go run ./cmd/narrc --version` for the smallest CLI smoke test.
14+
- Use `go run ./cmd/narrc lint --project examples/红楼梦` to verify the M1
15+
project-loading path.
16+
17+
## Project Layout
18+
19+
- CLI entry point: `cmd/narrc/main.go`.
20+
- CLI parsing and command dispatch: `internal/cli`.
21+
- Project discovery, config loading, and file collection: `internal/project`.
22+
- Diagnostics and source positions: `internal/source`.
23+
- User-facing output formatting: `internal/format`.
24+
25+
## Implementation Notes
26+
27+
- Keep parser/checker/evaluator work aligned with `docs/syntax.md`.
28+
- Do not add syntax that is not documented in `docs/syntax.md`.
29+
- Keep generated build output out of source control.

Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.PHONY: build install test smoke clean
2+
3+
BINARY := narrc
4+
CMD := ./cmd/narrc
5+
6+
build:
7+
go build -o bin/$(BINARY) $(CMD)
8+
9+
install:
10+
go install $(CMD)
11+
12+
test:
13+
go test ./...
14+
15+
smoke:
16+
go run $(CMD) --version
17+
18+
clean:
19+
rm -rf bin

0 commit comments

Comments
 (0)