confect/ directory (see Project Structure). Beyond those, you can organize your group spec and impl files however you like. The conventions below are what the Confect documentation and example project follow.
Spec and impl files
Name your group spec and impl files with.spec.ts and .impl.ts suffixes. This keeps each groupβs interface and implementation easy to identify, and colocates them in directory listings.
spec.ts and impl.ts then import from the corresponding .spec.ts and .impl.ts files:
confect/spec.ts
confect/impl.ts
Native Convex functions
When a group wraps native Convex functions (for use with components or other libraries), place the plain function definitions in a file named after the group β without a suffix. This puts all three files for a group side by side:Node actions
Place node action spec and impl files in anode/ subdirectory, using the same .spec.ts / .impl.ts suffixes. The entry-point files nodeSpec.ts and nodeImpl.ts import from this directory.
Nested groups
When a group contains subgroups, use a subdirectory named after the parent group. The parentβs.spec.ts and .impl.ts files stay at the top level and import from the subdirectory.
Full example
Putting it all together, a project using all of these conventions might look like this:confect
_generated
node
email.spec.ts
email.impl.ts
notesAndRandom
notes.spec.ts
notes.impl.ts
random.spec.ts
random.impl.ts
tables
env.spec.ts
env.impl.ts
http.ts
impl.ts
nodeImpl.ts
nodeSpec.ts
notesAndRandom.spec.ts
notesAndRandom.impl.ts
schema.ts
spec.ts
workpool.ts
workpool.spec.ts
workpool.impl.ts