-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: add a kit.files.src
option
#14144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
I personally don't love this. If someone changes the location of the |
We already let people configure just about everything in |
Exactly. I for one would love to deprecate all the non-top-level options. I'd be astonished if anyone is actually using them, but if anyone is they're probably having to set them all, redundantly. I don't think anything is really gained by making that stuff configurable (though the top-level option is probably an escape hatch worth having), but stuff is definitely lost — imagine you're coming to a SvelteKit codebase and someone has renamed everything for shits and giggles. Especially in a world of coding assistants, having things be consistent between projects is valuable. We're saying the same thing, of course, I'm just arguing (alongside @Conduitry) that this additional piece of configuration advances a have-less-configuration agenda. Once I get the tests passing I'll open a 'deprecate all the others' issue so people can weigh in |
🦋 Changeset detectedLatest commit: c7afab9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
I'm all for deprecating the other options! But I still don't understand why this one is needed. It doesn't seem to solve the issue in #14077 (comment) at all, which is that they want to put some code outside the |
It will fix #14077 because instead of crawling |
Can't we crawl |
If someone has config like this export default {
kit: {
files: {
lib: 'source/lib',
routes: 'source/routes'
// ...
}
}
}; ....then crawling a hardcoded |
Right, we have to crawl the existing directories for backwards compatibility. No argument there. Still not sure why |
Implements the idea in #14077 (comment). This adds a
kit.files.src
option, defaulting tosrc
, which specifies where your source code lives.lib
,routes
etc are now relative to that by default, so if you have this......your
$lib
alias will point tosource/lib
. No need to set up separate values for everything inside your source directory.The real draw of this is that we can use the
src
option for other things, including #14077 (though that's not implemented yet — TODO).Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Edits