Chakib Ouhajjou
Chakib Ouhajjouā€¢8mo ago

ignore files in convex folder

Can I put file in the convex folder and make them ignored, so they dont get loaded ?
13 Replies
ballingt
ballingtā€¢8mo ago
There is not besides that filenames with multiple dots are not included, like messages.test.ts and messages.js.anotherextension. https://github.com/get-convex/convex-js/blob/main/src/bundler/index.ts#L346-L347 Would appreciate hearing about your use case
Chakib Ouhajjou
Chakib OuhajjouOPā€¢8mo ago
I want to put some Rescript files inside Convex. And calling the generated js from queries. they are .res files I am getting this: ā ¼ Preparing Convex functions... āœ˜ [ERROR] No loader is configured for ".res" files: convex/test.res
v
vā€¢8mo ago
I guess you might have to make a fork for now If needed
Chakib Ouhajjou
Chakib OuhajjouOPā€¢8mo ago
so the answer is no ? fork is OVERKILL. it's simpler to just do a prebuild step, that copies the files I WANT to the convex folder. just waiting for the 'official confirmation' that it's not possible, and Thanks !!
Michal Srb
Michal Srbā€¢8mo ago
As Tom wrote above, no, all files are processed (although I think this could be considered a bug and we should only process the extensions we know we can handle, [tj]sx?). You could do foo.bla.res and compile that to foo.js.
v
vā€¢8mo ago
I was thinking that too Or have configurable conditions
Chakib Ouhajjou
Chakib OuhajjouOPā€¢8mo ago
Not elegant ! do you agree ? it's like naming my files based on a limitation that might change in convex. ignoring files with 2 dots is not robust / nor definitive IMO. this is discriminatory code šŸ™‚
} else if (base.startsWith("#")) {
log(chalk.yellow(`Skipping likely emacs tempfile ${fpath}`));
} else if (base.startsWith("#")) {
log(chalk.yellow(`Skipping likely emacs tempfile ${fpath}`));
hehe for only supporting emacs nerds ! šŸ™‚
lee
leeā€¢8mo ago
if i were in your position, i would put them in a separate folder outside of convex/, like /convex_rescript/test.res and have the compilation move the .js files into the convex/ directory.
Chakib Ouhajjou
Chakib OuhajjouOPā€¢8mo ago
rescript has nice feature, the compiled js is in the same folder as the .res file. when you delete .res is deletes the compiled .js automatically. so to keep that workflow, it has to be a 'build step that copies the js file AFTER compilation' but you know, this will comeup again IMO for you guys. Hardcoding all the cases is not fun to maintain for you guys. Already you are ignoring README.me, emacs, etc ...
ballingt
ballingtā€¢8mo ago
Helpful to hear! We'll consider config for this kind of integration. One important customization we'll likely support here is esbuild plugins, or potentially full bundler customization were you give us an executable to call.
ballingt
ballingtā€¢8mo ago
It looks like it's hard to customize the output directory for Rescript https://rescript-lang.org/docs/manual/latest/build-configuration#package-specs so I can see how this would be helpful.
ReScript Documentation
Build System Configuration | ReScript Language Manual
Details about the configuration of the ReScript build system (rescript.json)
ballingt
ballingtā€¢8mo ago
I'd still go with Lee's suggestion for now, you just need your own script syncing into (a .gitignored?) portion of the convex directory.
Chakib Ouhajjou
Chakib OuhajjouOPā€¢8mo ago
I think the quickwin is to ignore my build logic and be neutral to my setup. I will use only one of these 2 solutions: - pull files: convex allows .convex_ignore in /convex, to that you pull what you want. by default you pull everything - push files: I create a folder, I push to /convex what I want I don't need nothing for the push pipeline, so I am doing that for now. I'll do pull when and if you provide the setup. I will not integrate my pipelines with convex, just to keep thinks orthogonal and independent.

Did you find this page helpful?