Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
GabiGrin committed Sep 30, 2024
1 parent 330bb6d commit 6cf8201
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 24 deletions.
11 changes: 11 additions & 0 deletions core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from "./common";
import { Pos, OMap } from "./common";
import { FlydeFlow } from "./flow-schema";
import {
VisualNode,
CustomNode,
Expand Down Expand Up @@ -38,3 +39,13 @@ export interface NodeLibraryGroup {
export interface NodeLibraryData {
groups: NodeLibraryGroup[];
}

export type ImportablesResult = {
importables: Record<string, NodesDefCollection>;
errors: { path: string; message: string }[];
};

export interface FlowJob {
flow: FlydeFlow;
id: string;
}
2 changes: 1 addition & 1 deletion dev-server/src/runner/runFlow.host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { fork } from "child_process";
import { join } from "path";
import { runFlow } from "./runFlow";
import { FlowJob } from "./shared";
import type { FlowJob } from "@flyde/core";
import { onMessage, sendMessage } from "./typedProcessMessage";

export function forkRunFlow(data: {
Expand Down
3 changes: 1 addition & 2 deletions dev-server/src/runner/runFlow.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { FlydeFlow } from "@flyde/core";
import { FlowJob } from "./shared";
import { FlowJob, FlydeFlow } from "@flyde/core";
import { createId } from "@paralleldrive/cuid2";
import { loadFlowFromContent } from "@flyde/runtime";

Expand Down
6 changes: 0 additions & 6 deletions dev-server/src/runner/shared.ts

This file was deleted.

6 changes: 1 addition & 5 deletions dev-server/src/service/scan-importable-nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
isBaseNode,
isMacroNode,
NodesDefCollection,
ImportablesResult,
} from "@flyde/core";
import { scanFolderStructure } from "./scan-folders-structure";
import { FlydeFile } from "../fs-helper/shared";
Expand All @@ -25,11 +26,6 @@ export interface CorruptScannedNode {
error: string;
}

export type ImportablesResult = {
importables: Record<string, NodesDefCollection>;
errors: { path: string; message: string }[];
};

export async function scanImportableNodes(
rootPath: string,
filename: string
Expand Down
1 change: 0 additions & 1 deletion flow-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"@blueprintjs/icons": "^5.1.5",
"@blueprintjs/select": "^5.0.1",
"@flyde/core": "workspace:*",
"@flyde/dev-server": "workspace:*",
"@flyde/remote-debugger": "workspace:*",
"@fortawesome/fontawesome-svg-core": "^6.4.2",
"@fortawesome/free-brands-svg-icons": "^6.4.2",
Expand Down
10 changes: 2 additions & 8 deletions flow-editor/src/flow-editor/DependenciesContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,10 @@ import {
ImportableSource,
Pos,
NodeLibraryData,
ImportablesResult,
} from "@flyde/core";
import type { ImportablesResult } from "@flyde/dev-server";
import { createContext, useContext } from "react";

// TODO - merge this interface with the one from the dev-server
export interface LocalImportableResult {
importables: ImportableSource[];
errors: ImportablesResult["errors"];
}

export interface DependenciesContextData {
resolvedDependencies: ResolvedDependenciesDefinitions;
onImportNode: (
Expand All @@ -23,7 +17,7 @@ export interface DependenciesContextData {
connectTo?: { insId: string; outputId: string };
}
) => Promise<ResolvedDependenciesDefinitions>;
onRequestImportables: () => Promise<LocalImportableResult>;
onRequestImportables: () => Promise<ImportablesResult>;
libraryData: NodeLibraryData;
}

Expand Down
3 changes: 2 additions & 1 deletion flow-editor/src/flow-editor/ports/ports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import {
NodeLibraryData,
ResolvedDependenciesDefinitions,
noop,
FlowJob,
ImportablesResult,
} from "@flyde/core";
import { FlowJob, ImportablesResult } from "@flyde/dev-server";
import { ReportEvent } from "./analytics";
import { toastMsg } from "../../toaster";

Expand Down

0 comments on commit 6cf8201

Please sign in to comment.