remove projects and apps end to end
deletes the last of the projects/apps cluster: the published-app store (/api/apps + /api/app-serve), the project dev-server and its websocket proxy (/api/dev-server + /api/dev-server-proxy), the shared html-rewrite they were the only consumers of, and their frontend — the Preview panel, the UserApp panel/header, useUserApps and the /settings/apps screen. also drops getUserProjectsDir and getUserAppsDir, the ProjectType and ProjectDefinition types, and the 'dev-server' websocket provider from server.tsx. nothing on disk is touched. 1440 deletions, 31 insertions. tsgo clean.
This commit is contained in:
@@ -11,7 +11,5 @@ export { useRecentModels } from './useRecentModels';
|
||||
export { usePlans } from './usePlans';
|
||||
export { useLandingPage } from './useLandingPage';
|
||||
export { useServerSettings } from './useServerSettings';
|
||||
export { useUserApps } from './useUserApps';
|
||||
export type { AppManifest } from './useUserApps';
|
||||
export { useServerEnvironment } from './useServerEnvironment';
|
||||
export type { ServerEnvironment } from './useServerEnvironment';
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
import { useAuth } from 'hooks/useAuth';
|
||||
import { useClient } from 'hooks/useClient';
|
||||
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
|
||||
export type AppManifest = {
|
||||
slug: string;
|
||||
name: string;
|
||||
version: string;
|
||||
icon: string;
|
||||
description: string;
|
||||
sourceProject: string;
|
||||
commitHash: string;
|
||||
publishedAt: string;
|
||||
buildDir: string;
|
||||
};
|
||||
|
||||
const QUERY_KEY = ['USER_APPS'] as const;
|
||||
|
||||
export function useUserApps() {
|
||||
const client = useClient();
|
||||
const queryClient = useQueryClient();
|
||||
const { user, isAuthenticated } = useAuth();
|
||||
|
||||
const { data: apps = [], isLoading } = useQuery<AppManifest[]>({
|
||||
queryKey: QUERY_KEY,
|
||||
enabled: isAuthenticated,
|
||||
queryFn: () => client.get<{ apps: AppManifest[] }>('/apps').then((r) => r.apps),
|
||||
staleTime: 30_000,
|
||||
});
|
||||
|
||||
const refetch = () => queryClient.invalidateQueries({ queryKey: QUERY_KEY });
|
||||
|
||||
return { apps, isLoading, refetch, email: user?.email ?? '' };
|
||||
}
|
||||
Reference in New Issue
Block a user