@@ -201,15 +201,15 @@ export const createCommand = new Command<GlobalContext>()
201201 options . buildMemoryLimit ||
202202 options . region
203203 ) {
204- const org = require ( options . org , "org" ) ;
205- const app = require ( options . app , "app" ) ;
206- const source = require ( options . source , "source" ) ;
204+ const org = required ( options . org , "org" ) ;
205+ const app = required ( options . app , "app" ) ;
206+ const source = required ( options . source , "source" ) ;
207207 let repo : Repo = undefined ;
208208 let appDirectories : WorkspaceDetectionResult ;
209209 if ( source === "github" ) {
210210 repo = {
211- owner : require ( options . owner , "owner" ) ,
212- repo : require ( options . repo , "repo" ) ,
211+ owner : required ( options . owner , "owner" ) ,
212+ repo : required ( options . repo , "repo" ) ,
213213 } ;
214214
215215 const trpcClient = createTrpcClient ( options ) ;
@@ -236,7 +236,7 @@ export const createCommand = new Command<GlobalContext>()
236236
237237 if ( source === "github" ) {
238238 buildDirectory = member ?. path ??
239- require ( options . appDirectory , "app-directory" ) ;
239+ required ( options . appDirectory , "app-directory" ) ;
240240 } else {
241241 buildDirectory = options . appDirectory || "" ;
242242 }
@@ -255,24 +255,24 @@ export const createCommand = new Command<GlobalContext>()
255255 if ( ! buildConfig ) {
256256 const base = {
257257 frameworkPreset : options . frameworkPreset ?? "" as FrameworkPreset ,
258- installCommand : requireUnless (
258+ installCommand : requiredUnless (
259259 options . installCommand ,
260260 options . frameworkPreset ,
261261 "install-command" ,
262262 ) ,
263- buildCommand : requireUnless (
263+ buildCommand : requiredUnless (
264264 options . buildCommand ,
265265 options . frameworkPreset ,
266266 "build-command" ,
267267 ) ,
268- preDeployCommand : requireUnless (
268+ preDeployCommand : requiredUnless (
269269 options . preDeployCommand ,
270270 options . frameworkPreset ,
271271 "pre-deploy-command" ,
272272 ) ,
273273 } ;
274274
275- const runtimeMode = requireUnless (
275+ const runtimeMode = requiredUnless (
276276 options . runtimeMode ,
277277 options . frameworkPreset ,
278278 "runtime-mode" ,
@@ -283,7 +283,7 @@ export const createCommand = new Command<GlobalContext>()
283283 buildConfig = {
284284 ...base ,
285285 mode : "dynamic" as const ,
286- entrypoint : require ( options . entrypoint , "entrypoint" ) ,
286+ entrypoint : required ( options . entrypoint , "entrypoint" ) ,
287287 args : options . arguments ,
288288 cwd : options . workingDirectory ,
289289 } ;
@@ -293,7 +293,7 @@ export const createCommand = new Command<GlobalContext>()
293293 buildConfig = {
294294 ...base ,
295295 mode : "static" as const ,
296- staticDir : require ( options . staticDir , "static-dir" ) ,
296+ staticDir : required ( options . staticDir , "static-dir" ) ,
297297 singlePageApp : options . singlePageApp ?? false ,
298298 } ;
299299 break ;
@@ -305,12 +305,12 @@ export const createCommand = new Command<GlobalContext>()
305305 }
306306 }
307307
308- const buildTimeout = require ( options . buildTimeout , "build-timeout" ) ;
309- const buildMemoryLimit = require (
308+ const buildTimeout = required ( options . buildTimeout , "build-timeout" ) ;
309+ const buildMemoryLimit = required (
310310 options . buildMemoryLimit ,
311311 "build-memory-limit" ,
312312 ) ;
313- const region = require ( options . region , "region" ) ;
313+ const region = required ( options . region , "region" ) ;
314314
315315 console . log ( "Using the following build configuration:" ) ;
316316 console . log ( renderBuildConfig ( buildConfig satisfies BuildConfig ) ) ;
@@ -341,15 +341,15 @@ export const createCommand = new Command<GlobalContext>()
341341 }
342342 } , ( rootPath ) => rootPath ) ) ;
343343
344- function require < T > ( value : T | undefined , option : string ) : T {
344+ function required < T > ( value : T | undefined , option : string ) : T {
345345 if ( value === undefined ) {
346346 throw new ValidationError ( `Missing required option "--${ option } ".` ) ;
347347 } else {
348348 return value ;
349349 }
350350}
351351
352- function requireUnless < T > (
352+ function requiredUnless < T > (
353353 value : T | undefined ,
354354 unless : unknown | undefined ,
355355 option : string ,
0 commit comments