refactor: remove typedoc.json and update tsconfig.json includes

pull/7160/head
Mert Sincan 2025-01-27 23:34:38 +00:00
parent 6fa4442cef
commit 9503798742
7 changed files with 8965 additions and 1796 deletions

File diff suppressed because it is too large Load Diff

View File

@ -16,30 +16,29 @@ const staticMessages = {
tokens: 'Define design tokens used by the component.'
};
const app = new TypeDoc.Application();
const getTypeDoc = (typeDocOptions) => {
const app = new TypeDoc.Application();
// If you want TypeDoc to load tsconfig.json / typedoc.json files
app.options.addReader(new TypeDoc.TSConfigReader());
app.options.addReader(new TypeDoc.TypeDocReader());
// If you want TypeDoc to load tsconfig.json / typedoc.json files
app.options.addReader(new TypeDoc.TSConfigReader());
//app.options.addReader(new TypeDoc.TypeDocReader());
app.bootstrap({
app.bootstrap({
// typedoc options here
name: 'PrimeVue',
entryPoints: [`src/`],
entryPointStrategy: 'expand',
hideGenerator: true,
excludeExternals: true,
excludeExternals: false,
includeVersion: true,
searchInComments: true,
disableSources: true,
logLevel: 'Error',
sort: ['source-order'],
exclude: ['node_modules', 'src/**/*.js']
});
...typeDocOptions
});
const project = app.convert();
const project = app.convert();
if (project) {
if (project) {
const doc = {};
const parseText = (text) => {
@ -483,7 +482,9 @@ if (project) {
prop.comment.summary
.map((s) => {
if (s.text.indexOf('[here]') > -1) {
return `${s.text.slice(0, s.text.indexOf('[here]'))} <a target="_blank" href="${s.text.slice(s.text.indexOf('(') + 1, s.text.indexOf(')'))}">here</a> ${s.text.slice(s.text.indexOf(')') + 1)}`;
return `${s.text.slice(0, s.text.indexOf('[here]'))} <a target="_blank" href="${s.text.slice(s.text.indexOf('(') + 1, s.text.indexOf(')'))}">here</a> ${s.text.slice(
s.text.indexOf(')') + 1
)}`;
}
return s.text || '';
@ -683,10 +684,21 @@ if (project) {
// app.generateJson(module, `./api-generator/module-typedoc.json`);
});
const typedocJSON = JSON.stringify(doc, null, 4);
!fs.existsSync(outputPath) && fs.mkdirSync(outputPath);
fs.writeFileSync(path.resolve(outputPath, 'index.json'), typedocJSON);
return doc;
// app.generateJson(project, `./api-generator/typedoc.json`);
}
}
};
const inlineDocs = getTypeDoc({
name: 'PrimeVue',
entryPoints: ['../../packages/primevue', '../../packages/forms']
});
const themeDocs = getTypeDoc({
name: 'PrimeUIX',
entryPoints: ['../../node_modules/@primeuix/themes/types']
});
!fs.existsSync(outputPath) && fs.mkdirSync(outputPath);
fs.writeFileSync(path.resolve(outputPath, 'index.json'), JSON.stringify({ ...inlineDocs, ...themeDocs }, null, 4));

View File

@ -17,12 +17,8 @@
},
"include": [
"../../packages/primevue/src/**/*.d.ts",
"../../packages/primevue/src/**/style/*.d.ts",
"../../packages/themes/types",
"../packages/themes/src/**/**/index.js",
"../packages/forms/src/**/*.d.ts",
"../../packages/forms/src/**/*.d.ts",
"../../packages/forms/src/**/style/*.d.ts"
"../../node_modules/@primeuix/themes/types/**/*.d.ts"
],
"exclude": ["node_modules", "**/node_modules", "**/dist"]
}

View File

@ -1,5 +0,0 @@
{
"$schema": "https://typedoc.org/schema.json",
"entryPoints": ["../../packages/primevue", "../../packages/themes", "../../packages/forms"],
"sort": ["source-order"]
}