diff --git a/.changeset/healthy-buttons-attend.md b/.changeset/healthy-buttons-attend.md new file mode 100644 index 0000000..9047148 --- /dev/null +++ b/.changeset/healthy-buttons-attend.md @@ -0,0 +1,6 @@ +--- +"@itsmatteomanf/astro-security-txt": minor +"@itsmatteomanf/astro-pagefind": minor +--- + +Fix Types diff --git a/packages/astro-pagefind/env.d.ts b/packages/astro-pagefind/env.d.ts index f964fe0..aaf23e9 100644 --- a/packages/astro-pagefind/env.d.ts +++ b/packages/astro-pagefind/env.d.ts @@ -1 +1,14 @@ /// + +type PagefindOptions = { + index?: { + rootSelector?: string | undefined; + excludeSelectors?: string[] | undefined; + forceLanguage?: string | undefined; + keepIndexUrl?: boolean | undefined; + verbose?: boolean | undefined; + logfile?: string | undefined; + } | undefined; + directories?: string[] | undefined; + site?: string | undefined; +} | undefined; \ No newline at end of file diff --git a/packages/astro-pagefind/src/integration.ts b/packages/astro-pagefind/src/integration.ts index effe7bb..e6765fe 100644 --- a/packages/astro-pagefind/src/integration.ts +++ b/packages/astro-pagefind/src/integration.ts @@ -2,13 +2,11 @@ import type { AstroIntegration } from "astro"; import { createIndex } from "pagefind"; import { ZodError, z } from "zod"; import { name } from "../package.json"; -import { PagefindOptions, validateOptions } from "./libs/validate-options"; +import { PagefindOptions as ZodTypes, validateOptions } from "./libs/validate-options"; -type Options = z.infer; - -export const integration = (options: Options): AstroIntegration => { +export const integration = (options: PagefindOptions): AstroIntegration => { let generate = true; - let validatedOptions: Options; + let validatedOptions: z.infer; return { name, diff --git a/packages/astro-security-txt/env.d.ts b/packages/astro-security-txt/env.d.ts index f964fe0..1d87856 100644 --- a/packages/astro-security-txt/env.d.ts +++ b/packages/astro-security-txt/env.d.ts @@ -1 +1,13 @@ /// + +type SecurityTxtOptions = { + contact: string | string[] + expires?: Date | undefined + encryption?: string | string[] | undefined + acknowledgements?: string | string[] | undefined + preferredLanguages?: string | string[] | undefined + canonical?: string | string[] | undefined + policy?: string | string[] | undefined + hiring?: string | string[] | undefined + csaf?: string | string[] | undefined +}; \ No newline at end of file diff --git a/packages/astro-security-txt/src/integration.ts b/packages/astro-security-txt/src/integration.ts index 2b12cb7..4af800f 100644 --- a/packages/astro-security-txt/src/integration.ts +++ b/packages/astro-security-txt/src/integration.ts @@ -2,14 +2,12 @@ import type { AstroConfig, AstroIntegration } from "astro"; import { mkdirSync, writeFileSync } from "node:fs"; import { ZodError, z } from "zod"; import { name } from "../package.json"; -import { SecurityTxtOptions, validateOptions } from "./libs/validate-options"; +import { SecurityTxtOptions as ZodTypes, validateOptions } from "./libs/validate-options"; -type Options = z.infer; - -export const integration = (options: Options): AstroIntegration => { +export const integration = (options: SecurityTxtOptions): AstroIntegration => { let config: AstroConfig; let generate = true; - let validatedOptions: Options; + let validatedOptions: z.infer; return { name,