Open
Description
Hello 👋
Context
I have configured my project to have the convex directory under the src/deps folder.
{
"$schema": "https://raw.githubusercontent.com/get-convex/convex-backend/refs/heads/main/npm-packages/convex/schemas/convex.schema.json",
"functions": ["src/deps/convex", "src/modules/**/convex"]
}
Under src/deps/convex/schema.ts
I have a task
table which is imported from elsewhere.
import { taskTable } from '@/modules/task/convex/schema';
import { defineSchema } from 'convex/server';
export default defineSchema({
task: taskTable
});
Problem
The problem is: the convex backend only refreshes if files under src/deps/convex
change, but not when the imported dependent files change also - This results in having to redundantly save any file in the convex directory to see the changes reflected on the backend.
Any ideas how to overcome this issue? I am considering using Convex for a larger project with a large number of "modules" each having it's own table and functions. Having a neat folder structure is a must for such a use case.
Proposed solutions
1) Allow for specifying which folders the CLI should watch through a flag
- A potential solution could look like this:
bunx convex dev --watch src/modules/**/convex
2) Extending the schema so that dependent folders can be specified
{
"$schema": "https://raw.githubusercontent.com/get-convex/convex-backend/refs/heads/main/npm-packages/convex/schemas/convex.schema.json",
"root": "src/deps/convex"
"dependencies": [
"src/modules/post/convex",
"src/modules/profile/convex",
"src/modules/settings/convex"
]
}
3) Allow for multiple functions directories to be specified
{
"$schema": "https://raw.githubusercontent.com/get-convex/convex-backend/refs/heads/main/npm-packages/convex/schemas/convex.schema.json",
"functions": ["src/deps/convex", "src/modules/**/convex"]
}
- issue being where would the _generated folder be 🤔