@sveltejs/adapter-netlify 7.0.0-next.7 → 7.0.0-next.9

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.
Files changed (3) hide show
  1. package/files/edge.js +0 -1
  2. package/index.js +10 -12
  3. package/package.json +8 -8
package/files/edge.js CHANGED
@@ -1,4 +1,3 @@
1
- /** @import {} from 'deno' */
2
1
  import { Server } from '0SERVER';
3
2
  import { manifest } from 'MANIFEST';
4
3
 
package/index.js CHANGED
@@ -30,7 +30,7 @@ const netlify_framework_edge_path = '.netlify/v1/edge-functions';
30
30
 
31
31
  const FUNCTION_PREFIX = 'sveltekit-';
32
32
 
33
- /** @type {import('./index.js').default} */
33
+ /** @type {typeof import('./index.js').default} */
34
34
  export default function ({ split = false, edge = edge_set_in_env_var } = {}) {
35
35
  return {
36
36
  name,
@@ -42,15 +42,15 @@ export default function ({ split = false, edge = edge_set_in_env_var } = {}) {
42
42
  );
43
43
  }
44
44
 
45
- if (existsSync(`${builder.config.kit.files.assets}/_headers`)) {
45
+ if (existsSync(`${builder.config.files.assets}/_headers`)) {
46
46
  throw new Error(
47
- `The _headers file should be placed in the project root rather than the ${builder.config.kit.files.assets} directory`
47
+ `The _headers file should be placed in the project root rather than the ${builder.config.files.assets} directory`
48
48
  );
49
49
  }
50
50
 
51
- if (existsSync(`${builder.config.kit.files.assets}/_redirects`)) {
51
+ if (existsSync(`${builder.config.files.assets}/_redirects`)) {
52
52
  throw new Error(
53
- `The _redirects file should be placed in the project root rather than the ${builder.config.kit.files.assets} directory`
53
+ `The _redirects file should be placed in the project root rather than the ${builder.config.files.assets} directory`
54
54
  );
55
55
  }
56
56
 
@@ -80,7 +80,7 @@ export default function ({ split = false, edge = edge_set_in_env_var } = {}) {
80
80
  builder.log.minor(`Publishing to "${publish}"`);
81
81
 
82
82
  builder.log.minor('Copying assets...');
83
- const publish_dir = `${publish}${builder.config.kit.paths.base}`;
83
+ const publish_dir = `${publish}${builder.config.paths.base}`;
84
84
  builder.writeClient(publish_dir);
85
85
  builder.writePrerendered(publish_dir);
86
86
 
@@ -387,16 +387,14 @@ async function generate_edge_functions({ builder }) {
387
387
  // Contains static files
388
388
  `/${builder.getAppPath()}/immutable/*`,
389
389
  `/${builder.getAppPath()}/version.json`,
390
- ...builder.prerendered.paths,
390
+ // the base root and `trailingSlash: 'always'` pages are recorded with a trailing slash
391
+ ...builder.prerendered.paths.map((path) => (path === '/' ? path : path.replace(/\/$/, ''))),
391
392
  ...Array.from(assets).flatMap((asset) => {
392
393
  if (asset.endsWith('/index.html')) {
393
394
  const dir = asset.replace(/\/index\.html$/, '');
394
- return [
395
- `${builder.config.kit.paths.base}/${asset}`,
396
- `${builder.config.kit.paths.base}/${dir}`
397
- ];
395
+ return [`${builder.config.paths.base}/${asset}`, `${builder.config.paths.base}/${dir}`];
398
396
  }
399
- return `${builder.config.kit.paths.base}/${asset}`;
397
+ return `${builder.config.paths.base}/${asset}`;
400
398
  }),
401
399
  // Should not be served by SvelteKit at all
402
400
  '/.netlify/*'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/adapter-netlify",
3
- "version": "7.0.0-next.7",
3
+ "version": "7.0.0-next.9",
4
4
  "description": "A SvelteKit adapter that creates a Netlify app",
5
5
  "keywords": [
6
6
  "adapter",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "types": "index.d.ts",
29
29
  "files": [
30
- "files",
30
+ "files/*.js",
31
31
  "index.js",
32
32
  "utils.js",
33
33
  "index.d.ts",
@@ -36,23 +36,23 @@
36
36
  "dependencies": {
37
37
  "@iarna/toml": "^2.2.5",
38
38
  "@netlify/types": "^2.8.0",
39
- "rolldown": "^1.2.0"
39
+ "rolldown": "^1.2.3"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@netlify/edge-functions": "^3.0.8",
43
43
  "@types/deno": "^2.7.0",
44
44
  "@types/node": "^22.19.19",
45
- "typescript": "^6.0.3",
45
+ "typescript": "^7.0.2",
46
46
  "vitest": "^4.1.10",
47
- "@sveltejs/kit": "^3.0.0-next.17"
47
+ "@sveltejs/kit": "^3.0.0-next.24"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "@sveltejs/kit": "^2.31.0"
51
51
  },
52
52
  "scripts": {
53
- "check": "tsc",
54
- "lint": "prettier --check .",
55
- "format": "pnpm lint --write",
53
+ "check": "tsc && tsc --project files/tsconfig.json",
54
+ "lint": "oxfmt --check .",
55
+ "format": "oxfmt --write .",
56
56
  "test:unit": "vitest run",
57
57
  "test:build": "pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" build",
58
58
  "test": "pnpm test:unit && pnpm test:build"