allframe 0.1.28

Complete Rust web framework with built-in HTTP/2 server, REST/GraphQL/gRPC, compile-time DI, CQRS - TDD from day zero
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
# Publishing to crates.io - Complete Guide

**Date**: 2025-12-04
**Status**: ✅ Ready for v0.1.0 release
**Crates**: allframe-macros, allframe-core, allframe-forge, allframe-mcp

---

## Quick Start

```bash
# 1. Ensure logged in
cargo login <your-api-token>

# 2. Publish in order (wait 120s between each)
cd crates/allframe-macros && cargo publish && sleep 120
cd ../allframe-core && cargo publish && sleep 120
cd ../allframe-forge && cargo publish && sleep 120

# 3. Update allframe-mcp Cargo.toml: change path to version "0.1.0"
cd ../allframe-mcp && cargo publish

# 4. Tag release
cd ../.. && git tag -a v0.1.0 -m "Release v0.1.0" && git push origin v0.1.0
```

---

## Table of Contents

1. [Prerequisites]#prerequisites
2. [Pre-Publication Checklist]#pre-publication-checklist
3. [Publishing Order]#publishing-order
4. [Step-by-Step Instructions]#step-by-step-instructions
5. [Post-Publication]#post-publication
6. [Troubleshooting]#troubleshooting
7. [Automated Publishing (CI/CD)]#automated-publishing-cicd

---

## Prerequisites

### 1. crates.io Account

Create a free account at https://crates.io:

1. Visit https://crates.io
2. Click "Log in with GitHub"
3. Authorize crates.io to access your GitHub account
4. Verify your email address

### 2. API Token

Get your personal API token:

1. Log in to https://crates.io
2. Visit https://crates.io/me
3. Click "New Token"
4. Name: `allframe-publishing`
5. Click "Generate Token"
6. **IMPORTANT**: Copy the token immediately (you won't see it again!)

### 3. Configure cargo

```bash
# Store your API token
cargo login <your-api-token>

# This saves the token to ~/.cargo/credentials.toml
```

**Security Note**: Keep your API token secret! Never commit it to git.

---

## Pre-Publication Checklist

### Workspace-Level (Cargo.toml)

- [x] `rust-version = "1.86"` - MSRV specified
- [x] `authors` - Correct authors listed
- [x] `license = "MIT OR Apache-2.0"` - Dual license
- [x] `repository` - GitHub URL correct
- [x] `homepage` - Project homepage correct
- [x] All workspace dependencies use exact versions (e.g., `"1.48"` not `"1"`)

### allframe-core (crates/allframe-core/Cargo.toml)

```toml
[package]
name = "allframe-core"
version = "0.1.0"  # Semantic versioning
description = "Protocol-agnostic Rust web framework with TDD, CQRS, and zero-bloat design"
keywords = ["web", "framework", "api", "graphql", "grpc"]  # Max 5 keywords
categories = ["web-programming", "api-bindings", "asynchronous"]  # Max 5 categories
readme = "README.md"  # Package-level README
```

**Checklist**:
- [ ] `version = "0.1.0"` - Correct version number
- [ ] `description` - Clear, concise (< 100 chars)
- [ ] `keywords` - Relevant keywords (max 5)
- [ ] `categories` - Correct categories (see https://crates.io/categories)
- [ ] `readme = "README.md"` - Package README exists
- [ ] All dependencies are published or workspace-local
- [ ] No `path` dependencies to external crates
- [ ] Documentation compiles: `cargo doc --no-deps`
- [ ] All tests pass: `cargo test -p allframe-core --lib`
- [ ] Examples work: `cargo run --example rest_api`

### allframe-mcp (crates/allframe-mcp/Cargo.toml)

```toml
[package]
name = "allframe-mcp"
version = "0.1.0"
description = "MCP (Model Context Protocol) server for AllFrame - Expose APIs as LLM-callable tools"
keywords = ["mcp", "llm", "ai", "tools", "claude"]
categories = ["development-tools", "api-bindings"]
readme = "README.md"
```

**Checklist**:
- [x] `version = "0.1.0"` - Matches allframe-core
- [x] `description` - Clear MCP focus
- [x] `keywords` - MCP-relevant keywords
- [x] `categories` - Correct categories
- [x] `readme = "README.md"` - Package README exists
- [x] `allframe-core` dependency - Use crates.io version after publishing allframe-core
- [x] All tests pass: `cargo test -p allframe-mcp --lib`
- [x] Examples work: `cargo run --example mcp_stdio_server`

### Documentation

- [x] Root README.md - Up-to-date installation instructions
- [x] crates/allframe-core/README.md - Exists (if different from root)
- [x] crates/allframe-mcp/README.md - Complete usage guide
- [x] CHANGELOG.md - Version 0.1.0 documented (create if missing)
- [x] LICENSE-MIT - Exists
- [x] LICENSE-APACHE - Exists

### Code Quality

```bash
# Clean build
cargo clean

# Format
cargo fmt --all

# Lint
cargo clippy --all -- -D warnings

# Test all features
cargo test -p allframe-core --lib --features="di,openapi,router,router-graphql,router-grpc,router-full,cqrs,otel"
cargo test -p allframe-mcp --lib

# Build release
cargo build -p allframe-core --release
cargo build -p allframe-mcp --release

# Check documentation
cargo doc --no-deps -p allframe-core
cargo doc --no-deps -p allframe-mcp
```

All should pass without warnings!

---

## Publishing Order

**IMPORTANT**: Publish in dependency order!

```
1. allframe-core (no dependencies on allframe crates)
2. allframe-mcp (depends on allframe-core)
```

---

## Step-by-Step Instructions

### Step 1: Prepare Release

```bash
# Ensure you're on main branch
git checkout main
git pull origin main

# Ensure working directory is clean
git status  # Should show no uncommitted changes

# Tag the release
git tag -a v0.1.0 -m "Release v0.1.0: Initial crates.io publication"
```

### Step 2: Dry Run (Recommended!)

```bash
# Test publish without actually publishing
cd crates/allframe-core
cargo publish --dry-run

# Review output carefully
# Check:
# - Package size (should be reasonable, < 10 MB)
# - Files included (README, LICENSE, src/*, etc.)
# - Files excluded (target/, .git/, etc.)

# Test allframe-mcp (will fail because allframe-core not published yet)
cd ../allframe-mcp
cargo publish --dry-run --allow-dirty
```

### Step 3: Publish allframe-core

```bash
cd crates/allframe-core

# Final check
cargo test --lib --features="di,openapi,router,router-graphql,router-grpc,router-full,cqrs,otel"

# Publish!
cargo publish

# Wait for success message
# "Uploading allframe-core v0.1.0"
# "   Uploaded allframe-core v0.1.0 to registry"
```

**Wait 1-2 minutes for crates.io to index the package!**

Verify at: https://crates.io/crates/allframe-core

### Step 4: Update allframe-mcp Dependency

After allframe-core is published, update `allframe-mcp/Cargo.toml`:

```toml
[dependencies]
allframe-core = "0.1.0"  # Change from { path = "../allframe-core" }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
tokio = { workspace = true }
```

Test that it works:

```bash
cd crates/allframe-mcp

# Remove Cargo.lock if it exists
rm -f Cargo.lock

# Build with published allframe-core
cargo build

# Test
cargo test --lib
```

### Step 5: Publish allframe-mcp

```bash
cd crates/allframe-mcp

# Final check
cargo test --lib

# Publish!
cargo publish

# Wait for success message
```

Verify at: https://crates.io/crates/allframe-mcp

### Step 6: Push Tags

```bash
# Go back to root
cd ../..

# Push the version tag
git push origin v0.1.0

# Or push all tags
git push --tags
```

---

## Post-Publication

### 1. Verify Published Packages

**allframe-core**:
- Visit https://crates.io/crates/allframe-core
- Check version shows "0.1.0"
- Click "Documentation" → should redirect to docs.rs
- Wait 5-10 minutes for docs.rs to build documentation

**allframe-mcp**:
- Visit https://crates.io/crates/allframe-mcp
- Check version shows "0.1.0"
- Click "Documentation" → should redirect to docs.rs

### 2. Test Installation

Create a new test project:

```bash
mkdir /tmp/test-allframe
cd /tmp/test-allframe

cargo new --bin test-app
cd test-app

# Add to Cargo.toml:
# [dependencies]
# allframe-core = "0.1"
# allframe-mcp = "0.1"
# tokio = { version = "1.48", features = ["full"] }

cargo build
```

Should download and build successfully!

### 3. Update Documentation

**Root README.md**:
```markdown
## Installation

```toml
[dependencies]
allframe-core = "0.1"
allframe-mcp = "0.1"  # Optional: MCP server support
```
```

**Update badges** (if needed):
```markdown
[![Crates.io](https://img.shields.io/crates/v/allframe-core.svg)](https://crates.io/crates/allframe-core)
[![Documentation](https://docs.rs/allframe-core/badge.svg)](https://docs.rs/allframe-core)
[![Downloads](https://img.shields.io/crates/d/allframe-core.svg)](https://crates.io/crates/allframe-core)
```

### 4. Announcement

Create announcement in `docs/announcements/CRATES_IO_PUBLICATION.md`:

```markdown
# AllFrame v0.1.0 Published to crates.io!

**Date**: 2025-12-04

We're excited to announce that AllFrame v0.1.0 is now available on crates.io!

## Packages Published

- **allframe-core** - Protocol-agnostic web framework
  - https://crates.io/crates/allframe-core
  - https://docs.rs/allframe-core

- **allframe-mcp** - MCP server for LLM integration
  - https://crates.io/crates/allframe-mcp
  - https://docs.rs/allframe-mcp

## Installation

```toml
[dependencies]
allframe-core = "0.1"
allframe-mcp = "0.1"
```

## What's Included

- ✅ Protocol-agnostic routing (REST, GraphQL, gRPC)
- ✅ CQRS + Event Sourcing infrastructure
- ✅ OpenAPI, GraphQL, gRPC documentation
- ✅ Native MCP server (separate crate, zero bloat!)
- ✅ 291+ tests passing

## Get Started

Visit https://docs.rs/allframe-core for complete documentation!
```

### 5. Social Media

Post announcement to:
- Twitter/X
- LinkedIn
- Reddit r/rust
- Hacker News (Show HN)
- Dev.to

---

## Troubleshooting

### Error: "the package 'allframe-core' cannot be published"

**Cause**: Package name already taken or reserved.

**Solution**:
- Choose a different name (e.g., `allframe-web`)
- Or request name transfer if you own the project

### Error: "failed to select a version for 'allframe-core'"

**Cause**: Circular dependency or unpublished local dependency.

**Solution**:
- Publish dependencies in order (allframe-core first)
- Ensure no circular dependencies in Cargo.toml

### Error: "crate size limit exceeded"

**Cause**: Package > 10 MB (crates.io limit).

**Solution**:
```toml
# Add to Cargo.toml
[package]
exclude = [
    "target/",
    "examples/large_files/",
    "*.mp4",
    "*.png"
]
```

### Error: "documentation failed to build on docs.rs"

**Cause**: Missing features or dependencies for docs.

**Solution**:
```toml
# Add to Cargo.toml
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
```

### Yanking a Published Version

If you published a broken version:

```bash
# Yank (makes version unavailable for new users)
cargo yank --vers 0.1.0

# Unyank (if you change your mind)
cargo yank --vers 0.1.0 --undo
```

**Note**: Yanking doesn't delete the version, just marks it as "do not use".

---

## Automated Publishing (CI/CD)

### GitHub Actions Workflow

Create `.github/workflows/publish.yml`:

```yaml
name: Publish to crates.io

on:
  push:
    tags:
      - 'v*'  # Trigger on version tags like v0.1.0

permissions:
  contents: read

jobs:
  publish:
    name: Publish to crates.io
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Install Rust stable
        uses: dtolnay/rust-toolchain@stable

      - name: Cache dependencies
        uses: Swatinem/rust-cache@v2

      - name: Publish allframe-core
        run: |
          cd crates/allframe-core
          cargo publish --token ${{ secrets.CARGO_TOKEN }}

      - name: Wait for allframe-core to be indexed
        run: sleep 120  # Wait 2 minutes

      - name: Update allframe-mcp dependency
        run: |
          cd crates/allframe-mcp
          # Update Cargo.toml to use crates.io version
          sed -i 's|allframe-core = { path = "../allframe-core" }|allframe-core = "0.1"|g' Cargo.toml

      - name: Publish allframe-mcp
        run: |
          cd crates/allframe-mcp
          cargo publish --token ${{ secrets.CARGO_TOKEN }}
```

### Setup GitHub Secret

1. Go to GitHub repository → Settings → Secrets and variables → Actions
2. Click "New repository secret"
3. Name: `CARGO_TOKEN`
4. Value: Your crates.io API token
5. Click "Add secret"

### Test Workflow

```bash
# Create and push a test tag
git tag v0.1.0-test
git push origin v0.1.0-test

# Monitor GitHub Actions
# Workflow should trigger and run (but will fail on publish unless you want to actually publish)
```

---

## Version Management

### Semantic Versioning

AllFrame follows [Semver 2.0.0](https://semver.org):

- **MAJOR** (0.x.0): Breaking changes
- **MINOR** (0.1.x): New features, backwards compatible
- **PATCH** (0.1.1): Bug fixes, backwards compatible

### Version Bump Process

```bash
# Update version in Cargo.toml files
# crates/allframe-core/Cargo.toml
# crates/allframe-mcp/Cargo.toml

# Update CHANGELOG.md with version changes

# Commit changes
git add .
git commit -m "Bump version to 0.1.1"

# Tag release
git tag -a v0.1.1 -m "Release v0.1.1"

# Push
git push origin main
git push origin v0.1.1
```

---

## Checklist Summary

Before publishing:
- [ ] All tests pass
- [ ] Documentation builds
- [ ] Cargo.toml metadata complete
- [ ] README files up-to-date
- [ ] LICENSE files present
- [ ] Working directory clean
- [ ] On main branch
- [ ] Version tagged

During publishing:
- [ ] Run `cargo publish --dry-run` first
- [ ] Publish in dependency order (allframe-core → allframe-mcp)
- [ ] Wait for crates.io to index between publishes
- [ ] Verify each package on crates.io

After publishing:
- [ ] Test installation in fresh project
- [ ] Verify docs.rs builds documentation
- [ ] Update README badges
- [ ] Create announcement
- [ ] Social media posts
- [ ] Push version tag to GitHub

---

## Support

If you encounter issues:
1. Check https://doc.rust-lang.org/cargo/reference/publishing.html
2. Ask on crates.io Discord: https://discord.gg/rust-lang
3. File an issue: https://github.com/all-source-os/all-frame/issues

---

**Status**: Ready for v0.1.0 publication
**Owner**: @all-source-os
**Last Updated**: 2025-12-04