-
Notifications
You must be signed in to change notification settings - Fork 15
chore: update Supabase dependencies and improve e2e test infrastructure #292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,73 @@ | ||||||||||||||||
| #!/usr/bin/env bash | ||||||||||||||||
| set -euo pipefail | ||||||||||||||||
|
|
||||||||||||||||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||||||||||||||||
| EDGE_WORKER_DIR="$(dirname "$SCRIPT_DIR")" | ||||||||||||||||
| MONOREPO_ROOT="$(cd "$EDGE_WORKER_DIR/../.." && pwd)" | ||||||||||||||||
| VENDOR_DIR="$EDGE_WORKER_DIR/supabase/functions/_vendor" | ||||||||||||||||
|
|
||||||||||||||||
| echo "🔄 Syncing edge function dependencies for e2e tests..." | ||||||||||||||||
|
|
||||||||||||||||
| # Clean and create vendor directory | ||||||||||||||||
| rm -rf "$VENDOR_DIR" | ||||||||||||||||
| mkdir -p "$VENDOR_DIR/@pgflow" | ||||||||||||||||
|
|
||||||||||||||||
| # Verify builds succeeded | ||||||||||||||||
| if [ ! -d "$MONOREPO_ROOT/pkgs/core/dist" ]; then | ||||||||||||||||
| echo "❌ Error: core package build failed - dist directory not found" | ||||||||||||||||
| exit 1 | ||||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| if [ ! -d "$MONOREPO_ROOT/pkgs/dsl/dist" ]; then | ||||||||||||||||
| echo "❌ Error: dsl package build failed - dist directory not found" | ||||||||||||||||
| exit 1 | ||||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| # Copy core package | ||||||||||||||||
| echo "📋 Copying @pgflow/core..." | ||||||||||||||||
| mkdir -p "$VENDOR_DIR/@pgflow/core" | ||||||||||||||||
| cp -r "$MONOREPO_ROOT/pkgs/core/dist/"* "$VENDOR_DIR/@pgflow/core/" | ||||||||||||||||
| cp "$MONOREPO_ROOT/pkgs/core/package.json" "$VENDOR_DIR/@pgflow/core/" | ||||||||||||||||
|
|
||||||||||||||||
| # Copy dsl package | ||||||||||||||||
| echo "📋 Copying @pgflow/dsl..." | ||||||||||||||||
| mkdir -p "$VENDOR_DIR/@pgflow/dsl" | ||||||||||||||||
| cp -r "$MONOREPO_ROOT/pkgs/dsl/dist/"* "$VENDOR_DIR/@pgflow/dsl/" | ||||||||||||||||
| cp "$MONOREPO_ROOT/pkgs/dsl/package.json" "$VENDOR_DIR/@pgflow/dsl/" | ||||||||||||||||
|
|
||||||||||||||||
| # Copy edge-worker source (not built) - preserving directory structure | ||||||||||||||||
| echo "📋 Copying @pgflow/edge-worker..." | ||||||||||||||||
| mkdir -p "$VENDOR_DIR/@pgflow/edge-worker" | ||||||||||||||||
| # Copy the entire src directory to maintain relative imports | ||||||||||||||||
| cp -r "$MONOREPO_ROOT/pkgs/edge-worker/src" "$VENDOR_DIR/@pgflow/edge-worker/" | ||||||||||||||||
|
|
||||||||||||||||
| # Simple fix: replace .js with .ts in imports | ||||||||||||||||
| find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i 's/\.js"/\.ts"/g' {} + | ||||||||||||||||
| find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i "s/\.js'/\.ts'/g" {} + | ||||||||||||||||
|
Comment on lines
+45
to
+46
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: Platform compatibility issue with The Fix: # Use platform-independent approach
find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i.bak 's/\.js"/\.ts"/g' {} +
find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i.bak "s/\.js'/\.ts'/g" {} +
find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.bak" -type f -deleteOr use a more portable solution: find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f | while read -r file; do
sed 's/\.js"/\.ts"/g; s/\.js'\''/.ts'\'''/g' "$file" > "$file.tmp" && mv "$file.tmp" "$file"
done
Suggested change
Spotted by Graphite Agent |
||||||||||||||||
|
|
||||||||||||||||
| # Create a redirect index.ts at the root that points to src/index.ts | ||||||||||||||||
| cat > "$VENDOR_DIR/@pgflow/edge-worker/index.ts" << 'EOF' | ||||||||||||||||
| // Re-export from the src directory to maintain compatibility | ||||||||||||||||
| export * from './src/index.ts'; | ||||||||||||||||
| EOF | ||||||||||||||||
|
|
||||||||||||||||
| # Create _internal.ts redirect as well since edge-worker exports this path | ||||||||||||||||
| cat > "$VENDOR_DIR/@pgflow/edge-worker/_internal.ts" << 'EOF' | ||||||||||||||||
| // Re-export from the src directory to maintain compatibility | ||||||||||||||||
| export * from './src/_internal.ts'; | ||||||||||||||||
| EOF | ||||||||||||||||
|
|
||||||||||||||||
| # Verify key files exist | ||||||||||||||||
| if [ ! -f "$VENDOR_DIR/@pgflow/core/index.js" ]; then | ||||||||||||||||
| echo "⚠️ Warning: @pgflow/core/index.js not found after copy" | ||||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| if [ ! -f "$VENDOR_DIR/@pgflow/dsl/index.js" ]; then | ||||||||||||||||
| echo "⚠️ Warning: @pgflow/dsl/index.js not found after copy" | ||||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| if [ ! -f "$VENDOR_DIR/@pgflow/edge-worker/src/index.ts" ]; then | ||||||||||||||||
| echo "⚠️ Warning: @pgflow/edge-worker/src/index.ts not found after copy" | ||||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| echo "✅ Dependencies synced to $VENDOR_DIR" | ||||||||||||||||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.