From 60700af4836c81cea193ac5201f9ca8ba7ea0821 Mon Sep 17 00:00:00 2001 From: Altynbek Orumbayev Date: Tue, 15 Oct 2024 17:59:08 +0200 Subject: [PATCH 01/14] feat: migrating to latest beta prereleases of utils, utils-debug and generator --- .../{{ contract_name }}/deploy-config.ts.j2 | 28 ++++++------ .../package.json | 5 ++- .../cool_contract/deploy-config.ts | 28 ++++++------ .../hello_world/deploy-config.ts | 28 ++++++------ .../smart_contracts/index.ts | 2 + .../tests/hello-world.spec.ts | 44 +++++++++---------- ...pescript' %}deploy-config.ts.j2{% endif %} | 28 ++++++------ ...= 'typescript' %}index.ts{% endif %}.jinja | 2 + ...cript' %}deploy-config.ts{% endif %}.jinja | 28 ++++++------ ...cript_jest %}package.json{% endif %}.jinja | 5 ++- ..._kebab.jinja') %}.spec.ts{% endif %}.jinja | 44 +++++++++---------- 11 files changed, 122 insertions(+), 120 deletions(-) diff --git a/examples/generators/production_python_smart_contract_typescript/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/deploy-config.ts.j2 b/examples/generators/production_python_smart_contract_typescript/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/deploy-config.ts.j2 index ac114cc..bd3ad2d 100644 --- a/examples/generators/production_python_smart_contract_typescript/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/deploy-config.ts.j2 +++ b/examples/generators/production_python_smart_contract_typescript/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/deploy-config.ts.j2 @@ -1,5 +1,5 @@ import * as algokit from '@algorandfoundation/algokit-utils' -import { {{ contract_name.split('_')|map('capitalize')|join }}Client } from '../artifacts/{{ contract_name }}/{{ contract_name.split('_')|map('capitalize')|join }}Client' +import { {{ contract_name.split('_')|map('capitalize')|join }}Factory } from '../artifacts/{{ contract_name }}/{{ contract_name.split('_')|map('capitalize')|join }}Client' // Below is a showcase of various deployment options you can use in TypeScript Client export async function deploy() { @@ -7,27 +7,27 @@ export async function deploy() { const algorand = algokit.AlgorandClient.fromEnvironment() const deployer = await algorand.account.fromEnvironment('DEPLOYER') - - const appClient = algorand.client.getTypedAppClientByCreatorAndName({{ contract_name.split('_')|map('capitalize')|join }}Client, { - sender: deployer, - creatorAddress: deployer.addr, - }) - const app = await appClient.deploy({ - onSchemaBreak: 'append', - onUpdate: 'append', + const factory = algorand.client.getTypedAppFactory({{ contract_name.split('_')|map('capitalize')|join }}Factory, { + defaultSender: deployer.addr, }) + const { appClient, result } = await factory.deploy({ onUpdate: 'append', onSchemaBreak: 'append' }) + // If app was just created fund the app account - if (['create', 'replace'].includes(app.operationPerformed)) { + if (['create', 'replace'].includes(result.operationPerformed)) { await algorand.send.payment({ - amount: algokit.algos(1), + amount: (1).algo(), sender: deployer.addr, receiver: app.appAddress, }) } - const method = 'hello' - const response = await appClient.hello({ name: 'world' }) - console.log(`Called ${method} on ${app.name} (${app.appId}) with name = world, received: ${response.return}`) + const method = 'hello' + const response = await appClient.send.hello({ + args: { name: 'world' }, + }) + console.log( + `Called ${method} on ${appClient.appClient.appName} (${appClient.appClient.appId}) with name = world, received: ${response.return}`, + ) } diff --git a/examples/generators/production_python_smart_contract_typescript/package.json b/examples/generators/production_python_smart_contract_typescript/package.json index e64561d..6b832f0 100644 --- a/examples/generators/production_python_smart_contract_typescript/package.json +++ b/examples/generators/production_python_smart_contract_typescript/package.json @@ -14,11 +14,12 @@ "npm": ">=9.0" }, "dependencies": { - "@algorandfoundation/algokit-utils": "^6.0.2", + "@algorandfoundation/algokit-utils": "7.0.0-beta.14", + "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.2", "algosdk": "^2.7.0" }, "devDependencies": { - "@algorandfoundation/algokit-client-generator": "^3.0.3", + "@algorandfoundation/algokit-client-generator": "v4.0.0-beta.5", "@types/jest": "^29.5.11", "dotenv": "^16.0.3", "prettier": "^2.8.4", diff --git a/examples/generators/production_python_smart_contract_typescript/smart_contracts/cool_contract/deploy-config.ts b/examples/generators/production_python_smart_contract_typescript/smart_contracts/cool_contract/deploy-config.ts index a5dc036..d629083 100644 --- a/examples/generators/production_python_smart_contract_typescript/smart_contracts/cool_contract/deploy-config.ts +++ b/examples/generators/production_python_smart_contract_typescript/smart_contracts/cool_contract/deploy-config.ts @@ -1,5 +1,5 @@ import * as algokit from '@algorandfoundation/algokit-utils' -import { CoolContractClient } from '../artifacts/cool_contract/CoolContractClient' +import { CoolContractFactory } from '../artifacts/cool_contract/CoolContractClient' // Below is a showcase of various deployment options you can use in TypeScript Client export async function deploy() { @@ -7,27 +7,27 @@ export async function deploy() { const algorand = algokit.AlgorandClient.fromEnvironment() const deployer = await algorand.account.fromEnvironment('DEPLOYER') - - const appClient = algorand.client.getTypedAppClientByCreatorAndName(CoolContractClient, { - sender: deployer, - creatorAddress: deployer.addr, - }) - const app = await appClient.deploy({ - onSchemaBreak: 'append', - onUpdate: 'append', + const factory = algorand.client.getTypedAppFactory(CoolContractFactory, { + defaultSender: deployer.addr, }) + const { appClient, result } = await factory.deploy({ onUpdate: 'append', onSchemaBreak: 'append' }) + // If app was just created fund the app account - if (['create', 'replace'].includes(app.operationPerformed)) { + if (['create', 'replace'].includes(result.operationPerformed)) { await algorand.send.payment({ - amount: algokit.algos(1), + amount: (1).algo(), sender: deployer.addr, receiver: app.appAddress, }) } - const method = 'hello' - const response = await appClient.hello({ name: 'world' }) - console.log(`Called ${method} on ${app.name} (${app.appId}) with name = world, received: ${response.return}`) + const method = 'hello' + const response = await appClient.send.hello({ + args: { name: 'world' }, + }) + console.log( + `Called ${method} on ${appClient.appClient.appName} (${appClient.appClient.appId}) with name = world, received: ${response.return}`, + ) } diff --git a/examples/generators/production_python_smart_contract_typescript/smart_contracts/hello_world/deploy-config.ts b/examples/generators/production_python_smart_contract_typescript/smart_contracts/hello_world/deploy-config.ts index 5df7a31..e0608c9 100644 --- a/examples/generators/production_python_smart_contract_typescript/smart_contracts/hello_world/deploy-config.ts +++ b/examples/generators/production_python_smart_contract_typescript/smart_contracts/hello_world/deploy-config.ts @@ -1,5 +1,5 @@ import * as algokit from '@algorandfoundation/algokit-utils' -import { HelloWorldClient } from '../artifacts/hello_world/HelloWorldClient' +import { HelloWorldFactory } from '../artifacts/hello_world/HelloWorldClient' // Below is a showcase of various deployment options you can use in TypeScript Client export async function deploy() { @@ -8,26 +8,26 @@ export async function deploy() { const algorand = algokit.AlgorandClient.fromEnvironment() const deployer = await algorand.account.fromEnvironment('DEPLOYER') - const appClient = algorand.client.getTypedAppClientByCreatorAndName(HelloWorldClient, { - sender: deployer, - creatorAddress: deployer.addr, + const factory = algorand.client.getTypedAppFactory(HelloWorldFactory, { + defaultSender: deployer.addr, }) - const app = await appClient.deploy({ - onSchemaBreak: 'append', - onUpdate: 'append', - }) + const { appClient, result } = await factory.deploy({ onUpdate: 'append', onSchemaBreak: 'append' }) // If app was just created fund the app account - if (['create', 'replace'].includes(app.operationPerformed)) { + if (['create', 'replace'].includes(result.operationPerformed)) { await algorand.send.payment({ - amount: algokit.algos(1), + amount: (1).algo(), sender: deployer.addr, - receiver: app.appAddress, + receiver: appClient.appAddress, }) } - const method = 'hello' - const response = await appClient.hello({ name: 'world' }) - console.log(`Called ${method} on ${app.name} (${app.appId}) with name = world, received: ${response.return}`) + const method = 'hello' + const response = await appClient.send.hello({ + args: { name: 'world' }, + }) + console.log( + `Called ${method} on ${appClient.appClient.appName} (${appClient.appClient.appId}) with name = world, received: ${response.return}`, + ) } diff --git a/examples/generators/production_python_smart_contract_typescript/smart_contracts/index.ts b/examples/generators/production_python_smart_contract_typescript/smart_contracts/index.ts index 6955e33..623ca2b 100644 --- a/examples/generators/production_python_smart_contract_typescript/smart_contracts/index.ts +++ b/examples/generators/production_python_smart_contract_typescript/smart_contracts/index.ts @@ -2,6 +2,7 @@ import * as fs from 'fs' import * as path from 'path' import { consoleLogger } from '@algorandfoundation/algokit-utils/types/logging' import * as algokit from '@algorandfoundation/algokit-utils' +// import { registerDebugEventHandlers } from '@algorandfoundation/algokit-utils-debug' // Uncomment to enable persisting artifacts required by AlgoKit AVM Debugger // Uncomment the debug and traceAll options to enable auto generation of AVM Debugger compliant sourceMap and simulation trace file. // Learn more about using AlgoKit AVM Debugger to debug your TEAL source codes and inspect various kinds of Algorand transactions in atomic groups -> https://github.com/algorandfoundation/algokit-avm-vscode-Debugger @@ -11,6 +12,7 @@ algokit.Config.configure({ // debug: true, // traceAll: true, }) +// registerDebugEventHandlers() // Uncomment to enable persisting artifacts required by AlgoKit AVM Debugger // base directory const baseDir = path.resolve(__dirname) diff --git a/examples/generators/production_python_smart_contract_typescript/tests/hello-world.spec.ts b/examples/generators/production_python_smart_contract_typescript/tests/hello-world.spec.ts index 0c99f4b..c2ce598 100644 --- a/examples/generators/production_python_smart_contract_typescript/tests/hello-world.spec.ts +++ b/examples/generators/production_python_smart_contract_typescript/tests/hello-world.spec.ts @@ -1,7 +1,8 @@ import { algorandFixture } from '@algorandfoundation/algokit-utils/testing' -import { HelloWorldClient } from '../smart_contracts/artifacts/hello_world/HelloWorldClient' +import { HelloWorldFactory } from '../smart_contracts/artifacts/hello_world/HelloWorldClient' import { Account, Algodv2, Indexer } from 'algosdk' import * as algokit from '@algorandfoundation/algokit-utils' +import { TransactionSignerAccount } from '@algorandfoundation/algokit-utils/types/account' describe('hello world contract', () => { const localnet = algorandFixture() @@ -13,39 +14,36 @@ describe('hello world contract', () => { }) beforeEach(localnet.beforeEach) - const deploy = async (account: Account, algod: Algodv2, indexer: Indexer) => { - const client = new HelloWorldClient( - { - resolveBy: 'creatorAndName', - findExistingUsing: indexer, - sender: account, - creatorAddress: account.addr, - }, - algod, - ) - await client.deploy({ - onSchemaBreak: 'append', - onUpdate: 'append', + const deploy = async (account: Account & TransactionSignerAccount) => { + const factory = localnet.algorand.client.getTypedAppFactory(HelloWorldFactory, { + defaultSender: account.addr, + defaultSigner: account.signer, }) - return { client } + + const { appClient } = await factory.deploy({ onUpdate: 'append', onSchemaBreak: 'append' }) + return { client: appClient } } test('says hello', async () => { - const { algod, indexer, testAccount } = localnet.context - const { client } = await deploy(testAccount, algod, indexer) + const { testAccount } = localnet.context + const { client } = await deploy(testAccount) - const result = await client.hello({ name: 'World' }) + const result = await client.send.hello({ args: { name: 'World' } }) expect(result.return).toBe('Hello, World') }) test('simulate says hello with correct budget consumed', async () => { - const { algod, indexer, testAccount } = localnet.context - const { client } = await deploy(testAccount, algod, indexer) - const result = await client.compose().hello({ name: 'World' }).hello({ name: 'Jane' }).simulate() + const { testAccount } = localnet.context + const { client } = await deploy(testAccount) + const result = await client + .newGroup() + .hello({ args: { name: 'World' } }) + .hello({ args: { name: 'Jane' } }) + .simulate() - expect(result.methodResults[0].returnValue).toBe('Hello, World') - expect(result.methodResults[1].returnValue).toBe('Hello, Jane') + expect(result.returns[0]).toBe('Hello, World') + expect(result.returns[1]).toBe('Hello, Jane') expect(result.simulateResponse.txnGroups[0].appBudgetConsumed).toBeLessThan(100) }) }) diff --git a/template_content/.algokit/generators/create_contract/smart_contracts/{% raw %}{{ contract_name }}{% endraw %}/{% if deployment_language == 'typescript' %}deploy-config.ts.j2{% endif %} b/template_content/.algokit/generators/create_contract/smart_contracts/{% raw %}{{ contract_name }}{% endraw %}/{% if deployment_language == 'typescript' %}deploy-config.ts.j2{% endif %} index ac114cc..bd3ad2d 100644 --- a/template_content/.algokit/generators/create_contract/smart_contracts/{% raw %}{{ contract_name }}{% endraw %}/{% if deployment_language == 'typescript' %}deploy-config.ts.j2{% endif %} +++ b/template_content/.algokit/generators/create_contract/smart_contracts/{% raw %}{{ contract_name }}{% endraw %}/{% if deployment_language == 'typescript' %}deploy-config.ts.j2{% endif %} @@ -1,5 +1,5 @@ import * as algokit from '@algorandfoundation/algokit-utils' -import { {{ contract_name.split('_')|map('capitalize')|join }}Client } from '../artifacts/{{ contract_name }}/{{ contract_name.split('_')|map('capitalize')|join }}Client' +import { {{ contract_name.split('_')|map('capitalize')|join }}Factory } from '../artifacts/{{ contract_name }}/{{ contract_name.split('_')|map('capitalize')|join }}Client' // Below is a showcase of various deployment options you can use in TypeScript Client export async function deploy() { @@ -7,27 +7,27 @@ export async function deploy() { const algorand = algokit.AlgorandClient.fromEnvironment() const deployer = await algorand.account.fromEnvironment('DEPLOYER') - - const appClient = algorand.client.getTypedAppClientByCreatorAndName({{ contract_name.split('_')|map('capitalize')|join }}Client, { - sender: deployer, - creatorAddress: deployer.addr, - }) - const app = await appClient.deploy({ - onSchemaBreak: 'append', - onUpdate: 'append', + const factory = algorand.client.getTypedAppFactory({{ contract_name.split('_')|map('capitalize')|join }}Factory, { + defaultSender: deployer.addr, }) + const { appClient, result } = await factory.deploy({ onUpdate: 'append', onSchemaBreak: 'append' }) + // If app was just created fund the app account - if (['create', 'replace'].includes(app.operationPerformed)) { + if (['create', 'replace'].includes(result.operationPerformed)) { await algorand.send.payment({ - amount: algokit.algos(1), + amount: (1).algo(), sender: deployer.addr, receiver: app.appAddress, }) } - const method = 'hello' - const response = await appClient.hello({ name: 'world' }) - console.log(`Called ${method} on ${app.name} (${app.appId}) with name = world, received: ${response.return}`) + const method = 'hello' + const response = await appClient.send.hello({ + args: { name: 'world' }, + }) + console.log( + `Called ${method} on ${appClient.appClient.appName} (${appClient.appClient.appId}) with name = world, received: ${response.return}`, + ) } diff --git a/template_content/smart_contracts/{% if deployment_language == 'typescript' %}index.ts{% endif %}.jinja b/template_content/smart_contracts/{% if deployment_language == 'typescript' %}index.ts{% endif %}.jinja index 6955e33..623ca2b 100644 --- a/template_content/smart_contracts/{% if deployment_language == 'typescript' %}index.ts{% endif %}.jinja +++ b/template_content/smart_contracts/{% if deployment_language == 'typescript' %}index.ts{% endif %}.jinja @@ -2,6 +2,7 @@ import * as fs from 'fs' import * as path from 'path' import { consoleLogger } from '@algorandfoundation/algokit-utils/types/logging' import * as algokit from '@algorandfoundation/algokit-utils' +// import { registerDebugEventHandlers } from '@algorandfoundation/algokit-utils-debug' // Uncomment to enable persisting artifacts required by AlgoKit AVM Debugger // Uncomment the debug and traceAll options to enable auto generation of AVM Debugger compliant sourceMap and simulation trace file. // Learn more about using AlgoKit AVM Debugger to debug your TEAL source codes and inspect various kinds of Algorand transactions in atomic groups -> https://github.com/algorandfoundation/algokit-avm-vscode-Debugger @@ -11,6 +12,7 @@ algokit.Config.configure({ // debug: true, // traceAll: true, }) +// registerDebugEventHandlers() // Uncomment to enable persisting artifacts required by AlgoKit AVM Debugger // base directory const baseDir = path.resolve(__dirname) diff --git a/template_content/smart_contracts/{{ contract_name }}/{% if deployment_language == 'typescript' %}deploy-config.ts{% endif %}.jinja b/template_content/smart_contracts/{{ contract_name }}/{% if deployment_language == 'typescript' %}deploy-config.ts{% endif %}.jinja index ba3fc68..a375c9f 100644 --- a/template_content/smart_contracts/{{ contract_name }}/{% if deployment_language == 'typescript' %}deploy-config.ts{% endif %}.jinja +++ b/template_content/smart_contracts/{{ contract_name }}/{% if deployment_language == 'typescript' %}deploy-config.ts{% endif %}.jinja @@ -1,5 +1,5 @@ import * as algokit from '@algorandfoundation/algokit-utils' -import { {{ contract_name.split('_')|map('capitalize')|join }}Client } from '../artifacts/{{ contract_name }}/{{ contract_name.split('_')|map('capitalize')|join }}Client' +import { {{ contract_name.split('_')|map('capitalize')|join }}Factory } from '../artifacts/{{ contract_name }}/{{ contract_name.split('_')|map('capitalize')|join }}Client' // Below is a showcase of various deployment options you can use in TypeScript Client export async function deploy() { @@ -8,26 +8,26 @@ export async function deploy() { const algorand = algokit.AlgorandClient.fromEnvironment() const deployer = await algorand.account.fromEnvironment('DEPLOYER') - const appClient = algorand.client.getTypedAppClientByCreatorAndName({% include pathjoin('includes', 'contract_name_pascal.jinja') %}Client, { - sender: deployer, - creatorAddress: deployer.addr, + const factory = algorand.client.getTypedAppFactory({{ contract_name.split('_')|map('capitalize')|join }}Factory, { + defaultSender: deployer.addr, }) - const app = await appClient.deploy({ - onSchemaBreak: 'append', - onUpdate: 'append', - }) + const { appClient, result } = await factory.deploy({ onUpdate: 'append', onSchemaBreak: 'append' }) // If app was just created fund the app account - if (['create', 'replace'].includes(app.operationPerformed)) { + if (['create', 'replace'].includes(result.operationPerformed)) { await algorand.send.payment({ - amount: algokit.algos(1), + amount: (1).algo(), sender: deployer.addr, - receiver: app.appAddress, + receiver: appClient.appAddress, }) } - const method = 'hello' - const response = await appClient.hello({ name: 'world' }) - console.log(`Called ${method} on ${app.name} (${app.appId}) with name = world, received: ${response.return}`) + const method = 'hello' + const response = await appClient.send.hello({ + args: { name: 'world' }, + }) + console.log( + `Called ${method} on ${appClient.appClient.appName} (${appClient.appClient.appId}) with name = world, received: ${response.return}`, + ) } diff --git a/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja b/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja index 14b0174..87849d6 100644 --- a/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja +++ b/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja @@ -16,11 +16,12 @@ "npm": ">=9.0" }, "dependencies": { - "@algorandfoundation/algokit-utils": "^6.0.2", + "@algorandfoundation/algokit-utils": "7.0.0-beta.14", + "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.2", "algosdk": "^2.7.0" }, "devDependencies": { - "@algorandfoundation/algokit-client-generator": "^3.0.3", + "@algorandfoundation/algokit-client-generator": "v4.0.0-beta.5", {%- if use_typescript_jest %} "@types/jest": "^29.5.11", {%- endif %} diff --git a/template_content/{% if use_typescript_jest %}tests{% endif %}/{% if use_typescript_jest %}{% include pathjoin('includes', 'contract_name_kebab.jinja') %}.spec.ts{% endif %}.jinja b/template_content/{% if use_typescript_jest %}tests{% endif %}/{% if use_typescript_jest %}{% include pathjoin('includes', 'contract_name_kebab.jinja') %}.spec.ts{% endif %}.jinja index 5f54543..b7ea209 100644 --- a/template_content/{% if use_typescript_jest %}tests{% endif %}/{% if use_typescript_jest %}{% include pathjoin('includes', 'contract_name_kebab.jinja') %}.spec.ts{% endif %}.jinja +++ b/template_content/{% if use_typescript_jest %}tests{% endif %}/{% if use_typescript_jest %}{% include pathjoin('includes', 'contract_name_kebab.jinja') %}.spec.ts{% endif %}.jinja @@ -1,7 +1,8 @@ import { algorandFixture } from '@algorandfoundation/algokit-utils/testing' -import { {% include pathjoin('includes', 'contract_name_pascal.jinja') %}Client } from '../smart_contracts/artifacts/{{ contract_name }}/{{ contract_name.split('_')|map('capitalize')|join }}Client' +import { {% include pathjoin('includes', 'contract_name_pascal.jinja') %}Factory } from '../smart_contracts/artifacts/{{ contract_name }}/{{ contract_name.split('_')|map('capitalize')|join }}Client' import { Account, Algodv2, Indexer } from 'algosdk' import * as algokit from '@algorandfoundation/algokit-utils' +import { TransactionSignerAccount } from '@algorandfoundation/algokit-utils/types/account' describe('{{ contract_name.split('_')|join(' ') }} contract', () => { const localnet = algorandFixture() @@ -13,39 +14,36 @@ describe('{{ contract_name.split('_')|join(' ') }} contract', () => { }) beforeEach(localnet.beforeEach) - const deploy = async (account: Account, algod: Algodv2, indexer: Indexer) => { - const client = new {% include pathjoin('includes', 'contract_name_pascal.jinja') %}Client( - { - resolveBy: 'creatorAndName', - findExistingUsing: indexer, - sender: account, - creatorAddress: account.addr, - }, - algod, - ) - await client.deploy({ - onSchemaBreak: 'append', - onUpdate: 'append', + const deploy = async (account: Account & TransactionSignerAccount) => { + const factory = localnet.algorand.client.getTypedAppFactory({% include pathjoin('includes', 'contract_name_pascal.jinja') %}Factory, { + defaultSender: account.addr, + defaultSigner: account.signer, }) - return { client } + + const { appClient } = await factory.deploy({ onUpdate: 'append', onSchemaBreak: 'append' }) + return { client: appClient } } test('says hello', async () => { - const { algod, indexer, testAccount } = localnet.context - const { client } = await deploy(testAccount, algod, indexer) + const { testAccount } = localnet.context + const { client } = await deploy(testAccount) - const result = await client.hello({ name: 'World' }) + const result = await client.send.hello({ args: { name: 'World' } }) expect(result.return).toBe('Hello, World') }) test('simulate says hello with correct budget consumed', async () => { - const { algod, indexer, testAccount } = localnet.context - const { client } = await deploy(testAccount, algod, indexer) - const result = await client.compose().hello({ name: 'World' }).hello({ name: 'Jane' }).simulate() + const { testAccount } = localnet.context + const { client } = await deploy(testAccount) + const result = await client + .newGroup() + .hello({ args: { name: 'World' } }) + .hello({ args: { name: 'Jane' } }) + .simulate() - expect(result.methodResults[0].returnValue).toBe('Hello, World') - expect(result.methodResults[1].returnValue).toBe('Hello, Jane') + expect(result.returns[0]).toBe('Hello, World') + expect(result.returns[1]).toBe('Hello, Jane') expect(result.simulateResponse.txnGroups[0].appBudgetConsumed).toBeLessThan(100) }) }) From 554c3ae0c33e88a067ea58e0cc1a254481ae1ffe Mon Sep 17 00:00:00 2001 From: Altynbek Orumbayev Date: Wed, 16 Oct 2024 13:47:45 +0200 Subject: [PATCH 02/14] chore: disabling mypy in tests and artifacts folders for python generator cases --- .../{{ contract_name }}/deploy-config.ts.j2 | 28 +++++++++---------- .../package.json | 5 ++-- .../cool_contract/deploy-config.ts | 28 +++++++++---------- .../hello_world/deploy-config.ts | 28 +++++++++---------- .../smart_contracts/index.ts | 2 ++ examples/production_python/pyproject.toml | 6 ++++ template_content/pyproject.toml.jinja | 6 ++++ 7 files changed, 59 insertions(+), 44 deletions(-) diff --git a/examples/generators/starter_python_smart_contract_typescript/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/deploy-config.ts.j2 b/examples/generators/starter_python_smart_contract_typescript/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/deploy-config.ts.j2 index ac114cc..bd3ad2d 100644 --- a/examples/generators/starter_python_smart_contract_typescript/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/deploy-config.ts.j2 +++ b/examples/generators/starter_python_smart_contract_typescript/.algokit/generators/create_contract/smart_contracts/{{ contract_name }}/deploy-config.ts.j2 @@ -1,5 +1,5 @@ import * as algokit from '@algorandfoundation/algokit-utils' -import { {{ contract_name.split('_')|map('capitalize')|join }}Client } from '../artifacts/{{ contract_name }}/{{ contract_name.split('_')|map('capitalize')|join }}Client' +import { {{ contract_name.split('_')|map('capitalize')|join }}Factory } from '../artifacts/{{ contract_name }}/{{ contract_name.split('_')|map('capitalize')|join }}Client' // Below is a showcase of various deployment options you can use in TypeScript Client export async function deploy() { @@ -7,27 +7,27 @@ export async function deploy() { const algorand = algokit.AlgorandClient.fromEnvironment() const deployer = await algorand.account.fromEnvironment('DEPLOYER') - - const appClient = algorand.client.getTypedAppClientByCreatorAndName({{ contract_name.split('_')|map('capitalize')|join }}Client, { - sender: deployer, - creatorAddress: deployer.addr, - }) - const app = await appClient.deploy({ - onSchemaBreak: 'append', - onUpdate: 'append', + const factory = algorand.client.getTypedAppFactory({{ contract_name.split('_')|map('capitalize')|join }}Factory, { + defaultSender: deployer.addr, }) + const { appClient, result } = await factory.deploy({ onUpdate: 'append', onSchemaBreak: 'append' }) + // If app was just created fund the app account - if (['create', 'replace'].includes(app.operationPerformed)) { + if (['create', 'replace'].includes(result.operationPerformed)) { await algorand.send.payment({ - amount: algokit.algos(1), + amount: (1).algo(), sender: deployer.addr, receiver: app.appAddress, }) } - const method = 'hello' - const response = await appClient.hello({ name: 'world' }) - console.log(`Called ${method} on ${app.name} (${app.appId}) with name = world, received: ${response.return}`) + const method = 'hello' + const response = await appClient.send.hello({ + args: { name: 'world' }, + }) + console.log( + `Called ${method} on ${appClient.appClient.appName} (${appClient.appClient.appId}) with name = world, received: ${response.return}`, + ) } diff --git a/examples/generators/starter_python_smart_contract_typescript/package.json b/examples/generators/starter_python_smart_contract_typescript/package.json index e329b0d..978b8c3 100644 --- a/examples/generators/starter_python_smart_contract_typescript/package.json +++ b/examples/generators/starter_python_smart_contract_typescript/package.json @@ -13,11 +13,12 @@ "npm": ">=9.0" }, "dependencies": { - "@algorandfoundation/algokit-utils": "^6.0.2", + "@algorandfoundation/algokit-utils": "7.0.0-beta.14", + "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.2", "algosdk": "^2.7.0" }, "devDependencies": { - "@algorandfoundation/algokit-client-generator": "^3.0.3", + "@algorandfoundation/algokit-client-generator": "v4.0.0-beta.5", "dotenv": "^16.0.3", "prettier": "^2.8.4", "ts-node-dev": "^2.0.0", diff --git a/examples/generators/starter_python_smart_contract_typescript/smart_contracts/cool_contract/deploy-config.ts b/examples/generators/starter_python_smart_contract_typescript/smart_contracts/cool_contract/deploy-config.ts index a5dc036..d629083 100644 --- a/examples/generators/starter_python_smart_contract_typescript/smart_contracts/cool_contract/deploy-config.ts +++ b/examples/generators/starter_python_smart_contract_typescript/smart_contracts/cool_contract/deploy-config.ts @@ -1,5 +1,5 @@ import * as algokit from '@algorandfoundation/algokit-utils' -import { CoolContractClient } from '../artifacts/cool_contract/CoolContractClient' +import { CoolContractFactory } from '../artifacts/cool_contract/CoolContractClient' // Below is a showcase of various deployment options you can use in TypeScript Client export async function deploy() { @@ -7,27 +7,27 @@ export async function deploy() { const algorand = algokit.AlgorandClient.fromEnvironment() const deployer = await algorand.account.fromEnvironment('DEPLOYER') - - const appClient = algorand.client.getTypedAppClientByCreatorAndName(CoolContractClient, { - sender: deployer, - creatorAddress: deployer.addr, - }) - const app = await appClient.deploy({ - onSchemaBreak: 'append', - onUpdate: 'append', + const factory = algorand.client.getTypedAppFactory(CoolContractFactory, { + defaultSender: deployer.addr, }) + const { appClient, result } = await factory.deploy({ onUpdate: 'append', onSchemaBreak: 'append' }) + // If app was just created fund the app account - if (['create', 'replace'].includes(app.operationPerformed)) { + if (['create', 'replace'].includes(result.operationPerformed)) { await algorand.send.payment({ - amount: algokit.algos(1), + amount: (1).algo(), sender: deployer.addr, receiver: app.appAddress, }) } - const method = 'hello' - const response = await appClient.hello({ name: 'world' }) - console.log(`Called ${method} on ${app.name} (${app.appId}) with name = world, received: ${response.return}`) + const method = 'hello' + const response = await appClient.send.hello({ + args: { name: 'world' }, + }) + console.log( + `Called ${method} on ${appClient.appClient.appName} (${appClient.appClient.appId}) with name = world, received: ${response.return}`, + ) } diff --git a/examples/generators/starter_python_smart_contract_typescript/smart_contracts/hello_world/deploy-config.ts b/examples/generators/starter_python_smart_contract_typescript/smart_contracts/hello_world/deploy-config.ts index 5df7a31..e0608c9 100644 --- a/examples/generators/starter_python_smart_contract_typescript/smart_contracts/hello_world/deploy-config.ts +++ b/examples/generators/starter_python_smart_contract_typescript/smart_contracts/hello_world/deploy-config.ts @@ -1,5 +1,5 @@ import * as algokit from '@algorandfoundation/algokit-utils' -import { HelloWorldClient } from '../artifacts/hello_world/HelloWorldClient' +import { HelloWorldFactory } from '../artifacts/hello_world/HelloWorldClient' // Below is a showcase of various deployment options you can use in TypeScript Client export async function deploy() { @@ -8,26 +8,26 @@ export async function deploy() { const algorand = algokit.AlgorandClient.fromEnvironment() const deployer = await algorand.account.fromEnvironment('DEPLOYER') - const appClient = algorand.client.getTypedAppClientByCreatorAndName(HelloWorldClient, { - sender: deployer, - creatorAddress: deployer.addr, + const factory = algorand.client.getTypedAppFactory(HelloWorldFactory, { + defaultSender: deployer.addr, }) - const app = await appClient.deploy({ - onSchemaBreak: 'append', - onUpdate: 'append', - }) + const { appClient, result } = await factory.deploy({ onUpdate: 'append', onSchemaBreak: 'append' }) // If app was just created fund the app account - if (['create', 'replace'].includes(app.operationPerformed)) { + if (['create', 'replace'].includes(result.operationPerformed)) { await algorand.send.payment({ - amount: algokit.algos(1), + amount: (1).algo(), sender: deployer.addr, - receiver: app.appAddress, + receiver: appClient.appAddress, }) } - const method = 'hello' - const response = await appClient.hello({ name: 'world' }) - console.log(`Called ${method} on ${app.name} (${app.appId}) with name = world, received: ${response.return}`) + const method = 'hello' + const response = await appClient.send.hello({ + args: { name: 'world' }, + }) + console.log( + `Called ${method} on ${appClient.appClient.appName} (${appClient.appClient.appId}) with name = world, received: ${response.return}`, + ) } diff --git a/examples/generators/starter_python_smart_contract_typescript/smart_contracts/index.ts b/examples/generators/starter_python_smart_contract_typescript/smart_contracts/index.ts index 6955e33..623ca2b 100644 --- a/examples/generators/starter_python_smart_contract_typescript/smart_contracts/index.ts +++ b/examples/generators/starter_python_smart_contract_typescript/smart_contracts/index.ts @@ -2,6 +2,7 @@ import * as fs from 'fs' import * as path from 'path' import { consoleLogger } from '@algorandfoundation/algokit-utils/types/logging' import * as algokit from '@algorandfoundation/algokit-utils' +// import { registerDebugEventHandlers } from '@algorandfoundation/algokit-utils-debug' // Uncomment to enable persisting artifacts required by AlgoKit AVM Debugger // Uncomment the debug and traceAll options to enable auto generation of AVM Debugger compliant sourceMap and simulation trace file. // Learn more about using AlgoKit AVM Debugger to debug your TEAL source codes and inspect various kinds of Algorand transactions in atomic groups -> https://github.com/algorandfoundation/algokit-avm-vscode-Debugger @@ -11,6 +12,7 @@ algokit.Config.configure({ // debug: true, // traceAll: true, }) +// registerDebugEventHandlers() // Uncomment to enable persisting artifacts required by AlgoKit AVM Debugger // base directory const baseDir = path.resolve(__dirname) diff --git a/examples/production_python/pyproject.toml b/examples/production_python/pyproject.toml index d5d82aa..9c6617e 100644 --- a/examples/production_python/pyproject.toml +++ b/examples/production_python/pyproject.toml @@ -63,3 +63,9 @@ disallow_any_unimported = true disallow_any_expr = true disallow_any_decorated = true disallow_any_explicit = true +exclude = ["^smart_contracts/artifacts/.*$"] + +[[tool.mypy.overrides]] +module = "smart_contracts.artifacts.*" +ignore_missing_imports = true +follow_imports = "silent" diff --git a/template_content/pyproject.toml.jinja b/template_content/pyproject.toml.jinja index a5e7eb7..1ded6a8 100644 --- a/template_content/pyproject.toml.jinja +++ b/template_content/pyproject.toml.jinja @@ -82,4 +82,10 @@ disallow_any_unimported = true disallow_any_expr = true disallow_any_decorated = true disallow_any_explicit = true +exclude = ["^smart_contracts/artifacts/.*$"] + +[[tool.mypy.overrides]] +module = "smart_contracts.artifacts.*" +ignore_missing_imports = true +follow_imports = "silent" {% endif -%} From 2a9086fac8c9b836ba8efee4b05c47a854173d40 Mon Sep 17 00:00:00 2001 From: Altynbek Orumbayev Date: Wed, 16 Oct 2024 14:16:05 +0200 Subject: [PATCH 03/14] chore: pinning mypy to 1.11.0; to be resolved in separate pr --- .../pyproject.toml | 4 ++-- .../pyproject.toml | 4 ++-- examples/production_python/pyproject.toml | 10 ++-------- template_content/pyproject.toml.jinja | 10 ++-------- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/examples/generators/production_python_smart_contract_python/pyproject.toml b/examples/generators/production_python_smart_contract_python/pyproject.toml index 99fda3c..7e759c3 100644 --- a/examples/generators/production_python_smart_contract_python/pyproject.toml +++ b/examples/generators/production_python_smart_contract_python/pyproject.toml @@ -17,7 +17,7 @@ algorand-python-testing = "^0.4.0" algokit-client-generator = "^1.1.3" black = {extras = ["d"], version = "*"} ruff = "^0.1.6" -mypy = "*" +mypy = "1.11.0" pytest = "*" pytest-cov = "*" pip-audit = "*" @@ -58,7 +58,7 @@ warn_redundant_casts = true warn_unused_ignores = true warn_return_any = true strict_equality = true -strict_concatenate = true +extra_checks = true disallow_any_unimported = true disallow_any_expr = true disallow_any_decorated = true diff --git a/examples/generators/production_python_smart_contract_typescript/pyproject.toml b/examples/generators/production_python_smart_contract_typescript/pyproject.toml index b0e4ada..a1fc317 100644 --- a/examples/generators/production_python_smart_contract_typescript/pyproject.toml +++ b/examples/generators/production_python_smart_contract_typescript/pyproject.toml @@ -16,7 +16,7 @@ algorand-python-testing = "^0.4.0" [tool.poetry.group.dev.dependencies] black = {extras = ["d"], version = "*"} ruff = "^0.1.6" -mypy = "*" +mypy = "1.11.0" pip-audit = "*" pre-commit = "*" puyapy = "*" @@ -52,7 +52,7 @@ warn_redundant_casts = true warn_unused_ignores = true warn_return_any = true strict_equality = true -strict_concatenate = true +extra_checks = true disallow_any_unimported = true disallow_any_expr = true disallow_any_decorated = true diff --git a/examples/production_python/pyproject.toml b/examples/production_python/pyproject.toml index 9c6617e..0417b16 100644 --- a/examples/production_python/pyproject.toml +++ b/examples/production_python/pyproject.toml @@ -17,7 +17,7 @@ algorand-python-testing = "^0.4.0" algokit-client-generator = "^1.1.3" black = {extras = ["d"], version = "*"} ruff = "^0.1.6" -mypy = "*" +mypy = "1.11.0" pytest = "*" pytest-cov = "*" pip-audit = "*" @@ -58,14 +58,8 @@ warn_redundant_casts = true warn_unused_ignores = true warn_return_any = true strict_equality = true -strict_concatenate = true +extra_checks = true disallow_any_unimported = true disallow_any_expr = true disallow_any_decorated = true disallow_any_explicit = true -exclude = ["^smart_contracts/artifacts/.*$"] - -[[tool.mypy.overrides]] -module = "smart_contracts.artifacts.*" -ignore_missing_imports = true -follow_imports = "silent" diff --git a/template_content/pyproject.toml.jinja b/template_content/pyproject.toml.jinja index 1ded6a8..a6f2c8c 100644 --- a/template_content/pyproject.toml.jinja +++ b/template_content/pyproject.toml.jinja @@ -26,7 +26,7 @@ ruff = "^0.1.6" flake8 = "*" {% endif -%} {% if use_python_mypy -%} -mypy = "*" +mypy = "1.11.0" {% endif -%} {% if use_python_pytest -%} pytest = "*" @@ -77,15 +77,9 @@ warn_redundant_casts = true warn_unused_ignores = true warn_return_any = true strict_equality = true -strict_concatenate = true +extra_checks = true disallow_any_unimported = true disallow_any_expr = true disallow_any_decorated = true disallow_any_explicit = true -exclude = ["^smart_contracts/artifacts/.*$"] - -[[tool.mypy.overrides]] -module = "smart_contracts.artifacts.*" -ignore_missing_imports = true -follow_imports = "silent" {% endif -%} From 277d8a11ee4a1b09cb91e3729d3aacb4e55aa506 Mon Sep 17 00:00:00 2001 From: Altynbek Orumbayev Date: Wed, 16 Oct 2024 15:15:26 +0200 Subject: [PATCH 04/14] chore: temporary setting puya installation from puya debugging branch --- .../production_python_smart_contract_python/pyproject.toml | 2 +- .../smart_contracts/_helpers/build.py | 1 - .../production_python_smart_contract_typescript/pyproject.toml | 2 +- .../smart_contracts/_helpers/build.py | 1 - .../starter_python_smart_contract_python/pyproject.toml | 2 +- .../smart_contracts/_helpers/build.py | 1 - .../starter_python_smart_contract_typescript/pyproject.toml | 2 +- .../smart_contracts/_helpers/build.py | 1 - examples/production_python/pyproject.toml | 2 +- examples/production_python/smart_contracts/_helpers/build.py | 1 - examples/starter_python/pyproject.toml | 2 +- examples/starter_python/smart_contracts/_helpers/build.py | 1 - template_content/pyproject.toml.jinja | 2 +- template_content/smart_contracts/_helpers/build.py.jinja | 1 - 14 files changed, 7 insertions(+), 14 deletions(-) diff --git a/examples/generators/production_python_smart_contract_python/pyproject.toml b/examples/generators/production_python_smart_contract_python/pyproject.toml index 7e759c3..58766b4 100644 --- a/examples/generators/production_python_smart_contract_python/pyproject.toml +++ b/examples/generators/production_python_smart_contract_python/pyproject.toml @@ -22,7 +22,7 @@ pytest = "*" pytest-cov = "*" pip-audit = "*" pre-commit = "*" -puyapy = "*" +puyapy = { git = "https://github.com/algorandfoundation/puya.git", branch = "puya-debug-info" } [build-system] requires = ["poetry-core"] diff --git a/examples/generators/production_python_smart_contract_python/smart_contracts/_helpers/build.py b/examples/generators/production_python_smart_contract_python/smart_contracts/_helpers/build.py index 20770e8..771b585 100644 --- a/examples/generators/production_python_smart_contract_python/smart_contracts/_helpers/build.py +++ b/examples/generators/production_python_smart_contract_python/smart_contracts/_helpers/build.py @@ -31,7 +31,6 @@ def build(output_dir: Path, contract_path: Path) -> Path: contract_path.absolute(), f"--out-dir={output_dir}", "--output-arc32", - "--debug-level=0", ], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, diff --git a/examples/generators/production_python_smart_contract_typescript/pyproject.toml b/examples/generators/production_python_smart_contract_typescript/pyproject.toml index a1fc317..f82443d 100644 --- a/examples/generators/production_python_smart_contract_typescript/pyproject.toml +++ b/examples/generators/production_python_smart_contract_typescript/pyproject.toml @@ -19,7 +19,7 @@ ruff = "^0.1.6" mypy = "1.11.0" pip-audit = "*" pre-commit = "*" -puyapy = "*" +puyapy = { git = "https://github.com/algorandfoundation/puya.git", branch = "puya-debug-info" } [build-system] requires = ["poetry-core"] diff --git a/examples/generators/production_python_smart_contract_typescript/smart_contracts/_helpers/build.py b/examples/generators/production_python_smart_contract_typescript/smart_contracts/_helpers/build.py index ea0a8d5..a78f2d9 100644 --- a/examples/generators/production_python_smart_contract_typescript/smart_contracts/_helpers/build.py +++ b/examples/generators/production_python_smart_contract_typescript/smart_contracts/_helpers/build.py @@ -31,7 +31,6 @@ def build(output_dir: Path, contract_path: Path) -> Path: contract_path.absolute(), f"--out-dir={output_dir}", "--output-arc32", - "--debug-level=0", ], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, diff --git a/examples/generators/starter_python_smart_contract_python/pyproject.toml b/examples/generators/starter_python_smart_contract_python/pyproject.toml index 8000ea4..05fbeb5 100644 --- a/examples/generators/starter_python_smart_contract_python/pyproject.toml +++ b/examples/generators/starter_python_smart_contract_python/pyproject.toml @@ -15,7 +15,7 @@ algorand-python-testing = "^0.4.0" [tool.poetry.group.dev.dependencies] algokit-client-generator = "^1.1.3" -puyapy = "*" +puyapy = { git = "https://github.com/algorandfoundation/puya.git", branch = "puya-debug-info" } [build-system] requires = ["poetry-core"] diff --git a/examples/generators/starter_python_smart_contract_python/smart_contracts/_helpers/build.py b/examples/generators/starter_python_smart_contract_python/smart_contracts/_helpers/build.py index 20770e8..771b585 100644 --- a/examples/generators/starter_python_smart_contract_python/smart_contracts/_helpers/build.py +++ b/examples/generators/starter_python_smart_contract_python/smart_contracts/_helpers/build.py @@ -31,7 +31,6 @@ def build(output_dir: Path, contract_path: Path) -> Path: contract_path.absolute(), f"--out-dir={output_dir}", "--output-arc32", - "--debug-level=0", ], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, diff --git a/examples/generators/starter_python_smart_contract_typescript/pyproject.toml b/examples/generators/starter_python_smart_contract_typescript/pyproject.toml index 7db2d1f..bd6c7d3 100644 --- a/examples/generators/starter_python_smart_contract_typescript/pyproject.toml +++ b/examples/generators/starter_python_smart_contract_typescript/pyproject.toml @@ -14,7 +14,7 @@ algorand-python = "^2.0.0" algorand-python-testing = "^0.4.0" [tool.poetry.group.dev.dependencies] -puyapy = "*" +puyapy = { git = "https://github.com/algorandfoundation/puya.git", branch = "puya-debug-info" } [build-system] requires = ["poetry-core"] diff --git a/examples/generators/starter_python_smart_contract_typescript/smart_contracts/_helpers/build.py b/examples/generators/starter_python_smart_contract_typescript/smart_contracts/_helpers/build.py index ea0a8d5..a78f2d9 100644 --- a/examples/generators/starter_python_smart_contract_typescript/smart_contracts/_helpers/build.py +++ b/examples/generators/starter_python_smart_contract_typescript/smart_contracts/_helpers/build.py @@ -31,7 +31,6 @@ def build(output_dir: Path, contract_path: Path) -> Path: contract_path.absolute(), f"--out-dir={output_dir}", "--output-arc32", - "--debug-level=0", ], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, diff --git a/examples/production_python/pyproject.toml b/examples/production_python/pyproject.toml index 0417b16..c0dbaf1 100644 --- a/examples/production_python/pyproject.toml +++ b/examples/production_python/pyproject.toml @@ -22,7 +22,7 @@ pytest = "*" pytest-cov = "*" pip-audit = "*" pre-commit = "*" -puyapy = "*" +puyapy = { git = "https://github.com/algorandfoundation/puya.git", branch = "puya-debug-info" } [build-system] requires = ["poetry-core"] diff --git a/examples/production_python/smart_contracts/_helpers/build.py b/examples/production_python/smart_contracts/_helpers/build.py index 20770e8..771b585 100644 --- a/examples/production_python/smart_contracts/_helpers/build.py +++ b/examples/production_python/smart_contracts/_helpers/build.py @@ -31,7 +31,6 @@ def build(output_dir: Path, contract_path: Path) -> Path: contract_path.absolute(), f"--out-dir={output_dir}", "--output-arc32", - "--debug-level=0", ], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, diff --git a/examples/starter_python/pyproject.toml b/examples/starter_python/pyproject.toml index 054571a..62ea268 100644 --- a/examples/starter_python/pyproject.toml +++ b/examples/starter_python/pyproject.toml @@ -15,7 +15,7 @@ algorand-python-testing = "^0.4.0" [tool.poetry.group.dev.dependencies] algokit-client-generator = "^1.1.3" -puyapy = "*" +puyapy = { git = "https://github.com/algorandfoundation/puya.git", branch = "puya-debug-info" } [build-system] requires = ["poetry-core"] diff --git a/examples/starter_python/smart_contracts/_helpers/build.py b/examples/starter_python/smart_contracts/_helpers/build.py index 20770e8..771b585 100644 --- a/examples/starter_python/smart_contracts/_helpers/build.py +++ b/examples/starter_python/smart_contracts/_helpers/build.py @@ -31,7 +31,6 @@ def build(output_dir: Path, contract_path: Path) -> Path: contract_path.absolute(), f"--out-dir={output_dir}", "--output-arc32", - "--debug-level=0", ], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, diff --git a/template_content/pyproject.toml.jinja b/template_content/pyproject.toml.jinja index a6f2c8c..f3ef868 100644 --- a/template_content/pyproject.toml.jinja +++ b/template_content/pyproject.toml.jinja @@ -38,7 +38,7 @@ pip-audit = "*" {% if use_pre_commit -%} pre-commit = "*" {% endif -%} -puyapy = "*" +puyapy = { git = "https://github.com/algorandfoundation/puya.git", branch = "puya-debug-info" } [build-system] requires = ["poetry-core"] diff --git a/template_content/smart_contracts/_helpers/build.py.jinja b/template_content/smart_contracts/_helpers/build.py.jinja index dc679e0..fd1e9fa 100644 --- a/template_content/smart_contracts/_helpers/build.py.jinja +++ b/template_content/smart_contracts/_helpers/build.py.jinja @@ -34,7 +34,6 @@ def build(output_dir: Path, contract_path: Path) -> Path: contract_path.absolute(), f"--out-dir={output_dir}", "--output-arc32", - "--debug-level=0", ], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, From 799919aebb74ac21acc5d054a9d2c492bb9386b4 Mon Sep 17 00:00:00 2001 From: Altynbek Orumbayev Date: Wed, 16 Oct 2024 17:54:59 +0200 Subject: [PATCH 05/14] chore: temporary setting per branch install of algokit-utils-py with puya debugging --- .../production_python_smart_contract_python/pyproject.toml | 2 +- .../production_python_smart_contract_typescript/pyproject.toml | 2 +- .../starter_python_smart_contract_python/pyproject.toml | 2 +- .../starter_python_smart_contract_typescript/pyproject.toml | 2 +- examples/production_python/pyproject.toml | 2 +- examples/starter_python/pyproject.toml | 2 +- template_content/pyproject.toml.jinja | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/generators/production_python_smart_contract_python/pyproject.toml b/examples/generators/production_python_smart_contract_python/pyproject.toml index 58766b4..02e7820 100644 --- a/examples/generators/production_python_smart_contract_python/pyproject.toml +++ b/examples/generators/production_python_smart_contract_python/pyproject.toml @@ -8,7 +8,7 @@ package-mode = false [tool.poetry.dependencies] python = "^3.12" -algokit-utils = "^2.3.0" +algokit-utils = { git = "https://github.com/algorandfoundation/algokit-utils-py.git", branch = "feat/puya-debugging" } python-dotenv = "^1.0.0" algorand-python = "^2.0.0" algorand-python-testing = "^0.4.0" diff --git a/examples/generators/production_python_smart_contract_typescript/pyproject.toml b/examples/generators/production_python_smart_contract_typescript/pyproject.toml index f82443d..cc799ed 100644 --- a/examples/generators/production_python_smart_contract_typescript/pyproject.toml +++ b/examples/generators/production_python_smart_contract_typescript/pyproject.toml @@ -8,7 +8,7 @@ package-mode = false [tool.poetry.dependencies] python = "^3.12" -algokit-utils = "^2.3.0" +algokit-utils = { git = "https://github.com/algorandfoundation/algokit-utils-py.git", branch = "feat/puya-debugging" } python-dotenv = "^1.0.0" algorand-python = "^2.0.0" algorand-python-testing = "^0.4.0" diff --git a/examples/generators/starter_python_smart_contract_python/pyproject.toml b/examples/generators/starter_python_smart_contract_python/pyproject.toml index 05fbeb5..71f8fea 100644 --- a/examples/generators/starter_python_smart_contract_python/pyproject.toml +++ b/examples/generators/starter_python_smart_contract_python/pyproject.toml @@ -8,7 +8,7 @@ package-mode = false [tool.poetry.dependencies] python = "^3.12" -algokit-utils = "^2.3.0" +algokit-utils = { git = "https://github.com/algorandfoundation/algokit-utils-py.git", branch = "feat/puya-debugging" } python-dotenv = "^1.0.0" algorand-python = "^2.0.0" algorand-python-testing = "^0.4.0" diff --git a/examples/generators/starter_python_smart_contract_typescript/pyproject.toml b/examples/generators/starter_python_smart_contract_typescript/pyproject.toml index bd6c7d3..6e5e410 100644 --- a/examples/generators/starter_python_smart_contract_typescript/pyproject.toml +++ b/examples/generators/starter_python_smart_contract_typescript/pyproject.toml @@ -8,7 +8,7 @@ package-mode = false [tool.poetry.dependencies] python = "^3.12" -algokit-utils = "^2.3.0" +algokit-utils = { git = "https://github.com/algorandfoundation/algokit-utils-py.git", branch = "feat/puya-debugging" } python-dotenv = "^1.0.0" algorand-python = "^2.0.0" algorand-python-testing = "^0.4.0" diff --git a/examples/production_python/pyproject.toml b/examples/production_python/pyproject.toml index c0dbaf1..2794812 100644 --- a/examples/production_python/pyproject.toml +++ b/examples/production_python/pyproject.toml @@ -8,7 +8,7 @@ package-mode = false [tool.poetry.dependencies] python = "^3.12" -algokit-utils = "^2.3.0" +algokit-utils = { git = "https://github.com/algorandfoundation/algokit-utils-py.git", branch = "feat/puya-debugging" } python-dotenv = "^1.0.0" algorand-python = "^2.0.0" algorand-python-testing = "^0.4.0" diff --git a/examples/starter_python/pyproject.toml b/examples/starter_python/pyproject.toml index 62ea268..53dad4c 100644 --- a/examples/starter_python/pyproject.toml +++ b/examples/starter_python/pyproject.toml @@ -8,7 +8,7 @@ package-mode = false [tool.poetry.dependencies] python = "^3.12" -algokit-utils = "^2.3.0" +algokit-utils = { git = "https://github.com/algorandfoundation/algokit-utils-py.git", branch = "feat/puya-debugging" } python-dotenv = "^1.0.0" algorand-python = "^2.0.0" algorand-python-testing = "^0.4.0" diff --git a/template_content/pyproject.toml.jinja b/template_content/pyproject.toml.jinja index f3ef868..ab71772 100644 --- a/template_content/pyproject.toml.jinja +++ b/template_content/pyproject.toml.jinja @@ -8,7 +8,7 @@ package-mode = false [tool.poetry.dependencies] python = "^3.12" -algokit-utils = "^2.3.0" +algokit-utils = { git = "https://github.com/algorandfoundation/algokit-utils-py.git", branch = "feat/puya-debugging" } python-dotenv = "^1.0.0" algorand-python = "^2.0.0" algorand-python-testing = "^0.4.0" From 58d665f79774c6cfe959c69bd2e54a8aac8c4ca8 Mon Sep 17 00:00:00 2001 From: Altynbek Orumbayev Date: Thu, 17 Oct 2024 15:54:54 +0200 Subject: [PATCH 06/14] docs: tweak to ensure debugging docs are included on starter presets too --- .../README.md | 20 ++++++++--------- .../README.md | 20 ++++++++--------- .../README.md | 9 ++++++++ .../README.md | 9 ++++++++ examples/production_python/README.md | 20 ++++++++--------- examples/starter_python/README.md | 9 ++++++++ template_content/README.md.jinja | 22 +++++++++---------- 7 files changed, 68 insertions(+), 41 deletions(-) diff --git a/examples/generators/production_python_smart_contract_python/README.md b/examples/generators/production_python_smart_contract_python/README.md index b41dabd..715d773 100644 --- a/examples/generators/production_python_smart_contract_python/README.md +++ b/examples/generators/production_python_smart_contract_python/README.md @@ -77,15 +77,7 @@ By default the template creates a single `HelloWorld` contract under hello_world By default the template instance does not contain any env files. Using [`algokit project deploy`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/project/deploy.md) against `localnet` | `testnet` | `mainnet` will use default values for `algod` and `indexer` unless overwritten via `.env` or `.env.{target_network}`. -To generate a new `.env` or `.env.{target_network}` file, run `algokit generate env-file`### Continuous Integration / Continuous Deployment (CI/CD) - -This project uses [GitHub Actions](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions) to define CI/CD workflows, which are located in the [.github/workflows](`.github/workflows`) folder. - -> Please note, if you instantiated the project with --workspace flag in `algokit init` it will automatically attempt to move the contents of the `.github` folder to the root of the workspace. - -### AlgoKit Workspaces - -To define custom `algokit project run` commands refer to [documentation](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/project/run.md). This allows orchestration of commands spanning across multiple projects within an algokit workspace based project (monorepo). +To generate a new `.env` or `.env.{target_network}` file, run `algokit generate env-file` ### Debugging Smart Contracts @@ -94,7 +86,15 @@ Refer to the commented header in the `__main__.py` file in the `smart_contracts` If you have opted in to include VSCode launch configurations in your project, you can also use the `Debug TEAL via AlgoKit AVM Debugger` launch configuration to interactively select an available trace file and launch the debug session for your smart contract. -For information on using and setting up the `AlgoKit AVM Debugger` VSCode extension refer [here](https://github.com/algorandfoundation/algokit-avm-vscode-debugger). To install the extension from the VSCode Marketplace, use the following link: [AlgoKit AVM Debugger extension](https://marketplace.visualstudio.com/items?itemName=algorandfoundation.algokit-avm-vscode-debugger). +For information on using and setting up the `AlgoKit AVM Debugger` VSCode extension refer [here](https://github.com/algorandfoundation/algokit-avm-vscode-debugger). To install the extension from the VSCode Marketplace, use the following link: [AlgoKit AVM Debugger extension](https://marketplace.visualstudio.com/items?itemName=algorandfoundation.algokit-avm-vscode-debugger).### Continuous Integration / Continuous Deployment (CI/CD) + +This project uses [GitHub Actions](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions) to define CI/CD workflows, which are located in the [.github/workflows](`.github/workflows`) folder. + +> Please note, if you instantiated the project with --workspace flag in `algokit init` it will automatically attempt to move the contents of the `.github` folder to the root of the workspace. + +### AlgoKit Workspaces + +To define custom `algokit project run` commands refer to [documentation](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/project/run.md). This allows orchestration of commands spanning across multiple projects within an algokit workspace based project (monorepo). #### Setting up GitHub for CI/CD workflow and TestNet deployment diff --git a/examples/generators/production_python_smart_contract_typescript/README.md b/examples/generators/production_python_smart_contract_typescript/README.md index 28c68bb..c2c6505 100644 --- a/examples/generators/production_python_smart_contract_typescript/README.md +++ b/examples/generators/production_python_smart_contract_typescript/README.md @@ -78,15 +78,7 @@ By default the template creates a single `HelloWorld` contract under hello_world By default the template instance does not contain any env files. Using [`algokit project deploy`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/project/deploy.md) against `localnet` | `testnet` | `mainnet` will use default values for `algod` and `indexer` unless overwritten via `.env` or `.env.{target_network}`. -To generate a new `.env` or `.env.{target_network}` file, run `algokit generate env-file`### Continuous Integration / Continuous Deployment (CI/CD) - -This project uses [GitHub Actions](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions) to define CI/CD workflows, which are located in the [.github/workflows](`.github/workflows`) folder. - -> Please note, if you instantiated the project with --workspace flag in `algokit init` it will automatically attempt to move the contents of the `.github` folder to the root of the workspace. - -### AlgoKit Workspaces - -To define custom `algokit project run` commands refer to [documentation](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/project/run.md). This allows orchestration of commands spanning across multiple projects within an algokit workspace based project (monorepo). +To generate a new `.env` or `.env.{target_network}` file, run `algokit generate env-file` ### Debugging Smart Contracts @@ -95,7 +87,15 @@ Refer to the commented header in the `index.ts` file in the `smart_contracts` fo If you have opted in to include VSCode launch configurations in your project, you can also use the `Debug TEAL via AlgoKit AVM Debugger` launch configuration to interactively select an available trace file and launch the debug session for your smart contract. -For information on using and setting up the `AlgoKit AVM Debugger` VSCode extension refer [here](https://github.com/algorandfoundation/algokit-avm-vscode-debugger). To install the extension from the VSCode Marketplace, use the following link: [AlgoKit AVM Debugger extension](https://marketplace.visualstudio.com/items?itemName=algorandfoundation.algokit-avm-vscode-debugger). +For information on using and setting up the `AlgoKit AVM Debugger` VSCode extension refer [here](https://github.com/algorandfoundation/algokit-avm-vscode-debugger). To install the extension from the VSCode Marketplace, use the following link: [AlgoKit AVM Debugger extension](https://marketplace.visualstudio.com/items?itemName=algorandfoundation.algokit-avm-vscode-debugger).### Continuous Integration / Continuous Deployment (CI/CD) + +This project uses [GitHub Actions](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions) to define CI/CD workflows, which are located in the [.github/workflows](`.github/workflows`) folder. + +> Please note, if you instantiated the project with --workspace flag in `algokit init` it will automatically attempt to move the contents of the `.github` folder to the root of the workspace. + +### AlgoKit Workspaces + +To define custom `algokit project run` commands refer to [documentation](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/project/run.md). This allows orchestration of commands spanning across multiple projects within an algokit workspace based project (monorepo). #### Setting up GitHub for CI/CD workflow and TestNet deployment diff --git a/examples/generators/starter_python_smart_contract_python/README.md b/examples/generators/starter_python_smart_contract_python/README.md index fb1bc17..e7d5844 100644 --- a/examples/generators/starter_python_smart_contract_python/README.md +++ b/examples/generators/starter_python_smart_contract_python/README.md @@ -79,6 +79,15 @@ By default the template instance does not contain any env files. Using [`algokit To generate a new `.env` or `.env.{target_network}` file, run `algokit generate env-file` +### Debugging Smart Contracts + +This project is optimized to work with AlgoKit AVM Debugger extension. To activate it: +Refer to the commented header in the `__main__.py` file in the `smart_contracts` folder. + +If you have opted in to include VSCode launch configurations in your project, you can also use the `Debug TEAL via AlgoKit AVM Debugger` launch configuration to interactively select an available trace file and launch the debug session for your smart contract. + +For information on using and setting up the `AlgoKit AVM Debugger` VSCode extension refer [here](https://github.com/algorandfoundation/algokit-avm-vscode-debugger). To install the extension from the VSCode Marketplace, use the following link: [AlgoKit AVM Debugger extension](https://marketplace.visualstudio.com/items?itemName=algorandfoundation.algokit-avm-vscode-debugger). + # Tools This project makes use of Algorand Python to build Algorand smart contracts. The following tools are in use: diff --git a/examples/generators/starter_python_smart_contract_typescript/README.md b/examples/generators/starter_python_smart_contract_typescript/README.md index 81c6bf4..8d981a3 100644 --- a/examples/generators/starter_python_smart_contract_typescript/README.md +++ b/examples/generators/starter_python_smart_contract_typescript/README.md @@ -80,6 +80,15 @@ By default the template instance does not contain any env files. Using [`algokit To generate a new `.env` or `.env.{target_network}` file, run `algokit generate env-file` +### Debugging Smart Contracts + +This project is optimized to work with AlgoKit AVM Debugger extension. To activate it: +Refer to the commented header in the `index.ts` file in the `smart_contracts` folder. + +If you have opted in to include VSCode launch configurations in your project, you can also use the `Debug TEAL via AlgoKit AVM Debugger` launch configuration to interactively select an available trace file and launch the debug session for your smart contract. + +For information on using and setting up the `AlgoKit AVM Debugger` VSCode extension refer [here](https://github.com/algorandfoundation/algokit-avm-vscode-debugger). To install the extension from the VSCode Marketplace, use the following link: [AlgoKit AVM Debugger extension](https://marketplace.visualstudio.com/items?itemName=algorandfoundation.algokit-avm-vscode-debugger). + # Tools This project makes use of Algorand Python to build Algorand smart contracts. The following tools are in use: diff --git a/examples/production_python/README.md b/examples/production_python/README.md index d2c173e..5bb9ac6 100644 --- a/examples/production_python/README.md +++ b/examples/production_python/README.md @@ -77,15 +77,7 @@ By default the template creates a single `HelloWorld` contract under hello_world By default the template instance does not contain any env files. Using [`algokit project deploy`](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/project/deploy.md) against `localnet` | `testnet` | `mainnet` will use default values for `algod` and `indexer` unless overwritten via `.env` or `.env.{target_network}`. -To generate a new `.env` or `.env.{target_network}` file, run `algokit generate env-file`### Continuous Integration / Continuous Deployment (CI/CD) - -This project uses [GitHub Actions](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions) to define CI/CD workflows, which are located in the [.github/workflows](`.github/workflows`) folder. - -> Please note, if you instantiated the project with --workspace flag in `algokit init` it will automatically attempt to move the contents of the `.github` folder to the root of the workspace. - -### AlgoKit Workspaces - -To define custom `algokit project run` commands refer to [documentation](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/project/run.md). This allows orchestration of commands spanning across multiple projects within an algokit workspace based project (monorepo). +To generate a new `.env` or `.env.{target_network}` file, run `algokit generate env-file` ### Debugging Smart Contracts @@ -94,7 +86,15 @@ Refer to the commented header in the `__main__.py` file in the `smart_contracts` If you have opted in to include VSCode launch configurations in your project, you can also use the `Debug TEAL via AlgoKit AVM Debugger` launch configuration to interactively select an available trace file and launch the debug session for your smart contract. -For information on using and setting up the `AlgoKit AVM Debugger` VSCode extension refer [here](https://github.com/algorandfoundation/algokit-avm-vscode-debugger). To install the extension from the VSCode Marketplace, use the following link: [AlgoKit AVM Debugger extension](https://marketplace.visualstudio.com/items?itemName=algorandfoundation.algokit-avm-vscode-debugger). +For information on using and setting up the `AlgoKit AVM Debugger` VSCode extension refer [here](https://github.com/algorandfoundation/algokit-avm-vscode-debugger). To install the extension from the VSCode Marketplace, use the following link: [AlgoKit AVM Debugger extension](https://marketplace.visualstudio.com/items?itemName=algorandfoundation.algokit-avm-vscode-debugger).### Continuous Integration / Continuous Deployment (CI/CD) + +This project uses [GitHub Actions](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions) to define CI/CD workflows, which are located in the [.github/workflows](`.github/workflows`) folder. + +> Please note, if you instantiated the project with --workspace flag in `algokit init` it will automatically attempt to move the contents of the `.github` folder to the root of the workspace. + +### AlgoKit Workspaces + +To define custom `algokit project run` commands refer to [documentation](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/project/run.md). This allows orchestration of commands spanning across multiple projects within an algokit workspace based project (monorepo). #### Setting up GitHub for CI/CD workflow and TestNet deployment diff --git a/examples/starter_python/README.md b/examples/starter_python/README.md index 7733b5e..ee20af5 100644 --- a/examples/starter_python/README.md +++ b/examples/starter_python/README.md @@ -79,6 +79,15 @@ By default the template instance does not contain any env files. Using [`algokit To generate a new `.env` or `.env.{target_network}` file, run `algokit generate env-file` +### Debugging Smart Contracts + +This project is optimized to work with AlgoKit AVM Debugger extension. To activate it: +Refer to the commented header in the `__main__.py` file in the `smart_contracts` folder. + +If you have opted in to include VSCode launch configurations in your project, you can also use the `Debug TEAL via AlgoKit AVM Debugger` launch configuration to interactively select an available trace file and launch the debug session for your smart contract. + +For information on using and setting up the `AlgoKit AVM Debugger` VSCode extension refer [here](https://github.com/algorandfoundation/algokit-avm-vscode-debugger). To install the extension from the VSCode Marketplace, use the following link: [AlgoKit AVM Debugger extension](https://marketplace.visualstudio.com/items?itemName=algorandfoundation.algokit-avm-vscode-debugger). + # Tools This project makes use of Algorand Python to build Algorand smart contracts. The following tools are in use: diff --git a/template_content/README.md.jinja b/template_content/README.md.jinja index 99b904c..73ca5e9 100644 --- a/template_content/README.md.jinja +++ b/template_content/README.md.jinja @@ -82,17 +82,6 @@ By default the template instance does not contain any env files. Using [`algokit To generate a new `.env` or `.env.{target_network}` file, run `algokit generate env-file` -{%- if use_github_actions -%} -### Continuous Integration / Continuous Deployment (CI/CD) - -This project uses [GitHub Actions](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions) to define CI/CD workflows, which are located in the [.github/workflows](`{% if use_workspace %}../../.github/workflows{% else %}.github/workflows{% endif %}`) folder. - -> Please note, if you instantiated the project with --workspace flag in `algokit init` it will automatically attempt to move the contents of the `.github` folder to the root of the workspace. - -### AlgoKit Workspaces - -To define custom `algokit project run` commands refer to [documentation](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/project/run.md). This allows orchestration of commands spanning across multiple projects within an algokit workspace based project (monorepo). - ### Debugging Smart Contracts This project is optimized to work with AlgoKit AVM Debugger extension. To activate it: @@ -106,6 +95,17 @@ If you have opted in to include VSCode launch configurations in your project, yo For information on using and setting up the `AlgoKit AVM Debugger` VSCode extension refer [here](https://github.com/algorandfoundation/algokit-avm-vscode-debugger). To install the extension from the VSCode Marketplace, use the following link: [AlgoKit AVM Debugger extension](https://marketplace.visualstudio.com/items?itemName=algorandfoundation.algokit-avm-vscode-debugger). +{%- if use_github_actions -%} +### Continuous Integration / Continuous Deployment (CI/CD) + +This project uses [GitHub Actions](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions) to define CI/CD workflows, which are located in the [.github/workflows](`{% if use_workspace %}../../.github/workflows{% else %}.github/workflows{% endif %}`) folder. + +> Please note, if you instantiated the project with --workspace flag in `algokit init` it will automatically attempt to move the contents of the `.github` folder to the root of the workspace. + +### AlgoKit Workspaces + +To define custom `algokit project run` commands refer to [documentation](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/project/run.md). This allows orchestration of commands spanning across multiple projects within an algokit workspace based project (monorepo). + #### Setting up GitHub for CI/CD workflow and TestNet deployment 1. Every time you have a change to your smart contract, and when you first initialize the project you need to [build the contract](#initial-setup) and then commit the `smart_contracts/artifacts` folder so the [output stability](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/articles/output_stability.md) tests pass From 74a1121f013bc921e666fb0009172919507c9db1 Mon Sep 17 00:00:00 2001 From: Altynbek Orumbayev Date: Thu, 17 Oct 2024 20:40:17 +0200 Subject: [PATCH 07/14] chore: bump min beta versions of utils --- .../production_python_smart_contract_typescript/package.json | 4 ++-- .../starter_python_smart_contract_typescript/package.json | 4 ++-- ...pt' or use_typescript_jest %}package.json{% endif %}.jinja | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/generators/production_python_smart_contract_typescript/package.json b/examples/generators/production_python_smart_contract_typescript/package.json index 6b832f0..a581058 100644 --- a/examples/generators/production_python_smart_contract_typescript/package.json +++ b/examples/generators/production_python_smart_contract_typescript/package.json @@ -14,8 +14,8 @@ "npm": ">=9.0" }, "dependencies": { - "@algorandfoundation/algokit-utils": "7.0.0-beta.14", - "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.2", + "@algorandfoundation/algokit-utils": "7.0.0-beta.15", + "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.3", "algosdk": "^2.7.0" }, "devDependencies": { diff --git a/examples/generators/starter_python_smart_contract_typescript/package.json b/examples/generators/starter_python_smart_contract_typescript/package.json index 978b8c3..2d9e1d5 100644 --- a/examples/generators/starter_python_smart_contract_typescript/package.json +++ b/examples/generators/starter_python_smart_contract_typescript/package.json @@ -13,8 +13,8 @@ "npm": ">=9.0" }, "dependencies": { - "@algorandfoundation/algokit-utils": "7.0.0-beta.14", - "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.2", + "@algorandfoundation/algokit-utils": "7.0.0-beta.15", + "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.3", "algosdk": "^2.7.0" }, "devDependencies": { diff --git a/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja b/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja index 87849d6..53fc493 100644 --- a/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja +++ b/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja @@ -16,8 +16,8 @@ "npm": ">=9.0" }, "dependencies": { - "@algorandfoundation/algokit-utils": "7.0.0-beta.14", - "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.2", + "@algorandfoundation/algokit-utils": "7.0.0-beta.15", + "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.3", "algosdk": "^2.7.0" }, "devDependencies": { From f55c164e6f88fdef351f10e67b5f8c065399a8bf Mon Sep 17 00:00:00 2001 From: Altynbek Orumbayev Date: Fri, 25 Oct 2024 12:58:41 +0200 Subject: [PATCH 08/14] chore: refresh puya installation --- .../production_python_smart_contract_python/pyproject.toml | 2 +- .../smart_contracts/_helpers/build.py | 1 + .../production_python_smart_contract_typescript/pyproject.toml | 2 +- .../smart_contracts/_helpers/build.py | 1 + .../starter_python_smart_contract_python/pyproject.toml | 2 +- .../smart_contracts/_helpers/build.py | 1 + .../starter_python_smart_contract_typescript/pyproject.toml | 2 +- .../smart_contracts/_helpers/build.py | 1 + examples/production_python/pyproject.toml | 2 +- examples/production_python/smart_contracts/_helpers/build.py | 1 + examples/starter_python/pyproject.toml | 2 +- examples/starter_python/smart_contracts/_helpers/build.py | 1 + template_content/pyproject.toml.jinja | 2 +- template_content/smart_contracts/_helpers/build.py.jinja | 1 + 14 files changed, 14 insertions(+), 7 deletions(-) diff --git a/examples/generators/production_python_smart_contract_python/pyproject.toml b/examples/generators/production_python_smart_contract_python/pyproject.toml index 47be35d..a340d5f 100644 --- a/examples/generators/production_python_smart_contract_python/pyproject.toml +++ b/examples/generators/production_python_smart_contract_python/pyproject.toml @@ -21,7 +21,7 @@ pytest = "*" pytest-cov = "*" pip-audit = "*" pre-commit = "*" -puyapy = { git = "https://github.com/algorandfoundation/puya.git", branch = "puya-debug-info" } +puyapy = { git = "https://github.com/algorandfoundation/puya.git", branch = "main" } [build-system] requires = ["poetry-core"] diff --git a/examples/generators/production_python_smart_contract_python/smart_contracts/_helpers/build.py b/examples/generators/production_python_smart_contract_python/smart_contracts/_helpers/build.py index a8efecc..3461154 100644 --- a/examples/generators/production_python_smart_contract_python/smart_contracts/_helpers/build.py +++ b/examples/generators/production_python_smart_contract_python/smart_contracts/_helpers/build.py @@ -31,6 +31,7 @@ def build(output_dir: Path, contract_path: Path) -> Path: contract_path.absolute(), f"--out-dir={output_dir}", "--output-arc32", + "--output-source-map", ], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, diff --git a/examples/generators/production_python_smart_contract_typescript/pyproject.toml b/examples/generators/production_python_smart_contract_typescript/pyproject.toml index 167ca9c..174c21f 100644 --- a/examples/generators/production_python_smart_contract_typescript/pyproject.toml +++ b/examples/generators/production_python_smart_contract_typescript/pyproject.toml @@ -18,7 +18,7 @@ ruff = "^0.1.6" mypy = "1.11.0" pip-audit = "*" pre-commit = "*" -puyapy = { git = "https://github.com/algorandfoundation/puya.git", branch = "puya-debug-info" } +puyapy = { git = "https://github.com/algorandfoundation/puya.git", branch = "main" } [build-system] requires = ["poetry-core"] diff --git a/examples/generators/production_python_smart_contract_typescript/smart_contracts/_helpers/build.py b/examples/generators/production_python_smart_contract_typescript/smart_contracts/_helpers/build.py index d00f078..37ceb1f 100644 --- a/examples/generators/production_python_smart_contract_typescript/smart_contracts/_helpers/build.py +++ b/examples/generators/production_python_smart_contract_typescript/smart_contracts/_helpers/build.py @@ -31,6 +31,7 @@ def build(output_dir: Path, contract_path: Path) -> Path: contract_path.absolute(), f"--out-dir={output_dir}", "--output-arc32", + "--output-source-map", ], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, diff --git a/examples/generators/starter_python_smart_contract_python/pyproject.toml b/examples/generators/starter_python_smart_contract_python/pyproject.toml index 2c6e9c3..22393d1 100644 --- a/examples/generators/starter_python_smart_contract_python/pyproject.toml +++ b/examples/generators/starter_python_smart_contract_python/pyproject.toml @@ -14,7 +14,7 @@ algorand-python-testing = "^0.4.0" [tool.poetry.group.dev.dependencies] algokit-client-generator = "^1.1.3" -puyapy = { git = "https://github.com/algorandfoundation/puya.git", branch = "puya-debug-info" } +puyapy = { git = "https://github.com/algorandfoundation/puya.git", branch = "main" } [build-system] requires = ["poetry-core"] diff --git a/examples/generators/starter_python_smart_contract_python/smart_contracts/_helpers/build.py b/examples/generators/starter_python_smart_contract_python/smart_contracts/_helpers/build.py index a8efecc..3461154 100644 --- a/examples/generators/starter_python_smart_contract_python/smart_contracts/_helpers/build.py +++ b/examples/generators/starter_python_smart_contract_python/smart_contracts/_helpers/build.py @@ -31,6 +31,7 @@ def build(output_dir: Path, contract_path: Path) -> Path: contract_path.absolute(), f"--out-dir={output_dir}", "--output-arc32", + "--output-source-map", ], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, diff --git a/examples/generators/starter_python_smart_contract_typescript/pyproject.toml b/examples/generators/starter_python_smart_contract_typescript/pyproject.toml index ab0aba9..3d0984c 100644 --- a/examples/generators/starter_python_smart_contract_typescript/pyproject.toml +++ b/examples/generators/starter_python_smart_contract_typescript/pyproject.toml @@ -13,7 +13,7 @@ algorand-python = "^2.0.0" algorand-python-testing = "^0.4.0" [tool.poetry.group.dev.dependencies] -puyapy = { git = "https://github.com/algorandfoundation/puya.git", branch = "puya-debug-info" } +puyapy = { git = "https://github.com/algorandfoundation/puya.git", branch = "main" } [build-system] requires = ["poetry-core"] diff --git a/examples/generators/starter_python_smart_contract_typescript/smart_contracts/_helpers/build.py b/examples/generators/starter_python_smart_contract_typescript/smart_contracts/_helpers/build.py index d00f078..37ceb1f 100644 --- a/examples/generators/starter_python_smart_contract_typescript/smart_contracts/_helpers/build.py +++ b/examples/generators/starter_python_smart_contract_typescript/smart_contracts/_helpers/build.py @@ -31,6 +31,7 @@ def build(output_dir: Path, contract_path: Path) -> Path: contract_path.absolute(), f"--out-dir={output_dir}", "--output-arc32", + "--output-source-map", ], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, diff --git a/examples/production_python/pyproject.toml b/examples/production_python/pyproject.toml index c9fe3fb..bf2bfc2 100644 --- a/examples/production_python/pyproject.toml +++ b/examples/production_python/pyproject.toml @@ -21,7 +21,7 @@ pytest = "*" pytest-cov = "*" pip-audit = "*" pre-commit = "*" -puyapy = { git = "https://github.com/algorandfoundation/puya.git", branch = "puya-debug-info" } +puyapy = { git = "https://github.com/algorandfoundation/puya.git", branch = "main" } [build-system] requires = ["poetry-core"] diff --git a/examples/production_python/smart_contracts/_helpers/build.py b/examples/production_python/smart_contracts/_helpers/build.py index a8efecc..3461154 100644 --- a/examples/production_python/smart_contracts/_helpers/build.py +++ b/examples/production_python/smart_contracts/_helpers/build.py @@ -31,6 +31,7 @@ def build(output_dir: Path, contract_path: Path) -> Path: contract_path.absolute(), f"--out-dir={output_dir}", "--output-arc32", + "--output-source-map", ], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, diff --git a/examples/starter_python/pyproject.toml b/examples/starter_python/pyproject.toml index 830246b..33ccbbb 100644 --- a/examples/starter_python/pyproject.toml +++ b/examples/starter_python/pyproject.toml @@ -14,7 +14,7 @@ algorand-python-testing = "^0.4.0" [tool.poetry.group.dev.dependencies] algokit-client-generator = "^1.1.3" -puyapy = { git = "https://github.com/algorandfoundation/puya.git", branch = "puya-debug-info" } +puyapy = { git = "https://github.com/algorandfoundation/puya.git", branch = "main" } [build-system] requires = ["poetry-core"] diff --git a/examples/starter_python/smart_contracts/_helpers/build.py b/examples/starter_python/smart_contracts/_helpers/build.py index a8efecc..3461154 100644 --- a/examples/starter_python/smart_contracts/_helpers/build.py +++ b/examples/starter_python/smart_contracts/_helpers/build.py @@ -31,6 +31,7 @@ def build(output_dir: Path, contract_path: Path) -> Path: contract_path.absolute(), f"--out-dir={output_dir}", "--output-arc32", + "--output-source-map", ], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, diff --git a/template_content/pyproject.toml.jinja b/template_content/pyproject.toml.jinja index 433bf44..1f1ff84 100644 --- a/template_content/pyproject.toml.jinja +++ b/template_content/pyproject.toml.jinja @@ -37,7 +37,7 @@ pip-audit = "*" {% if use_pre_commit -%} pre-commit = "*" {% endif -%} -puyapy = { git = "https://github.com/algorandfoundation/puya.git", branch = "puya-debug-info" } +puyapy = { git = "https://github.com/algorandfoundation/puya.git", branch = "main" } [build-system] requires = ["poetry-core"] diff --git a/template_content/smart_contracts/_helpers/build.py.jinja b/template_content/smart_contracts/_helpers/build.py.jinja index aadee37..152f340 100644 --- a/template_content/smart_contracts/_helpers/build.py.jinja +++ b/template_content/smart_contracts/_helpers/build.py.jinja @@ -34,6 +34,7 @@ def build(output_dir: Path, contract_path: Path) -> Path: contract_path.absolute(), f"--out-dir={output_dir}", "--output-arc32", + "--output-source-map", ], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, From 125ddccaa78b26d5f1bc1bc21d2aa54927a7b455 Mon Sep 17 00:00:00 2001 From: Neil Campbell Date: Fri, 8 Nov 2024 14:21:00 +0800 Subject: [PATCH 09/14] chore: update to the latest packages --- .../package.json | 6 +++--- .../starter_python_smart_contract_typescript/package.json | 6 +++--- ...' or use_typescript_jest %}package.json{% endif %}.jinja | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/generators/production_python_smart_contract_typescript/package.json b/examples/generators/production_python_smart_contract_typescript/package.json index a581058..f7d024f 100644 --- a/examples/generators/production_python_smart_contract_typescript/package.json +++ b/examples/generators/production_python_smart_contract_typescript/package.json @@ -14,12 +14,12 @@ "npm": ">=9.0" }, "dependencies": { - "@algorandfoundation/algokit-utils": "7.0.0-beta.15", - "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.3", + "@algorandfoundation/algokit-utils": "7.0.0-beta.22", + "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.5", "algosdk": "^2.7.0" }, "devDependencies": { - "@algorandfoundation/algokit-client-generator": "v4.0.0-beta.5", + "@algorandfoundation/algokit-client-generator": "v4.0.0-beta.8", "@types/jest": "^29.5.11", "dotenv": "^16.0.3", "prettier": "^2.8.4", diff --git a/examples/generators/starter_python_smart_contract_typescript/package.json b/examples/generators/starter_python_smart_contract_typescript/package.json index 2d9e1d5..a41043a 100644 --- a/examples/generators/starter_python_smart_contract_typescript/package.json +++ b/examples/generators/starter_python_smart_contract_typescript/package.json @@ -13,12 +13,12 @@ "npm": ">=9.0" }, "dependencies": { - "@algorandfoundation/algokit-utils": "7.0.0-beta.15", - "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.3", + "@algorandfoundation/algokit-utils": "7.0.0-beta.22", + "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.5", "algosdk": "^2.7.0" }, "devDependencies": { - "@algorandfoundation/algokit-client-generator": "v4.0.0-beta.5", + "@algorandfoundation/algokit-client-generator": "v4.0.0-beta.8", "dotenv": "^16.0.3", "prettier": "^2.8.4", "ts-node-dev": "^2.0.0", diff --git a/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja b/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja index 53fc493..9268ff5 100644 --- a/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja +++ b/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja @@ -16,12 +16,12 @@ "npm": ">=9.0" }, "dependencies": { - "@algorandfoundation/algokit-utils": "7.0.0-beta.15", - "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.3", + "@algorandfoundation/algokit-utils": "7.0.0-beta.22", + "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.5", "algosdk": "^2.7.0" }, "devDependencies": { - "@algorandfoundation/algokit-client-generator": "v4.0.0-beta.5", + "@algorandfoundation/algokit-client-generator": "v4.0.0-beta.8", {%- if use_typescript_jest %} "@types/jest": "^29.5.11", {%- endif %} From d421ea2760bccac3c982ec55938b16b47c75bcc0 Mon Sep 17 00:00:00 2001 From: Neil Campbell Date: Fri, 8 Nov 2024 16:33:48 +0800 Subject: [PATCH 10/14] chore: update algosdk dependency --- .../production_python_smart_contract_typescript/package.json | 2 +- .../starter_python_smart_contract_typescript/package.json | 2 +- ...ript' or use_typescript_jest %}package.json{% endif %}.jinja | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/generators/production_python_smart_contract_typescript/package.json b/examples/generators/production_python_smart_contract_typescript/package.json index f7d024f..5cb3da2 100644 --- a/examples/generators/production_python_smart_contract_typescript/package.json +++ b/examples/generators/production_python_smart_contract_typescript/package.json @@ -16,7 +16,7 @@ "dependencies": { "@algorandfoundation/algokit-utils": "7.0.0-beta.22", "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.5", - "algosdk": "^2.7.0" + "algosdk": "^2.9.0" }, "devDependencies": { "@algorandfoundation/algokit-client-generator": "v4.0.0-beta.8", diff --git a/examples/generators/starter_python_smart_contract_typescript/package.json b/examples/generators/starter_python_smart_contract_typescript/package.json index a41043a..fe2e065 100644 --- a/examples/generators/starter_python_smart_contract_typescript/package.json +++ b/examples/generators/starter_python_smart_contract_typescript/package.json @@ -15,7 +15,7 @@ "dependencies": { "@algorandfoundation/algokit-utils": "7.0.0-beta.22", "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.5", - "algosdk": "^2.7.0" + "algosdk": "^2.9.0" }, "devDependencies": { "@algorandfoundation/algokit-client-generator": "v4.0.0-beta.8", diff --git a/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja b/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja index 9268ff5..5b2ece4 100644 --- a/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja +++ b/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja @@ -18,7 +18,7 @@ "dependencies": { "@algorandfoundation/algokit-utils": "7.0.0-beta.22", "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.5", - "algosdk": "^2.7.0" + "algosdk": "^2.9.0" }, "devDependencies": { "@algorandfoundation/algokit-client-generator": "v4.0.0-beta.8", From bfd017b7dfe1bbf28fe28f9f04180ae7311ad9fb Mon Sep 17 00:00:00 2001 From: Neil Campbell Date: Sat, 9 Nov 2024 22:09:31 +0800 Subject: [PATCH 11/14] chore: tweak the algosdk dependency --- .../production_python_smart_contract_typescript/package.json | 2 +- .../starter_python_smart_contract_typescript/package.json | 2 +- ...ript' or use_typescript_jest %}package.json{% endif %}.jinja | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/generators/production_python_smart_contract_typescript/package.json b/examples/generators/production_python_smart_contract_typescript/package.json index 5cb3da2..230d370 100644 --- a/examples/generators/production_python_smart_contract_typescript/package.json +++ b/examples/generators/production_python_smart_contract_typescript/package.json @@ -16,7 +16,7 @@ "dependencies": { "@algorandfoundation/algokit-utils": "7.0.0-beta.22", "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.5", - "algosdk": "^2.9.0" + "algosdk": ">=2.9.0 <3.0" }, "devDependencies": { "@algorandfoundation/algokit-client-generator": "v4.0.0-beta.8", diff --git a/examples/generators/starter_python_smart_contract_typescript/package.json b/examples/generators/starter_python_smart_contract_typescript/package.json index fe2e065..a115c6c 100644 --- a/examples/generators/starter_python_smart_contract_typescript/package.json +++ b/examples/generators/starter_python_smart_contract_typescript/package.json @@ -15,7 +15,7 @@ "dependencies": { "@algorandfoundation/algokit-utils": "7.0.0-beta.22", "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.5", - "algosdk": "^2.9.0" + "algosdk": ">=2.9.0 <3.0" }, "devDependencies": { "@algorandfoundation/algokit-client-generator": "v4.0.0-beta.8", diff --git a/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja b/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja index 5b2ece4..59444f1 100644 --- a/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja +++ b/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja @@ -18,7 +18,7 @@ "dependencies": { "@algorandfoundation/algokit-utils": "7.0.0-beta.22", "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.5", - "algosdk": "^2.9.0" + "algosdk": ">=2.9.0 <3.0" }, "devDependencies": { "@algorandfoundation/algokit-client-generator": "v4.0.0-beta.8", From 79f6132ed4f6e426735b2abd96e68d0fb6925f09 Mon Sep 17 00:00:00 2001 From: Neil Campbell Date: Mon, 25 Nov 2024 16:58:05 +0800 Subject: [PATCH 12/14] chore: add support for utils v7 --- .../package.json | 6 +++--- .../starter_python_smart_contract_typescript/package.json | 6 +++--- ...' or use_typescript_jest %}package.json{% endif %}.jinja | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/generators/production_python_smart_contract_typescript/package.json b/examples/generators/production_python_smart_contract_typescript/package.json index 230d370..c180772 100644 --- a/examples/generators/production_python_smart_contract_typescript/package.json +++ b/examples/generators/production_python_smart_contract_typescript/package.json @@ -14,12 +14,12 @@ "npm": ">=9.0" }, "dependencies": { - "@algorandfoundation/algokit-utils": "7.0.0-beta.22", - "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.5", + "@algorandfoundation/algokit-utils": "^7.0.0", + "@algorandfoundation/algokit-utils-debug": "^1.0.2", "algosdk": ">=2.9.0 <3.0" }, "devDependencies": { - "@algorandfoundation/algokit-client-generator": "v4.0.0-beta.8", + "@algorandfoundation/algokit-client-generator": "^4.0.0", "@types/jest": "^29.5.11", "dotenv": "^16.0.3", "prettier": "^2.8.4", diff --git a/examples/generators/starter_python_smart_contract_typescript/package.json b/examples/generators/starter_python_smart_contract_typescript/package.json index a115c6c..8dfdf44 100644 --- a/examples/generators/starter_python_smart_contract_typescript/package.json +++ b/examples/generators/starter_python_smart_contract_typescript/package.json @@ -13,12 +13,12 @@ "npm": ">=9.0" }, "dependencies": { - "@algorandfoundation/algokit-utils": "7.0.0-beta.22", - "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.5", + "@algorandfoundation/algokit-utils": "^7.0.0", + "@algorandfoundation/algokit-utils-debug": "^1.0.2", "algosdk": ">=2.9.0 <3.0" }, "devDependencies": { - "@algorandfoundation/algokit-client-generator": "v4.0.0-beta.8", + "@algorandfoundation/algokit-client-generator": "^4.0.0", "dotenv": "^16.0.3", "prettier": "^2.8.4", "ts-node-dev": "^2.0.0", diff --git a/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja b/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja index 59444f1..2ebe37b 100644 --- a/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja +++ b/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja @@ -16,12 +16,12 @@ "npm": ">=9.0" }, "dependencies": { - "@algorandfoundation/algokit-utils": "7.0.0-beta.22", - "@algorandfoundation/algokit-utils-debug": "v1.0.2-beta.5", + "@algorandfoundation/algokit-utils": "^7.0.0", + "@algorandfoundation/algokit-utils-debug": "^1.0.2", "algosdk": ">=2.9.0 <3.0" }, "devDependencies": { - "@algorandfoundation/algokit-client-generator": "v4.0.0-beta.8", + "@algorandfoundation/algokit-client-generator": "^4.0.0", {%- if use_typescript_jest %} "@types/jest": "^29.5.11", {%- endif %} From f707a7045ba86d1619d31cfcbe39838161b66090 Mon Sep 17 00:00:00 2001 From: Neil Campbell Date: Mon, 25 Nov 2024 17:11:04 +0800 Subject: [PATCH 13/14] chore: update node version --- .../production_python_smart_contract_typescript/package.json | 2 +- .../starter_python_smart_contract_typescript/package.json | 2 +- ...ript' or use_typescript_jest %}package.json{% endif %}.jinja | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/generators/production_python_smart_contract_typescript/package.json b/examples/generators/production_python_smart_contract_typescript/package.json index c180772..4cc398e 100644 --- a/examples/generators/production_python_smart_contract_typescript/package.json +++ b/examples/generators/production_python_smart_contract_typescript/package.json @@ -10,7 +10,7 @@ "format": "prettier --write ." }, "engines": { - "node": ">=18.0", + "node": ">=20.0", "npm": ">=9.0" }, "dependencies": { diff --git a/examples/generators/starter_python_smart_contract_typescript/package.json b/examples/generators/starter_python_smart_contract_typescript/package.json index 8dfdf44..5b1fef2 100644 --- a/examples/generators/starter_python_smart_contract_typescript/package.json +++ b/examples/generators/starter_python_smart_contract_typescript/package.json @@ -9,7 +9,7 @@ "format": "prettier --write ." }, "engines": { - "node": ">=18.0", + "node": ">=20.0", "npm": ">=9.0" }, "dependencies": { diff --git a/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja b/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja index 2ebe37b..e65dc5a 100644 --- a/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja +++ b/template_content/{% if deployment_language == 'typescript' or use_typescript_jest %}package.json{% endif %}.jinja @@ -12,7 +12,7 @@ "format": "prettier --write ." }, "engines": { - "node": ">=18.0", + "node": ">=20.0", "npm": ">=9.0" }, "dependencies": { From 95d745564f2d476c4acd61c32c611cc0fe0d484f Mon Sep 17 00:00:00 2001 From: Neil Campbell Date: Mon, 25 Nov 2024 17:41:18 +0800 Subject: [PATCH 14/14] chore: update build to node20 --- .github/workflows/check-python.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/check-python.yaml b/.github/workflows/check-python.yaml index cc493db..bae2ed2 100644 --- a/.github/workflows/check-python.yaml +++ b/.github/workflows/check-python.yaml @@ -44,6 +44,11 @@ jobs: # set git user and email as test invoke git git config --global user.email "actions@github.com" && git config --global user.name "github-actions" + - name: Setup Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: "20.x" + - name: Run tests shell: bash run: |