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: static webapp path #2931

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

fix: static webapp path #2931

wants to merge 17 commits into from

Conversation

heimwege
Copy link
Contributor

Copy link

changeset-bot bot commented Feb 17, 2025

🦋 Changeset detected

Latest commit: 73c579d

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

This PR includes changesets to release 41 packages
Name Type
@sap-ux/adp-flp-config-sub-generator Patch
@sap-ux/mockserver-config-writer Patch
@sap-ux/odata-service-writer Patch
@sap-ux/adp-tooling Patch
@sap-ux/telemetry Patch
@sap-ux/create Patch
@sap-ux/i18n Patch
@sap-ux/fiori-elements-writer Patch
@sap-ux/fiori-freestyle-writer Patch
@sap-ux/odata-service-inquirer Patch
@sap-ux/generator-simple-fe Patch
@sap-ux/flp-config-inquirer Patch
@sap-ux/preview-middleware Patch
@sap-ux/abap-deploy-config-sub-generator Patch
@sap-ux/fiori-generator-shared Patch
@sap-ux/inquirer-common Patch
@sap-ux/ui5-library-reference-sub-generator Patch
@sap-ux/cf-deploy-config-sub-generator Patch
@sap-ux/fe-fpm-writer Patch
@sap-ux/flp-config-sub-generator Patch
@sap-ux/project-access Patch
@sap-ux/app-config-writer Patch
@sap-ux/abap-deploy-config-inquirer Patch
@sap-ux/cap-config-writer Patch
@sap-ux/deploy-config-generator-shared Patch
@sap-ux/ui5-library-sub-generator Patch
@sap-ux/cf-deploy-config-inquirer Patch
@sap-ux/ui5-application-inquirer Patch
@sap-ux/ui5-library-inquirer Patch
@sap-ux/ui5-library-reference-inquirer Patch
@sap-ux/abap-deploy-config-writer Patch
@sap-ux/annotation-generator Patch
@sap-ux/cards-editor-middleware Patch
@sap-ux/cf-deploy-config-writer Patch
@sap-ux/environment-check Patch
@sap-ux/fiori-annotation-api Patch
@sap-ux/launch-config Patch
@sap-ux/project-integrity Patch
@sap-ux/ui5-library-reference-writer Patch
@sap-ux/ui5-library-writer Patch
@sap-ux/fe-fpm-cli 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 heimwege added odata-service-writer @sap-ux/odata-servier-writer mockserver-config-writer @sap-ux/mockserver-config-writer adp-tooling telemetry @sap-ux/telemetry labels Feb 17, 2025
@heimwege heimwege marked this pull request as ready for review February 18, 2025 07:04
@heimwege heimwege requested review from a team as code owners February 18, 2025 07:04
@heimwege heimwege requested a review from broksy February 18, 2025 07:09
@heimwege heimwege added the create @sap-ux/create label Feb 18, 2025
broksy
broksy previously approved these changes Feb 18, 2025
Copy link
Contributor

@broksy broksy left a comment

Choose a reason for hiding this comment

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

Changes for @sap-ux/mockserver-config-writer and @sap-ux/odata-service-writer looks good from my side.
Changeset corresponds to the changes. Approved.

devinea
devinea previously approved these changes Feb 18, 2025
Copy link
Member

@devinea devinea left a comment

Choose a reason for hiding this comment

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

Code changes are clear.
assumed covered by tests
changeset ✅

johannes-kolbe
johannes-kolbe previously approved these changes Feb 18, 2025
Copy link
Contributor

@johannes-kolbe johannes-kolbe left a comment

Choose a reason for hiding this comment

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

  • Focus on create, reusing refactored method lg
  • test snapshots show improved webapp path
  • changeset provided
  • Did not test manually

Copy link
Contributor

@Klaus-Keller Klaus-Keller left a comment

Choose a reason for hiding this comment

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

Thanks @heimwege, update to use getWebappPath() looks good. I commented some cosmetic proposals.

packages/adp-tooling/src/base/helper.ts Outdated Show resolved Hide resolved
packages/adp-tooling/src/base/helper.ts Outdated Show resolved Hide resolved
packages/adp-tooling/src/base/helper.ts Outdated Show resolved Hide resolved
packages/odata-service-writer/src/data/annotations.ts Outdated Show resolved Hide resolved
packages/odata-service-writer/src/data/annotations.ts Outdated Show resolved Hide resolved
packages/odata-service-writer/src/data/annotations.ts Outdated Show resolved Hide resolved
packages/odata-service-writer/src/data/annotations.ts Outdated Show resolved Hide resolved
packages/odata-service-writer/src/data/annotations.ts Outdated Show resolved Hide resolved
@heimwege heimwege dismissed stale reviews from johannes-kolbe, devinea, and broksy via defc2ba February 19, 2025 09:45
@heimwege
Copy link
Contributor Author

@mmilko01 While I was implementing the changes suggested by @Klaus-Keller I also refactored how the ui5 yaml config is being read in adp-tooling. project-access has a method for that as well (readUi5Yaml).

export async function getAdpConfig(basePath: string, yamlPath: string): Promise<AdpPreviewConfig> {
const ui5ConfigPath = isAbsolute(yamlPath) ? yamlPath : join(basePath, yamlPath);
let ui5Conf: UI5Config;
let adp: AdpPreviewConfig | undefined;
try {
ui5Conf = await readUi5Yaml(dirname(ui5ConfigPath), basename(ui5ConfigPath));
const customMiddleware =
ui5Conf.findCustomMiddleware<{ adp: AdpPreviewConfig }>('fiori-tools-preview') ??
ui5Conf.findCustomMiddleware<{ adp: AdpPreviewConfig }>('preview-middleware');
adp = customMiddleware?.configuration?.adp;
} catch (error) {
// do nothing here
}
if (!adp) {
throw new Error(`No system configuration found in ${basename(ui5ConfigPath)}`);
}
return adp;
}

At least the tests are still green 🤞🏻

…tic-webapp-path

# Conflicts:
#	packages/odata-service-writer/src/data/annotations.ts
@mmilko01
Copy link
Contributor

@mmilko01 While I was implementing the changes suggested by @Klaus-Keller I also refactored how the ui5 yaml config is being read in adp-tooling. project-access has a method for that as well (readUi5Yaml).

export async function getAdpConfig(basePath: string, yamlPath: string): Promise<AdpPreviewConfig> {
const ui5ConfigPath = isAbsolute(yamlPath) ? yamlPath : join(basePath, yamlPath);
let ui5Conf: UI5Config;
let adp: AdpPreviewConfig | undefined;
try {
ui5Conf = await readUi5Yaml(dirname(ui5ConfigPath), basename(ui5ConfigPath));
const customMiddleware =
ui5Conf.findCustomMiddleware<{ adp: AdpPreviewConfig }>('fiori-tools-preview') ??
ui5Conf.findCustomMiddleware<{ adp: AdpPreviewConfig }>('preview-middleware');
adp = customMiddleware?.configuration?.adp;
} catch (error) {
// do nothing here
}
if (!adp) {
throw new Error(`No system configuration found in ${basename(ui5ConfigPath)}`);
}
return adp;
}

At least the tests are still green 🤞🏻

@heimwege thanks for the heads-up. This refactoring looks good.

Copy link
Contributor

@johannes-kolbe johannes-kolbe left a comment

Choose a reason for hiding this comment

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

Reapproving. Nice cleanup, thanks @heimwege

Copy link
Member

@devinea devinea left a comment

Choose a reason for hiding this comment

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

re-approving

Copy link
Contributor

@Klaus-Keller Klaus-Keller left a comment

Choose a reason for hiding this comment

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

Thanks @heimwege!

  • all my comments have been addressed
  • changeset exists
  • code coverage is great
  • did a visual review, no manual test which I strongly suggest should be done for adaptation editor

Approved from my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adp-tooling create @sap-ux/create mockserver-config-writer @sap-ux/mockserver-config-writer odata-service-writer @sap-ux/odata-servier-writer telemetry @sap-ux/telemetry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants