@sveltejs/adapter-netlify 1.0.0-next.60 → 1.0.0-next.63

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/README.md CHANGED
@@ -48,7 +48,7 @@ New projects will use Node 16 by default. However, if you're upgrading a project
48
48
 
49
49
  ## Netlify Edge Functions (beta)
50
50
 
51
- SvelteKit supports the beta release of Netlify Edge Functions. If you pass the option `edge: true` to the `adapter` function, server-side rendering will happen in a Deno-based edge function that's deployed close to the site visitor. If set to `false` (the default), the site will deploy to standard Node-based Netlify Functions.
51
+ SvelteKit supports the beta release of [Netlify Edge Functions](https://docs.netlify.com/netlify-labs/experimental-features/edge-functions/). If you pass the option `edge: true` to the `adapter` function, server-side rendering will happen in a Deno-based edge function that's deployed close to the site visitor. If set to `false` (the default), the site will deploy to standard Node-based Netlify Functions.
52
52
 
53
53
  ## Netlify alternatives to SvelteKit functionality
54
54
 
package/files/edge.js CHANGED
@@ -12,6 +12,7 @@ const prefix = `/${manifest.appDir}/`;
12
12
  export default function handler(request, context) {
13
13
  if (is_static_file(request)) {
14
14
  // Static files can skip the handler
15
+ // TODO can we serve _app/immutable files with an immutable cache header?
15
16
  return;
16
17
  }
17
18
 
@@ -33,6 +34,7 @@ function is_static_file(request) {
33
34
  if (url.pathname.startsWith(prefix)) {
34
35
  return true;
35
36
  }
37
+
36
38
  // prerendered pages and index.html files
37
39
  const pathname = url.pathname.replace(/\/$/, '');
38
40
  let file = pathname.substring(1);
package/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
1
  import { Adapter } from '@sveltejs/kit';
2
2
 
3
- declare function plugin(opts?: { split?: boolean; edge?: boolean }): Adapter;
4
-
5
- export = plugin;
3
+ export default function plugin(opts?: { split?: boolean; edge?: boolean }): Adapter;
package/index.js CHANGED
@@ -34,7 +34,7 @@ const edge_set_in_env_var =
34
34
  process.env.NETLIFY_SVELTEKIT_USE_EDGE === 'true' ||
35
35
  process.env.NETLIFY_SVELTEKIT_USE_EDGE === '1';
36
36
 
37
- /** @type {import('.')} */
37
+ /** @type {import('.').default} */
38
38
  export default function ({ split = false, edge = edge_set_in_env_var } = {}) {
39
39
  return {
40
40
  name: '@sveltejs/adapter-netlify',
@@ -64,7 +64,7 @@ export default function ({ split = false, edge = edge_set_in_env_var } = {}) {
64
64
  builder.copy('_headers', headers_file);
65
65
  appendFileSync(
66
66
  headers_file,
67
- `\n\n/${builder.config.kit.appDir}/*\n cache-control: public\n cache-control: immutable\n cache-control: max-age=31536000\n`
67
+ `\n\n/${builder.config.kit.appDir}/immutable/*\n cache-control: public\n cache-control: immutable\n cache-control: max-age=31536000\n`
68
68
  );
69
69
 
70
70
  // for esbuild, use ESM
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/adapter-netlify",
3
- "version": "1.0.0-next.60",
3
+ "version": "1.0.0-next.63",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",
@@ -11,6 +11,7 @@
11
11
  "type": "module",
12
12
  "exports": {
13
13
  ".": {
14
+ "types": "./index.d.ts",
14
15
  "import": "./index.js"
15
16
  },
16
17
  "./package.json": "./package.json"
@@ -30,7 +31,7 @@
30
31
  "devDependencies": {
31
32
  "@types/set-cookie-parser": "^2.4.2",
32
33
  "@netlify/functions": "^1.0.0",
33
- "@sveltejs/kit": "1.0.0-next.342"
34
+ "@sveltejs/kit": "1.0.0-next.346"
34
35
  },
35
36
  "scripts": {
36
37
  "dev": "rimraf files && rollup -cw",