@tscircuit/fake-snippets 0.0.106 → 0.0.108

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 (43) hide show
  1. package/CLAUDE.md +92 -0
  2. package/api/generated-index.js +84 -25
  3. package/biome.json +7 -1
  4. package/bun-tests/fake-snippets-api/routes/package_builds/get.test.ts +0 -15
  5. package/bun-tests/fake-snippets-api/routes/package_builds/list.test.ts +0 -12
  6. package/dist/bundle.js +360 -434
  7. package/dist/index.d.ts +26 -15
  8. package/dist/index.js +40 -21
  9. package/dist/schema.d.ts +32 -24
  10. package/dist/schema.js +7 -5
  11. package/fake-snippets-api/lib/db/db-client.ts +19 -1
  12. package/fake-snippets-api/lib/db/schema.ts +6 -3
  13. package/fake-snippets-api/lib/db/seed.ts +23 -12
  14. package/fake-snippets-api/lib/public-mapping/public-map-package-build.ts +0 -3
  15. package/fake-snippets-api/lib/public-mapping/public-map-package-release.ts +3 -0
  16. package/fake-snippets-api/routes/api/package_builds/list.ts +0 -1
  17. package/package.json +3 -2
  18. package/src/App.tsx +27 -9
  19. package/src/components/FileSidebar.tsx +14 -159
  20. package/src/components/PackageBreadcrumb.tsx +111 -0
  21. package/src/components/ViewPackagePage/components/mobile-sidebar.tsx +1 -1
  22. package/src/components/ViewPackagePage/components/sidebar-about-section.tsx +18 -2
  23. package/src/components/ViewPackagePage/components/sidebar-releases-section.tsx +18 -8
  24. package/src/components/preview/BuildsList.tsx +84 -167
  25. package/src/components/preview/ConnectedPackagesList.tsx +92 -62
  26. package/src/components/preview/ConnectedRepoOverview.tsx +171 -155
  27. package/src/components/preview/{ConnectedRepoDashboard.tsx → PackageReleasesDashboard.tsx} +31 -69
  28. package/src/components/preview/index.tsx +20 -154
  29. package/src/hooks/use-package-builds.ts +0 -48
  30. package/src/hooks/use-package-release-by-id-or-version.ts +36 -0
  31. package/src/hooks/use-package-release.ts +32 -0
  32. package/src/index.css +24 -0
  33. package/src/lib/utils/isUuid.ts +5 -0
  34. package/src/lib/utils/transformFilesToTreeData.tsx +195 -0
  35. package/src/pages/404.tsx +3 -5
  36. package/src/pages/preview-release.tsx +269 -0
  37. package/src/pages/release-builds.tsx +99 -0
  38. package/src/pages/release-detail.tsx +120 -0
  39. package/src/pages/releases.tsx +55 -0
  40. package/fake-snippets-api/routes/api/package_builds/latest.ts +0 -109
  41. package/src/hooks/use-snippets-base-api-url.ts +0 -3
  42. package/src/pages/preview-build.tsx +0 -380
  43. package/src/pages/view-connected-repo.tsx +0 -49
@@ -1,49 +0,0 @@
1
- import { useParams } from "wouter"
2
- import NotFoundPage from "./404"
3
- import { ConnectedRepoDashboard } from "@/components/preview"
4
- import { usePackageBuild } from "@/hooks/use-package-builds"
5
- import { usePackageReleaseById } from "@/hooks/use-package-release"
6
- import { usePackageById } from "@/hooks/use-package-by-package-id"
7
-
8
- export default function ViewConnectedRepoOverview() {
9
- const params = useParams<{ buildId: string }>()
10
- const {
11
- data: packageBuild,
12
- isLoading: isLoadingBuild,
13
- error: buildError,
14
- } = usePackageBuild(params?.buildId)
15
- const {
16
- data: packageRelease,
17
- isLoading: isLoadingRelease,
18
- error: releaseError,
19
- } = usePackageReleaseById(packageBuild?.package_release_id)
20
- const {
21
- data: buildPackage,
22
- isLoading: isLoadingPackage,
23
- error: packageError,
24
- } = usePackageById(String(packageRelease?.package_id))
25
-
26
- if (isLoadingBuild || isLoadingRelease || isLoadingPackage) {
27
- return null
28
- }
29
-
30
- if (buildError?.status === 404 || !packageBuild) {
31
- return <NotFoundPage heading="Build Not Found" />
32
- }
33
-
34
- if (releaseError?.status === 404 || !packageRelease) {
35
- return <NotFoundPage heading="Package Release Not Found" />
36
- }
37
-
38
- if (packageError?.status === 404 || !buildPackage) {
39
- return <NotFoundPage heading="Package Not Found" />
40
- }
41
-
42
- return (
43
- <ConnectedRepoDashboard
44
- latestBuild={packageBuild}
45
- pkg={buildPackage}
46
- packageRelease={packageRelease}
47
- />
48
- )
49
- }