Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["biomejs.biome"]
}
16 changes: 16 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
{
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.biome": "explicit",
"source.organizeImports.biome": "explicit"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[json]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[jsonc]": {
"editor.defaultFormatter": "biomejs.biome"
}
}
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"javascript": {
"formatter": {
"quoteStyle": "double",
"trailingCommas": "es5",
"trailingCommas": "all",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not writing ES5, let's use modern standards and always use trailing comma.
This will reduce noise in PRs 🙏

"semicolons": "always"
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/cli/commands/agents/pull.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async function pullAgentsAction(): Promise<RunCommandResult> {
{
successMessage: "Agents fetched successfully",
errorMessage: "Failed to fetch agents",
}
},
);

if (remoteAgents.items.length === 0) {
Expand All @@ -36,7 +36,7 @@ async function pullAgentsAction(): Promise<RunCommandResult> {
{
successMessage: "Agent files written successfully",
errorMessage: "Failed to write agent files",
}
},
);

if (written.length > 0) {
Expand All @@ -54,7 +54,7 @@ async function pullAgentsAction(): Promise<RunCommandResult> {
export function getAgentsPullCommand(context: CLIContext): Command {
return new Command("pull")
.description(
"Pull agents from Base44 to local files (replaces all local agent configs)"
"Pull agents from Base44 to local files (replaces all local agent configs)",
)
.action(async () => {
await runCommand(pullAgentsAction, { requireAuth: true }, context);
Expand Down
6 changes: 3 additions & 3 deletions src/cli/commands/agents/push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async function pushAgentsAction(): Promise<RunCommandResult> {
log.info(
agents.length === 0
? "No local agents found - this will delete all remote agents"
: `Found ${agents.length} agents to push`
: `Found ${agents.length} agents to push`,
);

const result = await runTask(
Expand All @@ -23,7 +23,7 @@ async function pushAgentsAction(): Promise<RunCommandResult> {
{
successMessage: "Agents pushed successfully",
errorMessage: "Failed to push agents",
}
},
);

if (result.created.length > 0) {
Expand All @@ -42,7 +42,7 @@ async function pushAgentsAction(): Promise<RunCommandResult> {
export function getAgentsPushCommand(context: CLIContext): Command {
return new Command("push")
.description(
"Push local agents to Base44 (replaces all remote agent configs)"
"Push local agents to Base44 (replaces all remote agent configs)",
)
.action(async () => {
await runCommand(pushAgentsAction, { requireAuth: true }, context);
Expand Down
14 changes: 7 additions & 7 deletions src/cli/commands/auth/login-flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ async function generateAndDisplayDeviceCode(): Promise<DeviceCodeResponse> {
{
successMessage: "Device code generated",
errorMessage: "Failed to generate device code",
}
},
);

log.info(
`Verification code: ${theme.styles.bold(deviceCodeResponse.userCode)}` +
`\nPlease confirm this code at: ${deviceCodeResponse.verificationUri}`
`\nPlease confirm this code at: ${deviceCodeResponse.verificationUri}`,
);

return deviceCodeResponse;
Expand All @@ -38,7 +38,7 @@ async function generateAndDisplayDeviceCode(): Promise<DeviceCodeResponse> {
async function waitForAuthentication(
deviceCode: string,
expiresIn: number,
interval: number
interval: number,
): Promise<TokenResponse> {
let tokenResponse: TokenResponse | undefined;

Expand All @@ -58,13 +58,13 @@ async function waitForAuthentication(
{
interval: interval * 1000,
timeout: expiresIn * 1000,
}
},
);
},
{
successMessage: "Authentication completed!",
errorMessage: "Authentication failed",
}
},
);
} catch (error) {
if (error instanceof Error && error.message.includes("timed out")) {
Expand All @@ -82,7 +82,7 @@ async function waitForAuthentication(

async function saveAuthData(
response: TokenResponse,
userInfo: UserInfoResponse
userInfo: UserInfoResponse,
): Promise<void> {
const expiresAt = Date.now() + response.expiresIn * 1000;

Expand All @@ -105,7 +105,7 @@ export async function login(): Promise<RunCommandResult> {
const token = await waitForAuthentication(
deviceCodeResponse.deviceCode,
deviceCodeResponse.expiresIn,
deviceCodeResponse.interval
deviceCodeResponse.interval,
);

const userInfo = await getUserInfo(token.accessToken);
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/auth/whoami.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function getWhoamiCommand(context: CLIContext): Command {
await runCommand(
whoami,
{ requireAuth: true, requireAppConfig: false },
context
context,
);
});
}
4 changes: 2 additions & 2 deletions src/cli/commands/entities/push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async function pushEntitiesAction(): Promise<RunCommandResult> {
{
successMessage: "Entities pushed successfully",
errorMessage: "Failed to push entities",
}
},
);

// Print the results
Expand All @@ -49,6 +49,6 @@ export function getEntitiesPushCommand(context: CLIContext): Command {
.description("Push local entities to Base44")
.action(async () => {
await runCommand(pushEntitiesAction, { requireAuth: true }, context);
})
}),
);
}
8 changes: 4 additions & 4 deletions src/cli/commands/functions/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async function deployFunctionsAction(): Promise<RunCommandResult> {
}

log.info(
`Found ${functions.length} ${functions.length === 1 ? "function" : "functions"} to deploy`
`Found ${functions.length} ${functions.length === 1 ? "function" : "functions"} to deploy`,
);

const result = await runTask(
Expand All @@ -29,7 +29,7 @@ async function deployFunctionsAction(): Promise<RunCommandResult> {
{
successMessage: "Functions deployed successfully",
errorMessage: "Failed to deploy functions",
}
},
);

if (result.deployed.length > 0) {
Expand Down Expand Up @@ -63,8 +63,8 @@ export function getFunctionsDeployCommand(context: CLIContext): Command {
await runCommand(
deployFunctionsAction,
{ requireAuth: true },
context
context,
);
})
}),
);
}
34 changes: 17 additions & 17 deletions src/cli/commands/project/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function validateNonInteractiveFlags(command: Command): void {
}

async function createInteractive(
options: CreateOptions
options: CreateOptions,
): Promise<RunCommandResult> {
const templates = await listTemplates();
const templateOptions: Option<Template>[] = templates.map((t) => ({
Expand Down Expand Up @@ -97,7 +97,7 @@ async function createInteractive(
},
{
onCancel: onPromptCancel,
}
},
);

return await executeCreate({
Expand All @@ -111,10 +111,10 @@ async function createInteractive(
}

async function createNonInteractive(
options: CreateOptions
options: CreateOptions,
): Promise<RunCommandResult> {
const template = await getTemplateById(
options.template ?? DEFAULT_TEMPLATE_ID
options.template ?? DEFAULT_TEMPLATE_ID,
);

return await executeCreate({
Expand Down Expand Up @@ -160,7 +160,7 @@ async function executeCreate({
{
successMessage: theme.colors.base44Orange("Project created successfully"),
errorMessage: "Failed to create project",
}
},
);

// Set app config in cache for sync access to getDashboardUrl and getAppClient
Expand Down Expand Up @@ -190,10 +190,10 @@ async function executeCreate({
},
{
successMessage: theme.colors.base44Orange(
"Data models pushed successfully"
"Data models pushed successfully",
),
errorMessage: "Failed to push data models",
}
},
);
}
}
Expand Down Expand Up @@ -226,10 +226,10 @@ async function executeCreate({
},
{
successMessage: theme.colors.base44Orange(
"Site deployed successfully"
"Site deployed successfully",
),
errorMessage: "Failed to deploy site",
}
},
);

finalAppUrl = appUrl;
Expand All @@ -251,11 +251,11 @@ async function executeCreate({
},
{
successMessage: theme.colors.base44Orange(
"AI agent skills added successfully"
"AI agent skills added successfully",
),
errorMessage:
"Failed to add AI agent skills - you can add them later with: npx skills add base44/skills",
}
},
);
} catch {
// Skills installation is non-critical (e.g., user may not have git installed)
Expand All @@ -264,15 +264,15 @@ async function executeCreate({
}

log.message(
`${theme.styles.header("Project")}: ${theme.colors.base44Orange(name)}`
`${theme.styles.header("Project")}: ${theme.colors.base44Orange(name)}`,
);
log.message(
`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(projectId))}`
`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(projectId))}`,
);

if (finalAppUrl) {
log.message(
`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`
`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`,
);
}

Expand All @@ -286,7 +286,7 @@ export function getCreateCommand(context: CLIContext): Command {
.option("-p, --path <path>", "Path where to create the project")
.option(
"-t, --template <id>",
"Template ID (e.g., backend-only, backend-and-client)"
"Template ID (e.g., backend-only, backend-and-client)",
)
.option("--deploy", "Build and deploy the site")
.option("--no-skills", "Skip AI agent skills installation")
Expand All @@ -299,13 +299,13 @@ export function getCreateCommand(context: CLIContext): Command {
() =>
createNonInteractive({ name: options.name ?? name, ...options }),
{ requireAuth: true, requireAppConfig: false },
context
context,
);
} else {
await runCommand(
() => createInteractive({ name, ...options }),
{ fullBanner: true, requireAuth: true, requireAppConfig: false },
context
context,
);
}
});
Expand Down
Loading
Loading