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

fix(app-config-writer): wrong prerequisites check in convert preview-config #2922

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

heimwege
Copy link
Contributor

@heimwege heimwege commented Feb 14, 2025

cds-plugin-ui5 is currently being searched in package.json of the app to be converted but must be searched for in CAP root package.json.

This fix currently leads to an exception in project-access checkFilesInSrvFolder in case the CAP srv folder contains sub folders. (fixed in #2923)

Depends on #2926 being merged ✅

Copy link

changeset-bot bot commented Feb 14, 2025

🦋 Changeset detected

Latest commit: 67fb390

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 40 packages
Name Type
@sap-ux/app-config-writer Patch
@sap-ux/project-access Patch
@sap-ux/ui5-application-inquirer Patch
@sap-ux/create Patch
@sap-ux/flp-config-sub-generator Patch
@sap-ux/abap-deploy-config-sub-generator Patch
@sap-ux/abap-deploy-config-writer Patch
@sap-ux/adp-flp-config-sub-generator Patch
@sap-ux/adp-tooling Patch
@sap-ux/annotation-generator Patch
@sap-ux/cap-config-writer Patch
@sap-ux/cards-editor-middleware Patch
@sap-ux/cf-deploy-config-sub-generator Patch
@sap-ux/cf-deploy-config-writer Patch
@sap-ux/environment-check Patch
@sap-ux/fe-fpm-writer Patch
@sap-ux/fiori-annotation-api Patch
@sap-ux/fiori-generator-shared Patch
@sap-ux/flp-config-inquirer Patch
@sap-ux/launch-config Patch
@sap-ux/mockserver-config-writer Patch
@sap-ux/odata-service-inquirer Patch
@sap-ux/odata-service-writer Patch
@sap-ux/preview-middleware Patch
@sap-ux/project-integrity Patch
@sap-ux/telemetry Patch
@sap-ux/ui5-library-reference-inquirer Patch
@sap-ux/ui5-library-reference-sub-generator Patch
@sap-ux/ui5-library-reference-writer Patch
@sap-ux/ui5-library-writer Patch
@sap-ux/fiori-elements-writer Patch
@sap-ux/fiori-freestyle-writer Patch
@sap-ux/fe-fpm-cli Patch
@sap-ux/abap-deploy-config-inquirer Patch
@sap-ux/deploy-config-generator-shared Patch
@sap-ux/inquirer-common Patch
@sap-ux/ui5-library-sub-generator Patch
@sap-ux/generator-simple-fe Patch
@sap-ux/cf-deploy-config-inquirer Patch
@sap-ux/ui5-library-inquirer Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@heimwege
Copy link
Contributor Author

The new sonar issue seems to be a false positive because casting to Package | undefined is for sure a different type than the inferred JSONSchema7Object | undefined

@heimwege heimwege marked this pull request as ready for review February 17, 2025 08:06
@heimwege heimwege requested a review from a team as a code owner February 21, 2025 16:21
@@ -1,4 +1,4 @@
export { checkCdsUi5PluginEnabled, enableCdsUi5Plugin, satisfiesMinCdsVersion } from './cap-config';
Copy link
Contributor

Choose a reason for hiding this comment

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

@heimwege, I'm wondering whether we should keep the export checkCdsUi5PluginEnabled for backward compatibility reasons. We would then import and re-export the function. I know of other modules that use the function, search in tools suite for checkCdsUi5PluginEnabled. From a semver perspective this would be breaking changes and require a major version increase, but as we are on a 0.x.y version here we could do such incompatible changes. We just need to be careful and adjust all consumers, not only in this repo.
Let me know what you think.

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 adjusted all occurrences of checkCdsUi5PluginEnabled in open-ux-tools but you are right there might be usages in tools-suite as well. let's keep it.
Or we do it in two steps. First have both in then adjust tools-suite and ensure everything works and then have a follow up PR that gets rid of the import/export in cap-config-writer.

getWorkspaceInfo,
getWorkspacePackages,
minCdsVersion,
hasMinCdsVersion,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need a separate export for this, info is also included in checkCdsUi5PluginEnabled

Copy link
Contributor Author

@heimwege heimwege Feb 24, 2025

Choose a reason for hiding this comment

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

Currently it's additionally being used in cap-config-writer

export function ensureMinCdsVersion(packageJson: Package): void {
if (!hasMinCdsVersion(packageJson)) {
packageJson.dependencies ??= {};
packageJson.dependencies['@sap/cds'] = `^${minCdsVersion}`;
}
}

@heimwege
Copy link
Contributor Author

heimwege commented Feb 24, 2025

@Klaus-Keller ...and yes w.r.t. the failing unit test I might need your help. The cards-editor-middleware unit test fails because mem-fs-editor was added to cap.ts and I cannot get it running

https://cloud.nx.app/runs/OEWcAt6JIL/task/%40sap-ux%2Fcards-editor-middleware%3Atest

@heimwege heimwege added cap-config-writer @sap-ux/cap-config-writer project-access Tickets related to @sap-ux/project-access cards-editor-middleware @sap-ux/cards-editor-middleware odata-service-inquirer @sap-ux/odata-service-inquirer ui5-application-inquirer and removed odata-service-inquirer @sap-ux/odata-service-inquirer labels Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app-config-writer @sap-ux/app-config-writer bug Something isn't working cap-config-writer @sap-ux/cap-config-writer cards-editor-middleware @sap-ux/cards-editor-middleware project-access Tickets related to @sap-ux/project-access ui5-application-inquirer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants