1- import lodash from "lodash" ;
2- import { getAppTree , getAppData , allApplications } from "@exabyte-io/application-flavors.js" ;
1+ import { allApplications , getAppData , getAppTree } from "@exabyte-io/application-flavors.js" ;
32import { NamedDefaultableInMemoryEntity } from "@exabyte-io/code.js/dist/entity" ;
3+ import lodash from "lodash" ;
44
55import { Executable } from "./executable" ;
66import { getApplicationConfig , getExecutableConfig } from "./tree" ;
77
8-
98export class Application extends NamedDefaultableInMemoryEntity {
109 static Executable = Executable ;
1110
1211 constructor ( config ) {
1312 const staticConfig = getApplicationConfig ( config ) ;
14- super ( { ...staticConfig , ...config } ) ;
13+ super ( { ...staticConfig , ...config } ) ;
1514 }
1615
1716 // TODO: extract this from application-flavors "global" default config for espresso 5.4.0
1817 static get defaultConfig ( ) {
1918 return {
20- name : ' espresso' ,
21- shortName : 'qe' ,
22- version : ' 5.4.0' ,
23- summary : ' Quantum Espresso' ,
24- build : ' Default' ,
25- }
19+ name : " espresso" ,
20+ shortName : "qe" ,
21+ version : " 5.4.0" ,
22+ summary : " Quantum Espresso" ,
23+ build : " Default" ,
24+ } ;
2625 }
2726
2827 static create ( config ) {
2928 return this . createFromNameVersionBuild ( config ) ;
3029 }
3130
32- static createFromNameVersionBuild ( { name, version = null , build = "Default" } ) {
33- return new Application ( { name, version, build} ) ;
31+ static createFromNameVersionBuild ( { name, version = null , build = "Default" } ) {
32+ return new Application ( { name, version, build } ) ;
3433 }
3534
3635 getExecutables ( ) {
@@ -39,15 +38,15 @@ export class Application extends NamedDefaultableInMemoryEntity {
3938
4039 getBuilds ( ) {
4140 const data = getAppData ( this . prop ( "name" ) ) ;
42- const { versions} = data ;
41+ const { versions } = data ;
4342 const builds = [ "Default" ] ;
4443 versions . map ( ( v ) => v . build && builds . push ( v . build ) ) ;
4544 return lodash . uniq ( builds ) ;
4645 }
4746
4847 getVersions ( ) {
4948 const data = getAppData ( this . prop ( "name" ) ) ;
50- const { versions} = data ;
49+ const { versions } = data ;
5150 const these = versions . map ( ( v ) => v . version ) ;
5251 return lodash . uniq ( these ) ;
5352 }
@@ -61,7 +60,7 @@ export class Application extends NamedDefaultableInMemoryEntity {
6160 getExecutableConfig ( {
6261 appName : this . prop ( "name" ) ,
6362 execName : name ,
64- } )
63+ } ) ,
6564 ) ;
6665 }
6766
@@ -74,8 +73,9 @@ export class Application extends NamedDefaultableInMemoryEntity {
7473 }
7574
7675 // override upon inheritance
76+ // eslint-disable-next-line class-methods-use-this
7777 get allowedModelTypes ( ) {
78- return [ ]
78+ return [ ] ;
7979 }
8080
8181 get summary ( ) {
@@ -96,11 +96,11 @@ export class Application extends NamedDefaultableInMemoryEntity {
9696
9797 get executables ( ) {
9898 const tree = getAppTree ( this . prop ( "name" ) ) ;
99- return Object . keys ( tree ) . map ( key => {
99+ return Object . keys ( tree ) . map ( ( key ) => {
100100 return new this . constructor . Executable (
101- Object . assign ( { } , tree [ key ] , { name : key } )
102- )
103- } )
101+ { ... tree [ key ] , name : key } ,
102+ ) ;
103+ } ) ;
104104 }
105105
106106 get hasAdvancedComputeOptions ( ) {
@@ -110,5 +110,4 @@ export class Application extends NamedDefaultableInMemoryEntity {
110110 get isLicensed ( ) {
111111 return this . prop ( "isLicensed" ) ;
112112 }
113-
114113}
0 commit comments