Skip to content

Commit

Permalink
[FIX] JSDoc: add project name to JSDoc configuration and api.json (#609)
Browse files Browse the repository at this point in the history
The JSDoc processor did not propagate the library name (project name) to
the JSDoc configuration. As a consequence, the UI5 template (publish.js)
could not properly validate the metadata property 'library' for control
and elements classes. It reported many false positives ("ERROR:
specified library 'foo.bar' for class 'foo.bar.Control' doesn't match
containing library 'undefined'").
  • Loading branch information
codeworrior authored Jun 3, 2021
1 parent 97ac08b commit 419ce38
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/processors/jsdoc/jsdocGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ async function generateJsdocConfig({targetPath, tmpPath, namespace, projectName,
"ui5": {
"variants": ${JSON.stringify(variants)},
"version": "${version}",
"uilib": "${projectName}",
"jsapiFile": "${jsapiFilePath}",
"apiJsonFolder": "${apiJsonFolderPath}",
"apiJsonFile": "${apiJsonFilePath}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"$schema-ref":"http://schemas.sap.com/sapui5/designtime/api.json/1.0","version":"1.0.0","symbols":[{"kind":"namespace","name":"library.j","basename":"j","resource":"library/j/some.js","module":"library/j/some","static":true,"visibility":"public"}]}
{"$schema-ref":"http://schemas.sap.com/sapui5/designtime/api.json/1.0","version":"1.0.0","library":"library.j","symbols":[{"kind":"namespace","name":"library.j","basename":"j","resource":"library/j/some.js","module":"library/j/some","static":true,"visibility":"public"}]}
1 change: 1 addition & 0 deletions test/lib/processors/jsdoc/jsdocGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ test("generateJsdocConfig", async (t) => {
"ui5": {
"variants": ["apijson"],
"version": "1.0.0",
"uilib": "some.namespace",
"jsapiFile": "${jsapiFilePath}",
"apiJsonFolder": "${apiJsonFolderPath}",
"apiJsonFile": "${apiJsonFilePath}"
Expand Down

0 comments on commit 419ce38

Please sign in to comment.