Skip to content

Commit

Permalink
chore: add contract test util entry point (#2937)
Browse files Browse the repository at this point in the history
* chore: add contract test util entry point

* chore: dont export secondary entrypoint links
  • Loading branch information
danielbate committed Aug 15, 2024
1 parent 5e8a087 commit 6b4d754
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .changeset/big-dragons-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
11 changes: 9 additions & 2 deletions apps/docs/scripts/typedoc-postbuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const filesToRemove = [
'api/enums',
];

const secondaryEntryPoints = ['-index.md', '-test_utils.md', '-cli-utils.md'];
const secondaryEntryPoints = ['-index.md', '-test_utils.md', '-cli_utils.md'];
const secondaryModules: string[] = [];

const filePathReplacements: RegexReplacement[] = [];
Expand Down Expand Up @@ -65,7 +65,14 @@ const exportLinksJson = () => {
.forEach((directory) => {
links.items.push({ text: directory, link: `/api/${directory}/`, collapsed: true, items: [] });
readdirSync(join(apiDocsDir, directory))
.filter((file) => file !== 'index.md')
.filter((file) => {
// Exclude index files and files related to secondary entry points
const isIndexFile = file.endsWith('index.md');
const isSecondaryEntryPoint = secondaryEntryPoints.some((entryPoint) =>
file.includes(entryPoint.replace('_', '-').replace('.md', ''))
);
return !isIndexFile && !isSecondaryEntryPoint;
})
.forEach((file) => {
const index = links.items.findIndex((item) => item.text === directory);
if (index !== -1) {
Expand Down
2 changes: 1 addition & 1 deletion packages/contract/typedoc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://typedoc.org/schema.json",
"extends": ["../../typedoc.base.json"],
"entryPoints": ["src/index.ts"]
"entryPoints": ["src/index.ts", "src/test-utils.ts"]
}

0 comments on commit 6b4d754

Please sign in to comment.