Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions scripts/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import { dashCase, listPublicDirs, writeSourceFile } from "./utils.js";
const publicDirs = listPublicDirs("src");
const targetDir = "lib/components/internal/api-docs";

const importedCoreComponents = ["icon"];

componentDocs();
testUtilDocs();

Expand All @@ -22,17 +20,8 @@ function validatePublicFiles(definitionFiles) {
}
}

function getNodeModulesInterfacePath(componentName) {
return path.resolve("node_modules/@cloudscape-design/components", componentName, "interfaces.d.ts");
}

function componentDocs() {
const nodeModulesDependencyFilePaths = importedCoreComponents.map(getNodeModulesInterfacePath);
const definitions = documentComponents(
path.resolve("tsconfig.json"),
"src/*/index.tsx",
nodeModulesDependencyFilePaths,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed in the new version. It just works now

);
const definitions = documentComponents(path.resolve("tsconfig.json"), "src/*/index.tsx");
const outDir = path.join(targetDir, "components");
const fileNames = definitions
.filter((definition) => {
Expand Down
12 changes: 6 additions & 6 deletions src/__tests__/__snapshots__/documenter.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ exports[`definition for avatar matches the snapshot > avatar 1`] = `
"description": "Text to describe the avatar for assistive technology.
When more than one avatar is used, provide a unique label for each.
For example, "Avatar of John Doe" or "Avatar of generative AI assistant".
If \`tooltipText\` is used make sure to include it in the \`ariaLabel\`.
",

If \`tooltipText\` is used make sure to include it in the \`ariaLabel\`.",
"name": "ariaLabel",
"optional": false,
"type": "string",
Expand All @@ -36,8 +36,8 @@ Use \`gen-ai\` for AI assistants and \`default\` otherwise.",
"defaultValue": ""user-profile"",
"description": "Specifies the icon to be displayed as Avatar.
Use \`gen-ai\` icon for AI assistants. By default \`user-profile\` icon is used.
If you set both \`iconName\` and \`initials\`, \`initials\` will take precedence.
",

If you set both \`iconName\` and \`initials\`, \`initials\` will take precedence.",
"inlineType": {
"name": "IconProps.Name",
"type": "union",
Expand Down Expand Up @@ -76,8 +76,8 @@ Use it to define initials that uniquely identify the avatar's owner.",
},
{
"description": "The text content shown in the avatar's tooltip.
When you use this property, make sure to include it in the \`ariaLabel\`.
",

When you use this property, make sure to include it in the \`ariaLabel\`.",
"name": "tooltipText",
"optional": true,
"type": "string",
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/documenter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { expect, test } from "vitest";

import { getAllComponents, requireComponentDefinition } from "./utils";

test.skip.each<string>(getAllComponents())(`definition for %s matches the snapshot`, (componentName: string) => {
test.each<string>(getAllComponents())(`definition for %s matches the snapshot`, (componentName: string) => {
const definition = requireComponentDefinition(componentName);

// overriding with a fake value so that when there are icon changes in components this test doesn't block it
Expand Down
Loading