diff --git a/packages/create-twenty-app/package.json b/packages/create-twenty-app/package.json index 8924923440..d6bd8028a0 100644 --- a/packages/create-twenty-app/package.json +++ b/packages/create-twenty-app/package.json @@ -1,6 +1,6 @@ { "name": "create-twenty-app", - "version": "2.5.1", + "version": "2.6.0", "description": "Command-line interface to create Twenty application", "main": "dist/cli.cjs", "bin": "dist/cli.cjs", diff --git a/packages/create-twenty-app/src/cli.ts b/packages/create-twenty-app/src/cli.ts index e41aa9924a..05026ea2e4 100644 --- a/packages/create-twenty-app/src/cli.ts +++ b/packages/create-twenty-app/src/cli.ts @@ -74,12 +74,17 @@ const program = new Command(packageJson.name) ); } + const workspaceUrl = (options?.workspaceUrl ?? options?.apiUrl)?.replace( + /\/+$/, + '', + ); + await new CreateAppCommand().execute({ directory, name: options?.name, displayName: options?.displayName, description: options?.description, - workspaceUrl: options?.workspaceUrl ?? options?.apiUrl, + workspaceUrl, authenticationMethod: options?.authenticationMethod, }); }, diff --git a/packages/create-twenty-app/src/constants/template/src/front-components/main-page.tsx b/packages/create-twenty-app/src/constants/template/src/front-components/main-page.tsx index 2f1162c0cf..98de444270 100644 --- a/packages/create-twenty-app/src/constants/template/src/front-components/main-page.tsx +++ b/packages/create-twenty-app/src/constants/template/src/front-components/main-page.tsx @@ -1,4 +1,11 @@ import { defineFrontComponent } from 'twenty-sdk/define'; +import { + Avatar, + IconBox, + IconHierarchy, + IconLayout, + IconSettingsAutomation, +} from 'twenty-sdk/ui'; import { useState } from 'react'; import { @@ -30,7 +37,7 @@ const CATEGORIES = [ href: `${DOCS_BASE_URL}/logic/logic-functions`, }, { - label: 'SERVERLESS FUNCT.', + label: 'LOGIC FUNCTION', href: `${DOCS_BASE_URL}/logic/logic-functions`, }, { @@ -59,15 +66,6 @@ const CATEGORIES = [ }, ] as const; -const ItemIcon = ({ color }: { color: string }) => ( - - - - - - -); - const ArrowUpRight = ({ color = '#999' }: { color?: string }) => ( { const [hoveredItem, setHoveredItem] = useState(null); + const CategoryIcon = () => { + if (title === 'Data model') { + return ; + } + if (title === 'Logic') { + return ; + } + if (title === 'Layout') { + return ; + } + }; + return (
+ - + { padding: '40px', }} > - {/**/} + /> { You can now add content to your app. { try { @@ -117,7 +118,7 @@ export const registerRemoteCommands = (program: Command): void => { return; } - let apiUrl = options.apiUrl; + let apiUrl = options.apiUrl ? normalizeUrl(options.apiUrl) : undefined; if (!apiUrl) { const detectedUrl = await detectLocalServer(); @@ -136,24 +137,26 @@ export const registerRemoteCommands = (program: Command): void => { console.log(chalk.gray(`Found local server at ${detectedUrl}`)); apiUrl = detectedUrl; } else { - apiUrl = ( - await inquirer.prompt<{ apiUrl: string }>([ - { - type: 'input', - name: 'apiUrl', - message: 'Twenty server URL:', - validate: (input: string) => { - try { - new URL(input); + apiUrl = normalizeUrl( + ( + await inquirer.prompt<{ apiUrl: string }>([ + { + type: 'input', + name: 'apiUrl', + message: 'Twenty server URL:', + validate: (input: string) => { + try { + new URL(input); - return true; - } catch { - return 'Please enter a valid URL'; - } + return true; + } catch { + return 'Please enter a valid URL'; + } + }, }, - }, - ]) - ).apiUrl; + ]) + ).apiUrl, + ); } }