Skip to content

Commit bb73cbc

Browse files
authored
1774 extensibility v1 create an exhaustive documentation readme or dedicated section in twenty contributing doc (#16751)
As title <img width="1108" height="894" alt="image" src="https://github.com/user-attachments/assets/e2dc7e12-72e3-4ca3-ac7b-a94de547f82a" />
1 parent 50b0665 commit bb73cbc

25 files changed

Lines changed: 665 additions & 279 deletions

File tree

packages/create-twenty-app/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Create Twenty App is the official scaffolding CLI for building apps on top of [T
2323
- A Twenty workspace and an API key (create one at https://app.twenty.com/settings/api-webhooks)
2424

2525
## Quick start
26+
2627
```bash
2728
npx create-twenty-app@latest my-twenty-app
2829
cd my-twenty-app

packages/create-twenty-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-twenty-app",
3-
"version": "0.2.3",
3+
"version": "0.2.4",
44
"description": "Command-line interface to create Twenty application",
55
"main": "dist/cli.cjs",
66
"bin": "dist/cli.cjs",
Lines changed: 12 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1,137 +1,29 @@
11
import js from '@eslint/js';
2-
import typescriptEslint from '@typescript-eslint/eslint-plugin';
3-
import typescriptParser from '@typescript-eslint/parser';
4-
import importPlugin from 'eslint-plugin-import';
5-
import preferArrowPlugin from 'eslint-plugin-prefer-arrow';
6-
import prettierPlugin from 'eslint-plugin-prettier';
7-
import unusedImportsPlugin from 'eslint-plugin-unused-imports';
2+
import tseslint from 'typescript-eslint';
83

94
export default [
10-
// Base JS rules
5+
// Base JS recommended rules
116
js.configs.recommended,
127

13-
// Global ignores
14-
{
15-
ignores: ['**/node_modules/**', '**/dist/**', '**/coverage/**'],
16-
},
8+
// TypeScript recommended rules
9+
...tseslint.configs.recommended,
1710

18-
// Base config for TS/JS files
1911
{
20-
files: ['**/*.{js,jsx,ts,tsx}'],
12+
files: ['**/*.ts', '**/*.tsx'],
2113
languageOptions: {
22-
ecmaVersion: 'latest',
23-
sourceType: 'module',
24-
},
25-
plugins: {
26-
prettier: prettierPlugin,
27-
import: importPlugin,
28-
'prefer-arrow': preferArrowPlugin,
29-
'unused-imports': unusedImportsPlugin,
30-
},
31-
rules: {
32-
// General rules (aligned with main project)
33-
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
34-
'no-console': [
35-
'warn',
36-
{ allow: ['group', 'groupCollapsed', 'groupEnd'] },
37-
],
38-
'no-control-regex': 0,
39-
'no-debugger': 'error',
40-
'no-duplicate-imports': 'error',
41-
'no-undef': 'off',
42-
'no-unused-vars': 'off',
43-
44-
// Import rules
45-
'import/no-relative-packages': 'error',
46-
'import/no-useless-path-segments': 'error',
47-
'import/no-duplicates': ['error', { considerQueryString: true }],
48-
49-
// Prefer arrow functions
50-
'prefer-arrow/prefer-arrow-functions': [
51-
'error',
52-
{
53-
disallowPrototype: true,
54-
singleReturnOnly: false,
55-
classPropertiesAllowed: false,
56-
},
57-
],
58-
59-
// Unused imports
60-
'unused-imports/no-unused-imports': 'warn',
61-
'unused-imports/no-unused-vars': [
62-
'warn',
63-
{
64-
vars: 'all',
65-
varsIgnorePattern: '^_',
66-
args: 'after-used',
67-
argsIgnorePattern: '^_',
68-
},
69-
],
70-
71-
// Prettier (formatting as lint errors if you want)
72-
'prettier/prettier': 'error',
73-
},
74-
},
75-
76-
// TypeScript-specific configuration
77-
{
78-
files: ['**/*.{ts,tsx}'],
79-
languageOptions: {
80-
parser: typescriptParser,
8114
parserOptions: {
82-
ecmaFeatures: {
83-
jsx: true,
84-
},
15+
project: true,
16+
tsconfigRootDir: import.meta.dirname,
8517
},
8618
},
87-
plugins: {
88-
'@typescript-eslint': typescriptEslint,
89-
},
9019
rules: {
91-
// Turn off base rule and use TS-aware versions
92-
'no-redeclare': 'off',
93-
'@typescript-eslint/no-redeclare': 'error',
94-
95-
'@typescript-eslint/ban-ts-comment': 'error',
96-
'@typescript-eslint/consistent-type-imports': [
97-
'error',
98-
{
99-
prefer: 'type-imports',
100-
fixStyle: 'inline-type-imports',
101-
},
102-
],
103-
'@typescript-eslint/explicit-function-return-type': 'off',
104-
'@typescript-eslint/explicit-module-boundary-types': 'off',
105-
'@typescript-eslint/interface-name-prefix': 'off',
106-
'@typescript-eslint/no-empty-interface': [
107-
'error',
108-
{
109-
allowSingleExtends: true,
110-
},
20+
// Common TypeScript-friendly tweaks
21+
'@typescript-eslint/no-unused-vars': [
22+
'warn',
23+
{ argsIgnorePattern: '^_' },
11124
],
11225
'@typescript-eslint/no-explicit-any': 'off',
113-
'@typescript-eslint/no-empty-function': 'off',
114-
'@typescript-eslint/no-unused-vars': 'off',
115-
},
116-
},
117-
118-
// Test files (Jest)
119-
{
120-
files: ['**/*.spec.@(ts|tsx|js|jsx)', '**/*.test.@(ts|tsx|js|jsx)'],
121-
languageOptions: {
122-
globals: {
123-
jest: true,
124-
describe: true,
125-
it: true,
126-
expect: true,
127-
beforeEach: true,
128-
afterEach: true,
129-
beforeAll: true,
130-
afterAll: true,
131-
},
132-
},
133-
rules: {
134-
'@typescript-eslint/no-non-null-assertion': 'off',
26+
'no-unused-vars': 'off', // handled by TS rule
13527
},
13628
},
13729
];

packages/create-twenty-app/src/utils/app-template.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const createDefaultServerlessFunctionRoleConfig = async ({
100100
appDirectory: string;
101101
defaultServerlessFunctionRoleUniversalIdentifier: string;
102102
}) => {
103-
const content = `import { PermissionFlag, type RoleConfig } from 'twenty-sdk';
103+
const content = `import { type RoleConfig } from 'twenty-sdk';
104104
105105
export const functionRole: RoleConfig = {
106106
universalIdentifier: '${defaultServerlessFunctionRoleUniversalIdentifier}',
@@ -168,13 +168,17 @@ const createPackageJson = async ({
168168
uninstall: 'twenty app uninstall',
169169
help: 'twenty help',
170170
auth: 'twenty auth login',
171+
lint: 'eslint',
172+
'lint-fix': 'eslint --fix',
171173
},
172174
dependencies: {
173-
'twenty-sdk': '0.2.3',
175+
'twenty-sdk': '0.2.4',
174176
},
175177
devDependencies: {
176-
'@types/node': '^24.7.2',
177178
typescript: '^5.9.3',
179+
'@types/node': '^24.7.2',
180+
eslint: '^9.32.0',
181+
'typescript-eslint': '^8.50.0',
178182
},
179183
};
180184

packages/twenty-apps/hello-world/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hello-world",
3-
"version": "0.2.1",
3+
"version": "0.2.2",
44
"license": "MIT",
55
"engines": {
66
"node": "^24.5.0",
@@ -17,7 +17,7 @@
1717
"auth": "twenty auth login"
1818
},
1919
"dependencies": {
20-
"twenty-sdk": "0.2.2"
20+
"twenty-sdk": "0.2.4"
2121
},
2222
"devDependencies": {
2323
"@types/node": "^24.7.2"

packages/twenty-apps/hello-world/src/roles/function-role.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export const functionRole: RoleConfig = {
1212
canBeAssignedToAgents: false,
1313
canBeAssignedToUsers: false,
1414
canBeAssignedToApiKeys: false,
15-
canBeAssignedToApplications: true,
1615
objectPermissions: [
1716
{
1817
objectNameSingular: 'postCard',

packages/twenty-cli/README.md

Lines changed: 1 addition & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,8 @@
11
# Deprecated: twenty-cli
22

3-
This package is deprecated. Please install and use twenty-sdk instead:
3+
This package is deprecated. Please install and use [twenty-sdk](https://www.npmjs.com/package/twenty-sdk) instead:
44

55
```bash
66
npm uninstall twenty-cli
77
npm install -g twenty-sdk
88
```
9-
10-
The command name remains the same: twenty.
11-
12-
A command-line interface to easily scaffold, develop, and publish applications that extend Twenty CRM (now provided by twenty-sdk).
13-
14-
## Requirements
15-
- yarn >= 4.9.2
16-
- an `apiKey`. Go to `https://twenty.com/settings/api-webhooks` to generate one
17-
18-
## Quick example project
19-
20-
```bash
21-
# Authenticate using your apiKey (CLI will prompt for your <apiKey>)
22-
twenty auth login
23-
24-
# Init a new application called hello-world
25-
twenty app init hello-world
26-
27-
# Go to your app
28-
cd hello-world
29-
30-
# Add a serverless function to your application
31-
twenty app add serverlessFunction
32-
33-
# Add a trigger to your serverless function
34-
twenty app add trigger
35-
36-
# Add axios to your application
37-
yarn add axios
38-
39-
# Start dev mode: automatically syncs changes to your Twenty workspace, so you can test new functions/objects instantly.
40-
twenty app dev
41-
42-
# Or use one time sync (also generates SDK automatically)
43-
twenty app sync
44-
45-
# List all available commands
46-
twenty help
47-
```
48-
49-
## Application Structure
50-
51-
Each application in this package follows the standard application structure:
52-
53-
```
54-
app-name/
55-
├── package.json
56-
├── README.md
57-
├── serverlessFunctions # Custom backend logic (runs on demand)
58-
└── ...
59-
```
60-
61-
## Publish your application
62-
63-
Applications are currently stored in twenty/packages/twenty-apps.
64-
65-
You can share your application with all twenty users.
66-
67-
```bash
68-
# pull twenty project
69-
git clone https://github.com/twentyhq/twenty.git
70-
cd twenty
71-
72-
# create a new branch
73-
git checkout -b feature/my-awesome-app
74-
```
75-
76-
- copy your app folder into twenty/packages/twenty-apps
77-
- commit your changes and open a pull request on https://github.com/twentyhq/twenty
78-
79-
```bash
80-
git commit -m "Add new application"
81-
git push
82-
```
83-
84-
Our team reviews contributions for quality, security, and reusability before merging.
85-
86-
## Contributing
87-
88-
- see our [Hacktoberfest 2025 notion page](https://twentycrm.notion.site/Hacktoberfest-27711d8417038037a149d4638a9cc510)
89-
- our [Discord](https://discord.gg/cx5n4Jzs57)

packages/twenty-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "twenty-cli",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "[DEPRECATED] Use twenty-sdk instead: https://www.npmjs.com/package/twenty-sdk",
55
"scripts": {
66
"build": "echo 'use npx nx build'",

0 commit comments

Comments
 (0)