Skip to content

Commit

Permalink
Merge branch 'main' into feat/jestExternalCalls
Browse files Browse the repository at this point in the history
  • Loading branch information
nlunets authored Jan 23, 2025
2 parents 389f4a9 + 960b79a commit 576955a
Show file tree
Hide file tree
Showing 57 changed files with 1,527 additions and 87 deletions.
8 changes: 8 additions & 0 deletions packages/abap-deploy-config-inquirer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @sap-ux/abap-deploy-config-inquirer

## 1.2.1

### Patch Changes

- Updated dependencies [080bda2]
- @sap-ux/guided-answers-helper@0.2.1
- @sap-ux/inquirer-common@0.6.5

## 1.2.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/abap-deploy-config-inquirer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"url": "https://github.com/SAP/open-ux-tools.git",
"directory": "packages/abap-deploy-config-inquirer"
},
"version": "1.2.0",
"version": "1.2.1",
"license": "Apache-2.0",
"main": "dist/index.js",
"scripts": {
Expand Down
6 changes: 6 additions & 0 deletions packages/abap-deploy-config-sub-generator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @sap-ux/abap-deploy-config-sub-generator

## 0.0.17

### Patch Changes

- @sap-ux/abap-deploy-config-inquirer@1.2.1

## 0.0.16

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/abap-deploy-config-sub-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"url": "https://github.com/SAP/open-ux-tools.git",
"directory": "packages/abap-deploy-config-sub-generator"
},
"version": "0.0.16",
"version": "0.0.17",
"license": "Apache-2.0",
"main": "generators/app/index.js",
"scripts": {
Expand Down
7 changes: 7 additions & 0 deletions packages/adp-tooling/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @sap-ux/adp-tooling

## 0.12.112

### Patch Changes

- Updated dependencies [080bda2]
- @sap-ux/inquirer-common@0.6.5

## 0.12.111

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/adp-tooling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.111",
"version": "0.12.112",
"license": "Apache-2.0",
"author": "@SAP/ux-tools-team",
"main": "dist/index.js",
Expand Down
8 changes: 7 additions & 1 deletion packages/cap-config-writer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @sap-ux/cap-config-writer

## 0.8.2

### Patch Changes

- 1309fec: Fix writing watch script for CAP project where npm workspaces is already enabled

## 0.8.1

### Patch Changes
Expand All @@ -12,7 +18,7 @@

### Minor Changes

- 45c01b0: Remove cds version check when adding a cds watch sciprt to root package.json
- 45c01b0: Remove cds version check when adding a cds watch script to root package.json

## 0.7.68

Expand Down
2 changes: 1 addition & 1 deletion packages/cap-config-writer/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sap-ux/cap-config-writer",
"description": "Add or update configuration for SAP CAP projects",
"version": "0.8.1",
"version": "0.8.2",
"repository": {
"type": "git",
"url": "https://github.com/SAP/open-ux-tools.git",
Expand Down
9 changes: 5 additions & 4 deletions packages/cap-config-writer/src/cap-writer/package-json.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Package } from '@sap-ux/project-access';
import { getCapCustomPaths } from '@sap-ux/project-access';
import type { Editor } from 'mem-fs-editor';
import path, { join } from 'path';
import { dirname, join, normalize, posix } from 'path';
import type { CapServiceCdsInfo } from '../cap-config/types';
import { enableCdsUi5Plugin, checkCdsUi5PluginEnabled } from '../cap-config';
import type { Logger } from '@sap-ux/logger';
Expand Down Expand Up @@ -55,9 +55,10 @@ async function updateScripts(
appId: string,
enableNPMWorkspaces?: boolean
): Promise<void> {
const hasNPMworkspaces = await checkCdsUi5PluginEnabled(packageJsonPath, fs);
const hasNPMworkspaces = await checkCdsUi5PluginEnabled(dirname(packageJsonPath), fs);
let cdsScript;
if (enableNPMWorkspaces ?? hasNPMworkspaces) {
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
if (enableNPMWorkspaces || hasNPMworkspaces) {
// If the project uses npm workspaces (and specifically cds-plugin-ui5 ) then the project is served using the appId
cdsScript = getCDSWatchScript(projectName, appId);
} else {
Expand Down Expand Up @@ -102,7 +103,7 @@ export async function updateRootPackageJson(
if (sapux) {
const dirPath = join(capService.appPath ?? (await getCapCustomPaths(capService.projectPath)).app, projectName);
// Converts a directory path to a POSIX-style path.
const capProjectPath = path.normalize(dirPath).split(/[\\/]/g).join(path.posix.sep);
const capProjectPath = normalize(dirPath).split(/[\\/]/g).join(posix.sep);
const sapuxExt = Array.isArray(packageJson?.sapux) ? [...packageJson.sapux, capProjectPath] : [capProjectPath];
fs.extendJSON(packageJsonPath, { sapux: sapuxExt });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import { satisfiesMinCdsVersion } from '../../../src/cap-config/package-json';
import memFs from 'mem-fs';
import { ToolsLogger } from '@sap-ux/logger';
import editor, { type Editor } from 'mem-fs-editor';
import { join } from 'path';
import { dirname, join } from 'path';
import { minCdsVersion } from '../../../src/cap-config';
import { updateRootPackageJson, updateAppPackageJson } from '../../../src/cap-writer/package-json';
import type { Package } from '@sap-ux/project-access';
import type { CapServiceCdsInfo } from '../../../src/index';
import { dir } from 'console';

jest.mock('../../../src/cap-config/package-json', () => ({
...jest.requireActual('../../../src/cap-config/package-json'),
Expand Down Expand Up @@ -84,9 +85,45 @@ describe('Writing/package json files', () => {
);
const packageJson = (fs.readJSON(packageJsonPath) ?? {}) as Package;
const devDependencies = packageJson.devDependencies;
const scripts = packageJson.scripts;
expect(devDependencies).toEqual({
'cds-plugin-ui5': '^0.9.3'
});
expect(scripts?.['watch-test-cap-package-sapux']).toBeDefined();
expect(scripts?.['watch-test-cap-package-sapux']).toEqual(
'cds watch --open test.app.project/index.html?sap-ui-xx-viewCache=false --livereload false'
);
});
test('should add watch script when workspace is NOT enabled', async () => {
const isSapUxEnabled = true;
const isNpmWorkspacesEnabled = false;
const testProjectWSAlreadyEnabled = 'testprojectwsalreadyenabled';
const packageJsonPath = join(testInputPath, testProjectWSAlreadyEnabled, 'package.json');
const capServiceWS = { ...capService };
capServiceWS.projectPath = dirname(packageJsonPath);
fs.writeJSON(packageJsonPath, {
name: 'test-project-ws-already-enabled',
workspaces: ['app/*'],
devDependencies: {
'cds-plugin-ui5': '^0.9.3'
}
});
await updateRootPackageJson(
fs,
testProjectWSAlreadyEnabled,
isSapUxEnabled,
capServiceWS,
'test.app.project.ws.already.enabled',
logger,
isNpmWorkspacesEnabled
);
const packageJson = (fs.readJSON(packageJsonPath) ?? {}) as Package;
const devDependencies = packageJson.devDependencies;
const scripts = packageJson.scripts;
expect(scripts?.['watch-testprojectwsalreadyenabled']).toBeDefined();
expect(scripts?.['watch-testprojectwsalreadyenabled']).toEqual(
'cds watch --open test.app.project.ws.already.enabled/index.html?sap-ui-xx-viewCache=false --livereload false'
);
});

test('should remove int-test script and start scripts, and also keep other scripts', async () => {
Expand Down
7 changes: 7 additions & 0 deletions packages/cf-deploy-config-inquirer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @sap-ux/cf-deploy-config-inquirer

## 0.1.19

### Patch Changes

- Updated dependencies [080bda2]
- @sap-ux/inquirer-common@0.6.5

## 0.1.18

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cf-deploy-config-inquirer/package.json
Original file line number Diff line number Diff line change
@@ -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.1.18",
"version": "0.1.19",
"repository": {
"type": "git",
"url": "https://github.com/SAP/open-ux-tools.git",
Expand Down
8 changes: 8 additions & 0 deletions packages/cf-deploy-config-sub-generator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @sap-ux/cf-deploy-config-sub-generator

## 0.0.2

### Patch Changes

- Updated dependencies [080bda2]
- @sap-ux/inquirer-common@0.6.5
- @sap-ux/cf-deploy-config-inquirer@0.1.19

## 0.0.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cf-deploy-config-sub-generator/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sap-ux/cf-deploy-config-sub-generator",
"description": "Generators for configuring Cloud Foundry deployment configuration",
"version": "0.0.1",
"version": "0.0.2",
"repository": {
"type": "git",
"url": "https://github.com/SAP/open-ux-tools.git",
Expand Down
2 changes: 1 addition & 1 deletion packages/control-property-editor-common/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const convertCamelCaseToPascalCase = (text: string): string => {
const words = [];
let word = '';
let lookForUpperCase = true;
for (let i = 0; i < text.length; i++) {
for (let i = 0; i < (text ?? '').length; i++) {
const character = text[i];
if (lookForUpperCase) {
// make sure that the first letter is capitalized
Expand Down
26 changes: 26 additions & 0 deletions packages/create/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# @sap-ux/create

## 0.11.37

### Patch Changes

- Updated dependencies [1309fec]
- @sap-ux/cap-config-writer@0.8.2

## 0.11.36

### Patch Changes

- Updated dependencies [1586cc3]
- @sap-ux/preview-middleware@0.16.174
- @sap-ux/app-config-writer@0.5.15

## 0.11.35

### Patch Changes

- @sap-ux/abap-deploy-config-inquirer@1.2.1
- @sap-ux/adp-tooling@0.12.112
- @sap-ux/flp-config-inquirer@0.2.17
- @sap-ux/cap-config-writer@0.8.1
- @sap-ux/preview-middleware@0.16.173
- @sap-ux/app-config-writer@0.5.15

## 0.11.34

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/create/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sap-ux/create",
"description": "SAP Fiori tools module to add or remove features",
"version": "0.11.34",
"version": "0.11.37",
"repository": {
"type": "git",
"url": "https://github.com/SAP/open-ux-tools.git",
Expand Down
8 changes: 8 additions & 0 deletions packages/flp-config-inquirer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @sap-ux/flp-config-inquirer

## 0.2.17

### Patch Changes

- Updated dependencies [080bda2]
- @sap-ux/inquirer-common@0.6.5
- @sap-ux/adp-tooling@0.12.112

## 0.2.16

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/flp-config-inquirer/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sap-ux/flp-config-inquirer",
"description": "Prompts module that can prompt users for inputs required for FLP configuration",
"version": "0.2.16",
"version": "0.2.17",
"repository": {
"type": "git",
"url": "https://github.com/SAP/open-ux-tools.git",
Expand Down
9 changes: 9 additions & 0 deletions packages/flp-config-sub-generator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @sap-ux/flp-config-sub-generator

## 0.0.17

### Patch Changes

- Updated dependencies [080bda2]
- @sap-ux/inquirer-common@0.6.5
- @sap-ux/flp-config-inquirer@0.2.17
- @sap-ux/app-config-writer@0.5.15

## 0.0.16

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/flp-config-sub-generator/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sap-ux/flp-config-sub-generator",
"description": "Generator for creating Fiori Launcpad configuration",
"version": "0.0.16",
"version": "0.0.17",
"repository": {
"type": "git",
"url": "https://github.com/SAP/open-ux-tools.git",
Expand Down
6 changes: 6 additions & 0 deletions packages/guided-answers-helper/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @sap-ux/guided-answers-helper

## 0.2.1

### Patch Changes

- 080bda2: Adds new GA link for 504

## 0.2.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/guided-answers-helper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"url": "https://github.com/SAP/open-ux-tools.git",
"directory": "packages/guided-answers-helper"
},
"version": "0.2.0",
"version": "0.2.1",
"license": "Apache-2.0",
"main": "dist/index.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion packages/guided-answers-helper/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export const HELP_NODES = {
NO_V4_SERVICES: 57573, // No V4 OData services available
NO_ADT_SERVICE_AUTH: 57266, //Users does not have authorizations to use ADT services
DESTINATION_CONNECTION_ERRORS: 48366, // Non specific destination connection error help page, currently this is mapped to the same node as BAS_CATALOG_SERVICES_REQUEST_FAILED which will be updated in the future (and the entry here removed)
UI_SERVICE_GENERATOR: 63068 // UI Service generator
UI_SERVICE_GENERATOR: 63068, // UI Service generator
DESTINATION_GATEWAY_TIMEOUT: 57914 // Gateway timeout 504
};

export const GUIDED_ANSWERS_EXTENSION_ID = 'saposs.sap-guided-answers-extension';
Expand Down
Loading

0 comments on commit 576955a

Please sign in to comment.