🚧 Use TS project references

This commit is contained in:
Baptiste Arnaud
2024-08-28 18:09:35 +02:00
parent 0c7d2afd51
commit fdd6cc6fee
627 changed files with 3043 additions and 1696 deletions

View File

@@ -2,17 +2,14 @@
"name": "@typebot.io/anthropic-block",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"keywords": [],
"author": "Enchatted P.C.",
"license": "AGPL-3.0-or-later",
"devDependencies": {
"@typebot.io/forge": "workspace:*",
"@typebot.io/lib": "workspace:*",
"@typebot.io/tsconfig": "workspace:*",
"@types/node": "20.4.2",
"@types/react": "18.2.15",
"typescript": "5.4.5"
"@types/react": "18.3.4"
},
"dependencies": {
"@ai-sdk/anthropic": "0.0.30",

View File

@@ -1,11 +1,23 @@
{
"extends": "@typebot.io/tsconfig/base.json",
"extends": "../../../tsconfig/base.json",
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"],
"compilerOptions": {
"lib": ["ESNext", "DOM"],
"noEmit": true,
"jsx": "preserve",
"jsxImportSource": "react"
}
"jsxImportSource": "react",
"outDir": "dist"
},
"references": [
{
"path": "../../../ai"
},
{
"path": "../../../lib"
},
{
"path": "../../core"
},
{
"path": "../openai"
}
]
}

View File

@@ -2,14 +2,11 @@
"name": "@typebot.io/cal-com-block",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"keywords": [],
"license": "AGPL-3.0-or-later",
"devDependencies": {
"@typebot.io/forge": "workspace:*",
"@typebot.io/tsconfig": "workspace:*",
"@types/react": "18.2.15",
"typescript": "5.4.5",
"@typebot.io/lib": "workspace:*"
"@typebot.io/lib": "workspace:*",
"@types/react": "18.3.4"
}
}
}

View File

@@ -1,11 +1,17 @@
{
"extends": "@typebot.io/tsconfig/base.json",
"extends": "../../../tsconfig/base.json",
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"],
"compilerOptions": {
"lib": ["ESNext", "DOM"],
"noEmit": true,
"jsx": "preserve",
"jsxImportSource": "react"
}
"jsxImportSource": "react",
"outDir": "dist"
},
"references": [
{
"path": "../../../lib"
},
{
"path": "../../core"
}
]
}

View File

@@ -2,15 +2,12 @@
"name": "@typebot.io/chat-node-block",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"keywords": [],
"license": "AGPL-3.0-or-later",
"devDependencies": {
"@typebot.io/forge": "workspace:*",
"@typebot.io/lib": "workspace:*",
"@typebot.io/tsconfig": "workspace:*",
"@types/react": "18.2.15",
"typescript": "5.4.5",
"@types/react": "18.3.4",
"ky": "1.2.4"
}
}
}

View File

@@ -1,11 +1,17 @@
{
"extends": "@typebot.io/tsconfig/base.json",
"extends": "../../../tsconfig/base.json",
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"],
"compilerOptions": {
"lib": ["ESNext", "DOM"],
"noEmit": true,
"jsx": "preserve",
"jsxImportSource": "react"
}
"jsxImportSource": "react",
"outDir": "dist"
},
"references": [
{
"path": "../../../lib"
},
{
"path": "../../core"
}
]
}

View File

@@ -2,16 +2,13 @@
"name": "@typebot.io/dify-ai-block",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"keywords": [],
"license": "AGPL-3.0-or-later",
"devDependencies": {
"@typebot.io/forge": "workspace:*",
"@typebot.io/lib": "workspace:*",
"@typebot.io/tsconfig": "workspace:*",
"@types/react": "18.2.15",
"ky": "1.2.4",
"typescript": "5.4.5"
"@types/react": "18.3.4",
"ky": "1.2.4"
},
"dependencies": {
"ai": "3.3.15"

View File

@@ -1,11 +1,17 @@
{
"extends": "@typebot.io/tsconfig/base.json",
"extends": "../../../tsconfig/base.json",
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"],
"compilerOptions": {
"lib": ["ESNext", "DOM"],
"noEmit": true,
"jsx": "preserve",
"jsxImportSource": "react"
}
"jsxImportSource": "react",
"outDir": "dist"
},
"references": [
{
"path": "../../../lib"
},
{
"path": "../../core"
}
]
}

View File

@@ -2,18 +2,15 @@
"name": "@typebot.io/elevenlabs-block",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"keywords": [],
"license": "AGPL-3.0-or-later",
"devDependencies": {
"@typebot.io/forge": "workspace:*",
"@typebot.io/lib": "workspace:*",
"@typebot.io/tsconfig": "workspace:*",
"@types/react": "18.2.15",
"typescript": "5.4.5"
"@types/react": "18.3.4"
},
"dependencies": {
"ky": "1.2.4",
"@typebot.io/lib": "workspace:*"
"@typebot.io/lib": "workspace:*",
"ky": "1.2.4"
}
}
}

View File

@@ -1,11 +1,17 @@
{
"extends": "@typebot.io/tsconfig/base.json",
"extends": "../../../tsconfig/base.json",
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"],
"compilerOptions": {
"lib": ["ESNext", "DOM"],
"noEmit": true,
"jsx": "preserve",
"jsxImportSource": "react"
}
"jsxImportSource": "react",
"outDir": "dist"
},
"references": [
{
"path": "../../../lib"
},
{
"path": "../../core"
}
]
}

View File

@@ -2,16 +2,13 @@
"name": "@typebot.io/groq-block",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"keywords": [],
"license": "AGPL-3.0-or-later",
"devDependencies": {
"@typebot.io/forge": "workspace:*",
"@typebot.io/lib": "workspace:*",
"@typebot.io/openai-block": "workspace:*",
"@typebot.io/tsconfig": "workspace:*",
"@types/react": "18.2.15",
"typescript": "5.4.5"
"@types/react": "18.3.4"
},
"dependencies": {
"ky": "1.2.4"

View File

@@ -1,11 +1,20 @@
{
"extends": "@typebot.io/tsconfig/base.json",
"extends": "../../../tsconfig/base.json",
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"],
"compilerOptions": {
"lib": ["ESNext", "DOM"],
"noEmit": true,
"jsx": "preserve",
"jsxImportSource": "react"
}
"jsxImportSource": "react",
"outDir": "dist"
},
"references": [
{
"path": "../../../lib"
},
{
"path": "../../core"
},
{
"path": "../openai"
}
]
}

View File

@@ -2,16 +2,13 @@
"name": "@typebot.io/mistral-block",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"keywords": [],
"license": "AGPL-3.0-or-later",
"devDependencies": {
"@typebot.io/forge": "workspace:*",
"@typebot.io/lib": "workspace:*",
"@typebot.io/tsconfig": "workspace:*",
"@types/node": "20.4.2",
"@types/react": "18.2.15",
"typescript": "5.4.5"
"@types/react": "18.3.4"
},
"dependencies": {
"@ai-sdk/mistral": "0.0.22",

View File

@@ -1,11 +1,23 @@
{
"extends": "@typebot.io/tsconfig/base.json",
"extends": "../../../tsconfig/base.json",
"include": ["**/*.ts", "**/*.tsx", "helpers/client.ts"],
"exclude": ["node_modules"],
"compilerOptions": {
"lib": ["ESNext", "DOM"],
"noEmit": true,
"jsx": "preserve",
"jsxImportSource": "react"
}
"jsxImportSource": "react",
"outDir": "dist"
},
"references": [
{
"path": "../../../ai"
},
{
"path": "../../../lib"
},
{
"path": "../../core"
},
{
"path": "../openai"
}
]
}

View File

@@ -2,17 +2,14 @@
"name": "@typebot.io/nocodb-block",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"keywords": [],
"license": "AGPL-3.0-or-later",
"devDependencies": {
"@typebot.io/forge": "workspace:*",
"@typebot.io/lib": "workspace:*",
"@typebot.io/tsconfig": "workspace:*",
"@types/react": "18.2.15",
"typescript": "5.4.5"
"@types/react": "18.3.4"
},
"dependencies": {
"ky": "1.2.4"
}
}
}

View File

@@ -1,11 +1,17 @@
{
"extends": "@typebot.io/tsconfig/base.json",
"extends": "../../../tsconfig/base.json",
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"],
"compilerOptions": {
"lib": ["ESNext", "DOM"],
"noEmit": true,
"jsx": "preserve",
"jsxImportSource": "react"
}
"jsxImportSource": "react",
"outDir": "dist"
},
"references": [
{
"path": "../../../lib"
},
{
"path": "../../core"
}
]
}

View File

@@ -2,16 +2,13 @@
"name": "@typebot.io/open-router-block",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"keywords": [],
"license": "AGPL-3.0-or-later",
"devDependencies": {
"@typebot.io/forge": "workspace:*",
"@typebot.io/tsconfig": "workspace:*",
"@types/react": "18.2.15",
"typescript": "5.4.5",
"@typebot.io/lib": "workspace:*",
"@typebot.io/openai-block": "workspace:*",
"@types/react": "18.3.4",
"ky": "1.2.4"
}
}
}

View File

@@ -1,11 +1,20 @@
{
"extends": "@typebot.io/tsconfig/base.json",
"extends": "../../../tsconfig/base.json",
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"],
"compilerOptions": {
"lib": ["ESNext", "DOM"],
"noEmit": true,
"jsx": "preserve",
"jsxImportSource": "react"
}
"jsxImportSource": "react",
"outDir": "dist"
},
"references": [
{
"path": "../../../lib"
},
{
"path": "../../core"
},
{
"path": "../openai"
}
]
}

View File

@@ -1,10 +1,8 @@
import { option, createAction } from '@typebot.io/forge'
import { defaultOpenAIOptions } from '../constants'
import OpenAI, { ClientOptions, toFile } from 'openai'
import OpenAI, { ClientOptions } from 'openai'
import { isNotEmpty } from '@typebot.io/lib'
import { auth } from '../auth'
import { baseOptions } from '../baseOptions'
import ky from 'ky'
export const createTranscription = createAction({
name: 'Create transcription',

View File

@@ -2,7 +2,6 @@
"name": "@typebot.io/openai-block",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"keywords": [],
"author": "Baptiste Arnaud",
"license": "AGPL-3.0-or-later",
@@ -15,10 +14,8 @@
"devDependencies": {
"@typebot.io/forge": "workspace:*",
"@typebot.io/lib": "workspace:*",
"@typebot.io/tsconfig": "workspace:*",
"@typebot.io/variables": "workspace:*",
"@types/react": "18.2.15",
"ky": "1.2.4",
"typescript": "5.4.5"
"@types/react": "18.3.4",
"ky": "1.2.4"
}
}

View File

@@ -1,4 +1,4 @@
import { AsyncVariableStore, VariableStore } from '@typebot.io/forge/types'
import { AsyncVariableStore } from '@typebot.io/forge/types'
import { ChatCompletionOptions } from './parseChatCompletionOptions'
import { APICallError, streamText, ToolCallPart, ToolResultPart } from 'ai'
import { createOpenAI } from '@ai-sdk/openai'

View File

@@ -1,11 +1,26 @@
{
"extends": "@typebot.io/tsconfig/base.json",
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"],
"extends": "../../../tsconfig/base.json",
"include": [
"**/*.ts",
"**/*.tsx"
],
"compilerOptions": {
"lib": ["ESNext", "DOM"],
"noEmit": true,
"jsx": "preserve",
"jsxImportSource": "react"
}
"jsxImportSource": "react",
"outDir": "dist"
},
"references": [
{
"path": "../../../ai"
},
{
"path": "../../../lib"
},
{
"path": "../../../variables"
},
{
"path": "../../core"
}
]
}

View File

@@ -2,18 +2,15 @@
"name": "@typebot.io/qrcode-block",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"keywords": [],
"license": "AGPL-3.0-or-later",
"devDependencies": {
"@typebot.io/forge": "workspace:*",
"@typebot.io/lib": "workspace:*",
"@typebot.io/tsconfig": "workspace:*",
"@types/react": "18.2.15",
"@types/qrcode": "^1.5.3",
"typescript": "5.4.5"
"@types/react": "18.3.4"
},
"dependencies": {
"qrcode": "^1.5.3"
}
}
}

View File

@@ -1,11 +1,17 @@
{
"extends": "@typebot.io/tsconfig/base.json",
"extends": "../../../tsconfig/base.json",
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"],
"compilerOptions": {
"lib": ["ESNext", "DOM"],
"noEmit": true,
"jsx": "preserve",
"jsxImportSource": "react"
}
"jsxImportSource": "react",
"outDir": "dist"
},
"references": [
{
"path": "../../../lib"
},
{
"path": "../../core"
}
]
}

View File

@@ -2,15 +2,12 @@
"name": "@typebot.io/segment-block",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"keywords": [],
"license": "AGPL-3.0-or-later",
"devDependencies": {
"@typebot.io/forge": "workspace:*",
"@typebot.io/lib": "workspace:*",
"@typebot.io/tsconfig": "workspace:*",
"@types/react": "18.2.15",
"typescript": "5.4.5"
"@types/react": "18.3.4"
},
"dependencies": {
"@segment/analytics-node": "^2.1.2"

View File

@@ -1,11 +1,17 @@
{
"extends": "@typebot.io/tsconfig/base.json",
"extends": "../../../tsconfig/base.json",
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"],
"compilerOptions": {
"lib": ["ESNext", "DOM"],
"noEmit": true,
"jsx": "preserve",
"jsxImportSource": "react"
}
"jsxImportSource": "react",
"outDir": "dist"
},
"references": [
{
"path": "../../../lib"
},
{
"path": "../../core"
}
]
}

View File

@@ -2,16 +2,13 @@
"name": "@typebot.io/together-ai-block",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"keywords": [],
"license": "AGPL-3.0-or-later",
"devDependencies": {
"@typebot.io/forge": "workspace:*",
"@typebot.io/lib": "workspace:*",
"@typebot.io/tsconfig": "workspace:*",
"@typebot.io/variables": "workspace:*",
"@typebot.io/openai-block": "workspace:*",
"@types/react": "18.2.15",
"typescript": "5.4.5"
"@typebot.io/variables": "workspace:*",
"@types/react": "18.3.4"
}
}
}

View File

@@ -1,11 +1,26 @@
{
"extends": "@typebot.io/tsconfig/base.json",
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"],
"extends": "../../../tsconfig/base.json",
"include": [
"**/*.ts",
"**/*.tsx"
],
"compilerOptions": {
"lib": ["ESNext", "DOM"],
"noEmit": true,
"jsx": "preserve",
"jsxImportSource": "react"
}
"jsxImportSource": "react",
"outDir": "dist"
},
"references": [
{
"path": "../../../lib"
},
{
"path": "../../../variables"
},
{
"path": "../../core"
},
{
"path": "../openai"
}
]
}

View File

@@ -161,7 +161,7 @@ export const ${camelCaseName}Block = createBlock({
const createPackageJson = async (path: string, { id }: { id: unknown }) => {
writeFileSync(
join(path, 'package.json'),
await prettier.format(
prettier.format(
JSON.stringify({
name: `@typebot.io/${id}-block`,
version: '1.0.0',
@@ -173,7 +173,6 @@ const createPackageJson = async (path: string, { id }: { id: unknown }) => {
'@typebot.io/forge': 'workspace:*',
'@typebot.io/tsconfig': 'workspace:*',
'@types/react': builderPackageJson.devDependencies['@types/react'],
typescript: builderPackageJson.devDependencies['typescript'],
'@typebot.io/lib': 'workspace:*',
},
}),
@@ -185,14 +184,13 @@ const createPackageJson = async (path: string, { id }: { id: unknown }) => {
const createTsConfig = async (path: string) => {
writeFileSync(
join(path, 'tsconfig.json'),
await prettier.format(
prettier.format(
JSON.stringify({
extends: '@typebot.io/tsconfig/base.json',
include: ['**/*.ts', '**/*.tsx'],
exclude: ['node_modules'],
compilerOptions: {
lib: ['ESNext', 'DOM'],
noEmit: true,
jsx: 'preserve',
jsxImportSource: 'react',
},
@@ -208,7 +206,7 @@ const createLogoFile = async (
) => {
writeFileSync(
join(path, 'logo.tsx'),
await prettier.format(
prettier.format(
`/** @jsxImportSource react */
export const ${capitalize(
@@ -226,7 +224,7 @@ const createAuthFile = async (
) =>
writeFileSync(
join(path, 'auth.ts'),
await prettier.format(
prettier.format(
`import { option, AuthDefinition } from '@typebot.io/forge'
export const auth = {
@@ -279,7 +277,7 @@ const createSchemasFile = async (
const camelCaseName = camelize(id as string)
writeFileSync(
join(path, 'schemas.ts'),
await prettier.format(
prettier.format(
`// Do not edit this file manually
import { ${
auth !== 'none' ? 'parseBlockCredentials,' : ''
@@ -327,7 +325,7 @@ ${existingDefinitionsData.slice(newObjectEntryIndex)}`
writeFileSync(
join(schemasPath, 'definitions.ts'),
await prettier.format(newDefinitionsData, {
prettier.format(newDefinitionsData, {
parser: 'typescript',
...prettierRc,
})
@@ -363,7 +361,7 @@ ${existingDefinitionsData.slice(newObjectEntryIndex)}`
writeFileSync(
join(schemasPath, 'schemas.ts'),
await prettier.format(newDefinitionsData, {
prettier.format(newDefinitionsData, {
parser: 'typescript',
...prettierRc,
})
@@ -399,7 +397,7 @@ ${existingSchemasData.slice(newObjectEntryIndex)}`
writeFileSync(
join(schemasPath, 'credentials.ts'),
await prettier.format(newDefinitionsData, {
prettier.format(newDefinitionsData, {
parser: 'typescript',
...prettierRc,
})
@@ -413,7 +411,7 @@ async function addBlockToRepoConstants(schemasPath: string, id: string) {
writeFileSync(
join(schemasPath, 'constants.ts'),
await prettier.format(
prettier.format(
existingDefinitionsData.replace(
`] as const satisfies ForgedBlock['type'][]`,
`'${id}'] as const satisfies ForgedBlock['type'][]`
@@ -432,7 +430,7 @@ async function addBlockToRepoPackageJson(id: string) {
packageJson.devDependencies[`@typebot.io/${id}-block`] = 'workspace:*'
writeFileSync(
join(schemasPath, 'package.json'),
await prettier.format(JSON.stringify(packageJson, null, 2), {
prettier.format(JSON.stringify(packageJson, null, 2), {
parser: 'json',
...prettierRc,
})

View File

@@ -2,7 +2,6 @@
"name": "forge-cli",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "tsx ./index.ts"
},
@@ -11,9 +10,9 @@
"license": "AGPL-3.0-or-later",
"devDependencies": {
"@clack/prompts": "^0.7.0",
"@typebot.io/tsconfig": "workspace:*",
"@types/node": "20.4.2",
"tsx": "4.6.2",
"prettier": "2.8.8"
"prettier": "2.8.8",
"@types/prettier": "2.7.3"
}
}
}

View File

@@ -1,9 +1,8 @@
{
"extends": "@typebot.io/tsconfig/base.json",
"extends": "../../tsconfig/base.json",
"include": ["./**/*.ts"],
"exclude": ["node_modules"],
"compilerOptions": {
"lib": ["ESNext"],
"resolveJsonModule": true
"resolveJsonModule": true,
"outDir": "dist"
}
}

View File

@@ -2,7 +2,6 @@
"name": "@typebot.io/forge",
"version": "1.0.0",
"description": "",
"main": "index.ts",
"keywords": [],
"author": "Baptiste Arnaud",
"license": "AGPL-3.0-or-later",
@@ -10,7 +9,7 @@
"zod": "3.22.4"
},
"devDependencies": {
"@typebot.io/tsconfig": "workspace:*",
"@types/react": "18.2.15"
"@types/node": "20.4.2",
"@types/react": "18.3.4"
}
}

View File

@@ -1,5 +1,7 @@
{
"extends": "@typebot.io/tsconfig/base.json",
"extends": "../../tsconfig/base.json",
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"compilerOptions": {
"outDir": "dist"
}
}

View File

@@ -0,0 +1,54 @@
{
"extends": "../../tsconfig/base.json",
"include": [
"**/*.ts",
"**/*.tsx"
],
"compilerOptions": {
"outDir": "dist"
},
"references": [
{
"path": "../blocks/anthropic"
},
{
"path": "../blocks/calCom"
},
{
"path": "../blocks/chatNode"
},
{
"path": "../blocks/difyAi"
},
{
"path": "../blocks/elevenlabs"
},
{
"path": "../blocks/groq"
},
{
"path": "../blocks/mistral"
},
{
"path": "../blocks/nocodb"
},
{
"path": "../blocks/openRouter"
},
{
"path": "../blocks/openai"
},
{
"path": "../blocks/qrcode"
},
{
"path": "../blocks/segment"
},
{
"path": "../blocks/togetherAi"
},
{
"path": "../core"
}
]
}