Skip to content

Commit 5b2f65a

Browse files
committed
feat: add quick start and testing guide as docs
- add jsdoc for exported classes and functions - use typedoc to generate API documenation - add proof of attandance example contract and associated tests - add digital markplace example contract and associated tests - add initial contributing guide
1 parent 3e76292 commit 5b2f65a

Some content is hidden

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

70 files changed

+7464
-166
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,4 @@ out/
6565

6666

6767
examples/debug-out/
68+
examples/**/data/

CONTRIBUTING.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Contributing to Algorand TypeScript Testing
2+
3+
Contributions are welcome. For new features, please open an issue to discuss first.
4+
5+
## Workflow
6+
7+
We use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary). User-facing changes should include at least one `fix:` or `feat:` commit for release notes. Other conventions like `docs:` or `test:` are optional but helpful.
8+
9+
## Local Development
10+
11+
To set up the project locally:
12+
13+
1. **Install Node.js**: Download from [nodejs.org](https://nodejs.org/).
14+
15+
1. **Install Python 3.12+**.
16+
17+
1. **Install Puya**:
18+
19+
```sh
20+
pipx install puyapy --python 3.12.6
21+
```
22+
23+
1. **Install AlgoKit CLI**: Follow the guide from [Algokit](https://github.com/algorandfoundation/algokit-cli?tab=readme-ov-file#install).
24+
25+
1. **Start localnet**:
26+
27+
```sh
28+
algokit localnet start
29+
# or `algokit localnet reset --update` to update localnet docker images
30+
```
31+
32+
1. **Install npm dependencies**:
33+
34+
```sh
35+
npm install
36+
```
37+
38+
1. **Run tests**:
39+
```sh
40+
npm test
41+
```
42+
43+
## Common Commands
44+
45+
Here are some common commands you will use with npm:
46+
47+
- **Generate API reference documentation** `npm run script:documentation`
48+
- **Fix linting errors** `npm run lint:fix`
49+
- **Build a distribution locally** `npm run build`
50+
- **Compile all contracts used by tests for debugging** `npm run script:refresh-test-artifacts`
51+
- **Compile all example contracts for debugging** `npm run script:compile-examples`

docs/algots.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Algorand TypeScript
2+
3+
Algorand TypeScript is a partial implementation of the TypeScript programming language that runs on the Algorand Virtual Machine (AVM). It includes a statically typed framework for development of Algorand smart contracts and logic signatures, with TypeScript interfaces to underlying AVM functionality that works with standard TypeScript tooling.
4+
5+
It maintains the syntax and semantics of TypeScript such that a developer who knows TypeScript can make safe assumptions
6+
about the behaviour of the compiled code when running on the AVM. Algorand TypeScript is also executable TypeScript that can be run
7+
and debugged on a Node.js virtual machine with transpilation to EcmaScript and run from automated tests.
8+
9+
Algorand TypeScript is compiled for execution on the AVM by PuyaTs, a TypeScript frontend for the [Puya](https://github.com/algorandfoundation/puya) optimising compiler that ensures the resulting AVM bytecode execution semantics that match the given TypeScript code. PuyaTs produces output that is directly compatible with AlgoKit typed clients to make deployment and calling easy.
10+
11+
[Documentation](https://github.com/algorandfoundation/puya/blob/main/README.md)

docs/api.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# API Reference
2+
3+
An overview of the `algorand-typescript-testing` package - covering the main classes and functions.
4+
5+
```{hint}
6+
Spotted a typo in documentation? This project is open source, please submit an issue or a PR on [GitHub](https://github.com/algorandfoundation/algorand-typescript-testing).
7+
```
8+
9+
## Contexts
10+
11+
- [TestExecutionContext](./code/index/classes/TestExecutionContext.md)
12+
- [ContractContext](./code/subcontexts/contract-context/classes/ContractContext.md)
13+
- [LedgerContext](./code/subcontexts/ledger-context/classes/LedgerContext.md)
14+
- [TransactionContext](./code/subcontexts/transaction-context/classes/TransactionContext.md)
15+
16+
## Value Generators
17+
18+
- [AvmValueGenerator](./code/value-generators/avm/classes/AvmValueGenerator.md)
19+
- [Arc4ValueGenerator](./code/value-generators/arc4/classes/Arc4ValueGenerator.md)
20+
- [TxnValueGenerator](./code/value-generators/txn/classes/TxnValueGenerator.md)
21+
22+
## Utils
23+
24+
- [addEqualityTesters](./code/index/functions/addEqualityTesters.md)
25+
- [encodingUtils](./code/index/variables/encodingUtil.md)
26+
27+
## Reference documentation
28+
29+
We also have [auto-generated reference documentation for the code](./code/README.md).

docs/code/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
**@algorandfoundation/algorand-typescript-testing**
2+
3+
***
4+
5+
# @algorandfoundation/algorand-typescript-testing
6+
7+
## Modules
8+
9+
- [index](index/README.md)
10+
- [subcontexts/contract-context](subcontexts/contract-context/README.md)
11+
- [subcontexts/ledger-context](subcontexts/ledger-context/README.md)
12+
- [subcontexts/transaction-context](subcontexts/transaction-context/README.md)
13+
- [value-generators](value-generators/README.md)
14+
- [value-generators/arc4](value-generators/arc4/README.md)
15+
- [value-generators/avm](value-generators/avm/README.md)
16+
- [value-generators/txn](value-generators/txn/README.md)

docs/code/index/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[**@algorandfoundation/algorand-typescript-testing**](../README.md)
2+
3+
***
4+
5+
[@algorandfoundation/algorand-typescript-testing](../README.md) / index
6+
7+
# index
8+
9+
## Classes
10+
11+
- [TestExecutionContext](classes/TestExecutionContext.md)
12+
13+
## Variables
14+
15+
- [encodingUtil](variables/encodingUtil.md)
16+
17+
## Functions
18+
19+
- [addEqualityTesters](functions/addEqualityTesters.md)

0 commit comments

Comments
 (0)