Skip to content

Commit 90e8c3b

Browse files
committed
docs(AI): Updates AI resources and design language with latest guidance
Made-with: Cursor
1 parent d2d3bec commit 90e8c3b

File tree

20 files changed

+352
-168
lines changed

20 files changed

+352
-168
lines changed

packages/ast-helpers/CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,33 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# 1.4.0-alpha.349 (2026-03-18)
7+
8+
**Note:** Version bump only for package @patternfly/ast-helpers
9+
10+
11+
12+
13+
14+
# 1.4.0-alpha.348 (2026-03-16)
15+
16+
**Note:** Version bump only for package @patternfly/ast-helpers
17+
18+
19+
20+
21+
22+
# 1.4.0-alpha.347 (2026-03-11)
23+
24+
25+
### Bug Fixes
26+
27+
* Changes for docs-gen v6 ESM compatibility ([#4956](https://github.com/patternfly/patternfly-org/issues/4956)) ([ce09638](https://github.com/patternfly/patternfly-org/commit/ce0963869e626e790ff36f59d745a625c7b36bdf))
28+
29+
30+
31+
32+
633
# 1.4.0-alpha.346 (2026-03-05)
734

835
**Note:** Version bump only for package @patternfly/ast-helpers

packages/ast-helpers/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@patternfly/ast-helpers",
33
"description": "Acorn AST helpers for working with live code",
4-
"version": "1.4.0-alpha.346",
4+
"version": "1.4.0-alpha.349",
55
"author": "Red Hat",
66
"license": "MIT",
77
"publishConfig": {

packages/documentation-framework/CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,33 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## 6.36.7 (2026-03-18)
7+
8+
**Note:** Version bump only for package @patternfly/documentation-framework
9+
10+
11+
12+
13+
14+
## 6.36.6 (2026-03-16)
15+
16+
**Note:** Version bump only for package @patternfly/documentation-framework
17+
18+
19+
20+
21+
22+
## 6.36.5 (2026-03-11)
23+
24+
25+
### Bug Fixes
26+
27+
* Changes for docs-gen v6 ESM compatibility ([#4956](https://github.com/patternfly/patternfly-org/issues/4956)) ([ce09638](https://github.com/patternfly/patternfly-org/commit/ce0963869e626e790ff36f59d745a625c7b36bdf))
28+
29+
30+
31+
32+
633
## 6.36.4 (2026-03-05)
734

835
**Note:** Version bump only for package @patternfly/documentation-framework

packages/documentation-framework/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@patternfly/documentation-framework",
33
"description": "A framework to build documentation for PatternFly.",
4-
"version": "6.36.4",
4+
"version": "6.36.7",
55
"author": "Red Hat",
66
"license": "MIT",
77
"bin": {

packages/documentation-framework/scripts/cli/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async function execFile(file, args) {
7676
}
7777

7878
async function build(cmd, options) {
79-
generate(options);
79+
await generate(options);
8080
const toBuild = cmd === 'all'
8181
? ['server', 'client']
8282
: cmd;

packages/documentation-framework/scripts/cli/cli.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ program
99
program
1010
.command('generate')
1111
.description('generates source files')
12-
.action(options => {
12+
.action(async options => {
1313
const { generate } = require('./generate');
14-
generate(options);
14+
await generate(options);
1515
});
1616

1717
program
1818
.command('start')
1919
.description('generates source files and runs webpack-dev-server')
20-
.action(options => {
20+
.action(async options => {
2121
const { start } = require('./start');
22-
start(options);
22+
await start(options);
2323
});
2424

2525
program

packages/documentation-framework/scripts/cli/generate.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
const path = require('path');
2-
const { sourceMD, sourceProps, sourceFunctionDocs, writeIndex } = require('../md/parseMD');
2+
const { sourceMD, sourceProps, sourceFunctionDocs, writeIndex, waitForProps, processMD } = require('../md/parseMD');
33

44
function getSource(options) {
55
return require(path.join(process.cwd(), options.parent.source));
66
}
77

8-
function generate(options) {
8+
async function generate(options) {
99
const start = new Date();
1010
console.log('write source files to patternfly-docs/generated');
1111
const sourceMDWithOptions = (glob, source, ignore) => sourceMD(glob, source, ignore, options._name);
1212
getSource(options)(sourceMDWithOptions, sourceProps, sourceFunctionDocs);
13+
await waitForProps();
14+
processMD();
1315
const exitCode = writeIndex();
1416
if (exitCode !== 0) {
1517
process.exit(exitCode);

packages/documentation-framework/scripts/cli/start.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function startDevServer(webpackConfig) {
1919
}
2020

2121
async function start(options) {
22-
generate(options, true);
22+
await generate(options, true);
2323
const webpackClientConfig = await clientConfig(null, { mode: 'development', ...getConfig(options) });
2424
console.log('start rspack-dev-server');
2525
watchMD();

packages/documentation-framework/scripts/md/parseMD.js

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const outputBase = path.join(process.cwd(), `patternfly-docs/generated`);
1919
const tsDocs = {};
2020
let functionDocs = {};
2121
const routes = {};
22+
const pendingProps = [];
2223
const globs = {
2324
props: [],
2425
md: [],
@@ -267,8 +268,8 @@ function toReactComponent(mdFilePath, source, buildMode) {
267268
};
268269
}
269270

270-
function sourcePropsFile(file) {
271-
tsDocgen(file)
271+
async function sourcePropsFile(file) {
272+
(await tsDocgen(file))
272273
.filter(({ hide }) => !hide)
273274
.forEach(({ name, description, props }) => {
274275
tsDocs[getTsDocName(name, getTsDocNameVariant(file))] = { name, description, props };
@@ -345,19 +346,32 @@ function getTsDocNameVariant(source) {
345346
module.exports = {
346347
sourceProps(glob, ignore) {
347348
globs.props.push({ glob, ignore });
348-
globSync(glob, { ignore }).forEach(sourcePropsFile);
349+
const promise = Promise.all(globSync(glob, { ignore }).map(sourcePropsFile));
350+
pendingProps.push(promise);
351+
},
352+
async waitForProps() {
353+
await Promise.all(pendingProps);
349354
},
350355
sourceMD(glob, source, ignore, buildMode) {
351-
globs.md.push({ glob, source, ignore });
352-
globSync(glob, { ignore }).forEach(file => sourceMDFile(file, source, buildMode));
356+
globs.md.push({ glob, source, ignore, buildMode });
357+
},
358+
processMD() {
359+
globs.md.forEach(({ glob, source, ignore, buildMode }) => {
360+
globSync(glob, { ignore }).forEach(file => sourceMDFile(file, source, buildMode));
361+
});
353362
},
354363
sourceFunctionDocs,
355364
writeIndex,
356365
watchMD() {
357366
globs.props.forEach(({ glob, ignore }) => {
358367
const propWatcher = chokidar.watch(globSync(glob, { ignored: ignore, ignoreInitial: true}));
359-
propWatcher.on('add', sourcePropsFile);
360-
propWatcher.on('change', sourcePropsFile);
368+
const onPropFile = (file) => {
369+
sourcePropsFile(file).catch((err) => {
370+
console.error('Error updating props from', file, err);
371+
});
372+
};
373+
propWatcher.on('add', onPropFile);
374+
propWatcher.on('change', onPropFile);
361375
});
362376
globs.md.forEach(({ glob, source, ignore }) => {
363377
const mdWatcher = chokidar.watch(globSync(glob, { ignored: ignore, ignoreInitial: true }));

packages/documentation-framework/scripts/tsDocgen.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
const fs = require("fs");
2-
const reactDocgen = require("react-docgen");
32
const ts = require("typescript");
43

4+
// react-docgen v6+ is ESM-only; lazy-load it asynchronously on first use
5+
let reactDocgenReady = null;
6+
function loadReactDocgen() {
7+
if (!reactDocgenReady) {
8+
reactDocgenReady = import("react-docgen");
9+
}
10+
return reactDocgenReady;
11+
}
12+
513
const annotations = [
614
{
715
regex: /@deprecated/,
@@ -41,7 +49,8 @@ function addAnnotations(prop) {
4149
return prop;
4250
}
4351

44-
function getComponentMetadata(filename, sourceText) {
52+
async function getComponentMetadata(filename, sourceText) {
53+
const reactDocgen = await loadReactDocgen();
4554
let parsedComponents = null;
4655
try {
4756
parsedComponents = reactDocgen.parse(sourceText, {
@@ -159,9 +168,9 @@ function normalizeProp([
159168
return res;
160169
}
161170

162-
function tsDocgen(file) {
171+
async function tsDocgen(file) {
163172
const sourceText = fs.readFileSync(file, "utf8");
164-
const componentMeta = getComponentMetadata(file, sourceText); // Array of components with props
173+
const componentMeta = await getComponentMetadata(file, sourceText); // Array of components with props
165174
const interfaceMeta = getInterfaceMetadata(file, sourceText); // Array of interfaces with props
166175
const typeAliasMeta = getTypeAliasMetadata(file, sourceText); // Array of type aliases with props
167176
const propsMetaMap = [...interfaceMeta, ...typeAliasMeta].reduce(function (

0 commit comments

Comments
 (0)