Fix twenty cli (#15997)

As title

fixes "app add" and "app init" commands
adds tests
This commit is contained in:
martmull
2025-11-21 19:21:30 +01:00
committed by GitHub
parent 3b5949ec3c
commit aa5d30a911
22 changed files with 201 additions and 696 deletions
@@ -1,7 +1,13 @@
import kebabCase from 'lodash.kebabcase';
import { v4 } from 'uuid';
export const getServerlessFunctionBaseFile = ({ name }: { name: string }) => {
export const getServerlessFunctionBaseFile = ({
name,
universalIdentifier = v4(),
}: {
name: string;
universalIdentifier?: string;
}) => {
const kebabCaseName = kebabCase(name);
return `import { type ServerlessFunctionConfig } from 'twenty-sdk/application';
@@ -20,7 +26,7 @@ export const main = async (params: {
};
export const config: ServerlessFunctionConfig = {
universalIdentifier: '${v4()}',
universalIdentifier: '${universalIdentifier}',
name: '${kebabCaseName}',
timeoutSeconds: 5,
};