+31
-3
lexicons/README.md
+31
-3
lexicons/README.md
···
40
40
41
41
### Updating ATProto Lexicons
42
42
43
-
To update to the latest ATProto lexicons:
43
+
To update to the latest ATProto lexicons, use the provided update script:
44
+
45
+
```bash
46
+
./scripts/update-lexicons.sh
47
+
```
48
+
49
+
This will:
50
+
1. Fetch the latest changes from the atproto repository
51
+
2. Show you what changed
52
+
3. Stage the submodule update for commit
44
53
54
+
Then commit the changes:
55
+
```bash
56
+
git commit -m "Update atproto lexicons to latest"
57
+
```
58
+
59
+
**Manual approach:**
45
60
```bash
46
61
cd vendor/atproto
47
62
git pull origin main
···
50
65
git commit -m "Update atproto lexicons to latest"
51
66
```
52
67
53
-
### Setup Script
68
+
### Available Scripts
54
69
55
-
A convenience script is available to handle the initial setup:
70
+
Two convenience scripts are available:
71
+
72
+
**Setup Script** - Handle the initial setup:
56
73
57
74
```bash
58
75
#!/bin/bash
···
84
101
cd ..
85
102
86
103
echo "Lexicons setup complete!"
104
+
```
105
+
106
+
**Update Script** - Update ATProto lexicons:
107
+
108
+
```bash
109
+
#!/bin/bash
110
+
# scripts/update-lexicons.sh
111
+
112
+
# Fetches latest changes from atproto repository
113
+
# Shows what changed and stages the update for commit
114
+
./scripts/update-lexicons.sh
87
115
```
88
116
89
117
### Adding Custom Lexicons
+62
scripts/update-lexicons.sh
+62
scripts/update-lexicons.sh
···
1
+
#!/bin/bash
2
+
# scripts/update-lexicons.sh
3
+
# Update script for ATProto lexicons from upstream
4
+
5
+
set -e
6
+
7
+
echo "Updating ATProto lexicons..."
8
+
9
+
# Check if we're in the right directory
10
+
if [ ! -f "package.json" ] || [ ! -d "vendor/atproto" ]; then
11
+
echo "Error: This script must be run from the project root directory"
12
+
echo "Make sure vendor/atproto submodule exists"
13
+
exit 1
14
+
fi
15
+
16
+
# Save current directory
17
+
PROJECT_ROOT=$(pwd)
18
+
19
+
# Update the submodule
20
+
echo "Fetching latest changes from atproto repository..."
21
+
cd vendor/atproto
22
+
23
+
# Fetch latest changes
24
+
git fetch origin
25
+
26
+
# Get current commit
27
+
CURRENT_COMMIT=$(git rev-parse HEAD)
28
+
CURRENT_SHORT=$(git rev-parse --short HEAD)
29
+
30
+
# Get latest commit on main
31
+
LATEST_COMMIT=$(git rev-parse origin/main)
32
+
LATEST_SHORT=$(git rev-parse --short origin/main)
33
+
34
+
if [ "$CURRENT_COMMIT" = "$LATEST_COMMIT" ]; then
35
+
echo "Already up to date (${CURRENT_SHORT})"
36
+
cd "$PROJECT_ROOT"
37
+
exit 0
38
+
fi
39
+
40
+
echo "Updating from ${CURRENT_SHORT} to ${LATEST_SHORT}..."
41
+
42
+
# Pull latest changes
43
+
git pull origin main
44
+
45
+
# Go back to project root
46
+
cd "$PROJECT_ROOT"
47
+
48
+
# Stage the submodule update
49
+
git add vendor/atproto
50
+
51
+
# Show what changed
52
+
echo ""
53
+
echo "Submodule updated successfully!"
54
+
echo "Changes:"
55
+
git diff --cached --submodule=log vendor/atproto
56
+
57
+
echo ""
58
+
echo "To complete the update, commit the changes:"
59
+
echo " git commit -m \"Update atproto lexicons to ${LATEST_SHORT}\""
60
+
echo ""
61
+
echo "Or to see what lexicon files changed:"
62
+
echo " cd vendor/atproto && git log --oneline ${CURRENT_SHORT}..${LATEST_SHORT} -- lexicons/"