-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathmise.toml
More file actions
593 lines (514 loc) · 22.2 KB
/
Copy pathmise.toml
File metadata and controls
593 lines (514 loc) · 22.2 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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
[tools]
actionlint = "latest"
buf = "latest"
go = "1.26.2"
goreleaser = "latest"
node = "22"
uv = "0.11.30"
[env]
_.file = '.env'
CHATTO_DEVELOPMENT_VERSION = "0.5.0-dev"
# =============================================================================
# Setup
# =============================================================================
[tasks.setup]
description = "Set up the development environment"
run = [
{ task = "setup-appconfig" },
{ task = "setup-cli" },
{ task = "setup-datacrypto" },
{ task = "setup-events" },
{ task = "setup-natsruntime" },
{ task = "setup-frontend" },
{ task = "build-api-types" },
{ task = "build-lingua" },
]
# =============================================================================
# Dependencies
# =============================================================================
[tasks.deps-cli]
description = "Install Go dependencies"
dir = "cli"
run = "go mod download"
sources = ["go.mod", "go.sum"]
[tasks.deps-appconfig]
description = "Install application configuration dependencies"
dir = "pkg/appconfig"
run = "GOWORK=off go mod download"
sources = ["go.mod", "go.sum"]
[tasks.deps-datacrypto]
description = "Install data cryptography dependencies"
dir = "pkg/datacrypto"
run = "GOWORK=off go mod download"
sources = ["go.mod", "go.sum"]
[tasks.deps-events]
description = "Install event framework Go dependencies"
dir = "pkg/events"
run = "GOWORK=off go mod download"
sources = ["go.mod", "go.sum"]
[tasks.deps-natsruntime]
description = "Install embedded NATS runtime Go dependencies"
dir = "pkg/natsruntime"
run = "GOWORK=off go mod download"
sources = ["go.mod", "go.sum"]
[tasks.deps-frontend]
description = "Install frontend dependencies"
dir = "."
run = "pnpm install"
# package.json also contains app metadata and scripts; the lockfile is the
# dependency-resolution input that should trigger installs.
sources = ["package.json", "pnpm-lock.yaml", "pnpm-workspace.yaml", ".npmrc", "apps/*/package.json", "packages/*/package.json"]
[tasks.deps]
description = "Install all dependencies"
run = { task = "deps-*" }
[tasks.setup-cli]
description = "Set up the CLI module"
depends = ["deps-cli", "sync-cli-legal"]
[tasks.setup-appconfig]
description = "Set up the application configuration module"
depends = ["deps-appconfig"]
[tasks.setup-datacrypto]
description = "Set up the data cryptography module"
depends = ["deps-datacrypto"]
[tasks.setup-events]
description = "Set up the event framework module"
depends = ["deps-events"]
[tasks.setup-natsruntime]
description = "Set up the embedded NATS runtime module"
depends = ["deps-natsruntime"]
[tasks.setup-frontend]
description = "Set up the frontend module"
depends = ["deps-frontend"]
# =============================================================================
# License Metadata
# =============================================================================
[tasks.license-check]
description = "Check SPDX/REUSE license metadata"
run = "uvx --with charset-normalizer 'reuse==6.2.0' lint"
# =============================================================================
# Code Generation
# =============================================================================
[tasks.codegen-proto]
description = "Generate Go and frontend code from protobuf schemas"
depends = ["setup-cli", "setup-frontend"]
dir = "proto"
run = [
"pnpm --dir ../packages/api-types run clean",
"buf generate",
"node ../tools/split-connectrpc-docs.mjs",
"node ../tools/trim-proto-codegen-output.mjs",
]
[tasks.codegen-emoji]
description = "Generate Go emoji map from gemoji npm package"
depends = ["setup-frontend"]
run = "node tools/gen-emoji-map.mjs"
[tasks.codegen]
description = "Run all code generation tasks"
run = { task = "codegen-*" }
# =============================================================================
# Build
# =============================================================================
# Chatto does not expose Gin's MessagePack binding. Keep the nomsgpack tag on
# every Chatto binary build so the large, unused ugorji codec is not linked.
[tasks.sync-cli-legal]
description = "Copy root legal files into the CLI module for go:embed"
run = [
"mkdir -p cli/cmd/embedded",
"cp LICENSES/AGPL-3.0-or-later.txt cli/LICENSE",
"cp NOTICE cli/NOTICE",
"cp LICENSES/AGPL-3.0-or-later.txt cli/cmd/embedded/LICENSE",
"cp NOTICE cli/cmd/embedded/NOTICE",
]
sources = ["LICENSES/AGPL-3.0-or-later.txt", "NOTICE"]
outputs = ["cli/LICENSE", "cli/NOTICE", "cli/cmd/embedded/LICENSE", "cli/cmd/embedded/NOTICE"]
[tasks.build]
description = "Build Chatto and its bundled frontend"
run = [{ task = "build-*" }, "ls -lah cli/bin/*"]
[tasks.desktop-build]
description = "Build the experimental Chatto desktop app for the host platform"
depends = ["build-frontend"]
dir = "apps/desktop"
run = "pnpm build"
[tasks.build-api-types]
description = "Build the generated TypeScript API package"
depends = ["setup-frontend"]
dir = "packages/api-types"
run = "pnpm build"
sources = ["package.json", "tsconfig.json", "src/**/*"]
[tasks.build-lingua]
description = "Build the JSON internationalisation runtime package"
depends = ["setup-frontend"]
dir = "packages/lingua"
run = "pnpm build"
sources = ["package.json", "tsconfig.json", "src/**/*"]
[tasks.build-frontend]
description = "Build the frontend application"
depends = ["setup-frontend", "build-api-types", "build-lingua"]
dir = "apps/frontend"
run = [
"pnpm svelte-kit sync",
"pnpm build",
"touch build/.mise-build-stamp",
"bash ../../tools/prepare-embedded-frontend.sh build ../../cli/internal/http_server/.client",
]
sources = [
"../../.npmrc",
"../../package.json",
"../../pnpm-lock.yaml",
"../../pnpm-workspace.yaml",
"../../packages/api-types/dist/**/*",
"../../packages/lingua/dist/**/*",
"package.json",
"messages/**/*",
"scripts/check-bundle-size.mjs",
"../../tools/prepare-embedded-frontend.sh",
"src/**/*",
"!src/**/*.spec.*",
"!src/**/*.test.*",
"!src/**/*.stories.*",
"!src/**/*TestHarness.svelte",
"static/**/*",
"svelte.config.js",
"tsconfig.json",
"vite.config.ts",
]
outputs = ["build/.mise-build-stamp", "../../cli/internal/http_server/.client/.gitkeep"]
[tasks.build-dev-cli]
description = "Build the development CLI application for the current architecture"
depends = ["setup-cli", "build-frontend"]
dir = "cli"
run = "go build -trimpath -tags 'bootstrap nomsgpack' -ldflags \"-X main.Version=$CHATTO_DEVELOPMENT_VERSION\" -o bin/chatto ."
sources = [
"go.mod",
"go.sum",
"**/*.go",
"!**/*_test.go",
"cmd/embedded/LICENSE",
"cmd/embedded/NOTICE",
"internal/http_server/.client/**/*",
]
outputs = ["bin/chatto"]
[tasks.build-e2e-server]
description = "Build the E2E test server binary with dev bootstrap and test endpoints enabled"
depends = ["setup-cli", "build-frontend"]
dir = "cli"
# `bootstrap` enables the [bootstrap] section in chatto.toml, which seeds
# the e2eadmin user the harness logs in as. `test_endpoints` exposes the
# test-only HTTP endpoints (e.g. /auth/test/create-user) used by per-test
# fixtures. Deliberately scoped — the e2e binary should NOT pull in any
# future broader dev-only code that might land under a separate tag.
run = "CGO_ENABLED=0 go build -trimpath -tags 'bootstrap nomsgpack test_endpoints' -ldflags \"-s -w -X main.Version=$CHATTO_DEVELOPMENT_VERSION\" -o ../apps/frontend/e2e/fixtures/bin/chatto ."
sources = [
"**/*.go",
"cmd/embedded/LICENSE",
"cmd/embedded/NOTICE",
"internal/http_server/.client/**/*",
]
outputs = ["../apps/frontend/e2e/fixtures/bin/chatto"]
[tasks.build-compatibility-server]
description = "Build the production Chatto binary used as the current side of compatibility tests"
depends = ["setup-cli", "build-frontend"]
dir = "cli"
run = "CGO_ENABLED=0 go build -trimpath -tags nomsgpack -ldflags \"-s -w -X main.Version=$CHATTO_DEVELOPMENT_VERSION\" -o ../apps/frontend/e2e/fixtures/bin/chatto-current ."
sources = [
"**/*.go",
"cmd/embedded/LICENSE",
"cmd/embedded/NOTICE",
"internal/http_server/.client/**/*",
]
outputs = ["../apps/frontend/e2e/fixtures/bin/chatto-current"]
[tasks.storybook]
description = "Run the Storybook design-system catalog on the workspace port"
depends = ["setup-frontend", "build-api-types"]
dir = "apps/frontend"
env = {
CHATTO_STORYBOOK_PORT = "{{env.CHATTO_STORYBOOK_PORT | default(value=env.CONDUCTOR_PORT | default(value=env.PASEO_PORT | default(value='4000')))}}",
}
run = "exec pnpm exec storybook dev --host 127.0.0.1 --port \"$CHATTO_STORYBOOK_PORT\" --no-open"
[tasks.dev-backend]
description = "Build and run the local development backend"
depends = ["setup-cli"]
dir = "cli"
run = "mkdir -p internal/http_server/.client && touch internal/http_server/.client/.gitkeep && go build -trimpath -tags 'bootstrap nomsgpack' -ldflags \"-X main.Version=$CHATTO_DEVELOPMENT_VERSION\" -o bin/chatto-dev . && exec ./bin/chatto-dev start"
[tasks.dev-frontend]
description = "Run the local development frontend"
depends = ["setup-frontend", "build-api-types"]
dir = "apps/frontend"
run = "exec ./node_modules/.bin/vite dev"
[tasks.desktop-dev]
description = "Run the experimental Chatto desktop app with the latest frontend build"
depends = ["build-frontend"]
dir = "apps/desktop"
run = "pnpm dev"
[tasks.dev-livekit]
description = "Run a local LiveKit server with workspace-safe ports"
env = {
CHATTO_DEV_PORT_BASE = "{{env.CONDUCTOR_PORT | default(value=env.PASEO_PORT | default(value='4000'))}}",
CHATTO_DEV_LIVEKIT_KEYS = "devkey: devsecret",
CHATTO_DEV_LIVEKIT_PORT = "{{env.CHATTO_DEV_PORT_BASE | int + 5}}",
CHATTO_DEV_LIVEKIT_RTC_TCP_PORT = "{{env.CHATTO_DEV_PORT_BASE | int + 6}}",
CHATTO_DEV_LIVEKIT_UDP_PORTS = "{{env.CHATTO_DEV_PORT_BASE | int + 7}}",
}
run = "exec livekit-server --dev --bind 127.0.0.1 --node-ip 127.0.0.1 --keys \"$CHATTO_DEV_LIVEKIT_KEYS\" --port \"$CHATTO_DEV_LIVEKIT_PORT\" --rtc.tcp_port \"$CHATTO_DEV_LIVEKIT_RTC_TCP_PORT\" --udp-port \"$CHATTO_DEV_LIVEKIT_UDP_PORTS\""
[tasks.dev-mailpit]
description = "Run a local Mailpit SMTP server with workspace-safe ports"
env = {
CHATTO_DEV_PORT_BASE = "{{env.CONDUCTOR_PORT | default(value=env.PASEO_PORT | default(value='4000'))}}",
CHATTO_DEV_MAILPIT_SMTP_PORT = "{{env.CHATTO_DEV_PORT_BASE | int + 8}}",
CHATTO_DEV_MAILPIT_UI_PORT = "{{env.CHATTO_DEV_PORT_BASE | int + 9}}",
}
run = "exec mailpit --smtp \"127.0.0.1:$CHATTO_DEV_MAILPIT_SMTP_PORT\" --listen \"127.0.0.1:$CHATTO_DEV_MAILPIT_UI_PORT\""
[tasks.dev]
description = "Run the local backend and frontend development servers"
depends = ["setup-cli", "build-api-types"]
env = {
VITE_PORT = "{{env.VITE_PORT | default(value=env.CONDUCTOR_PORT | default(value=env.PASEO_PORT | default(value='4000')))}}",
CHATTO_WEBSERVER_PORT = "{{env.CHATTO_WEBSERVER_PORT | default(value=env.CONDUCTOR_PORT | default(value=env.PASEO_PORT | default(value='4000')) | int + 1)}}",
CHATTO_WEBSERVER_URL = "{% if env.CHATTO_WEBSERVER_URL is defined and env.CHATTO_WEBSERVER_URL != '' %}{{env.CHATTO_WEBSERVER_URL}}{% else %}http://localhost:{{env.VITE_PORT | default(value=env.CONDUCTOR_PORT | default(value=env.PASEO_PORT | default(value='4000')))}}{% endif %}",
CHATTO_NATS_EMBEDDED_PORT = "{{env.CHATTO_NATS_EMBEDDED_PORT | default(value=env.CONDUCTOR_PORT | default(value=env.PASEO_PORT | default(value='4000')) | int + 2)}}",
CHATTO_NATS_CLIENT_URL = "{% if env.CHATTO_NATS_CLIENT_URL is defined and env.CHATTO_NATS_CLIENT_URL != '' %}{{env.CHATTO_NATS_CLIENT_URL}}{% else %}nats://localhost:{{env.CHATTO_NATS_EMBEDDED_PORT | default(value=env.CONDUCTOR_PORT | default(value=env.PASEO_PORT | default(value='4000')) | int + 2)}}{% endif %}",
CHATTO_METRICS_PORT = "{{env.CHATTO_METRICS_PORT | default(value=env.CONDUCTOR_PORT | default(value=env.PASEO_PORT | default(value='4000')) | int + 3)}}",
CHATTO_EXPORTER_PORT = "{{env.CHATTO_EXPORTER_PORT | default(value=env.CONDUCTOR_PORT | default(value=env.PASEO_PORT | default(value='4000')) | int + 4)}}",
CHATTO_LIVEKIT_URL = "{% if env.CHATTO_LIVEKIT_URL is defined and env.CHATTO_LIVEKIT_URL != '' %}{{env.CHATTO_LIVEKIT_URL}}{% else %}ws://localhost:{{env.CONDUCTOR_PORT | default(value=env.PASEO_PORT | default(value='4000')) | int + 5}}{% endif %}",
CHATTO_LIVEKIT_WEBHOOK_URL = "{% if env.CHATTO_LIVEKIT_WEBHOOK_URL is defined and env.CHATTO_LIVEKIT_WEBHOOK_URL != '' %}{{env.CHATTO_LIVEKIT_WEBHOOK_URL}}{% else %}http://localhost:{{env.CHATTO_WEBSERVER_PORT | default(value=env.CONDUCTOR_PORT | default(value=env.PASEO_PORT | default(value='4000')) | int + 1)}}/webhooks/livekit{% endif %}",
CHATTO_SMTP_PORT = "{{env.CHATTO_SMTP_PORT | default(value=env.CONDUCTOR_PORT | default(value=env.PASEO_PORT | default(value='4000')) | int + 8)}}",
}
run = { tasks = ["dev-backend", "dev-frontend", "dev-livekit", "dev-mailpit"] }
[tasks.dev-docs-website]
description = "Run the docs website development server with workspace-safe ports"
depends = ["setup-frontend"]
dir = "apps/docs-website"
raw = true
run = """
workspace_port_base="${CONDUCTOR_PORT:-${PASEO_PORT:-4000}}"
docs_website_port="${CHATTO_DOCS_WEBSITE_PORT:-$workspace_port_base}"
exec pnpm astro dev --host 127.0.0.1 --port "$docs_website_port"
"""
[tasks.chatto]
description = "Build and run the bundled Chatto CLI command with workspace-safe ports"
depends = ["build-dev-cli"]
dir = "cli"
env = {
CHATTO_WEBSERVER_PORT = "{{env.CONDUCTOR_PORT | default(value=env.PASEO_PORT | default(value='4000'))}}",
CHATTO_WEBSERVER_URL = "http://localhost:{{env.CONDUCTOR_PORT | default(value=env.PASEO_PORT | default(value='4000'))}}",
CHATTO_NATS_EMBEDDED_PORT = "{{env.CONDUCTOR_PORT | default(value=env.PASEO_PORT | default(value='4000')) | int + 1}}",
CHATTO_NATS_CLIENT_URL = "nats://localhost:{{env.CONDUCTOR_PORT | default(value=env.PASEO_PORT | default(value='4000')) | int + 1}}",
CHATTO_METRICS_ENABLED = "true",
CHATTO_METRICS_BIND_ADDRESS = "127.0.0.1",
CHATTO_METRICS_PORT = "{{env.CONDUCTOR_PORT | default(value=env.PASEO_PORT | default(value='4000')) | int + 2}}",
CHATTO_METRICS_PATH = "/metrics",
CHATTO_EXPORTER_ENABLED = "true",
CHATTO_EXPORTER_BIND_ADDRESS = "127.0.0.1",
CHATTO_EXPORTER_PORT = "{{env.CONDUCTOR_PORT | default(value=env.PASEO_PORT | default(value='4000')) | int + 3}}",
CHATTO_EXPORTER_PATH = "/metrics",
CHATTO_LIVEKIT_ENABLED = "true",
CHATTO_LIVEKIT_URL = "ws://localhost:{{env.CONDUCTOR_PORT | default(value=env.PASEO_PORT | default(value='4000')) | int + 5}}",
CHATTO_LIVEKIT_API_KEY = "devkey",
CHATTO_LIVEKIT_API_SECRET = "devsecret",
CHATTO_LIVEKIT_WEBHOOK_URL = "http://localhost:{{env.CONDUCTOR_PORT | default(value=env.PASEO_PORT | default(value='4000')) | int}}/webhooks/livekit",
CHATTO_SMTP_ENABLED = "true",
CHATTO_SMTP_HOST = "127.0.0.1",
CHATTO_SMTP_PORT = "{{env.CONDUCTOR_PORT | default(value=env.PASEO_PORT | default(value='4000')) | int + 8}}",
CHATTO_SMTP_TLS = "opportunistic",
CHATTO_SMTP_FROM = "chatto-dev@chatto.localhost",
}
run = "exec bin/chatto"
[tasks.dev-compiled]
description = "Build and run the bundled Chatto stack with LiveKit and Mailpit"
run = { tasks = ["chatto run", "dev-livekit", "dev-mailpit"] }
# =============================================================================
# Benchmarking
# =============================================================================
[tasks.bench-projections]
description = "Benchmark projection replay throughput and retained heap"
depends = ["setup-cli"]
dir = "cli"
run = [
"go test -trimpath ./internal/core -run '^$' -bench '^BenchmarkProjectionReplay$' -benchmem -count=${CHATTO_BENCH_COUNT:-5}",
"go test -trimpath ./internal/core -run '^$' -bench '^BenchmarkProjectionRetainedHeap$' -benchmem -benchtime=1x -count=${CHATTO_BENCH_COUNT:-5}",
]
[tasks.bench-projections-profile]
description = "Capture exact retained-heap profiles for projection replay"
depends = ["setup-cli"]
dir = "cli"
env = { CHATTO_BENCH_HEAP_PROFILE_DIR = "../.context/bench/projections" }
run = "go test -trimpath ./internal/core -run '^$' -bench '^BenchmarkProjectionRetainedHeap$' -benchmem -benchtime=1x -count=1"
# =============================================================================
# Testing
# =============================================================================
[tasks.test-cli]
description = "Run CLI tests"
depends = ["setup-cli", "build-frontend"]
dir = "cli"
run = [
"../tools/dev-supervisor_test.sh",
"go test -trimpath -p ${CHATTO_GO_TEST_P:-4} -tags test_endpoints ./...",
]
sources = ["**/*.go", "cmd/embedded/LICENSE", "cmd/embedded/NOTICE"]
[tasks.test-appconfig]
description = "Run application configuration tests standalone and in the repository workspace"
depends = ["setup-appconfig"]
dir = "pkg/appconfig"
run = [
"GOWORK=off go test -trimpath ./...",
"go test -trimpath ./...",
]
sources = ["go.mod", "go.sum", "**/*.go"]
[tasks.test-events]
description = "Run event framework tests standalone and in the repository workspace"
depends = ["setup-events"]
dir = "pkg/events"
run = [
"GOWORK=off go test -trimpath ./...",
"go test -trimpath ./...",
]
sources = ["go.mod", "go.sum", "**/*.go"]
[tasks.test-datacrypto]
description = "Run data cryptography tests standalone and in the repository workspace"
depends = ["setup-datacrypto"]
dir = "pkg/datacrypto"
run = [
"GOWORK=off go test -trimpath ./...",
"go test -trimpath ./...",
]
sources = ["go.mod", "go.sum", "**/*.go"]
[tasks.test-natsruntime]
description = "Run embedded NATS runtime tests standalone and in the repository workspace"
depends = ["setup-natsruntime"]
dir = "pkg/natsruntime"
run = [
"GOWORK=off go test -trimpath ./...",
"go test -trimpath ./...",
]
sources = ["go.mod", "go.sum", "**/*.go"]
[tasks.test-cli-shutdown]
description = "Run backend process shutdown integration tests"
depends = ["setup-cli"]
dir = "cli"
run = "go test -trimpath -tags integration ./cmd -run TestRunCommandShutsDownOnSignals -count=1 -timeout 2m"
sources = ["**/*.go", "cmd/embedded/LICENSE", "cmd/embedded/NOTICE"]
[tasks.knip]
description = "Find unused frontend/docs files, dependencies, and exports"
depends = ["setup-frontend", "build-api-types", "build-lingua"]
run = "pnpm knip"
[tasks.lint-frontend]
description = "Run TypeScript and ESLint checks on frontend"
depends = ["setup-frontend", "build-api-types", "build-lingua"]
dir = "apps/frontend"
run = ["pnpm check", "pnpm lint"]
[tasks.lint-lingua]
description = "Type-check the JSON internationalisation runtime package"
depends = ["setup-frontend"]
dir = "packages/lingua"
run = "pnpm check"
[tasks.lint]
description = "Run linters"
run = [{ task = "lint-*" }]
[tasks.test-frontend]
description = "Run frontend unit tests"
depends = ["setup-frontend", "build-api-types", "build-lingua"]
dir = "apps/frontend"
run = "pnpm test:unit:run"
[tasks.test-lingua]
description = "Test the JSON internationalisation runtime package"
depends = ["setup-frontend"]
dir = "packages/lingua"
run = "pnpm test"
[tasks.test-workspace]
description = "Run all pnpm workspace package tests"
depends = ["setup-frontend"]
run = "pnpm test"
[tasks.test-desktop]
description = "Check and test the experimental Chatto desktop app"
depends = ["setup-frontend"]
dir = "apps/desktop"
run = "pnpm check"
[tasks.test-e2e]
description = "Run E2E tests"
depends = ["setup-frontend", "build-e2e-server"]
dir = "apps/frontend"
run = "pnpm exec playwright test"
[tasks.test-e2e-performance]
description = "Run the large synthetic-server E2E performance suite"
depends = ["setup-frontend", "build-e2e-server"]
dir = "apps/frontend"
run = "pnpm exec playwright test --config playwright.performance.config.ts"
[tasks.compare-e2e-performance]
description = "Compare two large-server E2E performance result files"
depends = ["setup-frontend"]
dir = "apps/frontend"
run = "node scripts/compare-e2e-performance.mjs"
[tasks.test]
description = "Run all tests"
run = [
{ task = "test-appconfig" },
{ task = "test-datacrypto" },
{ task = "test-events" },
{ task = "test-natsruntime" },
{ task = "test-cli" },
{ task = "test-desktop" },
{ task = "test-workspace" },
{ task = "test-e2e" },
]
# =============================================================================
# Utility
# =============================================================================
[tasks.run]
description = "Compile and run the project"
depends = ["build"]
dir = "cli"
run = "bin/chatto run"
[tasks.clean]
description = "Clean all build artifacts"
run = [
"rm -rf cli/bin/*",
"rm -rf cli/cmd/embedded",
"rm -rf cli/internal/http_server/.client",
"rm -rf apps/frontend/build",
"rm -rf apps/desktop/dist",
"rm -rf packages/lingua/dist",
]
[tasks.reset-config]
description = "Delete and reinitialize chatto.toml"
confirm = "Are you sure you want to re-initialize chatto.toml? This will delete your current configuration."
depends = ["setup-cli"]
dir = "cli"
run = ["rm chatto.toml", "go run . init"]
[tasks.reset-data]
description = "Reset the development environment (NATS data etc.)"
confirm = "Are you sure you want to reset the development environment? This will delete all data."
dir = "cli"
run = ["rm -rf data"]
[tasks.docs]
description = "Start pkgsite documentation server for the CLI"
dir = "cli"
run = """
echo "Starting pkgsite documentation server..."
echo "Browse to: http://localhost:6060/hmans.de/chatto"
pkgsite -http=localhost:6060 .
"""
[tasks.verify-docker]
description = "Validate Docker, GoReleaser, and image workflow wiring"
run = """
set -euo pipefail
goreleaser check
actionlint .github/workflows/*.yml
docker/nats-wrapper_test.sh
docker buildx build --check --build-arg TARGETARCH=amd64 -f docker/Dockerfile.dev .
docker buildx build --check -f docker/Dockerfile.frontend.dev .
docker buildx build --check -f docker/Dockerfile.frontend.prebuilt .
docker buildx build --check -f apps/frontend/Dockerfile.storybook .
tmp="$(mktemp -d /tmp/chatto-docker-verify.XXXXXX)"
trap 'rm -rf "$tmp"' EXIT
context="$tmp/linux-amd64"
mkdir -p "$context/docker"
cp docker/Dockerfile.goreleaser "$context/Dockerfile"
cp docker/docker-entrypoint.sh "$context/docker/docker-entrypoint.sh"
cp docker/nats-wrapper.sh "$context/docker/nats-wrapper.sh"
mkdir -p "$context/LICENSES"
cp LICENSES/AGPL-3.0-or-later.txt "$context/LICENSES/AGPL-3.0-or-later.txt"
cp NOTICE "$context/NOTICE"
printf '#!/bin/sh\necho chatto dummy\n' > "$context/chatto"
chmod +x "$context/chatto"
docker buildx build --build-arg TARGETARCH=amd64 -f "$context/Dockerfile" "$context"
"""