Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dts-generator] Cannot find any OpenUI5 library #488

Closed
eurushibata opened this issue Feb 11, 2025 · 6 comments · Fixed by #489
Closed

[dts-generator] Cannot find any OpenUI5 library #488

eurushibata opened this issue Feb 11, 2025 · 6 comments · Fixed by #489

Comments

@eurushibata
Copy link

eurushibata commented Feb 11, 2025

Describe the bug
When running the command

ui5-download-apijson sap.m,sap.ui.core,sap.ui.integration,sap.tnt,sap.ui.layout,sap.ui.table,sap.uxap 1.120.26 --targetDir ./dist/test-resources/api

it returns

[info] @ui5/dts-generator/download-apijson: Download api.json files for
[info] @ui5/dts-generator/download-apijson:   libs: sap.m,sap.ui.core,sap.ui.integration,sap.tnt,sap.ui.layout,sap.ui.table,sap.uxap
[info] @ui5/dts-generator/download-apijson:   version: 1.120.26
[info] @ui5/dts-generator/download-apijson:   targetDir: ./dist/test-resources/api
[info] @ui5/dts-generator/download-apijson: 
[error] @ui5/dts-generator/download-apijson: error fetching sapui5 metadata
[error] @ui5/dts-generator/download-apijson: An error occurred Error: One of the libraries was given as 'sap.m', but this library does not seem to exist among the OpenUI5 libraries in the given version.
      Available OpenUI5 libraries in this version are: .
    at file:///Users/user/workspace/sol-ui-op.worktrees/fb_28947_central_mockserver/node_modules/@ui5/dts-generator/dist/js-utils/ui5-metadata.js:80:19
    at Array.forEach (<anonymous>)
    at expandTransitiveDeps (file:///Users/user/workspace/sol-ui-op.worktrees/fb_28947_central_mockserver/node_modules/@ui5/dts-generator/dist/js-utils/ui5-metadata.js:78:10)
    at download (file:///Users/user/workspace/sol-ui-op.worktrees/fb_28947_central_mockserver/node_modules/@ui5/dts-generator/dist/download-apijson.js:23:37)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async main (file:///Users/user/workspace/sol-ui-op.worktrees/fb_28947_central_mockserver/node_modules/@ui5/dts-generator/dist/download-apijson.js:39:5)

Expected behavior
expected to have the api.json file with all libraries

Additional context

upon checking the code, it seems that the openui5 metadata is captured from https://registry.npmjs.com/-/v1/search?text=scope:openui5&size=100 according to js-utils/ui5-metadata.js but the query always return empty

@akudev
Copy link
Contributor

akudev commented Feb 13, 2025

This looks odd. The query being written as it is, I'm sure it used to work in the past. Maybe a temporary glitch on npmjs side? It would surprise me if they just change the search behavior like this.
We might query for "@openui5" (with higher limit) and then filter the results for packages that really are @openui5/...

@akudev akudev added the ts-interface-generator Related to the ts-interface-generator sub-package label Feb 13, 2025
@akudev akudev added dts-generator and removed ts-interface-generator Related to the ts-interface-generator sub-package labels Mar 5, 2025
@akudev akudev changed the title [ts-interface-generator] Cannot find any OpenUI5 library [dts-generator] Cannot find any OpenUI5 library Mar 5, 2025
@akudev
Copy link
Contributor

akudev commented Mar 5, 2025

I checked again and pages like https://blog.npmjs.org/post/159539048360/scope-support-in-search-and-download-stats and https://stackoverflow.com/questions/44228981/npm-registry-api-scoped-packages clearly indicate this used to work. But I didn't find any announcement of this being no longer supported (e.g. on https://github.blog/changelog/label/npm/). Will look into a solution, as we are also affected.

@codeworrior
Copy link
Member

codeworrior commented Mar 5, 2025

When I ran into this the last time, I simply replaced the query with a check for the scope @openui5 as, by convention, anything in that scope should be available in the npm registry.

akudev added a commit that referenced this issue Mar 5, 2025
Don't use the scoped search, which apparently stopped working, and use standard search instead.

The max supported limit of search results is 250 right now
and the current number of hits is still lower (183).
This number might increase over time to a degree
where relevant libraries are not within the first 250.
Results are sorted by popularity etc., so the libraries are right now still
at the very beginning of the result list.
This creates a comfortable buffer for the time being.

Fixes #488
akudev added a commit that referenced this issue Mar 5, 2025
Don't use the scoped search, which apparently stopped working, and use standard search instead.

The max supported limit of search results is 250 right now
and the current number of hits is still lower (183).
This number might increase over time to a degree
where relevant libraries are not within the first 250.
Results are sorted by popularity etc., so the libraries are right now still
at the very beginning of the result list.
This creates a comfortable buffer for the time being.

Fixes #488
@akudev
Copy link
Contributor

akudev commented Mar 5, 2025

Fixed, thanks for reporting. I am working on another thing, will trigger a release once that is done.

@akudev
Copy link
Contributor

akudev commented Mar 12, 2025

@ui5/dts-generator 3.6.0 including the fix has just been published.

@akudev
Copy link
Contributor

akudev commented Mar 12, 2025

When I ran into this the last time, I simply replaced the query with a check for the scope @openui5 as, by convention, anything in that scope should be available in the npm registry.

...and then you created #482, which I unfortunately missed. You think we should go for that solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants