File tree 6 files changed +54
-48
lines changed
6 files changed +54
-48
lines changed Original file line number Diff line number Diff line change @@ -87,9 +87,7 @@ export async function defineConfig(
87
87
const { preset : configDeploymentPreset , ...serverOptions } =
88
88
serverSchema . parse ( opts . server || { } )
89
89
90
- const deploymentPreset = checkDeploymentPresetInput (
91
- configDeploymentPreset || 'node-server' ,
92
- )
90
+ const deploymentPreset = checkDeploymentPresetInput ( configDeploymentPreset )
93
91
const tsr = setTsrDefaults ( opts . tsr )
94
92
const tsrConfig = getConfig ( tsr )
95
93
Original file line number Diff line number Diff line change @@ -80,19 +80,23 @@ const testedDeploymentPresets: Array<DeploymentPreset> = [
80
80
'node-server' ,
81
81
]
82
82
83
- export function checkDeploymentPresetInput ( preset : string ) : DeploymentPreset {
84
- if ( ! vinxiDeploymentPresets . includes ( preset as any ) ) {
85
- console . warn (
86
- `Invalid deployment preset "${ preset } ". Available presets are: ${ vinxiDeploymentPresets
87
- . map ( ( p ) => `"${ p } "` )
88
- . join ( ', ' ) } .`,
89
- )
90
- }
91
-
92
- if ( ! testedDeploymentPresets . includes ( preset as any ) ) {
93
- console . warn (
94
- `The deployment preset '${ preset } ' is not fully supported yet and may not work as expected.` ,
95
- )
83
+ export function checkDeploymentPresetInput (
84
+ preset ?: string ,
85
+ ) : DeploymentPreset | undefined {
86
+ if ( preset ) {
87
+ if ( ! vinxiDeploymentPresets . includes ( preset as any ) ) {
88
+ console . warn (
89
+ `Invalid deployment preset "${ preset } ". Available presets are: ${ vinxiDeploymentPresets
90
+ . map ( ( p ) => `"${ p } "` )
91
+ . join ( ', ' ) } .`,
92
+ )
93
+ }
94
+
95
+ if ( ! testedDeploymentPresets . includes ( preset as any ) ) {
96
+ console . warn (
97
+ `The deployment preset '${ preset } ' is not fully supported yet and may not work as expected.` ,
98
+ )
99
+ }
96
100
}
97
101
98
102
return preset
Original file line number Diff line number Diff line change @@ -87,9 +87,7 @@ export async function defineConfig(
87
87
const { preset : configDeploymentPreset , ...serverOptions } =
88
88
serverSchema . parse ( opts . server || { } )
89
89
90
- const deploymentPreset = checkDeploymentPresetInput (
91
- configDeploymentPreset || 'node-server' ,
92
- )
90
+ const deploymentPreset = checkDeploymentPresetInput ( configDeploymentPreset )
93
91
const tsr = setTsrDefaults ( opts . tsr )
94
92
const tsrConfig = getConfig ( tsr )
95
93
Original file line number Diff line number Diff line change @@ -80,19 +80,23 @@ const testedDeploymentPresets: Array<DeploymentPreset> = [
80
80
'node-server' ,
81
81
]
82
82
83
- export function checkDeploymentPresetInput ( preset : string ) : DeploymentPreset {
84
- if ( ! vinxiDeploymentPresets . includes ( preset as any ) ) {
85
- console . warn (
86
- `Invalid deployment preset "${ preset } ". Available presets are: ${ vinxiDeploymentPresets
87
- . map ( ( p ) => `"${ p } "` )
88
- . join ( ', ' ) } .`,
89
- )
90
- }
91
-
92
- if ( ! testedDeploymentPresets . includes ( preset as any ) ) {
93
- console . warn (
94
- `The deployment preset '${ preset } ' is not fully supported yet and may not work as expected.` ,
95
- )
83
+ export function checkDeploymentPresetInput (
84
+ preset ?: string ,
85
+ ) : DeploymentPreset | undefined {
86
+ if ( preset ) {
87
+ if ( ! vinxiDeploymentPresets . includes ( preset as any ) ) {
88
+ console . warn (
89
+ `Invalid deployment preset "${ preset } ". Available presets are: ${ vinxiDeploymentPresets
90
+ . map ( ( p ) => `"${ p } "` )
91
+ . join ( ', ' ) } .`,
92
+ )
93
+ }
94
+
95
+ if ( ! testedDeploymentPresets . includes ( preset as any ) ) {
96
+ console . warn (
97
+ `The deployment preset '${ preset } ' is not fully supported yet and may not work as expected.` ,
98
+ )
99
+ }
96
100
}
97
101
98
102
return preset
Original file line number Diff line number Diff line change @@ -87,9 +87,7 @@ export async function defineConfig(
87
87
const { preset : configDeploymentPreset , ...serverOptions } =
88
88
serverSchema . parse ( opts . server || { } )
89
89
90
- const deploymentPreset = checkDeploymentPresetInput (
91
- configDeploymentPreset || 'node-server' ,
92
- )
90
+ const deploymentPreset = checkDeploymentPresetInput ( configDeploymentPreset )
93
91
const tsr = setTsrDefaults ( opts . tsr )
94
92
const tsrConfig = getConfig ( tsr )
95
93
Original file line number Diff line number Diff line change @@ -80,19 +80,23 @@ const testedDeploymentPresets: Array<DeploymentPreset> = [
80
80
'node-server' ,
81
81
]
82
82
83
- export function checkDeploymentPresetInput ( preset : string ) : DeploymentPreset {
84
- if ( ! vinxiDeploymentPresets . includes ( preset as any ) ) {
85
- console . warn (
86
- `Invalid deployment preset "${ preset } ". Available presets are: ${ vinxiDeploymentPresets
87
- . map ( ( p ) => `"${ p } "` )
88
- . join ( ', ' ) } .`,
89
- )
90
- }
91
-
92
- if ( ! testedDeploymentPresets . includes ( preset as any ) ) {
93
- console . warn (
94
- `The deployment preset '${ preset } ' is not fully supported yet and may not work as expected.` ,
95
- )
83
+ export function checkDeploymentPresetInput (
84
+ preset ?: string ,
85
+ ) : DeploymentPreset | undefined {
86
+ if ( preset ) {
87
+ if ( ! vinxiDeploymentPresets . includes ( preset as any ) ) {
88
+ console . warn (
89
+ `Invalid deployment preset "${ preset } ". Available presets are: ${ vinxiDeploymentPresets
90
+ . map ( ( p ) => `"${ p } "` )
91
+ . join ( ', ' ) } .`,
92
+ )
93
+ }
94
+
95
+ if ( ! testedDeploymentPresets . includes ( preset as any ) ) {
96
+ console . warn (
97
+ `The deployment preset '${ preset } ' is not fully supported yet and may not work as expected.` ,
98
+ )
99
+ }
96
100
}
97
101
98
102
return preset
You can’t perform that action at this time.
0 commit comments