Skip to content

Commit

Permalink
Merge branch 'refs/heads/v18' into modern-divider
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed Ben Makhlouf committed Oct 20, 2024
2 parents 29b7942 + 384122c commit 8b595a7
Show file tree
Hide file tree
Showing 996 changed files with 34,622 additions and 18,003 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ Thumbs.db

# type doc
api-generator/typedoc.json
api-generator/themedoc.json
.vercel
.nx

builder/node_modules
builder/node_modules
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@
[![PrimeNG Hero](https://www.primefaces.org/static/social/primeng-preview.jpg)](https://primeng.org)

### Website

Visit the [PrimeNG Website](https://v18.primeng.org) for general information, demos and documentation.
PrimeNG is a rich set of open source UI Components for Angular. Visit the [PrimeNG website](https://primeng.org/) for interactive demos, comprehensive documentation and additional resources.
2 changes: 1 addition & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
"sourceMap": false
}
},
"defaultConfiguration": "production"
Expand Down
23 changes: 4 additions & 19 deletions api-generator/build-apidoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,11 @@ async function main() {
disableSources: false,
logLevel: 'Error',
sort: ['source-order'],
exclude: [
'node_modules',
'src/app/components/**/*spec.ts',
'src/app/components/**/*public_api.ts',
'src/app/components/**/*interface.ts',
],
exclude: ['node_modules', 'src/app/components/**/*spec.ts', 'src/app/components/**/*public_api.ts'],
});

const project = await app.convert();
await app.generateJson(project, `./api-generator/typedoc.json`);

if (project) {
let doc = {};

Expand Down Expand Up @@ -85,7 +79,6 @@ async function main() {
};

const modules = project.groups.find((g) => g.title === 'Modules');

if (isProcessable(modules)) {
modules.children.forEach((module) => {
const name = module.name.replace(/.*\//, '');
Expand Down Expand Up @@ -483,6 +476,7 @@ async function main() {
description: staticMessages['types'],
values: [],
};

module_types_group.children.forEach((t) => {
const parameters =
t.signatures && t.signatures[0]?.parameters
Expand Down Expand Up @@ -556,17 +550,8 @@ async function main() {

types.values.push({
name: t.name,
description: t.comment && t.comment.summary.map((s) => s.text || '').join(' '),
type: parameters.length || returnType ? 'function' : t.type && t.type.name,
children: typeChildren.length ? typeChildren : undefined,
parameters: parameters.length ? parameters : undefined,
returns: returnType
? {
type: returnType,
description: returnDescription,
}
: undefined,
deprecated: getDeprecatedText(t),
value: getTypesValue(t),
description: t.comment.summary && t.comment.summary.map((s) => s.text || '').join(' '),
});
});

Expand Down
92 changes: 92 additions & 0 deletions api-generator/build-theming.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
//@ts-ignore
const TypeDoc = require('typedoc');
//@ts-ignore
const path = require('path');
//@ts-ignore
const fs = require('fs');
//@ts-ignore
const rootDir = path.resolve(__dirname, '../');
//@ts-ignore
const outputPath = path.resolve(rootDir, 'src/app/showcase/doc/apidoc');

// const staticMessages = {
// methods: "Defines methods that can be accessed by the component's reference.",
// emits: 'Defines emit that determine the behavior of the component based on a given condition or report the actions that the component takes.',
// templates: 'Defines the templates used by the component.',
// events: "Defines the custom events used by the component's emitters.",
// interfaces: 'Defines the custom interfaces used by the module.',
// types: 'Defines the custom types used by the module.',
// props: 'Defines the input properties of the component.',
// service: 'Defines the service used by the component',
// };

async function theming() {
const app = await TypeDoc.Application.bootstrapWithPlugins({
// typedoc options here
name: 'PrimeNG',
entryPoints: [`src/app/components/themes/types/accordion/`, `src/app/components/themes/types/panel/`],
entryPointStrategy: 'expand',
hideGenerator: true,
excludeExternals: true,
includeVersion: true,
searchInComments: true,
disableSources: false,
logLevel: 'Error',
sort: ['source-order'],
exclude: ['node_modules', 'src/app/components/**/*spec.ts', 'src/app/components/**/*public_api.ts'],
});

const project = await app.convert();
await app.generateJson(project, `./api-generator/themedoc.json`);
// console.log(project);
if (project) {
let doc = {};

const parseText = (text) => {
return text.replace(/{/g, '{').replace(/}/g, '}');
};

const getDeprecatedText = (signature) => {
const deprecatedTag = signature?.comment?.getTag('@deprecated');
return deprecatedTag ? parseText(deprecatedTag.content[0].text) : undefined;
};

const isProcessable = (value) => {
return value && value.children && value.children.length;
};

const allowed = (name) => {
return !name.includes('ts-helpers') && !name.includes('icons');
};

const modules = project.groups.find((g) => g.title === 'Modules');
modules.children.forEach((child) => {
const _name = child.name.split('/').pop();
doc[_name] = {
name: _name,
properties: {},
};

child.groups.forEach((group) => {
// console.log(group.children);
});
});

let mergedDocs = {};

for (const key in doc) {
if (!mergedDocs[key]) {
mergedDocs[key] = {
...doc[key],
};
}
}

const typedocJSON = JSON.stringify(mergedDocs, null, 4);

!fs.existsSync(outputPath) && fs.mkdirSync(outputPath);
fs.writeFileSync(path.resolve(outputPath, 'index.json'), typedocJSON);
}
}

theming().catch(console.error);
Loading

0 comments on commit 8b595a7

Please sign in to comment.