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

FEATURE - Move apply cap updates to generate function of FE/FF writers #2787

Open
2 tasks
kjose90 opened this issue Jan 16, 2025 · 0 comments
Open
2 tasks
Assignees

Comments

@kjose90
Copy link
Member

kjose90 commented Jan 16, 2025

Add applyCapUpdates from @sap-ux/cap-config-writer directly to generate function of FE/FF writers.

Enhance the FioriElementsApp and FioriApp interfaces by:

  • Extend the service property to accommodate CapServiceCdsInfo alongside OdataService.
  • Add enableNPMWorkspaces to the appOptions interface for workspace handling.
import type { CapServiceCdsInfo } from '@sap-ux/cap-config-writer';

export interface FioriElementsApp<T> extends Ui5App {
    template: Template<T>;
    service: Omit<OdataService, 'model'> & {
        capService?: CapServiceCdsInfo;  // Optional CapService
    };
    app: FioriApp;
    appOptions: Partial<AppOptions> & {
        /**
         * Generate OPA-based tests, if applicable to the specified template.
         * This will eventually move up to {@link Ui5App.appOptions}
         */
        addTests?: boolean;
        enableNPMWorkspaces?: boolean;
    };
}
  • call applyCapUpdates from @sap-ux/cap-config-writer directly in generate function of writers.
import { applyCAPUpdates, type CapProjectSettings } from '@sap-ux/cap-config-writer';

if(feApp.service.capService) {
        const settings: CapProjectSettings = {
            appRoot: basePath,
            packageName: feApp.package.name ?? '',
            appId:feApp.app.id,
            sapux: feApp.appOptions?.sapux,
            enableNPMWorkspaces: feApp.app.enableNPMWorkspaces,
            enableTypescript: feApp.appOptions?.typescript,
            enableCdsUi5Plugin: feApp.service.capService.cdsUi5PluginInfo ? true : false
        };
        await applyCAPUpdates(fs, feApp.service.capService, settings);
    }
  • update unit tests sccordingly

Tasks

  • Unit Tests added
  • Test Cases defined
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

No branches or pull requests

1 participant