@ox-content/vite-plugin 2.13.0 → 2.15.0
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/dist/index.cjs +17 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +46 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +46 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +17 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -683,13 +683,25 @@ const DEFAULT_DOCS_INCLUDE = [
|
|
|
683
683
|
*/
|
|
684
684
|
async function extractDocs(srcDirs, options) {
|
|
685
685
|
const napi = await require_mermaid.importNapiModule();
|
|
686
|
+
if (options.entryPoints?.length) {
|
|
687
|
+
const extractDocsFromEntryPoints = napi.extractDocsFromEntryPoints;
|
|
688
|
+
if (!extractDocsFromEntryPoints) throw new Error("[ox-content] extractDocsFromEntryPoints is not available from @ox-content/napi.");
|
|
689
|
+
return extractDocsFromEntryPoints(options.entryPoints, {
|
|
690
|
+
root: process.cwd(),
|
|
691
|
+
private: options.private,
|
|
692
|
+
internal: options.internal
|
|
693
|
+
}).map((doc) => ({
|
|
694
|
+
file: doc.file,
|
|
695
|
+
entries: doc.entries
|
|
696
|
+
}));
|
|
697
|
+
}
|
|
686
698
|
const extractFileDocEntries = napi.extractFileDocEntries;
|
|
687
699
|
if (!extractFileDocEntries) throw new Error("[ox-content] extractFileDocEntries is not available from @ox-content/napi.");
|
|
688
700
|
const results = [];
|
|
689
701
|
for (const srcDir of srcDirs) {
|
|
690
702
|
const files = napi.collectDocsSourceFiles(srcDir, options.include, options.exclude);
|
|
691
703
|
for (const file of files) {
|
|
692
|
-
const entries = extractFileDocEntries(file, options.private);
|
|
704
|
+
const entries = extractFileDocEntries(file, options.private, options.internal);
|
|
693
705
|
if (entries.length > 0) results.push({
|
|
694
706
|
file,
|
|
695
707
|
entries
|
|
@@ -761,7 +773,8 @@ function toRustDocsModules(docs) {
|
|
|
761
773
|
file: entry.file,
|
|
762
774
|
line: entry.line,
|
|
763
775
|
endLine: entry.endLine,
|
|
764
|
-
signature: entry.signature
|
|
776
|
+
signature: entry.signature,
|
|
777
|
+
members: entry.members
|
|
765
778
|
}))
|
|
766
779
|
}));
|
|
767
780
|
}
|
|
@@ -781,8 +794,10 @@ function resolveDocsOptions(options) {
|
|
|
781
794
|
"**/*.spec.*",
|
|
782
795
|
"node_modules"
|
|
783
796
|
],
|
|
797
|
+
entryPoints: opts.entryPoints?.map((entryPoint) => typeof entryPoint === "string" ? { path: entryPoint } : entryPoint),
|
|
784
798
|
format: opts.format ?? "markdown",
|
|
785
799
|
private: opts.private ?? false,
|
|
800
|
+
internal: opts.internal ?? false,
|
|
786
801
|
toc: false,
|
|
787
802
|
groupBy: opts.groupBy ?? "file",
|
|
788
803
|
githubUrl: opts.githubUrl,
|