@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 +1 -1
- package/files/edge.js +3 -4
- package/files/serverless.js +1 -1
- package/index.d.ts +16 -1
- package/package.json +6 -5
package/ambient.d.ts
CHANGED
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
|
-
|
|
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() {
|
package/files/serverless.js
CHANGED
|
@@ -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/
|
|
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
|
|
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
|
+
"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/
|
|
39
|
-
"rolldown": "^1.
|
|
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.
|
|
46
|
-
"@sveltejs/kit": "^3.0.0-next.
|
|
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"
|