diff --git a/.changeset/nine-spies-attack.md b/.changeset/nine-spies-attack.md new file mode 100644 index 0000000..3370b12 --- /dev/null +++ b/.changeset/nine-spies-attack.md @@ -0,0 +1,5 @@ +--- +"domco": patch +--- + +fix: reference on `DomcoConfig` and export `MaybePromise` diff --git a/apps/docs/src/server/generated/globals.md b/apps/docs/src/server/generated/globals.md index 23e1ff7..b5c7a4b 100644 --- a/apps/docs/src/server/generated/globals.md +++ b/apps/docs/src/server/generated/globals.md @@ -80,7 +80,7 @@ Passed into Vite `config.ssr.target`. #### Defined in -[types/index.ts:58](https://github.com/rossrobino/domco/blob/079c24a873dea21ac0e5db4ef90b4f223f824e4a/packages/domco/src/types/index.ts#L58) +[types/index.ts:60](https://github.com/rossrobino/domco/blob/96bc88dd5cb595f98ceeaa40c8e6c0f3884cd45b/packages/domco/src/types/index.ts#L60) --- @@ -88,7 +88,7 @@ Passed into Vite `config.ssr.target`. ### AdapterBuilder()\ -> **AdapterBuilder**\<`AdapterOptions`\>: (`AdapterOptions`?) => `MaybePromise`\<[`Adapter`](globals.md#adapter)\> +> **AdapterBuilder**\<`AdapterOptions`\>: (`AdapterOptions`?) => [`MaybePromise`](globals.md#maybepromiset)\<[`Adapter`](globals.md#adapter)\> Use this type to create your own adapter. Pass any options for the adapter in as a generic. @@ -103,11 +103,11 @@ Pass any options for the adapter in as a generic. #### Returns -`MaybePromise`\<[`Adapter`](globals.md#adapter)\> +[`MaybePromise`](globals.md#maybepromiset)\<[`Adapter`](globals.md#adapter)\> #### Defined in -[types/index.ts:88](https://github.com/rossrobino/domco/blob/079c24a873dea21ac0e5db4ef90b4f223f824e4a/packages/domco/src/types/index.ts#L88) +[types/index.ts:90](https://github.com/rossrobino/domco/blob/96bc88dd5cb595f98ceeaa40c8e6c0f3884cd45b/packages/domco/src/types/index.ts#L90) --- @@ -151,7 +151,7 @@ The name of the entry point without extension. #### Defined in -[types/index.ts:42](https://github.com/rossrobino/domco/blob/079c24a873dea21ac0e5db4ef90b4f223f824e4a/packages/domco/src/types/index.ts#L42) +[types/index.ts:44](https://github.com/rossrobino/domco/blob/96bc88dd5cb595f98ceeaa40c8e6c0f3884cd45b/packages/domco/src/types/index.ts#L44) --- @@ -165,7 +165,7 @@ Middleware used in the Vite server for dev and preview. #### Defined in -[types/index.ts:39](https://github.com/rossrobino/domco/blob/079c24a873dea21ac0e5db4ef90b4f223f824e4a/packages/domco/src/types/index.ts#L39) +[types/index.ts:41](https://github.com/rossrobino/domco/blob/96bc88dd5cb595f98ceeaa40c8e6c0f3884cd45b/packages/domco/src/types/index.ts#L41) --- @@ -193,7 +193,7 @@ Exports from the SSR `app` entry point. #### Defined in -[types/index.ts:5](https://github.com/rossrobino/domco/blob/079c24a873dea21ac0e5db4ef90b4f223f824e4a/packages/domco/src/types/index.ts#L5) +[types/index.ts:7](https://github.com/rossrobino/domco/blob/96bc88dd5cb595f98ceeaa40c8e6c0f3884cd45b/packages/domco/src/types/index.ts#L7) --- @@ -250,7 +250,7 @@ export default defineConfig({ #### Defined in -[types/index.ts:114](https://github.com/rossrobino/domco/blob/079c24a873dea21ac0e5db4ef90b4f223f824e4a/packages/domco/src/types/index.ts#L114) +[types/index.ts:116](https://github.com/rossrobino/domco/blob/96bc88dd5cb595f98ceeaa40c8e6c0f3884cd45b/packages/domco/src/types/index.ts#L116) --- @@ -258,7 +258,7 @@ export default defineConfig({ ### Handler() -> **Handler**: (`req`) => `MaybePromise`\<`Response`\> +> **Handler**: (`req`) => [`MaybePromise`](globals.md#maybepromiset)\<`Response`\> Request handler, takes a web request and returns a web response. @@ -277,11 +277,29 @@ export const handler: Handler = async (req) => { #### Returns -`MaybePromise`\<`Response`\> +[`MaybePromise`](globals.md#maybepromiset)\<`Response`\> #### Defined in -[types/index.ts:22](https://github.com/rossrobino/domco/blob/079c24a873dea21ac0e5db4ef90b4f223f824e4a/packages/domco/src/types/index.ts#L22) +[types/index.ts:24](https://github.com/rossrobino/domco/blob/96bc88dd5cb595f98ceeaa40c8e6c0f3884cd45b/packages/domco/src/types/index.ts#L24) + +--- + + + +### MaybePromise\ + +> **MaybePromise**\<`T`\>: `T` \| `Promise`\<`T`\> + +Helper type for a type that could be a promise. + +#### Type Parameters + +• **T** + +#### Defined in + +[types/index.ts:4](https://github.com/rossrobino/domco/blob/96bc88dd5cb595f98ceeaa40c8e6c0f3884cd45b/packages/domco/src/types/index.ts#L4) --- @@ -304,7 +322,7 @@ export const prerender: Prerender = ["/", "/post-1", "/post-2"]; #### Defined in -[types/index.ts:36](https://github.com/rossrobino/domco/blob/079c24a873dea21ac0e5db4ef90b4f223f824e4a/packages/domco/src/types/index.ts#L36) +[types/index.ts:38](https://github.com/rossrobino/domco/blob/96bc88dd5cb595f98ceeaa40c8e6c0f3884cd45b/packages/domco/src/types/index.ts#L38) ## Functions @@ -321,6 +339,8 @@ to start using domco. • **domcoConfig**: [`DomcoConfig`](globals.md#domcoconfig) = `{}` +Your domco config object. + #### Returns `Promise`\<`Plugin`\<`any`\>[]\> @@ -341,4 +361,4 @@ export default defineConfig({ #### Defined in -[plugin/index.ts:29](https://github.com/rossrobino/domco/blob/079c24a873dea21ac0e5db4ef90b4f223f824e4a/packages/domco/src/plugin/index.ts#L29) +[plugin/index.ts:29](https://github.com/rossrobino/domco/blob/96bc88dd5cb595f98ceeaa40c8e6c0f3884cd45b/packages/domco/src/plugin/index.ts#L29) diff --git a/packages/domco/src/listener/index.ts b/packages/domco/src/listener/index.ts index eee76a8..a595fea 100644 --- a/packages/domco/src/listener/index.ts +++ b/packages/domco/src/listener/index.ts @@ -2,7 +2,7 @@ * Adapted from https://github.com/mjackson/remix-the-web/blob/main/packages/node-fetch-server * to use as middleware: https://github.com/mjackson/remix-the-web/issues/13 */ -import type { MaybePromise } from "../types/helper/index.js"; +import type { MaybePromise } from "../types/index.js"; import type { ReadStream } from "node:fs"; import type { IncomingHttpHeaders, diff --git a/packages/domco/src/plugin/index.ts b/packages/domco/src/plugin/index.ts index 4f5a4a9..ff9c7bb 100644 --- a/packages/domco/src/plugin/index.ts +++ b/packages/domco/src/plugin/index.ts @@ -11,7 +11,7 @@ import type { Plugin } from "vite"; * Creates domco Vite plugin, add to your `plugins` array within your `vite.config` * to start using domco. * - * @param config Your domco config object. + * @param domcoConfig Your domco config object. * @returns The domco Vite plugin. * * @example diff --git a/packages/domco/src/types/helper/index.ts b/packages/domco/src/types/helper/index.ts deleted file mode 100644 index cda192b..0000000 --- a/packages/domco/src/types/helper/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -/** Helper type for a type that could be a promise. */ -export type MaybePromise = T | Promise; diff --git a/packages/domco/src/types/index.ts b/packages/domco/src/types/index.ts index e5fd1fc..ff66673 100644 --- a/packages/domco/src/types/index.ts +++ b/packages/domco/src/types/index.ts @@ -1,6 +1,8 @@ -import type { MaybePromise } from "./helper/index.js"; import type { SSRTarget, SSROptions, Connect } from "vite"; +/** Helper type for a type that could be a promise. */ +export type MaybePromise = T | Promise; + /** Exports from the SSR `app` entry point. */ export type AppModule = { handler: Handler; diff --git a/packages/domco/src/version/index.ts b/packages/domco/src/version/index.ts index e5ae2a9..a693ce1 100644 --- a/packages/domco/src/version/index.ts +++ b/packages/domco/src/version/index.ts @@ -1 +1 @@ -export const version = "0.12.0"; +export const version = "0.13.0"; diff --git a/packages/domco/typedoc.config.js b/packages/domco/typedoc.config.js index fc41699..ff921c8 100644 --- a/packages/domco/typedoc.config.js +++ b/packages/domco/typedoc.config.js @@ -1,14 +1,19 @@ /** @import { TypeDocOptions } from "typedoc" */ /** @import { PluginOptions } from "typedoc-plugin-markdown" */ -/** @type {Partial} */ -export default { - entryPoints: ["src/index.ts"], - out: "../../apps/docs/src/server/generated", - +/** @type {PluginOptions} */ +const markdownOptions = { plugin: ["typedoc-plugin-markdown"], outputFileStrategy: "modules", hidePageHeader: true, hidePageTitle: true, useHTMLAnchors: true, }; + +/** @type {Partial} */ +export default { + entryPoints: ["src/index.ts"], + out: "../../apps/docs/src/server/generated", + plugin: ["typedoc-plugin-markdown"], + ...markdownOptions, +};