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
@@ -1,6 +1,11 @@
import Ajv from 'ajv';
import * as fs from 'fs-extra';
import * as path from 'path';
import {
AGENT_SCHEMA_URL,
APP_MANIFEST_SCHEMA_URL,
OBJECT_SCHEMA_URL,
} from '../constants/schemas';
export class SchemaValidationError extends Error {
constructor(
@@ -66,11 +71,8 @@ export const validateSchema = async (
export const getSchemaUrls = () => {
return {
agent:
'https://raw.githubusercontent.com/twentyhq/twenty/main/packages/twenty-cli/schemas/agent.schema.json',
object:
'https://raw.githubusercontent.com/twentyhq/twenty/main/packages/twenty-cli/schemas/object.schema.json',
appManifest:
'https://raw.githubusercontent.com/twentyhq/twenty/main/packages/twenty-cli/schemas/app-manifest.schema.json',
agent: AGENT_SCHEMA_URL,
object: OBJECT_SCHEMA_URL,
appManifest: APP_MANIFEST_SCHEMA_URL,
};
};