Skip to content
Merged
Show file tree
Hide file tree
Changes from 113 commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
e7372ce
feat: start transferring cf business logic
nikmace Aug 5, 2025
4e1f565
feat: add cf specific logic
nikmace Aug 6, 2025
2d9ff42
feat: add cf specific logic
nikmace Aug 6, 2025
bf521ab
feat: add cf specific logic
nikmace Aug 7, 2025
a4aff73
feat: add cf specific logic
nikmace Aug 7, 2025
3c657d9
feat: add cf specific logic
nikmace Aug 7, 2025
4070f28
feat: add cf specific logic
nikmace Aug 7, 2025
5f62087
feat: add cf specific logic
nikmace Aug 7, 2025
e7c2858
feat: add cf specific logic
nikmace Aug 7, 2025
80186d6
feat: add cf specific logic
nikmace Aug 7, 2025
7fa6652
feat: add cf specific logic
nikmace Aug 7, 2025
10949d7
feat: add cf specific logic
nikmace Aug 7, 2025
b3499e3
feat: adjust login validation
nikmace Aug 7, 2025
fe5217d
feat: correct cf config types
nikmace Aug 7, 2025
e481120
fix: login problem
nikmace Aug 7, 2025
79cb04e
feat: add attribute prompts for cf
nikmace Aug 8, 2025
8258a94
fix: build error
nikmace Aug 8, 2025
7882cba
feat: add business services and app prompts for cf
nikmace Aug 8, 2025
44c1a50
refactor: slightly improve code
nikmace Aug 8, 2025
efda0c2
feat: prevent writing for cf
nikmace Aug 11, 2025
6b7ea86
refactor: slight improvements
nikmace Aug 11, 2025
0473a8a
refactor: slight improvements
nikmace Aug 11, 2025
9ceaa65
refactor: slight improvements
nikmace Aug 11, 2025
1d66a23
refactor: remove redundant code
nikmace Aug 11, 2025
a0288bd
fix: gen private method
nikmace Aug 11, 2025
9bfee8a
feat: refactor and improve code
nikmace Aug 13, 2025
0becd56
feat: capitalize page names
nikmace Aug 13, 2025
b6a8907
feat: refactor and improve code
nikmace Aug 14, 2025
d14bae8
refactor: change texts
nikmace Aug 14, 2025
04007f1
refactor: change texts
nikmace Aug 14, 2025
b762ce4
feat: add cf writer code
nikmace Aug 19, 2025
68b123e
feat: change descr template writing
nikmace Aug 20, 2025
21bf108
refactor: use enhanced discovery api
nikmace Aug 22, 2025
7a96bd1
Merge remote-tracking branch 'origin/main' into feat/3514/cf-business…
nikmace Aug 25, 2025
9dc9eff
fix: app host id not found
nikmace Aug 26, 2025
05f049f
fix: incorrect result validation
nikmace Aug 26, 2025
c378bfe
fix: eliminate race conditions
nikmace Aug 26, 2025
44c64bf
fix: approuter incompatibilty issue
nikmace Aug 27, 2025
d88ca7b
feat: major refactoring for fdc service, and cf related business logic
nikmace Aug 27, 2025
52051cf
feat: further split code and refactor cf config, auth, fdc service
nikmace Aug 27, 2025
6cf76cb
fix: build error
nikmace Aug 28, 2025
05766e6
feat: extract mta releated logic
nikmace Aug 28, 2025
42eeb08
feat: extract api, mta, validation related logic
nikmace Aug 28, 2025
7a01679
feat: split and move business logic from fdc
nikmace Aug 28, 2025
db0dea1
feat: rethink folder structure for cf
nikmace Aug 28, 2025
40b9c6d
feat: dismantle fdc service and refactor code
nikmace Aug 29, 2025
f164eb4
fix: yaml path undefined
nikmace Aug 29, 2025
e073bac
fix: template path
nikmace Aug 29, 2025
5237a59
fix: template path
nikmace Aug 29, 2025
0443a00
feat: refactor yaml class
nikmace Sep 1, 2025
0ed9fc2
feat: enhance types, rafactor code
nikmace Sep 1, 2025
9d7ffdb
chore: update texts in methods
nikmace Sep 1, 2025
60820f6
feat: refactor cf app extraction and validation logic
nikmace Sep 3, 2025
30e9aad
feat: improve app validation and selection prompt logic
nikmace Sep 4, 2025
169d533
refactor: extract messages into i18n
nikmace Sep 4, 2025
a82dfe5
refactor: extract messages into i18n
nikmace Sep 4, 2025
b3b7727
refactor: extract messages into i18n
nikmace Sep 4, 2025
85a06ff
refactor: extract messages into i18n
nikmace Sep 4, 2025
bae5cf5
refactor: improve code
nikmace Sep 4, 2025
bb55024
refactor: improve writing logic
nikmace Sep 4, 2025
98bd2fd
refactor: improve writing logic
nikmace Sep 4, 2025
3d6b8c6
refactor: improve writing logic
nikmace Sep 4, 2025
a1ff1c1
Merge remote-tracking branch 'origin/main' into feat/3514/cf-business…
nikmace Sep 16, 2025
f46ee8d
refactor: change tooltip texts
nikmace Sep 16, 2025
720db4c
refactor: change tooltip texts
nikmace Sep 16, 2025
37e3e9c
Merge remote-tracking branch 'origin/main' into feat/3514/cf-business…
nikmace Sep 16, 2025
095fdd6
test: fix tests
nikmace Sep 16, 2025
3811c0f
test: fix tests
nikmace Sep 16, 2025
8ef0c9c
test: fix tests
nikmace Sep 16, 2025
0e8216a
refactor: change tooltip texts
nikmace Sep 17, 2025
cb4d179
Merge branch 'main' into feat/3514/cf-business-logic
nikmace Sep 17, 2025
c100ba2
Merge branch 'main' into feat/3514/cf-business-logic
nikmace Sep 19, 2025
725a819
test: add tests
nikmace Sep 19, 2025
55069eb
Merge branch 'main' into feat/3514/cf-business-logic
nikmace Sep 23, 2025
fae9850
test: add tests
nikmace Sep 23, 2025
046eec9
test: add tests
nikmace Sep 23, 2025
0c18c7f
Merge branch 'main' into feat/3514/cf-business-logic
nikmace Sep 23, 2025
ef8657a
chore: update lock file from merge commit
nikmace Sep 23, 2025
d8e7ad2
fix: tests
nikmace Sep 23, 2025
563d1ba
fix: tests
nikmace Sep 23, 2025
dd7c8f0
test: add new tests
nikmace Sep 24, 2025
b7d5224
test: add new tests
nikmace Sep 25, 2025
fe50200
test: add new tests
nikmace Sep 25, 2025
af20199
test: add all tests for adp tooling
nikmace Sep 26, 2025
af9eed6
test: fix windows tests
nikmace Sep 26, 2025
3ce18dc
fix: sonar issues
nikmace Sep 26, 2025
78b158a
fix: sonar issues
nikmace Sep 26, 2025
80cfcc1
fix: sonar issues
nikmace Sep 26, 2025
c6c8e4c
fix: sonar issues
nikmace Sep 26, 2025
6f9cbf3
fix: sonar issues
nikmace Sep 26, 2025
657e99a
fix: sonar issues
nikmace Sep 26, 2025
1e91c02
test: add new tests
nikmace Sep 29, 2025
725d5a4
test: add new tests
nikmace Sep 29, 2025
68c5d6c
test: add new tests
nikmace Sep 29, 2025
b897ca2
test: add new tests
nikmace Sep 29, 2025
8b817a1
Merge branch 'main' into feat/3514/cf-business-logic
nikmace Sep 30, 2025
914b6d3
test: add integration tests for cf flow
nikmace Sep 30, 2025
7f42cc1
fix: lint errors
nikmace Sep 30, 2025
fb875cb
fix: lint errors
nikmace Sep 30, 2025
5869400
chore: add cset
nikmace Sep 30, 2025
bb75006
fix(wip): change incorrect property setting for the yaml file
nikmace Oct 2, 2025
a953335
fix: add missing properties to configuration files in CF scenario
nikmace Oct 6, 2025
14646e9
fix: negated conditions
nikmace Oct 6, 2025
7fa08db
Merge branch 'main' into feat/3514/cf-business-logic
nikmace Oct 6, 2025
b4e76c5
test: improve coverage
nikmace Oct 6, 2025
b980d18
Merge branch 'main' into feat/3514/cf-business-logic
nikmace Oct 6, 2025
7429248
feat: add new structure to the cf project
nikmace Oct 6, 2025
c17c5d5
test: improve coverage
nikmace Oct 7, 2025
7abbae8
chore: add cset
nikmace Oct 7, 2025
6e638d6
chore: update cset
nikmace Oct 9, 2025
f04c4fa
Merge remote-tracking branch 'origin/main' into feat/3699/cf-project-…
nikmace Oct 14, 2025
a6018e8
chore: remove extra cset
nikmace Oct 14, 2025
4bdd950
refactor: change i18n
nikmace Oct 14, 2025
d06b55b
fix: incorrect property
nikmace Oct 14, 2025
a20defd
Merge remote-tracking branch 'origin/main' into feat/3699/cf-project-…
nikmace Oct 20, 2025
e68f877
feat: add ui5 build yaml
nikmace Oct 20, 2025
6e34d8e
test: add new tests and fix existing ones
nikmace Oct 20, 2025
7015ccb
Merge branch 'main' into feat/3699/cf-project-structure
nikmace Oct 20, 2025
d714cf3
chore: update template package json versions
nikmace Oct 21, 2025
7e2736d
fix: conflict when overwriting existing files
nikmace Oct 21, 2025
9a48872
feat: add feature toggle for cf flow
nikmace Oct 22, 2025
3835fcf
Merge remote-tracking branch 'origin/main' into feat/3699/cf-project-…
nikmace Oct 22, 2025
48d116e
fix: sonar issues
nikmace Oct 22, 2025
521b262
Merge branch 'main' into feat/3699/cf-project-structure
nikmace Oct 22, 2025
14b8e18
test: adjust test
nikmace Oct 22, 2025
9c890e7
Merge branches 'feat/3699/cf-project-structure' and 'feat/3699/cf-pro…
nikmace Oct 22, 2025
e46ef95
Merge branch 'main' into feat/3699/cf-project-structure
nikmace Oct 27, 2025
5c9759b
refactor: replace url with constant
nikmace Oct 28, 2025
7826016
Merge branch 'main' into feat/3699/cf-project-structure
nikmace Oct 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/eighty-coins-sip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@sap-ux/generator-adp': patch
'@sap-ux/adp-tooling': patch
---

feat: Adapt CF projects' structure to work with preview-middleware
2 changes: 1 addition & 1 deletion packages/adp-tooling/src/cf/services/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export function getFDCRequestArguments(cfConfig: CfConfig): RequestArguments {
* @param {string[]} appHostIds - The app host ids.
* @param {CfConfig} cfConfig - The CF config.
* @param {ToolsLogger} logger - The logger.
* @returns {Promise<FDCResponse>} The FDC apps.
* @returns {Promise<CFApp[]>} The FDC apps.
*/
export async function getFDCApps(appHostIds: string[], cfConfig: CfConfig, logger: ToolsLogger): Promise<CFApp[]> {
const requestArguments = getFDCRequestArguments(cfConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
},
"error": {
"appDoesNotSupportFlexibility": "The selected application does not support flexibility because it has `flexEnabled=false`. SAPUI5 Adaptation Project only supports applications that support flexibility. Please select a different application.",
"failedToParseXsAppJson": "Failed to parse `xs-app.json`. Error: {{error}}",
"failedToParseXsAppJson": "Failed to parse the `xs-app.json` file. Error: {{error}}",
"failedToParseManifestJson": "Failed to parse the `manifest.json` file. Error: {{error}}",
"oDataEndpointsValidationFailed": "Validation for the OData endpoints has failed. For more information, check the logs.",
"adpDoesNotSupportSelectedApp": "Adaptation project doesn't support the selected application. Please select a different application.",
Expand Down
3 changes: 2 additions & 1 deletion packages/adp-tooling/src/writer/cf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { adjustMtaYaml } from '../cf';
import { getApplicationType } from '../source';
import { fillDescriptorContent } from './manifest';
import type { CfAdpWriterConfig, Content } from '../types';
import { getCfVariant, writeCfTemplates } from './project-utils';
import { getCfVariant, writeCfTemplates, writeUI5YamlCf } from './project-utils';
import { getI18nDescription, getI18nModels, writeI18nModels } from './i18n';

/**
Expand Down Expand Up @@ -53,6 +53,7 @@ export async function generateCf(
fillDescriptorContent(variant.content as Content[], app.appType, ui5.version, app.i18nModels);

await writeCfTemplates(basePath, variant, fullConfig, fs);
await writeUI5YamlCf(fullConfig.project.folder, fullConfig, fs);

return fs;
}
Expand Down
60 changes: 59 additions & 1 deletion packages/adp-tooling/src/writer/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import type {
CloudApp,
InternalInboundNavigation,
CloudCustomTaskConfig,
CloudCustomTaskConfigTarget
CloudCustomTaskConfigTarget,
CfAdpWriterConfig
} from '../types';

const VSCODE_URL = 'https://REQUIRED_FOR_VSCODE.example';
Expand Down Expand Up @@ -346,3 +347,60 @@ export function enhanceManifestChangeContentWithFlpConfig(
manifestChangeContent.push(removeOtherInboundsChange);
}
}

/**
* Generate custom configuration required for the ui5.yaml.
*
* @param {UI5Config} ui5Config - Configuration representing the ui5.yaml.
* @param {CfAdpWriterConfig} config - Full project configuration.
*/
export function enhanceUI5YamlWithCfCustomTask(ui5Config: UI5Config, config: CfAdpWriterConfig): void {
const { baseApp, cf, project } = config;
ui5Config.addCustomTasks([
{
name: 'app-variant-bundler-build',
beforeTask: 'escapeNonAsciiCharacters',
configuration: {
module: project.name,
appHostId: baseApp.appHostId,
appName: baseApp.appName,
appVersion: baseApp.appVersion,
html5RepoRuntime: cf.html5RepoRuntimeGuid,
org: cf.org.GUID,
space: cf.space.GUID,
sapCloudService: cf.businessSolutionName ?? '',
instanceName: cf.businessService
}
}
]);
}

/**
* Generate custom configuration required for the ui5.yaml.
*
* @param {UI5Config} ui5Config - Configuration representing the ui5.yaml.
*/
export function enhanceUI5YamlWithCfCustomMiddleware(ui5Config: UI5Config): void {
const ui5ConfigOptions: Partial<FioriToolsProxyConfigUI5> = {
url: 'https://ui5.sap.com'
};

ui5Config.addFioriToolsProxyMiddleware(
{
ui5: ui5ConfigOptions,
backend: []
},
'compression'
);
ui5Config.addCustomMiddleware([
{
name: 'fiori-tools-preview',
afterMiddleware: 'fiori-tools-proxy',
configuration: {
flp: {
theme: 'sap_horizon'
}
}
}
]);
}
72 changes: 33 additions & 39 deletions packages/adp-tooling/src/writer/project-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ import {
type CustomConfig,
type TypesConfig,
type CfAdpWriterConfig,
type DescriptorVariant,
ApplicationType
type DescriptorVariant
} from '../types';
import {
enhanceUI5DeployYaml,
enhanceUI5Yaml,
hasDeployConfig,
enhanceUI5YamlWithCustomConfig,
enhanceUI5YamlWithCustomTask,
enhanceUI5YamlWithTranspileMiddleware
enhanceUI5YamlWithTranspileMiddleware,
enhanceUI5YamlWithCfCustomTask,
enhanceUI5YamlWithCfCustomMiddleware
} from './options';

import type { Package } from '@sap-ux/project-access';
Expand Down Expand Up @@ -125,30 +126,6 @@ export function getCfVariant(config: CfAdpWriterConfig): DescriptorVariant {
return variant;
}

/**
* Get the ADP config for the CF project.
*
* @param {CfAdpWriterConfig} config - The CF configuration.
* @returns {Record<string, unknown>} The ADP config for the CF project.
*/
export function getCfAdpConfig(config: CfAdpWriterConfig): Record<string, unknown> {
const { app, project, ui5, cf } = config;
const configJson = {
componentname: app.namespace,
appvariant: project.name,
layer: app.layer,
isOVPApp: app.appType === ApplicationType.FIORI_ELEMENTS_OVP,
isFioriElement: app.appType === ApplicationType.FIORI_ELEMENTS,
environment: 'CF',
ui5Version: ui5.version,
cfApiUrl: cf.url,
cfSpace: cf.space.GUID,
cfOrganization: cf.org.GUID
};

return configJson;
}

/**
* Writes a given project template files within a specified folder in the project directory.
*
Expand Down Expand Up @@ -212,6 +189,33 @@ export async function writeUI5Yaml(projectPath: string, data: AdpWriterConfig, f
}
}

/**
* Writes a ui5.yaml file for CF project within a specified folder in the project directory.
*
* @param {string} projectPath - The root path of the project.
* @param {AdpWriterConfig} data - The data to be populated in the template file.
* @param {Editor} fs - The `mem-fs-editor` instance used for file operations.
* @returns {void}
*/
export async function writeUI5YamlCf(projectPath: string, data: CfAdpWriterConfig, fs: Editor): Promise<void> {
try {
const ui5ConfigPath = join(projectPath, 'ui5.yaml');
const baseUi5ConfigContent = fs.read(ui5ConfigPath);
const ui5Config = await UI5Config.newInstance(baseUi5ConfigContent);
ui5Config.setConfiguration({ propertiesFileSourceEncoding: 'UTF-8', paths: { webapp: 'dist' } });

/** Builder task */
enhanceUI5YamlWithCfCustomTask(ui5Config, data);

/** Middlewares */
enhanceUI5YamlWithCfCustomMiddleware(ui5Config);

fs.write(ui5ConfigPath, ui5Config.toString());
} catch (e) {
throw new Error(`Could not write ui5.yaml file. Reason: ${e.message}`);
}
}

/**
* Writes a ui5-deploy.yaml file within a specified folder in the project directory.
*
Expand Down Expand Up @@ -251,7 +255,7 @@ export async function writeCfTemplates(
): Promise<void> {
const baseTmplPath = join(__dirname, '../../templates');
const templatePath = config.options?.templatePathOverwrite ?? baseTmplPath;
const { app, baseApp, cf, project, options } = config;
const { app, project, options } = config;

fs.copyTpl(
join(templatePath, 'project/webapp/manifest.appdescr_variant'),
Expand All @@ -264,19 +268,9 @@ export async function writeCfTemplates(
});

fs.copyTpl(join(templatePath, 'cf/ui5.yaml'), join(project.folder, 'ui5.yaml'), {
appHostId: baseApp.appHostId,
appName: baseApp.appName,
appVersion: baseApp.appVersion,
module: project.name,
html5RepoRuntime: cf.html5RepoRuntimeGuid,
org: cf.org.GUID,
space: cf.space.GUID,
sapCloudService: cf.businessSolutionName ?? '',
instanceName: cf.businessService
module: project.name
});

fs.writeJSON(join(project.folder, '.adp/config.json'), getCfAdpConfig(config));

fs.copyTpl(join(templatePath, 'cf/i18n/i18n.properties'), join(project.folder, 'webapp/i18n/i18n.properties'), {
module: project.name,
moduleTitle: app.title,
Expand Down
4 changes: 3 additions & 1 deletion packages/adp-tooling/templates/cf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
"start": "fiori run --open /test/flp.html#app-preview",
"build": "npm run clean && ui5 build --include-task=generateCachebusterInfo && npm run zip",
"zip": "cd dist && npx bestzip ../<%= module %>.zip *",
"clean": "npx rimraf <%= module %>.zip dist",
Expand All @@ -22,7 +23,8 @@
"devDependencies": {
"@sap/ui5-builder-webide-extension": "1.0.x",
"@sapui5/ts-types": "^1.85.1",
"@ui5/cli": "^3.0.0",
"@sap/ux-ui5-tooling": "1",
"@ui5/cli": "^4.0.16",
"@ui5/task-adaptation": "^1.0.x",
"bestzip": "2.1.4",
"rimraf": "3.0.2"
Expand Down
14 changes: 0 additions & 14 deletions packages/adp-tooling/templates/cf/ui5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,3 @@ specVersion: "2.2"
type: application
metadata:
name: <%= module %>
builder:
customTasks:
- name: app-variant-bundler-build
beforeTask: escapeNonAsciiCharacters
configuration:
appHostId: <%= appHostId %>
appName: <%= appName %>
appVersion: <%= appVersion %>
moduleName: <%= module %>
org: <%= org %>
space: <%= space %>
html5RepoRuntime: <%= html5RepoRuntime %>
sapCloudService: <%= sapCloudService %>
serviceInstanceName: <%= instanceName %>
Loading
Loading