create-twenty-app 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -25
- package/dist/cli.cjs +122 -30
- package/dist/cli.mjs +2480 -2234
- package/dist/constants/base-application/LLMS.md +9 -0
- package/dist/constants/base-application/README.md +18 -13
- package/dist/create-app.command.d.ts +3 -1
- package/dist/types/scaffolding-options.d.ts +10 -0
- package/dist/utils/app-template.d.ts +3 -1
- package/package.json +16 -4
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
## Base documentation
|
|
2
|
+
|
|
3
|
+
- Documentation: https://docs.twenty.com/developers/extend/capabilities/apps
|
|
4
|
+
- Rich app example: https://github.com/twentyhq/twenty/tree/main/packages/twenty-sdk/src/cli/__tests__/apps/rich-app
|
|
5
|
+
|
|
6
|
+
## Common Pitfalls
|
|
7
|
+
|
|
8
|
+
- Creating an object without an index view associated. Unless this is a technical object, user will need to visualize it.
|
|
9
|
+
- Creating a view without a navigationMenuItem associated. This will make the view available on the left sidebar.
|
|
@@ -5,36 +5,41 @@ This is a [Twenty](https://twenty.com) application project bootstrapped with [`c
|
|
|
5
5
|
First, authenticate to your workspace:
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
yarn auth:login
|
|
8
|
+
yarn twenty auth:login
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
Then, start development mode to sync your app and watch for changes:
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
yarn app:dev
|
|
14
|
+
yarn twenty app:dev
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
Open your Twenty instance and go to `/settings/applications` section to see the result.
|
|
18
18
|
|
|
19
19
|
## Available Commands
|
|
20
20
|
|
|
21
|
+
Run `yarn twenty help` to list all available commands. Common commands:
|
|
22
|
+
|
|
21
23
|
```bash
|
|
22
24
|
# Authentication
|
|
23
|
-
yarn auth:login # Authenticate with Twenty
|
|
24
|
-
yarn auth:logout # Remove credentials
|
|
25
|
-
yarn auth:status # Check auth status
|
|
26
|
-
yarn auth:switch # Switch default workspace
|
|
27
|
-
yarn auth:list # List all configured workspaces
|
|
25
|
+
yarn twenty auth:login # Authenticate with Twenty
|
|
26
|
+
yarn twenty auth:logout # Remove credentials
|
|
27
|
+
yarn twenty auth:status # Check auth status
|
|
28
|
+
yarn twenty auth:switch # Switch default workspace
|
|
29
|
+
yarn twenty auth:list # List all configured workspaces
|
|
28
30
|
|
|
29
31
|
# Application
|
|
30
|
-
yarn app:dev # Start dev mode (watch, build, and
|
|
31
|
-
yarn entity:add # Add a new entity (function, front-component,
|
|
32
|
-
yarn
|
|
33
|
-
yarn function:
|
|
34
|
-
yarn
|
|
35
|
-
yarn app:uninstall # Uninstall app from workspace
|
|
32
|
+
yarn twenty app:dev # Start dev mode (watch, build, sync, and auto-generate typed client)
|
|
33
|
+
yarn twenty entity:add # Add a new entity (object, field, function, front-component, role, view, navigation-menu-item)
|
|
34
|
+
yarn twenty function:logs # Stream function logs
|
|
35
|
+
yarn twenty function:execute # Execute a function with JSON payload
|
|
36
|
+
yarn twenty app:uninstall # Uninstall app from workspace
|
|
36
37
|
```
|
|
37
38
|
|
|
39
|
+
## LLMs instructions
|
|
40
|
+
|
|
41
|
+
Main docs and pitfalls are available in LLMS.md file.
|
|
42
|
+
|
|
38
43
|
## Learn More
|
|
39
44
|
|
|
40
45
|
To learn more about Twenty applications, take a look at the following resources:
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { ScaffoldingMode } from './types/scaffolding-options';
|
|
1
2
|
export declare class CreateAppCommand {
|
|
2
|
-
execute(directory?: string): Promise<void>;
|
|
3
|
+
execute(directory?: string, mode?: ScaffoldingMode): Promise<void>;
|
|
3
4
|
private getAppInfos;
|
|
5
|
+
private resolveExampleOptions;
|
|
4
6
|
private validateDirectory;
|
|
5
7
|
private logCreationInfo;
|
|
6
8
|
private logSuccess;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type ScaffoldingMode = 'exhaustive' | 'minimal' | 'interactive';
|
|
2
|
+
export type ExampleOptions = {
|
|
3
|
+
includeExampleObject: boolean;
|
|
4
|
+
includeExampleField: boolean;
|
|
5
|
+
includeExampleLogicFunction: boolean;
|
|
6
|
+
includeExampleFrontComponent: boolean;
|
|
7
|
+
includeExampleView: boolean;
|
|
8
|
+
includeExampleNavigationMenuItem: boolean;
|
|
9
|
+
includeExampleSkill: boolean;
|
|
10
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { ExampleOptions } from '../types/scaffolding-options';
|
|
2
|
+
export declare const copyBaseApplicationProject: ({ appName, appDisplayName, appDescription, appDirectory, exampleOptions, }: {
|
|
2
3
|
appName: string;
|
|
3
4
|
appDisplayName: string;
|
|
4
5
|
appDescription: string;
|
|
5
6
|
appDirectory: string;
|
|
7
|
+
exampleOptions: ExampleOptions;
|
|
6
8
|
}) => Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-twenty-app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Command-line interface to create Twenty application",
|
|
5
5
|
"main": "dist/cli.cjs",
|
|
6
6
|
"bin": "dist/cli.cjs",
|
|
@@ -10,9 +10,7 @@
|
|
|
10
10
|
"package.json"
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
|
-
"build": "npx rimraf dist && npx vite build"
|
|
14
|
-
"prepublishOnly": "tsx ../twenty-utils/pack-scripts/pre-publish-only.ts",
|
|
15
|
-
"postpublish": "tsx ../twenty-utils/pack-scripts/post-publish.ts"
|
|
13
|
+
"build": "npx rimraf dist && npx vite build"
|
|
16
14
|
},
|
|
17
15
|
"keywords": [
|
|
18
16
|
"twenty",
|
|
@@ -40,6 +38,20 @@
|
|
|
40
38
|
"lodash.startcase": "^4.4.0",
|
|
41
39
|
"uuid": "^13.0.0"
|
|
42
40
|
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/fs-extra": "^11.0.0",
|
|
43
|
+
"@types/inquirer": "^9.0.0",
|
|
44
|
+
"@types/lodash.camelcase": "^4.3.7",
|
|
45
|
+
"@types/lodash.kebabcase": "^4.1.7",
|
|
46
|
+
"@types/lodash.startcase": "^4",
|
|
47
|
+
"@types/node": "^20.0.0",
|
|
48
|
+
"twenty-sdk": "workspace:*",
|
|
49
|
+
"twenty-shared": "workspace:*",
|
|
50
|
+
"typescript": "^5.9.2",
|
|
51
|
+
"vite": "^7.0.0",
|
|
52
|
+
"vite-plugin-dts": "^4.5.4",
|
|
53
|
+
"vite-tsconfig-paths": "^4.2.1"
|
|
54
|
+
},
|
|
43
55
|
"engines": {
|
|
44
56
|
"node": "^24.5.0",
|
|
45
57
|
"yarn": "^4.0.2"
|