SAP / ui5-typescript

Tooling to enable TypeScript support in SAPUI5/OpenUI5 projects
https://sap.github.io/ui5-typescript
Apache License 2.0
200 stars 28 forks source link

None JSDoc Syntax compatible syntax in 1.65.1 API.json #20

Closed bd82 closed 5 years ago

bd82 commented 5 years ago

Examples:

In JSDocs this should be either:

What is the cause of this divergence from the standard?

This results in many signatures not translated to "any", e.g:

codeworrior commented 5 years ago

This must be specific to the way you generate the api.json files. In the api.json files delivered by UI5, the types look okay, e.g. https://sapui5.hana.ondemand.com/1.65.1/test-resources/sap/tnt/designtime/api.json

I'll check whether the ui5 tooling caused this. Have your api.json files been created with the 1.4.1 1.4.2 version of the tooling or an older version?

Adding @RandomByte on CC.

[Update] Version corrected according to @RandomByte's hint

RandomByte commented 5 years ago

Have your api.json files been created with the 1.4.1 version of the tooling or an older version?

I guess you mean v1.4.2 which pins the JSDoc dependency to v3.5.5?

bd82 commented 5 years ago

The API.json files are generated using this command:

You can reproduce this by running this script locally. It:

  1. checksout the openui5 repo with a specific tag
  2. execute ui5 cli build tool.
  3. collects the api.json results.

and Yes I am using 1.4.2 version of the UI5-CLI tools.

bd82 commented 5 years ago

I cannot find this syntax in the OpenUI5 source code So i guess this is a bug with v1.4.2 of the CLI tools?

codeworrior commented 5 years ago

I've run the following locally in openui5/src/sap.tnt with both, ui5 cli 1.4.1 and 1.4.2:

   ui5 build jsdoc

and the result looks as expected:

    ...
    {
        "name": "getAriaLabelledBy",
        "visibility": "public",
        "returnValue": {
            "type": "sap.ui.core.ID[]"
        },
        "description": "Returns array of IDs of the elements which are the current targets of the association {@link #getAriaLabelledBy ariaLabelledBy}."
    },
    ...
bd82 commented 5 years ago

Interesting I will re-examine this and fully re-create the node_modules directory in my local env.

bd82 commented 5 years ago

o.k. it looks good now. I must have had some mixture of dependencies in node_modules that results in this strange behavior.

https://github.com/SAP/ui5-typescript/commit/88392288d272a0d666d0f0e9a20d764aa1e8961b

bd82 commented 5 years ago

1.65.1 released with the relevant fixes.

https://www.npmjs.com/package/@openui5/ts-types/v/1.65.1

codeworrior commented 5 years ago

BTW: just noticed the following issue which has been reported for JSDoc 3.6.0: https://github.com/jsdoc/jsdoc/issues/1643. The text of the error message highly reminds me to this issue here. Maybe JSDoc 3.6.0 was still used for some reason.

bd82 commented 5 years ago

Could be related as I've recently updated to nodejs 12.0