Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
945d8ca
add support for ui5 project type 'component'
heimwege Dec 15, 2025
8e70432
Merge branch 'main' into feat/project-access/path-mappings-for-type-c…
heimwege Dec 16, 2025
c204fc0
add getWebappTestPath function and shortcut checking webapp directory
heimwege Jan 9, 2026
f93c92c
Merge branch 'main' of github.com:SAP/open-ux-tools into feat/project…
heimwege Jan 9, 2026
c263f20
export getWebappTestPath
heimwege Jan 9, 2026
7a15c06
remove unused code from eslint-plugin-fiori-tools
heimwege Jan 9, 2026
affb2f9
adjust virtual endpoints converter
heimwege Jan 9, 2026
9a54964
add todo for preview middleware
heimwege Jan 9, 2026
abbfe2f
adjust todo
heimwege Jan 9, 2026
3ebf770
adjust todos
heimwege Jan 9, 2026
7aabc18
make use of project type from ui5 server
heimwege Jan 19, 2026
3f16d92
refactoring
heimwege Jan 20, 2026
cfa9c09
Merge branch 'main' of github.com:SAP/open-ux-tools into feat/project…
heimwege Jan 20, 2026
eeeba31
Merge branch 'main' into feat/project-access/path-mappings-for-type-c…
heimwege Jan 20, 2026
a0b598e
fix unit tests
heimwege Jan 20, 2026
7bde53b
Merge branch 'main' into feat/project-access/path-mappings-for-type-c…
heimwege Jan 20, 2026
76e2aa4
add test project, adjust readme, refactoring and support editors
heimwege Jan 21, 2026
277c92c
delete unused code
heimwege Jan 21, 2026
3f41b86
refactoring, refactoring, refactoring
heimwege Jan 21, 2026
c5157ad
fix cards generator and add todo
heimwege Jan 21, 2026
93c77be
adjust reading manifest and manifest.appdescr_variant
heimwege Jan 21, 2026
0e8ea3f
fix reading manifest and manifest.appdescr_variant
heimwege Jan 21, 2026
a378724
more refactoring and fixes (sample app running with ui5 project type …
heimwege Jan 23, 2026
8e2b9a2
some renaming and refactoring
heimwege Jan 23, 2026
24d73e9
minor refactoring
heimwege Jan 26, 2026
6055b49
Merge branch 'main' of github.com:SAP/open-ux-tools into feat/project…
heimwege Jan 26, 2026
040b89f
Merge branch 'main' into feat/project-access/path-mappings-for-type-c…
heimwege Jan 26, 2026
4e872b7
adjust ui5 proxy to type component
heimwege Jan 27, 2026
845b16f
add unit tests for getWebappTestPath
heimwege Jan 27, 2026
c28db59
fix sonar issue
heimwege Jan 27, 2026
9995447
prettier
heimwege Jan 27, 2026
3b8212a
adjust jsdoc
heimwege Jan 27, 2026
da4a9f5
adjust proxy middleware UI5 spec version
heimwege Jan 27, 2026
cb338c4
add additional debug logging for routes
heimwege Jan 27, 2026
7d99e49
fix TestConfigDefaults
heimwege Jan 27, 2026
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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"typescript-eslint": "8.49.0",
"update-ts-references": "3.6.2",
"yargs-parser": "21.1.1",
"yaml": "2.8.2"
"yaml": "2.8.2",
"@sap-ux/ui5-config": "workspace:*"
},
"scripts": {
"update-ts-references": "update-ts-references",
Expand Down
16 changes: 13 additions & 3 deletions packages/adp-tooling/src/base/helper.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import type { Editor } from 'mem-fs-editor';
import type { ReaderCollection } from '@ui5/fs'; // eslint-disable-line sonarjs/no-implicit-dependencies
import { existsSync, readdirSync, readFileSync } from 'node:fs';
import { join, isAbsolute, relative, basename, dirname } from 'node:path';
import { join, isAbsolute, relative, basename, dirname, posix } from 'node:path';

import type { UI5Config } from '@sap-ux/ui5-config';
import type { InboundContent, Inbound } from '@sap-ux/axios-extension';
import { getWebappPath, FileName, readUi5Yaml, type ManifestNamespace, type Manifest } from '@sap-ux/project-access';

import type { DescriptorVariant, AdpPreviewConfig, UI5YamlCustomTaskConfiguration } from '../types';
// eslint-disable-next-line sonarjs/no-implicit-dependencies
import type { MiddlewareUtils } from '@ui5/server';

/**
* Get the app descriptor variant.
Expand Down Expand Up @@ -120,10 +122,18 @@ export function readManifestFromBuildPath(cfBuildPath: string): Manifest {
* Load and parse the app variant descriptor.
*
* @param {ReaderCollection} rootProject - The root project.
* @param {MiddlewareUtils} utils - The middleware utils.
* @returns {Promise<DescriptorVariant>} The parsed descriptor variant.
*/
export async function loadAppVariant(rootProject: ReaderCollection): Promise<DescriptorVariant> {
const appVariant = await rootProject.byPath('/manifest.appdescr_variant');
export async function loadAppVariant(
rootProject: ReaderCollection,
utils: MiddlewareUtils
): Promise<DescriptorVariant> {
const pathPrefix =
utils.getProject?.()?.getType?.() === 'component'
? posix.join('/resources', utils.getProject().getNamespace())
: '';
const appVariant = await rootProject.byPath(`${pathPrefix}/manifest.appdescr_variant`);
if (!appVariant) {
throw new Error('ADP configured but no manifest.appdescr_variant found.');
}
Expand Down
19 changes: 15 additions & 4 deletions packages/adp-tooling/test/unit/base/helper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ import {
loadAppVariant
} from '../../../src/base/helper';
import { readUi5Yaml } from '@sap-ux/project-access';
import { tmpdir } from 'node:os';
//eslint-disable-next-line sonarjs/no-implicit-dependencies
import type { MiddlewareUtils } from '@ui5/server';

jest.mock('fs', () => {
return {
Expand Down Expand Up @@ -421,6 +424,14 @@ describe('helper', () => {
namespace: 'apps/base.app/appVariants/my.adaptation/',
content: []
};
const mockUtils = {
getProject() {
return {
getSourcePath: () => tmpdir(),
getType: () => 'application'
};
}
} as unknown as MiddlewareUtils;

beforeEach(() => {
jest.clearAllMocks();
Expand All @@ -435,7 +446,7 @@ describe('helper', () => {
byPath: jest.fn().mockResolvedValue(mockResource)
} as unknown as ReaderCollection;

const result = await loadAppVariant(mockRootProject);
const result = await loadAppVariant(mockRootProject, mockUtils);

expect(mockRootProject.byPath).toHaveBeenCalledWith('/manifest.appdescr_variant');
expect(mockResource.getString).toHaveBeenCalled();
Expand All @@ -447,7 +458,7 @@ describe('helper', () => {
byPath: jest.fn().mockResolvedValue(null)
} as unknown as ReaderCollection;

await expect(loadAppVariant(mockRootProject)).rejects.toThrow(
await expect(loadAppVariant(mockRootProject, mockUtils)).rejects.toThrow(
'ADP configured but no manifest.appdescr_variant found.'
);
expect(mockRootProject.byPath).toHaveBeenCalledWith('/manifest.appdescr_variant');
Expand All @@ -462,7 +473,7 @@ describe('helper', () => {
byPath: jest.fn().mockResolvedValue(mockResource)
} as unknown as ReaderCollection;

await expect(loadAppVariant(mockRootProject)).rejects.toThrow(
await expect(loadAppVariant(mockRootProject, mockUtils)).rejects.toThrow(
'ADP configured but manifest.appdescr_variant file is empty.'
);
expect(mockRootProject.byPath).toHaveBeenCalledWith('/manifest.appdescr_variant');
Expand All @@ -479,7 +490,7 @@ describe('helper', () => {
byPath: jest.fn().mockResolvedValue(mockResource)
} as unknown as ReaderCollection;

await expect(loadAppVariant(mockRootProject)).rejects.toThrow(
await expect(loadAppVariant(mockRootProject, mockUtils)).rejects.toThrow(
'Failed to parse manifest.appdescr_variant: File read error'
);
expect(mockRootProject.byPath).toHaveBeenCalledWith('/manifest.appdescr_variant');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import * as manifestService from '../../../src/base/abap/manifest-service';
import type { AddXMLChange, AdpPreviewConfig, CommonChangeProperties } from '../../../src';
import { addXmlFragment, tryFixChange, addControllerExtension } from '../../../src/preview/change-handler';
import { addCustomSectionFragment } from '../../../src/preview/descriptor-change-handler';
// eslint-disable-next-line sonarjs/no-implicit-dependencies
import type { MiddlewareUtils } from '@ui5/server';

interface GetFragmentsResponse {
fragments: { fragmentName: string }[];
Expand Down Expand Up @@ -142,10 +144,13 @@ describe('AdaptationProject', () => {
},
getNamespace() {
return 'adp/project';
},
getType() {
return 'application';
}
};
}
};
} as unknown as MiddlewareUtils;

const logger = new ToolsLogger();
describe('init', () => {
Expand Down
10 changes: 6 additions & 4 deletions packages/app-config-writer/src/preview-config/preview-files.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { join } from 'node:path';
import { getWebappPath } from '@sap-ux/project-access';
import { join, basename } from 'node:path';
import { getWebappTestPath } from '@sap-ux/project-access';
import type { Editor } from 'mem-fs-editor';
import type { ToolsLogger } from '@sap-ux/logger';
import { TEST_CONFIG_DEFAULTS } from '../common/ui5-yaml';
Expand All @@ -22,7 +22,9 @@ const renameMessage = (filePath: string): string =>
* @param logger logger to report info to the user
*/
export async function renameSandbox(fs: Editor, basePath: string, path: string, logger?: ToolsLogger): Promise<void> {
const filePath = join(await getWebappPath(basePath), path);
const webappTestPath = await getWebappTestPath(basePath);
const fileName = basename(path);
const filePath = join(webappTestPath, fileName);
if (fs.exists(filePath)) {
fs.move(filePath, filePath.replace('.html', '_old.html'));
logger?.info(renameMessage(path));
Expand Down Expand Up @@ -86,7 +88,7 @@ export async function deleteNoLongerUsedFiles(
convertTests: boolean,
logger?: ToolsLogger
): Promise<void> {
const webappTestPath = join(await getWebappPath(basePath, fs), 'test');
const webappTestPath = await getWebappTestPath(basePath, fs);
const files = [
join(webappTestPath, 'locate-reuse-libs.js'),
join(webappTestPath, 'changes_loader.js'),
Expand Down
Loading
Loading