Repository navigation
Commit c6d9573
authored
fix: drop commented import from flows index template (#641)
## Why
`pgflow install` scaffolded `supabase/flows/index.ts` with a commented-out
example import:
```ts
// Example: export { MyFlow } from './my-flow.ts';
```
The Supabase CLI resolves each function's import graph with a **regex over raw
file text** (`importPathPattern` in `apps/cli/src/shared/functions/deploy.ts`) —
it does not strip comments. The commented example matches the pattern, the
walker tries to read `supabase/flows/my-flow.ts`, gets ENOENT, and
`supabase start` aborts on a fresh project:
```
failed to read file: open supabase/flows/my-flow.ts: no such file or directory
```
Reproduced in isolation: fresh `supabase init` + the comment in a transitive
file → `supabase start` exits with the error above; deleting only that comment
line → full stack boots.
## What
- `flows/index.ts` template: drop the commented example import, replace with a
short warning comment that itself contains no import-shaped text
- manual-installation docs: same change in the copy-paste snippet
- regression test: generated `index.ts` must not reference `my-flow`
## Verification
- `vitest create-flows-directory.test.ts` — 7/7 (new assertion caught an
earlier draft of this fix that quoted the forbidden pattern in its own
warning comment)
- ran supabase CLI's exact `importPathPattern` over the generated file: only
`./greet-user.ts` matches, which exists
- E2E with the locally built CLI: fresh project → `pgflow install` →
`supabase start` boots the full stack (previously failed at bind-mount
resolution)1 parent b9ef4c9 commit c6d9573
4 files changed
Lines changed: 14 additions & 2 deletions
File tree
- .changeset
- pkgs
- cli
- __tests__/commands/install
- src/commands/install
- website/src/content/docs/reference
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
| 140 | + | |
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
| |||
0 commit comments