Skip to content

Commit a548fa8

Browse files
authored
Merge branch 'master' into client-address
2 parents e5475bc + c3c700f commit a548fa8

File tree

29 files changed

+199
-54
lines changed

29 files changed

+199
-54
lines changed

.changeset/cool-crabs-listen.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+
Allow adapter.adapt to be synchronous

.changeset/early-pants-unite.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+
Make `manifest.mimeTypes` part of the public API

.changeset/long-guests-trade.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+
Allow routes with the same name as fallback components

.changeset/pre.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"brave-toys-joke",
5858
"brave-turkeys-bathe",
5959
"brave-weeks-allow",
60+
"breezy-ears-fetch",
6061
"breezy-games-count",
6162
"breezy-onions-remember",
6263
"breezy-sheep-dress",
@@ -113,6 +114,7 @@
113114
"cold-pants-unite",
114115
"cold-tables-shake",
115116
"cool-bananas-share",
117+
"cool-crabs-listen",
116118
"cool-ducks-cheat",
117119
"cool-hounds-divide",
118120
"cool-spoons-dress",
@@ -148,6 +150,7 @@
148150
"early-clocks-sneeze",
149151
"early-lemons-collect",
150152
"early-news-taste",
153+
"early-pants-unite",
151154
"early-snakes-peel",
152155
"early-wasps-obey",
153156
"eight-birds-run",
@@ -295,6 +298,7 @@
295298
"honest-jars-report",
296299
"honest-singers-guess",
297300
"hot-bags-jump",
301+
"hot-clouds-work",
298302
"hot-dogs-fry",
299303
"hot-keys-walk",
300304
"hot-kings-confess",
@@ -355,6 +359,7 @@
355359
"little-shirts-happen",
356360
"little-tables-decide",
357361
"long-bulldogs-invent",
362+
"long-guests-trade",
358363
"long-hotels-hunt",
359364
"long-moles-fold",
360365
"loud-dancers-cough",
@@ -657,6 +662,7 @@
657662
"spotty-parents-love",
658663
"spotty-ties-love",
659664
"spotty-timers-fix",
665+
"stale-crabs-carry",
660666
"stale-dodos-type",
661667
"stale-geckos-call",
662668
"stale-glasses-brake",
@@ -701,6 +707,7 @@
701707
"tasty-cars-love",
702708
"tasty-donkeys-wait",
703709
"tasty-islands-drive",
710+
"tasty-squids-share",
704711
"ten-hairs-perform",
705712
"ten-mice-kneel",
706713
"ten-plants-sleep",
@@ -817,6 +824,7 @@
817824
"wild-pumas-jam",
818825
"wise-bees-juggle",
819826
"wise-bugs-run",
827+
"wise-pens-ring",
820828
"wise-rules-cry",
821829
"witty-bottles-press",
822830
"witty-eyes-relax",

.changeset/stale-crabs-carry.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+
load hooks after server initialisation, to ensure `prerendering` is correct

.changeset/stale-dogs-rule.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+
Return 404 when fetching missing data during prerender

.changeset/tasty-squids-share.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/adapter-auto': patch
3+
---
4+
5+
Select adapter immediately

.changeset/wise-pens-ring.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'create-svelte': patch
3+
---
4+
5+
[fix] check for app.d.ts rather than global.d.ts

packages/adapter-auto/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# @sveltejs/adapter-auto
22

3+
## 1.0.0-next.32
4+
5+
### Patch Changes
6+
7+
- Select adapter immediately ([#4299](https://github.com/sveltejs/kit/pull/4299))
8+
9+
- Updated dependencies []:
10+
- @sveltejs/adapter-netlify@1.0.0-next.50
11+
- @sveltejs/adapter-vercel@1.0.0-next.46
12+
313
## 1.0.0-next.31
414

515
### Patch Changes

packages/adapter-auto/index.js

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,52 @@
11
import { adapters } from './adapters.js';
22

3-
/** @type {import('.')} **/
4-
export default function () {
5-
return {
6-
name: '@sveltejs/adapter-auto',
3+
/** @type {import('./index')} */
4+
let fn;
5+
6+
for (const candidate of adapters) {
7+
if (candidate.test()) {
8+
/** @type {{ default: () => import('@sveltejs/kit').Adapter }} */
9+
let module;
710

8-
async adapt(builder) {
9-
for (const candidate of adapters) {
10-
if (candidate.test()) {
11-
builder.log.info(`Detected environment: ${candidate.name}. Using ${candidate.module}`);
12-
13-
let module;
14-
15-
try {
16-
module = await import(candidate.module);
17-
} catch (error) {
18-
if (
19-
error.code === 'ERR_MODULE_NOT_FOUND' &&
20-
error.message.startsWith(`Cannot find package '${candidate.module}'`)
21-
) {
22-
throw new Error(
23-
`It looks like ${candidate.module} is not installed. Please install it and try building your project again.`
24-
);
25-
}
26-
27-
throw error;
11+
try {
12+
module = await import(candidate.module);
13+
14+
fn = () => {
15+
const adapter = module.default();
16+
return {
17+
...adapter,
18+
adapt: (builder) => {
19+
builder.log.info(`Detected environment: ${candidate.name}. Using ${candidate.module}`);
20+
return adapter.adapt(builder);
2821
}
22+
};
23+
};
2924

30-
const adapter = module.default();
31-
return adapter.adapt(builder);
32-
}
25+
break;
26+
} catch (error) {
27+
if (
28+
error.code === 'ERR_MODULE_NOT_FOUND' &&
29+
error.message.startsWith(`Cannot find package '${candidate.module}'`)
30+
) {
31+
throw new Error(
32+
`It looks like ${candidate.module} is not installed. Please install it and try building your project again.`
33+
);
3334
}
3435

36+
throw error;
37+
}
38+
}
39+
}
40+
41+
if (!fn) {
42+
fn = () => ({
43+
name: '@sveltejs/adapter-auto',
44+
adapt: (builder) => {
3545
builder.log.warn(
3646
'Could not detect a supported production environment. See https://kit.svelte.dev/docs/adapters to learn how to configure your app to run on the platform of your choosing'
3747
);
3848
}
39-
};
49+
});
4050
}
51+
52+
export default fn;

0 commit comments

Comments
 (0)