TypeScript Setup
The SDK uses a composite TypeScript setup to strictly separate your production code from your test environment. You will need three configuration files in your project root:
tsconfig.json(The Router) This file tells your editor and thevdl-plugin checkwhere to find the two separate configurations for production and tests.
{
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.test.json" }
]
}
tsconfig.app.json(For Production Code) This configuration extends the SDK's base app config and defines which files are part of your plugin, excluding tests.
{
"extends": "@varavel/vdl-plugin-sdk/tsconfig.app.base.json",
"include": ["src/**/*.ts"],
"exclude": ["src/**/*.test.ts", "src/**/*.spec.ts"]
}
tsconfig.test.json(For Tests) This configuration extends the SDK's test base config and includes everything your production code ignores. It ensures that test-specific types do not leak into your main plugin compilation.
{
"extends": "@varavel/vdl-plugin-sdk/tsconfig.test.base.json",
"include": [
"src/**/*.test.ts",
"src/**/*.spec.ts",
"tests/**/*.ts",
"e2e/**/*.ts",
"vitest.config.ts"
]
}