generated from blueplum/typescript-template
feat: config files, readme
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { type } from "arktype";
|
||||
|
||||
export interface Options {
|
||||
/**
|
||||
* Pattern matching files to include in parsing
|
||||
@@ -66,6 +68,22 @@ export interface Options {
|
||||
emitRegions: boolean;
|
||||
}
|
||||
|
||||
export const Options = type({
|
||||
include: "string[]",
|
||||
"exclude?": "string[]",
|
||||
"outDir?": "string | null",
|
||||
"fileExtension?": "string",
|
||||
"testName?": "string | null",
|
||||
"templateRoot?": "boolean",
|
||||
"templateHeader?": "string[]",
|
||||
"templateFooter?": "string[]",
|
||||
"format?": '"jest" | "vitest" | "assert"',
|
||||
"onlyGenerateTests?": "boolean",
|
||||
"requireCodeBlock?": "boolean",
|
||||
"includePath?": "boolean",
|
||||
"emitRegions?": "boolean",
|
||||
});
|
||||
|
||||
export const DEFAULT_OPTIONS: Required<Options> = {
|
||||
include: [],
|
||||
exclude: [],
|
||||
@@ -81,3 +99,13 @@ export const DEFAULT_OPTIONS: Required<Options> = {
|
||||
includePath: true,
|
||||
emitRegions: true,
|
||||
};
|
||||
|
||||
export function defineConfig(
|
||||
opts: Partial<Omit<Options, "include">> &
|
||||
Pick<Options, "include">,
|
||||
): Options {
|
||||
return {
|
||||
...DEFAULT_OPTIONS,
|
||||
...opts,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user