@sveltejs/adapter-netlify 1.0.0-next.37 → 1.0.0-next.38

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.
@@ -4850,7 +4850,7 @@ class Body {
4850
4850
  return formData;
4851
4851
  }
4852
4852
 
4853
- const {toFormData} = await Promise.resolve().then(function () { return require('./multipart-parser-b87ea3e5.js'); });
4853
+ const {toFormData} = await Promise.resolve().then(function () { return require('./multipart-parser-e24c3004.js'); });
4854
4854
  return toFormData(this.body, ct);
4855
4855
  }
4856
4856
 
@@ -6523,13 +6523,19 @@ function __fetch_polyfill() {
6523
6523
 
6524
6524
  __fetch_polyfill();
6525
6525
 
6526
+ /**
6527
+ *
6528
+ * @param {import('@sveltejs/kit').SSRManifest} manifest
6529
+ * @returns {import('@netlify/functions').Handler}
6530
+ */
6526
6531
  function init(manifest) {
6532
+ /** @type {import('@sveltejs/kit').App} */
6527
6533
  const app = new app_js.App(manifest);
6528
6534
 
6529
6535
  return async (event) => {
6530
6536
  const { httpMethod, headers, rawUrl, body, isBase64Encoded } = event;
6531
6537
 
6532
- const encoding = isBase64Encoded ? 'base64' : headers['content-encoding'] || 'utf-8';
6538
+ const encoding = isBase64Encoded ? 'base64' : 'utf-8';
6533
6539
  const rawBody = typeof body === 'string' ? Buffer.from(body, encoding) : body;
6534
6540
 
6535
6541
  const rendered = await app.render({
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var handler = require('./handler-bc05d78e.js');
5
+ var handler = require('./handler-a3623ede.js');
6
6
  require('./server/app.js');
7
7
  require('node:http');
8
8
  require('node:https');
@@ -3,7 +3,7 @@
3
3
  require('node:fs');
4
4
  require('node:path');
5
5
  var node_worker_threads = require('node:worker_threads');
6
- var handler = require('./handler-bc05d78e.js');
6
+ var handler = require('./handler-a3623ede.js');
7
7
  require('node:http');
8
8
  require('node:https');
9
9
  require('node:zlib');
@@ -4841,7 +4841,7 @@ class Body {
4841
4841
  return formData;
4842
4842
  }
4843
4843
 
4844
- const {toFormData} = await import('./multipart-parser-1104e57c.js');
4844
+ const {toFormData} = await import('./multipart-parser-b42aadce.js');
4845
4845
  return toFormData(this.body, ct);
4846
4846
  }
4847
4847
 
@@ -6514,13 +6514,19 @@ function __fetch_polyfill() {
6514
6514
 
6515
6515
  __fetch_polyfill();
6516
6516
 
6517
+ /**
6518
+ *
6519
+ * @param {import('@sveltejs/kit').SSRManifest} manifest
6520
+ * @returns {import('@netlify/functions').Handler}
6521
+ */
6517
6522
  function init(manifest) {
6523
+ /** @type {import('@sveltejs/kit').App} */
6518
6524
  const app = new App(manifest);
6519
6525
 
6520
6526
  return async (event) => {
6521
6527
  const { httpMethod, headers, rawUrl, body, isBase64Encoded } = event;
6522
6528
 
6523
- const encoding = isBase64Encoded ? 'base64' : headers['content-encoding'] || 'utf-8';
6529
+ const encoding = isBase64Encoded ? 'base64' : 'utf-8';
6524
6530
  const rawBody = typeof body === 'string' ? Buffer.from(body, encoding) : body;
6525
6531
 
6526
6532
  const rendered = await app.render({
@@ -1,4 +1,4 @@
1
- export { i as init } from './handler-5924cdbc.js';
1
+ export { i as init } from './handler-1cae7b39.js';
2
2
  import './server/app.js';
3
3
  import 'node:http';
4
4
  import 'node:https';
@@ -1,7 +1,7 @@
1
1
  import 'node:fs';
2
2
  import 'node:path';
3
3
  import { MessageChannel } from 'node:worker_threads';
4
- import { F as FormData, a as File } from './handler-5924cdbc.js';
4
+ import { F as FormData, a as File } from './handler-1cae7b39.js';
5
5
  import 'node:http';
6
6
  import 'node:https';
7
7
  import 'node:zlib';
package/index.js CHANGED
@@ -129,7 +129,13 @@ export default function ({ split = false } = {}) {
129
129
  builder.copy('_redirects', redirect_file);
130
130
  appendFileSync(redirect_file, `\n\n${redirects.join('\n')}`);
131
131
 
132
- // TODO write a _headers file that makes client-side assets immutable
132
+ builder.log.minor('Writing custom headers...');
133
+ const headers_file = join(publish, '_headers');
134
+ builder.copy('_headers', headers_file);
135
+ appendFileSync(
136
+ headers_file,
137
+ `\n\n/${builder.appDir}/*\n cache-control: public\n cache-control: immutable\n cache-control: max-age=31536000\n`
138
+ );
133
139
  }
134
140
  };
135
141
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/adapter-netlify",
3
- "version": "1.0.0-next.37",
3
+ "version": "1.0.0-next.38",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",
@@ -27,10 +27,11 @@
27
27
  "tiny-glob": "^0.2.9"
28
28
  },
29
29
  "devDependencies": {
30
+ "@netlify/functions": "^0.10.0",
30
31
  "@rollup/plugin-commonjs": "^21.0.0",
31
32
  "@rollup/plugin-json": "^4.1.0",
32
33
  "@rollup/plugin-node-resolve": "^13.0.5",
33
- "@sveltejs/kit": "1.0.0-next.208",
34
+ "@sveltejs/kit": "1.0.0-next.218",
34
35
  "rimraf": "^3.0.2",
35
36
  "rollup": "^2.58.0"
36
37
  },