Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Default: normalise line endings to LF in repo; checkout EOLs follow Git/platform settings
* text=auto

# Force LF for files that must not have CRLF (mise reads these directly
# on Windows and CRLF in task scripts causes bash shebang corruption)
*.toml text eol=lf
*.sh text eol=lf
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ node_modules/
playwright-report/
test-results/
.http-server.pid
flutter-dev.pid
playwright/.cache/

# Symbols
Expand Down
27 changes: 23 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ This document provides instructions for AI coding agents (Claude, Copilot, etc.)

**CRITICAL**: This project uses `mise` for task management. Always use mise commands, not raw `flutter` commands.

### Platform Note: Windows

**`./bin/mise` does not work on Windows** (including Git Bash / MINGW64). Use your system-installed `mise` instead:

```bash
# Windows: use system mise (e.g. installed via WinGet)
mise tasks ls
MISE_ENV=dev mise run dev

# macOS / Linux: use the project bootstrap script
./bin/mise tasks ls
MISE_ENV=dev ./bin/mise run dev
```

All commands below show `./bin/mise` — on Windows, replace with `mise`.

### First Thing to Do in Every Session

```bash
Expand All @@ -21,7 +37,6 @@ MISE_ENV=dev ./bin/mise tasks ls
| Task | Command | Notes |
|------|---------|-------|
| **Discover tasks** | `./bin/mise tasks ls` | Run this first! |
| Install dependencies | `./bin/mise run install` | Required after checkout |
| Generate code (mocks) | `./bin/mise run generate` | After model changes |
| Analyze code | `./bin/mise run analyze` | **Must pass before commit** |
| Run tests | `./bin/mise run test` | All unit/widget tests |
Expand Down Expand Up @@ -71,7 +86,7 @@ The CI pipeline (`.github/workflows/ci.yml`) runs these commands. Here's how to

| CI Command | Mise Equivalent | When to Use |
|------------|-----------------|-------------|
| `flutter pub get` | `./bin/mise run install` | After checkout, pubspec changes |
| `flutter pub get` | automatic (mise prepare) | Runs automatically on `pubspec.yaml` changes |
| `dart run build_runner build --delete-conflicting-outputs` | `./bin/mise run generate` | After model changes, before tests |
Comment on lines +89 to 90

Copilot AI Mar 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs now say flutter pub get runs automatically via mise prepare, but this file still lists the base tasks as including an install task. Since mise.toml removed [tasks.install], please update the “Available: …” list to remove install (or reintroduce the task) so the documentation matches the actual task set.

Copilot uses AI. Check for mistakes.
| `flutter analyze --no-fatal-infos` | `./bin/mise run analyze` | Before committing |
| `flutter test --coverage` | `./bin/mise run coverage` | Testing with coverage |
Expand All @@ -88,14 +103,18 @@ flutter pub get # Bypasses version management
flutter test # May use wrong Flutter version
flutter build web # Missing mise environment setup
mise run build:web # Missing MISE_ENV=dev (will fail)
./bin/mise run <anything> # ./bin/mise does not work on Windows
```

### ✅ Do This Instead
```bash
./bin/mise run install # Correct: uses ./bin/mise
# macOS/Linux
./bin/mise run test # Correct: proper environment
MISE_ENV=dev ./bin/mise run build:web # Correct: has MISE_ENV
./bin/mise tasks ls # Correct: discover first

# Windows (Git Bash / PowerShell)
mise run test
MISE_ENV=dev mise run build:web
Comment on lines +115 to +117

Copilot AI Mar 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section suggests Windows users can run tasks from PowerShell, but mise.toml configures Windows inline task scripts to run via bash -c. That will only work from PowerShell if bash is installed and on PATH (e.g. via Git for Windows). Please clarify the prerequisite (or adjust the guidance) to avoid “bash not found” failures.

Copilot uses AI. Check for mistakes.
```

## Testing Best Practices
Expand Down
10 changes: 6 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Quick reference (always check `./bin/mise tasks ls` for latest):
MISE_ENV=dev ./bin/mise tasks ls # Developer tasks

# Common tasks
./bin/mise run install # Install dependencies
./bin/mise run generate # Generate code (mocks)
./bin/mise run analyze # Code analysis (REQUIRED before commit)
./bin/mise run test # Run tests
Expand All @@ -50,9 +49,13 @@ MISE_ENV=dev ./bin/mise run build:web:prod # Production build

This project uses [Mise](https://mise.jdx.dev) for managing development tools and task running.

### Important: Use ./bin/mise
### Important: Use ./bin/mise (macOS/Linux) or mise (Windows)

**Always use `./bin/mise` (not plain `mise`)** when running mise commands in this repository.
**`./bin/mise` is a Unix-only bootstrap script — it does not work on Windows (Git Bash / MINGW64).**

- **macOS / Linux**: Use `./bin/mise` (ensures the project-local mise version is used)
- **Windows**: Use `mise` from your system PATH (e.g. installed via WinGet — `winget install jdx.mise`).
**Note**: The repo’s `mise.toml` sets `windows_default_inline_shell_args = "bash -c"`, so `mise run ...` on Windows requires `bash` to be available on `PATH` (for example via Git for Windows / Git Bash, WSL, or another Bash installation).

### Environment-Specific Tools

Expand Down Expand Up @@ -147,7 +150,6 @@ git clone https://github.com/mise-plugins/mise-flutter.git .mise/plugins/flutter
MISE_ENV=dev ./bin/mise tasks ls # List all tasks (includes dev)

# Essential tasks
./bin/mise run install # Install dependencies
./bin/mise run generate # Generate code (mocks)
./bin/mise run analyze # Code analysis
./bin/mise run test # All tests
Expand Down
5 changes: 1 addition & 4 deletions mise.dev.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ gh = "latest"

[tasks.dev]
description = "Start Flutter dev server on localhost:8080"
run = '''
echo "Starting Flutter dev server on http://localhost:8080"
flutter run -d web-server --web-port 8080 --pid-file flutter-dev.pid
'''
run = 'flutter run -d web-server --web-port 8080'

# Complex tasks moved to mise-tasks/ for better maintainability:
# - setup:tunnel -> mise-tasks/setup/tunnel
Expand Down
10 changes: 8 additions & 2 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@
# Docs: https://mise.jdx.dev/tasks/task-arguments.html
# https://mise.jdx.dev/tasks/file-tasks.html

[settings]
# Use bash for inline task scripts on Windows (default is cmd /c which only runs one line)
windows_default_inline_shell_args = "bash -c"
Comment on lines +13 to +14

Copilot AI Mar 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

windows_default_inline_shell_args = "bash -c" makes all inline task scripts on Windows depend on bash being available on PATH. If someone runs mise from PowerShell/cmd without Git Bash/WSL installed, tasks will fail immediately. Consider either documenting the bash prerequisite for Windows contributors or switching the Windows inline shell to something guaranteed (e.g. PowerShell).

Suggested change
# Use bash for inline task scripts on Windows (default is cmd /c which only runs one line)
windows_default_inline_shell_args = "bash -c"
# Use PowerShell for inline task scripts on Windows (default is cmd /c which only runs one line)
windows_default_inline_shell_args = "powershell -NoProfile -Command"

Copilot uses AI. Check for mistakes.

[tools]
flutter = "3.38.3"
node = "21" # For http_server and Playwright e2e tests

[tasks.install]
description = "Install Flutter dependencies (flutter pub get)"
[prepare.flutter-deps]
auto = true
run = 'flutter pub get'
sources = ['pubspec.yaml']
outputs = ['pubspec.lock', '.dart_tool/package_config.json']

[tasks.generate]
description = "Generate code (mocks, build_runner)"
Expand Down
Loading