[PRODENG-211] improved ADF CLI compilation (#9105)

* reduce npm log noise to errors

* remove unused ts config

* improve CLI build config

* use monorepo libs when building CLI

* [ci:force] minor polishing
This commit is contained in:
Denys Vuika
2023-11-22 13:51:20 +00:00
committed by GitHub
parent e97333aabd
commit 3309ea63f6
13 changed files with 135 additions and 19 deletions

View File

@@ -41,7 +41,7 @@ export default function main(_args: string[], workingDir: string) {
if (argv.includes('-h') || argv.includes('--help')) {
program.outputHelp();
return;
exit(0);
}
let packagePath = path.resolve(workingDir, 'package.json');

View File

@@ -155,7 +155,7 @@ export default function main(_args: string[], workingDir: string) {
if (argv.includes('-h') || argv.includes('--help')) {
program.outputHelp();
return;
exit(0);
}
const dir = path.resolve(program.dir || workingDir);

View File

@@ -124,6 +124,7 @@ async function getApplications(): Promise<{ list: { entries: any[] } }> {
} catch (error) {
logger.error(`Get application by status ${error.status} `);
isValid = false;
return null;
}
}
@@ -158,6 +159,7 @@ function getDescriptors() {
} catch (error) {
logger.error(`Get Descriptors ${error.status} `);
isValid = false;
return null;
}
}
@@ -192,6 +194,7 @@ function getProjects() {
} catch (error) {
logger.error('Get Projects' + error.status);
isValid = false;
return null;
}
}
@@ -227,6 +230,7 @@ function getProjectRelease(projectId: string) {
} catch (error) {
logger.error('Get Projects Release' + error.status);
isValid = false;
return null;
}
}
@@ -297,6 +301,7 @@ function deleteProject(projectId: string) {
} catch (error) {
logger.error('Delete project error' + error.status);
isValid = false;
return null;
}
}
@@ -373,6 +378,7 @@ function deleteDescriptor(name: string) {
} catch (error) {
logger.error('Delete descriptor' + error.status);
isValid = false;
return null;
}
}
@@ -408,6 +414,7 @@ function deploy(model: any) {
} catch (error) {
logger.error('Deploy post' + error.status);
isValid = false;
return null;
}
}

View File

@@ -148,6 +148,7 @@ async function lockFile(nodeId: string): Promise<NodeEntry> {
return result;
} catch (error) {
logger.error('Failed to lock file with error: ', error.stack);
return null;
}
}

View File

@@ -190,6 +190,7 @@ async function hasDefaultTenant(tenantId: number, tenantName: string): Promise<b
} else {
logger.info(`Wrong configuration. Another tenant has been created with id ${tenant.id} and name ${tenant.name}`);
throwError(`Wrong configuration. Another tenant has been created with id ${tenant.id} and name ${tenant.name}`);
return false;
}
}
@@ -212,6 +213,7 @@ async function createDefaultTenant(tenantName: string) {
return tenant.id;
} catch (error) {
logger.info(`APS: not able to create the default tenant: ${JSON.parse(error.message)}` );
return null;
}
}
@@ -285,6 +287,7 @@ async function isDefaultAppDeployed(appName: string): Promise<boolean> {
return defaultApp && defaultApp.length > 0;
} catch (error) {
logger.error(`Aps app failed to import/Publish!`);
return false;
}
}
@@ -306,6 +309,7 @@ async function importPublishApp(appName: string): Promise<AppDefinitionUpdateRes
return result;
} catch (error) {
logger.error(`Aps app failed to import/Publish!`, error.message);
return null;
}
}
@@ -353,6 +357,7 @@ async function hasLicense(): Promise<boolean> {
return false;
} catch (error) {
logger.error(`Aps not able to check the license` );
return false;
}
}
@@ -378,6 +383,7 @@ async function getDefaultApsUsersFromRealm() {
return apsDefaultUsers;
} catch (error) {
logger.error(`APS: not able to fetch user: ${error.message}` );
return null;
}
}
@@ -403,6 +409,7 @@ async function isContentRepoPresent(tenantId: number, contentName: string): Prom
return !!contentRepos.data.find(repo => repo.name === contentName);
} catch (error) {
logger.error(`APS: not able to create content: ${error.message}` );
return null;
}
}

View File

@@ -107,7 +107,7 @@ export default function main(_args: string[], workingDir: string) {
if (argv.includes('-h') || argv.includes('--help')) {
program.outputHelp();
return;
exit(0);
}
let packagePath = path.resolve(workingDir, 'package.json');

View File

@@ -215,6 +215,7 @@ async function getPeopleCount(skipCount: number = 0): Promise<PeopleTally> {
return result;
} catch (error) {
handleError(error);
return null;
}
}
@@ -232,6 +233,7 @@ async function getHomeFoldersCount(): Promise<number> {
return homesFolderApiResult.list.pagination.totalItems;
} catch (error) {
handleError(error);
return 0;
}
}
@@ -246,6 +248,7 @@ async function getGroupsCount(): Promise<number> {
return groupsApiResult.list.pagination.totalItems;
} catch (error) {
handleError(error);
return 0;
}
}
@@ -260,6 +263,7 @@ async function getSitesCount(): Promise<number> {
return sitesApiResult.list.pagination.totalItems;
} catch (error) {
handleError(error);
return 0;
}
}
@@ -282,6 +286,7 @@ async function getFilesCount(): Promise<number> {
return searchApiResult.list.pagination.totalItems;
} catch (error) {
handleError(error);
return 0;
}
}

View File

@@ -1,4 +1,5 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"declaration": true,
"module": "commonjs",

View File

@@ -1,9 +0,0 @@
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declarationMap": false
},
"angularCompilerOptions": {
"compilationMode": "partial"
}
}