Skip to content

Commit 05403aa

Browse files
committed
chore: remove Deno dependency and update flow compilation docs (#448)
# Remove Deno Dependency and Simplify Flow Compilation This PR removes the Deno dependency requirement for pgflow and streamlines the flow compilation process: - Removed Deno as a prerequisite in the CLI README - Removed the deprecated `--deno-json` flag and related warning messages - Added `--control-plane-url` option to the CLI for custom ControlPlane endpoints - Updated documentation to reflect the HTTP-based compilation approach: - Removed the dedicated "Compile flow to SQL" page - Updated references to flow compilation throughout the docs - Added clarification that the ControlPlane is currently for local development only - Added notes that production deployments don't need the ControlPlane function yet - Updated navigation links and redirects to point to the quickstart guide instead of the removed compilation page - Enhanced troubleshooting sections with more specific guidance These changes complete the transition to HTTP-based compilation introduced in v0.9.0, making pgflow easier to use by eliminating the local Deno dependency.
1 parent d911ddf commit 05403aa

File tree

14 files changed

+76
-191
lines changed

14 files changed

+76
-191
lines changed

pkgs/cli/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ This package provides essential tools for setting up, managing, and deploying pg
1616
## Prerequisites
1717

1818
- Supabase CLI v2.50.3 or higher
19-
- Deno v2.1.x or higher (for flow compilation)
2019
- Local Supabase project initialized
2120

2221
## Installation
@@ -70,8 +69,8 @@ npx pgflow@latest compile my_flow
7069

7170
Options:
7271

73-
- `--deno-json <path>` - Path to custom deno.json configuration file
7472
- `--supabase-path <path>` - Path to custom Supabase directory
73+
- `--control-plane-url <url>` - ControlPlane URL (default: `http://127.0.0.1:54321/functions/v1/pgflow`)
7574

7675
The compiler will:
7776

pkgs/cli/src/commands/compile/index.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -98,23 +98,10 @@ export default (program: Command) => {
9898
new Option('--secret-key [key]', 'Supabase anon/service_role key')
9999
.hideHelp()
100100
)
101-
.option(
102-
'--deno-json <denoJsonPath>',
103-
'[DEPRECATED] No longer used. Will be removed in v1.0'
104-
)
105101
.action(async (flowSlug, options) => {
106102
intro('pgflow - Compile Flow to SQL');
107103

108104
try {
109-
// Show deprecation warning for --deno-json
110-
if (options.denoJson) {
111-
log.warn(
112-
'The --deno-json flag is deprecated and no longer used.\n' +
113-
'Flow compilation now happens via HTTP, not local Deno.\n' +
114-
'This flag will be removed in v1.0'
115-
);
116-
}
117-
118105
// Validate Supabase path
119106
let supabasePath: string;
120107
if (options.supabasePath) {

pkgs/website/astro.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ export default defineConfig({
168168
'get-started/installation',
169169
'get-started/flows/quickstart',
170170
'get-started/flows/create-flow',
171-
'get-started/flows/compile-flow',
172171
'get-started/flows/run-flow',
173172
'concepts/how-pgflow-works',
174173
'concepts/data-model',

pkgs/website/redirects.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ export const redirects = {
4949
'/getting-started/': '/get-started/installation/',
5050
'/getting-started/install-pgflow/': '/get-started/installation/',
5151
'/getting-started/create-first-flow/': '/get-started/flows/create-flow/',
52-
'/getting-started/compile-to-sql/': '/get-started/flows/compile-flow/',
52+
'/getting-started/compile-to-sql/': '/get-started/flows/quickstart/',
53+
'/get-started/flows/compile-flow/': '/get-started/flows/quickstart/',
5354
'/getting-started/run-flow/': '/get-started/flows/run-flow/',
5455
'/getting-started/configuration/': '/reference/configuration/',
5556
'/getting-started/update-pgflow/': '/deploy/update-pgflow/',

pkgs/website/src/components/PageFrame.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const showFooter = isLandingPage || isAuthorPage;
6363
<ul>
6464
<li><a href="/get-started/installation/">Installation</a></li>
6565
<li><a href="/get-started/flows/create-flow/">Create Flow</a></li>
66-
<li><a href="/get-started/flows/compile-flow/">Compile Flow</a></li>
66+
<li><a href="/get-started/flows/quickstart/">Quickstart</a></li>
6767
<li><a href="/get-started/flows/run-flow/">Run Flow</a></li>
6868
<li><a href="/project-status/">Project Status</a></li>
6969
<li><a href="/get-started/faq/">FAQ</a></li>

pkgs/website/src/content/docs/build/version-flows.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Put the new flow in its own file with a versioned slug.
6868

6969
2. **Compile it**
7070

71-
[Compile the new flow to SQL](/get-started/flows/compile-flow/) which generates a migration file:
71+
Compile the new flow to SQL to generate a migration file:
7272

7373
```bash frame="none"
7474
npx pgflow@latest compile greetUserV2

pkgs/website/src/content/docs/concepts/compilation.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ This architecture provides several benefits:
6767

6868
**Simpler CLI** - The CLI is a lightweight Node.js package that makes HTTP requests, rather than needing to bundle the entire compilation infrastructure.
6969

70+
<Aside type="note" title="Production Deployment">
71+
The ControlPlane is currently used for local development compilation only.
72+
In future releases, it will be deployed to production for auto-compilation
73+
features where workers verify and compile flows at startup.
74+
For now, only deploy your worker functions to production.
75+
</Aside>
76+
7077
## Adding New Flows
7178

7279
To make a flow available for compilation:

pkgs/website/src/content/docs/deploy/supabase/deploy-first-flow.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ Before deploying to production:
1919
- You have a Supabase project (free or paid tier)
2020
</Aside>
2121

22+
<Aside type="note" title="ControlPlane Not Needed Yet">
23+
The `pgflow` ControlPlane function is for local compilation only.
24+
You do not need to deploy it to production yet - only deploy your worker functions.
25+
</Aside>
26+
2227
## Get Your Database Connection String
2328

2429
Your workers need to connect to the production database:

pkgs/website/src/content/docs/get-started/flows/compile-flow.mdx

Lines changed: 0 additions & 143 deletions
This file was deleted.

pkgs/website/src/content/docs/get-started/flows/quickstart.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,20 @@ Want to modify the flow structure? Flows are immutable once registered - this pr
119119

120120
**In production:** Create a [versioned flow](/build/version-flows/) (e.g., `greetUserV2`) to preserve history.
121121

122+
## Troubleshooting
123+
124+
### "Could not connect to ControlPlane"
125+
126+
Make sure edge functions are running:
127+
128+
```bash frame="none"
129+
npx supabase functions serve --no-verify-jwt
130+
```
131+
132+
### "Flow not found"
133+
134+
Register your flow in `supabase/functions/pgflow/index.ts` and restart the functions server.
135+
122136
## Next steps
123137

124138
<CardGrid>

0 commit comments

Comments
 (0)