Skip to content

Commit

Permalink
fix: backward compatibility with reference type (.target vs .id)
Browse files Browse the repository at this point in the history
  • Loading branch information
barjin committed Oct 9, 2024
1 parent b9f8325 commit 705c411
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 17 deletions.
2 changes: 1 addition & 1 deletion packages/plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apify/docusaurus-plugin-typedoc-api",
"version": "4.2.5",
"version": "4.2.6",
"description": "Docusaurus plugin that provides source code API documentation powered by TypeDoc. ",
"keywords": [
"docusaurus",
Expand Down
4 changes: 3 additions & 1 deletion packages/plugin/src/components/Type.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ export function Type({ needsParens = false, type: base }: TypeProps) {

case 'reference': {
const type = base as JSONOutput.ReferenceType;
const ref = type.target ? reflections[Number(type.target)] : null;
// eslint-disable-next-line
const reflectionIdentifier = type.target ?? (type as any).id;
const ref = reflectionIdentifier ? reflections[Number(reflectionIdentifier)] : null;
const genericClass = ref?.id && !ref.sources ? 'tsd-signature-type-generic' : '';

return (
Expand Down
53 changes: 38 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4311,7 +4311,7 @@ __metadata:
languageName: node
linkType: hard

"@types/react@npm:*, @types/react@npm:^18.2.48":
"@types/react@npm:*":
version: 18.3.4
resolution: "@types/react@npm:18.3.4"
dependencies:
Expand All @@ -4321,6 +4321,16 @@ __metadata:
languageName: node
linkType: hard

"@types/react@npm:^18.3.3":
version: 18.3.11
resolution: "@types/react@npm:18.3.11"
dependencies:
"@types/prop-types": "npm:*"
csstype: "npm:^3.0.2"
checksum: a36f0707fdfe9fe19cbe5892bcdab0f042ecadb501ea4e1c39519943f3e74cffbd31e892d3860f5c87cf33f5f223552b246a552bed0087b95954f2cb39d5cf65
languageName: node
linkType: hard

"@types/resolve@npm:1.20.2":
version: 1.20.2
resolution: "@types/resolve@npm:1.20.2"
Expand Down Expand Up @@ -5953,13 +5963,6 @@ __metadata:
languageName: node
linkType: hard

"camelcase@npm:^7.0.1":
version: 7.0.1
resolution: "camelcase@npm:7.0.1"
checksum: 86ab8f3ebf08bcdbe605a211a242f00ed30d8bfb77dab4ebb744dd36efbc84432d1c4adb28975ba87a1b8be40a80fbd1e60e2f06565315918fa7350011a26d3d
languageName: node
linkType: hard

"caniuse-api@npm:^3.0.0":
version: 3.0.0
resolution: "caniuse-api@npm:3.0.0"
Expand Down Expand Up @@ -7421,17 +7424,17 @@ __metadata:
dependencies:
"@moonrepo/dev": "npm:^2.0.1"
"@types/marked": "npm:^6.0.0"
"@types/react": "npm:^18.2.48"
"@types/react": "npm:^18.3.3"
eslint: "npm:^8.56.0"
eslint-config-moon: "npm:^2.0.14"
lerna: "npm:^7.4.2"
packemon: "npm:^3.2.3"
prettier: "npm:^3.2.4"
prettier: "npm:^3.3.3"
prettier-config-moon: "npm:^1.1.2"
react: "npm:^18.2.0"
rimraf: "npm:^5.0.5"
tsconfig-moon: "npm:^1.3.0"
typescript: "npm:^5.3.3"
typescript: "npm:^5.5.4"
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -14894,7 +14897,7 @@ __metadata:
languageName: node
linkType: hard

"prettier@npm:^3.2.4":
"prettier@npm:^3.3.3":
version: 3.3.3
resolution: "prettier@npm:3.3.3"
bin:
Expand Down Expand Up @@ -16882,9 +16885,9 @@ __metadata:
languageName: node
linkType: hard

"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.0.0, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.2, string-width@npm:^4.2.3":
version: 4.2.3
resolution: "string-width@npm:4.2.3"
"stop-iteration-iterator@npm:^1.0.0":
version: 1.0.0
resolution: "stop-iteration-iterator@npm:1.0.0"
dependencies:
internal-slot: "npm:^1.0.4"
checksum: 2a23a36f4f6bfa63f46ae2d53a3f80fe8276110b95a55345d8ed3d92125413494033bc8697eb774e8f7aeb5725f70e3d69753caa2ecacdac6258c16fa8aa8b0f
Expand Down Expand Up @@ -17707,6 +17710,16 @@ __metadata:
languageName: node
linkType: hard

"typescript@npm:^5.5.4":
version: 5.6.3
resolution: "typescript@npm:5.6.3"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: c328e418e124b500908781d9f7b9b93cf08b66bf5936d94332b463822eea2f4e62973bfb3b8a745fdc038785cb66cf59d1092bac3ec2ac6a3e5854687f7833f1
languageName: node
linkType: hard

"typescript@patch:typescript@npm%3A>=3 < 6#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A~5.5.2#optional!builtin<compat/typescript>":
version: 5.5.4
resolution: "typescript@patch:typescript@npm%3A5.5.4#optional!builtin<compat/typescript>::version=5.5.4&hash=29ae49"
Expand All @@ -17727,6 +17740,16 @@ __metadata:
languageName: node
linkType: hard

"typescript@patch:typescript@npm%3A^5.5.4#optional!builtin<compat/typescript>":
version: 5.6.3
resolution: "typescript@patch:typescript@npm%3A5.6.3#optional!builtin<compat/typescript>::version=5.6.3&hash=29ae49"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: dc4bec403cd33a204b655b1152a096a08e7bad2c931cb59ef8ff26b6f2aa541bf98f09fc157958a60c921b1983a8dde9a85b692f9de60fa8f574fd131e3ae4dd
languageName: node
linkType: hard

"uglify-js@npm:^3.1.4":
version: 3.19.2
resolution: "uglify-js@npm:3.19.2"
Expand Down

0 comments on commit 705c411

Please sign in to comment.