Skip to content

Commit

Permalink
Update adapter entrypoint typings to be NodeNext/ESNext-compatible. (#…
Browse files Browse the repository at this point in the history
…5111)

* update adapter entrypoint typings to be NodeNext-compatible (closes #5110)

* Create lemon-timers-deliver.md

* Update lemon-timers-deliver.md

Co-authored-by: Rich Harris <[email protected]>
  • Loading branch information
adam-coster and Rich-Harris authored May 30, 2022
1 parent 3e30360 commit 7d5fb30
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 22 deletions.
11 changes: 11 additions & 0 deletions .changeset/lemon-timers-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@sveltejs/adapter-auto": patch
"@sveltejs/adapter-cloudflare-workers": patch
"@sveltejs/adapter-cloudflare": patch
"@sveltejs/adapter-netlify": patch
"@sveltejs/adapter-node": patch
"@sveltejs/adapter-static": patch
"@sveltejs/adapter-vercel": patch
---

Update adapter entrypoint typings to be NodeNext/ESNext-compatible
3 changes: 1 addition & 2 deletions packages/adapter-auto/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Adapter } from '@sveltejs/kit';

declare function plugin(): Adapter;
export = plugin;
export default function plugin(): Adapter;
2 changes: 1 addition & 1 deletion packages/adapter-auto/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { adapters } from './adapters.js';

/** @type {import('./index')} */
/** @type {import('./index').default} */
let fn;

for (const candidate of adapters) {
Expand Down
3 changes: 1 addition & 2 deletions packages/adapter-cloudflare-workers/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Adapter } from '@sveltejs/kit';

declare function plugin(): Adapter;
export = plugin;
export default function plugin(): Adapter;
2 changes: 1 addition & 1 deletion packages/adapter-cloudflare-workers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { fileURLToPath } from 'url';
* }} WranglerConfig
*/

/** @type {import('.')} */
/** @type {import('.').default} */
export default function (options = {}) {
return {
name: '@sveltejs/adapter-cloudflare-workers',
Expand Down
3 changes: 1 addition & 2 deletions packages/adapter-cloudflare/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Adapter } from '@sveltejs/kit';

declare function plugin(): Adapter;
export = plugin;
export default function plugin(): Adapter;
2 changes: 1 addition & 1 deletion packages/adapter-cloudflare/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { posix } from 'path';
import { fileURLToPath } from 'url';
import * as esbuild from 'esbuild';

/** @type {import('.')} */
/** @type {import('.').default} */
export default function (options = {}) {
return {
name: '@sveltejs/adapter-cloudflare',
Expand Down
4 changes: 1 addition & 3 deletions packages/adapter-netlify/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Adapter } from '@sveltejs/kit';

declare function plugin(opts?: { split?: boolean; edge?: boolean }): Adapter;

export = plugin;
export default function plugin(opts?: { split?: boolean; edge?: boolean }): Adapter;
2 changes: 1 addition & 1 deletion packages/adapter-netlify/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const edge_set_in_env_var =
process.env.NETLIFY_SVELTEKIT_USE_EDGE === 'true' ||
process.env.NETLIFY_SVELTEKIT_USE_EDGE === '1';

/** @type {import('.')} */
/** @type {import('.').default} */
export default function ({ split = false, edge = edge_set_in_env_var } = {}) {
return {
name: '@sveltejs/adapter-netlify',
Expand Down
3 changes: 1 addition & 2 deletions packages/adapter-node/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ interface AdapterOptions {
envPrefix?: string;
}

declare function plugin(options?: AdapterOptions): Adapter;
export = plugin;
export default function plugin(options?: AdapterOptions): Adapter;
2 changes: 1 addition & 1 deletion packages/adapter-node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const pipe = promisify(pipeline);

const files = fileURLToPath(new URL('./files', import.meta.url).href);

/** @type {import('.')} */
/** @type {import('.').default} */
export default function (opts = {}) {
// TODO remove for 1.0
// @ts-expect-error
Expand Down
3 changes: 1 addition & 2 deletions packages/adapter-static/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ interface AdapterOptions {
precompress?: boolean;
}

declare function plugin(options?: AdapterOptions): Adapter;
export = plugin;
export default function plugin(options?: AdapterOptions): Adapter;
2 changes: 1 addition & 1 deletion packages/adapter-static/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import zlib from 'zlib';

const pipe = promisify(pipeline);

/** @type {import('.')} */
/** @type {import('.').default} */
export default function ({ pages = 'build', assets = pages, fallback, precompress = false } = {}) {
return {
name: '@sveltejs/adapter-static',
Expand Down
3 changes: 1 addition & 2 deletions packages/adapter-vercel/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ type Options = {
split?: boolean;
};

declare function plugin(options?: Options): Adapter;
export = plugin;
export default function plugin(options?: Options): Adapter;
2 changes: 1 addition & 1 deletion packages/adapter-vercel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const redirects = {

const files = fileURLToPath(new URL('./files', import.meta.url).href);

/** @type {import('.')} **/
/** @type {import('.').default} **/
export default function ({ external = [], edge, split } = {}) {
return {
name: '@sveltejs/adapter-vercel',
Expand Down

0 comments on commit 7d5fb30

Please sign in to comment.