@shipfox/client-projects 4.0.0 → 6.0.1
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 +78 -0
- package/dist/chrome.d.ts.map +1 -1
- package/dist/chrome.js +7 -10
- package/dist/chrome.js.map +1 -1
- package/dist/components/model-provider-reminder-banner.d.ts.map +1 -1
- package/dist/components/model-provider-reminder-banner.js +1 -1
- package/dist/components/model-provider-reminder-banner.js.map +1 -1
- package/dist/components/source-strip.d.ts +2 -2
- package/dist/components/source-strip.d.ts.map +1 -1
- package/dist/components/source-strip.js +2 -2
- package/dist/components/source-strip.js.map +1 -1
- package/dist/core/definition.d.ts +32 -0
- package/dist/core/definition.d.ts.map +1 -0
- package/dist/core/definition.js +3 -0
- package/dist/core/definition.js.map +1 -0
- package/dist/core/project.d.ts +26 -0
- package/dist/core/project.d.ts.map +1 -0
- package/dist/core/project.js +12 -0
- package/dist/core/project.js.map +1 -0
- package/dist/feature.d.ts +8 -10
- package/dist/feature.d.ts.map +1 -1
- package/dist/feature.js +11 -22
- package/dist/feature.js.map +1 -1
- package/dist/hooks/api/definitions.d.ts +12 -88
- package/dist/hooks/api/definitions.d.ts.map +1 -1
- package/dist/hooks/api/definitions.js +18 -10
- package/dist/hooks/api/definitions.js.map +1 -1
- package/dist/hooks/api/mappers.d.ts +17 -0
- package/dist/hooks/api/mappers.d.ts.map +1 -0
- package/dist/hooks/api/mappers.js +56 -0
- package/dist/hooks/api/mappers.js.map +1 -0
- package/dist/hooks/api/projects.d.ts +19 -81
- package/dist/hooks/api/projects.d.ts.map +1 -1
- package/dist/hooks/api/projects.js +72 -18
- package/dist/hooks/api/projects.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/pages/create-project-page.d.ts.map +1 -1
- package/dist/pages/create-project-page.js +12 -37
- package/dist/pages/create-project-page.js.map +1 -1
- package/dist/pages/create-project-page.stories.d.ts.map +1 -1
- package/dist/pages/create-project-page.stories.js +4 -5
- package/dist/pages/create-project-page.stories.js.map +1 -1
- package/dist/pages/home-router.d.ts +4 -1
- package/dist/pages/home-router.d.ts.map +1 -1
- package/dist/pages/home-router.js +4 -2
- package/dist/pages/home-router.js.map +1 -1
- package/dist/pages/projects-hub-page.d.ts +3 -1
- package/dist/pages/projects-hub-page.d.ts.map +1 -1
- package/dist/pages/projects-hub-page.js +26 -30
- package/dist/pages/projects-hub-page.js.map +1 -1
- package/dist/routes/home.d.ts +3 -2
- package/dist/routes/home.d.ts.map +1 -1
- package/dist/routes/home.js +7 -2
- package/dist/routes/home.js.map +1 -1
- package/dist/routes/inputs.d.ts +6 -0
- package/dist/routes/inputs.d.ts.map +1 -0
- package/dist/routes/inputs.js +14 -0
- package/dist/routes/inputs.js.map +1 -0
- package/dist/routes/search.d.ts +5 -0
- package/dist/routes/search.d.ts.map +1 -0
- package/dist/routes/search.js +8 -0
- package/dist/routes/search.js.map +1 -0
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +14 -17
- package/src/chrome.tsx +11 -6
- package/src/components/model-provider-reminder-banner.tsx +1 -3
- package/src/components/project-switcher.test.tsx +2 -1
- package/src/components/source-strip.tsx +5 -5
- package/src/core/definition.ts +31 -0
- package/src/core/project.ts +47 -0
- package/src/feature.ts +13 -23
- package/src/hooks/api/definitions.ts +54 -19
- package/src/hooks/api/mappers.ts +67 -0
- package/src/hooks/api/projects.test.ts +11 -4
- package/src/hooks/api/projects.ts +125 -28
- package/src/index.ts +10 -6
- package/src/pages/create-project-page.stories.tsx +7 -5
- package/src/pages/create-project-page.test.tsx +3 -1
- package/src/pages/create-project-page.tsx +16 -51
- package/src/pages/home-router.tsx +3 -2
- package/src/pages/projects-hub-page.test.tsx +13 -8
- package/src/pages/projects-hub-page.tsx +24 -34
- package/src/routes/home.tsx +6 -2
- package/src/routes/inputs.test.ts +14 -0
- package/src/routes/inputs.ts +15 -0
- package/src/routes/search.ts +8 -0
- 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
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ProjectRouteParams {
|
|
2
|
+
wid: string;
|
|
3
|
+
pid: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export function projectRouteParams(input: Record<string, unknown>): ProjectRouteParams {
|
|
7
|
+
const wid = stringParam(input.wid);
|
|
8
|
+
const pid = stringParam(input.pid);
|
|
9
|
+
if (!wid || !pid) throw new Error('Project route is missing required path parameters.');
|
|
10
|
+
return {wid, pid};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function stringParam(value: unknown): string | undefined {
|
|
14
|
+
return typeof value === 'string' && value.length > 0 ? value : undefined;
|
|
15
|
+
}
|
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
|
|