@@ -41,7 +41,7 @@ import {
4141} from "./lib/utils/utils.js" ;
4242import { writeConvexUrlToEnvFile } from "./lib/envvars.js" ;
4343import path from "path" ;
44- import { projectDashboardUrl } from "./dashboard.js" ;
44+ import { projectDashboardUrl } from "./lib/ dashboard.js" ;
4545import { doCodegen , doInitCodegen } from "./lib/codegen.js" ;
4646import { handleLocalDeployment } from "./lib/localDeployment/localDeployment.js" ;
4747import {
@@ -54,6 +54,7 @@ import {
5454 DeploymentSelection ,
5555 ProjectSelection ,
5656 deploymentNameFromSelection ,
57+ shouldAllowTryItOut ,
5758} from "./lib/deploymentSelection.js" ;
5859import { ensureLoggedIn } from "./lib/login.js" ;
5960import { handleTryItOutDeployment } from "./lib/localDeployment/tryitout.js" ;
@@ -260,21 +261,47 @@ export async function _deploymentCredentialsOrConfigure(
260261 cmdOptions ,
261262 ) ;
262263 }
263- const result = await handleTryItOutDeployment ( ctx , {
264+ const shouldPromptForLogin =
265+ deploymentSelection . deploymentName !== null
266+ ? "no"
267+ : await promptOptions ( ctx , {
268+ message :
269+ "Welcome to Convex! Would you like to login to your account?" ,
270+ choices : [
271+ {
272+ name : "Start without an account (run Convex locally)" ,
273+ value : "no" ,
274+ } ,
275+ { name : "Login or create an account" , value : "yes" } ,
276+ ] ,
277+ default : "no" ,
278+ } ) ;
279+ if ( shouldPromptForLogin === "no" ) {
280+ const result = await handleTryItOutDeployment ( ctx , {
281+ chosenConfiguration,
282+ deploymentName : deploymentSelection . deploymentName ,
283+ ...cmdOptions . localOptions ,
284+ } ) ;
285+ return {
286+ adminKey : result . adminKey ,
287+ url : result . deploymentUrl ,
288+ deploymentFields : {
289+ deploymentName : result . deploymentName ,
290+ deploymentType : "tryitout" ,
291+ projectSlug : null ,
292+ teamSlug : null ,
293+ } ,
294+ } ;
295+ }
296+ return await handleChooseProject (
297+ ctx ,
264298 chosenConfiguration ,
265- deploymentName : deploymentSelection . deploymentName ,
266- ...cmdOptions . localOptions ,
267- } ) ;
268- return {
269- adminKey : result . adminKey ,
270- url : result . deploymentUrl ,
271- deploymentFields : {
272- deploymentName : result . deploymentName ,
273- deploymentType : "tryitout" ,
274- projectSlug : null ,
275- teamSlug : null ,
299+ {
300+ globallyForceCloud,
301+ partitionId,
276302 } ,
277- } ;
303+ cmdOptions ,
304+ ) ;
278305 }
279306 }
280307}
@@ -296,9 +323,10 @@ async function handleDeploymentWithinProject(
296323 } ,
297324) {
298325 const hasAuth = ctx . bigBrainAuth ( ) !== null ;
299- const loginMessage = hasAuth
300- ? undefined
301- : `Tip: You can try out Convex without creating an account by clearing the ${ CONVEX_DEPLOYMENT_ENV_VAR_NAME } environment variable.` ;
326+ const loginMessage =
327+ hasAuth && shouldAllowTryItOut ( )
328+ ? undefined
329+ : `Tip: You can try out Convex without creating an account by clearing the ${ CONVEX_DEPLOYMENT_ENV_VAR_NAME } environment variable.` ;
302330 await ensureLoggedIn ( ctx , {
303331 message : loginMessage ,
304332 overrideAuthUrl : cmdOptions . overrideAuthUrl ,
@@ -753,6 +781,7 @@ export async function updateEnvAndConfigForDeploymentSelection(
753781 } ) ;
754782 await finalizeConfiguration ( ctx , {
755783 deploymentType : options . deploymentType ,
784+ deploymentName : options . deploymentName ,
756785 url : options . url ,
757786 wroteToGitIgnore,
758787 changedDeploymentEnvVar,
0 commit comments