Skip to content

Commit bebcf0a

Browse files
committed
chore: align CI to hardened canon, add AGENTS.md + CLAUDE.md
CI: drop accept-flake-config (supply-chain risk; caches already pinned), run luacheck with --std lua51 --no-unused-args (matches the Lua 5.1 target and the curried-FFI idiom), invoke the test step via bash so it no longer needs the execute bit. 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 JavaScript-era package files. Tooling and docs only, no src/.
1 parent 39f7ebb commit bebcf0a

8 files changed

Lines changed: 51 additions & 95 deletions

File tree

.eslintrc.json

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

.github/workflows/ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@ jobs:
1414
- uses: cachix/install-nix-action@v27
1515
with:
1616
extra_nix_config: |
17-
accept-flake-config = true
1817
extra-substituters = https://cache.iog.io https://purescript-lua.cachix.org
1918
extra-trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= purescript-lua.cachix.org-1:yLs4ei2HtnuPtzLekOrW3xdfm95+Etw15gwgyIGTayA=
2019
2120
- name: Build
2221
run: nix develop -c ./scripts/build
2322

2423
- name: Test
25-
run: if [ -f scripts/test ]; then nix develop -c ./scripts/test; fi
24+
run: if [ -f scripts/test ]; then nix develop -c bash ./scripts/test; fi
2625

2726
- name: Luacheck
28-
run: nix develop -c luacheck --quiet --std min src/
27+
run: nix develop -c luacheck --quiet --std lua51 --no-unused-args src/

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
/.*
22
!/.gitignore
3-
!/.eslintrc.json
43
!/.github/
5-
/bower_components/
6-
/node_modules/
74
/output/
8-
package-lock.json

AGENTS.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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 (only if the fork has `scripts/test`): `nix develop -c bash ./scripts/test`
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 (under `src/`)
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.
42+
43+
## Decisions
44+
45+
Cross-cutting decisions are recorded as ADRs in the [package-set repo](https://github.com/Unisay/purescript-lua-package-sets/tree/master/docs/adr). Read them before a decision that affects the set, and add one after making such a decision.

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 & 41 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 & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)