Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with the latest typedoc #15

Open
DarkPark opened this issue Jun 5, 2023 · 1 comment
Open

Does not work with the latest typedoc #15

DarkPark opened this issue Jun 5, 2023 · 1 comment

Comments

@DarkPark
Copy link

DarkPark commented Jun 5, 2023

After the deps update I got an error:

$ npm run build:docs

> test@2.3.0 build:docs
> typedoc

[info] Loaded plugin typedoc-plugin-missing-exports
Loaded plugin typedoc-plugin-versions
[info] Loaded plugin typedoc-theme-yaf
[warning] TypeDoc has been loaded multiple times. This is commonly caused by plugins which have their own installation of TypeDoc. The loaded paths are:
        /projects/test/node_modules/typedoc
        /projects/test/node_modules/typedoc-theme-yaf/node_modules/typedoc
TypeDoc exiting with unexpected error:
TypeError [ERR_INVALID_ARG_TYPE]: The "from" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:399:5)
    at validateString (node:internal/validators:163:11)
    at relative (node:path:1191:5)
    at ReflectionSymbolId.toObject (/projects/test/node_modules/typedoc/dist/lib/models/reflections/ReflectionSymbolId.js:49:66)
    at /projects/test/node_modules/typedoc/dist/lib/models/reflections/project.js:214:35
    at Map.forEach (<anonymous>)
    at ProjectReflection.toObject (/projects/test/node_modules/typedoc/dist/lib/models/reflections/project.js:213:40)
    at Serializer.toObject (/projects/test/node_modules/typedoc/dist/lib/serialization/serializer.js:21:69)
    at Renderer.prepareYafTheme (/projects/test/node_modules/typedoc-theme-yaf/src/backend/YafTheme.js:93:59)
    at triggerEvents (/projects/test/node_modules/typedoc/dist/lib/utils/events.js:191:43) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Looks like wrong inheritance from the default theme.
TypeStrong/typedoc#1786
TypeStrong/typedoc#1741 (comment)

dependencies in package.json:

"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typedoc-theme-hierarchy": "^3.2.0",
"typedoc-theme-yaf": "^0.0.4",
"typescript": "^5.1.3"

typedoc.json:

{
    "entryPoints": [
        "./src/index.ts",
    ],
    "exclude": ["./src/test.ts"],
    "out": "docs",
    "includes": "./src",
    "readme": "./readme.md",
    "sort": ["static-first", "alphabetical"],
    "disableSources": false,
    "plugin": ["typedoc-plugin-missing-exports", "typedoc-theme-yaf"],
	"theme": "yaf"
}
@citkane
Copy link
Owner

citkane commented Jun 7, 2023

Hi @DarkPark

This theme is compatible with Typedoc 0.23.x, and not with 0.24.x or later.

Given the nature of how this theme works and breaking API changes in Typedoc over minor releases, I am likely to peg this to 0.23.x and unlikely to upgrade until there is incentive for this projects long term goals.

To summarise;

  1. This theme uses the Typedoc API to parse Typescript into .json fragments (not .html), which then get consumed by a standalone frontend Single Page Application (SPA).
  2. Typedoc can already output .json, but the output is not complete enough to wrap a useful SPA around.
  3. This theme can continue developing if and when;
    3.1. Typedoc .json output is complete and consistent
    3.2. I have incentive to develop a standalone Typescript parser, thus creating a standalone document product.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants