Skip to content

Commit

Permalink
fix: prettier reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
unsigned6 committed Nov 17, 2022
1 parent 8fd52c5 commit 9f1d7f8
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 20 deletions.
4 changes: 1 addition & 3 deletions src/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ export class Application extends NamedDefaultableInMemoryEntity {
get executables() {
const tree = getAppTree(this.prop("name"));
return Object.keys(tree).map((key) => {
return new this.constructor.Executable(
{ ...tree[key], name: key },
);
return new this.constructor.Executable({ ...tree[key], name: key });
});
}

Expand Down
4 changes: 3 additions & 1 deletion src/flavor.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { mix } from "mixwith";
import { Template } from "./template";

export class Flavor extends mix(NamedDefaultableInMemoryEntity).with(RuntimeItemsMixin) {
get input() { return this.prop("input", []); }
get input() {
return this.prop("input", []);
}

// TODO : prevent this from running in client
get inputAsTemplates() {
Expand Down
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import {
allApplications, allowedMonitors, allowedResults, allTemplates,
allApplications,
allowedMonitors,
allowedResults,
allTemplates,
} from "@exabyte-io/application-flavors.js";

import { Application } from "./application";
Expand Down
14 changes: 7 additions & 7 deletions src/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ export class Template extends NamedInMemoryEntity {

render(externalContext) {
const renderingContext = this.getRenderingContext(externalContext);
let template,
rendered;
let template, rendered;
if (!this.isManuallyChanged) {
try {
template = jinja.compile(this.content);
Expand Down Expand Up @@ -85,9 +84,10 @@ export class Template extends NamedInMemoryEntity {

static fromFlavor(appName, execName, inputName) {
const filtered = allTemplates.filter(
(temp) => temp.applicationName === appName
&& temp.executableName === execName
&& temp.name === inputName,
(temp) =>
temp.applicationName === appName &&
temp.executableName === execName &&
temp.name === inputName,
);
if (filtered.length !== 1) {
console.log(
Expand All @@ -105,8 +105,8 @@ export class Template extends NamedInMemoryEntity {
getContextProvidersAsClassInstances(providerContext) {
const me = this;
return this.contextProviders.map((p) => {
const { constructor, config } = me.constructor.providerRegistry
.findProviderInstanceByName(p.name);
const { constructor, config } =
me.constructor.providerRegistry.findProviderInstanceByName(p.name);
const clsInstance = new constructor({
...config,
context: providerContext,
Expand Down
17 changes: 9 additions & 8 deletions src/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ export function getAllApplications(cls = null) {
const applicationsArray = [];
allApplications.forEach((appName) => {
applicationsTree[appName] = {};
const {
versions, defaultVersion, build = "Default", ...appData
} = getAppData(appName);
const { versions, defaultVersion, build = "Default", ...appData } = getAppData(appName);
applicationsTree[appName].defaultVersion = defaultVersion;
versions.forEach((options) => {
const { version } = options;
Expand All @@ -40,9 +38,7 @@ export function getAllApplications(cls = null) {
* @param build {String} the build to use (optional, defaults to Default)
* @return {*} an application
*/
export function getApplication({
applicationsTree, name, version = null, build = "Default",
}) {
export function getApplication({ applicationsTree, name, version = null, build = "Default" }) {
const app = applicationsTree[name];
// eslint-disable-next-line no-param-reassign
if (!version) version = app.defaultVersion;
Expand All @@ -60,7 +56,10 @@ const { applicationsTree } = getAllApplications(null);
*/
export function getApplicationConfig({ name, version = null, build = "Default" }) {
return getApplication({
applicationsTree, name, version, build,
applicationsTree,
name,
version,
build,
});
}

Expand All @@ -72,7 +71,9 @@ export function getApplicationConfig({ name, version = null, build = "Default" }
*/
export function getExecutableConfig({ appName, execName }) {
const appTree = getAppTree(appName);
Object.entries(appTree).forEach(([name, exec]) => { exec.name = name; });
Object.entries(appTree).forEach(([name, exec]) => {
exec.name = name;
});
if (!execName) return getOneMatchFromObject(appTree, "isDefault", true);
return appTree[execName];
}
Expand Down

0 comments on commit 9f1d7f8

Please sign in to comment.