[MIGRATION] - Improving the testing build to avoid having to bundle also the js-api

This commit is contained in:
VitoAlbano 2024-08-05 16:54:32 +01:00
parent 92823bd8ab
commit cf175c67b8
12 changed files with 14 additions and 34 deletions

View File

@ -205,7 +205,6 @@ jobs:
- name: install
run: |
npm ci
npx nx run js-api:bundle
npx nx run cli:bundle
npx nx run testing:bundle
- run: npx nx print-affected $NX_CALCULATION_FLAGS

View File

@ -97,7 +97,6 @@ jobs:
- name: install
run: |
npm ci
npx nx run js-api:bundle
npx nx run cli:bundle
npx nx run testing:bundle
- uses: ./.github/actions/upload-node-modules-and-artifacts

View File

@ -102,7 +102,6 @@ jobs:
- name: install
run: |
npm ci
npx nx run js-api:bundle
npx nx run cli:bundle
npx nx run testing:bundle
- uses: ./.github/actions/upload-node-modules-and-artifacts

View File

@ -5,27 +5,17 @@
"projectType": "library",
"prefix": "adf",
"targets": {
"build": {
"executor": "@nx/webpack:webpack",
"executor": "@angular-devkit/build-angular:ng-packagr",
"options": {
"projectRoot": "lib/testing",
"outputPath": "dist/libs/testing",
"main": "lib/testing/index.ts",
"generatePackageJson": true,
"tsConfig": "lib/testing/tsconfig.lib.prod.json",
"stylePreprocessorOptions": {
"includePaths": ["lib", "lib/core/src/lib"]
},
"target": "node",
"compiler": "tsc"
"tsConfig": "lib/testing/tsconfig.lib.json",
"project": "lib/testing/ng-package.json"
},
"configurations": {
"production": {
"projectRoot": "lib/testing",
"outputPath": "dist/libs/testing",
"main": "lib/testing/index.ts",
"generatePackageJson": true,
"tsConfig": "lib/testing/tsconfig.lib.prod.json"
"project": "lib/testing/ng-package.json",
"tsConfig": "lib/testing/tsconfig.prod.json"
}
},
"defaultConfiguration": "production"

View File

@ -18,9 +18,6 @@
import { Column } from './column';
export class DateColumn extends Column {
columnType: string;
columnName: string;
constructor(columnName: string) {
super(columnName, 'date');
}

View File

@ -18,9 +18,6 @@
import { Column } from './column';
export class TextColumn extends Column {
columnType: string;
columnName: string;
constructor(columnName: string) {
super(columnName, 'text');
}

View File

@ -22,7 +22,6 @@ import { ApiService } from '../../../shared/api/api.service';
import { ApiUtil } from '../../../shared/api/api.util';
export class Application {
requestApiHelper: E2eRequestApiHelper;
endPoint = `/deployment-service/v1/applications/`;
@ -57,6 +56,7 @@ export class Application {
return this.requestApiHelper.delete(`${this.endPoint}${applicationName}`);
} catch (error) {
Logger.error(`[Application] Undeploy application ${applicationName} failed with error: ${error.message}`);
return null;
}
};
return ApiUtil.waitForApi(apiCall, isApplicationUndeployed, 10, 3000);

View File

@ -23,7 +23,6 @@ import { ApiUtil } from '../../../shared/api/api.util';
import { ApiService } from '../../../shared/api/api.service';
export class Descriptor {
requestApiHelper: E2eRequestApiHelper;
endPoint = `deployment-service/v1/descriptors/`;
@ -61,6 +60,7 @@ export class Descriptor {
return this.requestApiHelper.delete(`${this.endPoint}${name}`);
} catch (error) {
Logger.error(`[Descriptor] Delete descriptor ${name} failed with error: ${error.message}`);
return null;
}
};
return ApiUtil.waitForApi(apiCall, isDescriptorDeleted, 10, 15000);

View File

@ -33,7 +33,7 @@ export class LogLevelsEnum extends Number {
static SILENT: number = 0;
}
export const logLevels: { level: LogLevelsEnum; name: LOG_LEVEL }[] = [
export const logLevels: { level: number; name: LOG_LEVEL }[] = [
{ level: LogLevelsEnum.TRACE, name: 'TRACE' },
{ level: LogLevelsEnum.DEBUG, name: 'DEBUG' },
{ level: LogLevelsEnum.INFO, name: 'INFO' },
@ -51,11 +51,10 @@ export interface LoggerLike {
/* eslint-disable no-console */
export class GenericLogger implements LoggerLike {
private level: LogLevelsEnum;
private level: number;
constructor(logLevel: string) {
this.level = logLevels.find(({name}) => name === logLevel)?.level || LogLevelsEnum.ERROR;
this.level = logLevels.find(({ name }) => name === logLevel)?.level || LogLevelsEnum.ERROR;
}
info(...messages: string[]): void {

View File

@ -7,7 +7,7 @@
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.lib.prod.json"
"path": "./tsconfig.prod.json"
}
],
"compilerOptions": {

View File

@ -6,8 +6,8 @@
"declarationMap": true,
"resolveJsonModule": true,
"paths": {
"@alfresco/js-api": ["../../dist/libs/js-api"],
"@alfresco/js-api/*": ["../../dist/libs/js-api/*"]
"@alfresco/js-api": ["../../../dist/libs/js-api"],
"@alfresco/js-api/*": ["../../../dist/libs/js-api/*"]
}
}
}