pixelmund / svemix

The Full-Stack addition to SvelteKit. Write your server code inside svelte files, handle sessions, forms and SEO easily.
https://svemix.com
MIT License
337 stars 16 forks source link

Maybe avoid generating endpoints next to routes #50

Closed pixelmund closed 2 years ago

pixelmund commented 2 years ago

Describe the bug

The situation is a bit tricky, we're currently using/generating SvelteKit Endpoints next to the files, but this can quickly sum up to a lot of files. I don't know if there is a way to avoid generating them while still using the functionality. This should probably belong to Kit, but i'm not sure what a solution in Kit would look like.

We could also leave it the way it is currently.

Your Example Website or App

-

Steps to Reproduce the Bug or Issue

-

Expected behavior

We shouldn't create the endpoints visible to the user.

Screenshots or Videos

-

Platform

-

Additional context

-

Acmion commented 2 years ago

Yeah, I have also thought about this issue.

I hid the "unwanted" files in VS Code, however, this is not generalizable to all cases. Additionally, this is also relatively prone to errors, especially if working in teams where a member may edit a generated file and thus causing problems in the long run.

pixelmund commented 2 years ago

A temporary solution is to edit the vscode settings or create a /.vscode/settings.json file with the following content:

{
    "files.exclude": {
        "src/routes/**/*.ts": true,
        "src/routes/**/*.js": true,
        "src/routes/api/**/*.js": false,
        "src/routes/api/**/*.ts": false
    }
}

The api folder would contain anything that you wan't to handle with Standalone SvelteKit and yes @Acmion this is unfortunate.

wobsoriano commented 2 years ago

Remix added support for Vue, and now have an open PR for Svelte fyi

https://github.com/brophdawg11/remix-routers/pull/9