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

Use cds info from project access to update package json in cap writers #1979

Closed
wants to merge 8 commits into from

Conversation

kjose90
Copy link
Member

@kjose90 kjose90 commented May 29, 2024

#1902

This PR consumes #1947

Copy link

changeset-bot bot commented May 29, 2024

⚠️ No Changeset found

Latest commit: 3691710

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

// or if 'cdsUi5PluginInfo' is not available and the version specified in 'package.json' satisfies the minimum required version,
// then set 'addScripts' to true. Otherwise, set it to false.
const addScripts = cdsUi5PluginInfo?.hasMinCdsVersion ? cdsUi5PluginInfo.hasMinCdsVersion : satisfiesMinCdsVersion(packageJson)
if(addScripts) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Here we add cds watch scripts only in cdsUi5PluginInfo has minimum cds version available, this is set during the prompt phase of the app generation. Question for head less app generation - according to the logic here I simply read from the package.json, is this consistent ??? Is there a better way to cater for this watch script addition for headless app?

@kjose90
Copy link
Member Author

kjose90 commented May 29, 2024

Please refer the updated logic for updating CDS watch scripts in cap-config-writer/src/cap-config-writer/package-json.ts.

For the generation of headless applications, where there's no prompt for cdsUi5Plugin, what's the optimal approach to retrieve the cds version from package.json?

We have a function loadModuleFromProject from project-access which will require pre-installing node modules. - i am not sure if this is the right way, if it could have effects elsewhere, and also considering the overhead associated with exporting this function.

In this PR I am currently re-reading this information from package json using satisfiesMinCdsVersion here

@kjose90
Copy link
Member Author

kjose90 commented Jul 10, 2024

Closing this PR as it has gone stale. Addressed in #1947

@kjose90 kjose90 closed this Jul 10, 2024
@kjose90 kjose90 deleted the useCdsVersionInfo branch July 10, 2024 13:09
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.

None yet

2 participants