| 63 | } |
| 64 | |
| 65 | async function getPageLinks() { |
| 66 | const packagePaths = [ |
| 67 | 'packages/@react-{spectrum,aria,stately}/*/docs/*.mdx', |
| 68 | 'packages/react-aria-components/docs/**/*.mdx', |
| 69 | 'packages/@internationalized/*/docs/*.mdx' |
| 70 | ]; |
| 71 | |
| 72 | const rootPages = 'packages/dev/docs/pages/**/*.mdx'; |
| 73 | |
| 74 | let links = []; |
| 75 | |
| 76 | for (const pattern of packagePaths) { |
| 77 | const files = await glob(pattern); |
| 78 | for (const file of files) { |
| 79 | const parts = file.split(path.sep); |
| 80 | const packageName = parts[1].replace('@', ''); |
| 81 | const componentName = path.basename(file, '.mdx'); |
| 82 | links.push(`/${packageName}/${componentName}.html`); |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | const rootFiles = await glob(rootPages); |
| 87 | for (const file of rootFiles) { |
| 88 | const relativePath = path.relative('packages/dev/docs/pages', file); |
| 89 | const urlPath = path.join('/', path.dirname(relativePath), path.basename(relativePath, '.mdx')); |
| 90 | links.push(`${urlPath}.html`); |
| 91 | } |
| 92 | |
| 93 | return links; |
| 94 | } |
| 95 | |
| 96 | async function testDocs() { |
| 97 | let server; |