From 77d50c2516c52112c0ada994e1b951ab3a90748e Mon Sep 17 00:00:00 2001 From: menduz Date: Mon, 18 Mar 2024 11:57:40 -0300 Subject: [PATCH] fix build --- etc/interfaces.api.md | 18 ++++++++++++++---- src/components/base-component.ts | 18 +++++++++++++----- src/utils/lifecycle.ts | 4 ++-- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/etc/interfaces.api.md b/etc/interfaces.api.md index 1e73df2..24d2f86 100644 --- a/etc/interfaces.api.md +++ b/etc/interfaces.api.md @@ -25,7 +25,11 @@ export namespace IBaseComponent { // @public export interface IBaseComponent { + [START_COMPONENT]?: (startOptions: IBaseComponent.ComponentStartOptions) => Promise; + [STOP_COMPONENT]?: () => Promise; + // @deprecated start?: (startOptions: IBaseComponent.ComponentStartOptions) => Promise; + // @deprecated stop?: () => Promise; } @@ -394,6 +398,12 @@ export type RequestOptions = fetch_2.RequestInit & { type Response_2 = fetch_2.Response; export { Response_2 as Response } +// @public +export const START_COMPONENT: unique symbol; + +// @public +export const STOP_COMPONENT: unique symbol; + // @public (undocumented) export type Trace = Pick; @@ -414,10 +424,10 @@ export type TraceState = Required>["traceState" // Warnings were encountered during analysis: // -// src/components/fetcher.ts:27:3 - (ae-incompatible-release-tags) The symbol "fetch" is marked as @public, but its signature references "Request" which is marked as @alpha -// src/components/fetcher.ts:27:3 - (ae-incompatible-release-tags) The symbol "fetch" is marked as @public, but its signature references "Response" which is marked as @alpha -// src/components/fetcher.ts:28:3 - (ae-incompatible-release-tags) The symbol "fetch" is marked as @public, but its signature references "Request" which is marked as @alpha -// src/components/fetcher.ts:28:3 - (ae-incompatible-release-tags) The symbol "fetch" is marked as @public, but its signature references "Response" which is marked as @alpha +// src/components/fetcher.ts:27:3 - (ae-incompatible-release-tags) The symbol "fetch" is marked as @public, but its signature references "Request_2" which is marked as @alpha +// src/components/fetcher.ts:27:3 - (ae-incompatible-release-tags) The symbol "fetch" is marked as @public, but its signature references "Response_2" which is marked as @alpha +// src/components/fetcher.ts:28:3 - (ae-incompatible-release-tags) The symbol "fetch" is marked as @public, but its signature references "Request_2" which is marked as @alpha +// src/components/fetcher.ts:28:3 - (ae-incompatible-release-tags) The symbol "fetch" is marked as @public, but its signature references "Response_2" which is marked as @alpha // (No @packageDocumentation comment for this package) diff --git a/src/components/base-component.ts b/src/components/base-component.ts index 07c7a02..e378f6a 100644 --- a/src/components/base-component.ts +++ b/src/components/base-component.ts @@ -1,5 +1,13 @@ -export const START_COMPONENT = Symbol.for("wkc:START_COMPONENT"); -export const STOP_COMPONENT = Symbol.for("wkc:STOP_COMPONENT"); +/** + * @public + * Symbol to start a component, used by Lifecycle + */ +export const START_COMPONENT = Symbol.for("wkc:START_COMPONENT") +/** + * @public + * Symbol to stop a component, used by Lifecycle + */ +export const STOP_COMPONENT = Symbol.for("wkc:STOP_COMPONENT") /** * @public @@ -29,12 +37,12 @@ export namespace IBaseComponent { export interface IBaseComponent { /** * starts the component, i.e. it connects the database or binds the port in a listener server - * @deprecated Use import { START_COMPONENT } from '@well-known-components/interfaces' + * @deprecated - Use import \{ START_COMPONENT \} from '\@well-known-components/interfaces' */ start?: (startOptions: IBaseComponent.ComponentStartOptions) => Promise /** * finishes pending work and/or releases all the resources (connections, bound ports, open file descriptors) - * @deprecated Use import { STOP_COMPONENT } from '@well-known-components/interfaces' + * @deprecated - Use import \{ STOP_COMPONENT \} from '\@well-known-components/interfaces' */ stop?: () => Promise @@ -60,5 +68,5 @@ export type IAdapterHandler = (context: Context) => Promise */ export type IMiddlewareAdapterHandler = ( context: Context, - next: () => Promise + next: () => Promise, ) => Promise diff --git a/src/utils/lifecycle.ts b/src/utils/lifecycle.ts index 90ef692..de14bec 100644 --- a/src/utils/lifecycle.ts +++ b/src/utils/lifecycle.ts @@ -1,4 +1,4 @@ -import { IBaseComponent, STOP_COMPONENT } from "../components/base-component" +import { IBaseComponent, STOP_COMPONENT, START_COMPONENT } from "../components/base-component" function stopAllComponents(components: Record) { const pending: PromiseLike[] = [] @@ -70,7 +70,7 @@ async function startComponentsLifecycle(components: Record