Fix path retrieval for twenty apps in twenty-cli (#14818)

## Context

Now should not confuse package.json from non-twenty apps but check if
$schema correctly targets twenty manifest json
<img width="741" height="422" alt="Screenshot 2025-10-01 at 17 34 45"
src="https://github.com/user-attachments/assets/5b9e729e-8634-4eb8-a2a9-4991a63d49f0"
/>
This commit is contained in:
Weiko
2025-10-01 18:11:42 +02:00
committed by GitHub
parent bb0d37d79f
commit d715533a90
7 changed files with 61 additions and 43 deletions
@@ -3,6 +3,10 @@ import {
createBasePackageJson,
createReadmeContent,
} from '../app-template';
import {
AGENT_SCHEMA_URL,
APP_MANIFEST_SCHEMA_URL,
} from '../../constants/schemas';
// Mock crypto.randomUUID to make tests deterministic
jest.mock('crypto', () => ({
@@ -17,8 +21,7 @@ describe('app-template', () => {
const basePackageJson = createBasePackageJson(appName, description);
expect(basePackageJson).toEqual({
$schema:
'https://raw.githubusercontent.com/twentyhq/twenty/main/packages/twenty-cli/schemas/app-manifest.schema.json',
$schema: APP_MANIFEST_SCHEMA_URL,
standardId: 'mocked-uuid-12345',
label: 'My Test App',
description: 'A Twenty application for my-test-app',
@@ -62,8 +65,7 @@ describe('app-template', () => {
const agent = createAgentManifest(appName);
expect(agent).toEqual({
$schema:
'https://raw.githubusercontent.com/twentyhq/twenty/main/packages/twenty-cli/schemas/agent.schema.json',
$schema: AGENT_SCHEMA_URL,
standardId: 'mocked-uuid-12345',
name: 'myTestAppAgent',
label: 'My Test App Agent',