-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: init wizard v2 improvements (#25)
* chore: wip * chore: test * chore: test * chore: test * chore: test * chore: test * chore: test * chore: wip * chore: minor tweaks * chore: removing default answers * refactor: tests structure * chore: using algokit from preview branch * chore: refining preset question * chore: minor refinements * chore: minor tweaks * chore: minor tweaks in copier * chore: remove zendesk yamls; refine tests * refactor: addressing pr comments * chore: patching ci * chore: defaulting vscode answer to yes * chore: refining ci dependencies * chore: fixing aiohttp 3.12 compatibility * chore: removing explicit pin on aiohttp
- Loading branch information
1 parent
b1cd177
commit 3981e53
Showing
308 changed files
with
4,075 additions
and
602 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 front end 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
_subdirectory: template_content | ||
_templates_suffix: '.jinja' | ||
|
||
# questions | ||
# project_name should never get prompted, AlgoKit should always pass it by convention | ||
|
@@ -17,47 +18,62 @@ author_email: | |
help: Package author email | ||
placeholder: '[email protected]' | ||
|
||
preset_name: | ||
type: str | ||
help: Name of the template preset to use. | ||
choices: | ||
'Starter - for a simpler starting point ideal for prototyping': 'starter' | ||
'Production - for confidently deploying to MainNet and/or more complex projects': 'production' | ||
'Custom - for tailoring the template output to your needs': 'custom' | ||
default: 'starter' | ||
|
||
ide_vscode: | ||
type: bool | ||
help: Do you want to add VSCode configuration? | ||
when: "{{ preset_name == 'custom' }}" | ||
default: yes | ||
|
||
ide_jetbrains: | ||
type: bool | ||
help: Do you want to add JetBrains configuration (primarily optimized for WebStorm)? | ||
when: '{{ ide_vscode == false }}' | ||
default: no | ||
when: "{{ preset_name == 'custom' }}" | ||
default: "{{ 'yes' if preset_name == 'production' else 'no' }}" | ||
|
||
use_eslint_prettier: | ||
type: bool | ||
help: Do you want to use ESLint and Prettier for code linting and formatting? | ||
default: yes | ||
when: "{{ preset_name == 'custom' }}" | ||
default: "{{ 'yes' if preset_name == 'production' else 'no' }}" | ||
|
||
use_tailwind: | ||
type: bool | ||
help: Do you want to use Tailwind CSS? A utility-first CSS framework for rapidly building custom designs. | ||
default: yes | ||
when: "{{ preset_name == 'custom' }}" | ||
default: "{{ 'yes' if preset_name == 'production' else 'no' }}" | ||
|
||
use_daisy_ui: | ||
type: bool | ||
help: Do you want to use a daisyUI? Framework agnostic CSS component library for building modern websites and web applications fast. | ||
default: yes | ||
when: '{{ use_tailwind != false }}' | ||
help: Do you want to use daisyUI? Framework agnostic CSS component library for building modern websites and web applications fast. | ||
when: "{{ use_tailwind != false and preset_name == 'custom' }}" | ||
default: "{{ 'yes' if preset_name == 'production' else 'no' }}" | ||
|
||
use_jest: | ||
type: bool | ||
help: Do you want to include unit tests (via Jest)? | ||
default: yes | ||
when: "{{ preset_name == 'custom' }}" | ||
default: "{{ 'yes' if preset_name == 'production' else 'no' }}" | ||
|
||
use_playwright: | ||
type: bool | ||
help: Do you want to include end to end tests (via Playwright)? | ||
default: yes | ||
when: "{{ preset_name == 'custom' }}" | ||
default: "{{ 'yes' if preset_name == 'production' else 'no' }}" | ||
|
||
use_github_actions: | ||
type: bool | ||
help: Do you want to include Github Actions workflows for build validation? | ||
default: yes | ||
when: "{{ preset_name == 'custom' }}" | ||
default: "{{ 'yes' if preset_name == 'production' else 'no' }}" | ||
|
||
cloud_provider: | ||
type: str | ||
|
@@ -67,36 +83,4 @@ cloud_provider: | |
Netlify: 'netlify' | ||
Vercel: 'vercel' | ||
Skip CD setup: 'none' | ||
default: 'netlify' | ||
|
||
# The following should never get prompted; algokit should always pass these values through by convention | ||
|
||
algod_token: | ||
type: str | ||
help: Default Algod Token | ||
default: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' | ||
|
||
algod_server: | ||
type: str | ||
help: Default Algod server | ||
default: 'http://localhost' | ||
|
||
algod_port: | ||
type: int | ||
help: Default Algod port | ||
default: 4001 | ||
|
||
indexer_token: | ||
type: str | ||
help: Default Indexer token | ||
default: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' | ||
|
||
indexer_server: | ||
type: str | ||
help: Default Indexer server | ||
default: 'http://localhost' | ||
|
||
indexer_port: | ||
type: int | ||
help: Default Indexer port | ||
default: 8980 | ||
default: "{{ 'netlify' if preset_name == 'production' else 'none' }}" |
Empty file.
Empty file.
10 changes: 10 additions & 0 deletions
10
examples/cloud_provider/production_react_netlify/.algokit.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[algokit] | ||
min_version = "v1.3.0b1" | ||
|
||
[generate.import_contract] | ||
description = "Import a typed client from your smart contracts project" | ||
path = ".algokit/generators/import_contract" | ||
|
||
[project] | ||
type = "frontend" | ||
name = "production_react_netlify" |
9 changes: 9 additions & 0 deletions
9
examples/cloud_provider/production_react_netlify/.copier-answers.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY | ||
_commit: <commit> | ||
_src_path: <src> | ||
author_email: None | ||
author_name: None | ||
cloud_provider: netlify | ||
preset_name: production | ||
project_name: production_react_netlify | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
54 changes: 54 additions & 0 deletions
54
examples/cloud_provider/production_react_netlify/.github/workflows/checks.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Check code base | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
run-build: | ||
required: false | ||
type: boolean | ||
default: false | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
checks: | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Run linters | ||
run: npm run lint | ||
|
||
- name: Run unit tests | ||
run: npm run test | ||
|
||
- name: Create placeholder .env file | ||
if: ${{ inputs.run-build }} | ||
uses: makerxstudio/shared-config/.github/actions/env-to-placeholders@main | ||
with: | ||
env-output-path: './.env' | ||
env-template-path: './.env.template' | ||
env-variable-prefix: VITE_ | ||
|
||
- name: Build | ||
if: ${{ inputs.run-build }} | ||
run: npm run build | ||
|
||
- name: Archive | ||
if: ${{ inputs.run-build }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist | ||
path: dist/ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ll_default_parameters_on_vercel/README.md → ...ovider/production_react_netlify/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...default_parameters_on_vercel/package.json → ...der/production_react_netlify/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.