Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/add-migration-installer-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@pgflow/edge-worker': patch
---

Add migration installer API endpoints for no-CLI platforms
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"private": true,
"devDependencies": {
"@axhxrx/nx-deno": "^1.0.2",
"supabase": "^2.62.10",
"@changesets/cli": "^2.28.1",
"@decimalturn/toml-patch": "0.3.7",
"@eslint/js": "^9.8.0",
Expand Down Expand Up @@ -45,7 +44,9 @@
"netlify-cli": "^22.1.3",
"nx": "21.2.1",
"prettier": "^2.6.2",
"supabase": "^2.62.10",
"tslib": "^2.3.0",
"tsx": "^4.20.6",
"typescript": "5.8.3",
"typescript-eslint": "8.34.1",
"vite": "6.3.5",
Expand Down
2 changes: 1 addition & 1 deletion pkgs/cli/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"serve:functions:e2e": {
"executor": "nx:run-commands",
"continuous": true,
"dependsOn": ["^build"],
"dependsOn": ["^build", "edge-worker:build"],
"local": true,
"cache": false,
"options": {
Expand Down
1 change: 0 additions & 1 deletion pkgs/core/.gitignore

This file was deleted.

1 change: 1 addition & 0 deletions pkgs/edge-worker/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
supabase/migrations/*
supabase/functions/_dist/
supabase/seed.sql
src/_generated/
159 changes: 0 additions & 159 deletions pkgs/edge-worker/deno.lock

This file was deleted.

1 change: 1 addition & 0 deletions pkgs/edge-worker/jsr.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"src/**/*.ts"
],
"exclude": [
"!src/_generated",
"__tests__/**/*",
"tests/",
"supabase/",
Expand Down
45 changes: 39 additions & 6 deletions pkgs/edge-worker/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,19 @@
"supabase:ci-marker": {
"executor": "nx:noop"
},
"generate-migrations": {
"executor": "nx:run-commands",
"cache": true,
"inputs": ["{workspaceRoot}/pkgs/core/supabase/migrations/*.sql", "{projectRoot}/scripts/generate-migrations.ts"],
"outputs": ["{projectRoot}/src/_generated/migrations"],
"options": {
"cwd": "{projectRoot}",
"command": "tsx scripts/generate-migrations.ts"
}
},
"build": {
"executor": "nx:noop",
"dependsOn": ["^build"]
"dependsOn": ["generate-migrations", "^build"]
},
"_build_disabled": {
"executor": "@nx/js:tsc",
Expand Down Expand Up @@ -134,8 +144,18 @@
"parallel": false
}
},
"db-clean:ensure": {
"executor": "nx:run-commands",
"local": true,
"cache": false,
"options": {
"cwd": "pkgs/edge-worker",
"commands": ["./scripts/ensure-db-clean"],
"parallel": false
}
},
"test:unit": {
"dependsOn": ["^build"],
"dependsOn": ["build", "^build"],
"executor": "nx:run-commands",
"local": true,
"inputs": ["default", "^production"],
Expand All @@ -148,7 +168,7 @@
}
},
"test:integration": {
"dependsOn": ["db:ensure", "^build"],
"dependsOn": ["db:ensure", "build", "^build"],
"executor": "nx:run-commands",
"local": true,
"inputs": ["default", "^production"],
Expand All @@ -160,9 +180,22 @@
"parallel": false
}
},
"test:migrations": {
"dependsOn": ["db-clean:ensure", "build", "^build"],
"executor": "nx:run-commands",
"local": true,
"inputs": ["default", "^production"],
"options": {
"cwd": "pkgs/edge-worker",
"commands": [
"deno test --config deno.test.json --allow-all --env=supabase/functions/.env tests/migrations/"
],
"parallel": false
}
},
"serve:functions:e2e": {
"executor": "nx:run-commands",
"dependsOn": ["^build"],
"dependsOn": ["build", "^build"],
"continuous": true,
"local": true,
"cache": false,
Expand All @@ -188,12 +221,12 @@
},
"test": {
"inputs": ["default", "^production"],
"dependsOn": ["test:types", "test:unit"]
"dependsOn": ["test:types", "test:unit", "test:migrations"]
},
"test:types": {
"executor": "nx:run-commands",
"cache": true,
"dependsOn": ["^build"],
"dependsOn": ["build", "^build"],
"inputs": ["production", "^production"],
"options": {
"cwd": "{projectRoot}",
Expand Down
20 changes: 20 additions & 0 deletions pkgs/edge-worker/scripts/ensure-db-clean
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
set -e

# Clean up any existing containers
echo "Shutting down existing clean database containers..."
docker compose -f tests/db-clean/compose.yaml down --volumes --remove-orphans

# Start fresh containers
echo "Starting clean database..."
docker compose -f tests/db-clean/compose.yaml up --detach

# Wait for database to be ready
echo "Waiting for database to be available..."
./scripts/wait-for-localhost 5433

# Additional pause to ensure database is fully initialized
echo "Waiting for database initialization..."
sleep 3

echo "Clean database is ready on port 5433!"
Loading