@ts-for-gir/typedoc-theme 4.0.0-rc.13 → 4.0.0-rc.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/partials/sidebar.ts +13 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ts-for-gir/typedoc-theme",
|
|
3
|
-
"version": "4.0.0-rc.
|
|
3
|
+
"version": "4.0.0-rc.14",
|
|
4
4
|
"description": "Custom TypeDoc theme inspired by gi-docgen for ts-for-gir",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"module": "src/index.ts",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
".": "./src/index.ts"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@ts-for-gir/tsconfig": "^4.0.0-rc.
|
|
38
|
+
"@ts-for-gir/tsconfig": "^4.0.0-rc.14",
|
|
39
39
|
"@types/lunr": "^2.3.7",
|
|
40
|
-
"@types/node": "^25.6.
|
|
40
|
+
"@types/node": "^25.6.2",
|
|
41
41
|
"typescript": "^6.0.3"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
package/src/partials/sidebar.ts
CHANGED
|
@@ -17,8 +17,19 @@ function getTsForGirVersion(): string {
|
|
|
17
17
|
if (typeof __TS_FOR_GIR_VERSION__ !== "undefined") {
|
|
18
18
|
return __TS_FOR_GIR_VERSION__;
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
// Dev mode reads the sibling package.json relative to this source file.
|
|
21
|
+
// Wrapped in try/catch so a bundle missing the __TS_FOR_GIR_VERSION__ define
|
|
22
|
+
// (or whose path math doesn't line up with its install location — e.g.
|
|
23
|
+
// when the GJS bundle lives at node_modules/@ts-for-gir/cli/bin/ rather
|
|
24
|
+
// than the typedoc-theme source layout) degrades to an empty string and
|
|
25
|
+
// downstream renderers fall back to "no version" instead of crashing the
|
|
26
|
+
// whole CLI at module load.
|
|
27
|
+
try {
|
|
28
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
29
|
+
return JSON.parse(readFileSync(join(__dirname, "..", "..", "package.json"), "utf8")).version as string;
|
|
30
|
+
} catch {
|
|
31
|
+
return "";
|
|
32
|
+
}
|
|
22
33
|
}
|
|
23
34
|
|
|
24
35
|
const TSFOR_GIR_VERSION = getTsForGirVersion();
|