@tscircuit/fake-snippets 0.0.108 → 0.0.110
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/.github/workflows/bun-formatcheck.yml +2 -2
- package/.github/workflows/bun-pver-release.yml +3 -3
- package/.github/workflows/bun-test.yml +1 -1
- package/.github/workflows/bun-typecheck.yml +2 -2
- package/.github/workflows/update-snapshots.yml +1 -1
- package/README.md +4 -0
- package/api/generated-index.js +37 -3
- package/biome.json +2 -1
- package/bun-tests/fake-snippets-api/fixtures/get-test-server.ts +31 -3
- package/bun-tests/fake-snippets-api/fixtures/preload.ts +18 -0
- package/bun-tests/fake-snippets-api/routes/orgs/add_member.test.ts +26 -0
- package/bun-tests/fake-snippets-api/routes/orgs/create.test.ts +37 -0
- package/bun-tests/fake-snippets-api/routes/orgs/get.test.ts +52 -0
- package/bun-tests/fake-snippets-api/routes/orgs/list.test.ts +17 -0
- package/bun-tests/fake-snippets-api/routes/orgs/list_members.test.ts +23 -0
- package/bun-tests/fake-snippets-api/routes/orgs/remove_member.test.ts +81 -0
- package/bun-tests/fake-snippets-api/routes/orgs/update.test.ts +99 -0
- package/bun-tests/fake-snippets-api/routes/package_builds/get.test.ts +1 -1
- package/bun-tests/fake-snippets-api/routes/package_files/create.test.ts +15 -13
- package/bun-tests/fake-snippets-api/routes/package_files/create_or_update.test.ts +26 -24
- package/bun-tests/fake-snippets-api/routes/package_files/delete.test.ts +9 -9
- package/bun-tests/fake-snippets-api/routes/package_files/download.test.ts +4 -4
- package/bun-tests/fake-snippets-api/routes/package_files/get.test.ts +38 -28
- package/bun-tests/fake-snippets-api/routes/package_files/list.test.ts +23 -15
- package/bun-tests/fake-snippets-api/routes/package_releases/create.test.ts +33 -0
- package/bun-tests/fake-snippets-api/routes/package_releases/get.test.ts +4 -4
- package/bun-tests/fake-snippets-api/routes/package_releases/get_image_generation_fields.test.ts +38 -0
- package/bun-tests/fake-snippets-api/routes/packages/create.test.ts +19 -0
- package/bun-tests/fake-snippets-api/routes/packages/fork.test.ts +3 -4
- package/bun-tests/fake-snippets-api/routes/packages/get.test.ts +30 -0
- package/bun-tests/fake-snippets-api/routes/packages/images.test.ts +4 -2
- package/bun-tests/fake-snippets-api/routes/packages/list-1.test.ts +34 -0
- package/bun.lock +389 -450
- package/bunfig.toml +2 -1
- package/dist/bundle.js +1255 -625
- package/dist/index.d.ts +296 -4
- package/dist/index.js +325 -24
- package/dist/schema.d.ts +282 -1
- package/dist/schema.js +54 -2
- package/fake-snippets-api/lib/db/autoload-dev-packages.ts +31 -20
- package/fake-snippets-api/lib/db/db-client.ts +214 -3
- package/fake-snippets-api/lib/db/schema.ts +62 -0
- package/fake-snippets-api/lib/db/seed.ts +100 -0
- package/fake-snippets-api/lib/middleware/with-session-auth.ts +1 -1
- package/fake-snippets-api/lib/package_file/get-package-file-id-from-file-descriptor.ts +2 -2
- package/fake-snippets-api/lib/public-mapping/public-map-org.ts +32 -0
- package/fake-snippets-api/lib/public-mapping/public-map-package-build.ts +10 -0
- package/fake-snippets-api/lib/public-mapping/public-map-package-release.ts +17 -0
- package/fake-snippets-api/routes/api/orgs/add_member.ts +52 -0
- package/fake-snippets-api/routes/api/orgs/create.ts +46 -0
- package/fake-snippets-api/routes/api/orgs/get.ts +39 -0
- package/fake-snippets-api/routes/api/orgs/list.ts +31 -0
- package/fake-snippets-api/routes/api/orgs/list_members.ts +67 -0
- package/fake-snippets-api/routes/api/orgs/remove_member.ts +46 -0
- package/fake-snippets-api/routes/api/orgs/update.ts +93 -0
- package/fake-snippets-api/routes/api/package_files/get.ts +3 -6
- package/fake-snippets-api/routes/api/package_files/list.ts +7 -4
- package/fake-snippets-api/routes/api/packages/create.ts +54 -10
- package/fake-snippets-api/routes/api/packages/get.ts +23 -0
- package/fake-snippets-api/routes/api/packages/images/[owner_github_username]/[unscoped_name]/[view_format].ts +13 -11
- package/fake-snippets-api/routes/api/packages/list.ts +29 -2
- package/fake-snippets-api/routes/api/packages/update_ai_description.ts +37 -0
- package/package.json +27 -24
- package/renovate.json +1 -1
- package/scripts/generate-sitemap.ts +1 -1
- package/src/App.tsx +29 -10
- package/src/ContextProviders.tsx +25 -2
- package/src/components/CircuitJsonImportDialog.tsx +1 -1
- package/src/components/CmdKMenu.tsx +281 -247
- package/src/components/DownloadButtonAndMenu.tsx +133 -36
- package/src/components/FileSidebar.tsx +41 -50
- package/src/components/Footer.tsx +8 -10
- package/src/components/Header.tsx +19 -32
- package/src/components/Header2.tsx +16 -32
- package/src/components/HeaderDropdown.tsx +13 -8
- package/src/components/HeaderLogin.tsx +44 -16
- package/src/components/HiddenFilesDropdown.tsx +0 -2
- package/src/components/NotFound.tsx +5 -5
- package/src/components/PackageBreadcrumb.tsx +6 -12
- package/src/components/PackageCard.tsx +0 -1
- package/src/components/PackageSearchResults.tsx +1 -1
- package/src/components/PrefetchPageLink.tsx +7 -1
- package/src/components/ProfileRouter.tsx +32 -0
- package/src/components/SearchComponent.tsx +12 -8
- package/src/components/UserCard.tsx +80 -0
- package/src/components/ViewPackagePage/components/ShikiCodeViewer.tsx +20 -11
- package/src/components/ViewPackagePage/components/build-status.tsx +1 -1
- package/src/components/ViewPackagePage/components/important-files-view.tsx +174 -87
- package/src/components/ViewPackagePage/components/main-content-header.tsx +8 -4
- package/src/components/ViewPackagePage/components/main-content-view-selector.tsx +1 -2
- package/src/components/ViewPackagePage/components/mobile-sidebar.tsx +54 -20
- package/src/components/ViewPackagePage/components/package-header.tsx +26 -37
- package/src/components/ViewPackagePage/components/preview-image-squares.tsx +11 -19
- package/src/components/ViewPackagePage/components/repo-page-content.tsx +33 -25
- package/src/components/ViewPackagePage/components/sidebar-about-section.tsx +16 -10
- package/src/components/ViewPackagePage/components/sidebar-releases-section.tsx +11 -11
- package/src/components/ViewPackagePage/components/sidebar.tsx +0 -2
- package/src/components/ViewPackagePage/components/tab-views/files-view.tsx +18 -17
- package/src/components/ViewPackagePage/components/tab-views/pcb-view.tsx +1 -2
- package/src/components/ViewPackagePage/components/tab-views/schematic-view.tsx +2 -1
- package/src/components/ViewPackagePage/components/theme-toggle.tsx +0 -2
- package/src/components/ViewPackagePage/hooks/use-toast.tsx +0 -1
- package/src/components/dialogs/GitHubRepositorySelector.tsx +56 -49
- package/src/components/dialogs/edit-package-details-dialog.tsx +5 -6
- package/src/components/dialogs/import-component-dialog.tsx +16 -9
- package/src/components/dialogs/import-package-dialog.tsx +3 -2
- package/src/components/dialogs/new-package-save-prompt-dialog.tsx +190 -0
- package/src/components/organization/OrganizationCard.tsx +204 -0
- package/src/components/organization/OrganizationCardSkeleton.tsx +55 -0
- package/src/components/organization/OrganizationHeader.tsx +154 -0
- package/src/components/organization/OrganizationMembers.tsx +146 -0
- package/src/components/package-port/CodeAndPreview.tsx +32 -46
- package/src/components/package-port/CodeEditor.tsx +28 -31
- package/src/components/package-port/CodeEditorHeader.tsx +128 -63
- package/src/components/package-port/EditorNav.tsx +32 -49
- package/src/components/preview/ConnectedPackagesList.tsx +8 -8
- package/src/components/preview/ConnectedRepoOverview.tsx +102 -2
- package/src/components/preview/PackageReleasesDashboard.tsx +53 -36
- package/src/components/ui/tree-view.tsx +6 -3
- package/src/hooks/use-add-org-member-mutation.ts +51 -0
- package/src/hooks/use-create-org-mutation.ts +38 -0
- package/src/hooks/use-create-package-mutation.ts +3 -0
- package/src/hooks/use-current-package-id.ts +5 -30
- package/src/hooks/use-current-package-info.ts +29 -5
- package/src/hooks/use-current-package-release.ts +4 -3
- package/src/hooks/use-download-zip.ts +2 -2
- package/src/hooks/use-global-store.ts +6 -4
- package/src/hooks/use-jlcpcb-component-import.tsx +164 -0
- package/src/hooks/use-list-org-members.ts +27 -0
- package/src/hooks/use-list-user-orgs.ts +25 -0
- package/src/hooks/use-org-by-github-handle.ts +26 -0
- package/src/hooks/use-org.ts +24 -0
- package/src/hooks/use-organization.ts +42 -0
- package/src/hooks/use-package-as-snippet.ts +4 -2
- package/src/hooks/use-package-builds.ts +6 -2
- package/src/hooks/use-package-files.ts +5 -3
- package/src/hooks/use-package-release-by-id-or-version.ts +29 -20
- package/src/hooks/use-package-release-images.ts +105 -0
- package/src/hooks/use-package-release.ts +2 -2
- package/src/hooks/use-package-stars.ts +80 -4
- package/src/hooks/use-preview-images.ts +6 -3
- package/src/hooks/use-remove-org-member-mutation.ts +32 -0
- package/src/hooks/use-update-ai-description-mutation.ts +42 -0
- package/src/hooks/use-update-org-mutation.ts +41 -0
- package/src/hooks/use-warn-user-on-page-change.ts +71 -4
- package/src/hooks/useFileManagement.ts +183 -35
- package/src/hooks/useOptimizedPackageFilesLoader.ts +136 -0
- package/src/hooks/usePackageFilesLoader.ts +2 -2
- package/src/hooks/useUpdatePackageFilesMutation.ts +15 -1
- package/src/lib/download-fns/download-circuit-png.ts +11 -3
- package/src/lib/download-fns/download-gltf-from-circuit-json.ts +44 -0
- package/src/lib/download-fns/download-kicad-files.ts +12 -11
- package/src/lib/normalize-svg-for-tile.ts +50 -0
- package/src/lib/posthog.ts +11 -9
- package/src/lib/react-query-api-failure-tracking.ts +148 -0
- package/src/lib/sentry.ts +14 -0
- package/src/lib/templates/blank-circuit-board-template.ts +0 -4
- package/src/lib/ts-lib-cache.ts +122 -7
- package/src/lib/utils/checkIfManualEditsImported.ts +4 -4
- package/src/lib/utils/findTargetFile.ts +45 -10
- package/src/lib/utils/isComponentExported.ts +10 -0
- package/src/main.tsx +2 -1
- package/src/pages/authorize.tsx +0 -2
- package/src/pages/create-organization.tsx +168 -0
- package/src/pages/dashboard.tsx +38 -6
- package/src/pages/datasheet.tsx +1 -1
- package/src/pages/datasheets.tsx +3 -3
- package/src/pages/editor.tsx +4 -6
- package/src/pages/landing.tsx +6 -7
- package/src/pages/latest.tsx +3 -0
- package/src/pages/organization-profile.tsx +199 -0
- package/src/pages/organization-settings.tsx +566 -0
- package/src/pages/package-editor.tsx +21 -21
- package/src/pages/preview-release.tsx +76 -136
- package/src/pages/quickstart.tsx +159 -123
- package/src/pages/release-detail.tsx +119 -31
- package/src/pages/search.tsx +192 -57
- package/src/pages/settings-redirect.tsx +44 -0
- package/src/pages/trending.tsx +29 -20
- package/src/pages/user-profile.tsx +58 -7
- package/src/pages/view-package.tsx +21 -26
- package/vite.config.ts +9 -0
- package/fake-snippets-api/routes/api/autocomplete/create_autocomplete.ts +0 -133
- package/src/components/Footer2.tsx +0 -100
- package/src/components/JLCPCBImportDialog.tsx +0 -280
- package/src/components/PackageBuildsPage/LogContent.tsx +0 -72
- package/src/components/PackageBuildsPage/PackageBuildDetailsPage.tsx +0 -115
- package/src/components/PackageBuildsPage/build-preview-content.tsx +0 -27
- package/src/components/PackageBuildsPage/collapsible-section.tsx +0 -63
- package/src/components/PackageBuildsPage/package-build-details-panel.tsx +0 -166
- package/src/components/PackageBuildsPage/package-build-header.tsx +0 -79
- package/src/components/PageSearchComponent.tsx +0 -148
- package/src/components/ShippingInformationForm.tsx +0 -423
- package/src/components/StaticViewSnippetHeader.tsx +0 -70
- package/src/components/ViewPackagePage/components/file-explorer.tsx +0 -67
- package/src/components/ViewPackagePage/components/readme-view.tsx +0 -58
- package/src/components/ViewPackagePage/components/repo-header-button.tsx +0 -36
- package/src/components/ViewPackagePage/components/repo-header.tsx +0 -4
- package/src/components/ViewPackagePage/components/sidebar-contributors-section.tsx +0 -31
- package/src/components/ViewSnippetHeader.tsx +0 -181
- package/src/components/ui/input-otp.tsx +0 -69
- package/src/pages/package-builds.tsx +0 -33
- package/src/pages/settings.tsx +0 -25
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { withRouteSpec } from "fake-snippets-api/lib/middleware/with-winter-spec"
|
|
2
|
+
import { z } from "zod"
|
|
3
|
+
|
|
4
|
+
export default withRouteSpec({
|
|
5
|
+
methods: ["POST"],
|
|
6
|
+
auth: "session",
|
|
7
|
+
jsonBody: z.object({
|
|
8
|
+
package_id: z.string(),
|
|
9
|
+
}),
|
|
10
|
+
jsonResponse: z.object({
|
|
11
|
+
success: z.boolean(),
|
|
12
|
+
}),
|
|
13
|
+
})(async (req, ctx) => {
|
|
14
|
+
const { package_id } = req.jsonBody
|
|
15
|
+
|
|
16
|
+
const package_info = ctx.db.getPackageById(package_id)
|
|
17
|
+
if (!package_info) {
|
|
18
|
+
return ctx.error(404, {
|
|
19
|
+
error_code: "package_not_found",
|
|
20
|
+
message: "Package not found",
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (package_info.owner_github_username !== ctx.auth.github_username) {
|
|
25
|
+
return ctx.error(403, {
|
|
26
|
+
error_code: "unauthorized",
|
|
27
|
+
message: "Only the package owner can update AI description",
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
ctx.db.updatePackage(package_id, {
|
|
32
|
+
ai_description: "New ai description",
|
|
33
|
+
ai_usage_instructions: "New ai usage instructions",
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
return ctx.json({ success: true })
|
|
37
|
+
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/fake-snippets",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.110",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"playwright": "bunx playwright test",
|
|
19
19
|
"playwright:update": "bunx playwright test --update-snapshots",
|
|
20
20
|
"start:playwright-server": "bun run build:fake-api && vite --port 5177",
|
|
21
|
-
"dev": "bun run build:fake-api && AUTOLOAD_PACKAGES=true vite",
|
|
21
|
+
"dev": "bun run build:fake-api && AUTOLOAD_PACKAGES=true vite --host",
|
|
22
22
|
"dev:registry": "SNIPPETS_API_URL=http://localhost:3100 vite",
|
|
23
23
|
"build": "bun run generate-images && bun run generate-sitemap && bun run build:fake-api && tsc -b && vite build",
|
|
24
24
|
"preview": "vite preview",
|
|
@@ -75,17 +75,20 @@
|
|
|
75
75
|
"@radix-ui/react-toggle": "^1.1.0",
|
|
76
76
|
"@radix-ui/react-toggle-group": "^1.1.0",
|
|
77
77
|
"@radix-ui/react-tooltip": "^1.1.2",
|
|
78
|
+
"@resvg/resvg-wasm": "^2.6.2",
|
|
79
|
+
"@sentry/react": "^10.10.0",
|
|
78
80
|
"@tailwindcss/typography": "^0.5.16",
|
|
79
|
-
"@tscircuit/3d-viewer": "^0.0.
|
|
80
|
-
"@tscircuit/assembly-viewer": "^0.0.
|
|
81
|
+
"@tscircuit/3d-viewer": "^0.0.402",
|
|
82
|
+
"@tscircuit/assembly-viewer": "^0.0.5",
|
|
81
83
|
"@tscircuit/create-snippet-url": "^0.0.8",
|
|
82
|
-
"@tscircuit/eval": "^0.0.
|
|
84
|
+
"@tscircuit/eval": "^0.0.325",
|
|
83
85
|
"@tscircuit/layout": "^0.0.29",
|
|
84
86
|
"@tscircuit/mm": "^0.0.8",
|
|
85
|
-
"@tscircuit/pcb-viewer": "^1.11.
|
|
87
|
+
"@tscircuit/pcb-viewer": "^1.11.218",
|
|
86
88
|
"@tscircuit/prompt-benchmarks": "^0.0.28",
|
|
87
|
-
"@tscircuit/runframe": "0.0.
|
|
88
|
-
"@tscircuit/schematic-viewer": "^2.0.
|
|
89
|
+
"@tscircuit/runframe": "^0.0.1031",
|
|
90
|
+
"@tscircuit/schematic-viewer": "^2.0.39",
|
|
91
|
+
"@tscircuit/simple-3d-svg": "^0.0.41",
|
|
89
92
|
"@types/babel__standalone": "^7.1.7",
|
|
90
93
|
"@types/bun": "^1.1.10",
|
|
91
94
|
"@types/country-list": "^2.1.4",
|
|
@@ -93,45 +96,44 @@
|
|
|
93
96
|
"@types/md5": "^2.3.5",
|
|
94
97
|
"@types/ms": "^0.7.34",
|
|
95
98
|
"@types/node": "^22.13.0",
|
|
96
|
-
"@types/prismjs": "^1.26.4",
|
|
97
99
|
"@types/react": "^18.3.9",
|
|
98
100
|
"@types/react-dom": "^18.3.0",
|
|
99
101
|
"@types/react-helmet": "^6.1.11",
|
|
100
102
|
"@types/sharp": "^0.32.0",
|
|
103
|
+
"@types/three": "^0.180.0",
|
|
101
104
|
"@typescript/ata": "^0.9.7",
|
|
102
105
|
"@typescript/vfs": "^1.6.0",
|
|
103
106
|
"@valtown/codemirror-ts": "^2.2.0",
|
|
104
107
|
"@vercel/analytics": "^1.4.1",
|
|
105
108
|
"@vitejs/plugin-react": "^4.3.1",
|
|
106
109
|
"autoprefixer": "^10.4.20",
|
|
107
|
-
"change-case": "^5.4.4",
|
|
108
110
|
"circuit-json-to-bom-csv": "^0.0.7",
|
|
109
111
|
"circuit-json-to-gerber": "^0.0.29",
|
|
112
|
+
"circuit-json-to-gltf": "^0.0.14",
|
|
110
113
|
"circuit-json-to-pnp-csv": "^0.0.7",
|
|
111
114
|
"circuit-json-to-readable-netlist": "^0.0.13",
|
|
115
|
+
"circuit-json-to-simple-3d": "^0.0.7",
|
|
112
116
|
"circuit-json-to-spice": "^0.0.6",
|
|
113
|
-
"circuit-json-to-tscircuit": "^0.0.
|
|
114
|
-
"circuit-to-svg": "^0.0.
|
|
117
|
+
"circuit-json-to-tscircuit": "^0.0.9",
|
|
118
|
+
"circuit-to-svg": "^0.0.202",
|
|
115
119
|
"class-variance-authority": "^0.7.1",
|
|
116
120
|
"clsx": "^2.1.1",
|
|
117
121
|
"cmdk": "^1.0.4",
|
|
118
122
|
"codemirror": "^6.0.1",
|
|
119
123
|
"codemirror-copilot": "^0.0.7",
|
|
120
|
-
"country-list": "^2.3.0",
|
|
121
|
-
"date-fns": "^4.1.0",
|
|
122
124
|
"dotenv": "^16.5.0",
|
|
123
125
|
"dsn-converter": "^0.0.60",
|
|
124
|
-
"easyeda": "^0.0.
|
|
126
|
+
"easyeda": "^0.0.228",
|
|
125
127
|
"embla-carousel-react": "^8.3.0",
|
|
126
128
|
"extract-codefence": "^0.0.4",
|
|
127
129
|
"fflate": "^0.8.2",
|
|
128
130
|
"file-saver": "^2.0.5",
|
|
131
|
+
"fuse.js": "^7.1.0",
|
|
129
132
|
"get-port": "^7.1.0",
|
|
130
133
|
"globals": "^15.9.0",
|
|
131
134
|
"he": "^1.2.0",
|
|
132
135
|
"idb-keyval": "^6.2.2",
|
|
133
136
|
"immer": "^10.1.1",
|
|
134
|
-
"input-otp": "^1.2.4",
|
|
135
137
|
"javascript-time-ago": "^2.5.11",
|
|
136
138
|
"jose": "^5.9.3",
|
|
137
139
|
"jscad-electronics": "^0.0.25",
|
|
@@ -144,15 +146,13 @@
|
|
|
144
146
|
"md5": "^2.3.0",
|
|
145
147
|
"ms": "^2.1.3",
|
|
146
148
|
"next-themes": "^0.3.0",
|
|
147
|
-
"openai": "^5.6.0",
|
|
148
149
|
"postcss": "^8.4.47",
|
|
149
150
|
"posthog-js": "^1.203.2",
|
|
150
|
-
"prismjs": "^1.29.0",
|
|
151
151
|
"prompts": "^2.4.2",
|
|
152
|
-
"react": "^
|
|
152
|
+
"react": "^19.1.1",
|
|
153
153
|
"react-cookie-consent": "^9.0.0",
|
|
154
154
|
"react-day-picker": "8.10.1",
|
|
155
|
-
"react-dom": "^
|
|
155
|
+
"react-dom": "^19.1.1",
|
|
156
156
|
"react-error-boundary": "^6.0.0",
|
|
157
157
|
"react-helmet": "^6.1.0",
|
|
158
158
|
"react-helmet-async": "^2.0.5",
|
|
@@ -166,19 +166,20 @@
|
|
|
166
166
|
"redaxios": "^0.5.1",
|
|
167
167
|
"remark-gfm": "^4.0.1",
|
|
168
168
|
"rollup-plugin-visualizer": "^5.12.0",
|
|
169
|
-
"schematic-symbols": "^0.0.
|
|
169
|
+
"schematic-symbols": "^0.0.202",
|
|
170
170
|
"sharp": "^0.33.5",
|
|
171
171
|
"shiki": "^3.2.1",
|
|
172
172
|
"sitemap": "^8.0.0",
|
|
173
173
|
"sonner": "^1.5.0",
|
|
174
174
|
"states-us": "^1.1.1",
|
|
175
|
+
"svgo": "^4.0.0",
|
|
175
176
|
"tailwind-merge": "^2.5.2",
|
|
176
177
|
"tailwindcss": "^3.4.13",
|
|
177
178
|
"tailwindcss-animate": "^1.0.7",
|
|
178
179
|
"terser": "^5.27.0",
|
|
179
|
-
"three": "
|
|
180
|
+
"three": "0.165.0",
|
|
180
181
|
"three-stdlib": "^2.36.0",
|
|
181
|
-
"tscircuit": "^0.0.
|
|
182
|
+
"tscircuit": "^0.0.653",
|
|
182
183
|
"tsup": "^8.5.0",
|
|
183
184
|
"typescript": "^5.6.3",
|
|
184
185
|
"use-async-memo": "^1.2.5",
|
|
@@ -191,6 +192,8 @@
|
|
|
191
192
|
"wouter": "^3.3.5",
|
|
192
193
|
"zod": "^3.23.8",
|
|
193
194
|
"zustand": "^4.5.5",
|
|
194
|
-
"zustand-hoist": "^2.0.1"
|
|
195
|
+
"zustand-hoist": "^2.0.1",
|
|
196
|
+
"circuit-json-to-kicad": "^0.0.3",
|
|
197
|
+
"kicadts": "^0.0.9"
|
|
195
198
|
}
|
|
196
199
|
}
|
package/renovate.json
CHANGED
|
@@ -20,7 +20,7 @@ const staticRoutes = [
|
|
|
20
20
|
async function fetchTrendingSnippets() {
|
|
21
21
|
try {
|
|
22
22
|
const response = await fetch(
|
|
23
|
-
"https://
|
|
23
|
+
"https://api.tscircuit.com/snippets/list_trending",
|
|
24
24
|
{
|
|
25
25
|
headers: {
|
|
26
26
|
Accept: "application/json",
|
package/src/App.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import React from "react"
|
|
|
6
6
|
import { ReloadIcon } from "@radix-ui/react-icons"
|
|
7
7
|
import { Loader2 } from "lucide-react"
|
|
8
8
|
|
|
9
|
-
const FullPageLoader = () => (
|
|
9
|
+
export const FullPageLoader = () => (
|
|
10
10
|
<div className="fixed inset-0 flex items-center justify-center bg-white z-50">
|
|
11
11
|
<div className="w-48">
|
|
12
12
|
<div className="loading">
|
|
@@ -64,11 +64,12 @@ const MyOrdersPage = lazyImport(() => import("@/pages/my-orders"))
|
|
|
64
64
|
const LatestPage = lazyImport(() => import("@/pages/latest"))
|
|
65
65
|
const QuickstartPage = lazyImport(() => import("@/pages/quickstart"))
|
|
66
66
|
const SearchPage = lazyImport(() => import("@/pages/search"))
|
|
67
|
-
const
|
|
68
|
-
|
|
67
|
+
const CreateOrganizationPage = lazyImport(
|
|
68
|
+
() => import("@/pages/create-organization"),
|
|
69
|
+
)
|
|
70
|
+
const ProfileRouter = lazyImport(() => import("@/components/ProfileRouter"))
|
|
69
71
|
const DevLoginPage = lazyImport(() => import("@/pages/dev-login"))
|
|
70
72
|
const ViewPackagePage = lazyImport(() => import("@/pages/view-package"))
|
|
71
|
-
const PackageBuildsPage = lazyImport(() => import("@/pages/package-builds"))
|
|
72
73
|
const TrendingPage = lazyImport(() => import("@/pages/trending"))
|
|
73
74
|
const DatasheetPage = lazyImport(() => import("@/pages/datasheet"))
|
|
74
75
|
const DatasheetsPage = lazyImport(() => import("@/pages/datasheets"))
|
|
@@ -83,6 +84,12 @@ const ReleasesPage = lazyImport(() => import("@/pages/releases"))
|
|
|
83
84
|
const ReleaseDetailPage = lazyImport(() => import("@/pages/release-detail"))
|
|
84
85
|
const ReleaseBuildsPage = lazyImport(() => import("@/pages/release-builds"))
|
|
85
86
|
const ReleasePreviewPage = lazyImport(() => import("@/pages/preview-release"))
|
|
87
|
+
const OrganizationSettingsPage = lazyImport(
|
|
88
|
+
() => import("@/pages/organization-settings"),
|
|
89
|
+
)
|
|
90
|
+
const SettingsRedirectPage = lazyImport(
|
|
91
|
+
() => import("@/pages/settings-redirect"),
|
|
92
|
+
)
|
|
86
93
|
|
|
87
94
|
class ErrorBoundary extends React.Component<
|
|
88
95
|
{ children: React.ReactNode },
|
|
@@ -252,7 +259,6 @@ function App() {
|
|
|
252
259
|
<Route path="/quickstart" component={QuickstartPage} />
|
|
253
260
|
<Route path="/dashboard" component={DashboardPage} />
|
|
254
261
|
<Route path="/latest" component={LatestPage} />
|
|
255
|
-
<Route path="/settings" component={SettingsPage} />
|
|
256
262
|
<Route path="/search" component={SearchPage} />
|
|
257
263
|
<Route path="/trending" component={TrendingPage} />
|
|
258
264
|
<Route path="/datasheets" component={DatasheetsPage} />
|
|
@@ -260,7 +266,23 @@ function App() {
|
|
|
260
266
|
<Route path="/authorize" component={AuthenticatePage} />
|
|
261
267
|
<Route path="/my-orders" component={MyOrdersPage} />
|
|
262
268
|
<Route path="/dev-login" component={DevLoginPage} />
|
|
263
|
-
|
|
269
|
+
|
|
270
|
+
{/* Organization creation route */}
|
|
271
|
+
<Route path="/orgs/new" component={CreateOrganizationPage} />
|
|
272
|
+
|
|
273
|
+
{/* User settings redirect */}
|
|
274
|
+
<Route path="/settings" component={SettingsRedirectPage} />
|
|
275
|
+
|
|
276
|
+
{/* Organization settings route */}
|
|
277
|
+
<Route
|
|
278
|
+
path="/:orgname/settings"
|
|
279
|
+
component={OrganizationSettingsPage}
|
|
280
|
+
/>
|
|
281
|
+
|
|
282
|
+
{/* Profile fallback route - handles both organizations and users */}
|
|
283
|
+
<Route path="/:username" component={ProfileRouter} />
|
|
284
|
+
|
|
285
|
+
{/* Package-related routes - must come after profile fallback */}
|
|
264
286
|
<Route
|
|
265
287
|
path="/:author/:packageName/releases/:releaseId/builds"
|
|
266
288
|
component={ReleaseBuildsPage}
|
|
@@ -282,10 +304,7 @@ function App() {
|
|
|
282
304
|
component={ReleasesPage}
|
|
283
305
|
/>
|
|
284
306
|
<Route path="/:author/:packageName" component={ViewPackagePage} />
|
|
285
|
-
|
|
286
|
-
path="/:author/:packageName/builds"
|
|
287
|
-
component={PackageBuildsPage}
|
|
288
|
-
/>
|
|
307
|
+
{/* 404 fallback */}
|
|
289
308
|
<Route component={lazyImport(() => import("@/pages/404"))} />
|
|
290
309
|
</Switch>
|
|
291
310
|
</Suspense>
|
package/src/ContextProviders.tsx
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
MutationCache,
|
|
3
|
+
QueryCache,
|
|
4
|
+
QueryClient,
|
|
5
|
+
QueryClientProvider,
|
|
6
|
+
} from "react-query"
|
|
2
7
|
import { HelmetProvider } from "react-helmet-async"
|
|
3
8
|
import { useEffect } from "react"
|
|
4
9
|
import { useGlobalStore } from "./hooks/use-global-store"
|
|
5
10
|
import { posthog } from "./lib/posthog"
|
|
6
11
|
import { Toaster } from "react-hot-toast"
|
|
7
12
|
import { populateQueryCacheWithSSRData } from "./lib/populate-query-cache-with-ssr-data"
|
|
13
|
+
import { trackReactQueryApiFailure } from "./lib/react-query-api-failure-tracking"
|
|
8
14
|
|
|
9
15
|
const staffGithubUsernames = [
|
|
10
16
|
"imrishabh18",
|
|
@@ -13,7 +19,24 @@ const staffGithubUsernames = [
|
|
|
13
19
|
...(import.meta.env.VITE_STAFF_GITHUB_USERNAMES?.split(",") || []),
|
|
14
20
|
]
|
|
15
21
|
|
|
16
|
-
const queryClient = new QueryClient(
|
|
22
|
+
const queryClient = new QueryClient({
|
|
23
|
+
queryCache: new QueryCache({
|
|
24
|
+
onError: (error, query) => {
|
|
25
|
+
trackReactQueryApiFailure(error, {
|
|
26
|
+
operationType: "query",
|
|
27
|
+
queryKey: query.queryKey,
|
|
28
|
+
})
|
|
29
|
+
},
|
|
30
|
+
}),
|
|
31
|
+
mutationCache: new MutationCache({
|
|
32
|
+
onError: (error, _variables, _context, mutation) => {
|
|
33
|
+
trackReactQueryApiFailure(error, {
|
|
34
|
+
operationType: "mutation",
|
|
35
|
+
mutationKey: mutation.options?.mutationKey,
|
|
36
|
+
})
|
|
37
|
+
},
|
|
38
|
+
}),
|
|
39
|
+
})
|
|
17
40
|
populateQueryCacheWithSSRData(queryClient)
|
|
18
41
|
|
|
19
42
|
const isInternalGithubUser = (githubUsername?: string | null) => {
|
|
@@ -123,7 +123,7 @@ export function CircuitJsonImportDialog({
|
|
|
123
123
|
const tscircuitComponentContent = convertCircuitJsonToTscircuit(
|
|
124
124
|
importedCircuitJson as any,
|
|
125
125
|
{
|
|
126
|
-
componentName: "
|
|
126
|
+
componentName: "Component",
|
|
127
127
|
},
|
|
128
128
|
)
|
|
129
129
|
console.info(tscircuitComponentContent)
|