Skip to content

Commit c8d0796

Browse files
committed
chore: add AGENTS.md + CLAUDE.md, drop dead JavaScript-era files
AGENTS.md is the single instruction file the coding agents read natively; CLAUDE.md is a one-line @AGENTS.md import so Claude Code shares it. Also removes dead bower.json/package.json/.eslintrc.json. CI is already on the shared canon; no src/ change.
1 parent 76e9059 commit c8d0796

6 files changed

Lines changed: 45 additions & 65 deletions

File tree

.eslintrc.json

Lines changed: 0 additions & 26 deletions
This file was deleted.

AGENTS.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# AGENTS.md
2+
3+
A PureScript→Lua FFI fork in the [`purescript-lua`](https://github.com/Unisay/purescript-lua) package set. Generated code targets **Lua 5.1**.
4+
5+
## Commands
6+
7+
All commands run inside the nix dev shell:
8+
9+
- Build: `nix develop -c ./scripts/build`
10+
- Test: `nix develop -c bash ./scripts/test` (only forks that ship Lua regression tests have one)
11+
- Lint: `nix develop -c luacheck --quiet --std lua51 --no-unused-args src/`
12+
13+
## Lua 5.1 target
14+
15+
The output runs on Lua 5.1, which is stricter than 5.3:
16+
17+
- No `table.unpack`, `bit32`, `utf8`, or the `//` operator. `math.pow` and `math.atan2` do exist.
18+
- Array-style tables are 1-indexed: the first element is `t[1]`, not `t[0]`.
19+
- `unit` is `{}`, never `nil`: a `nil` table element silently disappears, which would collapse `Array Unit` into an empty table.
20+
- Lua 5.1 mangles some Lua 5.3 string escapes, so keep FFI string escapes 5.1-safe.
21+
22+
## FFI files (`src/*.lua`)
23+
24+
pslua's foreign-file parser needs every exported value wrapped in parentheses:
25+
26+
```lua
27+
return {
28+
identity = (function(x) return x end),
29+
answer = (42),
30+
}
31+
```
32+
33+
A bare `function … end` or an unparenthesised expression fails to parse.
34+
35+
## Toolchain
36+
37+
`flake.nix` pins everything through [`purescript-overlay`](https://github.com/thomashoneyman/purescript-overlay): purs 0.15.16 (`purs-bin.purs-0_15_16`), spago 0.21.0 (`spago-bin.spago-0_21_0`), Lua 5.1 (`lua51Packages`). The `pslua` input tracks `github:Unisay/purescript-lua`; keep `flake.lock` reasonably current, since a long-stale pslua pin won't create the `--lua-output-file` directory and CI fails.
38+
39+
## Releasing
40+
41+
Tag-driven, with no GitHub Release or changelog entry. The full conventions live in the [package-set repo](https://github.com/Unisay/purescript-lua-package-sets/blob/master/CONTRIBUTING.md): push an annotated tag on `master`, bump this fork's `version` in the package set's `src/packages.dhall`, refresh `latest-compatible-sets.json`, and push a `psc-*` set tag.

CLAUDE.md

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

bower.json

Lines changed: 0 additions & 23 deletions
This file was deleted.

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)