allframe 0.1.10

The Composable Rust API Framework - TDD-first, compile-time DI, CQRS, protocol-agnostic
Documentation
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
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
# AllFrame - cargo-make task configuration
# Install: cargo install cargo-make
# Usage: cargo make <task>

[config]
default_to_workspace = false
min_version = "0.36.0"
# Always run from workspace root
main_project_member = "."

[env]
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
CARGO_MAKE_WORKSPACE_MAKEFILE = true
RUST_BACKTRACE = 0

# Default task - show help
[tasks.default]
alias = "help"

# Help - List all available tasks
[tasks.help]
description = "Show available tasks"
script = '''
echo "AllFrame Development Tasks"
echo ""
echo "Quality Gates:"
echo "  cargo make lint          - Check formatting and run clippy (CI mode)"
echo "  cargo make lint-check    - Check code formatting without modifying files"
echo "  cargo make lint-sort     - Check if Cargo.toml dependencies are sorted"
echo "  cargo make format        - Format all Rust code"
echo "  cargo make format-sort   - Sort Cargo.toml dependencies"
echo ""
echo "Testing:"
echo "  cargo make test          - Run all tests with main features"
echo "  cargo make test-all      - Run all tests with all features"
echo "  cargo make test-minimal  - Run tests with no features"
echo ""
echo "Building:"
echo "  cargo make build         - Build in debug mode"
echo "  cargo make build-release - Build in release mode"
echo "  cargo make clean         - Clean build artifacts"
echo ""
echo "Tools:"
echo "  cargo make install-tools - Install required development tools"
echo ""
echo "CI/CD:"
echo "  cargo make ci            - Run all CI checks (lint + test + build)"
echo ""
echo "Publishing:"
echo "  cargo make version-check      - Check which crates need publishing"
echo "  cargo make version-sync-check - Verify internal crate versions are in sync"
echo "  cargo make version-bump       - Bump version (patch by default)"
echo "  cargo make changelog-sync     - Sync CHANGELOG.md to GitHub Pages"
echo "  cargo make publish-dry-run    - Verify all crates are ready to publish"
echo "  cargo make publish-all        - Publish all crates (parallel, skips published)"
'''

# Quality Gates

[tasks.lint-check]
description = "Check code formatting without modifying files"
cwd = "crates/allframe-core"
command = "cargo"
args = ["fmt", "--check"]

[tasks.lint-clippy]
description = "Run clippy with warnings as errors"
cwd = "crates/allframe-core"
command = "cargo"
args = ["clippy", "--features", "di,openapi,router,cqrs,otel", "--", "-D", "warnings"]

[tasks.lint]
description = "Run both format check and clippy (CI mode)"
dependencies = ["lint-check", "lint-clippy"]

[tasks.lint-sort]
description = "Check if Cargo.toml dependencies are sorted"
cwd = "crates/allframe-core"
command = "cargo"
args = ["sort", "--check"]

[tasks.format]
description = "Format all Rust code"
cwd = "crates/allframe-core"
command = "cargo"
args = ["fmt"]

[tasks.format-sort]
description = "Sort Cargo.toml dependencies"
cwd = "crates/allframe-core"
command = "cargo"
args = ["sort", "-w"]

# Testing

[tasks.test]
description = "Run tests with main features"
cwd = "crates/allframe-core"
command = "cargo"
args = ["test", "--features", "di,openapi,router,cqrs"]

[tasks.test-all]
description = "Run tests with all features (excluding allsource)"
cwd = "crates/allframe-core"
command = "cargo"
args = ["test", "--features", "di,openapi,router,cqrs,otel"]

[tasks.test-minimal]
description = "Run tests with no features"
cwd = "crates/allframe-core"
command = "cargo"
args = ["test", "--no-default-features"]

# Building

[tasks.build]
description = "Build in debug mode"
cwd = "crates/allframe-core"
command = "cargo"
args = ["build"]

[tasks.build-release]
description = "Build in release mode"
cwd = "crates/allframe-core"
command = "cargo"
args = ["build", "--release"]

[tasks.clean]
description = "Clean build artifacts"
cwd = "crates/allframe-core"
command = "cargo"
args = ["clean"]

# Tools

[tasks.install-tools]
description = "Install required development tools"
script = '''
echo "Installing development tools..."
cargo install cargo-sort --quiet || true
cargo install cargo-bloat --quiet || true
cargo install cargo-make --quiet || true
echo "✅ Tools installed!"
'''

# CI/CD

[tasks.ci]
description = "Run all CI checks"
dependencies = ["lint", "lint-sort", "version-sync-check", "test", "build"]
script = '''
echo ""
echo "✅ All CI checks passed!"
'''

# Size monitoring

[tasks.size-minimal]
description = "Measure minimal binary size"
cwd = "crates/allframe-core"
command = "cargo"
args = ["bloat", "--release", "--example", "minimal", "--no-default-features", "--crates"]

[tasks.size-default]
description = "Measure default features binary size"
cwd = "crates/allframe-core"
command = "cargo"
args = ["bloat", "--release", "--example", "default_features", "--features", "di,openapi,router", "--crates"]

[tasks.size-all]
description = "Measure all features binary size"
cwd = "crates/allframe-core"
command = "cargo"
args = ["bloat", "--release", "--example", "all_features", "--features", "di,openapi,router,cqrs,otel", "--crates"]

[tasks.size]
description = "Measure binary sizes for all configurations"
dependencies = ["size-minimal", "size-default", "size-all"]

# Binary size monitoring tasks

[tasks.check-size]
description = "Check binary sizes against limits"
script = '''\n#!/usr/bin/env bash
./scripts/check_size.sh
'''

[tasks.analyze-size]
description = "Analyze binary sizes in detail"
script = '''\n#!/usr/bin/env bash
./scripts/analyze_size.sh full
'''

[tasks.analyze-size-minimal]
description = "Analyze minimal binary size"
script = '''\n#!/usr/bin/env bash
./scripts/analyze_size.sh minimal
'''

[tasks.analyze-size-default]
description = "Analyze default binary size"
script = '''\n#!/usr/bin/env bash
./scripts/analyze_size.sh default
'''

[tasks.analyze-size-main]
description = "Analyze main features binary size"
script = '''\n#!/usr/bin/env bash
./scripts/analyze_size.sh all
'''

# Publishing to crates.io
# Dependency graph:
#   allframe-macros (no deps)     ─┬─► allframe-core ─► allframe-mcp
#   allframe-forge (no deps)      ─┘

[tasks.version-sync-check]
description = "Check that all internal crate versions are in sync"
workspace = false
script_runner = "@shell"
script = '''
#!/usr/bin/env bash
set -e

# Navigate to workspace root
cd "$(git rev-parse --show-toplevel)"

# Get workspace.package version
WORKSPACE_VERSION=$(sed -n '/\[workspace\.package\]/,/\[/p' Cargo.toml | grep '^version' | cut -d'"' -f2)
echo "Workspace version: ${WORKSPACE_VERSION}"
echo ""

ERRORS=0

# Check root [package] version (allframe crate)
ROOT_VERSION=$(awk '/^\[package\]/{found=1} found && /^version/{print; exit}' Cargo.toml | cut -d'"' -f2)
echo "Checking root allframe crate:"
if [ "$ROOT_VERSION" != "$WORKSPACE_VERSION" ]; then
    echo "  ❌ allframe [package] version = ${ROOT_VERSION}, expected ${WORKSPACE_VERSION}"
    ERRORS=$((ERRORS + 1))
else
    echo "  ✅ allframe [package] version = ${ROOT_VERSION}"
fi

# Check workspace.dependencies versions
check_workspace_dep() {
    local crate=$1
    local version=$(grep "^${crate} = " Cargo.toml | grep -o 'version = "[^"]*"' | cut -d'"' -f2)
    if [ "$version" != "$WORKSPACE_VERSION" ]; then
        echo "  ❌ ${crate} = ${version}, expected ${WORKSPACE_VERSION}"
        ERRORS=$((ERRORS + 1))
    else
        echo "  ✅ ${crate} = ${version}"
    fi
}

echo ""
echo "Checking workspace.dependencies:"
check_workspace_dep "allframe-core"
check_workspace_dep "allframe-macros"
check_workspace_dep "allframe-forge"

echo ""
if [ $ERRORS -gt 0 ]; then
    echo "❌ Version sync check failed! Run 'cargo make version-bump' to fix."
    exit 1
else
    echo "✅ All versions in sync!"
fi
'''

[tasks.version-bump]
description = "Bump workspace version (patch, minor, or major)"
workspace = false
script_runner = "@shell"
script = '''
#!/usr/bin/env bash
set -e

# Navigate to workspace root
cd "$(git rev-parse --show-toplevel)"

BUMP_TYPE=${1:-patch}
CARGO_TOML="Cargo.toml"

# Get current workspace.package version
CURRENT=$(sed -n '/\[workspace\.package\]/,/\[/p' "$CARGO_TOML" | grep '^version' | cut -d'"' -f2)
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT"

case "$BUMP_TYPE" in
    major)
        MAJOR=$((MAJOR + 1))
        MINOR=0
        PATCH=0
        ;;
    minor)
        MINOR=$((MINOR + 1))
        PATCH=0
        ;;
    patch)
        PATCH=$((PATCH + 1))
        ;;
    *)
        echo "Usage: cargo make version-bump [patch|minor|major]"
        exit 1
        ;;
esac

NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"
TODAY=$(date +%Y-%m-%d)
echo "Bumping version: ${CURRENT} → ${NEW_VERSION}"
echo ""

# =============================================================================
# 1. Update Cargo.toml versions
# =============================================================================
echo "📦 Updating Cargo.toml..."

# Update workspace.package version (in [workspace.package] section only)
sed -i '' "/\[workspace\.package\]/,/\[.*\]/{s/^version = \"${CURRENT}\"/version = \"${NEW_VERSION}\"/;}" "$CARGO_TOML"

# Update root allframe crate version (in [package] section, before workspace.package)
sed -i '' "/^\[package\]/,/^\[/{s/^version = \"[0-9]*\.[0-9]*\.[0-9]*\"/version = \"${NEW_VERSION}\"/;}" "$CARGO_TOML"

# Update workspace.dependencies for internal crates
sed -i '' "s/allframe-core = { version = \"${CURRENT}\"/allframe-core = { version = \"${NEW_VERSION}\"/" "$CARGO_TOML"
sed -i '' "s/allframe-macros = { version = \"${CURRENT}\"/allframe-macros = { version = \"${NEW_VERSION}\"/" "$CARGO_TOML"
sed -i '' "s/allframe-forge = { version = \"${CURRENT}\"/allframe-forge = { version = \"${NEW_VERSION}\"/" "$CARGO_TOML"

echo "  ✅ workspace.package.version = ${NEW_VERSION}"
echo "  ✅ [package] version = ${NEW_VERSION} (root allframe crate)"
echo "  ✅ workspace.dependencies updated"

# =============================================================================
# 2. Update documentation
# =============================================================================
echo ""
echo "📚 Updating documentation..."

# Update PROJECT_STATUS.md
if [ -f "docs/PROJECT_STATUS.md" ]; then
    sed -i '' "s/\*\*Version\*\*: [0-9]*\.[0-9]*\.[0-9]*/\*\*Version\*\*: ${NEW_VERSION}/" "docs/PROJECT_STATUS.md"
    sed -i '' "s/\*\*Last Updated\*\*: [0-9-]*/\*\*Last Updated\*\*: ${TODAY}/" "docs/PROJECT_STATUS.md"
    echo "  ✅ docs/PROJECT_STATUS.md"
fi

# Update docs/README.md
if [ -f "docs/README.md" ]; then
    sed -i '' "s/\*\*Last Updated\*\*: [0-9-]*/\*\*Last Updated\*\*: ${TODAY}/" "docs/README.md"
    echo "  ✅ docs/README.md"
fi

# Update docs/INDEX.md
if [ -f "docs/INDEX.md" ]; then
    sed -i '' "s/\*\*Last Updated\*\*: [0-9-]*/\*\*Last Updated\*\*: ${TODAY}/" "docs/INDEX.md"
    echo "  ✅ docs/INDEX.md"
fi

# Update README.md version references (dependency examples)
if [ -f "README.md" ]; then
    # Update allframe = "X.Y.Z" patterns
    sed -i '' "s/allframe = \"${CURRENT}\"/allframe = \"${NEW_VERSION}\"/g" "README.md"
    # Update allframe = { version = "X.Y.Z" patterns
    sed -i '' "s/allframe = { version = \"${CURRENT}\"/allframe = { version = \"${NEW_VERSION}\"/g" "README.md"
    # Update allframe-mcp = "X.Y.Z" patterns
    sed -i '' "s/allframe-mcp = \"${CURRENT}\"/allframe-mcp = \"${NEW_VERSION}\"/g" "README.md"
    # Update current status line
    sed -i '' "s/v${CURRENT}/v${NEW_VERSION}/g" "README.md"
    echo "  ✅ README.md"
fi

# Update GitHub Pages site (docs/site/index.html)
if [ -f "docs/site/index.html" ]; then
    # Update version badges (e.g., <span class="badge green">v0.1.10</span>)
    sed -i '' "s/>v${CURRENT}</>v${NEW_VERSION}</g" "docs/site/index.html"
    # Update stats section version (e.g., <h3>v0.1.10</h3>)
    sed -i '' "s/<h3>v${CURRENT}</<h3>v${NEW_VERSION}</g" "docs/site/index.html"
    echo "  ✅ docs/site/index.html (GitHub Pages)"
fi

# =============================================================================
# 3. Summary
# =============================================================================
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "✅ Version bumped: ${CURRENT} → ${NEW_VERSION}"
echo ""
echo "Files updated:"
echo "  📦 Cargo.toml (workspace + allframe crate)"
echo "  📚 docs/PROJECT_STATUS.md"
echo "  📚 docs/README.md"
echo "  📚 docs/INDEX.md"
echo "  📚 README.md"
echo "  🌐 docs/site/index.html (GitHub Pages)"
echo ""
echo "Next steps:"
echo "  1. Update CHANGELOG.md with release notes for v${NEW_VERSION}"
echo "  2. Run: cargo make changelog-sync (regenerates docs/site/changelog.html)"
echo "  3. Run: cargo make ci"
echo "  4. Commit: git commit -am \"release: v${NEW_VERSION}\""
echo "  5. Tag: git tag v${NEW_VERSION}"
echo "  6. Push: git push && git push --tags (auto-deploys GitHub Pages)"
echo "  7. Publish: cargo make publish-all"
'''

[tasks.changelog-sync]
description = "Sync changelog from CHANGELOG.md to GitHub Pages site"
workspace = false
script_runner = "@shell"
script = '''
#!/usr/bin/env bash
set -e

# Navigate to workspace root
cd "$(git rev-parse --show-toplevel)"

echo "📝 Syncing changelog to GitHub Pages..."

# Generate the changelog HTML using the Python script
python3 scripts/generate_changelog_html.py CHANGELOG.md > docs/site/changelog.html

echo "  ✅ docs/site/changelog.html updated from CHANGELOG.md"
echo ""
echo "Done! The changelog page has been regenerated from CHANGELOG.md"
'''

[tasks.version-check]
description = "Check which crates need publishing"
workspace = false
script_runner = "@shell"
script = '''
#!/usr/bin/env bash

# Navigate to workspace root
cd "$(git rev-parse --show-toplevel)"

# Get workspace.package version (after [workspace.package] section)
LOCAL_VERSION=$(sed -n '/\[workspace\.package\]/,/\[/p' Cargo.toml | grep '^version' | cut -d'"' -f2)
echo "Workspace version: ${LOCAL_VERSION}"
echo ""

check_crate() {
    local crate=$1
    local published=$(curl -s "https://crates.io/api/v1/crates/${crate}" | grep -o "\"${LOCAL_VERSION}\"" | head -1)
    if [ -n "$published" ]; then
        echo "  ✅ ${crate}@${LOCAL_VERSION} - already published"
    else
        echo "  📦 ${crate}@${LOCAL_VERSION} - needs publishing"
    fi
}

echo "Crate status:"
check_crate "allframe"
check_crate "allframe-macros"
check_crate "allframe-core"
check_crate "allframe-mcp"
check_crate "allframe-forge"
'''

[tasks.publish-macros]
description = "Publish allframe-macros to crates.io"
cwd = "crates/allframe-macros"
command = "cargo"
args = ["publish"]

[tasks.publish-core]
description = "Publish allframe-core to crates.io"
cwd = "crates/allframe-core"
command = "cargo"
args = ["publish"]

[tasks.publish-mcp]
description = "Publish allframe-mcp to crates.io"
cwd = "crates/allframe-mcp"
command = "cargo"
args = ["publish"]

[tasks.publish-forge]
description = "Publish allframe-forge to crates.io"
cwd = "crates/allframe-forge"
command = "cargo"
args = ["publish"]

[tasks.publish-wait]
description = "Wait for crates.io indexing"
script = '''
echo "⏳ Waiting 30s for crates.io indexing..."
sleep 30
echo "✅ Done waiting"
'''

[tasks.publish-all]
description = "Publish all crates to crates.io in dependency order (parallel where possible)"
workspace = false
script_runner = "@shell"
script = '''
#!/usr/bin/env bash
set -e

# Navigate to workspace root
cd "$(git rev-parse --show-toplevel)"

# Get workspace.package version
LOCAL_VERSION=$(sed -n '/\[workspace\.package\]/,/\[/p' Cargo.toml | grep '^version' | cut -d'"' -f2)
echo "🚀 Publishing AllFrame crates v${LOCAL_VERSION} to crates.io"
echo ""

# Track if anything was actually published (to decide if we need to wait)
PUBLISHED_SOMETHING=false

# Function to check if version is already published
is_published() {
    local crate=$1
    local version=$2
    # Check crates.io API
    local published=$(curl -s "https://crates.io/api/v1/crates/${crate}" | grep -o "\"${version}\"" | head -1)
    [ -n "$published" ]
}

# Function to publish a crate if not already published
# Returns 0 if skipped, 1 if published
publish_crate() {
    local crate=$1
    local path=$2

    if is_published "$crate" "$LOCAL_VERSION"; then
        echo "  ⏭️  ${crate} - already published"
        return 0
    fi

    echo "  📦 Publishing ${crate}..."
    cd "$path" && cargo publish --allow-dirty && cd - > /dev/null
    echo "  ✅ ${crate} published"
    return 1  # Signal that we published something
}

# Wave 1: No internal dependencies (parallel)
echo "━━━ Wave 1: Independent crates ━━━"
WAVE1_PUBLISHED=false

if ! is_published "allframe-macros" "$LOCAL_VERSION"; then
    echo "  📦 Publishing allframe-macros..."
    cd crates/allframe-macros && cargo publish --allow-dirty && cd - > /dev/null
    echo "  ✅ allframe-macros published"
    WAVE1_PUBLISHED=true
else
    echo "  ⏭️  allframe-macros - already published"
fi &
PID_MACROS=$!

if ! is_published "allframe-forge" "$LOCAL_VERSION"; then
    echo "  📦 Publishing allframe-forge..."
    cd crates/allframe-forge && cargo publish --allow-dirty && cd - > /dev/null
    echo "  ✅ allframe-forge published"
    WAVE1_PUBLISHED=true
else
    echo "  ⏭️  allframe-forge - already published"
fi &
PID_FORGE=$!

# Wait for wave 1
wait $PID_MACROS || true
wait $PID_FORGE || true

# Only wait for indexing if we published something in wave 1
if ! is_published "allframe-macros" "$LOCAL_VERSION" || ! is_published "allframe-forge" "$LOCAL_VERSION"; then
    # Re-check - if either still not published, we need to wait
    :
fi

# Check if wave 1 published anything (need fresh check after parallel)
NEED_WAIT=false
if ! is_published "allframe-macros" "$LOCAL_VERSION" 2>/dev/null; then
    NEED_WAIT=true
fi

# Wave 2: Depends on macros
echo ""
echo "━━━ Wave 2: allframe-core ━━━"
if ! is_published "allframe-core" "$LOCAL_VERSION"; then
    # Need to wait for macros to be indexed first
    echo "  ⏳ Waiting 15s for crates.io indexing..."
    sleep 15
    echo "  📦 Publishing allframe-core..."
    cd crates/allframe-core && cargo publish --allow-dirty && cd - > /dev/null
    echo "  ✅ allframe-core published"
    PUBLISHED_SOMETHING=true
else
    echo "  ⏭️  allframe-core - already published"
fi

# Wave 3: Depends on core
echo ""
echo "━━━ Wave 3: allframe-mcp ━━━"
if ! is_published "allframe-mcp" "$LOCAL_VERSION"; then
    if [ "$PUBLISHED_SOMETHING" = true ]; then
        echo "  ⏳ Waiting 15s for crates.io indexing..."
        sleep 15
    fi
    echo "  📦 Publishing allframe-mcp..."
    cd crates/allframe-mcp && cargo publish --allow-dirty && cd - > /dev/null
    echo "  ✅ allframe-mcp published"
    PUBLISHED_SOMETHING=true
else
    echo "  ⏭️  allframe-mcp - already published"
fi

# Wave 4: Root allframe crate (depends on forge)
echo ""
echo "━━━ Wave 4: allframe (root crate) ━━━"
if ! is_published "allframe" "$LOCAL_VERSION"; then
    if [ "$PUBLISHED_SOMETHING" = true ]; then
        echo "  ⏳ Waiting 15s for crates.io indexing..."
        sleep 15
    fi
    echo "  📦 Publishing allframe..."
    cargo publish --allow-dirty
    echo "  ✅ allframe published"
else
    echo "  ⏭️  allframe - already published"
fi

echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "✅ All crates at v${LOCAL_VERSION}"
echo ""
echo "  allframe         @ ${LOCAL_VERSION}  (root - what users import)"
echo "  allframe-macros  @ ${LOCAL_VERSION}"
echo "  allframe-core    @ ${LOCAL_VERSION}"
echo "  allframe-mcp     @ ${LOCAL_VERSION}"
echo "  allframe-forge   @ ${LOCAL_VERSION}"
echo ""
echo "View at: https://crates.io/crates/allframe"
'''

[tasks.publish-dry-run]
description = "Dry-run publish all crates (no actual publish)"
script = '''
#!/usr/bin/env bash
set -e

echo "🔍 Dry-run publish for AllFrame crates"
echo ""

echo "📦 [1/5] Checking allframe-macros..."
cd crates/allframe-macros && cargo publish --dry-run && cd ../..

echo "📦 [2/5] Checking allframe-forge..."
cd crates/allframe-forge && cargo publish --dry-run && cd ../..

echo "📦 [3/5] Checking allframe-core..."
cd crates/allframe-core && cargo publish --dry-run && cd ../..

echo "📦 [4/5] Checking allframe-mcp..."
cd crates/allframe-mcp && cargo publish --dry-run && cd ../..

echo "📦 [5/5] Checking allframe (root)..."
cargo publish --dry-run

echo ""
echo "✅ All crates ready for publishing!"
'''