@shipfox/client-projects 3.0.1 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +39 -0
- package/dist/components/model-provider-reminder-banner.d.ts.map +1 -1
- package/dist/components/model-provider-reminder-banner.js +11 -15
- package/dist/components/model-provider-reminder-banner.js.map +1 -1
- package/dist/feature.d.ts +0 -10
- package/dist/feature.d.ts.map +1 -1
- package/dist/feature.js +0 -12
- package/dist/feature.js.map +1 -1
- package/dist/hooks/api/projects.d.ts +5 -1
- package/dist/hooks/api/projects.d.ts.map +1 -1
- package/dist/hooks/api/projects.js +12 -1
- package/dist/hooks/api/projects.js.map +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/pages/create-project-page.stories.d.ts.map +1 -1
- package/dist/pages/create-project-page.stories.js +1 -4
- package/dist/pages/create-project-page.stories.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +9 -43
- package/src/components/model-provider-reminder-banner.tsx +11 -18
- package/src/feature.ts +0 -12
- package/src/hooks/api/projects.ts +23 -1
- package/src/index.ts +1 -6
- package/src/pages/create-project-page.stories.tsx +1 -4
- package/test/pages.tsx +2 -17
- package/tsconfig.build.tsbuildinfo +1 -1
- package/dist/components/workspace-setup-guard.d.ts +0 -9
- package/dist/components/workspace-setup-guard.d.ts.map +0 -1
- package/dist/components/workspace-setup-guard.js +0 -160
- package/dist/components/workspace-setup-guard.js.map +0 -1
- package/dist/pages/project-workflows-page.d.ts +0 -4
- package/dist/pages/project-workflows-page.d.ts.map +0 -1
- package/dist/pages/project-workflows-page.js +0 -481
- package/dist/pages/project-workflows-page.js.map +0 -1
- package/dist/routes/workflows.d.ts +0 -5
- package/dist/routes/workflows.d.ts.map +0 -1
- package/dist/routes/workflows.js +0 -16
- package/dist/routes/workflows.js.map +0 -1
- package/src/components/workspace-setup-guard.test.tsx +0 -534
- package/src/components/workspace-setup-guard.tsx +0 -185
- package/src/pages/project-workflows-page.test.tsx +0 -258
- package/src/pages/project-workflows-page.tsx +0 -445
- package/src/routes/workflows.tsx +0 -10
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipfox/client-projects",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "5.0.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/ShipfoxHQ/shipfox.git",
|
|
@@ -32,16 +32,14 @@
|
|
|
32
32
|
"@swc/helpers": "^0.5.17",
|
|
33
33
|
"@tanstack/react-form": "^1.32.0",
|
|
34
34
|
"@shipfox/api-definitions-dto": "6.0.0",
|
|
35
|
-
"@shipfox/api-integration-core-dto": "
|
|
36
|
-
"@shipfox/api-projects-dto": "
|
|
37
|
-
"@shipfox/
|
|
38
|
-
"@shipfox/client-
|
|
39
|
-
"@shipfox/client-
|
|
40
|
-
"@shipfox/client-
|
|
41
|
-
"@shipfox/client-
|
|
42
|
-
"@shipfox/client-
|
|
43
|
-
"@shipfox/client-workflows": "3.0.1",
|
|
44
|
-
"@shipfox/client-ui": "3.0.1",
|
|
35
|
+
"@shipfox/api-integration-core-dto": "8.0.0",
|
|
36
|
+
"@shipfox/api-projects-dto": "8.0.0",
|
|
37
|
+
"@shipfox/client-agent": "5.0.0",
|
|
38
|
+
"@shipfox/client-api": "4.0.0",
|
|
39
|
+
"@shipfox/client-auth": "5.0.0",
|
|
40
|
+
"@shipfox/client-integrations": "5.0.0",
|
|
41
|
+
"@shipfox/client-shell": "5.0.0",
|
|
42
|
+
"@shipfox/client-ui": "4.0.0",
|
|
45
43
|
"@shipfox/react-ui": "0.3.5"
|
|
46
44
|
},
|
|
47
45
|
"peerDependencies": {
|
|
@@ -51,38 +49,6 @@
|
|
|
51
49
|
"react": "^19.0.0",
|
|
52
50
|
"react-dom": "^19.0.0"
|
|
53
51
|
},
|
|
54
|
-
"devDependencies": {
|
|
55
|
-
"@argos-ci/cli": "^5.0.0",
|
|
56
|
-
"@argos-ci/storybook": "^6.0.0",
|
|
57
|
-
"@storybook/addon-vitest": "^10.3.6",
|
|
58
|
-
"@storybook/react": "^10.0.0",
|
|
59
|
-
"@storybook/react-vite": "^10.0.0",
|
|
60
|
-
"@tailwindcss/vite": "^4.1.13",
|
|
61
|
-
"@tanstack/react-query": "^5.101.0",
|
|
62
|
-
"@tanstack/react-router": "^1.170.16",
|
|
63
|
-
"@testing-library/jest-dom": "^6.6.3",
|
|
64
|
-
"@testing-library/react": "^16.3.2",
|
|
65
|
-
"@testing-library/user-event": "^14.6.1",
|
|
66
|
-
"@types/react": "^19.1.11",
|
|
67
|
-
"@types/react-dom": "^19.1.7",
|
|
68
|
-
"@vitejs/plugin-react": "^6.0.0",
|
|
69
|
-
"@vitest/browser-playwright": "^4.1.5",
|
|
70
|
-
"jotai": "^2.19.1",
|
|
71
|
-
"jsdom": "^29.0.0",
|
|
72
|
-
"react": "^19.1.1",
|
|
73
|
-
"react-dom": "^19.1.1",
|
|
74
|
-
"storybook": "^10.0.0",
|
|
75
|
-
"storybook-addon-pseudo-states": "^10.0.0",
|
|
76
|
-
"tailwindcss": "^4.1.13",
|
|
77
|
-
"vite": "^8.0.3",
|
|
78
|
-
"vitest": "^4.1.5",
|
|
79
|
-
"@shipfox/biome": "1.8.2",
|
|
80
|
-
"@shipfox/client-test-setup": "0.0.3",
|
|
81
|
-
"@shipfox/swc": "1.2.6",
|
|
82
|
-
"@shipfox/ts-config": "1.3.8",
|
|
83
|
-
"@shipfox/typescript": "1.1.7",
|
|
84
|
-
"@shipfox/vitest": "1.2.3"
|
|
85
|
-
},
|
|
86
52
|
"scripts": {
|
|
87
53
|
"build": "shipfox-swc",
|
|
88
54
|
"check": "shipfox-biome-check",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {useModelProviderConfigsQuery} from '@shipfox/client-agent';
|
|
2
|
+
import {createTypedBrowserStorage, sessionStorageOrUndefined} from '@shipfox/client-ui';
|
|
2
3
|
import {
|
|
3
4
|
Alert,
|
|
4
5
|
AlertActions,
|
|
@@ -11,8 +12,6 @@ import {Button} from '@shipfox/react-ui/button';
|
|
|
11
12
|
import {Link} from '@tanstack/react-router';
|
|
12
13
|
import {useState} from 'react';
|
|
13
14
|
|
|
14
|
-
const REMINDER_SESSION_KEY_PREFIX = 'shipfox.modelProviderReminder.dismissed.';
|
|
15
|
-
|
|
16
15
|
export function ModelProviderReminderBanner({workspaceId}: {workspaceId: string}) {
|
|
17
16
|
const configsQuery = useModelProviderConfigsQuery(workspaceId);
|
|
18
17
|
const [dismissed, setDismissed] = useState(() => isReminderDismissed(workspaceId));
|
|
@@ -54,25 +53,19 @@ export function ModelProviderReminderBanner({workspaceId}: {workspaceId: string}
|
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
function isReminderDismissed(workspaceId: string): boolean {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
try {
|
|
60
|
-
return window.sessionStorage.getItem(sessionKey(workspaceId)) === 'true';
|
|
61
|
-
} catch {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
56
|
+
return reminderStorage(workspaceId).read() === true;
|
|
64
57
|
}
|
|
65
58
|
|
|
66
59
|
function dismissReminder(workspaceId: string): void {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
try {
|
|
70
|
-
window.sessionStorage.setItem(sessionKey(workspaceId), 'true');
|
|
71
|
-
} catch {
|
|
72
|
-
// Session persistence is best-effort; showing the banner again is benign.
|
|
73
|
-
}
|
|
60
|
+
reminderStorage(workspaceId).write(true);
|
|
74
61
|
}
|
|
75
62
|
|
|
76
|
-
function
|
|
77
|
-
return
|
|
63
|
+
function reminderStorage(workspaceId: string) {
|
|
64
|
+
return createTypedBrowserStorage(sessionStorageOrUndefined, {
|
|
65
|
+
key: `shipfox.modelProviderReminder.dismissed.${workspaceId}`,
|
|
66
|
+
lifetime: 'session' as const,
|
|
67
|
+
principalScope: 'workspace' as const,
|
|
68
|
+
serialize: (dismissed: boolean) => JSON.stringify(dismissed),
|
|
69
|
+
parse: (raw: string) => raw === 'true',
|
|
70
|
+
});
|
|
78
71
|
}
|
package/src/feature.ts
CHANGED
|
@@ -18,11 +18,6 @@ export const projectsFeature = defineClientFeature({
|
|
|
18
18
|
parent: 'projectLayout',
|
|
19
19
|
impl: '@shipfox/client-projects/routes/project-index',
|
|
20
20
|
},
|
|
21
|
-
{
|
|
22
|
-
path: '/workspaces/$wid/projects/$pid/workflows',
|
|
23
|
-
parent: 'projectLayout',
|
|
24
|
-
impl: '@shipfox/client-projects/routes/workflows',
|
|
25
|
-
},
|
|
26
21
|
],
|
|
27
22
|
navigation: [
|
|
28
23
|
{
|
|
@@ -33,12 +28,5 @@ export const projectsFeature = defineClientFeature({
|
|
|
33
28
|
exact: true,
|
|
34
29
|
order: 100,
|
|
35
30
|
},
|
|
36
|
-
{
|
|
37
|
-
id: 'nav.workflows',
|
|
38
|
-
scope: 'project',
|
|
39
|
-
label: 'Workflows',
|
|
40
|
-
to: '/workspaces/$wid/projects/$pid/workflows',
|
|
41
|
-
order: 200,
|
|
42
|
-
},
|
|
43
31
|
],
|
|
44
32
|
});
|
|
@@ -4,7 +4,14 @@ import type {
|
|
|
4
4
|
ProjectResponseDto,
|
|
5
5
|
} from '@shipfox/api-projects-dto';
|
|
6
6
|
import {apiRequest} from '@shipfox/client-api';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
type FetchQueryOptions,
|
|
9
|
+
keepPreviousData,
|
|
10
|
+
queryOptions,
|
|
11
|
+
useInfiniteQuery,
|
|
12
|
+
useMutation,
|
|
13
|
+
useQuery,
|
|
14
|
+
} from '@tanstack/react-query';
|
|
8
15
|
|
|
9
16
|
export const projectsQueryKeys = {
|
|
10
17
|
all: ['projects'] as const,
|
|
@@ -14,6 +21,13 @@ export const projectsQueryKeys = {
|
|
|
14
21
|
detail: (projectId: string) => [...projectsQueryKeys.all, 'detail', projectId] as const,
|
|
15
22
|
};
|
|
16
23
|
|
|
24
|
+
type ProjectExistenceQueryOptions = FetchQueryOptions<
|
|
25
|
+
ListProjectsResponseDto,
|
|
26
|
+
Error,
|
|
27
|
+
ListProjectsResponseDto,
|
|
28
|
+
ReturnType<typeof projectsQueryKeys.exists>
|
|
29
|
+
>;
|
|
30
|
+
|
|
17
31
|
export async function listProjects({
|
|
18
32
|
workspaceId,
|
|
19
33
|
limit = 50,
|
|
@@ -42,6 +56,14 @@ export async function createProject(body: CreateProjectBodyDto) {
|
|
|
42
56
|
return await apiRequest<ProjectResponseDto>('/projects', {method: 'POST', body});
|
|
43
57
|
}
|
|
44
58
|
|
|
59
|
+
export function projectExistenceQueryOptions(workspaceId: string): ProjectExistenceQueryOptions {
|
|
60
|
+
return queryOptions({
|
|
61
|
+
queryKey: projectsQueryKeys.exists(workspaceId),
|
|
62
|
+
queryFn: ({signal}) => listProjects({workspaceId, limit: 1, signal}),
|
|
63
|
+
staleTime: 30_000,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
45
67
|
export function useProjectsInfiniteQuery(
|
|
46
68
|
workspaceId: string | undefined,
|
|
47
69
|
search?: string,
|
package/src/index.ts
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
export type {WorkspaceSetupState} from '@shipfox/client-shell/runtime';
|
|
2
1
|
export {ProjectBreadcrumb, ProjectLayoutGuard} from './chrome.js';
|
|
3
2
|
export {ProjectCrumb, type ProjectCrumbProps} from './components/project-crumb.js';
|
|
4
3
|
export {ProjectSwitcher, type ProjectSwitcherProps} from './components/project-switcher.js';
|
|
5
|
-
export {
|
|
6
|
-
loadWorkspaceSetupRoute,
|
|
7
|
-
type WorkspaceSetupRouteOptions,
|
|
8
|
-
} from './components/workspace-setup-guard.js';
|
|
4
|
+
export {SourceStrip} from './components/source-strip.js';
|
|
9
5
|
export * from './hooks/api/definitions.js';
|
|
10
6
|
export * from './hooks/api/projects.js';
|
|
11
7
|
export * from './pages/create-project-page.js';
|
|
12
8
|
export * from './pages/home-router.js';
|
|
13
|
-
export * from './pages/project-workflows-page.js';
|
|
14
9
|
export * from './pages/projects-hub-page.js';
|
|
15
10
|
export * from './project-error.js';
|
|
@@ -39,10 +39,7 @@ const authState: AuthState = {
|
|
|
39
39
|
id: '22222222-2222-4222-8222-222222222222',
|
|
40
40
|
email: 'platform@example.com',
|
|
41
41
|
name: 'Platform Engineer',
|
|
42
|
-
|
|
43
|
-
status: 'active',
|
|
44
|
-
created_at: '2026-01-01T00:00:00.000Z',
|
|
45
|
-
updated_at: '2026-01-01T00:00:00.000Z',
|
|
42
|
+
emailVerifiedAt: '2026-01-01T00:00:00.000Z',
|
|
46
43
|
},
|
|
47
44
|
workspaces: [{id: WORKSPACE_ID, name: 'Acme', membershipId: 'membership-1'}],
|
|
48
45
|
};
|
package/test/pages.tsx
CHANGED
|
@@ -15,7 +15,6 @@ import {type RenderResult, render} from '@testing-library/react';
|
|
|
15
15
|
import {createStore, Provider as JotaiProvider} from 'jotai';
|
|
16
16
|
import type {ReactElement} from 'react';
|
|
17
17
|
import {CreateProjectPage} from '#pages/create-project-page.js';
|
|
18
|
-
import {ProjectWorkflowsPage} from '#pages/project-workflows-page.js';
|
|
19
18
|
import {ProjectsHubPage} from '#pages/projects-hub-page.js';
|
|
20
19
|
|
|
21
20
|
// All test renders that exercise pages requiring `useActiveWorkspace()` mount
|
|
@@ -29,11 +28,7 @@ const authState: AuthState = {
|
|
|
29
28
|
user: {
|
|
30
29
|
id: '22222222-2222-4222-8222-222222222222',
|
|
31
30
|
email: 'user@example.com',
|
|
32
|
-
|
|
33
|
-
email_verified_at: new Date().toISOString(),
|
|
34
|
-
status: 'active',
|
|
35
|
-
created_at: new Date().toISOString(),
|
|
36
|
-
updated_at: new Date().toISOString(),
|
|
31
|
+
emailVerifiedAt: new Date().toISOString(),
|
|
37
32
|
},
|
|
38
33
|
workspaces: [{id: PROJECT_TEST_WID, name: 'Acme', membershipId: 'm-1'}],
|
|
39
34
|
};
|
|
@@ -46,16 +41,6 @@ export function jsonResponse(body: unknown, init: ResponseInit = {}) {
|
|
|
46
41
|
});
|
|
47
42
|
}
|
|
48
43
|
|
|
49
|
-
// The param-carrying routes below declare `$pid`/`$runId` in their path, so the value is
|
|
50
|
-
// always present when their fallback page renders. A missing param means the harness
|
|
51
|
-
// wired a route wrong — fail loudly instead of rendering a page with a fabricated id.
|
|
52
|
-
function requireParam(value: string | undefined, name: string): string {
|
|
53
|
-
if (value === undefined) {
|
|
54
|
-
throw new Error(`Test router: route param "${name}" is missing`);
|
|
55
|
-
}
|
|
56
|
-
return value;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
44
|
function createTestRouter(path: string, element: ReactElement) {
|
|
60
45
|
const initialPath = path.split('?')[0] ?? path;
|
|
61
46
|
const rootRoute = createRootRoute({component: Outlet});
|
|
@@ -114,7 +99,7 @@ function createTestRouter(path: string, element: ReactElement) {
|
|
|
114
99
|
return element;
|
|
115
100
|
}
|
|
116
101
|
|
|
117
|
-
return <
|
|
102
|
+
return <h1>Workflows</h1>;
|
|
118
103
|
},
|
|
119
104
|
});
|
|
120
105
|
|