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

fix: include esbuild config in adapter type definition #1954

Merged
merged 2 commits into from
Jul 19, 2021
Merged

Conversation

GrygrFlzr
Copy link
Member

  • Added missing type definitions to adapters.
  • Fix adapter-node requiring esbuild to be defined if any options were specified.

Tests

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

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. All changesets should be patch until SvelteKit 1.0

@changeset-bot
Copy link

changeset-bot bot commented Jul 19, 2021

🦋 Changeset detected

Latest commit: 6494d96

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@sveltejs/adapter-cloudflare-workers Patch
@sveltejs/adapter-netlify Patch
@sveltejs/adapter-node Patch
@sveltejs/adapter-vercel Patch

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

@dummdidumm
Copy link
Member

Fixes #1958 I think

@benmccann benmccann merged commit e9f7899 into master Jul 19, 2021
@benmccann benmccann deleted the adapter-types branch July 19, 2021 16:39
@@ -11,9 +11,9 @@ import { fileURLToPath } from 'url';
/**
* @param {{
* esbuild?: (defaultOptions: BuildOptions) => Promise<BuildOptions> | BuildOptions;
* }} options
* }} [options]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an intentional change? Why only on some adapters?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • adapter-cloudflare-workers, adapter-vercel, adapter-netlify, and adapter-node all use esbuild, so this option should be available but not made mandatory.
  • adapter-begin is unmaintained
  • adapter-static doesn't use esbuild, so it wasn't affected.

If you're referring to the specific line, that's JSDoc's way of specifying an optional parameter so that you can do something like adapter: adapterCfw() without having to pass in an empty object.

Copy link
Contributor

@jthegedus jthegedus Jul 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're referring to the specific line, that's JSDoc's way of specifying an optional parameter so that you can do something like adapter: adapterCfw() without having to pass in an empty object.

I was referring to the specific line, thanks for clarifying. I need to learn the JSDoc spec better.

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-vercel returns an error with latest version "TypeError: options.esbuild is not a function"
4 participants