From 0afdf9deb168f3330d3ee7e8c5ffdba81dc4f2ba Mon Sep 17 00:00:00 2001 From: GerkinDev Date: Tue, 1 Mar 2022 19:43:22 +0100 Subject: [PATCH] feat(plugin-pages): use new option format, fix issue with pages ordering, rework theme plugins --- .../__snapshots__/simple.spec.ts.snap | 9 +- ...pagesconfig.js => typedoc-plugin-pages.js} | 0 .../src/options/build-options.ts | 57 +++++++++++ .../typedoc-plugin-pages/src/options/index.ts | 2 +- .../src/options/plugin-options.ts | 48 ++++----- .../src/options/read-plugin-options.spec.ts | 97 ------------------- .../src/options/read-plugin-options.ts | 58 ----------- .../page-tree/fallback-render-page-link.tsx | 7 -- .../src/page-tree/index.ts | 23 ----- packages/typedoc-plugin-pages/src/plugin.ts | 64 ++++-------- .../typedoc-plugin-pages/src/search/index.ts | 1 - .../src/theme-plugins/index.ts | 25 +++++ .../page-tree/a-page-tree-builder.spec.ts | 8 +- .../page-tree/a-page-tree-builder.ts | 12 +-- .../page-tree/default-tree-builder.spec.ts} | 14 +-- .../page-tree/default-tree-builder.tsx} | 22 ++--- .../src/theme-plugins/page-tree/index.ts | 4 + .../{ => theme-plugins}/page-tree/types.ts | 6 +- .../{ => theme-plugins}/page-tree/utils.ts | 6 +- ...avascript-index-plugin.GENERATED.ts.patch} | 12 +-- .../src/theme-plugins/search/index.ts | 1 + 21 files changed, 176 insertions(+), 300 deletions(-) rename packages/typedoc-plugin-pages/__tests__/mock-fs/simple/{pagesconfig.js => typedoc-plugin-pages.js} (100%) create mode 100644 packages/typedoc-plugin-pages/src/options/build-options.ts delete mode 100644 packages/typedoc-plugin-pages/src/options/read-plugin-options.spec.ts delete mode 100644 packages/typedoc-plugin-pages/src/options/read-plugin-options.ts delete mode 100644 packages/typedoc-plugin-pages/src/page-tree/fallback-render-page-link.tsx delete mode 100644 packages/typedoc-plugin-pages/src/page-tree/index.ts delete mode 100644 packages/typedoc-plugin-pages/src/search/index.ts create mode 100644 packages/typedoc-plugin-pages/src/theme-plugins/index.ts rename packages/typedoc-plugin-pages/src/{ => theme-plugins}/page-tree/a-page-tree-builder.spec.ts (97%) rename packages/typedoc-plugin-pages/src/{ => theme-plugins}/page-tree/a-page-tree-builder.ts (96%) rename packages/typedoc-plugin-pages/src/{page-tree/fallback-page-tree-builder.spec.ts => theme-plugins/page-tree/default-tree-builder.spec.ts} (88%) rename packages/typedoc-plugin-pages/src/{page-tree/fallback-page-tree-builder.tsx => theme-plugins/page-tree/default-tree-builder.tsx} (81%) create mode 100644 packages/typedoc-plugin-pages/src/theme-plugins/page-tree/index.ts rename packages/typedoc-plugin-pages/src/{ => theme-plugins}/page-tree/types.ts (76%) rename packages/typedoc-plugin-pages/src/{ => theme-plugins}/page-tree/utils.ts (95%) rename packages/typedoc-plugin-pages/src/{search/custom-javascript-index-plugin.GENERATED.ts.patch => theme-plugins/search/default-pages-javascript-index-plugin.GENERATED.ts.patch} (93%) create mode 100644 packages/typedoc-plugin-pages/src/theme-plugins/search/index.ts diff --git a/packages/typedoc-plugin-pages/__tests__/integration/__snapshots__/simple.spec.ts.snap b/packages/typedoc-plugin-pages/__tests__/integration/__snapshots__/simple.spec.ts.snap index cd3db652..f4e5372e 100644 --- a/packages/typedoc-plugin-pages/__tests__/integration/__snapshots__/simple.spec.ts.snap +++ b/packages/typedoc-plugin-pages/__tests__/integration/__snapshots__/simple.spec.ts.snap @@ -13,6 +13,7 @@ exports[`Real behavior should render correctly 1`] = ` + @@ -111,10 +112,10 @@ exports[`Real behavior should render correctly 1`] = `