Skip to content

Commit 81672f3

Browse files
authored
fix: resolve ci issues and some other items (#6)
* fix: Resolve CI issue by adding puyapy as a dev dependency * docs: Tweak docs * fix: Correct the GitHub actions for a project generated from the template * chore: Register the debug handlers in the end to end test, so simulate traces can be easily captured for debugging * fix: Fix file extension of a smart contract created from the generator
1 parent b1ee4ba commit 81672f3

27 files changed

+172
-57
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
---
1313

14-
This template provides a production-ready baseline for developing and deploying [Algorand TypeScript](https://github.com/algorandfoundation/puya-ts) smart contracts.
14+
This template provides a beta template for developing and deploying [Algorand TypeScript](https://github.com/algorandfoundation/puya-ts) smart contracts.
1515

1616
~~To use it [install AlgoKit](https://github.com/algorandfoundation/algokit-cli#readme) and then either pass in `-t typescript` to `algokit init` or select the `typescript` template.~~
1717

examples/production/.github/workflows/production-cd.yaml

+9-3
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,17 @@ jobs:
1818
- name: Checkout source code
1919
uses: actions/checkout@v4
2020

21-
- name: Use Node.js lts
22-
uses: actions/setup-node@v3
21+
- name: Use Node.js 22.x
22+
uses: actions/setup-node@v4
2323
with:
24-
node-version: lts
24+
node-version: '22.x'
2525
cache: 'npm'
26+
cache-dependency-path: '**/package-lock.json'
27+
28+
- name: Set up Python 3.12
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: '3.12'
2632

2733
- name: Install algokit
2834
run: pipx install algokit

examples/production/.github/workflows/production-ci.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@ jobs:
1111
- name: Checkout source code
1212
uses: actions/checkout@v4
1313

14-
- name: Use Node.js lts
15-
uses: actions/setup-node@v3
14+
- name: Use Node.js 22.x
15+
uses: actions/setup-node@v4
1616
with:
17-
node-version: lts
17+
node-version: '22.x'
1818
cache: 'npm'
19+
cache-dependency-path: '**/package-lock.json'
1920

2021
- name: Set up Python 3.12
2122
uses: actions/setup-python@v5
2223
with:
2324
python-version: '3.12'
24-
cache: 'poetry'
2525

2626
- name: Install algokit
2727
run: pipx install algokit
2828

29-
- name: Install puya compiler
30-
run: pipx install puya
29+
- name: Install Puya compiler
30+
run: pipx install puyapy
3131

3232
- name: Start LocalNet
3333
run: algokit localnet start

examples/production/.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,3 @@ coverage
6060
debug_traces/
6161
.algokit/static-analysis/ # Replace with .algokit/static-analysis/tealer/ to enable snapshot checks in CI
6262
.algokit/sources
63-

examples/production/.pre-commit-config.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ repos:
77
name: Prettier
88
entry: npm run format
99
language: system
10-
1110
- repo: local
1211
hooks:
1312
- id: vitest
1413
name: Vitest
1514
entry: npm run test
1615
language: system
17-
1816
# # Uncomment to enable TEAL static analysis using Tealer package
1917
# - id: tealer
2018
# name: tealer

examples/production/.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ coverage
1010
**/generated/types.ts
1111
# don't format ide files
1212
.idea
13+
smart_contracts/artifacts

examples/production/.vscode/settings.json

-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
{
22
"files.eol": "\n",
3-
43
"editor.formatOnSave": true,
54
"editor.defaultFormatter": "esbenp.prettier-vscode",
65
"editor.codeActionsOnSave": {
76
"source.organizeImports": "explicit"
87
},
9-
108
"jest.enable": false,
11-
129
"files.associations": {
1310
".github/**/*.yml": "github-actions-workflow"
1411
},
15-
1612
"eslint.enable": true,
1713
"eslint.validate": ["typescript"],
1814
"eslint.options": {

examples/production/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This project has been generated using AlgoKit. See below for default getting sta
99
- [Nodejs 20](https://nodejs.org/en/download) or later
1010
- [AlgoKit CLI 2.5](https://github.com/algorandfoundation/algokit-cli?tab=readme-ov-file#install) or later
1111
- [Docker](https://www.docker.com/) (only required for LocalNet)
12+
- [Puya Compiler 4.1.1](https://pypi.org/project/puyapy/) or later
1213

1314
> For interactive tour over the codebase, download [vsls-contrib.codetour](https://marketplace.visualstudio.com/items?itemName=vsls-contrib.codetour) extension for VS Code, then open the [`.codetour.json`](./.tours/getting-started-with-your-algokit-project.tour) file in code tour extension.
1415
@@ -24,6 +25,7 @@ Ensure the following pre-requisites are installed and properly configured:
2425

2526
- **Docker**: Required for running a local Algorand network.
2627
- **AlgoKit CLI**: Essential for project setup and operations. Verify installation with `algokit --version`, expecting `2.5.0` or later.
28+
- **Puya Compiler**: Can be installed from PyPi by running `pipx install puyapy`. Verify installation with `puyapy --version`, expecting `4.1.1` or later.
2729

2830
#### 3. Bootstrap Your Local Environment
2931

examples/production/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"devDependencies": {
2626
"@algorandfoundation/algokit-client-generator": "^4.0.6",
2727
"@algorandfoundation/algokit-utils": "^8.0.3",
28-
"@algorandfoundation/algokit-utils-debug": "^1.0.2",
28+
"@algorandfoundation/algokit-utils-debug": "^1.0.3",
2929
"@algorandfoundation/puya-ts": "^1.0.0-beta.6",
3030
"@rollup/plugin-typescript": "^12.1.2",
3131
"@tsconfig/node20": "^20.1.4",
@@ -37,7 +37,7 @@
3737
"typescript-eslint": "^8.19.1",
3838
"prettier": "^3.4.2",
3939
"ts-node-dev": "^2.0.0",
40-
"@algorandfoundation/algorand-typescript-testing": "^1.0.0-beta.1",
40+
"@algorandfoundation/algorand-typescript-testing": "^1.0.0-beta.2",
4141
"vitest": "^2.1.8",
4242
"@vitest/coverage-v8": "^2.1.8",
4343
"typescript": "^5.7.3"

examples/production/smart_contracts/hello_world/contract.e2e.spec.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Config } from '@algorandfoundation/algokit-utils'
2+
import { registerDebugEventHandlers } from '@algorandfoundation/algokit-utils-debug'
23
import { algorandFixture } from '@algorandfoundation/algokit-utils/testing'
34
import { Address } from 'algosdk'
45
import { beforeAll, beforeEach, describe, expect, test } from 'vitest'
@@ -11,6 +12,7 @@ describe('HelloWorld contract', () => {
1112
debug: true,
1213
// traceAll: true,
1314
})
15+
registerDebugEventHandlers()
1416
})
1517
beforeEach(localnet.beforeEach)
1618

examples/starter/.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,3 @@ coverage
6060
debug_traces/
6161
.algokit/static-analysis/ # Replace with .algokit/static-analysis/tealer/ to enable snapshot checks in CI
6262
.algokit/sources
63-
+1-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
{
22
"files.eol": "\n",
3-
4-
5-
6-
7-
}
3+
}

examples/starter/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This project has been generated using AlgoKit. See below for default getting sta
99
- [Nodejs 20](https://nodejs.org/en/download) or later
1010
- [AlgoKit CLI 2.5](https://github.com/algorandfoundation/algokit-cli?tab=readme-ov-file#install) or later
1111
- [Docker](https://www.docker.com/) (only required for LocalNet)
12+
- [Puya Compiler 4.1.1](https://pypi.org/project/puyapy/) or later
1213

1314
> For interactive tour over the codebase, download [vsls-contrib.codetour](https://marketplace.visualstudio.com/items?itemName=vsls-contrib.codetour) extension for VS Code, then open the [`.codetour.json`](./.tours/getting-started-with-your-algokit-project.tour) file in code tour extension.
1415
@@ -22,6 +23,7 @@ Ensure the following pre-requisites are installed and properly configured:
2223

2324
- **Docker**: Required for running a local Algorand network.
2425
- **AlgoKit CLI**: Essential for project setup and operations. Verify installation with `algokit --version`, expecting `2.5.0` or later.
26+
- **Puya Compiler**: Can be installed from PyPi by running `pipx install puyapy`. Verify installation with `puyapy --version`, expecting `4.1.1` or later.
2527

2628
#### 3. Bootstrap Your Local Environment
2729
Run the following commands within the project folder:

examples/starter/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"devDependencies": {
2020
"@algorandfoundation/algokit-client-generator": "^4.0.6",
2121
"@algorandfoundation/algokit-utils": "^8.0.3",
22-
"@algorandfoundation/algokit-utils-debug": "^1.0.2",
22+
"@algorandfoundation/algokit-utils-debug": "^1.0.3",
2323
"@algorandfoundation/puya-ts": "^1.0.0-beta.6",
2424
"@rollup/plugin-typescript": "^12.1.2",
2525
"@tsconfig/node20": "^20.1.4",

poetry.lock

+108-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ mypy = "^1.1.1"
2020
pre-commit = "^3.2.1"
2121
types-pyyaml = "^6.0.12.9"
2222
pytest-xdist = "^3.3.1"
23+
puyapy = "^4.1.1"
2324

2425
[build-system]
2526
requires = ["poetry-core"]

template_content/.gitignore

+1-3
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ coverage
5757
*.received.*
5858

5959
# AlgoKit
60-
debug-traces/
60+
debug_traces/
6161
.algokit/static-analysis/ # Replace with .algokit/static-analysis/tealer/ to enable snapshot checks in CI
6262
.algokit/sources
63-
.algokit/static-analysis
64-

template_content/README.md.jinja

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This project has been generated using AlgoKit. See below for default getting sta
99
- [Nodejs 20](https://nodejs.org/en/download) or later
1010
- [AlgoKit CLI 2.5](https://github.com/algorandfoundation/algokit-cli?tab=readme-ov-file#install) or later
1111
- [Docker](https://www.docker.com/) (only required for LocalNet)
12+
- [Puya Compiler 4.1.1](https://pypi.org/project/puyapy/) or later
1213

1314
> For interactive tour over the codebase, download [vsls-contrib.codetour](https://marketplace.visualstudio.com/items?itemName=vsls-contrib.codetour) extension for VS Code, then open the [`.codetour.json`](./.tours/getting-started-with-your-algokit-project.tour) file in code tour extension.
1415

@@ -22,6 +23,7 @@ Ensure the following pre-requisites are installed and properly configured:
2223

2324
- **Docker**: Required for running a local Algorand network.
2425
- **AlgoKit CLI**: Essential for project setup and operations. Verify installation with `algokit --version`, expecting `2.5.0` or later.
26+
- **Puya Compiler**: Can be installed from PyPi by running `pipx install puyapy`. Verify installation with `puyapy --version`, expecting `4.1.1` or later.
2527

2628
#### 3. Bootstrap Your Local Environment
2729
Run the following commands within the project folder:

0 commit comments

Comments
 (0)