Add twenty-sdk (#15208)
This commit is contained in:
+5
-1
@@ -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'
|
||||
},
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
```
|
||||
@@ -0,0 +1,8 @@
|
||||
import baseConfig from '../../eslint.config.mjs';
|
||||
|
||||
export default [
|
||||
...baseConfig,
|
||||
{
|
||||
ignores: ['**/dist/**', 'vite.config.ts'],
|
||||
},
|
||||
];
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
@@ -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 { };
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
export * from './decorators';
|
||||
export * from './types';
|
||||
@@ -0,0 +1 @@
|
||||
export { };
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"outDir": "dist",
|
||||
"rootDir": "src"
|
||||
},
|
||||
"include": ["src/**/*"]
|
||||
}
|
||||
@@ -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()],
|
||||
});
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user