From 15e695980219a6331b6d0c844427774576c7a0fc Mon Sep 17 00:00:00 2001 From: Austin Devine Date: Mon, 14 Oct 2024 17:29:59 +0100 Subject: [PATCH 01/18] TBI - refactor validation on target folder in app inquirer (#2461) --- .changeset/warm-dolphins-exercise.md | 6 ++ packages/project-access/src/index.ts | 1 - packages/project-access/src/project/index.ts | 3 +- packages/project-access/src/project/search.ts | 19 ++----- .../project-access/test/project/cap.test.ts | 55 ------------------- .../src/prompts/validators.ts | 10 ++-- .../test/unit/prompts/validators.test.ts | 9 ++- 7 files changed, 23 insertions(+), 80 deletions(-) create mode 100644 .changeset/warm-dolphins-exercise.md diff --git a/.changeset/warm-dolphins-exercise.md b/.changeset/warm-dolphins-exercise.md new file mode 100644 index 0000000000..891594fba1 --- /dev/null +++ b/.changeset/warm-dolphins-exercise.md @@ -0,0 +1,6 @@ +--- +"@sap-ux/project-access": minor +"@sap-ux/ui5-application-inquirer": patch +--- + +TBI - refactor validation on target folder in app inquirer diff --git a/packages/project-access/src/index.ts b/packages/project-access/src/index.ts index 03218db371..39e06fc248 100644 --- a/packages/project-access/src/index.ts +++ b/packages/project-access/src/index.ts @@ -5,7 +5,6 @@ export { clearCdsModuleCache, createApplicationAccess, createProjectAccess, - isPathForCapApp, deleteCapApp, filterDataSourcesByType, findAllApps, diff --git a/packages/project-access/src/project/index.ts b/packages/project-access/src/project/index.ts index 6c138315d6..594c1bf068 100644 --- a/packages/project-access/src/project/index.ts +++ b/packages/project-access/src/project/index.ts @@ -35,8 +35,7 @@ export { findProjectRoot, getAppRootFromWebappPath, findCapProjectRoot, - findRootsForPath, - isPathForCapApp + findRootsForPath } from './search'; export { getWebappPath, readUi5Yaml } from './ui5-config'; export { getMtaPath } from './mta'; diff --git a/packages/project-access/src/project/search.ts b/packages/project-access/src/project/search.ts index 862c0f4427..8f4e660225 100644 --- a/packages/project-access/src/project/search.ts +++ b/packages/project-access/src/project/search.ts @@ -215,9 +215,10 @@ export async function findRootsForPath(path: string): Promise<{ appRoot: string; * Find CAP project root path. * * @param path - path inside CAP project + * @param checkForAppRouter - if true, checks for app router in CAP project app folder * @returns - CAP project root path */ -export async function findCapProjectRoot(path: string): Promise { +export async function findCapProjectRoot(path: string, checkForAppRouter = true): Promise { try { if (!isAbsolute(path)) { return null; @@ -228,7 +229,8 @@ export async function findCapProjectRoot(path: string): Promise { if (await getCapProjectType(projectRoot)) { // We have found a CAP project as root. Check if the found app is not directly in CAP's 'app/' folder. // Sometime there is a /app/package.json file that is used for app router (not an app) - if (join(projectRoot, 'app') !== path || join(projectRoot, 'app', sep) !== path) { + // or skip app router check if checkForAppRouter is false and return the project root. + if ((checkForAppRouter && join(projectRoot, 'app') !== path) || !checkForAppRouter) { return projectRoot; } } @@ -499,16 +501,3 @@ export async function findCapProjects(options: { } return Array.from(result); } - -/** - * Returns true if the specified target path contains a CAP project. - * Checks sub and root directories. - * - * @param targetDir the target directory path. - * @returns true if CAP Project is in the directory or false if not. - */ -export async function isPathForCapApp(targetDir: string): Promise { - // Check if targetDir is a CAP project - // If not a CAP project root, check if the CAP root is in the subdirectories - return !!(await getCapProjectType(targetDir)) || !!(await findCapProjectRoot(targetDir)); -} diff --git a/packages/project-access/test/project/cap.test.ts b/packages/project-access/test/project/cap.test.ts index 1f112527cc..e92da030de 100644 --- a/packages/project-access/test/project/cap.test.ts +++ b/packages/project-access/test/project/cap.test.ts @@ -21,7 +21,6 @@ import { isCapProject, deleteCapApp } from '../../src'; -import { isPathForCapApp } from '../../src/project/search'; import * as file from '../../src/file'; import os from 'os'; import type { Logger } from '@sap-ux/logger'; @@ -89,60 +88,6 @@ describe('Test isCapJavaProject()', () => { ).toBeFalsy(); }); }); -describe('Test isPathForCapApp()', () => { - test('Should return true for root CAP path', async () => { - const result = await isPathForCapApp( - join(__dirname, '../test-data/project/find-all-apps/CAP/CAPnode_fiori_elements/app/fiori_elements/') - ); - expect(result).toBe(true); - }); - - test('Should return true for sub directory CAP path', async () => { - const result = await isPathForCapApp( - join(__dirname, '../test-data/project/find-all-apps/CAP/CAPnode_fiori_elements/app/fiori_elements/webapp/') - ); - expect(result).toBe(true); - }); - - test('Should return true for sub directory CAP path, specifially app folder', async () => { - const result = await isPathForCapApp( - join(__dirname, '../test-data/project/find-all-apps/CAP/CAPnode_fiori_elements/app') - ); - expect(result).toBe(true); - }); - - test('Should return true for sub directory CAP path, specifially app/ folder', async () => { - const result = await isPathForCapApp( - join(__dirname, '../test-data/project/find-all-apps/CAP/CAPnode_fiori_elements/app/') - ); - expect(result).toBe(true); - }); - - test('Should return true for sub directory CAP path on Windows, specifially app folder', async () => { - const pathSep = sep; - const result = await isPathForCapApp( - join( - __dirname, - `..${pathSep}test-data${pathSep}project${pathSep}find-all-apps${pathSep}CAP${pathSep}CAPnode_fiori_elements${pathSep}app` - ) - ); - expect(result).toBe(true); - const result2 = await isPathForCapApp( - join( - __dirname, - `..${pathSep}test-data${pathSep}project${pathSep}find-all-apps${pathSep}CAP${pathSep}CAPnode_fiori_elements${pathSep}app${pathSep}` - ) - ); - expect(result2).toBe(true); - }); - - test('Should return false for non CAP path', async () => { - const result = await isPathForCapApp( - join(__dirname, '../test-data/project/find-all-apps/find-all-apps/adaptations/valid-adaptation') - ); - expect(result).toBe(false); - }); -}); describe('Test getCapModelAndServices()', () => { afterEach(() => { diff --git a/packages/ui5-application-inquirer/src/prompts/validators.ts b/packages/ui5-application-inquirer/src/prompts/validators.ts index e530b7736f..d8923d3f5d 100644 --- a/packages/ui5-application-inquirer/src/prompts/validators.ts +++ b/packages/ui5-application-inquirer/src/prompts/validators.ts @@ -1,7 +1,7 @@ import { validateModuleName } from '@sap-ux/project-input-validator'; import { appPathExists } from './prompt-helpers'; import { t } from '../i18n'; -import { findRootsForPath, isPathForCapApp } from '@sap-ux/project-access'; +import { findRootsForPath, findCapProjectRoot, getCapProjectType } from '@sap-ux/project-access'; /** * Returns true (valid) if the specified projectName is a valid module name * and if an application folder (directory) at the specified path does not exist. @@ -30,12 +30,14 @@ export function validateAppName(appName: string, targetDir: string): boolean | s * @returns true, if not Fiori Project, or string message indicating that the path contains a Fiori project. */ export async function validateFioriAppProjectFolder(targetDir: string): Promise { + // Check if the target directory contains a CAP project + if (!!(await findCapProjectRoot(targetDir, false)) || !!(await getCapProjectType(targetDir))) { + return t('validators.folderContainsCapApp'); + } + // Check if the target directory contains a Fiori project const appRoot = await findRootsForPath(targetDir); if (appRoot) { return t('validators.folderContainsFioriApp', { path: appRoot.appRoot }); - } - if (await isPathForCapApp(targetDir)) { - return t('validators.folderContainsCapApp'); } else { return true; } diff --git a/packages/ui5-application-inquirer/test/unit/prompts/validators.test.ts b/packages/ui5-application-inquirer/test/unit/prompts/validators.test.ts index 7bd6d0d0e4..fcba10e716 100644 --- a/packages/ui5-application-inquirer/test/unit/prompts/validators.test.ts +++ b/packages/ui5-application-inquirer/test/unit/prompts/validators.test.ts @@ -3,7 +3,7 @@ import * as promptHelpers from '../../../src/prompts/prompt-helpers'; import { join } from 'path'; import { initI18nUi5AppInquirer, t } from '../../../src/i18n'; import { validateAppName, validateFioriAppProjectFolder } from '../../../src/prompts/validators'; -import { findRootsForPath } from '@sap-ux/project-access'; +import { findRootsForPath, findCapProjectRoot } from '@sap-ux/project-access'; import * as projectAccess from '@sap-ux/project-access'; /** @@ -18,7 +18,8 @@ jest.mock('@sap-ux/project-input-validator', () => { jest.mock('@sap-ux/project-access', () => ({ findRootsForPath: jest.fn(), - isPathForCapApp: jest.fn() + findCapProjectRoot: jest.fn(), + getCapProjectType: jest.fn() })); describe('validators', () => { @@ -51,9 +52,11 @@ describe('validators', () => { }); describe('validateFioriAppProjectFolder', () => { const mockFindRootsForPath = jest.fn(); + const mockFindCapProjectRoot = jest.fn(); beforeEach(() => { (findRootsForPath as jest.Mock) = mockFindRootsForPath; + (findCapProjectRoot as jest.Mock) = mockFindCapProjectRoot; jest.clearAllMocks(); }); @@ -75,7 +78,7 @@ describe('validators', () => { test('should return an error message if a CAP project is found in the target directory', async () => { mockFindRootsForPath.mockResolvedValueOnce(null); - jest.spyOn(projectAccess, 'isPathForCapApp').mockResolvedValue(true); + mockFindCapProjectRoot.mockResolvedValueOnce('CAPJava'); const result = await validateFioriAppProjectFolder('any/path'); expect(result).toEqual(t('validators.folderContainsCapApp')); }); From d7f2c654d80db2f8c4f74a3436ccda9bcabc3e71 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 14 Oct 2024 16:41:16 +0000 Subject: [PATCH 02/18] chore: apply latest changesets --- .changeset/warm-dolphins-exercise.md | 6 ------ examples/fe-fpm-cli/CHANGELOG.md | 6 ++++++ examples/fe-fpm-cli/package.json | 2 +- examples/simple-generator/CHANGELOG.md | 9 +++++++++ examples/simple-generator/package.json | 2 +- .../abap-deploy-config-inquirer/CHANGELOG.md | 8 ++++++++ .../abap-deploy-config-inquirer/package.json | 2 +- packages/abap-deploy-config-writer/CHANGELOG.md | 8 ++++++++ packages/abap-deploy-config-writer/package.json | 2 +- packages/adp-tooling/CHANGELOG.md | 9 +++++++++ packages/adp-tooling/package.json | 2 +- packages/annotation-generator/CHANGELOG.md | 8 ++++++++ packages/annotation-generator/package.json | 2 +- packages/app-config-writer/CHANGELOG.md | 8 ++++++++ packages/app-config-writer/package.json | 2 +- packages/cap-config-writer/CHANGELOG.md | 8 ++++++++ packages/cap-config-writer/package.json | 2 +- packages/cards-editor-middleware/CHANGELOG.md | 7 +++++++ packages/cards-editor-middleware/package.json | 2 +- packages/create/CHANGELOG.md | 16 ++++++++++++++++ packages/create/package.json | 2 +- packages/environment-check/CHANGELOG.md | 8 ++++++++ packages/environment-check/package.json | 2 +- packages/fe-fpm-writer/CHANGELOG.md | 8 ++++++++ packages/fe-fpm-writer/package.json | 2 +- packages/fiori-annotation-api/CHANGELOG.md | 8 ++++++++ packages/fiori-annotation-api/package.json | 2 +- packages/fiori-elements-writer/CHANGELOG.md | 10 ++++++++++ packages/fiori-elements-writer/package.json | 2 +- packages/fiori-freestyle-writer/CHANGELOG.md | 8 ++++++++ packages/fiori-freestyle-writer/package.json | 2 +- packages/fiori-generator-shared/CHANGELOG.md | 7 +++++++ packages/fiori-generator-shared/package.json | 2 +- packages/launch-config/CHANGELOG.md | 7 +++++++ packages/launch-config/package.json | 2 +- packages/odata-service-inquirer/CHANGELOG.md | 9 +++++++++ packages/odata-service-inquirer/package.json | 2 +- packages/preview-middleware/CHANGELOG.md | 8 ++++++++ packages/preview-middleware/package.json | 2 +- packages/project-access/CHANGELOG.md | 6 ++++++ packages/project-access/package.json | 2 +- packages/telemetry/CHANGELOG.md | 7 +++++++ packages/telemetry/package.json | 2 +- packages/ui5-application-inquirer/CHANGELOG.md | 8 ++++++++ packages/ui5-application-inquirer/package.json | 2 +- .../ui5-library-reference-inquirer/CHANGELOG.md | 7 +++++++ .../ui5-library-reference-inquirer/package.json | 2 +- .../ui5-library-reference-writer/CHANGELOG.md | 7 +++++++ .../ui5-library-reference-writer/package.json | 2 +- packages/ui5-library-sub-generator/CHANGELOG.md | 7 +++++++ packages/ui5-library-sub-generator/package.json | 2 +- packages/ui5-library-writer/CHANGELOG.md | 8 ++++++++ packages/ui5-library-writer/package.json | 2 +- 53 files changed, 236 insertions(+), 32 deletions(-) delete mode 100644 .changeset/warm-dolphins-exercise.md diff --git a/.changeset/warm-dolphins-exercise.md b/.changeset/warm-dolphins-exercise.md deleted file mode 100644 index 891594fba1..0000000000 --- a/.changeset/warm-dolphins-exercise.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@sap-ux/project-access": minor -"@sap-ux/ui5-application-inquirer": patch ---- - -TBI - refactor validation on target folder in app inquirer diff --git a/examples/fe-fpm-cli/CHANGELOG.md b/examples/fe-fpm-cli/CHANGELOG.md index 5e5e63c95a..fd1afdd08f 100644 --- a/examples/fe-fpm-cli/CHANGELOG.md +++ b/examples/fe-fpm-cli/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/fe-fpm-cli +## 0.0.35 + +### Patch Changes + +- @sap-ux/fe-fpm-writer@0.31.8 + ## 0.0.34 ### Patch Changes diff --git a/examples/fe-fpm-cli/package.json b/examples/fe-fpm-cli/package.json index 04d14e436a..5f9a9aa1b7 100644 --- a/examples/fe-fpm-cli/package.json +++ b/examples/fe-fpm-cli/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/fe-fpm-cli", - "version": "0.0.34", + "version": "0.0.35", "description": "A simple CLI to prompt required information to create a building block using the fe-fpm-writer module's prompt and generate functions.", "license": "Apache-2.0", "private": true, diff --git a/examples/simple-generator/CHANGELOG.md b/examples/simple-generator/CHANGELOG.md index cf78140bc1..0442c7d3f8 100644 --- a/examples/simple-generator/CHANGELOG.md +++ b/examples/simple-generator/CHANGELOG.md @@ -1,5 +1,14 @@ # @sap-ux/generator-simple-fe +## 1.0.58 + +### Patch Changes + +- @sap-ux/axios-extension@1.16.6 +- @sap-ux/system-access@0.5.12 +- @sap-ux/fiori-elements-writer@1.3.6 +- @sap-ux/fiori-freestyle-writer@1.2.4 + ## 1.0.57 ### Patch Changes diff --git a/examples/simple-generator/package.json b/examples/simple-generator/package.json index 4ccda5d906..9a7b1f6da2 100644 --- a/examples/simple-generator/package.json +++ b/examples/simple-generator/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/generator-simple-fe", - "version": "1.0.57", + "version": "1.0.58", "description": "Simple example of a yeoman generator for Fiori elements.", "license": "Apache-2.0", "private": true, diff --git a/packages/abap-deploy-config-inquirer/CHANGELOG.md b/packages/abap-deploy-config-inquirer/CHANGELOG.md index 701bfb604e..f2f4f7d308 100644 --- a/packages/abap-deploy-config-inquirer/CHANGELOG.md +++ b/packages/abap-deploy-config-inquirer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/abap-deploy-config-inquirer +## 1.0.2 + +### Patch Changes + +- @sap-ux/axios-extension@1.16.6 +- @sap-ux/fiori-generator-shared@0.6.2 +- @sap-ux/system-access@0.5.12 + ## 1.0.1 ### Patch Changes diff --git a/packages/abap-deploy-config-inquirer/package.json b/packages/abap-deploy-config-inquirer/package.json index 128d1089fe..730eca5937 100644 --- a/packages/abap-deploy-config-inquirer/package.json +++ b/packages/abap-deploy-config-inquirer/package.json @@ -6,7 +6,7 @@ "url": "https://github.com/SAP/open-ux-tools.git", "directory": "packages/abap-deploy-config-inquirer" }, - "version": "1.0.1", + "version": "1.0.2", "license": "Apache-2.0", "main": "dist/index.js", "scripts": { diff --git a/packages/abap-deploy-config-writer/CHANGELOG.md b/packages/abap-deploy-config-writer/CHANGELOG.md index 2c2c5408b0..9c1ea5036c 100644 --- a/packages/abap-deploy-config-writer/CHANGELOG.md +++ b/packages/abap-deploy-config-writer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/abap-deploy-config-writer +## 0.0.48 + +### Patch Changes + +- Updated dependencies [15e6959] + - @sap-ux/project-access@1.28.0 + - @sap-ux/system-access@0.5.12 + ## 0.0.47 ### Patch Changes diff --git a/packages/abap-deploy-config-writer/package.json b/packages/abap-deploy-config-writer/package.json index f64b07b654..0a1bae2627 100644 --- a/packages/abap-deploy-config-writer/package.json +++ b/packages/abap-deploy-config-writer/package.json @@ -6,7 +6,7 @@ "url": "https://github.com/SAP/open-ux-tools.git", "directory": "packages/abap-deploy-config-writer" }, - "version": "0.0.47", + "version": "0.0.48", "license": "Apache-2.0", "main": "dist/index.js", "scripts": { diff --git a/packages/adp-tooling/CHANGELOG.md b/packages/adp-tooling/CHANGELOG.md index 2372d9c194..74abb471fe 100644 --- a/packages/adp-tooling/CHANGELOG.md +++ b/packages/adp-tooling/CHANGELOG.md @@ -1,5 +1,14 @@ # @sap-ux/adp-tooling +## 0.12.57 + +### Patch Changes + +- Updated dependencies [15e6959] + - @sap-ux/project-access@1.28.0 + - @sap-ux/axios-extension@1.16.6 + - @sap-ux/system-access@0.5.12 + ## 0.12.56 ### Patch Changes diff --git a/packages/adp-tooling/package.json b/packages/adp-tooling/package.json index 77849889d0..53dbb1403f 100644 --- a/packages/adp-tooling/package.json +++ b/packages/adp-tooling/package.json @@ -9,7 +9,7 @@ "bugs": { "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aadp-tooling" }, - "version": "0.12.56", + "version": "0.12.57", "license": "Apache-2.0", "author": "@SAP/ux-tools-team", "main": "dist/index.js", diff --git a/packages/annotation-generator/CHANGELOG.md b/packages/annotation-generator/CHANGELOG.md index 1c6a90565d..4b98809b30 100644 --- a/packages/annotation-generator/CHANGELOG.md +++ b/packages/annotation-generator/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/annotation-generator +## 0.2.8 + +### Patch Changes + +- Updated dependencies [15e6959] + - @sap-ux/project-access@1.28.0 + - @sap-ux/fiori-annotation-api@0.2.8 + ## 0.2.7 ### Patch Changes diff --git a/packages/annotation-generator/package.json b/packages/annotation-generator/package.json index b3ad750987..10a14d54ec 100644 --- a/packages/annotation-generator/package.json +++ b/packages/annotation-generator/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/annotation-generator", - "version": "0.2.7", + "version": "0.2.8", "description": "Library that provides API for generation of annotations by SAP Fiori App Generator", "publisher": "SAPSE", "author": "SAP SE", diff --git a/packages/app-config-writer/CHANGELOG.md b/packages/app-config-writer/CHANGELOG.md index 178261563c..f8ad875fec 100644 --- a/packages/app-config-writer/CHANGELOG.md +++ b/packages/app-config-writer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/app-config-writer +## 0.4.40 + +### Patch Changes + +- Updated dependencies [15e6959] + - @sap-ux/project-access@1.28.0 + - @sap-ux/axios-extension@1.16.6 + ## 0.4.39 ### Patch Changes diff --git a/packages/app-config-writer/package.json b/packages/app-config-writer/package.json index ec52d6c542..b3f16ba369 100644 --- a/packages/app-config-writer/package.json +++ b/packages/app-config-writer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/app-config-writer", "description": "Add or update configuration for SAP Fiori tools application", - "version": "0.4.39", + "version": "0.4.40", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/cap-config-writer/CHANGELOG.md b/packages/cap-config-writer/CHANGELOG.md index e47f695194..9bdba7e027 100644 --- a/packages/cap-config-writer/CHANGELOG.md +++ b/packages/cap-config-writer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/cap-config-writer +## 0.7.47 + +### Patch Changes + +- Updated dependencies [15e6959] + - @sap-ux/project-access@1.28.0 + - @sap-ux/fiori-generator-shared@0.6.2 + ## 0.7.46 ### Patch Changes diff --git a/packages/cap-config-writer/package.json b/packages/cap-config-writer/package.json index 1312ef2f5c..87c7d96143 100644 --- a/packages/cap-config-writer/package.json +++ b/packages/cap-config-writer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/cap-config-writer", "description": "Add or update configuration for SAP CAP projects", - "version": "0.7.46", + "version": "0.7.47", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/cards-editor-middleware/CHANGELOG.md b/packages/cards-editor-middleware/CHANGELOG.md index 313d5547dc..d4dba58087 100644 --- a/packages/cards-editor-middleware/CHANGELOG.md +++ b/packages/cards-editor-middleware/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/cards-editor-middleware +## 0.4.28 + +### Patch Changes + +- Updated dependencies [15e6959] + - @sap-ux/project-access@1.28.0 + ## 0.4.27 ### Patch Changes diff --git a/packages/cards-editor-middleware/package.json b/packages/cards-editor-middleware/package.json index b1a7a19464..8b38142232 100644 --- a/packages/cards-editor-middleware/package.json +++ b/packages/cards-editor-middleware/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/cards-editor-middleware", - "version": "0.4.27", + "version": "0.4.28", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/create/CHANGELOG.md b/packages/create/CHANGELOG.md index ce427f3e54..ce132948d5 100644 --- a/packages/create/CHANGELOG.md +++ b/packages/create/CHANGELOG.md @@ -1,5 +1,21 @@ # @sap-ux/create +## 0.8.41 + +### Patch Changes + +- Updated dependencies [15e6959] + - @sap-ux/project-access@1.28.0 + - @sap-ux/abap-deploy-config-writer@0.0.48 + - @sap-ux/adp-tooling@0.12.57 + - @sap-ux/app-config-writer@0.4.40 + - @sap-ux/cap-config-writer@0.7.47 + - @sap-ux/cards-editor-config-writer@0.4.5 + - @sap-ux/mockserver-config-writer@0.6.5 + - @sap-ux/preview-middleware@0.16.84 + - @sap-ux/system-access@0.5.12 + - @sap-ux/abap-deploy-config-inquirer@1.0.2 + ## 0.8.40 ### Patch Changes diff --git a/packages/create/package.json b/packages/create/package.json index a429eaabf2..7d4e038b46 100644 --- a/packages/create/package.json +++ b/packages/create/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/create", "description": "SAP Fiori tools module to add or remove features", - "version": "0.8.40", + "version": "0.8.41", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/environment-check/CHANGELOG.md b/packages/environment-check/CHANGELOG.md index 5680a0b19a..44c05808ac 100644 --- a/packages/environment-check/CHANGELOG.md +++ b/packages/environment-check/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/environment-check +## 0.17.43 + +### Patch Changes + +- Updated dependencies [15e6959] + - @sap-ux/project-access@1.28.0 + - @sap-ux/axios-extension@1.16.6 + ## 0.17.42 ### Patch Changes diff --git a/packages/environment-check/package.json b/packages/environment-check/package.json index cdb64297c7..51ffb18f80 100644 --- a/packages/environment-check/package.json +++ b/packages/environment-check/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/environment-check", - "version": "0.17.42", + "version": "0.17.43", "description": "SAP Fiori environment check", "license": "Apache-2.0", "bin": { diff --git a/packages/fe-fpm-writer/CHANGELOG.md b/packages/fe-fpm-writer/CHANGELOG.md index 37692ac14d..4230e7e12a 100644 --- a/packages/fe-fpm-writer/CHANGELOG.md +++ b/packages/fe-fpm-writer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/fe-fpm-writer +## 0.31.8 + +### Patch Changes + +- Updated dependencies [15e6959] + - @sap-ux/project-access@1.28.0 + - @sap-ux/fiori-annotation-api@0.2.8 + ## 0.31.7 ### Patch Changes diff --git a/packages/fe-fpm-writer/package.json b/packages/fe-fpm-writer/package.json index 9435bf1899..0ba82100e7 100644 --- a/packages/fe-fpm-writer/package.json +++ b/packages/fe-fpm-writer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/fe-fpm-writer", "description": "SAP Fiori elements flexible programming model writer", - "version": "0.31.7", + "version": "0.31.8", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/fiori-annotation-api/CHANGELOG.md b/packages/fiori-annotation-api/CHANGELOG.md index ddcb69a78c..74aa5f48bc 100644 --- a/packages/fiori-annotation-api/CHANGELOG.md +++ b/packages/fiori-annotation-api/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/fiori-annotation-api +## 0.2.8 + +### Patch Changes + +- Updated dependencies [15e6959] + - @sap-ux/project-access@1.28.0 + - @sap-ux/cds-odata-annotation-converter@0.3.7 + ## 0.2.7 ### Patch Changes diff --git a/packages/fiori-annotation-api/package.json b/packages/fiori-annotation-api/package.json index 97ebd04b21..1ce2a321b5 100644 --- a/packages/fiori-annotation-api/package.json +++ b/packages/fiori-annotation-api/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/fiori-annotation-api", - "version": "0.2.7", + "version": "0.2.8", "description": "Library that provides API for reading and writing annotations in SAP Fiori elements projects.", "publisher": "SAPSE", "author": "SAP SE", diff --git a/packages/fiori-elements-writer/CHANGELOG.md b/packages/fiori-elements-writer/CHANGELOG.md index 822de54f43..9f758fc751 100644 --- a/packages/fiori-elements-writer/CHANGELOG.md +++ b/packages/fiori-elements-writer/CHANGELOG.md @@ -1,5 +1,15 @@ # @sap-ux/fiori-elements-writer +## 1.3.6 + +### Patch Changes + +- @sap-ux/fe-fpm-writer@0.31.8 +- @sap-ux/fiori-generator-shared@0.6.2 +- @sap-ux/odata-service-writer@0.23.0 +- @sap-ux/ui5-application-writer@1.2.0 +- @sap-ux/ui5-test-writer@0.4.1 + ## 1.3.5 ### Patch Changes diff --git a/packages/fiori-elements-writer/package.json b/packages/fiori-elements-writer/package.json index b617857038..00ca13bf9f 100644 --- a/packages/fiori-elements-writer/package.json +++ b/packages/fiori-elements-writer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/fiori-elements-writer", "description": "SAP Fiori elements application writer", - "version": "1.3.5", + "version": "1.3.6", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/fiori-freestyle-writer/CHANGELOG.md b/packages/fiori-freestyle-writer/CHANGELOG.md index 0927e46d2f..cffa0b6128 100644 --- a/packages/fiori-freestyle-writer/CHANGELOG.md +++ b/packages/fiori-freestyle-writer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/fiori-freestyle-writer +## 1.2.4 + +### Patch Changes + +- @sap-ux/fiori-generator-shared@0.6.2 +- @sap-ux/odata-service-writer@0.23.0 +- @sap-ux/ui5-application-writer@1.2.0 + ## 1.2.3 ### Patch Changes diff --git a/packages/fiori-freestyle-writer/package.json b/packages/fiori-freestyle-writer/package.json index 34872730df..2ca236113e 100644 --- a/packages/fiori-freestyle-writer/package.json +++ b/packages/fiori-freestyle-writer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/fiori-freestyle-writer", "description": "SAP Fiori freestyle application writer", - "version": "1.2.3", + "version": "1.2.4", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/fiori-generator-shared/CHANGELOG.md b/packages/fiori-generator-shared/CHANGELOG.md index e976a8ff1c..13db7d9657 100644 --- a/packages/fiori-generator-shared/CHANGELOG.md +++ b/packages/fiori-generator-shared/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/fiori-generator-shared +## 0.6.2 + +### Patch Changes + +- Updated dependencies [15e6959] + - @sap-ux/project-access@1.28.0 + ## 0.6.1 ### Patch Changes diff --git a/packages/fiori-generator-shared/package.json b/packages/fiori-generator-shared/package.json index 6c3de9df71..8d694d86a6 100644 --- a/packages/fiori-generator-shared/package.json +++ b/packages/fiori-generator-shared/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/fiori-generator-shared", "description": "Commonly used shared functionality and types to support the fiori generator.", - "version": "0.6.1", + "version": "0.6.2", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/launch-config/CHANGELOG.md b/packages/launch-config/CHANGELOG.md index 59d30ede53..baa9b91c26 100644 --- a/packages/launch-config/CHANGELOG.md +++ b/packages/launch-config/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/launch-config +## 0.7.3 + +### Patch Changes + +- Updated dependencies [15e6959] + - @sap-ux/project-access@1.28.0 + ## 0.7.2 ### Patch Changes diff --git a/packages/launch-config/package.json b/packages/launch-config/package.json index c62f3069ba..23246d4f92 100644 --- a/packages/launch-config/package.json +++ b/packages/launch-config/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/launch-config", - "version": "0.7.2", + "version": "0.7.3", "description": "SAP Fiori tools launch config administration", "repository": { "type": "git", diff --git a/packages/odata-service-inquirer/CHANGELOG.md b/packages/odata-service-inquirer/CHANGELOG.md index 7c88c850f2..6503924d24 100644 --- a/packages/odata-service-inquirer/CHANGELOG.md +++ b/packages/odata-service-inquirer/CHANGELOG.md @@ -1,5 +1,14 @@ # @sap-ux/odata-service-inquirer +## 0.5.46 + +### Patch Changes + +- Updated dependencies [15e6959] + - @sap-ux/project-access@1.28.0 + - @sap-ux/axios-extension@1.16.6 + - @sap-ux/telemetry@0.5.34 + ## 0.5.45 ### Patch Changes diff --git a/packages/odata-service-inquirer/package.json b/packages/odata-service-inquirer/package.json index 2b8e68bd7d..a7091a2cd6 100644 --- a/packages/odata-service-inquirer/package.json +++ b/packages/odata-service-inquirer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/odata-service-inquirer", "description": "Prompts module that can prompt users for inputs required for odata service writing", - "version": "0.5.45", + "version": "0.5.46", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/preview-middleware/CHANGELOG.md b/packages/preview-middleware/CHANGELOG.md index 1cce3eace5..90b921d55f 100644 --- a/packages/preview-middleware/CHANGELOG.md +++ b/packages/preview-middleware/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/preview-middleware +## 0.16.84 + +### Patch Changes + +- Updated dependencies [15e6959] + - @sap-ux/project-access@1.28.0 + - @sap-ux/adp-tooling@0.12.57 + ## 0.16.83 ### Patch Changes diff --git a/packages/preview-middleware/package.json b/packages/preview-middleware/package.json index 11a4890cfc..0d37553b49 100644 --- a/packages/preview-middleware/package.json +++ b/packages/preview-middleware/package.json @@ -9,7 +9,7 @@ "bugs": { "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Apreview-middleware" }, - "version": "0.16.83", + "version": "0.16.84", "license": "Apache-2.0", "author": "@SAP/ux-tools-team", "main": "dist/index.js", diff --git a/packages/project-access/CHANGELOG.md b/packages/project-access/CHANGELOG.md index 70ee28bd6c..73e1dd7817 100644 --- a/packages/project-access/CHANGELOG.md +++ b/packages/project-access/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/project-access +## 1.28.0 + +### Minor Changes + +- 15e6959: TBI - refactor validation on target folder in app inquirer + ## 1.27.6 ### Patch Changes diff --git a/packages/project-access/package.json b/packages/project-access/package.json index 444e1dbad4..e74a7e6236 100644 --- a/packages/project-access/package.json +++ b/packages/project-access/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/project-access", - "version": "1.27.6", + "version": "1.28.0", "description": "Library to access SAP Fiori tools projects", "repository": { "type": "git", diff --git a/packages/telemetry/CHANGELOG.md b/packages/telemetry/CHANGELOG.md index 6bfa1fdd58..18e0ffa89a 100644 --- a/packages/telemetry/CHANGELOG.md +++ b/packages/telemetry/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/telemetry +## 0.5.34 + +### Patch Changes + +- Updated dependencies [15e6959] + - @sap-ux/project-access@1.28.0 + ## 0.5.33 ### Patch Changes diff --git a/packages/telemetry/package.json b/packages/telemetry/package.json index ea8d9be488..c8f87fa8af 100644 --- a/packages/telemetry/package.json +++ b/packages/telemetry/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/telemetry", - "version": "0.5.33", + "version": "0.5.34", "description": "Library for sending usage telemetry data", "repository": { "type": "git", diff --git a/packages/ui5-application-inquirer/CHANGELOG.md b/packages/ui5-application-inquirer/CHANGELOG.md index 2b074ceaa4..5a99815b6c 100644 --- a/packages/ui5-application-inquirer/CHANGELOG.md +++ b/packages/ui5-application-inquirer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/ui5-application-inquirer +## 0.7.2 + +### Patch Changes + +- 15e6959: TBI - refactor validation on target folder in app inquirer +- Updated dependencies [15e6959] + - @sap-ux/project-access@1.28.0 + ## 0.7.1 ### Patch Changes diff --git a/packages/ui5-application-inquirer/package.json b/packages/ui5-application-inquirer/package.json index 92cb867b3f..e1c98cdd23 100644 --- a/packages/ui5-application-inquirer/package.json +++ b/packages/ui5-application-inquirer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/ui5-application-inquirer", "description": "Prompts module that can prompt users for inputs required for UI5 application writing", - "version": "0.7.1", + "version": "0.7.2", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/ui5-library-reference-inquirer/CHANGELOG.md b/packages/ui5-library-reference-inquirer/CHANGELOG.md index b2b4238498..8cc773de9e 100644 --- a/packages/ui5-library-reference-inquirer/CHANGELOG.md +++ b/packages/ui5-library-reference-inquirer/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/ui5-library-reference-inquirer +## 0.3.34 + +### Patch Changes + +- Updated dependencies [15e6959] + - @sap-ux/project-access@1.28.0 + ## 0.3.33 ### Patch Changes diff --git a/packages/ui5-library-reference-inquirer/package.json b/packages/ui5-library-reference-inquirer/package.json index 703e6a2029..21ce314a15 100644 --- a/packages/ui5-library-reference-inquirer/package.json +++ b/packages/ui5-library-reference-inquirer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/ui5-library-reference-inquirer", "description": "Prompts module that can provide prompts for UI5 library writer", - "version": "0.3.33", + "version": "0.3.34", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/ui5-library-reference-writer/CHANGELOG.md b/packages/ui5-library-reference-writer/CHANGELOG.md index 145a5da19d..a434eff04b 100644 --- a/packages/ui5-library-reference-writer/CHANGELOG.md +++ b/packages/ui5-library-reference-writer/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/ui5-library-reference-writer +## 0.1.28 + +### Patch Changes + +- Updated dependencies [15e6959] + - @sap-ux/project-access@1.28.0 + ## 0.1.27 ### Patch Changes diff --git a/packages/ui5-library-reference-writer/package.json b/packages/ui5-library-reference-writer/package.json index be7107f65b..b1c5378a26 100644 --- a/packages/ui5-library-reference-writer/package.json +++ b/packages/ui5-library-reference-writer/package.json @@ -6,7 +6,7 @@ "url": "https://github.com/SAP/open-ux-tools.git", "directory": "packages/ui5-library-reference-writer" }, - "version": "0.1.27", + "version": "0.1.28", "license": "Apache-2.0", "main": "dist/index.js", "scripts": { diff --git a/packages/ui5-library-sub-generator/CHANGELOG.md b/packages/ui5-library-sub-generator/CHANGELOG.md index 4f6937d52c..ef0a4f5590 100644 --- a/packages/ui5-library-sub-generator/CHANGELOG.md +++ b/packages/ui5-library-sub-generator/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/ui5-library-sub-generator +## 0.0.4 + +### Patch Changes + +- @sap-ux/fiori-generator-shared@0.6.2 +- @sap-ux/ui5-library-writer@0.5.24 + ## 0.0.3 ### Patch Changes diff --git a/packages/ui5-library-sub-generator/package.json b/packages/ui5-library-sub-generator/package.json index 01a37ca7e8..4275c5bd51 100644 --- a/packages/ui5-library-sub-generator/package.json +++ b/packages/ui5-library-sub-generator/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/ui5-library-sub-generator", "description": "Generator for creating UI5 libraries", - "version": "0.0.3", + "version": "0.0.4", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/ui5-library-writer/CHANGELOG.md b/packages/ui5-library-writer/CHANGELOG.md index 5c0331eb4c..ca57f965bf 100644 --- a/packages/ui5-library-writer/CHANGELOG.md +++ b/packages/ui5-library-writer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/ui5-library-writer +## 0.5.24 + +### Patch Changes + +- Updated dependencies [15e6959] + - @sap-ux/project-access@1.28.0 + - @sap-ux/ui5-application-writer@1.2.0 + ## 0.5.23 ### Patch Changes diff --git a/packages/ui5-library-writer/package.json b/packages/ui5-library-writer/package.json index 0b8c26548a..cfc6aa8b16 100644 --- a/packages/ui5-library-writer/package.json +++ b/packages/ui5-library-writer/package.json @@ -9,7 +9,7 @@ "bugs": { "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aui5-library-writer" }, - "version": "0.5.23", + "version": "0.5.24", "license": "Apache-2.0", "main": "dist/index.js", "scripts": { From 64e037daa87b847cf2f12e9858939b6008a83e49 Mon Sep 17 00:00:00 2001 From: Austin Devine Date: Mon, 14 Oct 2024 22:37:48 +0100 Subject: [PATCH 03/18] TBI - Allow filtering folder(s) to compile CAP model from (#2459) * Allow filtering folder(s) to compile CAP model from * Create many-carrots-notice.md --- .changeset/many-carrots-notice.md | 5 +++ packages/project-access/src/project/cap.ts | 16 +++++---- .../project-access/test/project/cap.test.ts | 35 +++++++++++++++++++ 3 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 .changeset/many-carrots-notice.md diff --git a/.changeset/many-carrots-notice.md b/.changeset/many-carrots-notice.md new file mode 100644 index 0000000000..c7e98c49a9 --- /dev/null +++ b/.changeset/many-carrots-notice.md @@ -0,0 +1,5 @@ +--- +"@sap-ux/project-access": patch +--- + +TBI - Optionally allow filtering CAP folder(s) to compile CAP model from diff --git a/packages/project-access/src/project/cap.ts b/packages/project-access/src/project/cap.ts index 0fc0373b8a..f25d908feb 100644 --- a/packages/project-access/src/project/cap.ts +++ b/packages/project-access/src/project/cap.ts @@ -138,24 +138,28 @@ export async function getCapCustomPaths(capProjectPath: string): Promise} - CAP Model and Services */ export async function getCapModelAndServices( - projectRoot: string | { projectRoot: string; logger?: Logger } + projectRoot: string | { projectRoot: string; logger?: Logger; pathSelection?: Set<'app' | 'srv' | 'db'> } ): Promise<{ model: csn; services: ServiceInfo[]; cdsVersionInfo: CdsVersionInfo }> { let _projectRoot; let _logger; + let _pathSelection; + const defaultPathSelection = new Set(['app', 'srv', 'db']); if (typeof projectRoot === 'object') { _projectRoot = projectRoot.projectRoot; _logger = projectRoot.logger; + _pathSelection = projectRoot.pathSelection ? projectRoot.pathSelection : defaultPathSelection; } else { + _pathSelection = defaultPathSelection; _projectRoot = projectRoot; } const cds = await loadCdsModuleFromProject(_projectRoot, true); const capProjectPaths = await getCapCustomPaths(_projectRoot); - const modelPaths = [ - join(_projectRoot, capProjectPaths.app), - join(_projectRoot, capProjectPaths.srv), - join(_projectRoot, capProjectPaths.db) - ]; + const modelPaths: string[] = []; + _pathSelection?.forEach((path: string) => { + modelPaths.push(join(_projectRoot, capProjectPaths[path as keyof CapCustomPaths])); + }); + const model = await cds.load(modelPaths, { root: _projectRoot }); _logger?.info(`@sap-ux/project-access:getCapModelAndServices - Using 'cds.home': ${cds.home}`); diff --git a/packages/project-access/test/project/cap.test.ts b/packages/project-access/test/project/cap.test.ts index e92da030de..b2dd0b9dbe 100644 --- a/packages/project-access/test/project/cap.test.ts +++ b/packages/project-access/test/project/cap.test.ts @@ -354,6 +354,41 @@ describe('Test getCapModelAndServices()', () => { expect(cdsMock.compile.to.serviceinfo).toBeCalledWith('MODEL_NO_SERVICES', { root: 'ROOT_PATH' }); }); + test('Get model and services filtered by db, but services are empty', async () => { + // Mock setup + const cdsMock = { + env: { + 'for': () => ({ + folders: { + app: 'APP', + db: 'DB', + srv: 'SRV' + } + }) + }, + load: jest.fn().mockImplementation(() => Promise.resolve('MODEL_NO_SERVICES')), + compile: { + to: { + serviceinfo: jest.fn().mockImplementation(() => null) + } + } + }; + jest.spyOn(projectModuleMock, 'loadModuleFromProject').mockImplementation(() => Promise.resolve(cdsMock)); + + // Test execution + const capMS = await getCapModelAndServices('ROOT_PATH'); + + // Check results + expect(capMS.model).toEqual('MODEL_NO_SERVICES'); + expect(capMS.services).toEqual([]); + expect(capMS.cdsVersionInfo).toEqual({ + home: undefined, + version: undefined, + root: undefined + }); + expect(cdsMock.compile.to.serviceinfo).toBeCalledWith('MODEL_NO_SERVICES', { root: 'ROOT_PATH' }); + }); + test('Get model and service', async () => { // Mock setup const cdsMock = { From 0b8d426391ae4f57e5dffe5146e6e0fdd43e68b5 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 14 Oct 2024 21:48:37 +0000 Subject: [PATCH 04/18] chore: apply latest changesets --- .changeset/many-carrots-notice.md | 5 ----- examples/fe-fpm-cli/CHANGELOG.md | 6 ++++++ examples/fe-fpm-cli/package.json | 2 +- examples/simple-generator/CHANGELOG.md | 9 +++++++++ examples/simple-generator/package.json | 2 +- .../abap-deploy-config-inquirer/CHANGELOG.md | 8 ++++++++ .../abap-deploy-config-inquirer/package.json | 2 +- packages/abap-deploy-config-writer/CHANGELOG.md | 8 ++++++++ packages/abap-deploy-config-writer/package.json | 2 +- packages/adp-tooling/CHANGELOG.md | 9 +++++++++ packages/adp-tooling/package.json | 2 +- packages/annotation-generator/CHANGELOG.md | 8 ++++++++ packages/annotation-generator/package.json | 2 +- packages/app-config-writer/CHANGELOG.md | 8 ++++++++ packages/app-config-writer/package.json | 2 +- packages/cap-config-writer/CHANGELOG.md | 8 ++++++++ packages/cap-config-writer/package.json | 2 +- packages/cards-editor-middleware/CHANGELOG.md | 7 +++++++ packages/cards-editor-middleware/package.json | 2 +- packages/create/CHANGELOG.md | 16 ++++++++++++++++ packages/create/package.json | 2 +- packages/environment-check/CHANGELOG.md | 8 ++++++++ packages/environment-check/package.json | 2 +- packages/fe-fpm-writer/CHANGELOG.md | 8 ++++++++ packages/fe-fpm-writer/package.json | 2 +- packages/fiori-annotation-api/CHANGELOG.md | 8 ++++++++ packages/fiori-annotation-api/package.json | 2 +- packages/fiori-elements-writer/CHANGELOG.md | 10 ++++++++++ packages/fiori-elements-writer/package.json | 2 +- packages/fiori-freestyle-writer/CHANGELOG.md | 8 ++++++++ packages/fiori-freestyle-writer/package.json | 2 +- packages/fiori-generator-shared/CHANGELOG.md | 7 +++++++ packages/fiori-generator-shared/package.json | 2 +- packages/launch-config/CHANGELOG.md | 7 +++++++ packages/launch-config/package.json | 2 +- packages/odata-service-inquirer/CHANGELOG.md | 9 +++++++++ packages/odata-service-inquirer/package.json | 2 +- packages/preview-middleware/CHANGELOG.md | 8 ++++++++ packages/preview-middleware/package.json | 2 +- packages/project-access/CHANGELOG.md | 6 ++++++ packages/project-access/package.json | 2 +- packages/telemetry/CHANGELOG.md | 7 +++++++ packages/telemetry/package.json | 2 +- packages/ui5-application-inquirer/CHANGELOG.md | 7 +++++++ packages/ui5-application-inquirer/package.json | 2 +- .../ui5-library-reference-inquirer/CHANGELOG.md | 7 +++++++ .../ui5-library-reference-inquirer/package.json | 2 +- .../ui5-library-reference-writer/CHANGELOG.md | 7 +++++++ .../ui5-library-reference-writer/package.json | 2 +- packages/ui5-library-sub-generator/CHANGELOG.md | 7 +++++++ packages/ui5-library-sub-generator/package.json | 2 +- packages/ui5-library-writer/CHANGELOG.md | 8 ++++++++ packages/ui5-library-writer/package.json | 2 +- 53 files changed, 235 insertions(+), 31 deletions(-) delete mode 100644 .changeset/many-carrots-notice.md diff --git a/.changeset/many-carrots-notice.md b/.changeset/many-carrots-notice.md deleted file mode 100644 index c7e98c49a9..0000000000 --- a/.changeset/many-carrots-notice.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@sap-ux/project-access": patch ---- - -TBI - Optionally allow filtering CAP folder(s) to compile CAP model from diff --git a/examples/fe-fpm-cli/CHANGELOG.md b/examples/fe-fpm-cli/CHANGELOG.md index fd1afdd08f..31611d3b67 100644 --- a/examples/fe-fpm-cli/CHANGELOG.md +++ b/examples/fe-fpm-cli/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/fe-fpm-cli +## 0.0.36 + +### Patch Changes + +- @sap-ux/fe-fpm-writer@0.31.9 + ## 0.0.35 ### Patch Changes diff --git a/examples/fe-fpm-cli/package.json b/examples/fe-fpm-cli/package.json index 5f9a9aa1b7..8db41ca698 100644 --- a/examples/fe-fpm-cli/package.json +++ b/examples/fe-fpm-cli/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/fe-fpm-cli", - "version": "0.0.35", + "version": "0.0.36", "description": "A simple CLI to prompt required information to create a building block using the fe-fpm-writer module's prompt and generate functions.", "license": "Apache-2.0", "private": true, diff --git a/examples/simple-generator/CHANGELOG.md b/examples/simple-generator/CHANGELOG.md index 0442c7d3f8..f51e76afea 100644 --- a/examples/simple-generator/CHANGELOG.md +++ b/examples/simple-generator/CHANGELOG.md @@ -1,5 +1,14 @@ # @sap-ux/generator-simple-fe +## 1.0.59 + +### Patch Changes + +- @sap-ux/axios-extension@1.16.6 +- @sap-ux/system-access@0.5.12 +- @sap-ux/fiori-elements-writer@1.3.7 +- @sap-ux/fiori-freestyle-writer@1.2.5 + ## 1.0.58 ### Patch Changes diff --git a/examples/simple-generator/package.json b/examples/simple-generator/package.json index 9a7b1f6da2..4fc840e987 100644 --- a/examples/simple-generator/package.json +++ b/examples/simple-generator/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/generator-simple-fe", - "version": "1.0.58", + "version": "1.0.59", "description": "Simple example of a yeoman generator for Fiori elements.", "license": "Apache-2.0", "private": true, diff --git a/packages/abap-deploy-config-inquirer/CHANGELOG.md b/packages/abap-deploy-config-inquirer/CHANGELOG.md index f2f4f7d308..b9703a0a52 100644 --- a/packages/abap-deploy-config-inquirer/CHANGELOG.md +++ b/packages/abap-deploy-config-inquirer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/abap-deploy-config-inquirer +## 1.0.3 + +### Patch Changes + +- @sap-ux/axios-extension@1.16.6 +- @sap-ux/fiori-generator-shared@0.6.3 +- @sap-ux/system-access@0.5.12 + ## 1.0.2 ### Patch Changes diff --git a/packages/abap-deploy-config-inquirer/package.json b/packages/abap-deploy-config-inquirer/package.json index 730eca5937..642bea3b26 100644 --- a/packages/abap-deploy-config-inquirer/package.json +++ b/packages/abap-deploy-config-inquirer/package.json @@ -6,7 +6,7 @@ "url": "https://github.com/SAP/open-ux-tools.git", "directory": "packages/abap-deploy-config-inquirer" }, - "version": "1.0.2", + "version": "1.0.3", "license": "Apache-2.0", "main": "dist/index.js", "scripts": { diff --git a/packages/abap-deploy-config-writer/CHANGELOG.md b/packages/abap-deploy-config-writer/CHANGELOG.md index 9c1ea5036c..13db0136c0 100644 --- a/packages/abap-deploy-config-writer/CHANGELOG.md +++ b/packages/abap-deploy-config-writer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/abap-deploy-config-writer +## 0.0.49 + +### Patch Changes + +- Updated dependencies [64e037d] + - @sap-ux/project-access@1.28.1 + - @sap-ux/system-access@0.5.12 + ## 0.0.48 ### Patch Changes diff --git a/packages/abap-deploy-config-writer/package.json b/packages/abap-deploy-config-writer/package.json index 0a1bae2627..d7458645d8 100644 --- a/packages/abap-deploy-config-writer/package.json +++ b/packages/abap-deploy-config-writer/package.json @@ -6,7 +6,7 @@ "url": "https://github.com/SAP/open-ux-tools.git", "directory": "packages/abap-deploy-config-writer" }, - "version": "0.0.48", + "version": "0.0.49", "license": "Apache-2.0", "main": "dist/index.js", "scripts": { diff --git a/packages/adp-tooling/CHANGELOG.md b/packages/adp-tooling/CHANGELOG.md index 74abb471fe..1f78ab12e5 100644 --- a/packages/adp-tooling/CHANGELOG.md +++ b/packages/adp-tooling/CHANGELOG.md @@ -1,5 +1,14 @@ # @sap-ux/adp-tooling +## 0.12.58 + +### Patch Changes + +- Updated dependencies [64e037d] + - @sap-ux/project-access@1.28.1 + - @sap-ux/axios-extension@1.16.6 + - @sap-ux/system-access@0.5.12 + ## 0.12.57 ### Patch Changes diff --git a/packages/adp-tooling/package.json b/packages/adp-tooling/package.json index 53dbb1403f..a75d4db95f 100644 --- a/packages/adp-tooling/package.json +++ b/packages/adp-tooling/package.json @@ -9,7 +9,7 @@ "bugs": { "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aadp-tooling" }, - "version": "0.12.57", + "version": "0.12.58", "license": "Apache-2.0", "author": "@SAP/ux-tools-team", "main": "dist/index.js", diff --git a/packages/annotation-generator/CHANGELOG.md b/packages/annotation-generator/CHANGELOG.md index 4b98809b30..b4a0e2cabb 100644 --- a/packages/annotation-generator/CHANGELOG.md +++ b/packages/annotation-generator/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/annotation-generator +## 0.2.9 + +### Patch Changes + +- Updated dependencies [64e037d] + - @sap-ux/project-access@1.28.1 + - @sap-ux/fiori-annotation-api@0.2.9 + ## 0.2.8 ### Patch Changes diff --git a/packages/annotation-generator/package.json b/packages/annotation-generator/package.json index 10a14d54ec..0ba91484d8 100644 --- a/packages/annotation-generator/package.json +++ b/packages/annotation-generator/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/annotation-generator", - "version": "0.2.8", + "version": "0.2.9", "description": "Library that provides API for generation of annotations by SAP Fiori App Generator", "publisher": "SAPSE", "author": "SAP SE", diff --git a/packages/app-config-writer/CHANGELOG.md b/packages/app-config-writer/CHANGELOG.md index f8ad875fec..7f96d5bc92 100644 --- a/packages/app-config-writer/CHANGELOG.md +++ b/packages/app-config-writer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/app-config-writer +## 0.4.41 + +### Patch Changes + +- Updated dependencies [64e037d] + - @sap-ux/project-access@1.28.1 + - @sap-ux/axios-extension@1.16.6 + ## 0.4.40 ### Patch Changes diff --git a/packages/app-config-writer/package.json b/packages/app-config-writer/package.json index b3f16ba369..f9fbf7b139 100644 --- a/packages/app-config-writer/package.json +++ b/packages/app-config-writer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/app-config-writer", "description": "Add or update configuration for SAP Fiori tools application", - "version": "0.4.40", + "version": "0.4.41", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/cap-config-writer/CHANGELOG.md b/packages/cap-config-writer/CHANGELOG.md index 9bdba7e027..6d7509be25 100644 --- a/packages/cap-config-writer/CHANGELOG.md +++ b/packages/cap-config-writer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/cap-config-writer +## 0.7.48 + +### Patch Changes + +- Updated dependencies [64e037d] + - @sap-ux/project-access@1.28.1 + - @sap-ux/fiori-generator-shared@0.6.3 + ## 0.7.47 ### Patch Changes diff --git a/packages/cap-config-writer/package.json b/packages/cap-config-writer/package.json index 87c7d96143..a442b1c975 100644 --- a/packages/cap-config-writer/package.json +++ b/packages/cap-config-writer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/cap-config-writer", "description": "Add or update configuration for SAP CAP projects", - "version": "0.7.47", + "version": "0.7.48", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/cards-editor-middleware/CHANGELOG.md b/packages/cards-editor-middleware/CHANGELOG.md index d4dba58087..5fd16b1a28 100644 --- a/packages/cards-editor-middleware/CHANGELOG.md +++ b/packages/cards-editor-middleware/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/cards-editor-middleware +## 0.4.29 + +### Patch Changes + +- Updated dependencies [64e037d] + - @sap-ux/project-access@1.28.1 + ## 0.4.28 ### Patch Changes diff --git a/packages/cards-editor-middleware/package.json b/packages/cards-editor-middleware/package.json index 8b38142232..04b93c8a36 100644 --- a/packages/cards-editor-middleware/package.json +++ b/packages/cards-editor-middleware/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/cards-editor-middleware", - "version": "0.4.28", + "version": "0.4.29", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/create/CHANGELOG.md b/packages/create/CHANGELOG.md index ce132948d5..8de84879da 100644 --- a/packages/create/CHANGELOG.md +++ b/packages/create/CHANGELOG.md @@ -1,5 +1,21 @@ # @sap-ux/create +## 0.8.42 + +### Patch Changes + +- Updated dependencies [64e037d] + - @sap-ux/project-access@1.28.1 + - @sap-ux/abap-deploy-config-writer@0.0.49 + - @sap-ux/adp-tooling@0.12.58 + - @sap-ux/app-config-writer@0.4.41 + - @sap-ux/cap-config-writer@0.7.48 + - @sap-ux/cards-editor-config-writer@0.4.5 + - @sap-ux/mockserver-config-writer@0.6.5 + - @sap-ux/preview-middleware@0.16.85 + - @sap-ux/system-access@0.5.12 + - @sap-ux/abap-deploy-config-inquirer@1.0.3 + ## 0.8.41 ### Patch Changes diff --git a/packages/create/package.json b/packages/create/package.json index 7d4e038b46..29d127c99d 100644 --- a/packages/create/package.json +++ b/packages/create/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/create", "description": "SAP Fiori tools module to add or remove features", - "version": "0.8.41", + "version": "0.8.42", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/environment-check/CHANGELOG.md b/packages/environment-check/CHANGELOG.md index 44c05808ac..10566996f2 100644 --- a/packages/environment-check/CHANGELOG.md +++ b/packages/environment-check/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/environment-check +## 0.17.44 + +### Patch Changes + +- Updated dependencies [64e037d] + - @sap-ux/project-access@1.28.1 + - @sap-ux/axios-extension@1.16.6 + ## 0.17.43 ### Patch Changes diff --git a/packages/environment-check/package.json b/packages/environment-check/package.json index 51ffb18f80..bc5b80f001 100644 --- a/packages/environment-check/package.json +++ b/packages/environment-check/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/environment-check", - "version": "0.17.43", + "version": "0.17.44", "description": "SAP Fiori environment check", "license": "Apache-2.0", "bin": { diff --git a/packages/fe-fpm-writer/CHANGELOG.md b/packages/fe-fpm-writer/CHANGELOG.md index 4230e7e12a..40043574cd 100644 --- a/packages/fe-fpm-writer/CHANGELOG.md +++ b/packages/fe-fpm-writer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/fe-fpm-writer +## 0.31.9 + +### Patch Changes + +- Updated dependencies [64e037d] + - @sap-ux/project-access@1.28.1 + - @sap-ux/fiori-annotation-api@0.2.9 + ## 0.31.8 ### Patch Changes diff --git a/packages/fe-fpm-writer/package.json b/packages/fe-fpm-writer/package.json index 0ba82100e7..1fb058a354 100644 --- a/packages/fe-fpm-writer/package.json +++ b/packages/fe-fpm-writer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/fe-fpm-writer", "description": "SAP Fiori elements flexible programming model writer", - "version": "0.31.8", + "version": "0.31.9", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/fiori-annotation-api/CHANGELOG.md b/packages/fiori-annotation-api/CHANGELOG.md index 74aa5f48bc..00038654a2 100644 --- a/packages/fiori-annotation-api/CHANGELOG.md +++ b/packages/fiori-annotation-api/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/fiori-annotation-api +## 0.2.9 + +### Patch Changes + +- Updated dependencies [64e037d] + - @sap-ux/project-access@1.28.1 + - @sap-ux/cds-odata-annotation-converter@0.3.7 + ## 0.2.8 ### Patch Changes diff --git a/packages/fiori-annotation-api/package.json b/packages/fiori-annotation-api/package.json index 1ce2a321b5..d127b8e195 100644 --- a/packages/fiori-annotation-api/package.json +++ b/packages/fiori-annotation-api/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/fiori-annotation-api", - "version": "0.2.8", + "version": "0.2.9", "description": "Library that provides API for reading and writing annotations in SAP Fiori elements projects.", "publisher": "SAPSE", "author": "SAP SE", diff --git a/packages/fiori-elements-writer/CHANGELOG.md b/packages/fiori-elements-writer/CHANGELOG.md index 9f758fc751..c5f17e8bc0 100644 --- a/packages/fiori-elements-writer/CHANGELOG.md +++ b/packages/fiori-elements-writer/CHANGELOG.md @@ -1,5 +1,15 @@ # @sap-ux/fiori-elements-writer +## 1.3.7 + +### Patch Changes + +- @sap-ux/fe-fpm-writer@0.31.9 +- @sap-ux/fiori-generator-shared@0.6.3 +- @sap-ux/odata-service-writer@0.23.0 +- @sap-ux/ui5-application-writer@1.2.0 +- @sap-ux/ui5-test-writer@0.4.1 + ## 1.3.6 ### Patch Changes diff --git a/packages/fiori-elements-writer/package.json b/packages/fiori-elements-writer/package.json index 00ca13bf9f..13e6f97886 100644 --- a/packages/fiori-elements-writer/package.json +++ b/packages/fiori-elements-writer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/fiori-elements-writer", "description": "SAP Fiori elements application writer", - "version": "1.3.6", + "version": "1.3.7", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/fiori-freestyle-writer/CHANGELOG.md b/packages/fiori-freestyle-writer/CHANGELOG.md index cffa0b6128..3a8d25e859 100644 --- a/packages/fiori-freestyle-writer/CHANGELOG.md +++ b/packages/fiori-freestyle-writer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/fiori-freestyle-writer +## 1.2.5 + +### Patch Changes + +- @sap-ux/fiori-generator-shared@0.6.3 +- @sap-ux/odata-service-writer@0.23.0 +- @sap-ux/ui5-application-writer@1.2.0 + ## 1.2.4 ### Patch Changes diff --git a/packages/fiori-freestyle-writer/package.json b/packages/fiori-freestyle-writer/package.json index 2ca236113e..ce14954bb5 100644 --- a/packages/fiori-freestyle-writer/package.json +++ b/packages/fiori-freestyle-writer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/fiori-freestyle-writer", "description": "SAP Fiori freestyle application writer", - "version": "1.2.4", + "version": "1.2.5", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/fiori-generator-shared/CHANGELOG.md b/packages/fiori-generator-shared/CHANGELOG.md index 13db7d9657..28aedf659e 100644 --- a/packages/fiori-generator-shared/CHANGELOG.md +++ b/packages/fiori-generator-shared/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/fiori-generator-shared +## 0.6.3 + +### Patch Changes + +- Updated dependencies [64e037d] + - @sap-ux/project-access@1.28.1 + ## 0.6.2 ### Patch Changes diff --git a/packages/fiori-generator-shared/package.json b/packages/fiori-generator-shared/package.json index 8d694d86a6..3380559a3b 100644 --- a/packages/fiori-generator-shared/package.json +++ b/packages/fiori-generator-shared/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/fiori-generator-shared", "description": "Commonly used shared functionality and types to support the fiori generator.", - "version": "0.6.2", + "version": "0.6.3", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/launch-config/CHANGELOG.md b/packages/launch-config/CHANGELOG.md index baa9b91c26..cc620f9f07 100644 --- a/packages/launch-config/CHANGELOG.md +++ b/packages/launch-config/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/launch-config +## 0.7.4 + +### Patch Changes + +- Updated dependencies [64e037d] + - @sap-ux/project-access@1.28.1 + ## 0.7.3 ### Patch Changes diff --git a/packages/launch-config/package.json b/packages/launch-config/package.json index 23246d4f92..562a3cccfb 100644 --- a/packages/launch-config/package.json +++ b/packages/launch-config/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/launch-config", - "version": "0.7.3", + "version": "0.7.4", "description": "SAP Fiori tools launch config administration", "repository": { "type": "git", diff --git a/packages/odata-service-inquirer/CHANGELOG.md b/packages/odata-service-inquirer/CHANGELOG.md index 6503924d24..3bdaa59ca5 100644 --- a/packages/odata-service-inquirer/CHANGELOG.md +++ b/packages/odata-service-inquirer/CHANGELOG.md @@ -1,5 +1,14 @@ # @sap-ux/odata-service-inquirer +## 0.5.47 + +### Patch Changes + +- Updated dependencies [64e037d] + - @sap-ux/project-access@1.28.1 + - @sap-ux/axios-extension@1.16.6 + - @sap-ux/telemetry@0.5.35 + ## 0.5.46 ### Patch Changes diff --git a/packages/odata-service-inquirer/package.json b/packages/odata-service-inquirer/package.json index a7091a2cd6..7a9ecfc4f9 100644 --- a/packages/odata-service-inquirer/package.json +++ b/packages/odata-service-inquirer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/odata-service-inquirer", "description": "Prompts module that can prompt users for inputs required for odata service writing", - "version": "0.5.46", + "version": "0.5.47", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/preview-middleware/CHANGELOG.md b/packages/preview-middleware/CHANGELOG.md index 90b921d55f..55b829f9d0 100644 --- a/packages/preview-middleware/CHANGELOG.md +++ b/packages/preview-middleware/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/preview-middleware +## 0.16.85 + +### Patch Changes + +- Updated dependencies [64e037d] + - @sap-ux/project-access@1.28.1 + - @sap-ux/adp-tooling@0.12.58 + ## 0.16.84 ### Patch Changes diff --git a/packages/preview-middleware/package.json b/packages/preview-middleware/package.json index 0d37553b49..3307e1b484 100644 --- a/packages/preview-middleware/package.json +++ b/packages/preview-middleware/package.json @@ -9,7 +9,7 @@ "bugs": { "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Apreview-middleware" }, - "version": "0.16.84", + "version": "0.16.85", "license": "Apache-2.0", "author": "@SAP/ux-tools-team", "main": "dist/index.js", diff --git a/packages/project-access/CHANGELOG.md b/packages/project-access/CHANGELOG.md index 73e1dd7817..1486c0ecf4 100644 --- a/packages/project-access/CHANGELOG.md +++ b/packages/project-access/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/project-access +## 1.28.1 + +### Patch Changes + +- 64e037d: TBI - Optionally allow filtering CAP folder(s) to compile CAP model from + ## 1.28.0 ### Minor Changes diff --git a/packages/project-access/package.json b/packages/project-access/package.json index e74a7e6236..5ca63fab9e 100644 --- a/packages/project-access/package.json +++ b/packages/project-access/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/project-access", - "version": "1.28.0", + "version": "1.28.1", "description": "Library to access SAP Fiori tools projects", "repository": { "type": "git", diff --git a/packages/telemetry/CHANGELOG.md b/packages/telemetry/CHANGELOG.md index 18e0ffa89a..b98463ed9c 100644 --- a/packages/telemetry/CHANGELOG.md +++ b/packages/telemetry/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/telemetry +## 0.5.35 + +### Patch Changes + +- Updated dependencies [64e037d] + - @sap-ux/project-access@1.28.1 + ## 0.5.34 ### Patch Changes diff --git a/packages/telemetry/package.json b/packages/telemetry/package.json index c8f87fa8af..421dce29d1 100644 --- a/packages/telemetry/package.json +++ b/packages/telemetry/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/telemetry", - "version": "0.5.34", + "version": "0.5.35", "description": "Library for sending usage telemetry data", "repository": { "type": "git", diff --git a/packages/ui5-application-inquirer/CHANGELOG.md b/packages/ui5-application-inquirer/CHANGELOG.md index 5a99815b6c..fb9f8411e0 100644 --- a/packages/ui5-application-inquirer/CHANGELOG.md +++ b/packages/ui5-application-inquirer/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/ui5-application-inquirer +## 0.7.3 + +### Patch Changes + +- Updated dependencies [64e037d] + - @sap-ux/project-access@1.28.1 + ## 0.7.2 ### Patch Changes diff --git a/packages/ui5-application-inquirer/package.json b/packages/ui5-application-inquirer/package.json index e1c98cdd23..4ac3d8dfff 100644 --- a/packages/ui5-application-inquirer/package.json +++ b/packages/ui5-application-inquirer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/ui5-application-inquirer", "description": "Prompts module that can prompt users for inputs required for UI5 application writing", - "version": "0.7.2", + "version": "0.7.3", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/ui5-library-reference-inquirer/CHANGELOG.md b/packages/ui5-library-reference-inquirer/CHANGELOG.md index 8cc773de9e..2422f48ecd 100644 --- a/packages/ui5-library-reference-inquirer/CHANGELOG.md +++ b/packages/ui5-library-reference-inquirer/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/ui5-library-reference-inquirer +## 0.3.35 + +### Patch Changes + +- Updated dependencies [64e037d] + - @sap-ux/project-access@1.28.1 + ## 0.3.34 ### Patch Changes diff --git a/packages/ui5-library-reference-inquirer/package.json b/packages/ui5-library-reference-inquirer/package.json index 21ce314a15..048fa8e674 100644 --- a/packages/ui5-library-reference-inquirer/package.json +++ b/packages/ui5-library-reference-inquirer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/ui5-library-reference-inquirer", "description": "Prompts module that can provide prompts for UI5 library writer", - "version": "0.3.34", + "version": "0.3.35", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/ui5-library-reference-writer/CHANGELOG.md b/packages/ui5-library-reference-writer/CHANGELOG.md index a434eff04b..cbb075d61b 100644 --- a/packages/ui5-library-reference-writer/CHANGELOG.md +++ b/packages/ui5-library-reference-writer/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/ui5-library-reference-writer +## 0.1.29 + +### Patch Changes + +- Updated dependencies [64e037d] + - @sap-ux/project-access@1.28.1 + ## 0.1.28 ### Patch Changes diff --git a/packages/ui5-library-reference-writer/package.json b/packages/ui5-library-reference-writer/package.json index b1c5378a26..b69f0e9e99 100644 --- a/packages/ui5-library-reference-writer/package.json +++ b/packages/ui5-library-reference-writer/package.json @@ -6,7 +6,7 @@ "url": "https://github.com/SAP/open-ux-tools.git", "directory": "packages/ui5-library-reference-writer" }, - "version": "0.1.28", + "version": "0.1.29", "license": "Apache-2.0", "main": "dist/index.js", "scripts": { diff --git a/packages/ui5-library-sub-generator/CHANGELOG.md b/packages/ui5-library-sub-generator/CHANGELOG.md index ef0a4f5590..5bdbf72915 100644 --- a/packages/ui5-library-sub-generator/CHANGELOG.md +++ b/packages/ui5-library-sub-generator/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/ui5-library-sub-generator +## 0.0.5 + +### Patch Changes + +- @sap-ux/fiori-generator-shared@0.6.3 +- @sap-ux/ui5-library-writer@0.5.25 + ## 0.0.4 ### Patch Changes diff --git a/packages/ui5-library-sub-generator/package.json b/packages/ui5-library-sub-generator/package.json index 4275c5bd51..2917c85a0e 100644 --- a/packages/ui5-library-sub-generator/package.json +++ b/packages/ui5-library-sub-generator/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/ui5-library-sub-generator", "description": "Generator for creating UI5 libraries", - "version": "0.0.4", + "version": "0.0.5", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/ui5-library-writer/CHANGELOG.md b/packages/ui5-library-writer/CHANGELOG.md index ca57f965bf..56b56fc796 100644 --- a/packages/ui5-library-writer/CHANGELOG.md +++ b/packages/ui5-library-writer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/ui5-library-writer +## 0.5.25 + +### Patch Changes + +- Updated dependencies [64e037d] + - @sap-ux/project-access@1.28.1 + - @sap-ux/ui5-application-writer@1.2.0 + ## 0.5.24 ### Patch Changes diff --git a/packages/ui5-library-writer/package.json b/packages/ui5-library-writer/package.json index cfc6aa8b16..075b282276 100644 --- a/packages/ui5-library-writer/package.json +++ b/packages/ui5-library-writer/package.json @@ -9,7 +9,7 @@ "bugs": { "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aui5-library-writer" }, - "version": "0.5.24", + "version": "0.5.25", "license": "Apache-2.0", "main": "dist/index.js", "scripts": { From efea4c171bfc0b3294a9c5a43ed2c953de3f3729 Mon Sep 17 00:00:00 2001 From: Emre Cevik Date: Tue, 15 Oct 2024 10:13:47 +0200 Subject: [PATCH 05/18] fix: refactor control id and control type (#2460) Removed popup for control id and added tooltip for control id and control type values. --- .changeset/empty-carpets-stare.md | 5 +++++ .../src/panels/properties/HeaderField.tsx | 2 ++ .../src/panels/properties/PropertiesList.tsx | 9 +-------- 3 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 .changeset/empty-carpets-stare.md diff --git a/.changeset/empty-carpets-stare.md b/.changeset/empty-carpets-stare.md new file mode 100644 index 0000000000..2a174f7107 --- /dev/null +++ b/.changeset/empty-carpets-stare.md @@ -0,0 +1,5 @@ +--- +'@sap-ux/control-property-editor': major +--- + +Added tooltip for value of control id and type and removed controlid popup diff --git a/packages/control-property-editor/src/panels/properties/HeaderField.tsx b/packages/control-property-editor/src/panels/properties/HeaderField.tsx index 0def9755b1..739243d591 100644 --- a/packages/control-property-editor/src/panels/properties/HeaderField.tsx +++ b/packages/control-property-editor/src/panels/properties/HeaderField.tsx @@ -81,8 +81,10 @@ export function HeaderField(headerFieldProps: Readonly): React item.name === FilterName.showEditableProperties )[0].value as boolean; const [filterValue, setFilterValue] = useState(''); - const doc = { - defaultValue: '-', - description: 'The unique identifier within a page, either configured or automatically generated.', - propertyName: 'id', - type: 'sap.ui.core.ID', - propertyType: 'ID' - }; if (!control) { // Nothing selected, show message return ; @@ -124,7 +117,7 @@ export function PropertiesList(): ReactElement { return ( <>
-
Date: Tue, 15 Oct 2024 08:24:27 +0000 Subject: [PATCH 06/18] chore: apply latest changesets --- .changeset/empty-carpets-stare.md | 5 ----- packages/control-property-editor/CHANGELOG.md | 6 ++++++ packages/control-property-editor/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/empty-carpets-stare.md diff --git a/.changeset/empty-carpets-stare.md b/.changeset/empty-carpets-stare.md deleted file mode 100644 index 2a174f7107..0000000000 --- a/.changeset/empty-carpets-stare.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@sap-ux/control-property-editor': major ---- - -Added tooltip for value of control id and type and removed controlid popup diff --git a/packages/control-property-editor/CHANGELOG.md b/packages/control-property-editor/CHANGELOG.md index d2b549db93..279db1ed2c 100644 --- a/packages/control-property-editor/CHANGELOG.md +++ b/packages/control-property-editor/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/control-property-editor +## 1.0.0 + +### Major Changes + +- efea4c1: Added tooltip for value of control id and type and removed controlid popup + ## 0.5.17 ### Patch Changes diff --git a/packages/control-property-editor/package.json b/packages/control-property-editor/package.json index 4387835604..597add455d 100644 --- a/packages/control-property-editor/package.json +++ b/packages/control-property-editor/package.json @@ -3,7 +3,7 @@ "displayName": "Control Property Editor", "description": "Control Property Editor", "license": "Apache-2.0", - "version": "0.5.17", + "version": "1.0.0", "main": "dist/app.js", "repository": { "type": "git", From 0acf38369ae8732312cba3fc1d658dd8bac9778a Mon Sep 17 00:00:00 2001 From: Emre Cevik Date: Tue, 15 Oct 2024 17:00:43 +0200 Subject: [PATCH 07/18] fix: revert major version update (#2465) Revert major version update --- .changeset/shaggy-planets-exercise.md | 5 +++++ packages/control-property-editor/package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/shaggy-planets-exercise.md diff --git a/.changeset/shaggy-planets-exercise.md b/.changeset/shaggy-planets-exercise.md new file mode 100644 index 0000000000..3211c3e7fa --- /dev/null +++ b/.changeset/shaggy-planets-exercise.md @@ -0,0 +1,5 @@ +--- +'@sap-ux/control-property-editor': patch +--- + +Added tooltip for value of control id and type and removed controlid popup diff --git a/packages/control-property-editor/package.json b/packages/control-property-editor/package.json index 597add455d..4387835604 100644 --- a/packages/control-property-editor/package.json +++ b/packages/control-property-editor/package.json @@ -3,7 +3,7 @@ "displayName": "Control Property Editor", "description": "Control Property Editor", "license": "Apache-2.0", - "version": "1.0.0", + "version": "0.5.17", "main": "dist/app.js", "repository": { "type": "git", From e266bcbeb915c720b2f41ffcc19df8548e879d8b Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 15 Oct 2024 15:11:53 +0000 Subject: [PATCH 08/18] chore: apply latest changesets --- .changeset/shaggy-planets-exercise.md | 5 ----- packages/control-property-editor/CHANGELOG.md | 6 ++++++ packages/control-property-editor/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/shaggy-planets-exercise.md diff --git a/.changeset/shaggy-planets-exercise.md b/.changeset/shaggy-planets-exercise.md deleted file mode 100644 index 3211c3e7fa..0000000000 --- a/.changeset/shaggy-planets-exercise.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@sap-ux/control-property-editor': patch ---- - -Added tooltip for value of control id and type and removed controlid popup diff --git a/packages/control-property-editor/CHANGELOG.md b/packages/control-property-editor/CHANGELOG.md index 279db1ed2c..bd0082cf8c 100644 --- a/packages/control-property-editor/CHANGELOG.md +++ b/packages/control-property-editor/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/control-property-editor +## 0.5.18 + +### Patch Changes + +- 0acf383: Added tooltip for value of control id and type and removed controlid popup + ## 1.0.0 ### Major Changes diff --git a/packages/control-property-editor/package.json b/packages/control-property-editor/package.json index 4387835604..29981c2669 100644 --- a/packages/control-property-editor/package.json +++ b/packages/control-property-editor/package.json @@ -3,7 +3,7 @@ "displayName": "Control Property Editor", "description": "Control Property Editor", "license": "Apache-2.0", - "version": "0.5.17", + "version": "0.5.18", "main": "dist/app.js", "repository": { "type": "git", From 9e9daa4b7a5eebf0c554965f291e94c3ba6702e0 Mon Sep 17 00:00:00 2001 From: Andis Redmans <90789422+815are@users.noreply.github.com> Date: Tue, 15 Oct 2024 19:14:51 +0300 Subject: [PATCH 09/18] fix: allow to extend callout props (#2466) allow to extend callout props --- .changeset/witty-carrots-give.md | 5 +++ .../src/components/UIComboBox/UIComboBox.tsx | 41 ++++++++++--------- .../src/components/UIDropdown/UIDropdown.tsx | 21 +++++----- .../test/unit/components/UICombobox.test.tsx | 10 +++++ .../test/unit/components/UIDropdown.test.tsx | 10 +++++ 5 files changed, 57 insertions(+), 30 deletions(-) create mode 100644 .changeset/witty-carrots-give.md diff --git a/.changeset/witty-carrots-give.md b/.changeset/witty-carrots-give.md new file mode 100644 index 0000000000..57b77b0c7c --- /dev/null +++ b/.changeset/witty-carrots-give.md @@ -0,0 +1,5 @@ +--- +'@sap-ux/ui-components': patch +--- + +UIComboBox, UIDropdown: Allow extending 'calloutProps' instead of overwriting. diff --git a/packages/ui-components/src/components/UIComboBox/UIComboBox.tsx b/packages/ui-components/src/components/UIComboBox/UIComboBox.tsx index 76762bc9ff..1d59b3e300 100644 --- a/packages/ui-components/src/components/UIComboBox/UIComboBox.tsx +++ b/packages/ui-components/src/components/UIComboBox/UIComboBox.tsx @@ -717,26 +717,6 @@ export class UIComboBox extends React.Component', () => { expect(wrapper.find('.custom-render-item').length).toBeGreaterThan(0); expect(wrapper.find('.ts-ComboBox--selected').length).toBeGreaterThan(0); }); + + it('Test "calloutProps"', () => { + wrapper.setProps({ + calloutProps: { + className: 'dummy' + } + }); + openDropdown(); + expect(wrapper.find('div.dummy').length).toEqual(1); + }); }); diff --git a/packages/ui-components/test/unit/components/UIDropdown.test.tsx b/packages/ui-components/test/unit/components/UIDropdown.test.tsx index ae0cd93447..8c5f99bcd2 100644 --- a/packages/ui-components/test/unit/components/UIDropdown.test.tsx +++ b/packages/ui-components/test/unit/components/UIDropdown.test.tsx @@ -395,6 +395,16 @@ describe('', () => { openDropdown(); expect(wrapper.find('.custom-render-item').length).toBeGreaterThan(0); }); + + it('Test "calloutProps"', () => { + wrapper.setProps({ + calloutProps: { + className: 'dummy' + } + }); + openDropdown(); + expect(wrapper.find('div.dummy').length).toEqual(1); + }); }); describe('Utils/getCalloutCollisionTransformationProps', () => { From d7df490671402076f0fbea574edcc0e62b3539bd Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 15 Oct 2024 16:25:45 +0000 Subject: [PATCH 10/18] chore: apply latest changesets --- .changeset/witty-carrots-give.md | 5 ----- examples/ui-prompting-examples/CHANGELOG.md | 8 ++++++++ examples/ui-prompting-examples/package.json | 2 +- packages/ui-components/CHANGELOG.md | 6 ++++++ packages/ui-components/package.json | 2 +- packages/ui-prompting/CHANGELOG.md | 7 +++++++ packages/ui-prompting/package.json | 2 +- 7 files changed, 24 insertions(+), 8 deletions(-) delete mode 100644 .changeset/witty-carrots-give.md diff --git a/.changeset/witty-carrots-give.md b/.changeset/witty-carrots-give.md deleted file mode 100644 index 57b77b0c7c..0000000000 --- a/.changeset/witty-carrots-give.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@sap-ux/ui-components': patch ---- - -UIComboBox, UIDropdown: Allow extending 'calloutProps' instead of overwriting. diff --git a/examples/ui-prompting-examples/CHANGELOG.md b/examples/ui-prompting-examples/CHANGELOG.md index e73e117879..f4e89bd4ce 100644 --- a/examples/ui-prompting-examples/CHANGELOG.md +++ b/examples/ui-prompting-examples/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux-private/ui-prompting-examples +## 0.2.7 + +### Patch Changes + +- Updated dependencies [9e9daa4] + - @sap-ux/ui-components@1.18.10 + - @sap-ux/ui-prompting@0.2.7 + ## 0.2.6 ### Patch Changes diff --git a/examples/ui-prompting-examples/package.json b/examples/ui-prompting-examples/package.json index 0a9e2755f3..1b7e62d4b8 100644 --- a/examples/ui-prompting-examples/package.json +++ b/examples/ui-prompting-examples/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux-private/ui-prompting-examples", - "version": "0.2.6", + "version": "0.2.7", "description": "This project contains UI storybook stories with exampleS with prompt ui and FPM based building blocks.", "license": "Apache-2.0", "private": true, diff --git a/packages/ui-components/CHANGELOG.md b/packages/ui-components/CHANGELOG.md index 7781c4f83b..eb303320aa 100644 --- a/packages/ui-components/CHANGELOG.md +++ b/packages/ui-components/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/ui-components +## 1.18.10 + +### Patch Changes + +- 9e9daa4: UIComboBox, UIDropdown: Allow extending 'calloutProps' instead of overwriting. + ## 1.18.9 ### Patch Changes diff --git a/packages/ui-components/package.json b/packages/ui-components/package.json index 34a0c4d2a1..84175c6a83 100644 --- a/packages/ui-components/package.json +++ b/packages/ui-components/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/ui-components", - "version": "1.18.9", + "version": "1.18.10", "license": "Apache-2.0", "description": "SAP UI Components Library", "repository": { diff --git a/packages/ui-prompting/CHANGELOG.md b/packages/ui-prompting/CHANGELOG.md index 21a061819b..1e03e808e5 100644 --- a/packages/ui-prompting/CHANGELOG.md +++ b/packages/ui-prompting/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/ui-prompting +## 0.2.7 + +### Patch Changes + +- Updated dependencies [9e9daa4] + - @sap-ux/ui-components@1.18.10 + ## 0.2.6 ### Patch Changes diff --git a/packages/ui-prompting/package.json b/packages/ui-prompting/package.json index 2d644f1f04..7fb43b1c2e 100644 --- a/packages/ui-prompting/package.json +++ b/packages/ui-prompting/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/ui-prompting", - "version": "0.2.6", + "version": "0.2.7", "license": "Apache-2.0", "description": "SAP UI Components Library", "repository": { From b4034591432a669c74f2d1bb1d56159ca6bde432 Mon Sep 17 00:00:00 2001 From: Edouard Ouin Date: Tue, 15 Oct 2024 22:34:53 +0100 Subject: [PATCH 11/18] fix(ui-components): #2140 - fix dropdown vertical align input field (#2464) * fix(ui-components): fix dropdown vertical align input field * Create fresh-hotels-tap.md --- .changeset/fresh-hotels-tap.md | 5 +++++ .../ui-components/src/components/UIDropdown/UIDropdown.scss | 2 +- packages/ui-components/src/styles/_variables.scss | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/fresh-hotels-tap.md diff --git a/.changeset/fresh-hotels-tap.md b/.changeset/fresh-hotels-tap.md new file mode 100644 index 0000000000..c1cfa5a9e9 --- /dev/null +++ b/.changeset/fresh-hotels-tap.md @@ -0,0 +1,5 @@ +--- +"@sap-ux/ui-components": patch +--- + +fix(ui-components): #2140 - fix dropdown vertical align input field diff --git a/packages/ui-components/src/components/UIDropdown/UIDropdown.scss b/packages/ui-components/src/components/UIDropdown/UIDropdown.scss index cd5b6717f5..caef5708e3 100644 --- a/packages/ui-components/src/components/UIDropdown/UIDropdown.scss +++ b/packages/ui-components/src/components/UIDropdown/UIDropdown.scss @@ -19,7 +19,7 @@ .ms-Dropdown-title { background: transparent; height: $dropdown-input-height; - line-height: $dropdown-input-height; + line-height: $dropdown-line-height; border: $dropdown-input-border-width solid transparent; padding: $dropdown-input-text-padding; @include base-font; diff --git a/packages/ui-components/src/styles/_variables.scss b/packages/ui-components/src/styles/_variables.scss index bc071cc892..b97a6b69d9 100644 --- a/packages/ui-components/src/styles/_variables.scss +++ b/packages/ui-components/src/styles/_variables.scss @@ -5,6 +5,7 @@ $font-size-base: var(--vscode-font-size); $font-weight-base: var(--vscode-font-weight); $base-element-height: 26px; +$base-element-line-height: 24px; $button-font-size: $font-size-base; // Box shadows @@ -15,6 +16,7 @@ $box-shadow-large: 0 10px 20px 0 var(--vscode-widget-shadow); // Dropdowns // colors $dropdown-input-height: $base-element-height; +$dropdown-line-height: $base-element-line-height; $dropdown-input-color: var(--vscode-foreground); $dropdown-input-placeholder-color: var(--vscode-input-placeholderForeground); $dropdown-input-background: var(--vscode-input-background); From e84f093754d41f2309bd1d034fa701829b7533d7 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 15 Oct 2024 21:45:56 +0000 Subject: [PATCH 12/18] chore: apply latest changesets --- .changeset/fresh-hotels-tap.md | 5 ----- examples/ui-prompting-examples/CHANGELOG.md | 8 ++++++++ examples/ui-prompting-examples/package.json | 2 +- packages/ui-components/CHANGELOG.md | 6 ++++++ packages/ui-components/package.json | 2 +- packages/ui-prompting/CHANGELOG.md | 7 +++++++ packages/ui-prompting/package.json | 2 +- 7 files changed, 24 insertions(+), 8 deletions(-) delete mode 100644 .changeset/fresh-hotels-tap.md diff --git a/.changeset/fresh-hotels-tap.md b/.changeset/fresh-hotels-tap.md deleted file mode 100644 index c1cfa5a9e9..0000000000 --- a/.changeset/fresh-hotels-tap.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@sap-ux/ui-components": patch ---- - -fix(ui-components): #2140 - fix dropdown vertical align input field diff --git a/examples/ui-prompting-examples/CHANGELOG.md b/examples/ui-prompting-examples/CHANGELOG.md index f4e89bd4ce..62439b4264 100644 --- a/examples/ui-prompting-examples/CHANGELOG.md +++ b/examples/ui-prompting-examples/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux-private/ui-prompting-examples +## 0.2.8 + +### Patch Changes + +- Updated dependencies [b403459] + - @sap-ux/ui-components@1.18.11 + - @sap-ux/ui-prompting@0.2.8 + ## 0.2.7 ### Patch Changes diff --git a/examples/ui-prompting-examples/package.json b/examples/ui-prompting-examples/package.json index 1b7e62d4b8..9bd282b6b8 100644 --- a/examples/ui-prompting-examples/package.json +++ b/examples/ui-prompting-examples/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux-private/ui-prompting-examples", - "version": "0.2.7", + "version": "0.2.8", "description": "This project contains UI storybook stories with exampleS with prompt ui and FPM based building blocks.", "license": "Apache-2.0", "private": true, diff --git a/packages/ui-components/CHANGELOG.md b/packages/ui-components/CHANGELOG.md index eb303320aa..d43b00f201 100644 --- a/packages/ui-components/CHANGELOG.md +++ b/packages/ui-components/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/ui-components +## 1.18.11 + +### Patch Changes + +- b403459: fix(ui-components): #2140 - fix dropdown vertical align input field + ## 1.18.10 ### Patch Changes diff --git a/packages/ui-components/package.json b/packages/ui-components/package.json index 84175c6a83..c373a817a2 100644 --- a/packages/ui-components/package.json +++ b/packages/ui-components/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/ui-components", - "version": "1.18.10", + "version": "1.18.11", "license": "Apache-2.0", "description": "SAP UI Components Library", "repository": { diff --git a/packages/ui-prompting/CHANGELOG.md b/packages/ui-prompting/CHANGELOG.md index 1e03e808e5..6e7d683271 100644 --- a/packages/ui-prompting/CHANGELOG.md +++ b/packages/ui-prompting/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/ui-prompting +## 0.2.8 + +### Patch Changes + +- Updated dependencies [b403459] + - @sap-ux/ui-components@1.18.11 + ## 0.2.7 ### Patch Changes diff --git a/packages/ui-prompting/package.json b/packages/ui-prompting/package.json index 7fb43b1c2e..d44da83d47 100644 --- a/packages/ui-prompting/package.json +++ b/packages/ui-prompting/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/ui-prompting", - "version": "0.2.7", + "version": "0.2.8", "license": "Apache-2.0", "description": "SAP UI Components Library", "repository": { From eb38e5b121f5e3bc220faa785f02f4e4c65ee871 Mon Sep 17 00:00:00 2001 From: Cian Morrin <99677697+cianmSAP@users.noreply.github.com> Date: Wed, 16 Oct 2024 09:09:51 +0100 Subject: [PATCH 13/18] fix(ui5-lib-sub-gen): move app info file writing to writing phase (#2463) * fix(ui5-lib-sub-gen): move app info file writing to writing phase * fix(ui5-lib-sub-gen): logs * refactor: Update variable declarations in getCapModelAndServices function * Create tough-books-sing.md --------- Co-authored-by: Austin Devine Co-authored-by: Austin Devine Co-authored-by: kitzkan --- .changeset/late-onions-compare.md | 5 +++++ .changeset/tough-books-sing.md | 5 +++++ packages/project-access/src/project/cap.ts | 6 +++--- packages/ui5-library-sub-generator/src/app/index.ts | 5 +++-- .../src/translations/ui5-lib-generator.i18n.json | 1 + packages/ui5-library-sub-generator/test/unit/app.test.ts | 3 +++ 6 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 .changeset/late-onions-compare.md create mode 100644 .changeset/tough-books-sing.md diff --git a/.changeset/late-onions-compare.md b/.changeset/late-onions-compare.md new file mode 100644 index 0000000000..1c99808807 --- /dev/null +++ b/.changeset/late-onions-compare.md @@ -0,0 +1,5 @@ +--- +'@sap-ux/ui5-library-sub-generator': patch +--- + +move app info file writing to writing phase diff --git a/.changeset/tough-books-sing.md b/.changeset/tough-books-sing.md new file mode 100644 index 0000000000..b39df720c3 --- /dev/null +++ b/.changeset/tough-books-sing.md @@ -0,0 +1,5 @@ +--- +"@sap-ux/project-access": patch +--- + +refactor: Update variable declarations in getCapModelAndServices function diff --git a/packages/project-access/src/project/cap.ts b/packages/project-access/src/project/cap.ts index f25d908feb..c3511ff219 100644 --- a/packages/project-access/src/project/cap.ts +++ b/packages/project-access/src/project/cap.ts @@ -140,9 +140,9 @@ export async function getCapCustomPaths(capProjectPath: string): Promise } ): Promise<{ model: csn; services: ServiceInfo[]; cdsVersionInfo: CdsVersionInfo }> { - let _projectRoot; - let _logger; - let _pathSelection; + let _projectRoot: string; + let _logger: Logger | undefined; + let _pathSelection: Set | undefined; const defaultPathSelection = new Set(['app', 'srv', 'db']); if (typeof projectRoot === 'object') { _projectRoot = projectRoot.projectRoot; diff --git a/packages/ui5-library-sub-generator/src/app/index.ts b/packages/ui5-library-sub-generator/src/app/index.ts index ccc9f8d223..c1f961203b 100644 --- a/packages/ui5-library-sub-generator/src/app/index.ts +++ b/packages/ui5-library-sub-generator/src/app/index.ts @@ -91,10 +91,12 @@ export default class extends Generator implements Ui5LibGenerator { if (this.answers.targetFolder) { this.targetFolder = this.answers.targetFolder; + this.projectPath = join(this.targetFolder, `${this.answers.namespace}.${this.answers.libraryName}`); } try { await generate(this.targetFolder, ui5Lib, this.fs); + writeApplicationInfoSettings(this.projectPath); } catch (e) { ReuseLibGenLogger.logger.error(e); throw new Error(t('error.generatingUi5Lib')); @@ -108,7 +110,6 @@ export default class extends Generator implements Ui5LibGenerator { const npm = platform() === 'win32' ? 'npm.cmd' : 'npm'; ReuseLibGenLogger.logger.info(t('info.installingDependencies')); - this.projectPath = join(this.targetFolder, `${this.answers.namespace}.${this.answers.libraryName}`); await runner.run(npm, ['install'], { cwd: this.projectPath }); ReuseLibGenLogger.logger.info(t('info.dependenciesInstalled')); } catch (error) { @@ -118,7 +119,7 @@ export default class extends Generator implements Ui5LibGenerator { } async end(): Promise { - writeApplicationInfoSettings(this.projectPath, this.fs); + ReuseLibGenLogger.logger.info(t('info.openingAppInfo')); await runPostLibGenHook({ path: this.projectPath, vscodeInstance: this.vscode as VSCodeInstance diff --git a/packages/ui5-library-sub-generator/src/translations/ui5-lib-generator.i18n.json b/packages/ui5-library-sub-generator/src/translations/ui5-lib-generator.i18n.json index c7c16373ac..1452e3a074 100644 --- a/packages/ui5-library-sub-generator/src/translations/ui5-lib-generator.i18n.json +++ b/packages/ui5-library-sub-generator/src/translations/ui5-lib-generator.i18n.json @@ -1,5 +1,6 @@ { "info": { + "openingAppInfo": "Opening application info...", "installingDependencies": "Installing dependencies...", "dependenciesInstalled": "Library dependencies have been installed." }, diff --git a/packages/ui5-library-sub-generator/test/unit/app.test.ts b/packages/ui5-library-sub-generator/test/unit/app.test.ts index 3ce5a276fe..8d623b96c6 100644 --- a/packages/ui5-library-sub-generator/test/unit/app.test.ts +++ b/packages/ui5-library-sub-generator/test/unit/app.test.ts @@ -10,6 +10,7 @@ import yeomanTest from 'yeoman-test'; import ReuseLibGen from '../../src/app'; import { CommandRunner } from '@sap-ux/nodejs-utils'; import type { Editor } from 'mem-fs-editor'; +import * as fioriToolsSettings from '@sap-ux/fiori-tools-settings'; jest.mock('@sap-ux/fiori-generator-shared', () => ({ // eslint-disable-next-line @@ -74,6 +75,7 @@ describe('Test reuse lib generator', () => { it('should run the generator', async () => { fs.mkdirSync(testOutputDir, { recursive: true }); jest.spyOn(ui5LibraryInquirer, 'getPrompts').mockResolvedValue(mockPrompts); + const writeApplicationInfoSettingsSpy = jest.spyOn(fioriToolsSettings, 'writeApplicationInfoSettings'); await yeomanTest .run(ReuseLibGen, { @@ -89,6 +91,7 @@ describe('Test reuse lib generator', () => { }); expect(join(testOutputDir, 'com.sap.library1')).toMatchFolder(join(expectedOutputPath, 'library1')); + expect(writeApplicationInfoSettingsSpy).toHaveBeenCalledWith(join(testOutputDir, 'com.sap.library1')); }); it('should run the generator (typescript)', async () => { From 99026b2411c809fae23c86dac0c4d13e6e1e2590 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 16 Oct 2024 08:21:13 +0000 Subject: [PATCH 14/18] chore: apply latest changesets --- .changeset/late-onions-compare.md | 5 ----- .changeset/tough-books-sing.md | 5 ----- examples/fe-fpm-cli/CHANGELOG.md | 6 ++++++ examples/fe-fpm-cli/package.json | 2 +- examples/simple-generator/CHANGELOG.md | 9 +++++++++ examples/simple-generator/package.json | 2 +- .../abap-deploy-config-inquirer/CHANGELOG.md | 8 ++++++++ .../abap-deploy-config-inquirer/package.json | 2 +- packages/abap-deploy-config-writer/CHANGELOG.md | 8 ++++++++ packages/abap-deploy-config-writer/package.json | 2 +- packages/adp-tooling/CHANGELOG.md | 9 +++++++++ packages/adp-tooling/package.json | 2 +- packages/annotation-generator/CHANGELOG.md | 8 ++++++++ packages/annotation-generator/package.json | 2 +- packages/app-config-writer/CHANGELOG.md | 8 ++++++++ packages/app-config-writer/package.json | 2 +- packages/cap-config-writer/CHANGELOG.md | 8 ++++++++ packages/cap-config-writer/package.json | 2 +- packages/cards-editor-middleware/CHANGELOG.md | 7 +++++++ packages/cards-editor-middleware/package.json | 2 +- packages/create/CHANGELOG.md | 16 ++++++++++++++++ packages/create/package.json | 2 +- packages/environment-check/CHANGELOG.md | 8 ++++++++ packages/environment-check/package.json | 2 +- packages/fe-fpm-writer/CHANGELOG.md | 8 ++++++++ packages/fe-fpm-writer/package.json | 2 +- packages/fiori-annotation-api/CHANGELOG.md | 8 ++++++++ packages/fiori-annotation-api/package.json | 2 +- packages/fiori-elements-writer/CHANGELOG.md | 10 ++++++++++ packages/fiori-elements-writer/package.json | 2 +- packages/fiori-freestyle-writer/CHANGELOG.md | 8 ++++++++ packages/fiori-freestyle-writer/package.json | 2 +- packages/fiori-generator-shared/CHANGELOG.md | 7 +++++++ packages/fiori-generator-shared/package.json | 2 +- packages/launch-config/CHANGELOG.md | 7 +++++++ packages/launch-config/package.json | 2 +- packages/odata-service-inquirer/CHANGELOG.md | 9 +++++++++ packages/odata-service-inquirer/package.json | 2 +- packages/preview-middleware/CHANGELOG.md | 8 ++++++++ packages/preview-middleware/package.json | 2 +- packages/project-access/CHANGELOG.md | 6 ++++++ packages/project-access/package.json | 2 +- packages/telemetry/CHANGELOG.md | 7 +++++++ packages/telemetry/package.json | 2 +- packages/ui5-application-inquirer/CHANGELOG.md | 7 +++++++ packages/ui5-application-inquirer/package.json | 2 +- .../ui5-library-reference-inquirer/CHANGELOG.md | 7 +++++++ .../ui5-library-reference-inquirer/package.json | 2 +- .../ui5-library-reference-writer/CHANGELOG.md | 7 +++++++ .../ui5-library-reference-writer/package.json | 2 +- packages/ui5-library-sub-generator/CHANGELOG.md | 8 ++++++++ packages/ui5-library-sub-generator/package.json | 2 +- packages/ui5-library-writer/CHANGELOG.md | 8 ++++++++ packages/ui5-library-writer/package.json | 2 +- 54 files changed, 236 insertions(+), 36 deletions(-) delete mode 100644 .changeset/late-onions-compare.md delete mode 100644 .changeset/tough-books-sing.md diff --git a/.changeset/late-onions-compare.md b/.changeset/late-onions-compare.md deleted file mode 100644 index 1c99808807..0000000000 --- a/.changeset/late-onions-compare.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@sap-ux/ui5-library-sub-generator': patch ---- - -move app info file writing to writing phase diff --git a/.changeset/tough-books-sing.md b/.changeset/tough-books-sing.md deleted file mode 100644 index b39df720c3..0000000000 --- a/.changeset/tough-books-sing.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@sap-ux/project-access": patch ---- - -refactor: Update variable declarations in getCapModelAndServices function diff --git a/examples/fe-fpm-cli/CHANGELOG.md b/examples/fe-fpm-cli/CHANGELOG.md index 31611d3b67..58c34b43cd 100644 --- a/examples/fe-fpm-cli/CHANGELOG.md +++ b/examples/fe-fpm-cli/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/fe-fpm-cli +## 0.0.37 + +### Patch Changes + +- @sap-ux/fe-fpm-writer@0.31.10 + ## 0.0.36 ### Patch Changes diff --git a/examples/fe-fpm-cli/package.json b/examples/fe-fpm-cli/package.json index 8db41ca698..c671afa37a 100644 --- a/examples/fe-fpm-cli/package.json +++ b/examples/fe-fpm-cli/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/fe-fpm-cli", - "version": "0.0.36", + "version": "0.0.37", "description": "A simple CLI to prompt required information to create a building block using the fe-fpm-writer module's prompt and generate functions.", "license": "Apache-2.0", "private": true, diff --git a/examples/simple-generator/CHANGELOG.md b/examples/simple-generator/CHANGELOG.md index f51e76afea..6b67846e70 100644 --- a/examples/simple-generator/CHANGELOG.md +++ b/examples/simple-generator/CHANGELOG.md @@ -1,5 +1,14 @@ # @sap-ux/generator-simple-fe +## 1.0.60 + +### Patch Changes + +- @sap-ux/axios-extension@1.16.6 +- @sap-ux/system-access@0.5.12 +- @sap-ux/fiori-elements-writer@1.3.8 +- @sap-ux/fiori-freestyle-writer@1.2.6 + ## 1.0.59 ### Patch Changes diff --git a/examples/simple-generator/package.json b/examples/simple-generator/package.json index 4fc840e987..1627027ee0 100644 --- a/examples/simple-generator/package.json +++ b/examples/simple-generator/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/generator-simple-fe", - "version": "1.0.59", + "version": "1.0.60", "description": "Simple example of a yeoman generator for Fiori elements.", "license": "Apache-2.0", "private": true, diff --git a/packages/abap-deploy-config-inquirer/CHANGELOG.md b/packages/abap-deploy-config-inquirer/CHANGELOG.md index b9703a0a52..05b45464e2 100644 --- a/packages/abap-deploy-config-inquirer/CHANGELOG.md +++ b/packages/abap-deploy-config-inquirer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/abap-deploy-config-inquirer +## 1.0.4 + +### Patch Changes + +- @sap-ux/axios-extension@1.16.6 +- @sap-ux/fiori-generator-shared@0.6.4 +- @sap-ux/system-access@0.5.12 + ## 1.0.3 ### Patch Changes diff --git a/packages/abap-deploy-config-inquirer/package.json b/packages/abap-deploy-config-inquirer/package.json index 642bea3b26..70e72c6b3a 100644 --- a/packages/abap-deploy-config-inquirer/package.json +++ b/packages/abap-deploy-config-inquirer/package.json @@ -6,7 +6,7 @@ "url": "https://github.com/SAP/open-ux-tools.git", "directory": "packages/abap-deploy-config-inquirer" }, - "version": "1.0.3", + "version": "1.0.4", "license": "Apache-2.0", "main": "dist/index.js", "scripts": { diff --git a/packages/abap-deploy-config-writer/CHANGELOG.md b/packages/abap-deploy-config-writer/CHANGELOG.md index 13db0136c0..c7914619c8 100644 --- a/packages/abap-deploy-config-writer/CHANGELOG.md +++ b/packages/abap-deploy-config-writer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/abap-deploy-config-writer +## 0.0.50 + +### Patch Changes + +- Updated dependencies [eb38e5b] + - @sap-ux/project-access@1.28.2 + - @sap-ux/system-access@0.5.12 + ## 0.0.49 ### Patch Changes diff --git a/packages/abap-deploy-config-writer/package.json b/packages/abap-deploy-config-writer/package.json index d7458645d8..80947f8eb8 100644 --- a/packages/abap-deploy-config-writer/package.json +++ b/packages/abap-deploy-config-writer/package.json @@ -6,7 +6,7 @@ "url": "https://github.com/SAP/open-ux-tools.git", "directory": "packages/abap-deploy-config-writer" }, - "version": "0.0.49", + "version": "0.0.50", "license": "Apache-2.0", "main": "dist/index.js", "scripts": { diff --git a/packages/adp-tooling/CHANGELOG.md b/packages/adp-tooling/CHANGELOG.md index 1f78ab12e5..65de34cbaa 100644 --- a/packages/adp-tooling/CHANGELOG.md +++ b/packages/adp-tooling/CHANGELOG.md @@ -1,5 +1,14 @@ # @sap-ux/adp-tooling +## 0.12.59 + +### Patch Changes + +- Updated dependencies [eb38e5b] + - @sap-ux/project-access@1.28.2 + - @sap-ux/axios-extension@1.16.6 + - @sap-ux/system-access@0.5.12 + ## 0.12.58 ### Patch Changes diff --git a/packages/adp-tooling/package.json b/packages/adp-tooling/package.json index a75d4db95f..e8fa9a0999 100644 --- a/packages/adp-tooling/package.json +++ b/packages/adp-tooling/package.json @@ -9,7 +9,7 @@ "bugs": { "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aadp-tooling" }, - "version": "0.12.58", + "version": "0.12.59", "license": "Apache-2.0", "author": "@SAP/ux-tools-team", "main": "dist/index.js", diff --git a/packages/annotation-generator/CHANGELOG.md b/packages/annotation-generator/CHANGELOG.md index b4a0e2cabb..e83f32ce9e 100644 --- a/packages/annotation-generator/CHANGELOG.md +++ b/packages/annotation-generator/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/annotation-generator +## 0.2.10 + +### Patch Changes + +- Updated dependencies [eb38e5b] + - @sap-ux/project-access@1.28.2 + - @sap-ux/fiori-annotation-api@0.2.10 + ## 0.2.9 ### Patch Changes diff --git a/packages/annotation-generator/package.json b/packages/annotation-generator/package.json index 0ba91484d8..b87138aa1a 100644 --- a/packages/annotation-generator/package.json +++ b/packages/annotation-generator/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/annotation-generator", - "version": "0.2.9", + "version": "0.2.10", "description": "Library that provides API for generation of annotations by SAP Fiori App Generator", "publisher": "SAPSE", "author": "SAP SE", diff --git a/packages/app-config-writer/CHANGELOG.md b/packages/app-config-writer/CHANGELOG.md index 7f96d5bc92..1a7d593923 100644 --- a/packages/app-config-writer/CHANGELOG.md +++ b/packages/app-config-writer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/app-config-writer +## 0.4.42 + +### Patch Changes + +- Updated dependencies [eb38e5b] + - @sap-ux/project-access@1.28.2 + - @sap-ux/axios-extension@1.16.6 + ## 0.4.41 ### Patch Changes diff --git a/packages/app-config-writer/package.json b/packages/app-config-writer/package.json index f9fbf7b139..62d778b33a 100644 --- a/packages/app-config-writer/package.json +++ b/packages/app-config-writer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/app-config-writer", "description": "Add or update configuration for SAP Fiori tools application", - "version": "0.4.41", + "version": "0.4.42", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/cap-config-writer/CHANGELOG.md b/packages/cap-config-writer/CHANGELOG.md index 6d7509be25..98dce87131 100644 --- a/packages/cap-config-writer/CHANGELOG.md +++ b/packages/cap-config-writer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/cap-config-writer +## 0.7.49 + +### Patch Changes + +- Updated dependencies [eb38e5b] + - @sap-ux/project-access@1.28.2 + - @sap-ux/fiori-generator-shared@0.6.4 + ## 0.7.48 ### Patch Changes diff --git a/packages/cap-config-writer/package.json b/packages/cap-config-writer/package.json index a442b1c975..6c5fb0ed63 100644 --- a/packages/cap-config-writer/package.json +++ b/packages/cap-config-writer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/cap-config-writer", "description": "Add or update configuration for SAP CAP projects", - "version": "0.7.48", + "version": "0.7.49", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/cards-editor-middleware/CHANGELOG.md b/packages/cards-editor-middleware/CHANGELOG.md index 5fd16b1a28..6d6fc14dd7 100644 --- a/packages/cards-editor-middleware/CHANGELOG.md +++ b/packages/cards-editor-middleware/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/cards-editor-middleware +## 0.4.30 + +### Patch Changes + +- Updated dependencies [eb38e5b] + - @sap-ux/project-access@1.28.2 + ## 0.4.29 ### Patch Changes diff --git a/packages/cards-editor-middleware/package.json b/packages/cards-editor-middleware/package.json index 04b93c8a36..7321a41557 100644 --- a/packages/cards-editor-middleware/package.json +++ b/packages/cards-editor-middleware/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/cards-editor-middleware", - "version": "0.4.29", + "version": "0.4.30", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/create/CHANGELOG.md b/packages/create/CHANGELOG.md index 8de84879da..9d2330f5af 100644 --- a/packages/create/CHANGELOG.md +++ b/packages/create/CHANGELOG.md @@ -1,5 +1,21 @@ # @sap-ux/create +## 0.8.43 + +### Patch Changes + +- Updated dependencies [eb38e5b] + - @sap-ux/project-access@1.28.2 + - @sap-ux/abap-deploy-config-writer@0.0.50 + - @sap-ux/adp-tooling@0.12.59 + - @sap-ux/app-config-writer@0.4.42 + - @sap-ux/cap-config-writer@0.7.49 + - @sap-ux/cards-editor-config-writer@0.4.5 + - @sap-ux/mockserver-config-writer@0.6.5 + - @sap-ux/preview-middleware@0.16.86 + - @sap-ux/system-access@0.5.12 + - @sap-ux/abap-deploy-config-inquirer@1.0.4 + ## 0.8.42 ### Patch Changes diff --git a/packages/create/package.json b/packages/create/package.json index 29d127c99d..6cbbebd383 100644 --- a/packages/create/package.json +++ b/packages/create/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/create", "description": "SAP Fiori tools module to add or remove features", - "version": "0.8.42", + "version": "0.8.43", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/environment-check/CHANGELOG.md b/packages/environment-check/CHANGELOG.md index 10566996f2..4e78abb33f 100644 --- a/packages/environment-check/CHANGELOG.md +++ b/packages/environment-check/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/environment-check +## 0.17.45 + +### Patch Changes + +- Updated dependencies [eb38e5b] + - @sap-ux/project-access@1.28.2 + - @sap-ux/axios-extension@1.16.6 + ## 0.17.44 ### Patch Changes diff --git a/packages/environment-check/package.json b/packages/environment-check/package.json index bc5b80f001..e43f134bd6 100644 --- a/packages/environment-check/package.json +++ b/packages/environment-check/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/environment-check", - "version": "0.17.44", + "version": "0.17.45", "description": "SAP Fiori environment check", "license": "Apache-2.0", "bin": { diff --git a/packages/fe-fpm-writer/CHANGELOG.md b/packages/fe-fpm-writer/CHANGELOG.md index 40043574cd..eb0a0e02e6 100644 --- a/packages/fe-fpm-writer/CHANGELOG.md +++ b/packages/fe-fpm-writer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/fe-fpm-writer +## 0.31.10 + +### Patch Changes + +- Updated dependencies [eb38e5b] + - @sap-ux/project-access@1.28.2 + - @sap-ux/fiori-annotation-api@0.2.10 + ## 0.31.9 ### Patch Changes diff --git a/packages/fe-fpm-writer/package.json b/packages/fe-fpm-writer/package.json index 1fb058a354..17028b2d0b 100644 --- a/packages/fe-fpm-writer/package.json +++ b/packages/fe-fpm-writer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/fe-fpm-writer", "description": "SAP Fiori elements flexible programming model writer", - "version": "0.31.9", + "version": "0.31.10", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/fiori-annotation-api/CHANGELOG.md b/packages/fiori-annotation-api/CHANGELOG.md index 00038654a2..0dedd1c4f9 100644 --- a/packages/fiori-annotation-api/CHANGELOG.md +++ b/packages/fiori-annotation-api/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/fiori-annotation-api +## 0.2.10 + +### Patch Changes + +- Updated dependencies [eb38e5b] + - @sap-ux/project-access@1.28.2 + - @sap-ux/cds-odata-annotation-converter@0.3.7 + ## 0.2.9 ### Patch Changes diff --git a/packages/fiori-annotation-api/package.json b/packages/fiori-annotation-api/package.json index d127b8e195..bb4d8207e6 100644 --- a/packages/fiori-annotation-api/package.json +++ b/packages/fiori-annotation-api/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/fiori-annotation-api", - "version": "0.2.9", + "version": "0.2.10", "description": "Library that provides API for reading and writing annotations in SAP Fiori elements projects.", "publisher": "SAPSE", "author": "SAP SE", diff --git a/packages/fiori-elements-writer/CHANGELOG.md b/packages/fiori-elements-writer/CHANGELOG.md index c5f17e8bc0..fcc96d2811 100644 --- a/packages/fiori-elements-writer/CHANGELOG.md +++ b/packages/fiori-elements-writer/CHANGELOG.md @@ -1,5 +1,15 @@ # @sap-ux/fiori-elements-writer +## 1.3.8 + +### Patch Changes + +- @sap-ux/fe-fpm-writer@0.31.10 +- @sap-ux/fiori-generator-shared@0.6.4 +- @sap-ux/odata-service-writer@0.23.0 +- @sap-ux/ui5-application-writer@1.2.0 +- @sap-ux/ui5-test-writer@0.4.1 + ## 1.3.7 ### Patch Changes diff --git a/packages/fiori-elements-writer/package.json b/packages/fiori-elements-writer/package.json index 13e6f97886..355898a39a 100644 --- a/packages/fiori-elements-writer/package.json +++ b/packages/fiori-elements-writer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/fiori-elements-writer", "description": "SAP Fiori elements application writer", - "version": "1.3.7", + "version": "1.3.8", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/fiori-freestyle-writer/CHANGELOG.md b/packages/fiori-freestyle-writer/CHANGELOG.md index 3a8d25e859..bc2102687f 100644 --- a/packages/fiori-freestyle-writer/CHANGELOG.md +++ b/packages/fiori-freestyle-writer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/fiori-freestyle-writer +## 1.2.6 + +### Patch Changes + +- @sap-ux/fiori-generator-shared@0.6.4 +- @sap-ux/odata-service-writer@0.23.0 +- @sap-ux/ui5-application-writer@1.2.0 + ## 1.2.5 ### Patch Changes diff --git a/packages/fiori-freestyle-writer/package.json b/packages/fiori-freestyle-writer/package.json index ce14954bb5..4fe6be3b9b 100644 --- a/packages/fiori-freestyle-writer/package.json +++ b/packages/fiori-freestyle-writer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/fiori-freestyle-writer", "description": "SAP Fiori freestyle application writer", - "version": "1.2.5", + "version": "1.2.6", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/fiori-generator-shared/CHANGELOG.md b/packages/fiori-generator-shared/CHANGELOG.md index 28aedf659e..61e39e9d2a 100644 --- a/packages/fiori-generator-shared/CHANGELOG.md +++ b/packages/fiori-generator-shared/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/fiori-generator-shared +## 0.6.4 + +### Patch Changes + +- Updated dependencies [eb38e5b] + - @sap-ux/project-access@1.28.2 + ## 0.6.3 ### Patch Changes diff --git a/packages/fiori-generator-shared/package.json b/packages/fiori-generator-shared/package.json index 3380559a3b..6e8e12afc7 100644 --- a/packages/fiori-generator-shared/package.json +++ b/packages/fiori-generator-shared/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/fiori-generator-shared", "description": "Commonly used shared functionality and types to support the fiori generator.", - "version": "0.6.3", + "version": "0.6.4", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/launch-config/CHANGELOG.md b/packages/launch-config/CHANGELOG.md index cc620f9f07..1d9308f0cf 100644 --- a/packages/launch-config/CHANGELOG.md +++ b/packages/launch-config/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/launch-config +## 0.7.5 + +### Patch Changes + +- Updated dependencies [eb38e5b] + - @sap-ux/project-access@1.28.2 + ## 0.7.4 ### Patch Changes diff --git a/packages/launch-config/package.json b/packages/launch-config/package.json index 562a3cccfb..12b5b13b69 100644 --- a/packages/launch-config/package.json +++ b/packages/launch-config/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/launch-config", - "version": "0.7.4", + "version": "0.7.5", "description": "SAP Fiori tools launch config administration", "repository": { "type": "git", diff --git a/packages/odata-service-inquirer/CHANGELOG.md b/packages/odata-service-inquirer/CHANGELOG.md index 3bdaa59ca5..e11d72513b 100644 --- a/packages/odata-service-inquirer/CHANGELOG.md +++ b/packages/odata-service-inquirer/CHANGELOG.md @@ -1,5 +1,14 @@ # @sap-ux/odata-service-inquirer +## 0.5.48 + +### Patch Changes + +- Updated dependencies [eb38e5b] + - @sap-ux/project-access@1.28.2 + - @sap-ux/axios-extension@1.16.6 + - @sap-ux/telemetry@0.5.36 + ## 0.5.47 ### Patch Changes diff --git a/packages/odata-service-inquirer/package.json b/packages/odata-service-inquirer/package.json index 7a9ecfc4f9..371bc0209f 100644 --- a/packages/odata-service-inquirer/package.json +++ b/packages/odata-service-inquirer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/odata-service-inquirer", "description": "Prompts module that can prompt users for inputs required for odata service writing", - "version": "0.5.47", + "version": "0.5.48", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/preview-middleware/CHANGELOG.md b/packages/preview-middleware/CHANGELOG.md index 55b829f9d0..9a33550932 100644 --- a/packages/preview-middleware/CHANGELOG.md +++ b/packages/preview-middleware/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/preview-middleware +## 0.16.86 + +### Patch Changes + +- Updated dependencies [eb38e5b] + - @sap-ux/project-access@1.28.2 + - @sap-ux/adp-tooling@0.12.59 + ## 0.16.85 ### Patch Changes diff --git a/packages/preview-middleware/package.json b/packages/preview-middleware/package.json index 3307e1b484..d89b8d83a7 100644 --- a/packages/preview-middleware/package.json +++ b/packages/preview-middleware/package.json @@ -9,7 +9,7 @@ "bugs": { "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Apreview-middleware" }, - "version": "0.16.85", + "version": "0.16.86", "license": "Apache-2.0", "author": "@SAP/ux-tools-team", "main": "dist/index.js", diff --git a/packages/project-access/CHANGELOG.md b/packages/project-access/CHANGELOG.md index 1486c0ecf4..adf12f42e6 100644 --- a/packages/project-access/CHANGELOG.md +++ b/packages/project-access/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/project-access +## 1.28.2 + +### Patch Changes + +- eb38e5b: refactor: Update variable declarations in getCapModelAndServices function + ## 1.28.1 ### Patch Changes diff --git a/packages/project-access/package.json b/packages/project-access/package.json index 5ca63fab9e..3bb9f792b7 100644 --- a/packages/project-access/package.json +++ b/packages/project-access/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/project-access", - "version": "1.28.1", + "version": "1.28.2", "description": "Library to access SAP Fiori tools projects", "repository": { "type": "git", diff --git a/packages/telemetry/CHANGELOG.md b/packages/telemetry/CHANGELOG.md index b98463ed9c..16dadb6e57 100644 --- a/packages/telemetry/CHANGELOG.md +++ b/packages/telemetry/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/telemetry +## 0.5.36 + +### Patch Changes + +- Updated dependencies [eb38e5b] + - @sap-ux/project-access@1.28.2 + ## 0.5.35 ### Patch Changes diff --git a/packages/telemetry/package.json b/packages/telemetry/package.json index 421dce29d1..e6d869d3c6 100644 --- a/packages/telemetry/package.json +++ b/packages/telemetry/package.json @@ -1,6 +1,6 @@ { "name": "@sap-ux/telemetry", - "version": "0.5.35", + "version": "0.5.36", "description": "Library for sending usage telemetry data", "repository": { "type": "git", diff --git a/packages/ui5-application-inquirer/CHANGELOG.md b/packages/ui5-application-inquirer/CHANGELOG.md index fb9f8411e0..3e7f5d06f3 100644 --- a/packages/ui5-application-inquirer/CHANGELOG.md +++ b/packages/ui5-application-inquirer/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/ui5-application-inquirer +## 0.7.4 + +### Patch Changes + +- Updated dependencies [eb38e5b] + - @sap-ux/project-access@1.28.2 + ## 0.7.3 ### Patch Changes diff --git a/packages/ui5-application-inquirer/package.json b/packages/ui5-application-inquirer/package.json index 4ac3d8dfff..04036af8d2 100644 --- a/packages/ui5-application-inquirer/package.json +++ b/packages/ui5-application-inquirer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/ui5-application-inquirer", "description": "Prompts module that can prompt users for inputs required for UI5 application writing", - "version": "0.7.3", + "version": "0.7.4", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/ui5-library-reference-inquirer/CHANGELOG.md b/packages/ui5-library-reference-inquirer/CHANGELOG.md index 2422f48ecd..a3b10c76b6 100644 --- a/packages/ui5-library-reference-inquirer/CHANGELOG.md +++ b/packages/ui5-library-reference-inquirer/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/ui5-library-reference-inquirer +## 0.3.36 + +### Patch Changes + +- Updated dependencies [eb38e5b] + - @sap-ux/project-access@1.28.2 + ## 0.3.35 ### Patch Changes diff --git a/packages/ui5-library-reference-inquirer/package.json b/packages/ui5-library-reference-inquirer/package.json index 048fa8e674..a25472fe1a 100644 --- a/packages/ui5-library-reference-inquirer/package.json +++ b/packages/ui5-library-reference-inquirer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/ui5-library-reference-inquirer", "description": "Prompts module that can provide prompts for UI5 library writer", - "version": "0.3.35", + "version": "0.3.36", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/ui5-library-reference-writer/CHANGELOG.md b/packages/ui5-library-reference-writer/CHANGELOG.md index cbb075d61b..e976fdc308 100644 --- a/packages/ui5-library-reference-writer/CHANGELOG.md +++ b/packages/ui5-library-reference-writer/CHANGELOG.md @@ -1,5 +1,12 @@ # @sap-ux/ui5-library-reference-writer +## 0.1.30 + +### Patch Changes + +- Updated dependencies [eb38e5b] + - @sap-ux/project-access@1.28.2 + ## 0.1.29 ### Patch Changes diff --git a/packages/ui5-library-reference-writer/package.json b/packages/ui5-library-reference-writer/package.json index b69f0e9e99..e9948c741d 100644 --- a/packages/ui5-library-reference-writer/package.json +++ b/packages/ui5-library-reference-writer/package.json @@ -6,7 +6,7 @@ "url": "https://github.com/SAP/open-ux-tools.git", "directory": "packages/ui5-library-reference-writer" }, - "version": "0.1.29", + "version": "0.1.30", "license": "Apache-2.0", "main": "dist/index.js", "scripts": { diff --git a/packages/ui5-library-sub-generator/CHANGELOG.md b/packages/ui5-library-sub-generator/CHANGELOG.md index 5bdbf72915..228c52d87a 100644 --- a/packages/ui5-library-sub-generator/CHANGELOG.md +++ b/packages/ui5-library-sub-generator/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/ui5-library-sub-generator +## 0.0.6 + +### Patch Changes + +- eb38e5b: move app info file writing to writing phase + - @sap-ux/fiori-generator-shared@0.6.4 + - @sap-ux/ui5-library-writer@0.5.26 + ## 0.0.5 ### Patch Changes diff --git a/packages/ui5-library-sub-generator/package.json b/packages/ui5-library-sub-generator/package.json index 2917c85a0e..c163a3a5db 100644 --- a/packages/ui5-library-sub-generator/package.json +++ b/packages/ui5-library-sub-generator/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/ui5-library-sub-generator", "description": "Generator for creating UI5 libraries", - "version": "0.0.5", + "version": "0.0.6", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git", diff --git a/packages/ui5-library-writer/CHANGELOG.md b/packages/ui5-library-writer/CHANGELOG.md index 56b56fc796..75f923930a 100644 --- a/packages/ui5-library-writer/CHANGELOG.md +++ b/packages/ui5-library-writer/CHANGELOG.md @@ -1,5 +1,13 @@ # @sap-ux/ui5-library-writer +## 0.5.26 + +### Patch Changes + +- Updated dependencies [eb38e5b] + - @sap-ux/project-access@1.28.2 + - @sap-ux/ui5-application-writer@1.2.0 + ## 0.5.25 ### Patch Changes diff --git a/packages/ui5-library-writer/package.json b/packages/ui5-library-writer/package.json index 075b282276..ad6845b886 100644 --- a/packages/ui5-library-writer/package.json +++ b/packages/ui5-library-writer/package.json @@ -9,7 +9,7 @@ "bugs": { "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aui5-library-writer" }, - "version": "0.5.25", + "version": "0.5.26", "license": "Apache-2.0", "main": "dist/index.js", "scripts": { From 0135ceafb088663ed9448e86994cf762310f9fb9 Mon Sep 17 00:00:00 2001 From: Emre Cevik Date: Wed, 16 Oct 2024 12:50:02 +0200 Subject: [PATCH 15/18] fix: update filterbars (#2453) * Adapt filter placeholder text, uniform height and width of filterbars and adjust calculation of sticky filterbar scrolling * changeset --- .changeset/shy-seas-share.md | 5 +++++ packages/control-property-editor/src/i18n/i18n.json | 6 +++--- .../src/panels/changes/ChangesPanel.module.scss | 4 +++- .../src/panels/outline/OutlinePanel.scss | 3 ++- .../control-property-editor/src/panels/outline/Tree.tsx | 2 +- .../src/panels/properties/Properties.scss | 3 ++- .../src/panels/properties/PropertiesList.tsx | 2 +- 7 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 .changeset/shy-seas-share.md diff --git a/.changeset/shy-seas-share.md b/.changeset/shy-seas-share.md new file mode 100644 index 0000000000..9d01ce8411 --- /dev/null +++ b/.changeset/shy-seas-share.md @@ -0,0 +1,5 @@ +--- +'@sap-ux/control-property-editor': patch +--- + +Update filter bars. diff --git a/packages/control-property-editor/src/i18n/i18n.json b/packages/control-property-editor/src/i18n/i18n.json index 1b8f72559e..0c10cd4ac4 100644 --- a/packages/control-property-editor/src/i18n/i18n.json +++ b/packages/control-property-editor/src/i18n/i18n.json @@ -15,7 +15,7 @@ "LIGHT_THEME_NAME": "Light", "DARK_THEME_NAME": "Dark", "HIGH_CONTRAST_THEME_NAME": "High Contrast", - "SEARCH_OUTLINE": "Search Outline", + "SEARCH_OUTLINE": "Filter Outline", "NO_CONTROL_FOUND": "No control found", "MODIFY_SEARCH_INPUT": "Modify the search input", "APP_TITLE": "Control Property Editor", @@ -42,7 +42,7 @@ "SELECT_ICON": "Select Icon", "NO_CONTROL_SELECTED": "No control selected", "PROPERTIES_MODIFY_TEXT": "Select a control on the canvas to see and modify its properties", - "SEARCH_PROPERTIES": "Search Properties", + "SEARCH_PROPERTIES": "Filter Properties", "SHOW_EDITABLE_PROPERTIES": "Show only editable properties", "COPIED_TO_CLIPBOARD": "Copied to clipboard", "PROPERTY_NAME": "Property name", @@ -65,7 +65,7 @@ "CONFIRM_OTHER_CHANGE_DELETE_TITLE": "Confirm change deletion", "CONFIRM_DELETE_SUBTEXT": "Are you sure you want to delete all changes for this property? This action cannot be undone.", "FIT_PREVIEW": "Fit", - "FILTER": "Filter", + "FILTER": "Filter Changes", "CHANGE_SUMMARY_SAVED_CHANGES": "SAVED CHANGES", "CHANGE_SUMMARY_UNSAVED_CHANGES": "UNSAVED CHANGES", "CHANGES_DETECTED": "Changes detected!", diff --git a/packages/control-property-editor/src/panels/changes/ChangesPanel.module.scss b/packages/control-property-editor/src/panels/changes/ChangesPanel.module.scss index 34a869dd59..d8835599f3 100644 --- a/packages/control-property-editor/src/panels/changes/ChangesPanel.module.scss +++ b/packages/control-property-editor/src/panels/changes/ChangesPanel.module.scss @@ -1,9 +1,11 @@ .filter { display: flex; - padding: 15px 15px 15px 15px; + padding: 19px 15px 15px 15px; flex-direction: row; + justify-content: center; align-items: center; background-color: var(--vscode-sideBar-background); + border-bottom: 1px solid var(--vscode-menu-separatorBackground); } .noData { diff --git a/packages/control-property-editor/src/panels/outline/OutlinePanel.scss b/packages/control-property-editor/src/panels/outline/OutlinePanel.scss index 5dfd1a054d..f353a90934 100644 --- a/packages/control-property-editor/src/panels/outline/OutlinePanel.scss +++ b/packages/control-property-editor/src/panels/outline/OutlinePanel.scss @@ -1,9 +1,10 @@ .filter-outline { display: flex; - padding: 15px 14px 15px 14px; + padding: 15px 15px 15px 15px; flex-direction: row; align-items: center; background-color: var(--vscode-sideBar-background); + border-bottom: 1px solid var(--vscode-menu-separatorBackground); } .auto-element-scroller { diff --git a/packages/control-property-editor/src/panels/outline/Tree.tsx b/packages/control-property-editor/src/panels/outline/Tree.tsx index cd87a13101..19d3860d54 100644 --- a/packages/control-property-editor/src/panels/outline/Tree.tsx +++ b/packages/control-property-editor/src/panels/outline/Tree.tsx @@ -23,7 +23,7 @@ interface OutlineNodeItem extends OutlineNode { export const Tree = (): ReactElement => { // padding + height of `Search` bar - const SEARCH_HEIGHT = 56; + const SEARCH_HEIGHT = 57; // height of the tree row in a outline const TREE_ROW_HEIGHT = 28; diff --git a/packages/control-property-editor/src/panels/properties/Properties.scss b/packages/control-property-editor/src/panels/properties/Properties.scss index 0f04613587..f41107a1ad 100644 --- a/packages/control-property-editor/src/panels/properties/Properties.scss +++ b/packages/control-property-editor/src/panels/properties/Properties.scss @@ -83,9 +83,10 @@ } .filter-properties { display: flex; - margin: 0px 15px 10px 15px; + padding: 0px 15px 15px 15px; flex-direction: row; align-items: center; + border-bottom: 1px solid var(--vscode-menu-separatorBackground); } .funnel-properties-icon { diff --git a/packages/control-property-editor/src/panels/properties/PropertiesList.tsx b/packages/control-property-editor/src/panels/properties/PropertiesList.tsx index 1adde50111..7738738551 100644 --- a/packages/control-property-editor/src/panels/properties/PropertiesList.tsx +++ b/packages/control-property-editor/src/panels/properties/PropertiesList.tsx @@ -123,7 +123,7 @@ export function PropertiesList(): ReactElement {
From ffb0892ddb8395b0d184f5deeb7c76d4423531be Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 16 Oct 2024 11:01:15 +0000 Subject: [PATCH 16/18] chore: apply latest changesets --- .changeset/shy-seas-share.md | 5 ----- packages/control-property-editor/CHANGELOG.md | 6 ++++++ packages/control-property-editor/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/shy-seas-share.md diff --git a/.changeset/shy-seas-share.md b/.changeset/shy-seas-share.md deleted file mode 100644 index 9d01ce8411..0000000000 --- a/.changeset/shy-seas-share.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@sap-ux/control-property-editor': patch ---- - -Update filter bars. diff --git a/packages/control-property-editor/CHANGELOG.md b/packages/control-property-editor/CHANGELOG.md index bd0082cf8c..a74fb190ba 100644 --- a/packages/control-property-editor/CHANGELOG.md +++ b/packages/control-property-editor/CHANGELOG.md @@ -1,5 +1,11 @@ # @sap-ux/control-property-editor +## 0.5.19 + +### Patch Changes + +- 0135cea: Update filter bars. + ## 0.5.18 ### Patch Changes diff --git a/packages/control-property-editor/package.json b/packages/control-property-editor/package.json index 29981c2669..e31dfc7380 100644 --- a/packages/control-property-editor/package.json +++ b/packages/control-property-editor/package.json @@ -3,7 +3,7 @@ "displayName": "Control Property Editor", "description": "Control Property Editor", "license": "Apache-2.0", - "version": "0.5.18", + "version": "0.5.19", "main": "dist/app.js", "repository": { "type": "git", From 2fa3fdac7562ca10baf564c4d6c0f04d93e06b32 Mon Sep 17 00:00:00 2001 From: kitzkan Date: Wed, 16 Oct 2024 13:39:18 +0100 Subject: [PATCH 17/18] adding `@sap-ux/cf-deploy-config-inquirer` (#2436) * cf prompts app gen flow * changing name to addManagedApprouter * add overwrite logic * add test * update tests and lint * refactor prompt types * adding additional choice lists * cf choice list * fix choices * fix test * fix dest name * remove reference to sap system * added propmpts * added propmpts * change names of answers for writers * lint * read me * cf comments * adding changeset * add js docs * change name to projectRoot * Linting auto fix commit * remove cap reference * fix readme * add tests * fix sonar issues * search autocomplete feature * fix auto complete * change name to destination * Linting auto fix commit * adding comments * Linting auto fix commit * rename prompt names to cf * fix dest name message * rename overwrite prompt * altering types * Update cf-deploy-config-inquirer.i18n.json * adding addBTPdestList Flag * add log and test * add validate tests * add log info * add warning.btpDestinationListWarning for vscode when no list returned from btpDest * logging * update logging --------- Co-authored-by: github-actions[bot] Co-authored-by: J Long --- .changeset/happy-lemons-hug.md | 5 + .../cf-deploy-config-inquirer/.eslintignore | 3 + .../cf-deploy-config-inquirer/.eslintrc.js | 7 + packages/cf-deploy-config-inquirer/LICENSE | 201 ++++++++++++++ packages/cf-deploy-config-inquirer/README.md | 64 +++++ .../cf-deploy-config-inquirer/jest.config.js | 6 + .../cf-deploy-config-inquirer/package.json | 48 ++++ .../cf-deploy-config-inquirer/src/i18n.ts | 41 +++ .../cf-deploy-config-inquirer/src/index.ts | 57 ++++ .../src/logger-helper.ts | 26 ++ .../src/prompts/index.ts | 1 + .../src/prompts/prompt-helpers.ts | 55 ++++ .../src/prompts/prompts.ts | 146 ++++++++++ .../src/prompts/validators.ts | 53 ++++ .../cf-deploy-config-inquirer.i18n.json | 22 ++ .../cf-deploy-config-inquirer/src/types.ts | 90 +++++++ .../test/index.test.ts | 49 ++++ .../test/prompt-helpers.test.ts | 115 ++++++++ .../test/prompts.test.ts | 253 ++++++++++++++++++ .../test/validators.test.ts | 36 +++ .../tsconfig.eslint.json | 4 + .../cf-deploy-config-inquirer/tsconfig.json | 22 ++ pnpm-lock.yaml | 38 ++- sonar-project.properties | 2 + tsconfig.json | 3 + 25 files changed, 1342 insertions(+), 5 deletions(-) create mode 100644 .changeset/happy-lemons-hug.md create mode 100644 packages/cf-deploy-config-inquirer/.eslintignore create mode 100644 packages/cf-deploy-config-inquirer/.eslintrc.js create mode 100644 packages/cf-deploy-config-inquirer/LICENSE create mode 100644 packages/cf-deploy-config-inquirer/README.md create mode 100644 packages/cf-deploy-config-inquirer/jest.config.js create mode 100644 packages/cf-deploy-config-inquirer/package.json create mode 100644 packages/cf-deploy-config-inquirer/src/i18n.ts create mode 100644 packages/cf-deploy-config-inquirer/src/index.ts create mode 100644 packages/cf-deploy-config-inquirer/src/logger-helper.ts create mode 100644 packages/cf-deploy-config-inquirer/src/prompts/index.ts create mode 100644 packages/cf-deploy-config-inquirer/src/prompts/prompt-helpers.ts create mode 100644 packages/cf-deploy-config-inquirer/src/prompts/prompts.ts create mode 100644 packages/cf-deploy-config-inquirer/src/prompts/validators.ts create mode 100644 packages/cf-deploy-config-inquirer/src/translations/cf-deploy-config-inquirer.i18n.json create mode 100644 packages/cf-deploy-config-inquirer/src/types.ts create mode 100644 packages/cf-deploy-config-inquirer/test/index.test.ts create mode 100644 packages/cf-deploy-config-inquirer/test/prompt-helpers.test.ts create mode 100644 packages/cf-deploy-config-inquirer/test/prompts.test.ts create mode 100644 packages/cf-deploy-config-inquirer/test/validators.test.ts create mode 100644 packages/cf-deploy-config-inquirer/tsconfig.eslint.json create mode 100644 packages/cf-deploy-config-inquirer/tsconfig.json diff --git a/.changeset/happy-lemons-hug.md b/.changeset/happy-lemons-hug.md new file mode 100644 index 0000000000..7e9c5924d1 --- /dev/null +++ b/.changeset/happy-lemons-hug.md @@ -0,0 +1,5 @@ +--- +'@sap-ux/cf-deploy-config-inquirer': patch +--- + +add new module @sap-ux/cf-deploy-config-inquirer to get cf prompt options diff --git a/packages/cf-deploy-config-inquirer/.eslintignore b/packages/cf-deploy-config-inquirer/.eslintignore new file mode 100644 index 0000000000..9be6e1b137 --- /dev/null +++ b/packages/cf-deploy-config-inquirer/.eslintignore @@ -0,0 +1,3 @@ +/test/test-output/ +dist +templates \ No newline at end of file diff --git a/packages/cf-deploy-config-inquirer/.eslintrc.js b/packages/cf-deploy-config-inquirer/.eslintrc.js new file mode 100644 index 0000000000..b717f83ae9 --- /dev/null +++ b/packages/cf-deploy-config-inquirer/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ['../../.eslintrc'], + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigRootDir: __dirname + } +}; diff --git a/packages/cf-deploy-config-inquirer/LICENSE b/packages/cf-deploy-config-inquirer/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/packages/cf-deploy-config-inquirer/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/cf-deploy-config-inquirer/README.md b/packages/cf-deploy-config-inquirer/README.md new file mode 100644 index 0000000000..be895d744c --- /dev/null +++ b/packages/cf-deploy-config-inquirer/README.md @@ -0,0 +1,64 @@ +# @sap-ux/cf-deploy-config-inquirer + +Prompts module that can provide prompts for Cloud Foundry deployment config writer. + +## Installation +Npm +`npm install --save @sap-ux/cf-deploy-config-inquirer` + +Yarn +`yarn add @sap-ux/cf-deploy-config-inquirer` + +Pnpm +`pnpm add @sap-ux/cf-deploy-config-inquirer` + + +## Explainer + +Prompts may be retrieved using `getPrompts` and then executed in another prompting module that supports `inquirer` type prompts. + +`getPrompts` is provided to allow consumers to access cloud foundry prompts. There may be cases where these can be transformed to support other prompting frameworks. Most prompt configuration is possible via `CfDeployConfigPromptOptions` and calling `prompt`. This is the recommended approach. + +Configurability of prompts is entirely controlled using the `CfDeployConfigPromptOptions` parameter. + +See [Inquirer.js](https://www.npmjs.com/package/inquirer) for valid default properties. + +### Cloud Foundry Deploy Config Inquirer usage example: + +```TypeScript +import type { InquirerAdapter } from '@sap-ux/inquirer-common'; +import type { CfDeployConfigAnswers, CfDeployConfigPromptOptions } from '@sap-ux/cf-deploy-config-inquirer'; +import { prompt as cfDeployConfigPrompt, promptNames } from '@sap-ux/cf-deploy-config-inquirer'; + +const promptOptions = { + [promptNames.destinationName]: { + defaultValue: 'defaultDestination', + hint: false + }, + [promptNames.addManagedAppRouter]: true, + [promptNames.overwrite]: true +}; + +/** + * Pass an Inquirer prompt function https://www.npmjs.com/package/inquirer#methods + */ +const inqAdaptor = { + prompt: this.prompt.bind(this) // the inquirer prompting function, here we use the generators reference +}; + +const cfDeployConfigAnswers: CfDeployConfigAnswers = await cfDeployConfigPrompt( + inqAdaptor as InquirerAdapter, + promptOpts +); +``` + +## License + +Read [License](./LICENSE). + +## Keywords +SAP UI5 Application +Inquirer +Prompting +Generator +Deployment diff --git a/packages/cf-deploy-config-inquirer/jest.config.js b/packages/cf-deploy-config-inquirer/jest.config.js new file mode 100644 index 0000000000..2f0a4db758 --- /dev/null +++ b/packages/cf-deploy-config-inquirer/jest.config.js @@ -0,0 +1,6 @@ +const config = require('../../jest.base'); +config.snapshotFormat = { + escapeString: false, + printBasicPrototype: false +}; +module.exports = config; diff --git a/packages/cf-deploy-config-inquirer/package.json b/packages/cf-deploy-config-inquirer/package.json new file mode 100644 index 0000000000..b2aedefce2 --- /dev/null +++ b/packages/cf-deploy-config-inquirer/package.json @@ -0,0 +1,48 @@ +{ + "name": "@sap-ux/cf-deploy-config-inquirer", + "description": "Prompts module that can provide prompts for cf deployment config writer", + "version": "0.0.0", + "repository": { + "type": "git", + "url": "https://github.com/SAP/open-ux-tools.git", + "directory": "packages/cf-deploy-config-inquirer" + }, + "bugs": { + "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Acf-deploy-config-inquirer" + }, + "license": "Apache-2.0", + "main": "dist/index.js", + "scripts": { + "build": "tsc --build", + "clean": "rimraf --glob dist test/test-output coverage *.tsbuildinfo", + "watch": "tsc --watch", + "lint": "eslint . --ext .ts", + "lint:fix": "eslint . --ext .ts --fix", + "test": "jest --ci --forceExit --detectOpenHandles --colors --passWithNoTests", + "test-u": "jest --ci --forceExit --detectOpenHandles --colors -u", + "link": "pnpm link --global", + "unlink": "pnpm unlink --global" + }, + "files": [ + "LICENSE", + "dist", + "!dist/*.map", + "!dist/**/*.map" + ], + "dependencies": { + "@sap-ux/inquirer-common": "workspace:*", + "@sap-ux/btp-utils": "workspace:*", + "@sap-ux/logger": "workspace:*", + "i18next": "23.5.1", + "inquirer-autocomplete-prompt": "2.0.1" + }, + "devDependencies": { + "@sap-devx/yeoman-ui-types": "1.14.4", + "@types/inquirer-autocomplete-prompt": "2.0.1", + "@types/inquirer": "8.2.6", + "inquirer": "8.2.6" + }, + "engines": { + "node": ">=18.x" + } +} diff --git a/packages/cf-deploy-config-inquirer/src/i18n.ts b/packages/cf-deploy-config-inquirer/src/i18n.ts new file mode 100644 index 0000000000..2f3180dfd4 --- /dev/null +++ b/packages/cf-deploy-config-inquirer/src/i18n.ts @@ -0,0 +1,41 @@ +import type { TOptions } from 'i18next'; +import i18next from 'i18next'; +import translations from './translations/cf-deploy-config-inquirer.i18n.json'; + +const cfInquirerNamespace = 'cf-deploy-config-inquirer'; +export const defaultProjectNumber = 1; +/** + * Initialize i18next with the translations for this module. + */ +export async function initI18nCfDeployConfigInquirer(): Promise { + await i18next.init( + { + lng: 'en', + fallbackLng: 'en', + interpolation: { + defaultVariables: { + defaultProjectNumber + } + } + }, + () => i18next.addResourceBundle('en', cfInquirerNamespace, translations) + ); +} + +/** + * Helper function facading the call to i18next. Unless a namespace option is provided the local namespace will be used. + * + * @param key i18n key + * @param options additional options + * @returns {string} localized string stored for the given key + */ +export function t(key: string, options?: TOptions): string { + if (!options?.ns) { + options = Object.assign(options ?? {}, { ns: cfInquirerNamespace }); + } + return i18next.t(key, options); +} + +initI18nCfDeployConfigInquirer().catch(() => { + // Needed for lint +}); diff --git a/packages/cf-deploy-config-inquirer/src/index.ts b/packages/cf-deploy-config-inquirer/src/index.ts new file mode 100644 index 0000000000..bbb0326b95 --- /dev/null +++ b/packages/cf-deploy-config-inquirer/src/index.ts @@ -0,0 +1,57 @@ +import { getQuestions } from './prompts'; +import type { + CfDeployConfigPromptOptions, + CfDeployConfigQuestions, + CfSystemChoice, + CfDeployConfigAnswers +} from './types'; +import { promptNames } from './types'; +import { initI18nCfDeployConfigInquirer } from './i18n'; +import type { InquirerAdapter } from '@sap-ux/inquirer-common'; +import autocomplete from 'inquirer-autocomplete-prompt'; +import type { Logger } from '@sap-ux/logger'; +import LoggerHelper from './logger-helper'; + +/** + * Retrieves Cloud Foundry deployment configuration prompts. + * + * This function returns a list of cf deployment questions based on the provided application root and prompt options. + * + * @param {CfDeployConfigPromptOptions} promptOptions - The configuration options for prompting during cf target deployment. + * @param logger - The logger instance to use for logging. + * @returns {Promise} A promise that resolves to an array of questions for cf target prompting. + */ +async function getPrompts( + promptOptions: CfDeployConfigPromptOptions, + logger?: Logger +): Promise { + if (logger) { + LoggerHelper.logger = logger; + } + await initI18nCfDeployConfigInquirer(); + return getQuestions(promptOptions, LoggerHelper.logger); +} + +/** + * Prompt for cf inquirer inputs. + * + * @param adapter - optionally provide references to a calling inquirer instance, this supports integration to Yeoman generators, for example + * @param promptOptions - options that can control some of the prompt behavior. See {@link CfDeployConfigPromptOptions} for details + * @param logger - logger instance to use for logging + * @returns the prompt answers + */ +async function prompt( + adapter: InquirerAdapter, + promptOptions: CfDeployConfigPromptOptions, + logger?: Logger +): Promise { + const cfPrompts = await getPrompts(promptOptions, logger); + if (adapter?.promptModule && promptOptions[promptNames.destinationName]?.useAutocomplete) { + const pm = adapter.promptModule; + pm.registerPrompt('autocomplete', autocomplete); + } + const answers = await adapter.prompt(cfPrompts); + return answers; +} + +export { getPrompts, CfDeployConfigPromptOptions, CfSystemChoice, promptNames, prompt }; diff --git a/packages/cf-deploy-config-inquirer/src/logger-helper.ts b/packages/cf-deploy-config-inquirer/src/logger-helper.ts new file mode 100644 index 0000000000..7bb3d8882b --- /dev/null +++ b/packages/cf-deploy-config-inquirer/src/logger-helper.ts @@ -0,0 +1,26 @@ +import { ToolsLogger, type Logger } from '@sap-ux/logger'; + +/** + * Static logger prevents passing of logger references through all functions, as this is a cross-cutting concern. + */ +export default class LoggerHelper { + private static _logger: Logger = new ToolsLogger({ logPrefix: '@sap-ux/cf-deploy-config-inquirer' }); + + /** + * Get the logger. + * + * @returns the logger + */ + public static get logger(): Logger { + return LoggerHelper._logger; + } + + /** + * Set the logger. + * + * @param value the logger to set + */ + public static set logger(value: Logger) { + LoggerHelper._logger = value; + } +} diff --git a/packages/cf-deploy-config-inquirer/src/prompts/index.ts b/packages/cf-deploy-config-inquirer/src/prompts/index.ts new file mode 100644 index 0000000000..4ae4948f98 --- /dev/null +++ b/packages/cf-deploy-config-inquirer/src/prompts/index.ts @@ -0,0 +1 @@ +export * from './prompts'; diff --git a/packages/cf-deploy-config-inquirer/src/prompts/prompt-helpers.ts b/packages/cf-deploy-config-inquirer/src/prompts/prompt-helpers.ts new file mode 100644 index 0000000000..558ffd4cc0 --- /dev/null +++ b/packages/cf-deploy-config-inquirer/src/prompts/prompt-helpers.ts @@ -0,0 +1,55 @@ +import type { CfSystemChoice } from '../types'; +import { + isAppStudio, + listDestinations, + getDisplayName, + isAbapEnvironmentOnBtp, + type Destinations +} from '@sap-ux/btp-utils'; +import LoggerHelper from '../logger-helper'; +import { t } from '../i18n'; + +/** + * Generates a sorted list of Cloud Foundry system destination choices from provided destinations. + * + * @param {Destinations} [destinations] - Object containing destination details retrieved from BTP. + * @returns {CfSystemChoice[]} - Array of destination choices formatted for selection prompts. + */ +function createDestinationChoices(destinations: Destinations = {}): CfSystemChoice[] { + return Object.values(destinations) + .filter( + (destination): destination is Destinations[keyof Destinations] => + destination && typeof destination.Name === 'string' && typeof destination.Host === 'string' + ) + .sort((a, b) => a.Name.localeCompare(b.Name, undefined, { numeric: true, caseFirst: 'lower' })) + .map((destination) => ({ + name: `${getDisplayName(destination) ?? 'Unknown'} - ${destination.Host}`, + value: destination.Name, + scp: isAbapEnvironmentOnBtp(destination) || false, + url: destination.Host + })); +} + +/** + * Retrieves an array of Cloud Foundry system choices. + * + * @param {Destinations} [destinations] - Optional destinations object retrieved from BTP. + * @returns {Promise} - List of system choices formatted for selection prompts. + */ +export async function getCfSystemChoices(destinations?: Destinations): Promise { + return destinations ? createDestinationChoices(destinations) : []; +} + +/** + * Retrieves and caches the list of available BTP destinations if running in BAS. + * + * @returns {Promise} - A promise resolving to a list of destinations or undefined if not in BAS. + */ +export async function fetchBTPDestinations(): Promise { + if (isAppStudio()) { + const destinations = await listDestinations(); + return destinations; + } + LoggerHelper.logger.warn(t('warning.btpDestinationListWarning')); + return undefined; +} diff --git a/packages/cf-deploy-config-inquirer/src/prompts/prompts.ts b/packages/cf-deploy-config-inquirer/src/prompts/prompts.ts new file mode 100644 index 0000000000..0a3bda17d6 --- /dev/null +++ b/packages/cf-deploy-config-inquirer/src/prompts/prompts.ts @@ -0,0 +1,146 @@ +import { type ConfirmQuestion, type InputQuestion, searchChoices } from '@sap-ux/inquirer-common'; +import { t } from '../i18n'; +import type { + CfDeployConfigPromptOptions, + CfDeployConfigQuestions, + CfDeployConfigAnswers, + DestinationNamePromptOptions, + CfSystemChoice +} from '../types'; +import { promptNames } from '../types'; +import * as validators from './validators'; +import { isAppStudio } from '@sap-ux/btp-utils'; +import { getCfSystemChoices, fetchBTPDestinations } from './prompt-helpers'; +import type { Logger } from '@sap-ux/logger'; + +/** + * Retrieves the prompt configuration for selecting a Cloud Foundry destination name. + * + * This function generates a prompt that allows users to specify a destination name. The prompt can be rendered as a list or + * an input field depending on the provided options. If the environment supports + * autocomplete, it can provide suggestions based on existing destinations. + * + * @param {DestinationNamePromptOptions} destinationOptions - The options for configuring + * the destination name prompt. + * @param {string} destinationOptions.destination - The Cloud Foundry destination name + * to be used. + * @param {string} destinationOptions.defaultValue - The default destination value for CF. + * @param {boolean} [destinationOptions.addDestinationHintMessage] - A flag to indicate + * whether to show a hint for the destination name. + * @param {CfSystemChoice[]} [destinationOptions.additionalChoiceList] - Additional choices + * available for the destination. If additional choices are provided and the environment is VsCode, the prompt + * type will render as a list instead of an input field. + * @param {boolean} [destinationOptions.useAutocomplete] - A flag to indicate whether + * to use an autocomplete feature for the destination name input. + * @param {boolean} [destinationOptions.addBTPDestinationList] - A flag to indicate whether to include BTP destination choices. + * @returns {Promise} A promise that resolves to the configuration + * of the prompt, which includes the question and any related options for rendering + * the prompt in a user interface. + */ +async function getDestinationNamePrompt( + destinationOptions: DestinationNamePromptOptions +): Promise { + const { + hint = false, + additionalChoiceList = [], + defaultValue, + useAutocomplete = false, + addBTPDestinationList = true + } = destinationOptions; + + const isBAS = isAppStudio(); + const destinations = addBTPDestinationList ? await fetchBTPDestinations() : {}; + const destinationList: CfSystemChoice[] = [...additionalChoiceList, ...(await getCfSystemChoices(destinations))]; + // If BAS is used or additional choices are provided, the prompt should be a list + // If VsCode is used and additional choices are not provided, the prompt should be an input field + // If VsCode is used and additional choices are provided, the prompt should be a list + const basePromptType = isBAS || additionalChoiceList.length ? 'list' : 'input'; + // If autocomplete is enabled and there are destination choices, the prompt should be an autocomplete + const promptType = useAutocomplete && destinationList.length ? 'autocomplete' : basePromptType; + return { + guiOptions: { + mandatory: !isBAS, + breadcrumb: t('prompts.destinationNameMessage') + }, + type: promptType, + default: () => defaultValue, + name: promptNames.destinationName, + message: () => (hint ? t('prompts.directBindingDestinationHint') : t('prompts.destinationNameMessage')), + validate: (destination: string): string | boolean => { + return validators.validateDestinationQuestion(destination, !destination && isBAS); + }, + source: (prevAnswers: CfDeployConfigAnswers, input: string) => searchChoices(input, destinationList), + choices: () => destinationList + } as InputQuestion; +} + +/** + * Creates a prompt for managing application router during cf deployment. + * + * + * This function returns a confirmation question that asks whether to add a managed application router + * to the cf deployment. The prompt only appears if no mta file is found. + * + * @returns {ConfirmQuestion} Returns a confirmation question object for configuring the application router. + */ +function getAddManagedRouterPrompt(): CfDeployConfigQuestions { + return { + type: 'confirm', + name: promptNames.addManagedAppRouter, + guiOptions: { + breadcrumb: t('prompts.addApplicationRouterBreadcrumbMessage') + }, + message: () => t('prompts.generateManagedApplicationToRouterMessage'), + default: () => true + } as ConfirmQuestion; +} + +/** + * + * @returns A confirmation question object which overwrites destination. + */ +function getOverwritePrompt(): CfDeployConfigQuestions { + return { + type: 'confirm', + name: promptNames.overwrite, + guiOptions: { + hint: t('prompts.overwriteHintMessage') + }, + default: () => { + return true; + }, + message: () => t('prompts.overwriteMessage') + } as ConfirmQuestion; +} + +/** + * Retrieves a list of deployment questions based on the application root and prompt options. + * + * @param {CfDeployConfigPromptOptions} promptOptions - The configuration options for prompting during cf target deployment. + * @param {Logger} [log] - The logger instance to use for logging. + * @returns {CfDeployConfigQuestions[]} Returns an array of questions related to cf deployment configuration. + */ +export async function getQuestions( + promptOptions: CfDeployConfigPromptOptions, + log?: Logger +): Promise { + const destinationOptions = promptOptions[promptNames.destinationName] as DestinationNamePromptOptions; + const addOverwriteQuestion = promptOptions[promptNames.overwrite] ?? false; + const addManagedAppRouter = promptOptions[promptNames.addManagedAppRouter] ?? false; + + const questions: CfDeployConfigQuestions[] = []; + // Collect questions into an array + questions.push(await getDestinationNamePrompt(destinationOptions)); + + if (addManagedAppRouter) { + log?.info(t('info.addManagedAppRouter')); + questions.push(getAddManagedRouterPrompt()); + } + + if (addOverwriteQuestion) { + log?.info(t('info.overwriteDestination')); + questions.push(getOverwritePrompt()); + } + + return questions; +} diff --git a/packages/cf-deploy-config-inquirer/src/prompts/validators.ts b/packages/cf-deploy-config-inquirer/src/prompts/validators.ts new file mode 100644 index 0000000000..b755909bad --- /dev/null +++ b/packages/cf-deploy-config-inquirer/src/prompts/validators.ts @@ -0,0 +1,53 @@ +import { t } from '../i18n'; +import type { CfSystemChoice } from '../types'; + +/** + * + * @param input The input string to check for emptiness. + * @returns returns true if the input string is not empty, otherwise false. + */ +function isNotEmpty(input: string): boolean { + return !!input?.trim(); +} + +/** + * Validates the input string for the following: + * - It must not be empty after trimming whitespace. + * - It must contain only alphanumeric characters, underscores, or dashes. + * - It must not exceed 200 characters. + * + * @param {string} input - The input string to validate. + * @returns {boolean|string} `true` if the input is valid, otherwise an error message. + */ +function validateInput(input: string): boolean | string { + if (!isNotEmpty(input)) { + return t('errors.emptyDestinationNameError'); + } + const result = /^[a-z0-9_-]+$/i.test(input); + if (!result) { + return t('errors.destinationNameError'); + } + if (input.length > 200) { + return t('errors.destinationNameLengthError'); + } + return true; +} + +/** + * Validates the destination name or input string. If `allowEmptyChoice` is true, + * the validation will pass immediately. Otherwise, the input will be validated + * against rules (non-empty, valid characters, length check). + * + * @param {string} input - The destination name or input string to validate. + * @param {boolean} allowEmptyChoice - Whether to allow an empty input as a valid choice. + * @returns {boolean|string} `true` if the input is valid or empty choices are allowed, otherwise an error message. + */ +export function validateDestinationQuestion( + input: string | CfSystemChoice, + allowEmptyChoice: boolean = false +): boolean | string { + if (allowEmptyChoice) { + return true; + } + return typeof input === 'string' ? validateInput(input) : true; +} diff --git a/packages/cf-deploy-config-inquirer/src/translations/cf-deploy-config-inquirer.i18n.json b/packages/cf-deploy-config-inquirer/src/translations/cf-deploy-config-inquirer.i18n.json new file mode 100644 index 0000000000..b62b1753d1 --- /dev/null +++ b/packages/cf-deploy-config-inquirer/src/translations/cf-deploy-config-inquirer.i18n.json @@ -0,0 +1,22 @@ +{ + "prompts": { + "destinationNameMessage": "Destination name", + "addApplicationRouterBreadcrumbMessage": "Add to Router", + "generateManagedApplicationToRouterMessage": "Add application to managed application router?", + "directBindingDestinationHint": "Destination name - The app router is configured to use direct service binding", + "overwriteMessage": "Editing the deployment configuration will overwrite existing configuration, are you sure you want to continue?", + "overwriteHintMessage": "Deployment config will abort if you choose no. Click Finish to abort." + }, + "errors": { + "emptyDestinationNameError": "You must provide a destination name in order to continue.", + "destinationNameError": "The destination name must only contain letters, digits, dashes and underscores.", + "destinationNameLengthError": "Destination name cannot contain more than 200 characters" + }, + "warning": { + "btpDestinationListWarning": "BTP destinations are only retrieved on BAS" + }, + "info": { + "addManagedAppRouter": "Add managed application router is enabled", + "overwriteDestination": "Overwriting destination is enabled" + } +} diff --git a/packages/cf-deploy-config-inquirer/src/types.ts b/packages/cf-deploy-config-inquirer/src/types.ts new file mode 100644 index 0000000000..0c0d181bcf --- /dev/null +++ b/packages/cf-deploy-config-inquirer/src/types.ts @@ -0,0 +1,90 @@ +import type { YUIQuestion } from '@sap-ux/inquirer-common'; +import type { AutocompleteQuestionOptions } from 'inquirer-autocomplete-prompt'; + +/** + * Enum defining prompt names for Cloud Foundry (CF) deployment configuration. + */ +export enum promptNames { + /** The prompt to specify the destination name for CF deployment. */ + destinationName = 'destinationName', + /** The prompt to specify if a managed app router should be added to the deployment. */ + addManagedAppRouter = 'addManagedAppRouter', + /** The prompt for confirming destination overwrite. */ + overwrite = 'overwriteDestinationName' +} + +/** + * Configuration options for the 'destinationName' prompt used in deployment settings. + */ +export type DestinationNamePromptOptions = { + /** Default value to suggest for the destination name. */ + defaultValue: string; + /** Flag to indicate if a hint message should be shown to indicate the app router is configured.*/ + hint?: boolean; + /** + * List of additional destination choices available for the prompt. + * - In BAS environments, this list will be appended to BTP destination options. + * - If `additionalChoiceList` is provided and the environment is VS Code, + * the prompt will render as a list, allowing users to select from the provided choices instead of input. + */ + additionalChoiceList?: CfSystemChoice[]; + /** + * Indicates BTP destination list choices should be available for the prompt. + * If `addBTPDestinationList` is set to true, the prompt will include BTP destination choices else it will not. + * By default, this is set to true. + */ + addBTPDestinationList?: boolean; + /** + * Flag to indicate if the destination prompt should use auto completion + */ + useAutocomplete?: boolean; +}; + +/** + * Defines options for boolean-type prompts in CF deployment configuration. + */ +type booleanValuePromptOptions = Record & + Record; + +/** + * Defines options for string-type prompts in CF deployment configuration. + */ +type stringValuePromptOptions = Record; + +/** + * Configuration options for CF deployment prompts. + */ +export type CfDeployConfigPromptOptions = Partial; + +/** + * Represents a question in the CF deployment configuration. + * Extends `YUIQuestion` with optional autocomplete functionality. + */ +export type CfDeployConfigQuestions = YUIQuestion & + Partial>; + +/** + * User responses for CF deployment configuration. + */ +export interface CfDeployConfigAnswers { + /** The selected Cloud Foundry destination. */ + destinationName?: string; + /** Indicates whether the user opted to include a managed application router. */ + addManagedRouter?: boolean; + /* Indicates whether the user opted to overwrite the destination. */ + overwrite?: boolean; +} + +/** + * Interface for selectable system choices within prompts. + */ +export interface CfSystemChoice { + /** Display name of the system choice. */ + name: string; + /** Value associated with the system choice. */ + value: string; + /** Flag indicating if the system choice is an scp destination. */ + scp: boolean; + /** URL associated with the system choice. */ + url: string; +} diff --git a/packages/cf-deploy-config-inquirer/test/index.test.ts b/packages/cf-deploy-config-inquirer/test/index.test.ts new file mode 100644 index 0000000000..833841c2e3 --- /dev/null +++ b/packages/cf-deploy-config-inquirer/test/index.test.ts @@ -0,0 +1,49 @@ +import { getPrompts, promptNames, type CfDeployConfigPromptOptions, prompt } from '../src'; +import * as cfPrompts from '../src/prompts/prompts'; +import type { CfDeployConfigAnswers } from '../src/types'; +import type { Logger } from '@sap-ux/logger'; +import { createPromptModule } from 'inquirer'; +import type { InquirerAdapter } from '@sap-ux/inquirer-common'; +import AutocompletePrompt from 'inquirer-autocomplete-prompt'; + +describe('index', () => { + const mockLog = { + info: jest.fn(), + warn: jest.fn() + } as unknown as Logger; + const promptOptions: CfDeployConfigPromptOptions = { + [promptNames.destinationName]: { + defaultValue: 'defaultDestination', + hint: false, + useAutocomplete: true + }, + [promptNames.addManagedAppRouter]: true, + [promptNames.overwrite]: true + }; + + it('should return prompts from getPrompts', async () => { + const getQuestionsSpy = jest.spyOn(cfPrompts, 'getQuestions'); + const prompts = await getPrompts(promptOptions, mockLog); + expect(prompts.length).toBe(3); + expect(getQuestionsSpy).toHaveBeenCalledWith(promptOptions, mockLog); + }); + + it('should prompt with inquirer adapter', async () => { + const answers: CfDeployConfigAnswers = { + destinationName: 'testDestination', + addManagedRouter: true, + overwrite: true + }; + + const mockPromptsModule = createPromptModule(); + const adapterRegisterPromptSpy = jest.spyOn(mockPromptsModule, 'registerPrompt'); + const mockInquirerAdapter: InquirerAdapter = { + prompt: jest.fn().mockResolvedValue(answers), + promptModule: mockPromptsModule + }; + + expect(await prompt(mockInquirerAdapter, promptOptions)).toMatchObject(answers); + // Ensure autocomplete plugin is registered + expect(adapterRegisterPromptSpy).toHaveBeenCalledWith('autocomplete', AutocompletePrompt); + }); +}); diff --git a/packages/cf-deploy-config-inquirer/test/prompt-helpers.test.ts b/packages/cf-deploy-config-inquirer/test/prompt-helpers.test.ts new file mode 100644 index 0000000000..35d77bd3c5 --- /dev/null +++ b/packages/cf-deploy-config-inquirer/test/prompt-helpers.test.ts @@ -0,0 +1,115 @@ +import { + isAppStudio, + listDestinations, + getDisplayName, + isAbapEnvironmentOnBtp, + type Destinations +} from '@sap-ux/btp-utils'; +import { getCfSystemChoices, fetchBTPDestinations } from '../src/prompts/prompt-helpers'; +import type { CfSystemChoice } from '../src/types'; +import LoggerHelper from '../src/logger-helper'; +import { t } from '../src/i18n'; + +jest.mock('@sap-ux/btp-utils', () => ({ + isAppStudio: jest.fn(), + listDestinations: jest.fn(), + getDisplayName: jest.fn(), + isAbapEnvironmentOnBtp: jest.fn() +})); + +jest.mock('../src/logger-helper', () => ({ + logger: { + warn: jest.fn() + } +})); + +describe('Utility Functions', () => { + const mockDestinations: Destinations = { + dest1: { + Name: 'Dest1', + Type: 'HTTP', + Authentication: 'NoAuthentication', + ProxyType: 'Internet', + Description: 'Test Destination', + Host: 'host' + }, + dest2: { + Name: '', + Type: 'HTTP', + Authentication: 'NoAuthentication', + ProxyType: 'Internet', + Description: 'Test Destination ', + Host: 'host' + } + }; + beforeEach(() => { + jest.clearAllMocks(); + }); + + describe('getCfSystemChoices', () => { + it('should return destination choices when destinations are provided', async () => { + const choices: CfSystemChoice[] = [ + { name: 'Dest1 - host', value: '', scp: false, url: 'host' }, + { name: 'Unknown - host', value: 'Dest1', scp: false, url: 'host' } + ]; + (getDisplayName as jest.Mock).mockReturnValueOnce('Dest1'); + (isAbapEnvironmentOnBtp as jest.Mock).mockReturnValueOnce(false); + + const result = await getCfSystemChoices(mockDestinations); + + expect(result).toEqual(choices); + }); + + it('should return an empty array if no destinations are provided', async () => { + const result = await getCfSystemChoices(); + expect(result).toEqual([]); + }); + + it('should return sorted and formatted destination choices', async () => { + const destinations: Destinations = { + ...mockDestinations, + dest2: { + Name: 'Dest2', + Host: 'host2', + Type: 'HTTP', + Authentication: 'NoAuthentication', + ProxyType: 'Internet', + Description: 'Test Destination 2' + } + }; + (getDisplayName as jest.Mock).mockImplementation((dest) => dest.Name); + (isAbapEnvironmentOnBtp as jest.Mock).mockReturnValue(false); + + const result = await getCfSystemChoices(destinations); + + expect(result).toEqual([ + { name: 'Dest1 - host', value: 'Dest1', scp: false, url: 'host' }, + { name: 'Dest2 - host2', value: 'Dest2', scp: false, url: 'host2' } + ]); + }); + }); + + describe('fetchBTPDestinations', () => { + it('should return destinations if running in App Studio', async () => { + (isAppStudio as jest.Mock).mockReturnValue(true); + (listDestinations as jest.Mock).mockResolvedValue(mockDestinations); + + const result = await fetchBTPDestinations(); + + expect(result).toEqual(mockDestinations); + expect(isAppStudio).toHaveBeenCalled(); + expect(listDestinations).toHaveBeenCalled(); + }); + + it('should return undefined if not running in App Studio', async () => { + (isAppStudio as jest.Mock).mockReturnValue(false); + + const result = await fetchBTPDestinations(); + + expect(result).toBeUndefined(); + expect(isAppStudio).toHaveBeenCalled(); + expect(listDestinations).not.toHaveBeenCalled(); + expect(LoggerHelper.logger.warn).toHaveBeenCalledWith(t('warning.btpDestinationListWarning')); + }); + }); +}); diff --git a/packages/cf-deploy-config-inquirer/test/prompts.test.ts b/packages/cf-deploy-config-inquirer/test/prompts.test.ts new file mode 100644 index 0000000000..0bc4c13da1 --- /dev/null +++ b/packages/cf-deploy-config-inquirer/test/prompts.test.ts @@ -0,0 +1,253 @@ +import { getQuestions } from '../src/prompts/prompts'; +import { isAppStudio } from '@sap-ux/btp-utils'; +import { t } from '../src/i18n'; +import type { + CfDeployConfigPromptOptions, + CfSystemChoice, + CfDeployConfigQuestions, + DestinationNamePromptOptions +} from '../src/types'; +import { promptNames } from '../src/types'; +import { fetchBTPDestinations } from '../src/prompts/prompt-helpers'; +import { type ListQuestion } from '@sap-ux/inquirer-common'; +import type { Logger } from '@sap-ux/logger'; + +jest.mock('@sap-ux/btp-utils', () => ({ + ...jest.requireActual('@sap-ux/btp-utils'), + isAppStudio: jest.fn() +})); +const mockIsAppStudio = isAppStudio as jest.Mock; + +jest.mock('../src/prompts/prompt-helpers', () => ({ + ...jest.requireActual('../src/prompts/prompt-helpers'), + fetchBTPDestinations: jest.fn() +})); +const mockFetchBTPDestinations = fetchBTPDestinations as jest.Mock; +const mockLog = { + info: jest.fn(), + warn: jest.fn() +} as unknown as Logger; + +describe('Prompt Generation Tests', () => { + let promptOptions: CfDeployConfigPromptOptions; + const destinationPrompts: DestinationNamePromptOptions = { + defaultValue: 'defaultDestination', + hint: false + }; + const additionalChoiceList: CfSystemChoice[] = [ + { + name: 'testChoice', + value: 'testValue', + scp: false, + url: 'testUrl' + }, + { + name: 'testChoice1', + value: 'testValue1', + scp: false, + url: 'testUrl' + } + ]; + + beforeEach(() => { + jest.clearAllMocks(); + promptOptions = { + [promptNames.destinationName]: destinationPrompts + }; + }); + + describe('getDestinationNamePrompt', () => { + it('returns list-based prompt when environment is BAS', async () => { + mockIsAppStudio.mockReturnValueOnce(true); + + const questions: CfDeployConfigQuestions[] = await getQuestions(promptOptions); + const destinationNamePrompt = questions.find((question) => question.name === promptNames.destinationName); + expect(destinationNamePrompt?.type).toBe('list'); + expect(destinationNamePrompt?.default()).toBe('defaultDestination'); + }); + + it('returns list-based prompt for cap project when environment is BAS', async () => { + mockIsAppStudio.mockReturnValueOnce(true); + mockFetchBTPDestinations.mockResolvedValueOnce({ + btpTestDest: { + Name: 'btpTestDest', + Host: 'btpTestDest', + Type: 'HTTP', + Authentication: 'BasicAuthentication', + ProxyType: 'OnPremise', + Description: 'btpTestDest' + } + }); + // cap destination is provided as an additional choice + promptOptions = { + [promptNames.destinationName]: { + ...destinationPrompts, + additionalChoiceList + } + }; + + const questions: CfDeployConfigQuestions[] = await getQuestions(promptOptions); + const destinationNamePrompt = questions.find((question) => question.name === promptNames.destinationName); + expect(destinationNamePrompt?.type).toBe('list'); + expect(destinationNamePrompt?.default()).toBe('defaultDestination'); + // ensure additional choice is added to the BTP destination list + expect(((destinationNamePrompt as ListQuestion)?.choices as Function)()).toStrictEqual([ + ...additionalChoiceList, + { name: 'btpTestDest - btpTestDest', value: 'btpTestDest', scp: false, url: 'btpTestDest' } + ]); + }); + + it('enables autocomplete when enabled and additionalChoiceList is provided', async () => { + mockIsAppStudio.mockReturnValueOnce(false); + promptOptions = { + [promptNames.destinationName]: { + ...destinationPrompts, + addBTPDestinationList: false, + useAutocomplete: true, + additionalChoiceList + } + }; + + const questions: CfDeployConfigQuestions[] = await getQuestions(promptOptions); + const destinationNamePrompt = questions.find((question) => question.name === promptNames.destinationName); + expect(destinationNamePrompt?.type).toBe('autocomplete'); + }); + + it('returns input-based prompt when environment is vscode', async () => { + mockIsAppStudio.mockReturnValueOnce(false); + + const questions: CfDeployConfigQuestions[] = await getQuestions(promptOptions); + const destinationNamePrompt = questions.find((question) => question.name === promptNames.destinationName); + expect(destinationNamePrompt?.type).toBe('input'); + expect((destinationNamePrompt?.message as Function)()).toBe(t('prompts.destinationNameMessage')); + expect(((destinationNamePrompt as ListQuestion)?.choices as Function)()).toStrictEqual([]); + }); + + it('returns list-based prompt when environment is vscode and additionalChoiceList is provided', async () => { + mockIsAppStudio.mockReturnValueOnce(false); + promptOptions = { + [promptNames.destinationName]: { + ...destinationPrompts, + additionalChoiceList + } + }; + const questions: CfDeployConfigQuestions[] = await getQuestions(promptOptions); + const destinationNamePrompt = questions.find((question) => question.name === promptNames.destinationName); + expect(destinationNamePrompt?.type).toBe('list'); + expect((destinationNamePrompt?.message as Function)()).toBe(t('prompts.destinationNameMessage')); + expect(((destinationNamePrompt as ListQuestion)?.choices as Function)()).toStrictEqual( + additionalChoiceList + ); + }); + + it('validates destination correctly and shows hint when directBindingDestinationHint is enabled', async () => { + promptOptions = { + [promptNames.destinationName]: { + ...destinationPrompts, + hint: true + } + }; + const questions: CfDeployConfigQuestions[] = await getQuestions(promptOptions); + const destinationNamePrompt = questions.find((question) => question.name === promptNames.destinationName); + expect((destinationNamePrompt?.validate as Function)()).toBe(true); + expect((destinationNamePrompt?.message as Function)()).toBe(t('prompts.directBindingDestinationHint')); + }); + + it('Shows default hint when directBindingDestinationHint is not provided', async () => { + promptOptions = { + [promptNames.destinationName]: { + ...destinationPrompts, + hint: undefined + } + }; + const questions: CfDeployConfigQuestions[] = await getQuestions(promptOptions); + const destinationNamePrompt = questions.find((question) => question.name === promptNames.destinationName); + expect((destinationNamePrompt?.message as Function)()).toBe(t('prompts.destinationNameMessage')); + }); + + test('Destination name when autocomplete is specified', async () => { + // Option `useAutocomplete` specified + promptOptions = { + [promptNames.destinationName]: { + ...destinationPrompts, + useAutocomplete: true, + additionalChoiceList, + defaultValue: 'testChoice' + } + }; + const questions: CfDeployConfigQuestions[] = await getQuestions(promptOptions); + const destinationNamePrompt = questions.find( + (question: CfDeployConfigQuestions) => question.name === promptNames.destinationName + ); + expect(destinationNamePrompt?.type).toEqual('autocomplete'); + expect(((destinationNamePrompt as ListQuestion)?.choices as Function)()).toEqual(additionalChoiceList); + expect((destinationNamePrompt?.source as Function)()).toEqual(additionalChoiceList); + // Default should be used + expect((destinationNamePrompt?.default as Function)()).toEqual(additionalChoiceList[0].name); + }); + }); + + describe('getAddManagedRouterPrompt', () => { + beforeEach(() => { + promptOptions = { + ...promptOptions, + [promptNames.addManagedAppRouter]: true + }; + }); + + it('Displays managed router prompt when enabled', async () => { + const questions: CfDeployConfigQuestions[] = await getQuestions(promptOptions, mockLog); + const managedAppRouterPrompt = questions.find( + (question) => question.name === promptNames.addManagedAppRouter + ); + expect(managedAppRouterPrompt?.type).toBe('confirm'); + expect(managedAppRouterPrompt?.guiOptions?.breadcrumb).toBe( + t('prompts.addApplicationRouterBreadcrumbMessage') + ); + expect((managedAppRouterPrompt?.message as Function)()).toBe( + t('prompts.generateManagedApplicationToRouterMessage') + ); + expect((managedAppRouterPrompt?.default as Function)()).toBe(true); + expect(mockLog.info).toHaveBeenCalledWith(t('info.addManagedAppRouter')); + }); + + it('Displays managed router prompt when disabled', async () => { + promptOptions[promptNames.addManagedAppRouter] = false; + + const questions: CfDeployConfigQuestions[] = await getQuestions(promptOptions, mockLog); + const managedAppRouterPrompt = questions.find( + (question) => question.name === promptNames.addManagedAppRouter + ); + expect(managedAppRouterPrompt).toBeUndefined(); + expect(mockLog.info).not.toHaveBeenCalled(); + }); + }); + + describe('getOverwritePrompt', () => { + beforeEach(() => { + promptOptions = { + ...promptOptions, + [promptNames.overwrite]: true + }; + }); + + it('Displays get overwrite prompt when enabled', async () => { + const questions: CfDeployConfigQuestions[] = await getQuestions(promptOptions, mockLog); + const overwritePrompt = questions.find((question) => question.name === promptNames.overwrite); + expect(overwritePrompt?.type).toBe('confirm'); + expect((overwritePrompt?.default as Function)()).toBe(true); + expect((overwritePrompt?.message as Function)()).toBe(t('prompts.overwriteMessage')); + expect(mockLog.info).toHaveBeenCalledWith(t('info.overwriteDestination')); + }); + + it('Displays get overwrite prompt when disabled', async () => { + if (promptOptions[promptNames.overwrite]) { + promptOptions[promptNames.overwrite] = false; + } + const questions: CfDeployConfigQuestions[] = await getQuestions(promptOptions, mockLog); + const overwritePrompt = questions.find((question) => question.name === promptNames.overwrite); + expect(overwritePrompt?.type).toBeUndefined(); + expect(mockLog.info).not.toHaveBeenCalled(); + }); + }); +}); diff --git a/packages/cf-deploy-config-inquirer/test/validators.test.ts b/packages/cf-deploy-config-inquirer/test/validators.test.ts new file mode 100644 index 0000000000..fc9ccccc7c --- /dev/null +++ b/packages/cf-deploy-config-inquirer/test/validators.test.ts @@ -0,0 +1,36 @@ +import { t } from '../src/i18n'; +import { validateDestinationQuestion } from '../src/prompts/validators'; + +describe('validateDestinationQuestion', () => { + beforeEach(async () => { + jest.clearAllMocks(); + }); + + const cfServiceInput: [any, any][] = [ + [' ', t('errors.emptyDestinationNameError')], + ['', t('errors.emptyDestinationNameError')], + ['ABC ', t('errors.destinationNameError')], + ['ABC&', t('errors.destinationNameError')], + ['ABC$', t('errors.destinationNameError')], + ['ABC abc', t('errors.destinationNameError')], + ['a'.repeat(201), t('errors.destinationNameLengthError')], + ['ABCabc', true], + ['123ABCabc', true], + ['123ABCabc123', true], + ['_ABCabc123', true], + ['-ABCabc123', true], + ['ABC', true], + ['ABC-abc', true], + ['ABC_abc', true], + [{}, true] + ]; + + test.each(cfServiceInput)('Validate destination field %p', (input, toEqual) => { + const output = validateDestinationQuestion(input, false); + expect(output).toEqual(toEqual); + }); + + it('returns true if allowEmptyChoice is true', () => { + expect(validateDestinationQuestion('', true)).toBe(true); + }); +}); diff --git a/packages/cf-deploy-config-inquirer/tsconfig.eslint.json b/packages/cf-deploy-config-inquirer/tsconfig.eslint.json new file mode 100644 index 0000000000..d5f1aa3474 --- /dev/null +++ b/packages/cf-deploy-config-inquirer/tsconfig.eslint.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.json", + "include": ["src", "test", ".eslintrc.js"] +} diff --git a/packages/cf-deploy-config-inquirer/tsconfig.json b/packages/cf-deploy-config-inquirer/tsconfig.json new file mode 100644 index 0000000000..24c19c23fa --- /dev/null +++ b/packages/cf-deploy-config-inquirer/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "../../tsconfig.json", + "include": [ + "src", + "src/**/*.json" + ], + "compilerOptions": { + "rootDir": "src", + "outDir": "dist" + }, + "references": [ + { + "path": "../btp-utils" + }, + { + "path": "../inquirer-common" + }, + { + "path": "../logger" + } + ] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 183faf3e5b..c41aa9734d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -886,6 +886,37 @@ importers: specifier: 5.6.2 version: 5.6.2 + packages/cf-deploy-config-inquirer: + dependencies: + '@sap-ux/btp-utils': + specifier: workspace:* + version: link:../btp-utils + '@sap-ux/inquirer-common': + specifier: workspace:* + version: link:../inquirer-common + '@sap-ux/logger': + specifier: workspace:* + version: link:../logger + i18next: + specifier: 23.5.1 + version: 23.5.1 + inquirer-autocomplete-prompt: + specifier: 2.0.1 + version: 2.0.1(inquirer@8.2.6) + devDependencies: + '@sap-devx/yeoman-ui-types': + specifier: 1.14.4 + version: 1.14.4 + '@types/inquirer': + specifier: 8.2.6 + version: 8.2.6 + '@types/inquirer-autocomplete-prompt': + specifier: 2.0.1 + version: 2.0.1 + inquirer: + specifier: 8.2.6 + version: 8.2.6 + packages/control-property-editor: devDependencies: '@esbuild-plugins/node-modules-polyfill': @@ -6570,7 +6601,7 @@ packages: dependencies: '@formatjs/ts-transformer': 2.13.0(ts-jest@29.1.2) '@types/json-stable-stringify': 1.0.36 - '@types/lodash': 4.17.7 + '@types/lodash': 4.14.202 '@types/loud-rejection': 2.0.0 '@types/node': 14.18.63 '@vue/compiler-core': 3.4.37 @@ -9351,10 +9382,6 @@ packages: resolution: {integrity: sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==} dev: true - /@types/lodash@4.17.7: - resolution: {integrity: sha512-8wTvZawATi/lsmNu10/j2hk1KEP0IvjubqPE3cu1Xz7xfXXt5oCq3SNUz4fMIP4XGF9Ky+Ue2tBA3hcS7LSBlA==} - dev: true - /@types/loud-rejection@2.0.0: resolution: {integrity: sha512-oTHISsIybJGoh3b3Ay/10csbAd2k0su7G7DGrE1QWciC+IdydPm0WMw1+Gr9YMYjPiJ5poB3g5Ev73IlLoavLw==} dependencies: @@ -21015,6 +21042,7 @@ packages: /semver@7.6.3: resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} engines: {node: '>=10'} + hasBin: true dev: true /send@0.19.0: diff --git a/sonar-project.properties b/sonar-project.properties index 32c26ddb65..b251f52ceb 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -55,6 +55,7 @@ sonar.javascript.lcov.reportPaths=packages/abap-deploy-config-inquirer/coverage/ packages/odata-annotation-core-types/coverage/lcov.info, \ packages/odata-entity-model/coverage/lcov.info, \ packages/cds-odata-annotation-converter/coverage/lcov.info, \ + packages/cf-deploy-config-inquirer/coverage/lcov.info, \ packages/ui5-application-writer/coverage/lcov.info, \ packages/ui5-config/coverage/lcov.info, \ packages/ui5-proxy-middleware/coverage/lcov.info, \ @@ -122,6 +123,7 @@ sonar.testExecutionReportPaths=packages/abap-deploy-config-inquirer/coverage/son packages/odata-annotation-core-types/coverage/sonar-report.xml, \ packages/odata-entity-model/coverage/sonar-report.xml, \ packages/cds-odata-annotation-converter/coverage/sonar-report.xml, \ + packages/cf-deploy-config-inquirer/coverage/sonar-report.xml, \ packages/ui5-application-writer/coverage/sonar-report.xml, \ packages/ui5-config/coverage/sonar-report.xml, \ packages/ui5-proxy-middleware/coverage/sonar-report.xml, \ diff --git a/tsconfig.json b/tsconfig.json index 1f99248f49..d6be5dde09 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -62,6 +62,9 @@ { "path": "packages/cds-odata-annotation-converter" }, + { + "path": "packages/cf-deploy-config-inquirer" + }, { "path": "packages/control-property-editor-common" }, From c9421ce7875b2acd3ef3d5cf92363ae49e6980a3 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 16 Oct 2024 12:50:13 +0000 Subject: [PATCH 18/18] chore: apply latest changesets --- .changeset/happy-lemons-hug.md | 5 ----- packages/cf-deploy-config-inquirer/CHANGELOG.md | 7 +++++++ packages/cf-deploy-config-inquirer/package.json | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) delete mode 100644 .changeset/happy-lemons-hug.md create mode 100644 packages/cf-deploy-config-inquirer/CHANGELOG.md diff --git a/.changeset/happy-lemons-hug.md b/.changeset/happy-lemons-hug.md deleted file mode 100644 index 7e9c5924d1..0000000000 --- a/.changeset/happy-lemons-hug.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@sap-ux/cf-deploy-config-inquirer': patch ---- - -add new module @sap-ux/cf-deploy-config-inquirer to get cf prompt options diff --git a/packages/cf-deploy-config-inquirer/CHANGELOG.md b/packages/cf-deploy-config-inquirer/CHANGELOG.md new file mode 100644 index 0000000000..f6c196b03c --- /dev/null +++ b/packages/cf-deploy-config-inquirer/CHANGELOG.md @@ -0,0 +1,7 @@ +# @sap-ux/cf-deploy-config-inquirer + +## 0.0.1 + +### Patch Changes + +- 2fa3fda: add new module @sap-ux/cf-deploy-config-inquirer to get cf prompt options diff --git a/packages/cf-deploy-config-inquirer/package.json b/packages/cf-deploy-config-inquirer/package.json index b2aedefce2..81332958fb 100644 --- a/packages/cf-deploy-config-inquirer/package.json +++ b/packages/cf-deploy-config-inquirer/package.json @@ -1,7 +1,7 @@ { "name": "@sap-ux/cf-deploy-config-inquirer", "description": "Prompts module that can provide prompts for cf deployment config writer", - "version": "0.0.0", + "version": "0.0.1", "repository": { "type": "git", "url": "https://github.com/SAP/open-ux-tools.git",