Skip to content

fix: include esbuild config in adapter type definition#1954

Merged
benmccann merged 2 commits intomasterfrom
adapter-types
Jul 19, 2021
Merged

fix: include esbuild config in adapter type definition#1954
benmccann merged 2 commits intomasterfrom
adapter-types

Conversation

@GrygrFlzr
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
* @param {{
* esbuild?: (defaultOptions: BuildOptions) => Promise<BuildOptions> | BuildOptions;
* }} options
* }} [options]
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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