-
Notifications
You must be signed in to change notification settings - Fork 2
/
copier.yaml
139 lines (122 loc) · 4.67 KB
/
copier.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
_subdirectory: ./template_content
_tasks:
- "echo '==== Checking compatibility with the cli ==='"
- '"{{ python_path if python_path else _copier_python }}" pre_init.py'
- "echo '==== 1/4 - Initializing base template ===='"
- 'algokit init -t base -n . --no-git --no-ide --no-bootstrap --no-workspace
-a include_readme "no"
-a include_algokit_toml "no"
-a include_vscode_code_workspace "no"
-a include_github_workflow_template "no"'
# CLI auto sets include_github_workflow_template to false for any blessed template
# however still defining explicitly for clarity
- "echo '==== 2/4 - Initializing frontend template ===='"
- 'algokit init -t react -n {{ project_name }}-frontend --no-git --no-ide --no-bootstrap
-a author_email "{{ author_email }}"
-a author_name "{{ author_name }}"
-a preset_name "{{ preset_name }}"
-a ide_vscode "{{ ide_vscode }}"
-a ide_jetbrains "{{ ide_jetbrains }}"
-a cloud_provider "{{ cloud_provider }}"
-a use_github_actions "{{ use_github_actions }}"'
- "echo '==== 3/4 - Initializing contract template ===='"
- 'algokit init -t {{ contract_template }} -n {{ project_name }}-contracts --no-git --no-ide --no-bootstrap
-a author_email "{{ author_email }}"
-a author_name "{{ author_name }}"
-a preset_name "{{ preset_name }}"
-a contract_name "{{ contract_name }}"
-a deployment_language "{{ deployment_language }}"
-a ide_vscode "{{ ide_vscode }}"
-a ide_jetbrains "{{ ide_jetbrains }}"
-a use_github_actions "{{ use_github_actions }}"
-a use_pre_commit "no"'
- "echo '==== 4/4 - Finalizing setup ===='"
- '"{{ python_path if python_path else _copier_python }}" post_init.py "./projects/{{ project_name }}-contracts" "./projects/{{ project_name }}-frontend"'
# _copier_python above is used for backwards compatibility with versions < v1.11.3 of the algokit cli
# questions
contract_template:
type: str
help: Choose the contract template.
when: false
choices:
Python: python
TealScript: tealscript
Beaker: beaker
default: python
# project_name should never get prompted, AlgoKit should always pass it by convention
project_name:
type: str
help: Name for this project.
placeholder: 'algorand-frontend'
default: 'myproject'
# Auto determined by algokit-cli from v1.11.3 to allow execution of python script
# in binary mode.
python_path:
type: str
help: Path to the sys.executable.
when: false
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'
contract_name:
type: str
help: Name of the default smart contract app.
placeholder: '{{ "HelloWorld" if contract_template == "tealscript" else "hello_world" }}'
default: '{{ "HelloWorld" if contract_template == "tealscript" else "hello_world" }}'
validator: >-
{% if contract_template == 'tealscript' %}
{% if not (contract_name | regex_search('^[A-Z][a-zA-Z]*(?:[A-Z][a-zA-Z]*)*$')) %}
contract_name must be formatted in PascalCase.
{% endif %}
{% else %}
{% if not (contract_name | regex_search('^[a-z]+(?:_[a-z]+)*$')) %}
contract_name must be formatted in snake case.
{% endif %}
{% endif %}
author_name:
type: str
help: Package author name
placeholder: 'Your-Name'
default: 'Your-Name'
author_email:
type: str
help: Package author email
placeholder: 'your@email.tld'
default: 'your@email.tld'
deployment_language:
type: str
help: Pick language for deployment scripts in the backend?
when: "{{ contract_template != 'tealscript' }}"
choices:
Python: 'python'
TypeScript: 'typescript'
default: 'python'
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 (`frontend` optimized for WebStorm, `backend` for PyCharm CE)?
when: "{{ preset_name == 'custom' }}"
default: no
use_github_actions:
type: bool
help: Do you want to include Github Actions workflows for build and testnet deployment?
when: "{{ preset_name == 'custom' }}"
default: "{{ 'yes' if preset_name == 'production' else 'no' }}"
cloud_provider:
type: str
help: Pick your website hosting provider for continuous delivery
when: '{{ use_github_actions != false }}'
choices:
Netlify: 'netlify'
Vercel: 'vercel'
Skip CD setup: 'none'
default: "{{ 'netlify' if preset_name == 'production' else 'none' }}"