TypeScript Support

Takomo supports custom configuration written in TypeScript. By default, it looks for a takomo.ts file in the project root. If found, this file is compiled using esbuild and executed to apply any customizations.

You can control this behavior through the esbuild property in your takomo.yml file:

Property Description Required Default
enabled Enable or disable esbuild and TypeScript support No true
outFile Output path for the compiled TypeScript file No .takomo/out/takomo.mjs
entryPoint Entry file to compile with esbuild No takomo.ts

Examples

Use a custom entry point:

takomo.yml
1esbuild:
2  entryPoint: src/index.ts

Disable TypeScript support:

takomo.yml
1esbuild:
2  enabled: false

Customizing Project Configuration

The entry point file (typically takomo.ts) must export a default function of type TakomoConfigProvider.
This function returns a TakomoConfig object containing your project's custom configuration.

Example

1import { HandlebarsTemplateEngineProvider, TakomoConfigProvider } from "takomo"
2
3const provider: TakomoConfigProvider = async () => ({
4  schemaProviders: [ 
5    // Custom schema providers
6  ],
7  hookProviders: [
8    // Custom hook providers
9  ],
10  resolverProviders: [
11    // Custom resolver providers
12  ],
13  templateEngineProvider: new HandlebarsTemplateEngineProvider(),
14})
15
16export default provider