Improve twenty deploy cli logs (#20237)
## Before <img width="1074" height="562" alt="image" src="https://github.com/user-attachments/assets/a2fbe902-d34e-40e4-87c9-f344a06fd6ae" /> ## After <img width="1107" height="605" alt="image" src="https://github.com/user-attachments/assets/af78276a-f4c7-42f9-9347-01d562b1a779" />
This commit is contained in:
@@ -93,7 +93,7 @@ export const registerCommands = (program: Command): void => {
|
||||
|
||||
program
|
||||
.command('deploy [appPath]')
|
||||
.description('Build and upload application to a Twenty server')
|
||||
.description("Publish a new version to a Twenty server's registry")
|
||||
.option('-r, --remote <name>', 'Deploy to a specific remote')
|
||||
.action(async (appPath, options) => {
|
||||
await deployCommand.execute({
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import path from 'path';
|
||||
|
||||
import { appBuild } from '@/cli/operations/build';
|
||||
import { appDeploy } from '@/cli/operations/deploy';
|
||||
import { ConfigService } from '@/cli/utilities/config/config-service';
|
||||
import { CURRENT_EXECUTION_DIRECTORY } from '@/cli/utilities/config/current-execution-directory';
|
||||
import { readJson } from '@/cli/utilities/file/fs-utils';
|
||||
import { checkSdkVersionCompatibility } from '@/cli/utilities/version/check-sdk-version-compatibility';
|
||||
import chalk from 'chalk';
|
||||
|
||||
@@ -42,6 +46,17 @@ export class DeployCommand {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log(chalk.green('✓ Deployed successfully'));
|
||||
const packageJson = await readJson<{ name?: string; version?: string }>(
|
||||
path.join(appPath, 'package.json'),
|
||||
).catch(() => undefined);
|
||||
|
||||
const appName = packageJson?.name ?? result.data.name;
|
||||
const appVersion = packageJson?.version ?? 'unknown';
|
||||
const remoteName = ConfigService.getActiveRemote();
|
||||
|
||||
console.log(
|
||||
chalk.green(`\n✓ Published ${appName} v${appVersion} to ${remoteName}\n`),
|
||||
);
|
||||
console.log(' To install deployed application: `yarn twenty install`');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ export type AppDeployOptions = {
|
||||
};
|
||||
|
||||
export type AppDeployResult = {
|
||||
id: string;
|
||||
name: string;
|
||||
universalIdentifier: string;
|
||||
};
|
||||
|
||||
@@ -49,9 +51,7 @@ const innerAppDeploy = async (
|
||||
|
||||
return {
|
||||
success: true,
|
||||
data: {
|
||||
universalIdentifier: uploadResult.data.universalIdentifier,
|
||||
},
|
||||
data: uploadResult.data,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user