Skip to content

Commit

Permalink
chore: regen examples
Browse files Browse the repository at this point in the history
  • Loading branch information
aorumbayev committed Mar 25, 2024
1 parent 590737b commit 4bb0c60
Show file tree
Hide file tree
Showing 179 changed files with 346 additions and 181 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ This template supports a multitude of features for developing full-stack applica

And the following backend templates:

- [algokit-puya-template](https://github.com/algorandfoundation/algokit-puya-template) - An official starter for developing and deploying Puya smart contracts.
- [algokit-python-template](https://github.com/algorandfoundation/algokit-python-template) - An official starter for developing and deploying Puya smart contracts.
- [algokit-tealscript-template](https://github.com/algorand-devrel/tealscript-algokit-template) - An official starter for developing and deploying TealScript smart contracts.
- [algokit-beaker-default-template](https://github.com/algorandfoundation/algokit-beaker-default-template) - A production-ready baseline for developing and deploying Beaker smart contracts. Please note this template option is to be deprecated after `puya` is ready for production use.
- [algokit-beaker-default-template](https://github.com/algorandfoundation/algokit-beaker-default-template) - A production-ready baseline for developing and deploying Beaker smart contracts.

### Frontend

Expand All @@ -44,7 +44,7 @@ And the following backend templates:
### Backend

- Compilation of multiple `puya`, `tealscript`, `beaker` contracts to a predictable folder location and file layout where they can be deployed.
- Compilation of multiple `python`, `tealscript`, `beaker` contracts to a predictable folder location and file layout where they can be deployed.
- Deploy-time immutability and permanence control.
- [Poetry](https://python-poetry.org/) for Python dependency management and virtual environment management.
- Linting via [Ruff](https://github.com/charliermarsh/ruff) or [Flake8](https://flake8.pycqa.org/en/latest/).
Expand Down
4 changes: 2 additions & 2 deletions copier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ contract_template:
help: Choose the contract template.
when: false
choices:
Puya: puya
Python: python
TealScript: tealscript
Beaker: beaker
default: puya
default: python

# project_name should never get prompted, AlgoKit should always pass it by convention
project_name:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,46 @@
},
{
"path": "./projects/production_beaker_react-frontend"
},
{
"path": "."
},
{
"path": "projects/production_beaker_react-frontend"
},
{
"path": "projects/production_beaker_react-contracts"
},
{
"path": "."
}
],
"settings": {
"files.exclude": {
"projects/": true
},
"jest.disabledWorkspaceFolders": ["ROOT", "projects"],
"jest.disabledWorkspaceFolders": [
"ROOT",
"projects"
],
"dotenv.enableAutocloaking": false
},
"extensions": {
"recommendations": ["joshx.workspace-terminals"]
"recommendations": [
"joshx.workspace-terminals"
]
},

"tasks": {
"version": "2.0.0",
"tasks": [
{
"label": "Build artifacts (+ LocalNet)",
"command": "algokit",
"args": ["project", "run", "build"],
"args": [
"project",
"run",
"build"
],
"options": {
"cwd": "${workspaceFolder}"
},
Expand All @@ -38,7 +58,10 @@
{
"label": "Start AlgoKit LocalNet",
"command": "algokit",
"args": ["localnet", "start"],
"args": [
"localnet",
"start"
],
"type": "shell",
"options": {
"cwd": "${workspaceFolder}"
Expand All @@ -58,7 +81,10 @@
"name": "Deploy contracts",
"folder": "production_beaker_react-contracts"
},
{ "name": "Run dApp", "folder": "production_beaker_react-frontend" }
{
"name": "Run dApp",
"folder": "production_beaker_react-frontend"
}
],
"presentation": {
"hidden": false,
Expand All @@ -67,4 +93,4 @@
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: 1.13.1-2-gf28c608
_commit: 1.13.1-3-g2215bf7
_src_path: gh:algorandfoundation/algokit-beaker-default-template
author_email: None
author_name: None
Expand Down
38 changes: 0 additions & 38 deletions examples/production_puya_react/.github/workflows/release.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions examples/production_puya_react/.github/workflows/validate.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ type = 'workspace'
projects_root_path = 'projects'

[project.run]
build = ['production_puya_react-contracts', 'production_puya_react-frontend']
build = ['production_python_react-contracts', 'production_python_react-frontend']
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ cloud_provider: netlify
contract_name: hello_world
deployment_language: python
preset_name: production
project_name: production_puya_react
project_name: production_python_react

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release production_puya_react-contracts
name: Release production_python_react-contracts

on:
workflow_call:
Expand All @@ -25,7 +25,7 @@ jobs:
run: pipx install git+https://github.com/algorandfoundation/algokit-cli@feat/command_orchestration

- name: Bootstrap dependencies
run: algokit bootstrap all --project-name 'production_puya_react-contracts'
run: algokit bootstrap all --project-name 'production_python_react-contracts'

- name: Configure git
shell: bash
Expand All @@ -34,7 +34,7 @@ jobs:
git config --global user.email "[email protected]" && git config --global user.name "github-actions"
- name: Deploy to testnet
run: algokit deploy testnet --project-name 'production_puya_react-contracts'
run: algokit deploy testnet --project-name 'production_python_react-contracts'
env:
# This is the account that becomes the creator of the contract
DEPLOYER_MNEMONIC: ${{ secrets.DEPLOYER_MNEMONIC }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Validate production_puya_react-contracts
name: Validate production_python_react-contracts

on:
workflow_call:
Expand Down Expand Up @@ -26,7 +26,7 @@ jobs:
run: algokit localnet start

- name: Bootstrap dependencies
run: algokit bootstrap all --project-name 'production_puya_react-contracts'
run: algokit bootstrap all --project-name 'production_python_react-contracts'

- name: Configure git
shell: bash
Expand All @@ -35,25 +35,25 @@ jobs:
git config --global user.email "[email protected]" && git config --global user.name "github-actions"
- name: Audit python dependencies
run: algokit project run audit --project-name 'production_puya_react-contracts'
run: algokit project run audit --project-name 'production_python_react-contracts'

- name: Lint and format python dependencies
run: algokit project run lint --project-name 'production_puya_react-contracts'
run: algokit project run lint --project-name 'production_python_react-contracts'

- name: Run tests
shell: bash
run: |
set -o pipefail
algokit project run test --project-name 'production_puya_react-contracts'
algokit project run test --project-name 'production_python_react-contracts'
- name: Build smart contracts
run: algokit project run build --project-name 'production_puya_react-contracts'
run: algokit project run build --project-name 'production_python_react-contracts'

- name: Scan TEAL files for issues
run: algokit project run audit-teal --project-name 'production_puya_react-contracts'
run: algokit project run audit-teal --project-name 'production_python_react-contracts'

- name: Check output stability of the smart contracts
run: algokit project run ci-teal-diff --project-name 'production_puya_react-contracts'
run: algokit project run ci-teal-diff --project-name 'production_python_react-contracts'

- name: Run deployer against LocalNet
run: algokit project deploy localnet --project-name 'production_puya_react-contracts'
run: algokit project deploy localnet --project-name 'production_python_react-contracts'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release production_puya_react-frontend
name: Release production_python_react-frontend

on:
workflow_call:
Expand Down Expand Up @@ -26,7 +26,7 @@ jobs:
run: pipx install git+https://github.com/algorandfoundation/algokit-cli@feat/command_orchestration

- name: Bootstrap dependencies
run: algokit bootstrap all --project-name 'production_puya_react-frontend'
run: algokit bootstrap all --project-name 'production_python_react-frontend'

- name: Publish to Netlify
env:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Validate production_puya_react-frontend
name: Validate production_python_react-frontend

on:

Expand Down Expand Up @@ -32,16 +32,16 @@ jobs:
run: pipx install git+https://github.com/algorandfoundation/algokit-cli@feat/command_orchestration

- name: Install dependencies
run: algokit bootstrap all --project-name 'production_puya_react-frontend'
run: algokit bootstrap all --project-name 'production_python_react-frontend'


- name: Run linters
run: algokit project run lint --project-name 'production_puya_react-frontend'
run: algokit project run lint --project-name 'production_python_react-frontend'


- name: Run unit tests
run: algokit project run test --project-name 'production_puya_react-frontend'
run: algokit project run test --project-name 'production_python_react-frontend'


- name: Build
run: algokit project run build --project-name 'production_puya_react-frontend'
run: algokit project run build --project-name 'production_python_react-frontend'
38 changes: 38 additions & 0 deletions examples/production_python_react/.github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release

on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
- '**.md'
- '.vscode/**'
- '.idea/**'

permissions:
contents: read
packages: read

jobs:
production_python_react-contracts-validate:
name: Run production_python_react-contracts release
secrets: inherit
uses: ./.github/workflows/production_python_react-contracts-ci.yaml

production_python_react-contracts-release:
name: Run production_python_react-contracts release
secrets: inherit
uses: ./.github/workflows/production_python_react-contracts-cd.yaml
needs: production_python_react-contracts-validate

production_python_react-frontend-validate:
name: Run production_python_react-frontend release
secrets: inherit
uses: ./.github/workflows/production_python_react-frontend-ci.yaml

production_python_react-frontend-release:
name: Run production_python_react-frontend release
secrets: inherit
uses: ./.github/workflows/production_python_react-frontend-cd.yaml
needs: production_python_react-frontend-validate
14 changes: 14 additions & 0 deletions examples/production_python_react/.github/workflows/validate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Pull Request validation

on: [pull_request]


jobs:
production_python_react-contracts-ci:
name: Run production_python_react-contracts validation
uses: ./.github/workflows/production_python_react-contracts-ci.yaml

production_python_react-frontend-ci:
name: Run production_python_react-frontend validation
uses: ./.github/workflows/production_python_react-frontend-ci.yaml

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# production_puya_react
# production_python_react

This starter full stack project has been generated using AlgoKit. See below for default getting started instructions.

Expand All @@ -15,8 +15,8 @@ This starter full stack project has been generated using AlgoKit. See below for
- For all projects, it will copy `.env.template` to `.env`.
- Run `algokit localnet start` to start a local Algorand network in Docker. If you are using VS Code launch configurations provided by the template, this will be done automatically for you.
3. Open the project and start debugging / developing on:
- [production_puya_react-contracts](projects/production_puya_react-contracts/README.md) - Refer to the README for more information on how to work with smart contracts.
- [production_puya_react-frontend](projects/production_puya_react-frontend/README.md) - Refer to the README for more information on how to work with the frontend application.
- [production_python_react-contracts](projects/production_python_react-contracts/README.md) - Refer to the README for more information on how to work with smart contracts.
- [production_python_react-frontend](projects/production_python_react-frontend/README.md) - Refer to the README for more information on how to work with the frontend application.


### Subsequently
Expand Down Expand Up @@ -48,10 +48,10 @@ It has also been configured to have a productive dev experience out of the box i

## Integrating with smart contracts and application clients

Refer to the [production_puya_react-contracts](projects/production_puya_react-contracts/README.md) folder for overview of working with smart contracts, [projects/production_puya_react-frontend](projects/production_puya_react-frontend/README.md) for overview of the React project and the [projects/production_puya_react-frontend/contracts](projects/production_puya_react-frontend/src/contracts/README.md) folder for README on adding new smart contracts from backend as application clients on your frontend. The templates provided in these folders will help you get started.
When you compile and generate smart contract artifacts, your frontend component will automatically generate typescript application clients from smart contract artifacts and move them to `frontend/src/contracts` folder, see [`generate:app-clients` in package.json](projects/production_puya_react-frontend/package.json). Afterwards, you are free to import and use them in your frontend application.
Refer to the [production_python_react-contracts](projects/production_python_react-contracts/README.md) folder for overview of working with smart contracts, [projects/production_python_react-frontend](projects/production_python_react-frontend/README.md) for overview of the React project and the [projects/production_python_react-frontend/contracts](projects/production_python_react-frontend/src/contracts/README.md) folder for README on adding new smart contracts from backend as application clients on your frontend. The templates provided in these folders will help you get started.
When you compile and generate smart contract artifacts, your frontend component will automatically generate typescript application clients from smart contract artifacts and move them to `frontend/src/contracts` folder, see [`generate:app-clients` in package.json](projects/production_python_react-frontend/package.json). Afterwards, you are free to import and use them in your frontend application.

The frontend starter also provides an example of interactions with your HelloWorldClient in [`AppCalls.tsx`](projects/production_puya_react-frontend/src/components/AppCalls.tsx) component by default.
The frontend starter also provides an example of interactions with your HelloWorldClient in [`AppCalls.tsx`](projects/production_python_react-frontend/src/components/AppCalls.tsx) component by default.

## Next Steps

Expand Down
Loading

0 comments on commit 4bb0c60

Please sign in to comment.