You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`\nFailed to verify Infrastructure Projects API access: ${message}\nPlease try again.\n`,
308
+
),
309
+
);
310
+
process.exit(1);
311
+
}
312
+
313
+
console.warn(
314
+
colorize(
315
+
'yellow',
316
+
`\nCould not verify Infrastructure Projects API access: ${message}\nDefaulting to self-hosted (Next.js). Re-run create-catalyst if you intended to use Commerce-hosted.\n`,
317
+
),
318
+
);
319
+
320
+
returnnull;
321
+
}
322
+
}
323
+
324
+
asyncfunctionshouldUseCommerceHosting(
325
+
hostingFlag: HostingMode|undefined,
326
+
hasAccess: boolean,
327
+
): Promise<boolean>{
328
+
if(hostingFlag==='commerce')returntrue;
329
+
330
+
if(hostingFlag===undefined&&hasAccess){
331
+
returnselect({
332
+
message: 'How would you like to host your Catalyst storefront?',
333
+
choices: [
334
+
{
335
+
name: 'Self-hosted (Next.js)',
336
+
value: false,
337
+
description: 'Use standard next dev / build / start',
338
+
},
339
+
{
340
+
name: 'Commerce-hosted (Native)',
341
+
value: true,
342
+
description: 'Use catalyst dev / build / deploy',
343
+
},
344
+
],
345
+
});
346
+
}
347
+
348
+
returnfalse;
349
+
}
350
+
351
+
asyncfunctionresolveHostingMode({
352
+
hostingFlag,
353
+
storeHash,
354
+
accessToken,
355
+
cliApiOrigin,
356
+
apiHostname,
357
+
defaultProjectName,
358
+
autoUseProjectName,
359
+
}: {
360
+
hostingFlag?: HostingMode;
361
+
storeHash?: string;
362
+
accessToken?: string;
363
+
cliApiOrigin: string;
364
+
apiHostname: string;
365
+
defaultProjectName?: string;
366
+
autoUseProjectName?: boolean;
367
+
}): Promise<HostingResolution>{
368
+
if(hostingFlag==='self-hosted'){
369
+
return{mode: 'self-hosted'};
370
+
}
371
+
372
+
if(!storeHash||!accessToken){
373
+
if(hostingFlag==='commerce'){
374
+
console.error(
375
+
colorize(
376
+
'red',
377
+
'\n--hosting commerce requires store credentials (store hash and access token)\n',
0 commit comments