Skip to content

Commit 2e10375

Browse files
author
Atticus
committed
chore(readme): update dev section
1 parent 79756cb commit 2e10375

File tree

3 files changed

+111
-1
lines changed

3 files changed

+111
-1
lines changed

.github/workflows/ant.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ jobs:
2222
run: luarocks install ar-io-ao-0.1-1.rockspec
2323

2424
- name: Run Busted Tests
25-
working-directory: ant
2625
run: busted .
2726

2827
- name: Upload coverage reports to Codecov

README.md

+96
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,102 @@ Removes a record from the ANT.
228228
| Action | string | "Remove-Record" | true | Action tag for triggering handler |
229229
| Sub-Domain | string | "^(?:[a-zA-Z0-9_-]+\|@)$" | true | Subdomain of the record to remove. |
230230

231+
## Developers
232+
233+
### Requirements
234+
235+
- Lua 5.3 - [Download](https://www.lua.org/download.html)
236+
- Luarocks - [Download](https://luarocks.org/)
237+
238+
### Lua Setup (MacOS)
239+
240+
1. Clone the repository and navigate to the project directory.
241+
1. Install `lua`
242+
- `brew install [email protected]`
243+
1. Add the following to your `.zshrc` or `.bashrc` file:
244+
245+
```bash
246+
echo 'export LDFLAGS="-L/usr/local/opt/[email protected]/lib"' >> ~/.zshrc
247+
echo 'export CPPFLAGS="-I/usr/local/opt/[email protected]/include"' >> ~/.zshrc
248+
echo 'export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"' >> ~/.zshrc
249+
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc
250+
```
251+
252+
1. Run `source ~/.zshrc` or `source ~/.bashrc` to apply the changes.
253+
1. Run `lua -v` to verify the installation.
254+
255+
### LuaRocks Setup
256+
257+
1. Install `luarocks`
258+
259+
```bash
260+
curl -R -O http://luarocks.github.io/luarocks/releases/luarocks-3.9.1.tar.gz
261+
tar zxpf luarocks-3.9.1.tar.gz
262+
cd luarocks-3.9.1
263+
./configure --with-lua=/usr/local/opt/[email protected] --with-lua-include=/usr/local/opt/[email protected]/include
264+
make build
265+
sudo make install
266+
```
267+
268+
1. Check the installation by running `luarocks --version`.
269+
1. Check the LuaRocks configuration by running `luarocks config | grep LUA`
270+
271+
If you ever need to refresh .luarocks, run the following command:
272+
273+
```sh
274+
luarocks purge && luarocks install ar-io-ao-0.1-1.rockspec
275+
```
276+
277+
### aos
278+
279+
To load the module into the `aos` REPL, run the following command:
280+
281+
```sh
282+
aos --load src/main.lua
283+
```
284+
285+
### Code Formatting
286+
287+
The code is formatted using `stylua`. To install `stylua`, run the following command:
288+
289+
```sh
290+
cargo install stylua
291+
stylua contract
292+
```
293+
294+
### Testing
295+
296+
To run the tests, execute the following command:
297+
298+
```sh
299+
busted .
300+
```
301+
302+
To see the test coverage, run the following command:
303+
304+
```sh
305+
luacov --reporter html && open luacov-html/index.html
306+
```
307+
308+
### Dependencies
309+
310+
To add new dependencies, install using luarocks to the local directory
311+
312+
```sh
313+
luarocks install <package>
314+
```
315+
316+
And add the package to the `dependencies` table in the `ar-io-ao-0.1-1.rockspec` file.
317+
318+
```lua
319+
-- rest of the file
320+
dependencies = {
321+
"lua >= 5.3",
322+
"luaunit >= 3.3.0",
323+
"<package>"
324+
}
325+
```
326+
231327
# Additional Resources
232328

233329
- [AR.IO Gateways]

ar-io-ao-0.1-1.rockspec

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package = "ar-io-ao"
2+
version = "0.1-1"
3+
rockspec_format = "3.0"
4+
source = {
5+
url = "./src/aos.lua"
6+
}
7+
dependencies = {
8+
"busted >= 2.2.0",
9+
"luacov >= 0.15.0",
10+
"luacheck >= 1.1.2",
11+
"luacov-html >=1.0.0"
12+
}
13+
test = {
14+
type = "busted",
15+
}

0 commit comments

Comments
 (0)