Improve apps (#19256)
- simplify the base application template - remove --exhaustive option and replace by a --example option like in next.js https://nextjs.org/docs/app/api-reference/cli - Fix some bugs and logs - add a post-card app in twenty-apps/examples/
This commit is contained in:
@@ -2,7 +2,7 @@ import { resolve } from 'path';
|
||||
|
||||
const FIXTURES_ROOT = resolve(__dirname, '../../../../../twenty-apps/fixtures');
|
||||
|
||||
export const POSTCARD_APP_PATH = resolve(FIXTURES_ROOT, 'postcard-app');
|
||||
export const RICH_APP_PATH = resolve(FIXTURES_ROOT, 'rich-app');
|
||||
export const MINIMAL_APP_PATH = resolve(FIXTURES_ROOT, 'minimal-app');
|
||||
export const INVALID_APP_PATH = resolve(FIXTURES_ROOT, 'invalid-app');
|
||||
export const FUNCTION_EXECUTE_APP_PATH = resolve(
|
||||
|
||||
+4
-4
@@ -3,13 +3,13 @@ import { existsSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
import { inspect } from 'util';
|
||||
import { runCliCommand } from '@/cli/__tests__/integration/utils/run-cli-command.util';
|
||||
import { POSTCARD_APP_PATH } from '@/cli/__tests__/apps/fixture-paths';
|
||||
import { RICH_APP_PATH } from '@/cli/__tests__/apps/fixture-paths';
|
||||
|
||||
inspect.defaultOptions.depth = 10;
|
||||
|
||||
describe('Application: install delete and reinstall postcard-app', () => {
|
||||
const applicationName = 'postcard-app';
|
||||
const appPath = POSTCARD_APP_PATH;
|
||||
describe('Application: install delete and reinstall rich-app', () => {
|
||||
const applicationName = 'rich-app';
|
||||
const appPath = RICH_APP_PATH;
|
||||
|
||||
beforeAll(async () => {
|
||||
expect(existsSync(appPath)).toBe(true);
|
||||
+5
-5
@@ -1,12 +1,12 @@
|
||||
import { runAppDevInProcess } from '@/cli/__tests__/integration/utils/run-app-dev-in-process.util';
|
||||
import { POSTCARD_APP_PATH } from '@/cli/__tests__/apps/fixture-paths';
|
||||
import { RICH_APP_PATH } from '@/cli/__tests__/apps/fixture-paths';
|
||||
|
||||
import { defineEntitiesTests } from './tests/entities.tests';
|
||||
import { defineManifestTests } from './tests/manifest.tests';
|
||||
|
||||
describe('postcard-app dev', () => {
|
||||
describe('rich-app dev', () => {
|
||||
beforeAll(async () => {
|
||||
const result = await runAppDevInProcess({ appPath: POSTCARD_APP_PATH });
|
||||
const result = await runAppDevInProcess({ appPath: RICH_APP_PATH });
|
||||
|
||||
if (!result.success) {
|
||||
const diagnostics = JSON.stringify(
|
||||
@@ -21,6 +21,6 @@ describe('postcard-app dev', () => {
|
||||
}
|
||||
}, 60000);
|
||||
|
||||
defineManifestTests(POSTCARD_APP_PATH);
|
||||
defineEntitiesTests(POSTCARD_APP_PATH);
|
||||
defineManifestTests(RICH_APP_PATH);
|
||||
defineEntitiesTests(RICH_APP_PATH);
|
||||
});
|
||||
@@ -33,10 +33,11 @@ export const registerCommands = (program: Command): void => {
|
||||
.command('dev [appPath]')
|
||||
.description('Watch and sync local application changes')
|
||||
.option('-v, --verbose', 'Show detailed logs')
|
||||
.option('-d, --debug', 'Show detailed logs (alias for --verbose)')
|
||||
.action(async (appPath, options) => {
|
||||
await devCommand.execute({
|
||||
appPath: formatPath(appPath),
|
||||
verbose: options.verbose,
|
||||
verbose: options.verbose || options.debug,
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@ export { serverStart } from './server-start';
|
||||
export type { ServerStartOptions, ServerStartResult } from './server-start';
|
||||
export { detectLocalServer } from '@/cli/utilities/server/detect-local-server';
|
||||
|
||||
// Config
|
||||
export { ConfigService } from '@/cli/utilities/config/config-service';
|
||||
|
||||
// Shared types and error codes
|
||||
export {
|
||||
APP_ERROR_CODES,
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import { FieldMetadataType, RelationType } from 'twenty-shared/types';
|
||||
import { manifestValidate } from '@/cli/utilities/build/manifest/manifest-validate';
|
||||
|
||||
const validApplication: ApplicationManifest = {
|
||||
universalIdentifier: '4ec0391d-18d5-411c-b2f3-266ddc1c3ef7',
|
||||
universalIdentifier: '8e8ee827-5a0b-46b0-bb63-c13ccd734ac6',
|
||||
displayName: 'Test App',
|
||||
description: 'Test app for Twenty',
|
||||
defaultRoleUniversalIdentifier: '68bb56f3-8300-4cb5-8cc3-8da9ee66f1b2',
|
||||
|
||||
Reference in New Issue
Block a user