@sveltejs/adapter-netlify 7.0.0-next.3 → 7.0.0-next.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ambient.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  declare global {
2
2
  namespace App {
3
3
  export interface Platform {
4
- context: import('@netlify/functions').Context;
4
+ context: import('@netlify/types').Context;
5
5
  }
6
6
  }
7
7
  }
package/files/edge.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { Server } from "0SERVER";
2
2
  import { manifest } from "MANIFEST";
3
3
  //#region src/edge.js
4
+ /** @import {} from 'deno' */
4
5
  const server = new Server(manifest);
5
6
  /**
6
7
  * We don't know the origin until we receive a request, but
@@ -19,10 +20,8 @@ const initialized = server.init({
19
20
  });
20
21
  /** @type {import('@netlify/edge-functions').EdgeFunction} */
21
22
  async function handler(request, context) {
22
- if (!origin) {
23
- origin = new URL(request.url).origin;
24
- await initialized;
25
- }
23
+ if (!origin) origin = new URL(request.url).origin;
24
+ await initialized;
26
25
  return server.respond(request, {
27
26
  platform: { context },
28
27
  getClientAddress() {
@@ -16,7 +16,7 @@ function createReadableStream(file) {
16
16
  //#region src/serverless.js
17
17
  /**
18
18
  * @param {import('@sveltejs/kit').SSRManifest} manifest
19
- * @returns {(request: Request, context: import('@netlify/functions').Context) => Promise<Response>}
19
+ * @returns {(request: Request, context: import('@netlify/types').Context) => Promise<Response>}
20
20
  */
21
21
  function init(manifest) {
22
22
  const server = new Server(manifest);
package/index.d.ts CHANGED
@@ -1,4 +1,19 @@
1
1
  import { Adapter } from '@sveltejs/kit';
2
2
  import './ambient.d.ts';
3
3
 
4
- export default function plugin(opts?: { split?: boolean; edge?: boolean }): Adapter;
4
+ export interface AdapterOptions {
5
+ /**
6
+ * If `true`, your app will be deployed as a [Netlify Edge Function](https://docs.netlify.com/build/edge-functions/overview/) rather than the standard Node-based function.
7
+ * @default false
8
+ */
9
+ edge?: boolean;
10
+ /**
11
+ * If `true`, your app will be split into multiple functions instead of a single one for the entire app.
12
+ *
13
+ * If `edge` is `true`, this option cannot be used.
14
+ * @default false
15
+ */
16
+ split?: boolean;
17
+ }
18
+
19
+ export default function plugin(opts?: AdapterOptions): Adapter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/adapter-netlify",
3
- "version": "7.0.0-next.3",
3
+ "version": "7.0.0-next.5",
4
4
  "description": "A SvelteKit adapter that creates a Netlify app",
5
5
  "keywords": [
6
6
  "adapter",
@@ -35,15 +35,16 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@iarna/toml": "^2.2.5",
38
- "@netlify/functions": "^5.3.0",
39
- "rolldown": "^1.1.2"
38
+ "@netlify/types": "^2.8.0",
39
+ "rolldown": "^1.2.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@netlify/edge-functions": "^3.0.8",
43
+ "@types/deno": "^2.7.0",
43
44
  "@types/node": "^22.19.19",
44
45
  "typescript": "^6.0.3",
45
- "vitest": "^4.1.9",
46
- "@sveltejs/kit": "^3.0.0-next.8"
46
+ "vitest": "^4.1.10",
47
+ "@sveltejs/kit": "^3.0.0-next.13"
47
48
  },
48
49
  "peerDependencies": {
49
50
  "@sveltejs/kit": "^2.31.0"