@@ -228,6 +228,102 @@ Removes a record from the ANT.
228
228
| Action | string | "Remove-Record" | true | Action tag for triggering handler |
229
229
| Sub-Domain | string | "^(?:[ a-zA-Z0-9_ -] +\| @)$" | true | Subdomain of the record to remove. |
230
230
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
+
231
327
# Additional Resources
232
328
233
329
- [ AR.IO Gateways]
0 commit comments