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

Exclude writing of specific files for CAP applications #2032

Closed
wants to merge 19 commits into from
Closed

Conversation

kjose90
Copy link
Member

@kjose90 kjose90 commented Jun 14, 2024

Copy link

changeset-bot bot commented Jun 14, 2024

⚠️ No Changeset found

Latest commit: cd8f13c

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

@kjose90
Copy link
Member Author

kjose90 commented Jun 14, 2024

This PR is an initial rough trial to identify all the files that need modification to prevent writing .gitignore, ui5-local.yaml, and webapp/index.html when the application is a CAP application. The flag name used in this case can be changed to something generic.

Also not sure how to deal with not writing ui5-local.yaml Flexible Programming Model here

Copy link

cla-assistant bot commented Jun 19, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

sonarcloud bot commented Jun 19, 2024

remove cap check
remove comment
@kjose90
Copy link
Member Author

kjose90 commented Jun 19, 2024

Introduced isCapProject to AppOptions interface under ui5-application-writer to provide a unified and consistent way to handle CAP project-specific configurations. By using this flag:

  • we can exclude ui5-local.yaml and .gitignore files from CAP projects.
  • we can conditionally exclude scripts start-local in package defaults based on whether the project is a CAP project or not.

Alternative suggestion would be to introduce a flag like writeUi5Local specifically for controlling the writing of the ui5-local.yaml file. However, this approach would necessitate a separate flag for handling the .gitignore file exclusion or maybe we can leave .gitignore file for cap projects ( after all its a git ignore file)

below is a description of files which will need to be changed where ui5-local yaml files are being written (the code for now just uses a flag isCapProject)

packages/ui5-application-writer/src/types.ts

  • Added isCapProjecta boolean type to AppOptions interface to exclude files ui5-local.yaml and .gitignore from the template for CAP projects if set to true.

packages/ui5-application-writer/src/data/defaults.ts

  • If isCapProject is true, do not add start-local scripts to package defaults.

packages/fiori-elements-writer/src/index.ts

  • Use the same isCapProject from AppOptions interface
    • to determine whether to write the ui5-local.yaml if cap project.
    • Flexible Programming Model: Use isCapProject to decide on the inclusion of the ui5-local.yaml file.
    • Pass isCapProject to the package json config to add start-local script to package JSON scripts only for non-CAP applications only.
      packages/fiori-freestyle-writer/src/index.ts

packages/fiori-freestyle-writer/src/index.ts

  • Maintain the behavior of using the existing CapType to not write to ui5-local.yaml files for CAP projects.

@kjose90
Copy link
Member Author

kjose90 commented Jun 28, 2024

closing this PR as this is outdated

@kjose90 kjose90 closed this Jun 28, 2024
@kjose90 kjose90 deleted the cap-files branch June 28, 2024 09:18
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

1 participant