Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 03:37 UTC
| 1 | import { defineConfig } from 'vitest/config'; |
| 2 | import path from 'node:path'; |
| 3 | import { createRequire } from 'node:module'; |
| 4 | |
| 5 | const require = createRequire(import.meta.url); |
| 6 | const __dirname = path.resolve(path.dirname(new URL(import.meta.url).pathname)); |
| 7 | const coreDir = path.resolve(__dirname, '../core'); |
| 8 | const tsBuildersDir = path.resolve(__dirname, '../ts-builders'); |
| 9 | const jsonSchemaToEffectSchemaDir = path.resolve(__dirname, '../json-schema-to-effect-schema'); |
| 10 | const jsonSchemaToZodDir = path.resolve(__dirname, '../json-schema-to-zod'); |
| 11 | |
| 12 | export default defineConfig({ |
| 13 | resolve: { |
| 14 | alias: { |
| 15 | '~': path.resolve(__dirname, './'), |
| 16 | src: path.resolve(__dirname, './src'), |
| 17 | test: path.resolve(__dirname, './test'), |
| 18 | '@composio/core/utils/ssrf-guard': path.join(coreDir, 'src/utils/ssrfGuard.node.ts'), |
| 19 | '@composio/core/experimental': path.join(coreDir, 'src/experimental/index.ts'), |
| 20 | '@composio/core': path.join(coreDir, 'src/index.ts'), |
| 21 | '@composio/ts-builders': path.join(tsBuildersDir, 'src/index.ts'), |
| 22 | '@composio/json-schema-to-effect-schema': path.join( |
| 23 | jsonSchemaToEffectSchemaDir, |
| 24 | 'src/index.ts' |
| 25 | ), |
| 26 | '@composio/json-schema-to-zod': path.join(jsonSchemaToZodDir, 'src/index.ts'), |
| 27 | 'effect-errors': path.resolve(__dirname, './src/effect-errors'), |
| 28 | // @composio/core uses package.json "imports" (#config_defaults, #platform, etc.) |
| 29 | // Vitest/Vite does not resolve these for workspace deps, so alias them explicitly |
| 30 | '#config_defaults': path.join(coreDir, 'src/utils/config-defaults/ConfigDefaults.node.ts'), |
| 31 | '#platform': path.join(coreDir, 'src/platform/node.ts'), |
| 32 | '#files': path.join(coreDir, 'src/models/Files.node.ts'), |
| 33 | '#file_tool_modifier': path.join(coreDir, 'src/utils/modifiers/FileToolModifier.node.ts'), |
| 34 | '#ssrf_guard': path.join(coreDir, 'src/utils/ssrfGuard.node.ts'), |
| 35 | }, |
| 36 | }, |
| 37 | test: { |
| 38 | server: { deps: { inline: [/zod/] } }, |
| 39 | testTimeout: 15_000, |
| 40 | typecheck: { |
| 41 | tsconfig: './tsconfig.test.json', |
| 42 | }, |
| 43 | include: ['test/**/*.test.ts'], |
| 44 | // When defined, Vitest will run all matched files with import.meta.vitest inside. |
| 45 | includeSource: ['src/**/*.ts', 'test/__utils__/*-compiler.ts'], |
| 46 | unstubEnvs: true, |
| 47 | setupFiles: ['./test/__utils__/vitest.setup.ts'], |
| 48 | globalSetup: './test/__utils__/vitest.global-setup.ts', |
| 49 | }, |
| 50 | }); |