Skip to content

Commit 50273ac

Browse files
authored
Merge branch 'master' into regurgitate-errors
2 parents 1bc4849 + fb24644 commit 50273ac

File tree

41 files changed

+533
-67
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+533
-67
lines changed

.changeset/bright-moles-worry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
fix: only show prerendering message when actually prerendering

.changeset/hip-eggs-raise.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
fix: handle anchors with special chars when navigating

documentation/docs/25-build-and-deploy/90-adapter-vercel.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Since all of these variables are unchanged between build time and run time when
6969

7070
### Vercel functions
7171

72-
Vercel functions contained in the `/api` directory at the project's root will _not_ be included in the deployment — these should be implemented as [server endpoints](https://kit.svelte.dev/docs/routing#server) in your SvelteKit app.
72+
If you have Vercel functions contained in the `api` directory at the project's root, any requests for `/api/*` will _not_ be handled by SvelteKit. You should implement these as [API routes](https://kit.svelte.dev/docs/routing#server) in your SvelteKit app instead, unless you need to use a non-JavaScript language in which case you will need to ensure that you don't have any `/api/*` routes in your SvelteKit app.
7373

7474
### Node version
7575

@@ -79,4 +79,4 @@ Projects created before a certain date will default to using Node 14, while Svel
7979

8080
### Accessing the file system
8181

82-
You can't access the file system through methods like `fs.readFileSync` in Serverless/Edge environments. If you need to access files that way, do that during building the app through [prerendering](https://kit.svelte.dev/docs/page-options#prerender). If you have a blog for example and don't want to manage your content through a CMS, then you need to prerender the content (or prerender the endpoint from which you get it) and redeploy your blog everytime you add new content.
82+
You can't access the file system through methods like `fs.readFileSync` in Serverless/Edge environments. If you need to access files that way, do that during building the app through [prerendering](https://kit.svelte.dev/docs/page-options#prerender). If you have a blog for example and don't want to manage your content through a CMS, then you need to prerender the content (or prerender the endpoint from which you get it) and redeploy your blog everytime you add new content.

packages/kit/.eslintrc.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"env": {
3+
"es2022": true
4+
},
5+
"parserOptions": {
6+
"ecmaVersion": "latest",
7+
"sourceType": "module"
8+
},
9+
"plugins": ["unicorn"],
10+
"rules": {
11+
"unicorn/prefer-node-protocol": "error"
12+
}
13+
}

packages/kit/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
"@types/node": "^16.18.6",
3333
"@types/sade": "^1.7.4",
3434
"@types/set-cookie-parser": "^2.4.2",
35+
"eslint": "^8.33.0",
36+
"eslint-plugin-unicorn": "^45.0.2",
3537
"marked": "^4.2.3",
3638
"rollup": "^3.7.0",
3739
"svelte": "^3.55.1",
@@ -57,7 +59,7 @@
5759
"postinstall.js"
5860
],
5961
"scripts": {
60-
"lint": "prettier --check . --config ../../.prettierrc --ignore-path .gitignore",
62+
"lint": "prettier --check . --config ../../.prettierrc --ignore-path .gitignore && eslint src/**",
6163
"check": "tsc",
6264
"check:all": "tsc && pnpm -r --filter=\"./**\" check",
6365
"format": "pnpm lint --write",

packages/kit/src/cli.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import fs from 'fs';
2-
import path from 'path';
1+
import fs from 'node:fs';
2+
import path from 'node:path';
33
import colors from 'kleur';
44
import sade from 'sade';
55
import { load_config } from './core/config/index.js';

packages/kit/src/core/adapt/builder.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
import { fork } from 'node:child_process';
12
import { existsSync, statSync, createReadStream, createWriteStream } from 'node:fs';
23
import { pipeline } from 'node:stream';
3-
import { promisify } from 'node:util';
4-
import { fork } from 'node:child_process';
54
import { fileURLToPath } from 'node:url';
5+
import { promisify } from 'node:util';
6+
import zlib from 'node:zlib';
67
import glob from 'tiny-glob';
7-
import zlib from 'zlib';
88
import { copy, rimraf, mkdirp } from '../../utils/filesystem.js';
99
import { generate_manifest } from '../generate_manifest/index.js';
1010
import { get_route_segments } from '../../utils/routing.js';

packages/kit/src/core/adapt/builder.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { rmSync } from 'fs';
2-
import { join } from 'path';
1+
import { rmSync } from 'node:fs';
2+
import { join } from 'node:path';
3+
import { fileURLToPath } from 'node:url';
34
import { test } from 'uvu';
45
import * as assert from 'uvu/assert';
56
import glob from 'tiny-glob/sync.js';
67
import { create_builder } from './builder.js';
7-
import { fileURLToPath } from 'url';
88

99
const __filename = fileURLToPath(import.meta.url);
1010
const __dirname = join(__filename, '..');

packages/kit/src/core/config/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import fs from 'fs';
2-
import path from 'path';
3-
import * as url from 'url';
1+
import fs from 'node:fs';
2+
import path from 'node:path';
3+
import * as url from 'node:url';
44
import options from './options.js';
55

66
/**

packages/kit/src/core/config/index.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { join } from 'path';
2-
import { fileURLToPath } from 'url';
1+
import { join } from 'node:path';
2+
import { fileURLToPath } from 'node:url';
33
import { test } from 'uvu';
44
import * as assert from 'uvu/assert';
55
import { validate_config, load_config } from './index.js';

0 commit comments

Comments
 (0)