kit icon indicating copy to clipboard operation
kit copied to clipboard

Adapter API to parse ignore files to warn of suggested ignores

Open jthegedus opened this issue 4 years ago • 2 comments

Describe the problem

Different adapters require different ignore settings.

The current proposed soln that is in use today is for all adapter output to be under .svelte-kit/<somedir> though this may change in future per adapter.

The proposed solution would provide adapter authors with an alternative.

Describe the proposed solution

Use gitignore-parser to let Adapters to loudly warn users. From this exchange:

Should we expect to see gitignore-parser provided via the Adapter API in the near future?

  • jthegedus https://github.com/sveltejs/kit/pull/2055#issuecomment-890661100

Yes, I think we should — we could have an API like utils.warn_if_unignored([opts.output])

  • Rich-Harris https://github.com/sveltejs/kit/pull/2055#issuecomment-890666505

Alternatives considered

Writing this in my documentation

Importance

would make my life easier

Additional Information

raising the issues:

  • #1832
  • #1581

initial proposition:

  • #1924

revert of initial proposition

  • #2055

jthegedus avatar Aug 21 '21 04:08 jthegedus

https://kit.svelte.dev/docs#writing-an-adapter says:

If possible, we recommend putting the adapter output under the build/ directory with any intermediate output placed under '.svelte-kit/' + adapterName.

Unfortunately it hasn't always been possible. We had to move some of the Netlify output to be under .netlify

benmccann avatar Aug 21 '21 05:08 benmccann

kit.svelte.dev/docs#writing-an-adapter says:

If possible, we recommend putting the adapter output under the build/ directory with any intermediate output placed under '.svelte-kit/' + adapterName.

Unfortunately it hasn't always been possible. We had to move some of the Netlify output to be under .netlify

Yes, this cannot always be achieved. If the adapter reads the platform config (netlify.toml, firebase.json etc) to determine where to put the final build output, then a way to warn about ignoring is required.

A key point to highlight, and that I think is missed in a lot of the Kit > PlatformX conversations, is the idea that Kit is the only App & owner of all APIs hosted on PlatformX. For instance, a single Firebase project can house many Android, iOS, Web apps and APIs all from the same firebase.json config, which is why the Firebase Adapter cannot simply put everything in build/ nor that build/ is even at the root of the Firebase project. But also, does not mean the user wants to commit the final build output wherever it lives.

jthegedus avatar Aug 22 '21 00:08 jthegedus