Skip to content

feat: Autofix Core API (complex cases) #675

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

Draft
wants to merge 69 commits into
base: main
Choose a base branch
from

Conversation

d3xter666
Copy link
Contributor

@d3xter666 d3xter666 commented May 28, 2025

JIRA: CPOUI5FOUNDATION-991

Enhances:
#671
#675

Enables getLibraryResourceBundle migration by checking whether sLibrary (the first argument) is an actual SAPUI5 library. The check is performed as follows:

  • check for library existence in TS definitions for SAPUI5
  • Check project's libs in manifest.json
  • If the current project is a library

Reolves partially: #619

const potentialLibNamespace = node.text;

// Check libs from the manifest
const manifest = JSON.parse(this.manifestContent ?? "{}") as SAPJSONSchemaForWebApplicationManifestFile;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we just re-use the existing logic that extracts manifest.json information instead of doing it again here?
(see

async function getLibraryDependenciesFromManifest(workspace: AbstractAdapter, virBasePath: string | undefined) {
)

We could change this to a broader scope, like getInformationFromManifest, and then returning an object with the relevant details.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just split the existing solution into separate PRs and now I'll do the refactorings

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry for the premature review 😄


if (manifestLibs[potentialLibNamespace]) {
return true;
} else if (manifest?.["sap.app"]?.id === potentialLibNamespace) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check should only be done when the project is a library.

@d3xter666 d3xter666 marked this pull request as draft May 28, 2025 07:00
@d3xter666 d3xter666 force-pushed the autofix-deprecated-core-apis branch 2 times, most recently from 0c07e32 to cb85a25 Compare May 28, 2025 07:46
@d3xter666 d3xter666 force-pushed the autofix-determine-library-resource branch from 56ebba1 to 66098d1 Compare May 28, 2025 08:41
@d3xter666 d3xter666 force-pushed the autofix-deprecated-core-apis branch from f67bfba to d4eed0f Compare May 28, 2025 11:20
@d3xter666 d3xter666 force-pushed the autofix-determine-library-resource branch from 08844d2 to 4ad1d98 Compare May 28, 2025 11:36
@d3xter666 d3xter666 force-pushed the autofix-deprecated-core-apis branch from d4eed0f to f033503 Compare May 29, 2025 07:04
@d3xter666 d3xter666 force-pushed the autofix-deprecated-core-apis branch from f033503 to 0b46e18 Compare May 29, 2025 07:12
@d3xter666 d3xter666 force-pushed the autofix-determine-library-resource branch 2 times, most recently from 18ec577 to 5015376 Compare May 29, 2025 08:32
@d3xter666 d3xter666 changed the title feat: Determine library resource for autofixer feat: Autofix Core API (complex cases) May 29, 2025
@d3xter666 d3xter666 force-pushed the autofix-deprecated-core-apis branch from 8b14602 to 3360082 Compare May 30, 2025 11:37
@d3xter666 d3xter666 force-pushed the autofix-deprecated-core-apis branch from 3360082 to c815258 Compare May 30, 2025 16:07
@d3xter666 d3xter666 force-pushed the autofix-determine-library-resource branch from bcf4001 to c0ed35a Compare May 30, 2025 16:21
d3xter666 added a commit that referenced this pull request Jun 2, 2025
JIRA: CPOUI5FOUNDATION-991

This is the first (base) chunk of several PRs related to the Core APIs
autofix.
All of the other PRs would build on top of it. Here we migrate the
trivial cases where replacements are 1:1

Resolves partially: #619

Follow up PRs:
#639
#675

---------

Co-authored-by: Max Reichmann <[email protected]>
@d3xter666 d3xter666 force-pushed the autofix-deprecated-core-apis branch from c815258 to 1eafe45 Compare June 2, 2025 11:22
d3xter666 added a commit that referenced this pull request Jun 5, 2025
JIRA: CPOUI5FOUNDATION-991

Enhances #671 by enabling more
complex autofixes where migration depends on the provided arguments.

Resolves partially: #619

Follow up PRs:
#675

---------

Co-authored-by: Yavor Ivanov <[email protected]>
Base automatically changed from autofix-deprecated-core-apis to main June 5, 2025 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants