Add twenty-sdk (#15208)

This commit is contained in:
Weiko
2025-10-20 15:54:08 +02:00
committed by GitHub
parent 7723fa70a4
commit 76c2dc020e
12 changed files with 118 additions and 1 deletions
+5 -1
View File
@@ -53,6 +53,10 @@ export default [
enforceBuildableLibDependency: true,
allow: [],
depConstraints: [
{
sourceTag: 'scope:sdk',
onlyDependOnLibsWithTags: ['scope:sdk'],
},
{
sourceTag: 'scope:shared',
onlyDependOnLibsWithTags: ['scope:shared'],
@@ -123,7 +127,7 @@ export default [
'@typescript-eslint/ban-ts-comment': 'error',
'@typescript-eslint/consistent-type-imports': [
'error',
{
{
prefer: 'type-imports',
fixStyle: 'inline-type-imports'
},
+1
View File
@@ -242,6 +242,7 @@
"packages/twenty-website",
"packages/twenty-e2e-testing",
"packages/twenty-shared",
"packages/twenty-sdk",
"packages/twenty-apps",
"packages/twenty-cli",
"tools/eslint-rules"
+27
View File
@@ -0,0 +1,27 @@
# twenty-sdk
A lightweight TypeScript SDK for Twenty CRM.
## Installation
```bash
npm install twenty-sdk
# or
yarn add twenty-sdk
```
## Usage
```typescript
import { /* your exports */ } from 'twenty-sdk';
```
## Development
```bash
# Build
npx nx build twenty-sdk
# Lint
npx nx lint twenty-sdk
```
+8
View File
@@ -0,0 +1,8 @@
import baseConfig from '../../eslint.config.mjs';
export default [
...baseConfig,
{
ignores: ['**/dist/**', 'vite.config.ts'],
},
];
+19
View File
@@ -0,0 +1,19 @@
{
"name": "twenty-sdk",
"version": "0.0.1",
"license": "AGPL-3.0",
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "vite build"
},
"devDependencies": {
"typescript": "5.9.2",
"vite": "^7.0.0",
"vite-plugin-dts": "3.8.1"
}
}
+17
View File
@@ -0,0 +1,17 @@
{
"name": "twenty-sdk",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/twenty-sdk/src",
"projectType": "library",
"tags": ["scope:sdk"],
"targets": {
"build": {
"outputs": ["{projectRoot}/dist"]
},
"lint": {
"configurations": {
"fix": {}
}
}
}
}
@@ -0,0 +1,2 @@
export { };
+2
View File
@@ -0,0 +1,2 @@
export * from './decorators';
export * from './types';
+1
View File
@@ -0,0 +1 @@
export { };
+9
View File
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"declaration": true,
"outDir": "dist",
"rootDir": "src"
},
"include": ["src/**/*"]
}
+14
View File
@@ -0,0 +1,14 @@
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
export default defineConfig({
build: {
lib: {
entry: 'src/index.ts',
name: 'twenty-sdk',
formats: ['es', 'cjs'],
fileName: (format) => `index.${format === 'es' ? 'mjs' : 'cjs'}`,
},
},
plugins: [dts()],
});
+13
View File
@@ -51699,6 +51699,19 @@ __metadata:
languageName: unknown
linkType: soft
"twenty-sdk@workspace:packages/twenty-sdk":
version: 0.0.0-use.local
resolution: "twenty-sdk@workspace:packages/twenty-sdk"
dependencies:
"@babel/preset-env": "npm:^7.26.9"
"@types/babel__preset-env": "npm:^7"
tsx: "npm:^4.19.3"
vite: "npm:^7.0.0"
vite-plugin-dts: "npm:3.8.1"
vite-tsconfig-paths: "npm:^4.2.1"
languageName: unknown
linkType: soft
"twenty-server@workspace:packages/twenty-server":
version: 0.0.0-use.local
resolution: "twenty-server@workspace:packages/twenty-server"