Skip to content

Commit

Permalink
TA-3148: Revert back the changes made to Studio logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Buqeta committed Jul 18, 2024
1 parent 8af0670 commit deaa7a4
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/content/factory/widget-manager.factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as path from "path";
import { FatalError, logger } from "../../util/logger";
import { WidgetManager } from "../manager/widget.manager";
import * as AdmZip from "adm-zip";
import {parse} from "../../util/json";
import {parse} from "../../util/yaml";

interface Manifest {
key: string;
Expand Down
2 changes: 1 addition & 1 deletion src/content/manager/analysis.manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { BaseManager } from "./base.manager";
import { ManagerConfig } from "../../interfaces/manager-config.interface";
import { AssetManager } from "./asset.manager";
import * as fs from "fs";
import {stringify} from "../../util/json";
import {stringify} from "../../util/yaml";
import * as FormData from "form-data";

export class AnalysisManager extends BaseManager {
Expand Down
2 changes: 1 addition & 1 deletion src/content/manager/asset.manager.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BaseManager } from "./base.manager";
import { ManagerConfig } from "../../interfaces/manager-config.interface";
import { SaveContentNode } from "../../interfaces/save-content-node.interface";
import { parse, stringify } from "../../util/json";
import { parse, stringify } from "../../util/yaml";

export class AssetManager extends BaseManager {
public static ASSET_FILE_PREFIX = "asset_";
Expand Down
2 changes: 1 addition & 1 deletion src/services/file-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as fs from "fs";
import * as path from "path";
import { ManifestNodeTransport } from "../interfaces/manifest-transport";
import { FatalError, logger } from "../util/logger";
import {parse} from "../util/json";
import {parse} from "../util/yaml";

export class FileService {
public static readonly fileDownloadedMessage = "File downloaded successfully. New filename: ";
Expand Down
2 changes: 1 addition & 1 deletion src/services/package-manager/package-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {SpaceTransport} from "../../interfaces/save-space.interface";
import {ManifestDependency, ManifestNodeTransport} from "../../interfaces/manifest-transport";
import {DataPoolInstallVersionReport} from "../../interfaces/data-pool-manager.interfaces";
import {SemanticVersioning} from "../../util/semantic-versioning"
import {stringify} from "../../util/json";
import {stringify} from "../../util/yaml";
import * as FormData from "form-data";

class PackageService {
Expand Down
9 changes: 9 additions & 0 deletions src/util/yaml.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import * as YAML from "yaml";

export function stringify(data: any): string {
return YAML.stringify(data, {doubleQuotedAsJSON: true, indent: 2, lineWidth: 200});
}

export function parse<T>(data: string): T {
return YAML.parse(data);
}

0 comments on commit deaa7a4

Please sign in to comment.