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:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "create-twenty-app",
|
||||
"version": "2.2.0",
|
||||
"version": "2.3.0",
|
||||
"description": "Command-line interface to create Twenty application",
|
||||
"main": "dist/cli.cjs",
|
||||
"bin": "dist/cli.cjs",
|
||||
|
||||
@@ -60,9 +60,20 @@ If you're working on this app rather than installing the published version:
|
||||
|
||||
```bash
|
||||
cd packages/twenty-apps/internal/twenty-linear
|
||||
|
||||
# For day-to-day development (publish + install + watch in one):
|
||||
yarn twenty dev
|
||||
|
||||
# Manual publish flow (deploy registers the app, install activates it):
|
||||
yarn twenty deploy
|
||||
yarn twenty install
|
||||
```
|
||||
|
||||
`twenty dev` is recommended for iteration — it publishes, installs, and
|
||||
watches for changes in one command. Use `twenty deploy` + `twenty install`
|
||||
when you want to control each step separately (e.g. deploying to a
|
||||
production server without auto-installing).
|
||||
|
||||
This serves as the reference implementation for Twenty's
|
||||
`defineConnectionProvider({ type: 'oauth' })` flow — useful as a template
|
||||
when adding OAuth integrations for other providers.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "twenty-client-sdk",
|
||||
"version": "2.2.0",
|
||||
"version": "2.3.0",
|
||||
"sideEffects": false,
|
||||
"license": "AGPL-3.0",
|
||||
"scripts": {
|
||||
|
||||
@@ -88,7 +88,7 @@ yarn twenty dev --verbose
|
||||
```
|
||||
|
||||
<Warning>
|
||||
Dev mode is only available on Twenty instances running in development (`NODE_ENV=development`). Production instances reject dev sync requests. Use `yarn twenty deploy` to deploy to production servers — see [Publishing Apps](/developers/extend/apps/publishing) for details.
|
||||
Dev mode is only available on Twenty instances running in development (`NODE_ENV=development`). Production instances reject dev sync requests. Use `yarn twenty deploy` followed by `yarn twenty install` to publish and install on production servers — `deploy` publishes to the application registry, while `install` installs it on a given workspace. See [Publishing Apps](/developers/extend/apps/publishing) for details.
|
||||
</Warning>
|
||||
|
||||
<div style={{textAlign: 'center'}}>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "twenty-sdk",
|
||||
"version": "2.2.0",
|
||||
"version": "2.3.0",
|
||||
"sideEffects": false,
|
||||
"bin": {
|
||||
"twenty": "dist/cli.cjs"
|
||||
|
||||
@@ -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