Skip to content

Commit

Permalink
Fix build issue
Browse files Browse the repository at this point in the history
Use 8788 as api port
  • Loading branch information
hatchan committed Sep 27, 2024
1 parent c709a77 commit 9e6e0bc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion fpx.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
listen_port = 9898
listen_port = 8788
7 changes: 3 additions & 4 deletions packages/types/src/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const AppStateSchema = z.object({

export type AppState = z.infer<typeof AppStateSchema>;

export const OpenWorkspaceByPathErrorSchema = z.any().superRefine((x, ctx) => {
export const OpenWorkspaceErrorSchema = z.any().superRefine((x, ctx) => {
const schemas = [
z.object({ path: z.string(), type: z.literal("ConfigFileMissing") }),
z.object({ message: z.string(), type: z.literal("InvalidConfiguration") }),
Expand All @@ -106,9 +106,7 @@ export const OpenWorkspaceByPathErrorSchema = z.any().superRefine((x, ctx) => {
}
});

export type OpenWorkspaceByPathError = z.infer<
typeof OpenWorkspaceByPathErrorSchema
>;
export type OpenWorkspaceError = z.infer<typeof OpenWorkspaceErrorSchema>;

export const WorkspaceSchema = z.object({ config: z.any(), path: z.string() });

Expand All @@ -132,6 +130,7 @@ export type FpxConfig = z.infer<typeof FpxConfigSchema>;

export const FpxConfigErrorSchema = z.any().superRefine((x, ctx) => {
const schemas = [
z.literal("RootDirectoryNotFound"),
z.object({ FileNotFound: z.string() }).strict(),
z
.object({
Expand Down
8 changes: 4 additions & 4 deletions studio/src/tauri/RuntimeProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
type AppState,
type OpenWorkspaceByPathError,
OpenWorkspaceByPathErrorSchema,
type OpenWorkspaceError,
OpenWorkspaceErrorSchema,
type Workspace,
} from "@fiberplane/fpx-types";
import { useHandler } from "@fiberplane/hooks";
Expand Down Expand Up @@ -45,7 +45,7 @@ export function RuntimeProvider({ children }: RuntimeProviderProps) {

function TauriRuntime({ children }: RuntimeProviderProps) {
const [workspace, setWorkspace] = useState<Workspace | undefined>();
const [error, setError] = useState<OpenWorkspaceByPathError | undefined>();
const [error, setError] = useState<OpenWorkspaceError | undefined>();

const handleOpenWorkspaceByPath = useHandler(async (path: string) => {
const workspace = await openWorkspace(path);
Expand All @@ -60,7 +60,7 @@ function TauriRuntime({ children }: RuntimeProviderProps) {
}
})
.catch((error) => {
const parsed = OpenWorkspaceByPathErrorSchema.safeParse(error);
const parsed = OpenWorkspaceErrorSchema.safeParse(error);
if (parsed.success) {
return setError(parsed.data);
}
Expand Down
4 changes: 2 additions & 2 deletions studio/src/tauri/WorkspaceOpenError/WorkspaceOpenError.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Button } from "@/components/ui/button";
import { Card } from "@/components/ui/card";
import type { OpenWorkspaceByPathError } from "@fiberplane/fpx-types";
import type { OpenWorkspaceError } from "@fiberplane/fpx-types";
import type { ReactNode } from "react";

type WorkspaceOpenErrorProps = {
error: OpenWorkspaceByPathError;
error: OpenWorkspaceError;
reset: () => void;
};

Expand Down

0 comments on commit 9e6e0bc

Please sign in to comment.