@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.
Files changed (109) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +78 -0
  3. package/dist/chrome.d.ts.map +1 -1
  4. package/dist/chrome.js +7 -10
  5. package/dist/chrome.js.map +1 -1
  6. package/dist/components/model-provider-reminder-banner.d.ts.map +1 -1
  7. package/dist/components/model-provider-reminder-banner.js +1 -1
  8. package/dist/components/model-provider-reminder-banner.js.map +1 -1
  9. package/dist/components/source-strip.d.ts +2 -2
  10. package/dist/components/source-strip.d.ts.map +1 -1
  11. package/dist/components/source-strip.js +2 -2
  12. package/dist/components/source-strip.js.map +1 -1
  13. package/dist/core/definition.d.ts +32 -0
  14. package/dist/core/definition.d.ts.map +1 -0
  15. package/dist/core/definition.js +3 -0
  16. package/dist/core/definition.js.map +1 -0
  17. package/dist/core/project.d.ts +26 -0
  18. package/dist/core/project.d.ts.map +1 -0
  19. package/dist/core/project.js +12 -0
  20. package/dist/core/project.js.map +1 -0
  21. package/dist/feature.d.ts +8 -10
  22. package/dist/feature.d.ts.map +1 -1
  23. package/dist/feature.js +11 -22
  24. package/dist/feature.js.map +1 -1
  25. package/dist/hooks/api/definitions.d.ts +12 -88
  26. package/dist/hooks/api/definitions.d.ts.map +1 -1
  27. package/dist/hooks/api/definitions.js +18 -10
  28. package/dist/hooks/api/definitions.js.map +1 -1
  29. package/dist/hooks/api/mappers.d.ts +17 -0
  30. package/dist/hooks/api/mappers.d.ts.map +1 -0
  31. package/dist/hooks/api/mappers.js +56 -0
  32. package/dist/hooks/api/mappers.js.map +1 -0
  33. package/dist/hooks/api/projects.d.ts +19 -81
  34. package/dist/hooks/api/projects.d.ts.map +1 -1
  35. package/dist/hooks/api/projects.js +72 -18
  36. package/dist/hooks/api/projects.js.map +1 -1
  37. package/dist/index.d.ts +3 -3
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +2 -2
  40. package/dist/index.js.map +1 -1
  41. package/dist/pages/create-project-page.d.ts.map +1 -1
  42. package/dist/pages/create-project-page.js +12 -37
  43. package/dist/pages/create-project-page.js.map +1 -1
  44. package/dist/pages/create-project-page.stories.d.ts.map +1 -1
  45. package/dist/pages/create-project-page.stories.js +4 -5
  46. package/dist/pages/create-project-page.stories.js.map +1 -1
  47. package/dist/pages/home-router.d.ts +4 -1
  48. package/dist/pages/home-router.d.ts.map +1 -1
  49. package/dist/pages/home-router.js +4 -2
  50. package/dist/pages/home-router.js.map +1 -1
  51. package/dist/pages/projects-hub-page.d.ts +3 -1
  52. package/dist/pages/projects-hub-page.d.ts.map +1 -1
  53. package/dist/pages/projects-hub-page.js +26 -30
  54. package/dist/pages/projects-hub-page.js.map +1 -1
  55. package/dist/routes/home.d.ts +3 -2
  56. package/dist/routes/home.d.ts.map +1 -1
  57. package/dist/routes/home.js +7 -2
  58. package/dist/routes/home.js.map +1 -1
  59. package/dist/routes/inputs.d.ts +6 -0
  60. package/dist/routes/inputs.d.ts.map +1 -0
  61. package/dist/routes/inputs.js +14 -0
  62. package/dist/routes/inputs.js.map +1 -0
  63. package/dist/routes/search.d.ts +5 -0
  64. package/dist/routes/search.d.ts.map +1 -0
  65. package/dist/routes/search.js +8 -0
  66. package/dist/routes/search.js.map +1 -0
  67. package/dist/tsconfig.test.tsbuildinfo +1 -1
  68. package/package.json +14 -17
  69. package/src/chrome.tsx +11 -6
  70. package/src/components/model-provider-reminder-banner.tsx +1 -3
  71. package/src/components/project-switcher.test.tsx +2 -1
  72. package/src/components/source-strip.tsx +5 -5
  73. package/src/core/definition.ts +31 -0
  74. package/src/core/project.ts +47 -0
  75. package/src/feature.ts +13 -23
  76. package/src/hooks/api/definitions.ts +54 -19
  77. package/src/hooks/api/mappers.ts +67 -0
  78. package/src/hooks/api/projects.test.ts +11 -4
  79. package/src/hooks/api/projects.ts +125 -28
  80. package/src/index.ts +10 -6
  81. package/src/pages/create-project-page.stories.tsx +7 -5
  82. package/src/pages/create-project-page.test.tsx +3 -1
  83. package/src/pages/create-project-page.tsx +16 -51
  84. package/src/pages/home-router.tsx +3 -2
  85. package/src/pages/projects-hub-page.test.tsx +13 -8
  86. package/src/pages/projects-hub-page.tsx +24 -34
  87. package/src/routes/home.tsx +6 -2
  88. package/src/routes/inputs.test.ts +14 -0
  89. package/src/routes/inputs.ts +15 -0
  90. package/src/routes/search.ts +8 -0
  91. package/test/pages.tsx +2 -17
  92. package/tsconfig.build.tsbuildinfo +1 -1
  93. package/dist/components/workspace-setup-guard.d.ts +0 -9
  94. package/dist/components/workspace-setup-guard.d.ts.map +0 -1
  95. package/dist/components/workspace-setup-guard.js +0 -160
  96. package/dist/components/workspace-setup-guard.js.map +0 -1
  97. package/dist/pages/project-workflows-page.d.ts +0 -4
  98. package/dist/pages/project-workflows-page.d.ts.map +0 -1
  99. package/dist/pages/project-workflows-page.js +0 -481
  100. package/dist/pages/project-workflows-page.js.map +0 -1
  101. package/dist/routes/workflows.d.ts +0 -5
  102. package/dist/routes/workflows.d.ts.map +0 -1
  103. package/dist/routes/workflows.js +0 -16
  104. package/dist/routes/workflows.js.map +0 -1
  105. package/src/components/workspace-setup-guard.test.tsx +0 -534
  106. package/src/components/workspace-setup-guard.tsx +0 -185
  107. package/src/pages/project-workflows-page.test.tsx +0 -258
  108. package/src/pages/project-workflows-page.tsx +0 -445
  109. 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
+ }
@@ -0,0 +1,8 @@
1
+ export interface ProjectsSearch {
2
+ search?: string;
3
+ }
4
+
5
+ export function validateProjectsSearch(input: Record<string, unknown>): ProjectsSearch {
6
+ const search = typeof input.search === 'string' ? input.search.trim() : '';
7
+ return search ? {search} : {};
8
+ }
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
- name: null,
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 <ProjectWorkflowsPage projectId={requireParam(params.pid, 'pid')} />;
102
+ return <h1>Workflows</h1>;
118
103
  },
119
104
  });
120
105