nate
nate5mo ago

Where to store api helper utils?

Was looking where i store api utils that i want to format response or do some shared util checking etc.. without them being generated into the api files
7 Replies
lee
lee5mo ago
You can store them inside or outside the convex/ folder. As long as they're not exported as query, mutation, or action, they won't be included in the api
nate
nateOP5mo ago
ahh ok, i thought i was seeing them in generated file mappings, but i guess they dont get exposed thanks! is there also away to ignore coverage files? ie:
ing Convex functions...
✘ [ERROR] No loader is configured for ".html" files: convex/coverage/lcov-report/convex/lib/index.html

✘ [ERROR] No loader is configured for ".png" files: convex/coverage/favicon.png

✘ [ERROR] No loader is configured for ".html" files: convex/coverage/convex/_generated/index.html

✘ [ERROR] No loader is configured for ".html" files: convex/coverage/lcov-report/convex/_generated/index.html

✘ [ERROR] No loader is configured for ".html" files: convex/coverage/index.html

✘ [ERROR] No loader is configured for ".png" files: convex/coverage/lcov-report/favicon.png

✘ [ERROR] No loader is configured for ".info" files: convex/coverage/lcov.info

✘ [ERROR] No loader is configured for ".html" files: convex/coverage/lcov-report/convex/index.html

✘ [ERROR] No loader is configured for ".html" files: convex/coverage/convex/index.html
ing Convex functions...
✘ [ERROR] No loader is configured for ".html" files: convex/coverage/lcov-report/convex/lib/index.html

✘ [ERROR] No loader is configured for ".png" files: convex/coverage/favicon.png

✘ [ERROR] No loader is configured for ".html" files: convex/coverage/convex/_generated/index.html

✘ [ERROR] No loader is configured for ".html" files: convex/coverage/lcov-report/convex/_generated/index.html

✘ [ERROR] No loader is configured for ".html" files: convex/coverage/index.html

✘ [ERROR] No loader is configured for ".png" files: convex/coverage/lcov-report/favicon.png

✘ [ERROR] No loader is configured for ".info" files: convex/coverage/lcov.info

✘ [ERROR] No loader is configured for ".html" files: convex/coverage/lcov-report/convex/index.html

✘ [ERROR] No loader is configured for ".html" files: convex/coverage/convex/index.html
ampp
ampp5mo ago
You should just be able to exclude it via the tsconfig.json exclude option in convex folder
nate
nateOP5mo ago
thanks!
lee
lee5mo ago
Ah yeah putting non-ts/js files in the convex directory doesn't work very well right now. Files with two dots like foo.test.ts are ignored. Personally i would put them outside the convex directory if possible
Michal Srb
Michal Srb5mo ago
Usually the coverage folder should be generated from the root of your project. Maybe you're running the test command from the convex/ directory instead of from its parent.
nate
nateOP5mo ago
i did move it to the root, and the. my ide (webstorm) stopped displaying coverage inline weird it wont go back now updated some config and it worked

Did you find this page helpful?