Skip to content
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

feat: pass validated svelte config to adapters #1559

Merged

Conversation

jthegedus
Copy link
Contributor

@jthegedus jthegedus commented May 26, 2021

Pass validated Svelte config to Adapters.

As vaguely discussed in #1435 and #1436 adapters may need the svelte config settings, but currently must parse the files themselves, which is brittle and unnecessary.

An example of this need comes from adapters reading specific cloud provider config to determine input and output dirs. The Firebase adapter reads the firebase.json file to determine the output dir for the static assets, but by default this is public and so conflicts with the default of kit.files.assets. The adapter checks that these are different, but must first read the svelte config to determine the actual value of svelte.config.js:kit.files.assets and deal with it not being listed because we are reading the object before SvelteKit defaults are applied etc.

Closes #1435

Following the contribution guide, pnpm i changed the lockfile 🤷

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpx changeset and following the prompts

@dummdidumm
Copy link
Member

The changelock change may have happened because you are on a different version of pnpm (not latest major perhaps)

@jthegedus
Copy link
Contributor Author

The changelock change may have happened because you are on a different version of pnpm (not latest major perhaps)

I am on 6.3.0. I updated my fork aswell before creating branch. I can remove the file from PR as it seems unnecessary.

@benmccann benmccann mentioned this pull request May 26, 2021
5 tasks
@benmccann benmccann merged commit 028abd9 into sveltejs:master May 26, 2021
@benmccann
Copy link
Member

thanks!

@jthegedus jthegedus deleted the feat/computed-svelte-config-for-adapter branch May 27, 2021 00:42
sidharthv96 added a commit to sidharthv96/kit that referenced this pull request May 29, 2021
* 'master' of https://github.com/sveltejs/kit:
  Version Packages (next) (sveltejs#1543)
  type fixes for adapter-node and adapter-static (sveltejs#1578)
  Upgrade to Vite 2.3.3 (sveltejs#1580)
  fix: improve getRawBody parsing & handle error(s) (sveltejs#1528)
  create-svelte: add svelte-check for TS (sveltejs#1556)
  pass validated svelte config to adapters (sveltejs#1559)
  types: group related and reduce potential inconsistencies (sveltejs#1539)
  Use sveltekit tag on StackOverflow (sveltejs#1558)
  Fix create-svelte build-template script (sveltejs#1555)
  Remove err param from Polka .listen() callback (sveltejs#1550)
  bump: polka and sirv versions (sveltejs#1548)
  svelte-kit package (sveltejs#1499)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[adapter api]: pass svelte.config.js config object to adapter
3 participants