From ca4420782c6e5904ca638a04b95f35b8dc813a1b Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Tue, 12 Apr 2022 11:25:25 +0200 Subject: [PATCH] Review feedback. Signed-off-by: Eric Peterson --- .changeset/spotty-ducks-exercise.md | 2 +- plugins/techdocs-react/README.md | 2 +- plugins/techdocs-react/api-report.md | 6 +++--- plugins/techdocs-react/package.json | 4 +++- plugins/techdocs-react/src/hooks.ts | 6 +++--- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.changeset/spotty-ducks-exercise.md b/.changeset/spotty-ducks-exercise.md index be1ae987cb..c04d312714 100644 --- a/.changeset/spotty-ducks-exercise.md +++ b/.changeset/spotty-ducks-exercise.md @@ -2,4 +2,4 @@ '@backstage/integration': patch --- -replaceGitLabUrlType exported from package +Exported `replaceGitLabUrlType` from package diff --git a/plugins/techdocs-react/README.md b/plugins/techdocs-react/README.md index 244e8c70da..548ba8be5a 100644 --- a/plugins/techdocs-react/README.md +++ b/plugins/techdocs-react/README.md @@ -5,5 +5,5 @@ This package provides frontend utilities for TechDocs and Addons. ## Installation ```sh -yarn add @backstage/plugin-techdocs-react +yarn add --cwd packages/app @backstage/plugin-techdocs-react ``` diff --git a/plugins/techdocs-react/api-report.md b/plugins/techdocs-react/api-report.md index 1c536245fe..66ad397412 100644 --- a/plugins/techdocs-react/api-report.md +++ b/plugins/techdocs-react/api-report.md @@ -80,17 +80,17 @@ export type TechDocsReaderPageValue = { onReady?: () => void; }; -// @public +// @alpha export const useShadowRoot: () => ShadowRoot | undefined; -// @public +// @alpha export const useShadowRootElements: < TReturnedElement extends HTMLElement = HTMLElement, >( selectors: string[], ) => TReturnedElement[]; -// @public +// @alpha export const useShadowRootSelection: (wait?: number) => Selection | null; // @alpha diff --git a/plugins/techdocs-react/package.json b/plugins/techdocs-react/package.json index 942838c959..cec985baa3 100644 --- a/plugins/techdocs-react/package.json +++ b/plugins/techdocs-react/package.json @@ -5,6 +5,7 @@ "private": false, "publishConfig": { "access": "public", + "alphaTypes": "dist/index.alpha.d.ts", "main": "dist/index.esm.js", "types": "dist/index.d.ts" }, @@ -25,7 +26,7 @@ "main": "src/index.ts", "types": "src/index.ts", "scripts": { - "build": "backstage-cli package build", + "build": "backstage-cli package build --experimental-type-build", "lint": "backstage-cli package lint", "test": "backstage-cli package test", "prepack": "backstage-cli package prepack", @@ -59,6 +60,7 @@ "@backstage/theme": "^0.2.15" }, "files": [ + "alpha", "dist" ] } diff --git a/plugins/techdocs-react/src/hooks.ts b/plugins/techdocs-react/src/hooks.ts index 560c548156..cc141c9e15 100644 --- a/plugins/techdocs-react/src/hooks.ts +++ b/plugins/techdocs-react/src/hooks.ts @@ -20,7 +20,7 @@ import { useTechDocsReaderPage } from './context'; /** * Hook for use within TechDocs addons that provides access to the underlying * shadow root of the current page, allowing the DOM within to be mutated. - * @public + * @alpha */ export const useShadowRoot = () => { const { shadowRoot } = useTechDocsReaderPage(); @@ -31,7 +31,7 @@ export const useShadowRoot = () => { * Convenience hook for use within TechDocs addons that provides access to * elements that match a given selector within the shadow root. * - * @public + * @alpha */ export const useShadowRootElements = < TReturnedElement extends HTMLElement = HTMLElement, @@ -58,7 +58,7 @@ const isValidSelection = (newSelection: Selection) => { /** * Hook for retreiving a selection within the ShadowRoot. - * @public + * @alpha */ export const useShadowRootSelection = (wait: number = 0) => { const shadowRoot = useShadowRoot();