-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmise.toml
More file actions
198 lines (164 loc) · 4.54 KB
/
Copy pathmise.toml
File metadata and controls
198 lines (164 loc) · 4.54 KB
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
[tools]
python = "3.14"
uv = "latest"
##### Settings and environment variables #####
[settings]
python.uv_venv_auto = "create|source"
[env]
JSII_SILENCE_WARNING_UNTESTED_NODE_VERSION = true # silence warning about untested Node.js versions in CDK
##### Shell aliases #####
[shell_alias]
# Project-specific shortcuts
n = "mise run new"
i = "mise run install"
u = "mise run update"
l = "mise run lint"
t = "mise run test"
d = "mise run deploy"
D = "mise run destroy"
v = "mise run verify"
c = "mise run clean"
m = "mise run"
# Common utility aliases
ll = "ls -la"
la = "ls -A"
gs = "git status"
ga = "git add"
gc = "git commit"
gp = "git push"
gco = "git checkout"
gb = "git branch"
g = "git"
##### Scripts #####
[tasks.new]
description = "Create new Lambda function template"
usage = """
arg "<template>" help="Template name"
"""
run = "uv run new -n $usage_template"
alias = "n"
[tasks.init]
description = "Initialize project (run once)"
usage = """
flag "--name <name>" help="Project new name"
flag "--description <description>" help="Project short description"
flag "--author <author>" help="Author name"
flag "--email <email>" help="Author email"
flag "--github <github>" help="GitHub username"
"""
run = "uv run init"
##### Dev setup and maintenance #####
[tasks.install]
description = "Install dependencies and project"
run = "uv sync"
alias = "i"
[tasks.update]
description = "Update dependencies"
run = "uv lock --upgrade"
alias = "u"
[tasks.precommit]
description = "Install pre-commit hooks"
run = "uv run pre-commit autoupdate && uv run pre-commit install"
[tasks.dev]
description = "Set up dev environment"
depends = ["precommit"]
[tasks.lint]
description = "Format and lint code"
run = """
uv run ruff format
uv run ruff check --fix
uv run ruff format
# uv run pyright
"""
alias = "l"
[tasks.test]
description = "Run tests with coverage"
run = """
uv run coverage run -m pytest .
uv run coverage report -m
uv run coverage xml
"""
alias = "t"
[tasks.verify]
description = "Run lint, test, and infra synth"
depends = ["lint", "test", "infra:synth"]
alias = "v"
[tasks.clean]
description = "Clean up build artifacts and temporary files"
run = """rm -rf cdk.out .coverage coverage.xml .pytest_cache .ruff_cache .hypothesis .localstack node_modules"""
alias = "c"
##### Docs #####
[tasks.install-docs]
description = "Install documentation dependencies"
run = "uv sync --group docs"
hide = true
tools = { node = "latest" }
[tasks.docs]
description = "Build and deploy documentation to GitHub pages"
run = "uv run mkdocs gh-deploy --force"
depends = ["install-docs"]
[tasks.docs-local]
description = "Serve documentation on a local server"
run = "uv run mkdocs serve"
##### Infra #####
[tasks."infra:setup"]
description = "Install CDK dependencies"
run = "uv sync --group infra"
hide = true
[tasks."infra:synth"]
description = "Synthesize CDK stack(s)"
usage = """
arg "[stack]" help="CDK stack to synthesize"
"""
run = "STACK=${usage_stack:-all} npx aws-cdk synth"
alias = ["synth", "s"]
depends = ["infra:setup"]
[tasks."infra:deploy"]
description = "Deploy a CDK stack"
usage = """
arg "<stack>" help="CDK stack to deploy"
flag "-p --profile <profile>" help="AWS profile to use"
"""
run = "STACK=$usage_stack npx aws-cdk deploy ${usage_profile:+--profile $usage_profile}"
alias = ["d", "deploy"]
depends = ["infra:synth"]
[tasks."infra:destroy"]
description = "Destroy a deployed CDK stack"
usage = """
arg "<stack>" help="CDK stack to destroy"
flag "-p --profile <profile>" help="AWS profile to use"
"""
run = "STACK=$usage_stack npx aws-cdk destroy --force ${usage_profile:+--profile $usage_profile}"
alias = ["destroy", "D"]
depends = ["infra:setup"]
[tasks."local:setup"]
description = "Install CDK dependencies in local environment"
run = "pnpm i"
hide = true
tools = { node = "latest" }
depends = ["infra:setup"]
[tasks."local:deploy"]
description = "Deploy a CDK stack to LocalStack"
usage = """
arg "<stack>" env=STACK help="CDK stack to deploy"
"""
run = "STACK=$usage_stack pnpm run deploy"
alias = ["local"]
depends = ["local:setup", "local:up"]
[tasks."local:destroy"]
description = "Destroy a deployed CDK stack from LocalStack"
usage = """
arg "<stack>" env=STACK help="CDK stack to destroy"
"""
run = "STACK=$usage_stack pnpm run destroy"
depends = ["local:setup"]
[tasks."local:up"]
description = "Start LocalStack via docker compose"
run = "docker compose up -d --wait localstack"
[tasks."local:down"]
description = "Stop LocalStack via docker compose"
run = "docker compose down localstack"
[tasks."local:deploy".env]
_.file = ".env.local"
[tasks."local:destroy".env]
_.file = ".env.local"