Skip to content

Prep/beta release#111

Draft
p2arthur wants to merge 13 commits intomainfrom
prep/beta-release
Draft

Prep/beta release#111
p2arthur wants to merge 13 commits intomainfrom
prep/beta-release

Conversation

@p2arthur
Copy link

@p2arthur p2arthur commented Feb 27, 2026

chore: prepare for AlgoKit v4 beta (Python Generator)

This PR updates the Python generator to support the upcoming AlgoKit v4 beta. Following the same pattern as the TypeScript template, I've migrated the generated TypeScript deployment/testing code to be fully ESM-compatible.

Summary of Changes

  • ESM Migration: Updated tsconfig.json to NodeNext and added "type": "module" to the generated package.json.
  • Jest ESM Support: Configured Jest to run in ESM mode using ts-jest/presets/default-esm and updated the test script to use --experimental-vm-modules. This fixes the test failures I was seeing in the generated templates.
  • Dynamic Imports: Updated smart_contracts/index.ts to use import.meta.url and pathToFileURL for finding and loading deployer configs, replacing CJS __dirname logic.
  • Tooling Swap: Replaced ts-node-dev with tsx in the generated templates and updated the README documentation.
  • Dependency Bumps: Updated @algorandfoundation packages to the latest v4 alphas (Utils v10.0.0-alpha.40, etc.) and bumped TypeScript to v5.7.3.
  • **Enable commit changelog to GitHub source code

Important

Status: Draft
Like the other template PRs, this will remain a draft until the official v4 beta releases are live, at which point I'll update the alpha tags to stable versions.

@p2arthur p2arthur changed the base branch from main to decoupling/remove-algosdk February 27, 2026 09:08
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the generated Python smart-contract TypeScript templates from CommonJS to ESM to support modern (ESM) dependencies and keep deploy/test workflows functional under Node 20+.

Changes:

  • Switch TypeScript compilation settings to NodeNext module + resolution.
  • Convert deploy entrypoints to be ESM-safe (import.meta.url + fileURLToPath) and update dynamic deployer importing to use file URLs.
  • Update generated package scripts to use tsx, and migrate Jest config to ts-jest’s ESM preset (production template).

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
examples/generators/starter_python_smart_contract_typescript/tsconfig.json Switch TS module settings to NodeNext for ESM-friendly resolution.
examples/generators/starter_python_smart_contract_typescript/smart_contracts/index.ts Replace __dirname usage and adjust dynamic imports for ESM.
examples/generators/starter_python_smart_contract_typescript/package.json Mark package as ESM and move deploy scripts from ts-node-dev to tsx.
examples/generators/production_python_smart_contract_typescript/tsconfig.json Switch TS module settings to NodeNext for ESM-friendly resolution.
examples/generators/production_python_smart_contract_typescript/smart_contracts/index.ts Replace __dirname usage and adjust dynamic imports for ESM.
examples/generators/production_python_smart_contract_typescript/package.json Mark package as ESM, move deploy to tsx, and run Jest with ESM support flags.
examples/generators/production_python_smart_contract_typescript/jest.config.ts Migrate Jest to ts-jest ESM preset and add ESM-related mappings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@p2arthur p2arthur changed the base branch from decoupling/remove-algosdk to main March 7, 2026 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants