Allow control over git exclude behavior #2076
Replies: 2 comments 11 replies
-
Have you tried using a soft symlink? See https://vike.dev/filesystem-routing#crawl-space.
If that's the case, then Vike should eventually add some documentation about this techique at https://vike.dev/build-your-own-framework. If you're up for it, we can discuss whether it really is the best setup. (Tbh I ain't sure that's the case.) Why not publishing it as a private npm package while using semver? In other words, you'll be publishing and managing your internal framework similarly to an open source project like Vike (while keeping everything private and internal). Also, in case you're company is up for it, you can sponsor Vike for a tigh-knit collaboration. (Actually, one of Vike's sponsor is also building an internal company framework). |
Beta Was this translation helpful? Give feedback.
-
Thank you for your reply. I tried symlinking to an outside directory, but then it becomes cumbersome to utilize dependencies from the framework (I will call our framework that, and Vike by its name). I gave it another try to refresh my thoughts on it. To give an example, some page configs import The symlink would still have the same issue as the directory itself, too; it either wants to be committed into the framework's repo or it gets ignored by Vike. A private package could probably be made to work, but we don't currently use private packages elsewhere, so we would need to pay a subscription or manage a local piece of infrastructure for years to come almost exclusively to get around this issue. Until we do have a wider need for private packages, we're probably more likely to end up with a post-install script that rewrites the git flags in Vike's source code. My described solution seems to be the most portable for our specific usecase, but I can't say how broadly this can be applied to other projects. However, several other approaches I tried would've conflicted with git ignores as well, I can't imagine no one else has run into this. The 'Build your own framework' guide diverges from our setup, in that it seems each individual site is expected to have its own Vike installation and config, while we'd like to treat the templates more like drop-in configuration files. It unfortunate because conceptually Vike's crawling, inheritance and domain-driven file structure facilitate this approach almost perfectly, and it comes down pretty much entirely to I could propose a sponsorship at some point, but this is the first time I've used Vike for this company, so it might be better to bring it up once it's made an impression, rather than while I'm figuring out how to make it work for us. It's also a pretty small company, what we can spare is probably closer to a gesture than an investment. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am using Vike as the base for a generic company framework that should power multiple separate sites within our network, each with its own pages, components, styles, components, etc. One of the most straight-forward ways to do this seems to be to simply drop a directory with all the local files bundled inside the framework installation, as Vike will still find the page files.
However, our framework and the individual sites should each have their own git repository, the sites shouldn't be committed to the generic framework's repo. This is where Vike's git-based file indexing is causing some issues, as adding the local site directory to
.gitignore
, registering it as a submodule and possibly.git/info/exclude
all result in Vike ignoring the contents of that directory. I think it can be narrowed down togit ls-files --exclude-standard
being hardcoded incrawlPlusFiles.js
, and it would be helpful to have an option to adjust these parameters.Other ideas for allowing local templates are welcome. I've played around with symlinks, import rewrites and all sorts, but so far this seems to be the path of least resistance, bar this one quibble. Most of the potential alternatives I could come up with also still called for a way to exclude local files in git, while still allowing them to be found by Vike.
Thank you in advance, kind regards
Beta Was this translation helpful? Give feedback.
All reactions