Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@
"build": "pnpm -r build"
},
"devDependencies": {
"@angular-eslint/builder": "^20.2.0",
"@angular-eslint/eslint-plugin": "^20.2.0",
"@angular-eslint/eslint-plugin-template": "^20.2.0",
"@angular-eslint/schematics": "^20.2.0",
"@angular-eslint/template-parser": "^20.2.0",
"@eslint/js": "^9.24.0",
"@typescript-eslint/eslint-plugin": "^8.41.0",
"@typescript-eslint/parser": "^8.41.0",
"eslint": "^9.24.0",
"eslint-config-prettier": "^10.1.2",
"eslint-plugin-prettier": "^5.2.6",
"eslint-plugin-sonarjs": "^3.0.2",
"@angular-eslint/builder": "^20.7.0",
"@angular-eslint/eslint-plugin": "^20.7.0",
"@angular-eslint/eslint-plugin-template": "^20.7.0",
"@angular-eslint/schematics": "^20.7.0",
"@angular-eslint/template-parser": "^20.7.0",
"@eslint/js": "^9.39.2",
"@typescript-eslint/eslint-plugin": "^8.53.1",
"@typescript-eslint/parser": "^8.53.1",
"eslint": "^9.39.2",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.5",
"eslint-plugin-sonarjs": "^3.0.5",
"eslint-plugin-unicorn": "^58.0.0",
"prettier": "^3.2.5",
"typescript": "~5.9.x"
"prettier": "^3.8.1",
"typescript": "~5.9.3"
},
"packageManager": "pnpm@10.22.0+sha512.bf049efe995b28f527fd2b41ae0474ce29186f7edcb3bf545087bd61fbbebb2bf75362d1307fda09c2d288e1e499787ac12d4fcb617a974718a6051f2eee741c"
"packageManager": "pnpm@10.28.1+sha512.7d7dbbca9e99447b7c3bf7a73286afaaf6be99251eb9498baefa7d406892f67b879adb3a1d7e687fc4ccc1a388c7175fbaae567a26ab44d1067b54fcb0d6a316"
}
38 changes: 19 additions & 19 deletions packages/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^20.2.2",
"@angular/common": "^20.2.2",
"@angular/compiler": "^20.2.2",
"@angular/core": "^20.2.2",
"@angular/forms": "^20.2.2",
"@angular/platform-browser": "^20.2.2",
"@angular/platform-browser-dynamic": "^20.2.2",
"@angular/router": "^20.2.2",
"rxjs": "~7.8.0",
"tslib": "^2.7.0",
"zone.js": "~0.15.0",
"@frankframework/doc-library-core": "workspace:^"
"@angular/animations": "^20.3.16",
"@angular/common": "^20.3.16",
"@angular/compiler": "^20.3.16",
"@angular/core": "^20.3.16",
"@angular/forms": "^20.3.16",
"@angular/platform-browser": "^20.3.16",
"@angular/platform-browser-dynamic": "^20.3.16",
"@angular/router": "^20.3.16",
"@frankframework/doc-library-core": "workspace:^",
"rxjs": "~7.8.2",
"tslib": "^2.8.1",
"zone.js": "~0.15.1"
},
"devDependencies": {
"@angular/build": "^20.2.1",
"@angular/cli": "^20.2.1",
"@angular/compiler-cli": "^20.2.2",
"@types/jasmine": "~5.1.0",
"jasmine-core": "^5.3.0",
"@angular/build": "^20.3.15",
"@angular/cli": "^20.3.15",
"@angular/compiler-cli": "^20.3.16",
"@types/jasmine": "~5.1.15",
"jasmine-core": "^5.13.0",
"karma": "^6.4.4",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-coverage": "~2.2.1",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"ng-packagr": "^20.2.0"
"ng-packagr": "^20.3.2"
},
"packageManager": "pnpm@10.18.0"
}
6 changes: 3 additions & 3 deletions packages/angular/projects/ff-doc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@frankframework/doc-library-ng",
"version": "1.0.0",
"version": "1.0.1",
"description": "A powerful and easy-to-use library, made for Angular, designed to extract and process information from the FF! Doc JSON.",
"main": "",
"author": "Vivy Booman",
Expand All @@ -12,9 +12,9 @@
"directory": "packages/angular/projects/ff-doc"
},
"peerDependencies": {
"@angular/core": "^20.2.2"
"@angular/core": "^20.2.2 || ^21.0.0"
},
"dependencies": {
"@frankframework/doc-library-core": "^1.0.0"
"@frankframework/doc-library-core": "~1.0.1"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Directive, inject, Input, OnChanges, TemplateRef, ViewContainerRef } from '@angular/core';
import { ElementClass, LinkData, transformAsHtml, transformAsText } from '@frankframework/doc-library-core';
import { ElementsWithInfo, LinkData, transformAsHtml, transformAsText } from '@frankframework/doc-library-core';

export type TemplateContext = { $implicit: string };
export type LinkTemplateContext = { $implicit: LinkData };
Expand All @@ -13,7 +13,7 @@ export type LinkTemplateContext = { $implicit: LinkData };
})
export class JavadocTransformDirective implements OnChanges {
@Input({ required: true }) fdJavadocTransformOf?: string;
@Input({ required: true }) fdJavadocTransformElements!: Record<string, ElementClass> | null;
@Input({ required: true }) fdJavadocTransformElements!: Record<string, ElementsWithInfo> | null;
@Input() fdJavadocTransformLink?: TemplateRef<LinkTemplateContext>;
@Input() fdJavadocTransformAsText = false;

Expand Down
8 changes: 8 additions & 0 deletions packages/angular/src/assets/example-ffdoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
]
},
"elements": {
"org.frankframework.test.TestElement": {
"name": "TestElement",
"description": "This is a test element used for demonstration purposes. See {@link FixedResultSender}"
},
"org.frankframework.senders.FixedResultSender": {
"name": "FixedResultSender",
"description": "FixedResultSender, same behaviour as {@link FixedResultPipe}, but now as a ISender.",
Expand Down Expand Up @@ -97,6 +101,10 @@
}
},
"elementNames": {
"TestElement": {
"labels": {},
"className": "org.frankframework.test.TestElement"
},
"FixedResultSender": {
"labels": {
"Components": "Senders",
Expand Down
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@frankframework/doc-library-core",
"version": "1.0.0",
"version": "1.0.1",
"type": "module",
"description": "A powerful and easy-to-use library, designed to extract and process information from the FF! Doc JSON.",
"module": "dist/doc-library-core.js",
Expand All @@ -21,8 +21,8 @@
"build": "vite build"
},
"devDependencies": {
"@microsoft/api-extractor": "^7.55.0",
"@microsoft/api-extractor": "^7.55.2",
"unplugin-dts": "1.0.0-beta.6",
"vite": "^7.2.2"
"vite": "^7.3.1"
}
}
19 changes: 12 additions & 7 deletions packages/core/src/javadoc.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { ElementClass } from './frankdoc.types';
import { ElementClass, ElementInfo } from './frankdoc.types';

export type LinkData = { text: string; href?: string };
export type ElementsWithInfo = ElementClass & ElementInfo;
export type LinkData = {
text: string;
href?: string;
element?: ElementsWithInfo;
};

// eslint-disable-next-line sonarjs/slow-regex
export const markdownLinkRegex = /\[([^\]]+)]\(([^)]+)\)/g; // old regex: /\[(.*?)\]\((.+?)\)/g
Expand All @@ -9,7 +14,7 @@ export const linkRegex = /(?:{@link\s(.*?)})/g;

export function transformAsHtml(
javadoc: string,
elements: Record<string, ElementClass>,
elements: Record<string, ElementsWithInfo>,
hasCustomLinkTransform: boolean,
): string[] {
let value = `${javadoc}`;
Expand All @@ -33,7 +38,7 @@ export function transformAsHtml(
return [value];
}

export function transformAsText(javadoc: string, elements: Record<string, ElementClass>): string[] {
export function transformAsText(javadoc: string, elements: Record<string, ElementsWithInfo>): string[] {
let value = `${javadoc}`;
value = value.replaceAll(markdownLinkRegex, '$1($2)');
value = value.replaceAll(tagsRegex, '');
Expand All @@ -55,7 +60,7 @@ export function defaultLinkTransformation(linkData: LinkData): string {
* e.g. 'PipeLineSession pipeLineSession' for `{@link PipeLineSession pipeLineSession}`
* @param elements
*/
export function getLinkData(captureGroup: string, elements: Record<string, ElementClass>): LinkData {
export function getLinkData(captureGroup: string, elements: Record<string, ElementsWithInfo>): LinkData {
const hashPosition = captureGroup.indexOf('#'),
isMethod = hashPosition !== -1,
elementString = isMethod ? captureGroup.split('#')[0] : captureGroup;
Expand All @@ -69,7 +74,7 @@ export function getLinkData(captureGroup: string, elements: Record<string, Eleme

const element = findElement(elements, elementParts[0]);
if (!element) return { text: name };
return { href: element.name, text: name };
return { href: element.className, text: name, element };
}

/** Handle links to internal class methods */
Expand All @@ -91,7 +96,7 @@ function parseLinkName(elementParts: string[], isMethod: boolean, captureGroup:
return elementName;
}

function findElement(elements: Record<string, ElementClass>, simpleName: string): ElementClass | null {
function findElement(elements: Record<string, ElementsWithInfo>, simpleName: string): ElementsWithInfo | null {
if (Object.keys(elements).length === 0) return null;
const element = elements[simpleName];
if (element) return element;
Expand Down
36 changes: 18 additions & 18 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@
"type": "module",
"scripts": {
"build": "vite -c vite.lib.config.ts build",
"dev": "react-router dev",
"dev": "pnpm run build && react-router dev",
"start": "react-router-serve ./build/server/index.js",
"typecheck": "react-router typegen && tsc"
},
"dependencies": {
"@react-router/node": "^7.9.2",
"@react-router/serve": "^7.9.2",
"isbot": "^5.1.31",
"react": "^19.1.1",
"react-dom": "^19.1.1",
"react-router": "^7.9.2",
"@frankframework/doc-library-core": "workspace:^"
"@frankframework/doc-library-core": "workspace:^",
"@react-router/node": "^7.13.0",
"@react-router/serve": "^7.13.0",
"isbot": "^5.1.33",
"react": "^19.2.3",
"react-dom": "^19.2.3",
"react-router": "^7.13.0"
},
"devDependencies": {
"@microsoft/api-extractor": "^7.55.0",
"@react-router/dev": "^7.9.2",
"@tailwindcss/vite": "^4.1.13",
"@types/node": "^22",
"@types/react": "^19.1.13",
"@types/react-dom": "^19.1.9",
"@vitejs/plugin-react": "^5.1.1",
"tailwindcss": "^4.1.13",
"typescript": "^5.9.2",
"@microsoft/api-extractor": "^7.55.2",
"@react-router/dev": "^7.13.0",
"@tailwindcss/vite": "^4.1.18",
"@types/node": "^22.19.7",
"@types/react": "^19.2.9",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^5.1.2",
"tailwindcss": "^4.1.18",
"typescript": "^5.9.3",
"unplugin-dts": "1.0.0-beta.6",
"vite": "^7.1.7",
"vite": "^7.3.1",
"vite-tsconfig-paths": "^5.1.4"
},
"packageManager": "pnpm@10.22.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/react/projects/ff-doc/public/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@frankframework/doc-library-react",
"version": "1.0.0",
"version": "1.0.1",
"type": "module",
"description": "A powerful and easy-to-use library, made for React, designed to extract and process information from the FF! Doc JSON.",
"module": "doc-library-react.js",
Expand All @@ -14,10 +14,10 @@
"directory": "packages/react/projects/ff-doc"
},
"peerDependencies": {
"react": "^19.1.0"
"react": "^19.1.0 || ^20.0.0"
},
"dependencies": {
"@frankframework/doc-library-core": "^1.0.0"
"@frankframework/doc-library-core": "~1.0.1"
}
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { transformAsHtml, transformAsText } from '@frankframework/doc-library-core';
import type { ElementClass, LinkData } from '@frankframework/doc-library-core';
import type { ElementsWithInfo, LinkData } from '@frankframework/doc-library-core';
import { useMemo } from 'react';

type InnerHTML = {
Expand All @@ -8,7 +8,7 @@ type InnerHTML = {

function javadocTransform(
javadoc: string | undefined,
elements: Record<string, ElementClass> | null,
elements: Record<string, ElementsWithInfo> | null,
asText = true,
// eslint-disable-next-line no-unused-vars
linkTemplate?: (link: LinkData) => string,
Expand Down Expand Up @@ -43,8 +43,8 @@ function javadocTransform(

export function useJavadocTransform(
javadoc: string | undefined,
elements: Record<string, ElementClass> | null,
asText = true,
elements: Record<string, ElementsWithInfo> | null,
asText = false,
// eslint-disable-next-line no-unused-vars
linkTemplate?: (link: LinkData) => string,
): InnerHTML {
Expand Down
8 changes: 8 additions & 0 deletions packages/react/public/example-ffdoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
]
},
"elements": {
"org.frankframework.test.TestElement": {
"name": "TestElement",
"description": "This is a test element used for demonstration purposes. See {@link FixedResultSender}"
},
"org.frankframework.senders.FixedResultSender": {
"name": "FixedResultSender",
"description": "FixedResultSender, same behaviour as {@link FixedResultPipe}, but now as a ISender.",
Expand Down Expand Up @@ -97,6 +101,10 @@
}
},
"elementNames": {
"TestElement": {
"labels": {},
"className": "org.frankframework.test.TestElement"
},
"FixedResultSender": {
"labels": {
"Components": "Senders",
Expand Down
Loading