@tscircuit/fake-snippets 0.0.101 → 0.0.102

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 (56) hide show
  1. package/api/generated-index.js +23 -1
  2. package/bun.lock +2 -2
  3. package/dist/bundle.js +530 -367
  4. package/dist/index.d.ts +29 -2
  5. package/dist/index.js +18 -1
  6. package/dist/schema.d.ts +94 -1
  7. package/dist/schema.js +17 -1
  8. package/fake-snippets-api/lib/db/db-client.ts +6 -1
  9. package/fake-snippets-api/lib/db/schema.ts +15 -0
  10. package/fake-snippets-api/lib/public-mapping/public-map-package.ts +2 -0
  11. package/fake-snippets-api/routes/api/github/installations/create_new_installation_redirect.ts +75 -0
  12. package/fake-snippets-api/routes/api/github/repos/list_available.ts +91 -0
  13. package/fake-snippets-api/routes/api/packages/update.ts +4 -0
  14. package/package.json +2 -2
  15. package/src/App.tsx +10 -1
  16. package/src/components/CreateReleaseDialog.tsx +124 -0
  17. package/src/components/FileSidebar.tsx +128 -23
  18. package/src/components/PackageBuildsPage/package-build-header.tsx +9 -1
  19. package/src/components/PageSearchComponent.tsx +2 -2
  20. package/src/components/SearchComponent.tsx +2 -2
  21. package/src/components/SuspenseRunFrame.tsx +2 -2
  22. package/src/components/TrendingPackagesCarousel.tsx +2 -2
  23. package/src/components/ViewPackagePage/components/mobile-sidebar.tsx +1 -0
  24. package/src/components/ViewPackagePage/components/sidebar-about-section.tsx +1 -0
  25. package/src/components/dialogs/GitHubRepositorySelector.tsx +123 -0
  26. package/src/components/dialogs/create-use-dialog.tsx +8 -2
  27. package/src/components/dialogs/edit-package-details-dialog.tsx +22 -3
  28. package/src/components/dialogs/view-ts-files-dialog.tsx +178 -33
  29. package/src/components/package-port/CodeAndPreview.tsx +4 -1
  30. package/src/components/package-port/CodeEditor.tsx +42 -35
  31. package/src/components/package-port/CodeEditorHeader.tsx +6 -4
  32. package/src/components/package-port/EditorNav.tsx +94 -37
  33. package/src/components/preview/BuildsList.tsx +238 -0
  34. package/src/components/preview/ConnectedRepoDashboard.tsx +258 -0
  35. package/src/components/preview/ConnectedRepoOverview.tsx +454 -0
  36. package/src/components/preview/ConnectedRepoSettings.tsx +343 -0
  37. package/src/components/preview/ConnectedReposCards.tsx +191 -0
  38. package/src/components/preview/index.tsx +207 -0
  39. package/src/components/ui/tree-view.tsx +23 -6
  40. package/src/hooks/use-axios.ts +2 -2
  41. package/src/hooks/use-create-release-dialog.ts +160 -0
  42. package/src/hooks/use-package-details-form.ts +7 -0
  43. package/src/hooks/use-packages-base-api-url.ts +1 -1
  44. package/src/hooks/use-sign-in.ts +2 -2
  45. package/src/hooks/useFileManagement.ts +22 -2
  46. package/src/index.css +4 -0
  47. package/src/lib/utils/formatTimeAgo.ts +10 -0
  48. package/src/lib/utils/isValidFileName.ts +15 -3
  49. package/src/pages/dashboard.tsx +2 -2
  50. package/src/pages/dev-login.tsx +2 -2
  51. package/src/pages/latest.tsx +2 -2
  52. package/src/pages/preview-build.tsx +380 -0
  53. package/src/pages/search.tsx +2 -2
  54. package/src/pages/trending.tsx +2 -2
  55. package/src/pages/user-profile.tsx +32 -24
  56. package/src/pages/view-connected-repo.tsx +24 -0
@@ -31,6 +31,7 @@ const PREFETCHABLE_PAGES = new Set([
31
31
  "latest",
32
32
  "settings",
33
33
  "quickstart",
34
+ "view-connected-repo",
34
35
  ])
35
36
 
36
37
  const pageDescriptions = {
@@ -50,6 +51,8 @@ const pageDescriptions = {
50
51
  "Get started quickly with tscircuit. Create new circuit packages, import components from JLCPCB, or start from templates to begin your electronic design journey.",
51
52
  settings:
52
53
  "Manage your tscircuit account settings, shipping information, and preferences for electronic design and PCB ordering.",
54
+ "view-connected-repo":
55
+ "View and manage your connected repositories. Monitor repository status, access build information, and configure build options.",
53
56
  }
54
57
 
55
58
  function getPageDescription(pageName) {
@@ -181,6 +184,9 @@ async function handleCustomPackageHtml(req, res) {
181
184
  if (author === "datasheets") {
182
185
  throw new Error("Datasheet route")
183
186
  }
187
+ if (author === "build" || unscopedPackageName === "view-connected-repo") {
188
+ throw new Error("Deployment route - not a package")
189
+ }
184
190
 
185
191
  const packageNotFoundHtml = getHtmlWithModifiedSeoTags({
186
192
  title: "Package Not Found - tscircuit",
@@ -302,6 +308,23 @@ export default async function handler(req, res) {
302
308
  res.status(200).send(htmlContent)
303
309
  return
304
310
  }
311
+
312
+ const pathParts = req.url.split("?")[0].split("/")
313
+
314
+ if (pathParts[1] === "build" && pathParts[2]) {
315
+ const pageDescription = getPageDescription("view-connected-repo")
316
+ const html = getHtmlWithModifiedSeoTags({
317
+ title: `Preview Build For ${pathParts[2]} - tscircuit`,
318
+ description: pageDescription,
319
+ canonicalUrl: `${BASE_URL}/build/${pathParts[2]}`,
320
+ })
321
+ res.setHeader("Content-Type", "text/html; charset=utf-8")
322
+ res.setHeader("Cache-Control", cacheControlHeader)
323
+ res.setHeader("Vary", "Accept-Encoding")
324
+ res.status(200).send(html)
325
+ return
326
+ }
327
+
305
328
  try {
306
329
  await handleCustomPackageHtml(req, res)
307
330
  return
@@ -309,7 +332,6 @@ export default async function handler(req, res) {
309
332
  console.warn(e)
310
333
  }
311
334
 
312
- const pathParts = req.url.split("?")[0].split("/")
313
335
  if (pathParts[1] === "datasheets" && pathParts[2]) {
314
336
  try {
315
337
  await handleDatasheetPage(req, res)
package/bun.lock CHANGED
@@ -54,7 +54,7 @@
54
54
  "@tscircuit/mm": "^0.0.8",
55
55
  "@tscircuit/pcb-viewer": "^1.11.194",
56
56
  "@tscircuit/prompt-benchmarks": "^0.0.28",
57
- "@tscircuit/runframe": "^0.0.736",
57
+ "@tscircuit/runframe": "0.0.764",
58
58
  "@tscircuit/schematic-viewer": "^2.0.21",
59
59
  "@types/babel__standalone": "^7.1.7",
60
60
  "@types/bun": "^1.1.10",
@@ -746,7 +746,7 @@
746
746
 
747
747
  "@tscircuit/props": ["@tscircuit/props@0.0.262", "", { "peerDependencies": { "circuit-json": "*", "react": "*", "zod": "*" } }, "sha512-Ygye4XDWErj73ArhDZunodb1n30Kvdw/rucCdHjBhOseUSlRuACk0ApdJ/AqG0WJ4aEpPJ51mCWgpYDovcMdmw=="],
748
748
 
749
- "@tscircuit/runframe": ["@tscircuit/runframe@0.0.736", "", {}, "sha512-KDaUg3mgUmdP9q2NUSvyozzCf5knypGkGf+sD+3OW6YYMyJP4xekdB7BLxP4W+YXSFJyzdv8cr34gaSato53wg=="],
749
+ "@tscircuit/runframe": ["@tscircuit/runframe@0.0.764", "", {}, "sha512-jf/CbwqEfchDPnciW3UP18d/vL+MVM0bmECbGTD/RDEMw0CBGge648cgDSuUiGBCYm+Mvhvm0ab1R8QS0L8M+g=="],
750
750
 
751
751
  "@tscircuit/schematic-autolayout": ["@tscircuit/schematic-autolayout@0.0.6", "", { "dependencies": { "@tscircuit/soup-util": "^0.0.38", "transformation-matrix": "^2.16.1" } }, "sha512-34cQxtlSylBKyHkzaMBCynaWJgN9c/mWm7cz63StTYIafKmfFs383K8Xoc4QX8HXCvVrHYl1aK15onZua9MxeA=="],
752
752