@shipfox/client-shell 0.2.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.
Files changed (252) hide show
  1. package/.turbo/turbo-build.log +2 -0
  2. package/.turbo/turbo-type$colon$emit.log +1 -0
  3. package/.turbo/turbo-type.log +1 -0
  4. package/CHANGELOG.md +26 -0
  5. package/LICENSE +21 -0
  6. package/dist/components/main-layout.d.ts +11 -0
  7. package/dist/components/main-layout.d.ts.map +1 -0
  8. package/dist/components/main-layout.js +39 -0
  9. package/dist/components/main-layout.js.map +1 -0
  10. package/dist/components/nav-bar.d.ts +4 -0
  11. package/dist/components/nav-bar.d.ts.map +1 -0
  12. package/dist/components/nav-bar.js +62 -0
  13. package/dist/components/nav-bar.js.map +1 -0
  14. package/dist/components/nav-tabs.d.ts +6 -0
  15. package/dist/components/nav-tabs.d.ts.map +1 -0
  16. package/dist/components/nav-tabs.js +38 -0
  17. package/dist/components/nav-tabs.js.map +1 -0
  18. package/dist/components/not-found-page.d.ts +2 -0
  19. package/dist/components/not-found-page.d.ts.map +1 -0
  20. package/dist/components/not-found-page.js +25 -0
  21. package/dist/components/not-found-page.js.map +1 -0
  22. package/dist/components/settings-nav.d.ts +5 -0
  23. package/dist/components/settings-nav.d.ts.map +1 -0
  24. package/dist/components/settings-nav.js +45 -0
  25. package/dist/components/settings-nav.js.map +1 -0
  26. package/dist/components/user-menu.d.ts +2 -0
  27. package/dist/components/user-menu.d.ts.map +1 -0
  28. package/dist/components/user-menu.js +76 -0
  29. package/dist/components/user-menu.js.map +1 -0
  30. package/dist/components/workspace-crumb.d.ts +7 -0
  31. package/dist/components/workspace-crumb.d.ts.map +1 -0
  32. package/dist/components/workspace-crumb.js +54 -0
  33. package/dist/components/workspace-crumb.js.map +1 -0
  34. package/dist/components/workspace-switcher.d.ts +5 -0
  35. package/dist/components/workspace-switcher.d.ts.map +1 -0
  36. package/dist/components/workspace-switcher.js +90 -0
  37. package/dist/components/workspace-switcher.js.map +1 -0
  38. package/dist/compose/compose-routes.d.ts +6 -0
  39. package/dist/compose/compose-routes.d.ts.map +1 -0
  40. package/dist/compose/compose-routes.js +53 -0
  41. package/dist/compose/compose-routes.js.map +1 -0
  42. package/dist/compose/errors.d.ts +26 -0
  43. package/dist/compose/errors.d.ts.map +1 -0
  44. package/dist/compose/errors.js +39 -0
  45. package/dist/compose/errors.js.map +1 -0
  46. package/dist/compose/merge-config.d.ts +4 -0
  47. package/dist/compose/merge-config.d.ts.map +1 -0
  48. package/dist/compose/merge-config.js +28 -0
  49. package/dist/compose/merge-config.js.map +1 -0
  50. package/dist/compose/normalize-route-path.d.ts +2 -0
  51. package/dist/compose/normalize-route-path.d.ts.map +1 -0
  52. package/dist/compose/normalize-route-path.js +7 -0
  53. package/dist/compose/normalize-route-path.js.map +1 -0
  54. package/dist/compose/validate-providers.d.ts +3 -0
  55. package/dist/compose/validate-providers.d.ts.map +1 -0
  56. package/dist/compose/validate-providers.js +32 -0
  57. package/dist/compose/validate-providers.js.map +1 -0
  58. package/dist/compose/validate-registries.d.ts +4 -0
  59. package/dist/compose/validate-registries.d.ts.map +1 -0
  60. package/dist/compose/validate-registries.js +50 -0
  61. package/dist/compose/validate-registries.js.map +1 -0
  62. package/dist/config/shell-config.d.ts +10 -0
  63. package/dist/config/shell-config.d.ts.map +1 -0
  64. package/dist/config/shell-config.js +12 -0
  65. package/dist/config/shell-config.js.map +1 -0
  66. package/dist/contract.d.ts +39 -0
  67. package/dist/contract.d.ts.map +1 -0
  68. package/dist/contract.js +5 -0
  69. package/dist/contract.js.map +1 -0
  70. package/dist/index.d.ts +2 -0
  71. package/dist/index.d.ts.map +1 -0
  72. package/dist/index.js +3 -0
  73. package/dist/index.js.map +1 -0
  74. package/dist/runtime/active-workspace.d.ts +4 -0
  75. package/dist/runtime/active-workspace.d.ts.map +1 -0
  76. package/dist/runtime/active-workspace.js +15 -0
  77. package/dist/runtime/active-workspace.js.map +1 -0
  78. package/dist/runtime/anchor-paths.d.ts +9 -0
  79. package/dist/runtime/anchor-paths.d.ts.map +1 -0
  80. package/dist/runtime/anchor-paths.js +18 -0
  81. package/dist/runtime/anchor-paths.js.map +1 -0
  82. package/dist/runtime/anchors.d.ts +19 -0
  83. package/dist/runtime/anchors.d.ts.map +1 -0
  84. package/dist/runtime/anchors.js +125 -0
  85. package/dist/runtime/anchors.js.map +1 -0
  86. package/dist/runtime/assemble-route-tree.d.ts +10 -0
  87. package/dist/runtime/assemble-route-tree.d.ts.map +1 -0
  88. package/dist/runtime/assemble-route-tree.js +30 -0
  89. package/dist/runtime/assemble-route-tree.js.map +1 -0
  90. package/dist/runtime/auth.d.ts +50 -0
  91. package/dist/runtime/auth.d.ts.map +1 -0
  92. package/dist/runtime/auth.js +194 -0
  93. package/dist/runtime/auth.js.map +1 -0
  94. package/dist/runtime/chrome-context.d.ts +10 -0
  95. package/dist/runtime/chrome-context.d.ts.map +1 -0
  96. package/dist/runtime/chrome-context.js +16 -0
  97. package/dist/runtime/chrome-context.js.map +1 -0
  98. package/dist/runtime/compose-client-app.d.ts +13 -0
  99. package/dist/runtime/compose-client-app.d.ts.map +1 -0
  100. package/dist/runtime/compose-client-app.js +93 -0
  101. package/dist/runtime/compose-client-app.js.map +1 -0
  102. package/dist/runtime/define-route.d.ts +19 -0
  103. package/dist/runtime/define-route.d.ts.map +1 -0
  104. package/dist/runtime/define-route.js +12 -0
  105. package/dist/runtime/define-route.js.map +1 -0
  106. package/dist/runtime/index.d.ts +20 -0
  107. package/dist/runtime/index.d.ts.map +1 -0
  108. package/dist/runtime/index.js +21 -0
  109. package/dist/runtime/index.js.map +1 -0
  110. package/dist/runtime/last-workspace.d.ts +4 -0
  111. package/dist/runtime/last-workspace.d.ts.map +1 -0
  112. package/dist/runtime/last-workspace.js +20 -0
  113. package/dist/runtime/last-workspace.js.map +1 -0
  114. package/dist/runtime/nav-order.d.ts +7 -0
  115. package/dist/runtime/nav-order.d.ts.map +1 -0
  116. package/dist/runtime/nav-order.js +8 -0
  117. package/dist/runtime/nav-order.js.map +1 -0
  118. package/dist/runtime/provider-stack.d.ts +14 -0
  119. package/dist/runtime/provider-stack.d.ts.map +1 -0
  120. package/dist/runtime/provider-stack.js +28 -0
  121. package/dist/runtime/provider-stack.js.map +1 -0
  122. package/dist/runtime/registries.d.ts +4 -0
  123. package/dist/runtime/registries.d.ts.map +1 -0
  124. package/dist/runtime/registries.js +23 -0
  125. package/dist/runtime/registries.js.map +1 -0
  126. package/dist/runtime/router-context.d.ts +9 -0
  127. package/dist/runtime/router-context.d.ts.map +1 -0
  128. package/dist/runtime/router-context.js +3 -0
  129. package/dist/runtime/router-context.js.map +1 -0
  130. package/dist/runtime/workspace-setup.d.ts +18 -0
  131. package/dist/runtime/workspace-setup.d.ts.map +1 -0
  132. package/dist/runtime/workspace-setup.js +64 -0
  133. package/dist/runtime/workspace-setup.js.map +1 -0
  134. package/dist/testing/index.d.ts +17 -0
  135. package/dist/testing/index.d.ts.map +1 -0
  136. package/dist/testing/index.js +35 -0
  137. package/dist/testing/index.js.map +1 -0
  138. package/dist/tsconfig.test.tsbuildinfo +1 -0
  139. package/dist/vite/evaluate-features.d.ts +8 -0
  140. package/dist/vite/evaluate-features.d.ts.map +1 -0
  141. package/dist/vite/evaluate-features.js +80 -0
  142. package/dist/vite/evaluate-features.js.map +1 -0
  143. package/dist/vite/generate.d.ts +9 -0
  144. package/dist/vite/generate.d.ts.map +1 -0
  145. package/dist/vite/generate.js +80 -0
  146. package/dist/vite/generate.js.map +1 -0
  147. package/dist/vite/index.d.ts +2 -0
  148. package/dist/vite/index.d.ts.map +1 -0
  149. package/dist/vite/index.js +3 -0
  150. package/dist/vite/index.js.map +1 -0
  151. package/dist/vite/plugin.d.ts +7 -0
  152. package/dist/vite/plugin.d.ts.map +1 -0
  153. package/dist/vite/plugin.js +77 -0
  154. package/dist/vite/plugin.js.map +1 -0
  155. package/package.json +113 -0
  156. package/src/components/main-layout.tsx +45 -0
  157. package/src/components/nav-bar.tsx +41 -0
  158. package/src/components/nav-tabs.test.tsx +60 -0
  159. package/src/components/nav-tabs.tsx +47 -0
  160. package/src/components/not-found-page.tsx +14 -0
  161. package/src/components/settings-nav.tsx +35 -0
  162. package/src/components/user-menu.tsx +59 -0
  163. package/src/components/workspace-crumb.tsx +43 -0
  164. package/src/components/workspace-switcher.tsx +75 -0
  165. package/src/compose/compose-routes.test.ts +112 -0
  166. package/src/compose/compose-routes.ts +60 -0
  167. package/src/compose/errors.ts +54 -0
  168. package/src/compose/merge-config.test.ts +26 -0
  169. package/src/compose/merge-config.ts +27 -0
  170. package/src/compose/normalize-route-path.ts +6 -0
  171. package/src/compose/validate-providers.test.ts +31 -0
  172. package/src/compose/validate-providers.ts +36 -0
  173. package/src/compose/validate-registries.test.ts +92 -0
  174. package/src/compose/validate-registries.ts +61 -0
  175. package/src/config/config-screen.test.tsx +37 -0
  176. package/src/config/shell-config.ts +10 -0
  177. package/src/contract.ts +47 -0
  178. package/src/index.ts +1 -0
  179. package/src/runtime/active-workspace.ts +13 -0
  180. package/src/runtime/anchor-paths.ts +18 -0
  181. package/src/runtime/anchors.tsx +106 -0
  182. package/src/runtime/assemble-route-tree.ts +42 -0
  183. package/src/runtime/auth.tsx +213 -0
  184. package/src/runtime/chrome-context.tsx +22 -0
  185. package/src/runtime/compose-client-app.tsx +122 -0
  186. package/src/runtime/define-route.test.ts +15 -0
  187. package/src/runtime/define-route.ts +33 -0
  188. package/src/runtime/index.ts +19 -0
  189. package/src/runtime/last-workspace.ts +22 -0
  190. package/src/runtime/nav-order.ts +1 -0
  191. package/src/runtime/provider-stack.tsx +39 -0
  192. package/src/runtime/providers.test.tsx +51 -0
  193. package/src/runtime/registries.test.tsx +100 -0
  194. package/src/runtime/registries.ts +42 -0
  195. package/src/runtime/router-context.ts +9 -0
  196. package/src/runtime/routes.test.tsx +48 -0
  197. package/src/runtime/workspace-setup.tsx +61 -0
  198. package/src/testing/index.test.tsx +57 -0
  199. package/src/testing/index.tsx +51 -0
  200. package/src/vite/evaluate-features.test.ts +34 -0
  201. package/src/vite/evaluate-features.ts +93 -0
  202. package/src/vite/generate.test.ts +22 -0
  203. package/src/vite/generate.ts +99 -0
  204. package/src/vite/generated-router.test.tsx +58 -0
  205. package/src/vite/index.ts +1 -0
  206. package/src/vite/plugin.test.ts +181 -0
  207. package/src/vite/plugin.ts +114 -0
  208. package/src/vite/validate.test.ts +166 -0
  209. package/test/default-route-impl.tsx +3 -0
  210. package/test/external/FINDINGS.md +53 -0
  211. package/test/external/README.md +39 -0
  212. package/test/external/fixture/index.html +12 -0
  213. package/test/external/fixture/package.json +32 -0
  214. package/test/external/fixture/src/app.fixture.tsx +72 -0
  215. package/test/external/fixture/src/features/override-impl.tsx +12 -0
  216. package/test/external/fixture/src/features/override.tsx +20 -0
  217. package/test/external/fixture/src/features.collision.ts +15 -0
  218. package/test/external/fixture/src/features.ts +4 -0
  219. package/test/external/fixture/src/link-typecheck.tsx +10 -0
  220. package/test/external/fixture/src/main.tsx +4 -0
  221. package/test/external/fixture/tsconfig.json +15 -0
  222. package/test/external/fixture/vite.config.ts +10 -0
  223. package/test/external/fixture/vitest.config.ts +15 -0
  224. package/test/external/toy-feature/CHANGELOG.md +15 -0
  225. package/test/external/toy-feature/node_modules/.bin/shipfox-biome-check +43 -0
  226. package/test/external/toy-feature/node_modules/.bin/shipfox-biome-format +43 -0
  227. package/test/external/toy-feature/node_modules/.bin/shipfox-biome-lint +43 -0
  228. package/test/external/toy-feature/node_modules/.bin/shipfox-swc +43 -0
  229. package/test/external/toy-feature/node_modules/.bin/shipfox-tsc-check +43 -0
  230. package/test/external/toy-feature/node_modules/.bin/shipfox-tsc-emit +43 -0
  231. package/test/external/toy-feature/package.json +57 -0
  232. package/test/external/toy-feature/src/config.ts +5 -0
  233. package/test/external/toy-feature/src/index.ts +64 -0
  234. package/test/external/toy-feature/src/provider.tsx +33 -0
  235. package/test/external/toy-feature/src/routes/insights.tsx +7 -0
  236. package/test/external/toy-feature/src/routes/settings.tsx +7 -0
  237. package/test/external/toy-feature/tsconfig.build.json +5 -0
  238. package/test/external/toy-feature/tsconfig.json +1 -0
  239. package/test/external/verify.mjs +318 -0
  240. package/test/fixtures/features.ts +56 -0
  241. package/test/named-route-impl.tsx +3 -0
  242. package/test/not-route-impl.ts +1 -0
  243. package/test/render.tsx +67 -0
  244. package/test/search-route-impl.tsx +7 -0
  245. package/test/setup.ts +3 -0
  246. package/test/typecheck/shipfox-app.gen.ts +85 -0
  247. package/test/typecheck/types.tsx +18 -0
  248. package/tsconfig.build.json +10 -0
  249. package/tsconfig.build.tsbuildinfo +1 -0
  250. package/tsconfig.json +1 -0
  251. package/tsconfig.test.json +12 -0
  252. package/vitest.config.ts +22 -0
@@ -0,0 +1,56 @@
1
+ import {defineClientFeature} from '#contract.js';
2
+
3
+ export const features = [
4
+ defineClientFeature({
5
+ id: 'shipfox.projects',
6
+ routes: [
7
+ {
8
+ path: '/workspaces/$wid/projects/$pid/overview',
9
+ parent: 'projectLayout',
10
+ impl: '#test/default-route-impl.js',
11
+ },
12
+ {
13
+ path: '/workspaces/$wid/settings/members',
14
+ parent: 'workspaceSettings',
15
+ impl: '#test/default-route-impl.js',
16
+ },
17
+ ],
18
+ navigation: [
19
+ {
20
+ id: 'projects',
21
+ scope: 'workspace',
22
+ label: 'Projects',
23
+ to: '/workspaces/$wid/projects/$pid/overview',
24
+ order: 100,
25
+ },
26
+ ],
27
+ settingsSections: [
28
+ {id: 'members', pathSegment: 'members', label: 'Members', icon: 'users', order: 100},
29
+ ],
30
+ }),
31
+ defineClientFeature({
32
+ id: 'acme.insights',
33
+ routes: [
34
+ {
35
+ path: '/workspaces/$wid/insights',
36
+ parent: 'workspaceLayout',
37
+ impl: '#test/named-route-impl.js',
38
+ },
39
+ {
40
+ path: '/workspaces/$wid/projects/$pid/overview',
41
+ parent: 'projectLayout',
42
+ override: true,
43
+ impl: '#test/search-route-impl.js',
44
+ },
45
+ ],
46
+ navigation: [
47
+ {
48
+ id: 'insights',
49
+ scope: 'workspace',
50
+ label: 'Insights',
51
+ to: '/workspaces/$wid/insights',
52
+ order: 200,
53
+ },
54
+ ],
55
+ }),
56
+ ] as const;
@@ -0,0 +1,3 @@
1
+ import {defineRoute} from '@shipfox/client-shell/runtime';
2
+
3
+ export default defineRoute({component: () => <div>Named route</div>});
@@ -0,0 +1 @@
1
+ export const value = 'not a route implementation';
@@ -0,0 +1,67 @@
1
+ import {QueryClient} from '@tanstack/react-query';
2
+ import {createMemoryHistory, createRouter, Outlet, RouterProvider} from '@tanstack/react-router';
3
+ import {render} from '@testing-library/react';
4
+ import {createStore} from 'jotai';
5
+ import {composeRoutes} from '#compose/compose-routes.js';
6
+ import type {ClientFeature} from '#contract.js';
7
+ import {assembleRouteTree, type ResolveRouteImpl} from '#runtime/assemble-route-tree.js';
8
+ import {type AuthStateValue, authStateAtom} from '#runtime/auth.js';
9
+ import {ChromeProvider, type ChromeSlots} from '#runtime/chrome-context.js';
10
+ import {ShellProviderStack} from '#runtime/provider-stack.js';
11
+ import {navigationEntries, settingsEntries} from '#runtime/registries.js';
12
+
13
+ export async function renderComposedShell({
14
+ features,
15
+ initialPath,
16
+ resolveImpl,
17
+ }: {
18
+ features: readonly ClientFeature[];
19
+ initialPath: string;
20
+ resolveImpl: ResolveRouteImpl;
21
+ }): Promise<{
22
+ router: unknown;
23
+ queryClient: QueryClient;
24
+ store: ReturnType<typeof createStore>;
25
+ }> {
26
+ const routeTree = await assembleRouteTree(composeRoutes(features), {
27
+ resolveImpl,
28
+ navigation: navigationEntries(features),
29
+ settingsSections: settingsEntries(features),
30
+ });
31
+ const queryClient = new QueryClient({defaultOptions: {queries: {retry: false}}});
32
+ const store = createStore();
33
+ const auth: AuthStateValue = {
34
+ status: 'authenticated',
35
+ workspaces: [{id: 'workspace', name: 'Workspace', membershipId: 'membership'}],
36
+ isLoading: false,
37
+ isAuthenticated: true,
38
+ hasWorkspace: true,
39
+ };
40
+ const chrome: ChromeSlots = {
41
+ ProjectBreadcrumb: () => null,
42
+ ProjectLayoutGuard: Outlet,
43
+ };
44
+ store.set(authStateAtom, auth);
45
+ const router = createRouter({
46
+ history: createMemoryHistory({initialEntries: [initialPath]}),
47
+ routeTree,
48
+ context: {
49
+ auth,
50
+ queryClient,
51
+ workspaceSetup: async () => ({hideProjectNavigation: false}),
52
+ },
53
+ });
54
+ render(
55
+ <ChromeProvider chrome={chrome}>
56
+ <ShellProviderStack
57
+ features={features}
58
+ queryClient={queryClient}
59
+ store={store}
60
+ auth={{effects: false}}
61
+ >
62
+ <RouterProvider router={router} />
63
+ </ShellProviderStack>
64
+ </ChromeProvider>,
65
+ );
66
+ return {router, queryClient, store};
67
+ }
@@ -0,0 +1,7 @@
1
+ import {defineRoute} from '@shipfox/client-shell/runtime';
2
+
3
+ export default defineRoute({
4
+ component: () => <div>Search route</div>,
5
+ validateSearch: (search: Record<string, unknown>) =>
6
+ ({tab: search.tab === 'activity' ? 'activity' : 'overview'}) as const,
7
+ });
package/test/setup.ts ADDED
@@ -0,0 +1,3 @@
1
+ import {installClientDomTestEnv} from '@shipfox/client-test-setup';
2
+
3
+ installClientDomTestEnv();
@@ -0,0 +1,85 @@
1
+ // GENERATED by @shipfox/client-shell/vite. Do not edit.
2
+ // biome-ignore-all format: generated code has stable, reviewable output.
3
+ // biome-ignore-all assist/source/organizeImports: generated imports follow route order.
4
+ import {createRoute, createRouter} from '@tanstack/react-router';
5
+ import {buildAnchorSkeleton, isRouteImpl, type RouteImpl, type RouterContext} from '@shipfox/client-shell/runtime';
6
+ import route0Impl from "#test/search-route-impl.js";
7
+ import route1Impl from "#test/default-route-impl.js";
8
+ import route2Impl from "#test/named-route-impl.js";
9
+
10
+ function routeOptions<T extends RouteImpl>(routeImpl: T, impl: string, path: string): T['options'] {
11
+ if (!isRouteImpl(routeImpl)) {
12
+ throw new TypeError(`Route implementation "${impl}" for "${path}" must export default defineRoute(...).`);
13
+ }
14
+ return routeImpl.options;
15
+ }
16
+
17
+ const skeleton = buildAnchorSkeleton({
18
+ navigation: [
19
+ {
20
+ "id": "projects",
21
+ "scope": "workspace",
22
+ "label": "Projects",
23
+ "to": "/workspaces/$wid/projects/$pid/overview",
24
+ "order": 100
25
+ },
26
+ {
27
+ "id": "insights",
28
+ "scope": "workspace",
29
+ "label": "Insights",
30
+ "to": "/workspaces/$wid/insights",
31
+ "order": 200
32
+ }
33
+ ],
34
+ settingsSections: [
35
+ {
36
+ "id": "members",
37
+ "pathSegment": "members",
38
+ "label": "Members",
39
+ "icon": "users",
40
+ "order": 100
41
+ }
42
+ ],
43
+ });
44
+
45
+ const route0 = createRoute({
46
+ getParentRoute: () => skeleton.projectLayout,
47
+ path: "/overview",
48
+ ...routeOptions(route0Impl, "#test/search-route-impl.js", "/workspaces/$wid/projects/$pid/overview"),
49
+ });
50
+
51
+ const route1 = createRoute({
52
+ getParentRoute: () => skeleton.workspaceSettings,
53
+ path: "/members",
54
+ ...routeOptions(route1Impl, "#test/default-route-impl.js", "/workspaces/$wid/settings/members"),
55
+ });
56
+
57
+ const route2 = createRoute({
58
+ getParentRoute: () => skeleton.workspaceLayout,
59
+ path: "/insights",
60
+ ...routeOptions(route2Impl, "#test/named-route-impl.js", "/workspaces/$wid/insights"),
61
+ });
62
+
63
+ const projectLayout = skeleton.projectLayout.addChildren([route0]);
64
+ const workspaceSettings = skeleton.workspaceSettings.addChildren([route1]);
65
+ const workspaceLayout = skeleton.workspaceLayout.addChildren([
66
+ route2,
67
+ projectLayout,
68
+ workspaceSettings,
69
+ ]);
70
+
71
+ export const routeTree = skeleton.rootRoute.addChildren([
72
+ workspaceLayout,
73
+ ]);
74
+
75
+ export const router = createRouter({
76
+ routeTree,
77
+ context: {auth: undefined, queryClient: undefined} satisfies RouterContext,
78
+ scrollRestoration: true,
79
+ });
80
+
81
+ declare module '@tanstack/react-router' {
82
+ interface Register {
83
+ router: typeof router;
84
+ }
85
+ }
@@ -0,0 +1,18 @@
1
+ import {Link, useSearch} from '@tanstack/react-router';
2
+ import './shipfox-app.gen.js';
3
+
4
+ export function CompositionTypes(): React.ReactNode {
5
+ const search = useSearch({from: '/workspaces/$wid/projects/$pid/overview'});
6
+ const tab: 'activity' | 'overview' = search.tab;
7
+
8
+ return (
9
+ <>
10
+ <Link to="/workspaces/$wid/insights" params={{wid: 'workspace'}}>
11
+ Insights
12
+ </Link>
13
+ <span>{tab}</span>
14
+ {/* @ts-expect-error The generated route tree rejects unknown paths. */}
15
+ <Link to="/not-a-route">Missing route</Link>
16
+ </>
17
+ );
18
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "@shipfox/ts-config/react",
3
+ "compilerOptions": {
4
+ "rootDir": "src",
5
+ "outDir": "dist",
6
+ "customConditions": ["workspace-source"]
7
+ },
8
+ "include": ["src"],
9
+ "exclude": ["**/*.test.tsx", "**/*.test.ts"]
10
+ }