@shipfox/client-onboarding 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 +2 -0
- package/.turbo/turbo-check.log +24 -0
- package/CHANGELOG.md +17 -0
- package/LICENSE +21 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/workspace-setup-route.d.ts +9 -0
- package/dist/workspace-setup-route.d.ts.map +1 -0
- package/dist/workspace-setup-route.js +128 -0
- package/dist/workspace-setup-route.js.map +1 -0
- package/package.json +66 -0
- package/src/index.ts +4 -0
- package/src/workspace-setup-route.test.tsx +561 -0
- package/src/workspace-setup-route.ts +157 -0
- package/test/setup.ts +3 -0
- package/tsconfig.build.json +10 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +3 -0
- package/tsconfig.test.json +8 -0
- package/vitest.config.ts +31 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Scope: all 148 workspace projects
|
|
2
|
+
✓ Lockfile passes supply-chain policies (verified 1h ago)
|
|
3
|
+
../../.. | Progress: resolved 1, reused 0, downloaded 0, added 0
|
|
4
|
+
[1A../../.. | +1625 ++++++++++++++++++++++++++[0K
|
|
5
|
+
../../.. | Progress: resolved 1, reused 0, downloaded 0, added 0
|
|
6
|
+
[1A../../.. | Progress: resolved 1625, reused 0, downloaded 0, added 0
|
|
7
|
+
[1A../../.. | Progress: resolved 1625, reused 16, downloaded 0, added 0
|
|
8
|
+
[1A../../.. | Progress: resolved 1625, reused 314, downloaded 0, added 0
|
|
9
|
+
[75C[1A485[78D[1B[75C[1A592[78D[1B[75C[1A659[78D[1B[75C[1A701[78D[1B[76C[1A50[78D[1B[76C[1A9[77D[1B[75C[1A858[78D[1B[75C[1A965[78D[1B[1A../../.. | Progress: resolved 1625, reused 1042, downloaded 0, added 0
|
|
10
|
+
[76C[1A179[79D[1B[76C[1A258[79D[1B[76C[1A355[79D[1B[76C[1A428[79D[1B[76C[1A557[79D[1B[76C[1A618, downloaded 0, added 4[102D[1B[1A../../.. | Progress: resolved 1625, reused 1620, downloaded 0, added 12
|
|
11
|
+
[78C[1A1, downloaded 0, added 19[103D[1B[101C[1A25[103D[1B[102C[1A6[103D[1B[102C[1A7[103D[1B[101C[1A30[103D[1B[102C[1A2[103D[1B[102C[1A4[103D[1B[102C[1A5[103D[1B[102C[1A9[103D[1B[101C[1A42[103D[1B[102C[1A3[103D[1B[102C[1A5[103D[1B[102C[1A7[103D[1B[101C[1A50[103D[1B[102C[1A2[103D[1B[102C[1A4[103D[1B[102C[1A5[103D[1B[102C[1A7[103D[1B[101C[1A62[103D[1B[102C[1A4[103D[1B[102C[1A5[103D[1B[101C[1A70[103D[1B[102C[1A2[103D[1B[102C[1A4[103D[1B[102C[1A6[103D[1B[102C[1A7[103D[1B[102C[1A8[103D[1B[102C[1A9[103D[1B[101C[1A82[103D[1B[102C[1A5[103D[1B[102C[1A6[103D[1B[102C[1A7[103D[1B[101C[1A91[103D[1B[102C[1A3[103D[1B[102C[1A5[103D[1B[102C[1A6[103D[1B[102C[1A8[103D[1B[1A../../.. | Progress: resolved 1625, reused 1621, downloaded 0, added 101
|
|
12
|
+
[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A8[104D[1B[102C[1A10[104D[1B[103C[1A2[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A20[104D[1B[103C[1A1[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A30[104D[1B[103C[1A1[104D[1B[103C[1A2[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A40[104D[1B[103C[1A1[104D[1B[103C[1A2[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A51[104D[1B[103C[1A2[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A60[104D[1B[103C[1A1[104D[1B[103C[1A2[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[102C[1A73[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A9[104D[1B[102C[1A81[104D[1B[103C[1A2[104D[1B[103C[1A6[104D[1B[103C[1A8[104D[1B[102C[1A92[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[101C[1A205[104D[1B[103C[1A9[104D[1B[102C[1A10[104D[1B[103C[1A5[104D[1B[103C[1A8[104D[1B[102C[1A22[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A30[104D[1B[103C[1A2[104D[1B[103C[1A3[104D[1B[103C[1A8[104D[1B[102C[1A40[104D[1B[103C[1A6[104D[1B[103C[1A9[104D[1B[102C[1A50[104D[1B[103C[1A3[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A9[104D[1B[102C[1A60[104D[1B[103C[1A1[104D[1B[103C[1A2[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A8[104D[1B[102C[1A74[104D[1B[103C[1A6[104D[1B[103C[1A9[104D[1B[102C[1A81[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A93[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[101C[1A300[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A10[104D[1B[103C[1A2[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A9[104D[1B[102C[1A20[104D[1B[103C[1A1[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A30[104D[1B[103C[1A2[104D[1B[103C[1A4[104D[1B[103C[1A6[104D[1B[103C[1A9[104D[1B[102C[1A42[104D[1B[103C[1A3[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[102C[1A50[104D[1B[103C[1A2[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A61[104D[1B[103C[1A2[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[102C[1A70[104D[1B[103C[1A2[104D[1B[103C[1A4[104D[1B[103C[1A8[104D[1B[102C[1A80[104D[1B[103C[1A2[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[102C[1A90[104D[1B[103C[1A1[104D[1B[103C[1A2[104D[1B[103C[1A4[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[101C[1A401[104D[1B[103C[1A3[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A10[104D[1B[103C[1A1[104D[1B[103C[1A2[104D[1B[103C[1A4[104D[1B[103C[1A8[104D[1B[102C[1A21[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A7[104D[1B[102C[1A30[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A6[104D[1B[102C[1A41[104D[1B[103C[1A4[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A50[104D[1B[103C[1A1[104D[1B[103C[1A3[104D[1B[103C[1A5[104D[1B[102C[1A60[104D[1B[103C[1A1[104D[1B[103C[1A2[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A70[104D[1B[103C[1A1[104D[1B[103C[1A2[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A80[104D[1B[103C[1A1[104D[1B[103C[1A2[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[102C[1A90[104D[1B[103C[1A2[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A7[104D[1B[103C[1A9[104D[1B[101C[1A500[104D[1B[103C[1A1[104D[1B[103C[1A2[104D[1B[103C[1A3[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[102C[1A11[104D[1B[103C[1A2[104D[1B[103C[1A5[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A20[104D[1B[103C[1A4[104D[1B[103C[1A7[104D[1B[102C[1A34[104D[1B[103C[1A9[104D[1B[102C[1A43[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A50[104D[1B[103C[1A1[104D[1B[103C[1A2[104D[1B[103C[1A3[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A60[104D[1B[103C[1A1[104D[1B[103C[1A2[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A70[104D[1B[103C[1A1[104D[1B[103C[1A2[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A81[104D[1B[103C[1A2[104D[1B[103C[1A3[104D[1B[103C[1A5[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A90[104D[1B[103C[1A1[104D[1B[103C[1A2[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[101C[1A600[104D[1B[103C[1A1[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A7[104D[1B[102C[1A10[104D[1B[103C[1A1[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A8[104D[1B[102C[1A20[104D[1B[103C[1A2[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[102C[1A31[104D[1B[103C[1A3[104D[1B[103C[1A5[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A40[104D[1B[103C[1A3[104D[1B[103C[1A5[104D[1B[103C[1A7[104D[1B[103C[1A9[104D[1B[102C[1A51[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A63[104D[1B[103C[1A4[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A71[104D[1B[103C[1A2[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A80[104D[1B[103C[1A1[104D[1B[103C[1A2[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A90[104D[1B[103C[1A1[104D[1B[103C[1A2[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A7[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[101C[1A700[104D[1B[103C[1A1[104D[1B[103C[1A2[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A7[104D[1B[103C[1A9[104D[1B[102C[1A11[104D[1B[103C[1A3[104D[1B[103C[1A4[104D[1B[103C[1A5[104D[1B[103C[1A6[104D[1B[103C[1A8[104D[1B[103C[1A9[104D[1B[102C[1A20[104D[1B[ERROR] Command was killed with SIGINT (User interruption with CTRL-C): pnpm install
|
|
13
|
+
|
|
14
|
+
pnpm: Command was killed with SIGINT (User interruption with CTRL-C): pnpm install
|
|
15
|
+
at getFinalError (file:///Users/noe.charmet/.local/share/mise/installs/npm-pnpm/11.7.0/lib/node_modules/pnpm/dist/pnpm.mjs:34109:14)
|
|
16
|
+
at makeError (file:///Users/noe.charmet/.local/share/mise/installs/npm-pnpm/11.7.0/lib/node_modules/pnpm/dist/pnpm.mjs:36416:21)
|
|
17
|
+
at getSyncResult (file:///Users/noe.charmet/.local/share/mise/installs/npm-pnpm/11.7.0/lib/node_modules/pnpm/dist/pnpm.mjs:38260:10)
|
|
18
|
+
at spawnSubprocessSync (file:///Users/noe.charmet/.local/share/mise/installs/npm-pnpm/11.7.0/lib/node_modules/pnpm/dist/pnpm.mjs:38220:14)
|
|
19
|
+
at execaCoreSync (file:///Users/noe.charmet/.local/share/mise/installs/npm-pnpm/11.7.0/lib/node_modules/pnpm/dist/pnpm.mjs:38150:23)
|
|
20
|
+
at callBoundExeca (file:///Users/noe.charmet/.local/share/mise/installs/npm-pnpm/11.7.0/lib/node_modules/pnpm/dist/pnpm.mjs:40678:23)
|
|
21
|
+
at boundExeca (file:///Users/noe.charmet/.local/share/mise/installs/npm-pnpm/11.7.0/lib/node_modules/pnpm/dist/pnpm.mjs:40655:49)
|
|
22
|
+
at sync (file:///Users/noe.charmet/.local/share/mise/installs/npm-pnpm/11.7.0/lib/node_modules/pnpm/dist/pnpm.mjs:40810:14)
|
|
23
|
+
at runPnpmCli (file:///Users/noe.charmet/.local/share/mise/installs/npm-pnpm/11.7.0/lib/node_modules/pnpm/dist/pnpm.mjs:245101:5)
|
|
24
|
+
at runDepsStatusCheck (file:///Users/noe.charmet/.local/share/mise/installs/npm-pnpm/11.7.0/lib/node_modules/pnpm/dist/pnpm.mjs:246833:7)
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# @shipfox/client-onboarding
|
|
2
|
+
|
|
3
|
+
## 5.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 8d8cdef: Extracts workspace onboarding into a dedicated coordinator and shares its feature query policies.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [8d8cdef]
|
|
12
|
+
- Updated dependencies [ffd727b]
|
|
13
|
+
- Updated dependencies [f1d6465]
|
|
14
|
+
- @shipfox/client-agent@5.0.0
|
|
15
|
+
- @shipfox/client-integrations@5.0.0
|
|
16
|
+
- @shipfox/client-projects@5.0.0
|
|
17
|
+
- @shipfox/client-shell@5.0.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Shipfox
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,KAAK,0BAA0B,GAChC,MAAM,4BAA4B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n loadWorkspaceSetupRoute,\n type WorkspaceSetupRouteOptions,\n} from './workspace-setup-route.js';\n"],"names":["loadWorkspaceSetupRoute"],"mappings":"AAAA,SACEA,uBAAuB,QAElB,6BAA6B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type WorkspaceSetupState } from '@shipfox/client-shell/runtime';
|
|
2
|
+
import type { QueryClient } from '@tanstack/react-query';
|
|
3
|
+
export interface WorkspaceSetupRouteOptions {
|
|
4
|
+
queryClient: QueryClient;
|
|
5
|
+
workspaceId: string;
|
|
6
|
+
pathname: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function loadWorkspaceSetupRoute({ queryClient, workspaceId, pathname, }: WorkspaceSetupRouteOptions): Promise<WorkspaceSetupState>;
|
|
9
|
+
//# sourceMappingURL=workspace-setup-route.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-setup-route.d.ts","sourceRoot":"","sources":["../src/workspace-setup-route.ts"],"names":[],"mappings":"AASA,OAAO,EAA0B,KAAK,mBAAmB,EAAC,MAAM,+BAA+B,CAAC;AAChG,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAKvD,MAAM,WAAW,0BAA0B;IACzC,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,uBAAuB,CAAC,EAC5C,WAAW,EACX,WAAW,EACX,QAAQ,GACT,EAAE,0BAA0B,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAyD3D"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { isModelProviderOnboardingDismissed, modelProviderConfigsQueryOptions } from '@shipfox/client-agent';
|
|
2
|
+
import { sourceConnectionsQueryOptions } from '@shipfox/client-integrations';
|
|
3
|
+
import { projectExistenceQueryOptions } from '@shipfox/client-projects';
|
|
4
|
+
import { WorkspaceSetupLoadError } from '@shipfox/client-shell/runtime';
|
|
5
|
+
import { redirect } from '@tanstack/react-router';
|
|
6
|
+
const TRAILING_SLASHES_RE = /\/+$/u;
|
|
7
|
+
export async function loadWorkspaceSetupRoute({ queryClient, workspaceId, pathname }) {
|
|
8
|
+
const projects = await fetchWorkspaceProjectExistence(queryClient, workspaceId);
|
|
9
|
+
const normalizedPathname = normalizePath(pathname);
|
|
10
|
+
if (projects.projects.length > 0) {
|
|
11
|
+
if (isIntegrationsIndexPath(normalizedPathname, workspaceId)) {
|
|
12
|
+
throw redirect({
|
|
13
|
+
to: '/workspaces/$wid/settings/integrations',
|
|
14
|
+
params: {
|
|
15
|
+
wid: workspaceId
|
|
16
|
+
},
|
|
17
|
+
replace: true
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
hideProjectNavigation: false
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const sourceConnections = await fetchWorkspaceSourceConnections(queryClient, workspaceId);
|
|
25
|
+
const hasSourceConnection = sourceConnections.length > 0;
|
|
26
|
+
if (!hasSourceConnection) {
|
|
27
|
+
if (isIntegrationSetupPath(normalizedPathname, workspaceId)) {
|
|
28
|
+
return {
|
|
29
|
+
hideProjectNavigation: true
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
throw redirect({
|
|
33
|
+
to: '/workspaces/$wid/integrations',
|
|
34
|
+
params: {
|
|
35
|
+
wid: workspaceId
|
|
36
|
+
},
|
|
37
|
+
replace: true
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
if (isAgentSettingsPath(normalizedPathname, workspaceId)) {
|
|
41
|
+
return {
|
|
42
|
+
hideProjectNavigation: true
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const providerHandled = await hasHandledModelProviderOnboarding(queryClient, workspaceId);
|
|
46
|
+
if (!providerHandled) {
|
|
47
|
+
if (isModelProviderOnboardingPath(normalizedPathname, workspaceId)) {
|
|
48
|
+
return {
|
|
49
|
+
hideProjectNavigation: true
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
throw redirect({
|
|
53
|
+
to: '/workspaces/$wid/model-provider',
|
|
54
|
+
params: {
|
|
55
|
+
wid: workspaceId
|
|
56
|
+
},
|
|
57
|
+
replace: true
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
if (isProjectCreationPath(normalizedPathname, workspaceId)) {
|
|
61
|
+
return {
|
|
62
|
+
hideProjectNavigation: true
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
throw redirect({
|
|
66
|
+
to: '/workspaces/$wid/projects/new',
|
|
67
|
+
params: {
|
|
68
|
+
wid: workspaceId
|
|
69
|
+
},
|
|
70
|
+
replace: true
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
async function fetchWorkspaceProjectExistence(queryClient, workspaceId) {
|
|
74
|
+
const options = projectExistenceQueryOptions(workspaceId);
|
|
75
|
+
try {
|
|
76
|
+
return await queryClient.fetchQuery(options);
|
|
77
|
+
} catch (error) {
|
|
78
|
+
const cached = queryClient.getQueryData(options.queryKey);
|
|
79
|
+
if (cached !== undefined) return cached;
|
|
80
|
+
throw new WorkspaceSetupLoadError(error);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
async function fetchWorkspaceSourceConnections(queryClient, workspaceId) {
|
|
84
|
+
const options = sourceConnectionsQueryOptions(workspaceId);
|
|
85
|
+
try {
|
|
86
|
+
return await queryClient.fetchQuery(options);
|
|
87
|
+
} catch (error) {
|
|
88
|
+
const cached = queryClient.getQueryData(options.queryKey);
|
|
89
|
+
if (cached !== undefined) return cached;
|
|
90
|
+
throw new WorkspaceSetupLoadError(error);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async function hasHandledModelProviderOnboarding(queryClient, workspaceId) {
|
|
94
|
+
if (isModelProviderOnboardingDismissed(workspaceId)) return true;
|
|
95
|
+
const options = modelProviderConfigsQueryOptions(workspaceId);
|
|
96
|
+
try {
|
|
97
|
+
const configs = await queryClient.fetchQuery(options);
|
|
98
|
+
return configs.configs.length > 0;
|
|
99
|
+
} catch {
|
|
100
|
+
const cached = queryClient.getQueryData(options.queryKey);
|
|
101
|
+
return cached?.configs.length !== 0;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function normalizePath(pathname) {
|
|
105
|
+
if (pathname === '/') return pathname;
|
|
106
|
+
return pathname.replace(TRAILING_SLASHES_RE, '');
|
|
107
|
+
}
|
|
108
|
+
function workspacePath(workspaceId, suffix) {
|
|
109
|
+
return `/workspaces/${workspaceId}${suffix}`;
|
|
110
|
+
}
|
|
111
|
+
function isIntegrationsIndexPath(pathname, workspaceId) {
|
|
112
|
+
return pathname === workspacePath(workspaceId, '/integrations');
|
|
113
|
+
}
|
|
114
|
+
function isIntegrationSetupPath(pathname, workspaceId) {
|
|
115
|
+
const basePath = workspacePath(workspaceId, '/integrations');
|
|
116
|
+
return pathname === basePath || pathname.startsWith(`${basePath}/`) || pathname === workspacePath(workspaceId, '/settings/integrations');
|
|
117
|
+
}
|
|
118
|
+
function isProjectCreationPath(pathname, workspaceId) {
|
|
119
|
+
return pathname === workspacePath(workspaceId, '/projects/new');
|
|
120
|
+
}
|
|
121
|
+
function isModelProviderOnboardingPath(pathname, workspaceId) {
|
|
122
|
+
return pathname === workspacePath(workspaceId, '/model-provider');
|
|
123
|
+
}
|
|
124
|
+
function isAgentSettingsPath(pathname, workspaceId) {
|
|
125
|
+
return pathname === workspacePath(workspaceId, '/settings/agents');
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
//# sourceMappingURL=workspace-setup-route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/workspace-setup-route.ts"],"sourcesContent":["import {\n isModelProviderOnboardingDismissed,\n modelProviderConfigsQueryOptions,\n} from '@shipfox/client-agent';\nimport {\n type IntegrationConnection,\n sourceConnectionsQueryOptions,\n} from '@shipfox/client-integrations';\nimport {projectExistenceQueryOptions} from '@shipfox/client-projects';\nimport {WorkspaceSetupLoadError, type WorkspaceSetupState} from '@shipfox/client-shell/runtime';\nimport type {QueryClient} from '@tanstack/react-query';\nimport {redirect} from '@tanstack/react-router';\n\nconst TRAILING_SLASHES_RE = /\\/+$/u;\n\nexport interface WorkspaceSetupRouteOptions {\n queryClient: QueryClient;\n workspaceId: string;\n pathname: string;\n}\n\nexport async function loadWorkspaceSetupRoute({\n queryClient,\n workspaceId,\n pathname,\n}: WorkspaceSetupRouteOptions): Promise<WorkspaceSetupState> {\n const projects = await fetchWorkspaceProjectExistence(queryClient, workspaceId);\n const normalizedPathname = normalizePath(pathname);\n\n if (projects.projects.length > 0) {\n if (isIntegrationsIndexPath(normalizedPathname, workspaceId)) {\n throw redirect({\n to: '/workspaces/$wid/settings/integrations',\n params: {wid: workspaceId},\n replace: true,\n });\n }\n\n return {hideProjectNavigation: false};\n }\n\n const sourceConnections = await fetchWorkspaceSourceConnections(queryClient, workspaceId);\n const hasSourceConnection = sourceConnections.length > 0;\n\n if (!hasSourceConnection) {\n if (isIntegrationSetupPath(normalizedPathname, workspaceId)) {\n return {hideProjectNavigation: true};\n }\n\n throw redirect({\n to: '/workspaces/$wid/integrations',\n params: {wid: workspaceId},\n replace: true,\n });\n }\n\n if (isAgentSettingsPath(normalizedPathname, workspaceId)) {\n return {hideProjectNavigation: true};\n }\n\n const providerHandled = await hasHandledModelProviderOnboarding(queryClient, workspaceId);\n if (!providerHandled) {\n if (isModelProviderOnboardingPath(normalizedPathname, workspaceId)) {\n return {hideProjectNavigation: true};\n }\n\n throw redirect({\n to: '/workspaces/$wid/model-provider',\n params: {wid: workspaceId},\n replace: true,\n });\n }\n\n if (isProjectCreationPath(normalizedPathname, workspaceId)) {\n return {hideProjectNavigation: true};\n }\n\n throw redirect({\n to: '/workspaces/$wid/projects/new',\n params: {wid: workspaceId},\n replace: true,\n });\n}\n\nasync function fetchWorkspaceProjectExistence(queryClient: QueryClient, workspaceId: string) {\n const options = projectExistenceQueryOptions(workspaceId);\n\n try {\n return await queryClient.fetchQuery(options);\n } catch (error) {\n const cached = queryClient.getQueryData<{projects: unknown[]}>(options.queryKey);\n if (cached !== undefined) return cached;\n throw new WorkspaceSetupLoadError(error);\n }\n}\n\nasync function fetchWorkspaceSourceConnections(queryClient: QueryClient, workspaceId: string) {\n const options = sourceConnectionsQueryOptions(workspaceId);\n\n try {\n return await queryClient.fetchQuery(options);\n } catch (error) {\n const cached = queryClient.getQueryData<IntegrationConnection[]>(options.queryKey);\n if (cached !== undefined) return cached;\n throw new WorkspaceSetupLoadError(error);\n }\n}\n\nasync function hasHandledModelProviderOnboarding(\n queryClient: QueryClient,\n workspaceId: string,\n): Promise<boolean> {\n if (isModelProviderOnboardingDismissed(workspaceId)) return true;\n\n const options = modelProviderConfigsQueryOptions(workspaceId);\n try {\n const configs = await queryClient.fetchQuery(options);\n return configs.configs.length > 0;\n } catch {\n const cached = queryClient.getQueryData<{configs: unknown[]}>(options.queryKey);\n return cached?.configs.length !== 0;\n }\n}\n\nfunction normalizePath(pathname: string) {\n if (pathname === '/') return pathname;\n return pathname.replace(TRAILING_SLASHES_RE, '');\n}\n\nfunction workspacePath(workspaceId: string, suffix: string) {\n return `/workspaces/${workspaceId}${suffix}`;\n}\n\nfunction isIntegrationsIndexPath(pathname: string, workspaceId: string) {\n return pathname === workspacePath(workspaceId, '/integrations');\n}\n\nfunction isIntegrationSetupPath(pathname: string, workspaceId: string) {\n const basePath = workspacePath(workspaceId, '/integrations');\n return (\n pathname === basePath ||\n pathname.startsWith(`${basePath}/`) ||\n pathname === workspacePath(workspaceId, '/settings/integrations')\n );\n}\n\nfunction isProjectCreationPath(pathname: string, workspaceId: string) {\n return pathname === workspacePath(workspaceId, '/projects/new');\n}\n\nfunction isModelProviderOnboardingPath(pathname: string, workspaceId: string) {\n return pathname === workspacePath(workspaceId, '/model-provider');\n}\n\nfunction isAgentSettingsPath(pathname: string, workspaceId: string) {\n return pathname === workspacePath(workspaceId, '/settings/agents');\n}\n"],"names":["isModelProviderOnboardingDismissed","modelProviderConfigsQueryOptions","sourceConnectionsQueryOptions","projectExistenceQueryOptions","WorkspaceSetupLoadError","redirect","TRAILING_SLASHES_RE","loadWorkspaceSetupRoute","queryClient","workspaceId","pathname","projects","fetchWorkspaceProjectExistence","normalizedPathname","normalizePath","length","isIntegrationsIndexPath","to","params","wid","replace","hideProjectNavigation","sourceConnections","fetchWorkspaceSourceConnections","hasSourceConnection","isIntegrationSetupPath","isAgentSettingsPath","providerHandled","hasHandledModelProviderOnboarding","isModelProviderOnboardingPath","isProjectCreationPath","options","fetchQuery","error","cached","getQueryData","queryKey","undefined","configs","workspacePath","suffix","basePath","startsWith"],"mappings":"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"}
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@shipfox/client-onboarding",
|
|
3
|
+
"license": "MIT",
|
|
4
|
+
"version": "5.0.0",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/ShipfoxHQ/shipfox.git",
|
|
8
|
+
"directory": "libs/client/onboarding"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "dist/index.js",
|
|
12
|
+
"types": "dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"workspace-source": {
|
|
16
|
+
"types": "./src/index.ts",
|
|
17
|
+
"default": "./src/index.ts"
|
|
18
|
+
},
|
|
19
|
+
"default": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"default": "./dist/index.js"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@swc/helpers": "^0.5.17",
|
|
27
|
+
"@shipfox/client-agent": "5.0.0",
|
|
28
|
+
"@shipfox/client-integrations": "5.0.0",
|
|
29
|
+
"@shipfox/client-projects": "5.0.0",
|
|
30
|
+
"@shipfox/client-shell": "5.0.0"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"@tanstack/react-query": "^5.101.0",
|
|
34
|
+
"@tanstack/react-router": "^1.170.16",
|
|
35
|
+
"react": "^19.0.0",
|
|
36
|
+
"react-dom": "^19.0.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@tanstack/react-query": "^5.101.0",
|
|
40
|
+
"@tanstack/react-router": "^1.170.16",
|
|
41
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
42
|
+
"@testing-library/react": "^16.3.2",
|
|
43
|
+
"@types/react": "^19.1.11",
|
|
44
|
+
"@types/react-dom": "^19.1.7",
|
|
45
|
+
"jsdom": "^29.0.0",
|
|
46
|
+
"react": "^19.1.1",
|
|
47
|
+
"react-dom": "^19.1.1",
|
|
48
|
+
"vitest": "^4.1.5",
|
|
49
|
+
"@shipfox/biome": "1.8.2",
|
|
50
|
+
"@shipfox/client-api": "4.0.0",
|
|
51
|
+
"@shipfox/react-ui": "0.3.5",
|
|
52
|
+
"@shipfox/client-test-setup": "0.0.4",
|
|
53
|
+
"@shipfox/swc": "1.2.6",
|
|
54
|
+
"@shipfox/typescript": "1.1.7",
|
|
55
|
+
"@shipfox/ts-config": "1.3.8",
|
|
56
|
+
"@shipfox/vitest": "1.2.3"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "shipfox-swc",
|
|
60
|
+
"check": "shipfox-biome-check",
|
|
61
|
+
"check:fix": "shipfox-biome-check --write",
|
|
62
|
+
"test": "shipfox-vitest-run",
|
|
63
|
+
"type": "shipfox-tsc-check",
|
|
64
|
+
"type:emit": "shipfox-tsc-emit"
|
|
65
|
+
}
|
|
66
|
+
}
|
package/src/index.ts
ADDED