Closed B4nan closed 12 months ago
I'm getting sources
generated correctly for Serenity/JS using:
docusaurus-plugin-typedoc-api
: 3.0.1
, docusaurus
: 2.4.3
typedoc
: 0.25.2
typescript
: 5.1.6
Maybe it's the TypeScript version affecting the result?
@B4nan I think the problem is is that TypeDoc doesn't consider index.ts
a module anymore. It doesn't show up in the list:
{
allSourceFiles: {
'3rd-party/apify-client-js/src/resource_clients/dataset.ts': true,
'3rd-party/apify-client-js/src/resource_clients/user.ts': true,
'3rd-party/apify-client-js/src/resource_clients/schedule.ts': true,
'3rd-party/apify-client-js/src/resource_clients/webhook_dispatch.ts': true,
'3rd-party/apify-client-js/src/resource_clients/actor.ts': true,
'3rd-party/apify-client-js/src/resource_clients/actor_collection.ts': true,
'3rd-party/apify-client-js/src/apify_api_error.ts': true,
'3rd-party/apify-client-js/src/apify_client.ts': true,
'3rd-party/apify-client-js/src/resource_clients/build.ts': true,
'3rd-party/apify-client-js/src/resource_clients/build_collection.ts': true,
'3rd-party/apify-client-js/src/resource_clients/dataset_collection.ts': true,
'3rd-party/apify-client-js/src/interceptors.ts': true,
'3rd-party/apify-client-js/src/resource_clients/key_value_store.ts': true,
'3rd-party/apify-client-js/src/resource_clients/key_value_store_collection.ts': true,
'3rd-party/apify-client-js/src/resource_clients/log.ts': true,
'3rd-party/apify-client-js/src/resource_clients/request_queue.ts': true,
'3rd-party/apify-client-js/src/resource_clients/request_queue_collection.ts': true,
'3rd-party/apify-client-js/src/resource_clients/run.ts': true,
'3rd-party/apify-client-js/src/resource_clients/run_collection.ts': true,
'3rd-party/apify-client-js/src/resource_clients/schedule_collection.ts': true,
'3rd-party/apify-client-js/src/resource_clients/store_collection.ts': true,
'3rd-party/apify-client-js/src/resource_clients/task.ts': true,
'3rd-party/apify-client-js/src/resource_clients/task_collection.ts': true,
'3rd-party/apify-client-js/src/resource_clients/webhook.ts': true,
'3rd-party/apify-client-js/src/resource_clients/webhook_collection.ts': true,
'3rd-party/apify-client-js/src/resource_clients/webhook_dispatch_collection.ts': true,
'3rd-party/apify-client-js/src/utils.ts': true
},
isSinglePackage: true,
isUsingDeepImports: false,
packagePath: '.'
} { relModSourceFile: '', relEntryPoint: 'src/index.ts' }
Probably because it just re-exports stuff and doesn't defined it's own types?
Confirmed that adding an explicit type to the index fixes it.
I can try and "hack" this in the plugin, but feels weird.
The fix is in v4
After updating to latest version (3.0.1 with TS 5.2), the generated
api-typedoc-default.json
file no longer hassources
in the children in our case, so this line fails withTypeError: Cannot read properties of undefined (reading 'sources')
. Using optional chaining on that array item on its own will make the build pass, but the page is not generated properly (I get 404 when switching to the next version).When I log the
mod
object in that place, I get:But when I open that JSON file, I can see the
children
are there:It's from this repository: https://github.com/apify/apify-sdk-js (I can PR the broken update if you want, but its just about updating the dependencies in
website
folder. Also tried to bump typedoc to 0.25.1 (viaoverrides
) but no luck with that either.