Skip to content

Commit

Permalink
fix: update deprecation/experimental tags in alignment with UI5 SDK
Browse files Browse the repository at this point in the history
Fixes: #468
  • Loading branch information
matz3 committed Aug 13, 2024
1 parent ea65c9d commit 06c8a16
Show file tree
Hide file tree
Showing 8 changed files with 1,481 additions and 1,459 deletions.
32 changes: 14 additions & 18 deletions packages/dts-generator/src/phases/dts-code-gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,12 @@ function JSDOC({
}

contents += since ? `@since ${since}` + NL : EMPTY_STRING;
contents += deprecated ? genDeprecated(deprecated) + NL : EMPTY_STRING;
contents += experimental ? genExperimental(experimental) + NL : EMPTY_STRING;
contents += deprecated
? genDeprecatedOrExperimental(deprecated) + NL
: EMPTY_STRING;
contents += experimental
? genDeprecatedOrExperimental(experimental) + NL
: EMPTY_STRING;
contents += isProtected
? genProtected({ callable: kind === "FunctionDesc" }) + NL
: EMPTY_STRING;
Expand Down Expand Up @@ -219,11 +223,15 @@ function NAMED_INTERFACE_MARKER(fqn: string): string {
* @param ast
* @return
*/
function genDeprecated(ast: DeprecatedDesc) {
function genDeprecatedOrExperimental(ast: DeprecatedDesc | ExperimentalDesc) {
let contents = EMPTY_STRING;
contents += "@deprecated";
contents += ast.since ? ` (since ${ast.since})` : EMPTY_STRING;
contents += ast.description ? ` - ${ast.description}` : EMPTY_STRING;
if (ast.kind === "DeprecatedDesc") {
contents += "@deprecated";
} else if (ast.kind === "ExperimentalDesc") {
contents += "@experimental";
}
contents += ast.since ? ` As of version ${ast.since}.` : EMPTY_STRING;
contents += ast.description ? ` ${ast.description}` : EMPTY_STRING;
return contents;
}

Expand All @@ -236,18 +244,6 @@ function genProtected({ callable = false }) {
: "@ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework)";
}

/**
* @param ast
* @return
*/
function genExperimental(ast: ExperimentalDesc) {
let contents = EMPTY_STRING;
contents += "@experimental";
contents += ast.since ? ` (since ${ast.since})` : EMPTY_STRING;
contents += ast.description ? ` - ${ast.description}` : EMPTY_STRING;
return contents;
}

/**
*
* @param ast
Expand Down
4 changes: 2 additions & 2 deletions packages/dts-generator/src/resources/core-preamble.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ interface JQuery<TElement = HTMLElement> extends Iterable<TElement> {

/**
* Extension function to the jQuery.fn which identifies SAPUI5 controls in the given jQuery context.
* @deprecated since 1.106, use sap.ui.core.Element.closestTo instead.
* @deprecated As of version 1.106, use {@link sap.ui.core.Element.closestTo} instead.
*/
control(
/**
Expand All @@ -75,7 +75,7 @@ interface JQuery<TElement = HTMLElement> extends Iterable<TElement> {

/**
* Extension function to the jQuery.fn which identifies SAPUI5 controls in the given jQuery context.
* @deprecated since 1.106, use sap.ui.core.Element.closestTo instead.
* @deprecated As of version 1.106, use {@link sap.ui.core.Element.closestTo} instead.
*/
control(
/**
Expand Down
Loading

0 comments on commit 06c8a16

Please sign in to comment.