Files
AFFiNE-Mirror/packages/frontend/apps/ios/apollo-codegen-chore.sh
Lakr 10e981aa6d chore: update codegen cli and apollo version on iOS (#12879)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Added support for creating new documents from markdown and retrieving
the current locale in the iOS app.
- Introduced a shell script to automate Apollo iOS code generation
tasks.

- **Improvements**
- Upgraded the Apollo iOS library to version 1.22.0 for improved
performance and compatibility.
- Enhanced metadata handling in the app to include document ID,
workspace ID, server URL, and locale.
- Improved JavaScript execution integration for document and workspace
operations.

- **Bug Fixes**
- Fixed button appearance in the input bar by setting a static corner
radius for the send button.

- **Chores**
- Removed unused dependencies and updated .gitignore entries for cleaner
project management.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-20 11:03:16 +00:00

30 lines
1.1 KiB
Bash
Executable File

#!/bin/zsh
cd "$(dirname "$0")"
set -euo pipefail
VERSION=$(grep -o 'apollo-ios", exact: "[^"]*"' "App/Packages/AffineGraphQL/Package.swift" | sed 's/.*exact: "\([^"]*\)".*/\1/')
[ -z "$VERSION" ] && { echo "❌ Failed to extract version"; exit 1; }
echo "📦 Apollo Version: $VERSION"
sed -i '' "s|apollo-ios\.git\", from: \"[^\"]*\"|apollo-ios.git\", from: \"$VERSION\"|" "App/Packages/Intelligents/Package.swift"
echo "✅ Version synced"
mkdir -p "App/Packages/AffineGraphQL/apollo-ios-cli"
curl -L "https://github.com/apollographql/apollo-ios/releases/download/$VERSION/apollo-ios-cli.tar.gz" | tar -xz -C "App/Packages/AffineGraphQL/apollo-ios-cli"
echo "✅ CLI downloaded"
CLI_BIN=$(find App/Packages/AffineGraphQL/apollo-ios-cli -type f -perm +111 -name 'apollo-ios-cli' | head -n 1)
[ -z "$CLI_BIN" ] && { echo "❌ apollo-ios-cli executable not found"; exit 1; }
echo "🔧 Using binary tool at: $CLI_BIN"
$CLI_BIN generate --path "apollo-codegen-config.json" --ignore-version-mismatch
echo "✅ Code generated"
rm -rf "App/Packages/AffineGraphQL/apollo-ios-cli"
echo "🧹 Cleaned up"