fumadocs-typescript 1.0.1 → 1.0.2
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.
|
@@ -5,6 +5,10 @@ interface TypescriptConfig {
|
|
|
5
5
|
tsconfigPath?: string;
|
|
6
6
|
/** A root directory to resolve relative path entries in the config file to. e.g. outDir */
|
|
7
7
|
basePath?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Default lib directory, use `./node_modules/typescript/lib` if not specified
|
|
10
|
+
*/
|
|
11
|
+
getDefaultLibLocation?: (() => string) | 'default';
|
|
8
12
|
}
|
|
9
13
|
|
|
10
14
|
interface GeneratedDoc {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
2
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
3
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
4
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -16,7 +14,6 @@ var __spreadValues = (a, b) => {
|
|
|
16
14
|
}
|
|
17
15
|
return a;
|
|
18
16
|
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
17
|
var __objRest = (source, exclude) => {
|
|
21
18
|
var target = {};
|
|
22
19
|
for (var prop in source)
|
|
@@ -30,7 +27,7 @@ var __objRest = (source, exclude) => {
|
|
|
30
27
|
return target;
|
|
31
28
|
};
|
|
32
29
|
var __async = (__this, __arguments, generator) => {
|
|
33
|
-
return new Promise((
|
|
30
|
+
return new Promise((resolve2, reject) => {
|
|
34
31
|
var fulfilled = (value) => {
|
|
35
32
|
try {
|
|
36
33
|
step(generator.next(value));
|
|
@@ -45,7 +42,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
45
42
|
reject(e);
|
|
46
43
|
}
|
|
47
44
|
};
|
|
48
|
-
var step = (x) => x.done ?
|
|
45
|
+
var step = (x) => x.done ? resolve2(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
49
46
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
50
47
|
});
|
|
51
48
|
};
|
|
@@ -54,6 +51,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
54
51
|
import ts2 from "typescript";
|
|
55
52
|
|
|
56
53
|
// src/program.ts
|
|
54
|
+
import * as path from "path";
|
|
57
55
|
import ts from "typescript";
|
|
58
56
|
var cache = /* @__PURE__ */ new Map();
|
|
59
57
|
function getFileSymbol(file, program) {
|
|
@@ -64,25 +62,31 @@ function getFileSymbol(file, program) {
|
|
|
64
62
|
return checker.getSymbolAtLocation(sourceFile);
|
|
65
63
|
}
|
|
66
64
|
function getProgram(options = {}) {
|
|
67
|
-
var _a, _b, _c;
|
|
65
|
+
var _a, _b, _c, _d;
|
|
68
66
|
const key = JSON.stringify(options);
|
|
69
67
|
const cached = cache.get(key);
|
|
70
68
|
if (cached)
|
|
71
69
|
return cached;
|
|
72
70
|
const configFile = ts.readJsonConfigFile(
|
|
73
71
|
(_a = options.tsconfigPath) != null ? _a : "./tsconfig.json",
|
|
74
|
-
(
|
|
72
|
+
(p) => ts.sys.readFile(p)
|
|
75
73
|
);
|
|
76
74
|
const parsed = ts.parseJsonSourceFileConfigFileContent(
|
|
77
75
|
configFile,
|
|
78
76
|
ts.sys,
|
|
79
77
|
(_b = options.basePath) != null ? _b : "./"
|
|
80
78
|
);
|
|
79
|
+
parsed.options.incremental = false;
|
|
80
|
+
const host = ts.createCompilerHost(parsed.options);
|
|
81
|
+
if (options.getDefaultLibLocation !== "default") {
|
|
82
|
+
host.getDefaultLibLocation = (_c = options.getDefaultLibLocation) != null ? _c : () => path.resolve("./node_modules/typescript/lib");
|
|
83
|
+
}
|
|
81
84
|
const program = ts.createProgram({
|
|
82
|
-
rootNames: (
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
rootNames: (_d = options.files) != null ? _d : parsed.fileNames,
|
|
86
|
+
host,
|
|
87
|
+
options: parsed.options,
|
|
88
|
+
configFileParsingDiagnostics: parsed.errors,
|
|
89
|
+
projectReferences: parsed.projectReferences
|
|
86
90
|
});
|
|
87
91
|
cache.set(key, program);
|
|
88
92
|
return program;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { G as GenerateOptions, T as TypescriptConfig, a as GeneratedDoc, D as DocEntry } from './base-
|
|
2
|
-
export { b as GenerateDocumentationOptions, c as generate, g as generateDocumentation } from './base-
|
|
1
|
+
import { G as GenerateOptions, T as TypescriptConfig, a as GeneratedDoc, D as DocEntry } from './base-3iGxlbJG.js';
|
|
2
|
+
export { b as GenerateDocumentationOptions, c as generate, g as generateDocumentation } from './base-3iGxlbJG.js';
|
|
3
3
|
import fg from 'fast-glob';
|
|
4
4
|
import 'typescript';
|
|
5
5
|
|
package/dist/index.js
CHANGED
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as GenerateOptions } from '../base-
|
|
1
|
+
import { G as GenerateOptions } from '../base-3iGxlbJG.js';
|
|
2
2
|
import 'typescript';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -10,6 +10,6 @@ declare function AutoTypeTable({ path, name, options, }: {
|
|
|
10
10
|
path: string;
|
|
11
11
|
name: string;
|
|
12
12
|
options?: GenerateOptions;
|
|
13
|
-
}):
|
|
13
|
+
}): React.ReactElement;
|
|
14
14
|
|
|
15
15
|
export { AutoTypeTable };
|
package/dist/ui/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateDocumentation
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-KXYVJC2E.js";
|
|
4
4
|
|
|
5
5
|
// src/ui/auto-type-table.tsx
|
|
6
6
|
import { TypeTable } from "fumadocs-ui/components/type-table";
|
|
@@ -9,9 +9,7 @@ import { TypeTable } from "fumadocs-ui/components/type-table";
|
|
|
9
9
|
import { fromMarkdown } from "mdast-util-from-markdown";
|
|
10
10
|
import { gfmFromMarkdown } from "mdast-util-gfm";
|
|
11
11
|
import { toHast } from "mdast-util-to-hast";
|
|
12
|
-
import {
|
|
13
|
-
toJsxRuntime
|
|
14
|
-
} from "hast-util-to-jsx-runtime";
|
|
12
|
+
import { toJsxRuntime } from "hast-util-to-jsx-runtime";
|
|
15
13
|
import * as runtime from "react/jsx-runtime";
|
|
16
14
|
function renderMarkdown(md) {
|
|
17
15
|
const mdast = fromMarkdown(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-typescript",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Typescript Integration for Fumadocs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/hast": "^3.0.4",
|
|
46
46
|
"@types/mdast": "^4.0.3",
|
|
47
|
-
"@types/react": "18.2.
|
|
48
|
-
"@types/react-dom": "18.2.
|
|
47
|
+
"@types/react": "18.2.67",
|
|
48
|
+
"@types/react-dom": "18.2.22",
|
|
49
49
|
"eslint-config-custom": "0.0.0",
|
|
50
|
-
"fumadocs-ui": "10.0
|
|
50
|
+
"fumadocs-ui": "10.1.0",
|
|
51
51
|
"tsconfig": "0.0.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|