@sveltejs/adapter-vercel 5.9.0 → 5.9.1
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/index.js +19 -8
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -8,6 +8,17 @@ import esbuild from 'esbuild';
|
|
|
8
8
|
import { get_pathname, pattern_to_src } from './utils.js';
|
|
9
9
|
import { VERSION } from '@sveltejs/kit';
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* @template T
|
|
13
|
+
* @template {keyof T} K
|
|
14
|
+
* @typedef {Partial<Omit<T, K>> & Required<Pick<T, K>>} PartialExcept
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* We use a custom `Builder` type here to support the minimum version of SvelteKit.
|
|
19
|
+
* @typedef {PartialExcept<import('@sveltejs/kit').Builder, 'log' | 'rimraf' | 'mkdirp' | 'config' | 'prerendered' | 'routes' | 'createEntries' | 'findServerAssets' | 'generateFallback' | 'generateEnvModule' | 'generateManifest' | 'getBuildDirectory' | 'getClientDirectory' | 'getServerDirectory' | 'getAppPath' | 'writeClient' | 'writePrerendered' | 'writePrerendered' | 'writeServer' | 'copy' | 'compress'>} Builder2_4_0
|
|
20
|
+
*/
|
|
21
|
+
|
|
11
22
|
const name = '@sveltejs/adapter-vercel';
|
|
12
23
|
const INTERNAL = '![-]'; // this name is guaranteed not to conflict with user routes
|
|
13
24
|
|
|
@@ -48,7 +59,7 @@ const plugin = function (defaults = {}) {
|
|
|
48
59
|
|
|
49
60
|
return {
|
|
50
61
|
name,
|
|
51
|
-
|
|
62
|
+
/** @param {Builder2_4_0} builder */
|
|
52
63
|
async adapt(builder) {
|
|
53
64
|
if (!builder.routes) {
|
|
54
65
|
throw new Error(
|
|
@@ -100,8 +111,8 @@ const plugin = function (defaults = {}) {
|
|
|
100
111
|
MANIFEST: './manifest.js'
|
|
101
112
|
}
|
|
102
113
|
});
|
|
103
|
-
if (builder.hasServerInstrumentationFile()) {
|
|
104
|
-
builder.instrument({
|
|
114
|
+
if (builder.hasServerInstrumentationFile?.()) {
|
|
115
|
+
builder.instrument?.({
|
|
105
116
|
entrypoint: `${tmp}/index.js`,
|
|
106
117
|
instrumentation: `${builder.getServerDirectory()}/instrumentation.server.js`
|
|
107
118
|
});
|
|
@@ -182,14 +193,14 @@ const plugin = function (defaults = {}) {
|
|
|
182
193
|
});
|
|
183
194
|
|
|
184
195
|
let instrumentation_result;
|
|
185
|
-
if (builder.hasServerInstrumentationFile()) {
|
|
196
|
+
if (builder.hasServerInstrumentationFile?.()) {
|
|
186
197
|
instrumentation_result = await esbuild.build({
|
|
187
198
|
entryPoints: [`${builder.getServerDirectory()}/instrumentation.server.js`],
|
|
188
199
|
outfile: `${outdir}/instrumentation.server.js`,
|
|
189
200
|
...esbuild_config
|
|
190
201
|
});
|
|
191
202
|
|
|
192
|
-
builder.instrument({
|
|
203
|
+
builder.instrument?.({
|
|
193
204
|
entrypoint: `${outdir}/index.js`,
|
|
194
205
|
instrumentation: `${outdir}/instrumentation.server.js`,
|
|
195
206
|
module: {
|
|
@@ -543,7 +554,7 @@ function write(file, data) {
|
|
|
543
554
|
|
|
544
555
|
// This function is duplicated in adapter-static
|
|
545
556
|
/**
|
|
546
|
-
* @param {
|
|
557
|
+
* @param {Builder2_4_0} builder
|
|
547
558
|
* @param {import('./index.js').Config} config
|
|
548
559
|
* @param {string} dir
|
|
549
560
|
*/
|
|
@@ -658,7 +669,7 @@ function static_vercel_config(builder, config, dir) {
|
|
|
658
669
|
}
|
|
659
670
|
|
|
660
671
|
/**
|
|
661
|
-
* @param {
|
|
672
|
+
* @param {Builder2_4_0} builder
|
|
662
673
|
* @param {string} entry
|
|
663
674
|
* @param {string} dir
|
|
664
675
|
* @param {import('./index.js').ServerlessConfig} config
|
|
@@ -780,7 +791,7 @@ async function create_function_bundle(builder, entry, dir, config) {
|
|
|
780
791
|
|
|
781
792
|
/**
|
|
782
793
|
*
|
|
783
|
-
* @param {
|
|
794
|
+
* @param {Builder2_4_0} builder
|
|
784
795
|
* @param {any} vercel_config
|
|
785
796
|
*/
|
|
786
797
|
function validate_vercel_json(builder, vercel_config) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltejs/adapter-vercel",
|
|
3
|
-
"version": "5.9.
|
|
3
|
+
"version": "5.9.1",
|
|
4
4
|
"description": "A SvelteKit adapter that creates a Vercel app",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adapter",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@types/node": "^18.19.119",
|
|
43
43
|
"typescript": "^5.3.3",
|
|
44
44
|
"vitest": "^3.2.3",
|
|
45
|
-
"@sveltejs/kit": "^2.31.
|
|
45
|
+
"@sveltejs/kit": "^2.31.1"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@sveltejs/kit": "^2.4.0"
|