Skip to content

Commit

Permalink
feat: init wizard v2 improvements (#59)
Browse files Browse the repository at this point in the history
* feat: tealer integration

* chore: apply tweaks

Co-authored-by: Neil Campbell <neil.campbell@makerx.com.au>

* refactor: addressing pr comments

* chore: updating gitignore

* chore: updating gitignore

* chore: bump min version of algokit cli

* chore: adding custom preset; aligning launch configs

* chore: minor tweaks

* chore: minor tweaks

* refactor: refining tests; adding contribution guide; adding refs to readme

* docs: minor tweaks

* docs: minor tweaks

* chore: minor tweaks

* chore: minor tweaks

* chore: using algokit from preview branch

* chore: refining preset question

* chore: minor refinements

* chore: minor tweaks

* chore: minor tweaks in copier

* chore: remove zendesk actions

* refactor: addressing pr comments

* chore: merging latest

* chore: patching ci

* chore: defaulting vscode answer to yes

* chore: refining tests

* chore: refining ci dependencies

---------

Co-authored-by: Neil Campbell <neil.campbell@makerx.com.au>
  • Loading branch information
aorumbayev and neilcampbell committed Feb 26, 2024
1 parent f75a831 commit 46a2dd3
Show file tree
Hide file tree
Showing 569 changed files with 1,201 additions and 10,878 deletions.
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: "\U0001F41C Bug report"
about: Report a reproducible bug.
title: ''
labels: bug
assignees: ''
---

### Subject of the issue

<!-- Describe your issue here. -->

### Your environment

<!--
* Please provide the output of `algokit doctor` command response,
* This will give us a good idea about your environment
-->

### Steps to reproduce

1.
2.

### Expected behaviour

### Actual behaviour
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: "\U0001F514 Feature Request"
about: Suggestions for how we can improve the algorand platform.
title: ''
labels: enhancement
assignees: ''
---

## Problem

<!-- What is the problem that we’re trying to solve? -->

## Solution

<!-- Do you have a potential/suggested solution? Document more than one if possible. -->

### Proposal

<!-- Describe the solution you’d like in detail. -->

### Pros and Cons

<!-- What are the advantages and disadvantages of this solution? -->

## Dependencies

<!-- Does the solution have any team or design dependencies? -->
2 changes: 1 addition & 1 deletion .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
needs: ci-check-python
steps:
- name: Checkout source code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Tag release
id: tag
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/check-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: Checkout source code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Install algokit
run: pipx install algokit
run: pipx install git+https://github.com/algorandfoundation/algokit-cli@feat/init_wizard_v2 --force

- name: Set up Python 3.10
uses: actions/setup-python@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
cache: "poetry"

- name: Install dependencies
Expand Down Expand Up @@ -51,6 +51,6 @@ jobs:
shell: bash
run: |
# Add untracked files as empty so they come up in diff
git add -N ./tests_generated
git add -N ./examples
# Look for changes in generated templates and error if there are any
git diff --exit-code --minimal ./tests_generated
git diff --exit-code --minimal ./examples
12 changes: 0 additions & 12 deletions .github/workflows/issue_closed.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/issue_commented.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/issue_labelled.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/workflows/zendesk_github_add_comment.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/workflows/zendesk_github_close_issue.yml

This file was deleted.

8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,11 @@ cython_debug/

# NPM
node_modules

# Ignore lockfiles in all directories and subdirectories under examples, recursively
examples/**/package-lock.json
examples/**/poetry.lock

# playground folder for previewing templates
.playground/*
!.playground/.gitkeep
File renamed without changes.
40 changes: 40 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# AlgoKit Official Template for contributors

This repository is a template for creating new AlgoKit projects. It includes a basic structure for creating a beaker based smart contract project.

## Pre-requisites

`poetry install` - Install the dependencies for the project.

## Testing

```bash
poetry run pytest
```

This will regenerate the tests for default `starter` and `production` presets as well as default tests for `generators` available on the template.

## Development

```bash
poetry run copier copy . .playground/{some_dummy_folder_name} --vcs-ref=HEAD --trust
```

To generate a dummy project into the `.playground` folder. This is useful for testing the template to quickly preview the output of the template before testing via `pytest`.

## Contributing

### Commits

We are using the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) standard for commit messages. This allows us to automatically generate release notes and version numbers. We do this via [Python Semantic Release](https://python-semantic-release.readthedocs.io/en/latest/) and [GitHub actions](.github/workflows/cd.yaml).

### Guiding Principles

AlgoKit development is done within the [AlgoKit Guiding Principles](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/algokit.md#guiding-principles).

### Pull Requests

1. Submit a pull request to the `main` branch. Fork the repo if you are an external contributor.
2. Ensure that the pull request is up to date with the `main` branch.
3. Ensure that the pull request has a clear title and description.
4. Pass PR reviews and wait for approval.
48 changes: 31 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<a target="_blank" href="https://github.com/algorandfoundation/algokit-cli"><img src="https://img.shields.io/badge/docs-repository-00dc94?logo=github&style=flat.svg" /></a>
<a target="_blank" href="https://developer.algorand.org/algokit/"><img src="https://img.shields.io/badge/learn-AlgoKit-00dc94?logo=algorand&mac=flat.svg" /></a>
<a target="_blank" href="https://github.com/algorandfoundation/algokit-beaker-default-template"><img src="https://img.shields.io/github/stars/algorandfoundation/algokit-beaker-default-template?color=00dc94&logo=star&style=flat" /></a>
<a target="_blank" href="https://developer.algorand.org/algokit/"><img src="https://vbr.wocr.tk/badge?page_id=algorandfoundation%2Falgokit-beaker-default-template&color=%2300dc94&style=flat" /></a>
<a target="_blank" href="https://developer.algorand.org/algokit/"><img src="https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Fgithub.com%2Falgorandfoundation%2Falgokit-beaker-default-template&countColor=%2300dc94&style=flat" /></a>
</p>

---
Expand All @@ -21,21 +21,35 @@ This is one of the official templates used by AlgoKit to initialize an Algorand

This template supports the following features:

- Compilation of [multiple Beaker contracts](template_content/smart_contracts/config.py) to a [predictable folder location and file layout](template_content/smart_contracts/__main__.py) 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/)
- Formatting via [Black](https://github.com/psf/black)
- Type checking via [mypy](https://mypy-lang.org/)
- Testing via pytest (not yet used)
- Dependency vulnerability scanning via pip-audit (not yet used)
- VS Code configuration (linting, formatting, breakpoint debugging)
- dotenv (.env) file for configuration
- Automated testing of the compiled smart contracts
- [Output stability](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/articles/output_stability.md) tests of the TEAL output
- CI/CD pipeline using GitHub Actions:
- - Optionally pick deployments to Netlify or Vercel

# Getting started
- Compilation of [multiple Beaker contracts](template_content/smart_contracts/config.py) to a [predictable folder location and file layout](template_content/smart_contracts/__main__.py) 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/)
- Formatting via [Black](https://github.com/psf/black)
- Type checking via [mypy](https://mypy-lang.org/)
- Testing via pytest (not yet used)
- Dependency vulnerability scanning via pip-audit (not yet used)
- VS Code configuration (linting, formatting, breakpoint debugging)
- dotenv (.env) file for configuration
- Automated testing of the compiled smart contracts
- [Output stability](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/articles/output_stability.md) tests of the TEAL output
- CI/CD pipeline using GitHub Actions:
- - Optionally pick deployments to Netlify or Vercel

## Getting started

Once the template is instantiated you can follow the [README.md](template_content/README.md.jinja) file to see instructions for how to use the template.

### Interactive Wizard

**To initialize using the `algokit` CLI**:

- Execute the command `algokit init`. This initiates an interactive wizard that assists in selecting the most appropriate template for your project requirements.

**To initialize within GitHub Codespaces**:

- Follow these steps to leverage GitHub Codespaces for template selection:

1. Go to the [algokit-base-template](https://github.com/algorandfoundation/algokit-base-template) repository.
2. Initiate a new codespace by selecting the `Create codespace on main` option. This can be found by clicking the `Code` button, then navigating to the `Codespaces` tab.
3. Upon codespace preparation, `algokit` will automatically start `LocalNet` and present a prompt with the next steps. Executing `algokit init` will initiate the interactive wizard.
Loading

0 comments on commit 46a2dd3

Please sign in to comment.