Skip to content

Conversation

@jumski
Copy link
Contributor

@jumski jumski commented Nov 27, 2025

Reorganize Flow Directory Structure and Improve Import Patterns

This PR introduces a new, more organized directory structure for pgflow projects by moving flow definitions from supabase/functions/_flows/ to a dedicated top-level supabase/flows/ directory. This change improves code organization and simplifies imports.

Key changes:

  • Created a new supabase/flows/ directory with an index.ts barrel file that re-exports all flows
  • Updated the Control Plane to use namespace imports (import * as flows) instead of individual imports
  • Modified ControlPlane.serve() to accept either an array of flows or a namespace object
  • Updated documentation and examples to use named exports instead of default exports
  • Removed the supabase CLI dependency from package.json (not needed)
  • Added comprehensive tests for the new namespace import pattern

This new structure makes flows first-class citizens in the project, improves discoverability, and follows a more intuitive organization pattern. The barrel file pattern (index.ts) makes it easy to add new flows without modifying the Control Plane.

@changeset-bot
Copy link

changeset-bot bot commented Nov 27, 2025

⚠️ No Changeset found

Latest commit: ffdc2d0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Copy link
Contributor Author

jumski commented Nov 27, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge:queue - adds this PR to the back of the merge queue
  • hotfix:queue - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@nx-cloud
Copy link

nx-cloud bot commented Nov 27, 2025

View your CI Pipeline Execution ↗ for commit ffdc2d0

Command Status Duration Result
nx affected -t verify-exports --base=origin/mai... ✅ Succeeded 3s View ↗
nx affected -t build --configuration=production... ✅ Succeeded 30s View ↗
nx affected -t lint typecheck test --parallel -... ✅ Succeeded 3m 44s View ↗
nx run edge-worker:e2e ✅ Succeeded 2m 52s View ↗
nx run cli:e2e ✅ Succeeded 4s View ↗

☁️ Nx Cloud last updated this comment at 2025-11-27 21:09:44 UTC

Comment on lines 96 to 98
supabase:
specifier: ^2.34.3
specifier: ^2.62.10
version: 2.62.10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Critical inconsistency: supabase dependency was removed from package.json (line 47) but pnpm-lock.yaml still contains it with an updated version. This means:

  1. The lock file is out of sync with package.json
  2. The package will still be installed despite being removed from dependencies
  3. Future pnpm install runs may behave unexpectedly

Fix: Run pnpm install to regenerate the lock file after removing the dependency from package.json:

pnpm install

This will properly remove the supabase entry from pnpm-lock.yaml to match the package.json changes.

Spotted by Graphite Agent

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@jumski jumski force-pushed the 11-27-add_flows__directory_structure_with_namespace_imports_for_controlplane.serve_ branch from 908b1ab to ffdc2d0 Compare November 27, 2025 21:01
@github-actions
Copy link
Contributor

🔍 Preview Deployment: Website

Deployment successful!

🔗 Preview URL: https://pr-441.pgflow.pages.dev

📝 Details:

  • Branch: 11-27-add_flows__directory_structure_with_namespace_imports_for_controlplane.serve_
  • Commit: 404c5ea91e65b5c442c1acfd5131978b3e16e329
  • View Logs

_Last updated: _

@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 28, 2025

Merge activity

  • Nov 28, 11:45 PM UTC: jumski added this pull request to the Graphite merge queue.
  • Nov 28, 11:45 PM UTC: CI is running for this pull request on a draft pull request (#449) due to your merge queue CI optimization settings.
  • Nov 28, 11:53 PM UTC: Merged by the Graphite merge queue via draft PR: #449.

graphite-app bot pushed a commit that referenced this pull request Nov 28, 2025
…e.serve() (#441)

# Reorganize Flow Directory Structure and Improve Import Patterns

This PR introduces a new, more organized directory structure for pgflow projects by moving flow definitions from `supabase/functions/_flows/` to a dedicated top-level `supabase/flows/` directory. This change improves code organization and simplifies imports.

Key changes:

- Created a new `supabase/flows/` directory with an `index.ts` barrel file that re-exports all flows
- Updated the Control Plane to use namespace imports (`import * as flows`) instead of individual imports
- Modified `ControlPlane.serve()` to accept either an array of flows or a namespace object
- Updated documentation and examples to use named exports instead of default exports
- Removed the `supabase` CLI dependency from package.json (not needed)
- Added comprehensive tests for the new namespace import pattern

This new structure makes flows first-class citizens in the project, improves discoverability, and follows a more intuitive organization pattern. The barrel file pattern (`index.ts`) makes it easy to add new flows without modifying the Control Plane.
@graphite-app graphite-app bot closed this Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants