Skip to content

Commit

Permalink
fix(cf-deploy-config-writer): fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
longieirl committed Jan 23, 2025
1 parent 740f4e8 commit 808ffd3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 14 deletions.
13 changes: 4 additions & 9 deletions packages/cf-deploy-config-writer/src/cf-writer/app-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,8 @@ import {
import LoggerHelper from '../logger-helper';
import { t } from '../i18n';
import { type Logger } from '@sap-ux/logger';
import {
ApiHubType,
type CFAppConfig,
type CFConfig,
type MTABaseConfig,
RouterModuleType,
XSAppDocument
} from '../types';
import type { XSAppDocument } from '../types';
import { ApiHubType, type CFAppConfig, type CFConfig, type MTABaseConfig } from '../types';

/**
* Add a managed approuter configuration to an existing HTML5 application.
Expand Down Expand Up @@ -259,8 +253,9 @@ export function generateMTAFile(cfConfig: CFConfig): void {

/**
* Updates the MTA configuration file.
* @param fs reference to a mem-fs editor
*
* @param cfConfig writer configuration
* @param fs reference to a mem-fs editor
*/
async function updateMtaConfig(cfConfig: CFConfig, fs: Editor): Promise<void> {
const mtaInstance = await getMtaConfig(cfConfig.rootPath);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { create as createStorage } from 'mem-fs';
import { create, type Editor } from 'mem-fs-editor';
import { addSupportingConfig, addRoutingConfig, setMtaDefaults } from '../utils';
import { addSupportingConfig, addRoutingConfig } from '../utils';
import LoggerHelper from '../logger-helper';
import { createMTA, validateMtaConfig } from '../mta-config';
import { type Logger } from '@sap-ux/logger';
Expand Down
4 changes: 2 additions & 2 deletions packages/cf-deploy-config-writer/src/cf-writer/cap-config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { create as createStorage } from 'mem-fs';
import { create, type Editor } from 'mem-fs-editor';
import { addSupportingConfig, addRoutingConfig, setMtaDefaults } from '../utils';
import { createCAPMTA, doesMTABinaryExist, validateMtaConfig } from '../mta-config';
import { addSupportingConfig, addRoutingConfig } from '../utils';
import { createCAPMTA, validateMtaConfig } from '../mta-config';
import LoggerHelper from '../logger-helper';
import type { Logger } from '@sap-ux/logger';
import type { CAPConfig, CFBaseConfig } from '../types';
Expand Down
14 changes: 12 additions & 2 deletions packages/cf-deploy-config-writer/src/mta-config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,25 @@ export function doesCDSBinaryExist(): void {
}
}

/**
*
* @param cwd
* @param options
*/
export function addCAMtaServices(cwd: string, options?: string[]): void {
let result = spawnSync(CDSExecutable, [...CDSAddMtaParams, ...(options ?? [])], { cwd });
const result = spawnSync(CDSExecutable, [...CDSAddMtaParams, ...(options ?? [])], { cwd });
if (result.error) {
throw new Error(CDSBinNotFound);
}
}

/**
*
* @param cwd
* @param options
*/
export function createCAPMTA(cwd: string, options?: string[]): void {
let result = spawnSync(CDSExecutable, [...CDSAddMtaParams, ...(options ?? [])], { cwd });
const result = spawnSync(CDSExecutable, [...CDSAddMtaParams, ...(options ?? [])], { cwd });
if (result.error) {
throw new Error(CDSBinNotFound);
}
Expand Down
5 changes: 5 additions & 0 deletions packages/cf-deploy-config-writer/src/mta-config/mta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ export class MtaConfig {
this.dirty = true;
}

/**
*
* @param serviceName
* @param resourceName
*/
private async updateServiceName(serviceName: string, resourceName: string): Promise<void> {
const resource = this.resources.get(resourceName);
if (resource && !resource.parameters?.['service-name']) {
Expand Down

0 comments on commit 808ffd3

Please sign in to comment.