pkgviz 0.7.7 → 0.8.1
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/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +2 -1
- package/.next/build-manifest.json +15 -24
- package/.next/fallback-build-manifest.json +15 -0
- package/.next/images-manifest.json +14 -3
- package/.next/next-minimal-server.js.nft.json +1 -1
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +52 -16
- package/.next/required-server-files.js +349 -0
- package/.next/required-server-files.json +106 -75
- package/.next/routes-manifest.json +16 -6
- package/.next/server/app/_global-error/page/app-paths-manifest.json +3 -0
- package/.next/server/app/_global-error/page/build-manifest.json +20 -0
- package/.next/server/app/_global-error/page/next-font-manifest.json +6 -0
- package/.next/server/app/_global-error/page/server-reference-manifest.json +4 -0
- package/.next/server/app/_global-error/page.js +9 -0
- package/.next/server/app/_global-error/page.js.map +5 -0
- package/.next/server/app/_global-error/page.js.nft.json +1 -0
- package/.next/server/app/_global-error/page_client-reference-manifest.js +3 -0
- package/.next/server/app/_global-error.html +1 -0
- package/.next/server/app/_global-error.meta +22 -0
- package/.next/server/app/_global-error.rsc +15 -0
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +20 -0
- package/.next/server/app/_global-error.segments/_full.segment.rsc +15 -0
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
- package/.next/server/app/_not-found/page/app-paths-manifest.json +3 -0
- package/.next/server/app/_not-found/page/build-manifest.json +20 -0
- package/.next/server/app/_not-found/page/next-font-manifest.json +11 -0
- package/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/_not-found/page/server-reference-manifest.json +4 -0
- package/.next/server/app/_not-found/page.js +13 -2
- package/.next/server/app/_not-found/page.js.map +5 -0
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +3 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.meta +19 -0
- package/.next/server/app/_not-found.rsc +18 -19
- package/.next/server/app/_not-found.segments/_full.segment.rsc +18 -0
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +24 -0
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -0
- package/.next/server/app/favicon.ico/route/app-paths-manifest.json +3 -0
- package/.next/server/app/favicon.ico/route/build-manifest.json +12 -0
- package/.next/server/app/favicon.ico/route.js +6 -1
- package/.next/server/app/favicon.ico/route.js.map +5 -0
- package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
- package/.next/server/app/page/app-paths-manifest.json +3 -0
- package/.next/server/app/page/build-manifest.json +20 -0
- package/.next/server/app/page/next-font-manifest.json +11 -0
- package/.next/server/app/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/page/server-reference-manifest.json +93 -0
- package/.next/server/app/page.js +16 -13
- package/.next/server/app/page.js.map +5 -0
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +3 -1
- package/.next/server/app-paths-manifest.json +2 -1
- package/.next/server/chunks/[externals]__0l8ei7u._.js +3 -0
- package/.next/server/chunks/[externals]__0l8ei7u._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__1to-yfd._.js +160 -0
- package/.next/server/chunks/[root-of-the-server]__1to-yfd._.js.map +1 -0
- package/.next/server/chunks/[turbopack]_runtime.js +807 -0
- package/.next/server/chunks/[turbopack]_runtime.js.map +10 -0
- package/.next/server/chunks/_next-internal_server_app_favicon_ico_route_actions_0g2jjls.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_favicon_ico_route_actions_0g2jjls.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0agsrep._.js +28 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0agsrep._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0f_e7c8._.js +33 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0f_e7c8._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0yqn68e._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0yqn68e._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__112mz-6._.js +14 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__112mz-6._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__11_76b7._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__11_76b7._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__12ovu0c._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__12ovu0c._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__16pmw__._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__16pmw__._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1f2jx51._.js +33 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1f2jx51._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1rn09vt._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1rn09vt._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__20e4gkp._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__20e4gkp._.js.map +1 -0
- package/.next/server/chunks/ssr/[turbopack]_runtime.js +807 -0
- package/.next/server/chunks/ssr/[turbopack]_runtime.js.map +10 -0
- package/.next/server/chunks/ssr/_1acy_2s._.js +158 -0
- package/.next/server/chunks/ssr/_1acy_2s._.js.map +1 -0
- package/.next/server/chunks/ssr/_1rh2tf9._.js +367 -0
- package/.next/server/chunks/ssr/_1rh2tf9._.js.map +1 -0
- package/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_0zi5s8-.js +3 -0
- package/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_0zi5s8-.js.map +1 -0
- package/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_0pt47yr.js +3 -0
- package/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_0pt47yr.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_01xbj_9._.js +33 -0
- package/.next/server/chunks/ssr/node_modules_01xbj_9._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_1c5ky4f._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_1c5ky4f._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_1n3w9lb._.js +6 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_1n3w9lb._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_0wpq8j3._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_0wpq8j3._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_0symwr9.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_0symwr9.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0q-w892.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0q-w892.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_0l_sp0x.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_0l_sp0x.js.map +1 -0
- package/.next/server/chunks/ssr/src_app_loading_tsx_01g_-m0._.js +3 -0
- package/.next/server/chunks/ssr/src_app_loading_tsx_01g_-m0._.js.map +1 -0
- package/.next/server/middleware-build-manifest.js +24 -1
- package/.next/server/middleware-manifest.json +2 -2
- package/.next/server/next-font-manifest.js +1 -1
- package/.next/server/next-font-manifest.json +15 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages-manifest.json +2 -4
- package/.next/server/prefetch-hints.json +25 -0
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +94 -1
- package/.next/static/chunks/0_j-_aavigxqr.js +345 -0
- package/.next/static/chunks/19mx3mg6lkumu.js +1 -0
- package/.next/static/chunks/1las_6j17xa9p.js +1 -0
- package/.next/static/chunks/1xk6snnh6e5_j.css +3 -0
- package/.next/static/chunks/2-rtuqsgzmno4.js +22 -0
- package/.next/static/chunks/27t_qfc-3_lzs.js +1 -0
- package/.next/static/chunks/310vm2bl3xxpt.js +31 -0
- package/.next/static/chunks/3fntmmi971322.js +1 -0
- package/.next/static/chunks/turbopack-1b6uko1cu_h42.js +1 -0
- package/.next/static/media/4fa387ec64143e14-s.2tuy5pz7dlieh.woff2 +0 -0
- package/.next/static/media/53b9e256198e5412-s.390ncx5urfkfu.woff2 +0 -0
- package/.next/static/media/5ce348bf30bf5439-s.31988l_ccedte.woff2 +0 -0
- package/.next/static/media/6306c77e7c8268e4-s.2dbetqa9o8jxf.woff2 +0 -0
- package/.next/static/media/7178b3e590c64307-s.21jp631_3pja2.woff2 +0 -0
- package/.next/static/media/797e433ab948586e-s.p.0r6juujl39pe6.woff2 +0 -0
- package/.next/static/media/7d817b4c03b0c5f1-s.1uyisp29ctx0d.woff2 +0 -0
- package/.next/static/media/8a480f0b521d4e75-s.1qq4vpdcun5oj.woff2 +0 -0
- package/.next/static/media/bbc41e54d2fcbd21-s.1rgnod-3esatf.woff2 +0 -0
- package/.next/static/media/caa3a2e1cccd8315-s.p.0wgildi0cnwt9.woff2 +0 -0
- package/.next/static/media/favicon.2246eezznj2ab.ico +0 -0
- package/.next/static/media/fef07dbb0973bf53-s.3p2_lha1f2xer.woff2 +0 -0
- package/.next/static/qznDSVYlkQxVdRx-TE_Wk/_buildManifest.js +11 -0
- package/.next/static/qznDSVYlkQxVdRx-TE_Wk/_clientMiddlewareManifest.js +1 -0
- package/README.md +176 -4
- package/bin/pkgviz.ts +57 -29
- package/package.json +57 -36
- package/src/app/actions/audit.actions.ts +7 -49
- package/src/app/globals.css +0 -2
- package/src/app/layout.tsx +3 -2
- package/src/app/loading.tsx +8 -0
- package/src/app/page.tsx +16 -2
- package/src/app/utils/buildGraph.ts +99 -100
- package/src/app/utils/getParsedFileStructure.ts +128 -54
- package/src/app/utils/inspectParserLanguageAsync.ts +39 -0
- package/src/app/utils/markCyclicPackages.ts +45 -185
- package/src/app/utils/parser/cpp/parseCppFile.ts +68 -86
- package/src/app/utils/parser/delphi/parseFile.ts +36 -120
- package/src/app/utils/parser/java/findEntryPoint.ts +2 -1
- package/src/app/utils/parser/java/parseJavaFile.ts +33 -45
- package/src/app/utils/parser/kotlin/parseFile.ts +34 -87
- package/src/app/utils/parser/python/parseFile.ts +30 -100
- package/src/app/utils/parser/typescript/parseFile.ts +17 -52
- package/src/app/utils/selectParserLanguage.ts +39 -0
- package/src/cli/formatAuditRuleFailures.ts +21 -0
- package/src/cli/runAuditAsync.ts +41 -0
- package/src/components/Breadcrumb.tsx +5 -4
- package/src/components/ExportPanel.tsx +53 -0
- package/src/components/Header.tsx +1 -0
- package/src/components/Loader.tsx +8 -2
- package/src/components/ProjectLoadError.tsx +15 -0
- package/src/components/SettingsPanel.tsx +184 -0
- package/src/components/Switch.tsx +9 -17
- package/src/components/ThemeToggle.tsx +2 -1
- package/src/components/ToggleSwitch.tsx +36 -0
- package/src/components/sidebar/Sidebar.tsx +14 -0
- package/src/components/sidebar/SidebarBadge.tsx +25 -0
- package/src/components/sidebar/SidebarRow.tsx +14 -0
- package/src/components/sidebar/SidebarSection.tsx +16 -0
- package/src/components/sidebar/SidebarTabs.tsx +58 -0
- package/src/contexts/SettingsContext.tsx +19 -20
- package/src/features/audit/adapters/inbound/react/AuditRuleList.tsx +76 -0
- package/src/features/audit/adapters/inbound/react/AuditRulePanel.tsx +30 -0
- package/src/features/audit/adapters/inbound/react/CycleInspector.tsx +116 -0
- package/src/features/audit/adapters/inbound/react/CyclicDependenciesRuleDetails.tsx +124 -0
- package/src/features/audit/adapters/inbound/react/useCycleSelection.ts +47 -0
- package/src/features/audit/application/use-cases/createAuditFromSnapshot.ts +28 -0
- package/src/features/audit/application/use-cases/resolveSelectedCycleIds.ts +18 -0
- package/src/features/audit/composition/createAuditAsync.ts +11 -0
- package/src/features/audit/domain/evaluateAuditRules.ts +42 -0
- package/src/features/audit/domain/hasBlockingAuditRuleFailure.ts +6 -0
- package/src/features/audit/domain/resolveAuditConfiguration.ts +27 -0
- package/src/features/audit/utils/cycleVisualization.ts +86 -0
- package/src/features/dependency-analysis/adapters/outbound/dependency-graph/analyzeDependencyImportsAsync.ts +172 -0
- package/src/features/dependency-analysis/adapters/outbound/dependency-graph/analyzeTypeScriptImportsAsync.ts +6 -0
- package/src/features/graph-view/adapters/inbound/react/DependencyGraphView.tsx +184 -0
- package/src/features/graph-view/adapters/inbound/react/GraphZoomControls.tsx +48 -0
- package/src/features/graph-view/adapters/inbound/react/applyGraphInteractionPresentation.ts +35 -0
- package/src/features/graph-view/adapters/inbound/react/createGraphViewModel.ts +240 -0
- package/src/features/graph-view/adapters/inbound/react/createGraphViewStyles.ts +37 -0
- package/src/features/graph-view/adapters/inbound/react/useGraphFocus.ts +104 -0
- package/src/features/graph-view/adapters/inbound/react/useGraphInteractions.ts +50 -0
- package/src/features/graph-view/adapters/inbound/react/useGraphProjection.ts +71 -0
- package/src/features/graph-view/adapters/inbound/react/useGraphViewport.ts +48 -0
- package/src/features/graph-view/domain/getDependencyHighlightClasses.ts +39 -0
- package/src/features/graph-view/domain/reduceGraphInteraction.ts +23 -0
- package/src/features/graph-view/utils/createCompoundOpacityIndex.ts +38 -0
- package/src/features/graph-view/utils/projectVisibleGraph.ts +109 -0
- package/src/features/graph-view/utils/readNodeDefinitionId.ts +7 -0
- package/src/features/graph-view/utils/removeEmptyStructuralNodes.ts +27 -0
- package/src/features/project-analysis/adapters/outbound/filesystem/readProjectSnapshotAsync.ts +12 -0
- package/src/features/project-analysis/application/use-cases/createProjectSnapshotReader.ts +29 -0
- package/src/features/project-analysis/composition/loadProjectOverviewAsync.ts +14 -0
- package/src/features/project-analysis/composition/loadProjectSnapshotAsync.ts +12 -0
- package/src/features/project-tree/adapters/inbound/react/ProjectTreePanel.tsx +52 -0
- package/src/features/project-tree/adapters/inbound/react/useProjectTreeExpansion.ts +46 -0
- package/src/features/project-tree/application/use-cases/buildProjectTree.ts +61 -0
- package/src/features/project-tree/application/use-cases/resolveProjectTreeNavigation.ts +13 -0
- package/src/features/project-tree/utils/findProjectTreeNode.ts +14 -0
- package/src/features/project-tree/utils/findProjectTreeNodeByGraphPackage.ts +21 -0
- package/src/features/project-tree/utils/getProjectTreeAncestorIds.ts +26 -0
- package/src/features/settings/utils/readSettingsEnvironment.ts +53 -0
- package/src/i18n/en.ts +21 -2
- package/src/i18n/i18n.ts +2 -3
- package/src/layouts/breadthfirst/style.ts +1 -0
- package/src/layouts/circle/style.ts +1 -0
- package/src/layouts/concentric/style.ts +1 -0
- package/src/layouts/elk/layout.ts +1 -3
- package/src/layouts/elk/style.ts +1 -0
- package/src/layouts/getWeightBuckets.ts +3 -1
- package/src/layouts/grid/style.ts +1 -0
- package/src/layouts/index.ts +0 -4
- package/src/layouts/style.ts +172 -25
- package/src/screens/home/Home.tsx +73 -25
- package/src/screens/home/HomeGraph.tsx +43 -0
- package/src/screens/home/HomeSidebar.tsx +129 -0
- package/src/shared/types/index.ts +0 -9
- package/src/shared/utils/getProjectName.ts +4 -1
- package/src/shared/utils/parseProjectPath.ts +1 -0
- package/src/shared/utils/toPosix.ts +1 -1
- package/src/types/audit.ts +76 -0
- package/src/types/auditVisualization.ts +22 -0
- package/src/types/graphInteraction.ts +9 -0
- package/src/types/parserSelection.ts +11 -0
- package/src/types/projectAnalysis.ts +20 -0
- package/src/types/projectAnalysisActionResult.ts +2 -0
- package/src/types/projectTree.ts +7 -0
- package/src/utils/filter/filterByPackagePrefix.ts +25 -7
- package/src/utils/filter/filterEmptyPackages.ts +28 -29
- package/src/utils/filter/filterSubPackagesFromDepth.ts +20 -17
- package/src/utils/filter/filterVendorPackages.ts +1 -1
- package/src/utils/filter/isIntrinsicGraphNode.ts +8 -0
- package/src/utils/filter/toggleCompoundNodes.ts +41 -31
- package/src/utils/runProjectAnalysisActionAsync.ts +14 -0
- package/tsconfig.json +11 -3
- package/.next/app-build-manifest.json +0 -29
- package/.next/cache/.previewinfo +0 -1
- package/.next/cache/.rscinfo +0 -1
- package/.next/cache/.tsbuildinfo +0 -1
- package/.next/cache/chrome-devtools-workspace-uuid +0 -1
- package/.next/cache/eslint/.cache_6t30dc +0 -1
- package/.next/cache/webpack/client-production/0.pack +0 -4
- package/.next/cache/webpack/client-production/1.pack +0 -0
- package/.next/cache/webpack/client-production/10.pack +0 -0
- package/.next/cache/webpack/client-production/11.pack +0 -0
- package/.next/cache/webpack/client-production/12.pack +0 -0
- package/.next/cache/webpack/client-production/13.pack +0 -0
- package/.next/cache/webpack/client-production/14.pack +0 -0
- package/.next/cache/webpack/client-production/15.pack +0 -0
- package/.next/cache/webpack/client-production/16.pack +0 -0
- package/.next/cache/webpack/client-production/2.pack +0 -0
- package/.next/cache/webpack/client-production/3.pack +0 -0
- package/.next/cache/webpack/client-production/4.pack +0 -0
- package/.next/cache/webpack/client-production/5.pack +0 -0
- package/.next/cache/webpack/client-production/6.pack +0 -0
- package/.next/cache/webpack/client-production/7.pack +0 -0
- package/.next/cache/webpack/client-production/8.pack +0 -0
- package/.next/cache/webpack/client-production/9.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack.old +0 -0
- package/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/.next/cache/webpack/edge-server-production/index.pack.old +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/1.pack +0 -0
- package/.next/cache/webpack/server-production/10.pack +0 -4
- package/.next/cache/webpack/server-production/11.pack +0 -0
- package/.next/cache/webpack/server-production/12.pack +0 -0
- package/.next/cache/webpack/server-production/13.pack +0 -0
- package/.next/cache/webpack/server-production/14.pack +0 -0
- package/.next/cache/webpack/server-production/15.pack +0 -0
- package/.next/cache/webpack/server-production/16.pack +0 -0
- package/.next/cache/webpack/server-production/17.pack +0 -0
- package/.next/cache/webpack/server-production/18.pack +0 -4
- package/.next/cache/webpack/server-production/2.pack +0 -0
- package/.next/cache/webpack/server-production/3.pack +0 -0
- package/.next/cache/webpack/server-production/4.pack +0 -0
- package/.next/cache/webpack/server-production/5.pack +0 -0
- package/.next/cache/webpack/server-production/6.pack +0 -0
- package/.next/cache/webpack/server-production/7.pack +0 -0
- package/.next/cache/webpack/server-production/8.pack +0 -0
- package/.next/cache/webpack/server-production/9.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack.old +0 -0
- package/.next/diagnostics/build-diagnostics.json +0 -6
- package/.next/diagnostics/framework.json +0 -1
- package/.next/server/app/index.html +0 -1
- package/.next/server/app/index.meta +0 -7
- package/.next/server/app/index.rsc +0 -20
- package/.next/server/chunks/548.js +0 -6
- package/.next/server/chunks/610.js +0 -7
- package/.next/server/chunks/985.js +0 -22
- package/.next/server/middleware-react-loadable-manifest.js +0 -1
- package/.next/server/pages/_app.js +0 -1
- package/.next/server/pages/_app.js.nft.json +0 -1
- package/.next/server/pages/_document.js +0 -1
- package/.next/server/pages/_document.js.nft.json +0 -1
- package/.next/server/pages/_error.js +0 -19
- package/.next/server/pages/_error.js.nft.json +0 -1
- package/.next/server/webpack-runtime.js +0 -1
- package/.next/static/_YC2p40ZiYT2Gcw-h_tjC/_buildManifest.js +0 -1
- package/.next/static/chunks/4bd1b696-cf72ae8a39fa05aa.js +0 -1
- package/.next/static/chunks/680-55ad17895c8fb70b.js +0 -1
- package/.next/static/chunks/90542734-29e255269788f1bd.js +0 -1
- package/.next/static/chunks/91dbc596-b9cdccd3f5cba95d.js +0 -1
- package/.next/static/chunks/964-b440f7af22c41ca5.js +0 -1
- package/.next/static/chunks/app/_not-found/page-11e4fea8e290f304.js +0 -1
- package/.next/static/chunks/app/layout-8aae7fba5ed8afb3.js +0 -1
- package/.next/static/chunks/app/page-91450b1230da8bca.js +0 -1
- package/.next/static/chunks/framework-bc35dade6ff9684e.js +0 -1
- package/.next/static/chunks/main-9e86d333c1e02dd1.js +0 -1
- package/.next/static/chunks/main-app-69a9ff75ff3465ca.js +0 -1
- package/.next/static/chunks/pages/_app-0a0020ddd67f79cf.js +0 -1
- package/.next/static/chunks/pages/_error-03529f2c21436739.js +0 -1
- package/.next/static/chunks/webpack-7adfafc806738767.js +0 -1
- package/.next/static/css/ec31779168107a11.css +0 -3
- package/.next/static/media/4cf2300e9c8272f7-s.p.woff2 +0 -0
- package/.next/static/media/747892c23ea88013-s.woff2 +0 -0
- package/.next/static/media/8d697b304b401681-s.woff2 +0 -0
- package/.next/static/media/93f479601ee12b01-s.p.woff2 +0 -0
- package/.next/static/media/9610d9e46709d722-s.woff2 +0 -0
- package/.next/static/media/ba015fad6dcf6784-s.woff2 +0 -0
- package/.next/trace +0 -2
- package/.next/types/app/layout.ts +0 -84
- package/.next/types/app/page.ts +0 -84
- package/.next/types/cache-life.d.ts +0 -141
- package/.next/types/package.json +0 -1
- package/src/app/actions/graph.actions.ts +0 -25
- package/src/app/utils/parser/cpp/extractCppPackageFromImport.ts +0 -18
- package/src/app/utils/parser/delphi/extractPackageFromImport.ts +0 -21
- package/src/app/utils/parser/java/extractJavaPackageFromImport.ts +0 -39
- package/src/app/utils/parser/java/getIntrinsicPackagesRecursive.ts +0 -33
- package/src/app/utils/parser/kotlin/extractPackageFromImport.ts +0 -19
- package/src/app/utils/parser/python/extractPythonPackageFromImport.ts +0 -18
- package/src/app/utils/parser/typescript/extractTypeScriptPackageFromImport.ts +0 -18
- package/src/components/Cytoscape.tsx +0 -23
- package/src/components/Setting.tsx +0 -17
- package/src/components/Settings.tsx +0 -189
- package/src/components/ZoomInput.tsx +0 -94
- package/src/components/useCytoscape.ts +0 -343
- package/src/layouts/getLayoutStyle.ts +0 -19
- package/src/shared/utils/detectLanguage.ts +0 -255
- package/src/shared/utils/getJsonAsync.ts +0 -13
- package/src/shared/utils/parseEnv.ts +0 -91
- package/src/store/useLocalStorage.ts +0 -29
- package/src/utils/hasChildren.ts +0 -7
- /package/.next/{react-loadable-manifest.json → server/app/_global-error/page/react-loadable-manifest.json} +0 -0
- /package/.next/static/chunks/{polyfills-42372ed130431b0a.js → 0cz1d0mv5g_q7.js} +0 -0
- /package/.next/static/{_YC2p40ZiYT2Gcw-h_tjC → qznDSVYlkQxVdRx-TE_Wk}/_ssgManifest.js +0 -0
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
'use server';
|
|
2
|
-
import { Language, type LanguageDetectionResult } from '@/shared/types';
|
|
3
|
-
|
|
4
|
-
import fs from 'node:fs';
|
|
5
|
-
import path from 'node:path';
|
|
6
|
-
|
|
7
|
-
export async function detectLanguage(directoryPath: string): Promise<LanguageDetectionResult> {
|
|
8
|
-
// Check if directory exists
|
|
9
|
-
if (!fs.existsSync(directoryPath) || !fs.statSync(directoryPath).isDirectory()) {
|
|
10
|
-
throw new Error(`Directory does not exist: ${directoryPath}`);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const files = fs.readdirSync(directoryPath);
|
|
14
|
-
const indicators: Record<Language, string[]> = {
|
|
15
|
-
[Language.JavaScript]: [],
|
|
16
|
-
[Language.TypeScript]: [],
|
|
17
|
-
[Language.Java]: [],
|
|
18
|
-
[Language.Cpp]: [],
|
|
19
|
-
[Language.Python]: [],
|
|
20
|
-
[Language.Delphi]: [],
|
|
21
|
-
[Language.Kotlin]: [],
|
|
22
|
-
[Language.Unknown]: [],
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
// Check for JavaScript indicators
|
|
26
|
-
if (files.includes('package.json') && !files.includes('tsconfig.json')) {
|
|
27
|
-
indicators[Language.JavaScript].push('package.json without tsconfig.json');
|
|
28
|
-
}
|
|
29
|
-
if (files.some(file => file.endsWith('.js') || file.endsWith('.jsx'))) {
|
|
30
|
-
indicators[Language.JavaScript].push('.js/.jsx files');
|
|
31
|
-
}
|
|
32
|
-
if (files.includes('node_modules')) {
|
|
33
|
-
indicators[Language.JavaScript].push('node_modules directory');
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Check for TypeScript indicators
|
|
37
|
-
if (files.includes('tsconfig.json')) {
|
|
38
|
-
indicators[Language.TypeScript].push('tsconfig.json');
|
|
39
|
-
}
|
|
40
|
-
if (files.some(file => file.endsWith('.ts') || file.endsWith('.tsx'))) {
|
|
41
|
-
indicators[Language.TypeScript].push('.ts/.tsx files');
|
|
42
|
-
}
|
|
43
|
-
if (files.includes('package.json')) {
|
|
44
|
-
try {
|
|
45
|
-
const packageJson = JSON.parse(
|
|
46
|
-
fs.readFileSync(path.join(directoryPath, 'package.json'), 'utf8')
|
|
47
|
-
);
|
|
48
|
-
if (packageJson.dependencies?.typescript || packageJson.devDependencies?.typescript) {
|
|
49
|
-
indicators[Language.TypeScript].push('typescript dependency');
|
|
50
|
-
}
|
|
51
|
-
} catch (error) {
|
|
52
|
-
console.error(error);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Check for Java indicators
|
|
57
|
-
if (files.includes('pom.xml')) {
|
|
58
|
-
indicators[Language.Java].push('pom.xml');
|
|
59
|
-
}
|
|
60
|
-
if (files.includes('build.gradle') || files.includes('build.gradle.kts')) {
|
|
61
|
-
indicators[Language.Java].push('gradle build file');
|
|
62
|
-
}
|
|
63
|
-
if (files.some(file => file.endsWith('.java'))) {
|
|
64
|
-
indicators[Language.Java].push('.java files');
|
|
65
|
-
}
|
|
66
|
-
if (files.includes('.mvn') || files.includes('mvnw') || files.includes('mvnw.cmd')) {
|
|
67
|
-
indicators[Language.Java].push('Maven wrapper');
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Check for C++ indicators
|
|
71
|
-
if (files.includes('CMakeLists.txt')) {
|
|
72
|
-
indicators[Language.Cpp].push('CMakeLists.txt');
|
|
73
|
-
}
|
|
74
|
-
if (files.includes('Makefile')) {
|
|
75
|
-
indicators[Language.Cpp].push('Makefile');
|
|
76
|
-
}
|
|
77
|
-
if (files.some(file => file.endsWith('.cpp') || file.endsWith('.cc') || file.endsWith('.cxx'))) {
|
|
78
|
-
indicators[Language.Cpp].push('.cpp/.cc/.cxx files');
|
|
79
|
-
}
|
|
80
|
-
if (files.some(file => file.endsWith('.h') || file.endsWith('.hpp') || file.endsWith('.hxx'))) {
|
|
81
|
-
indicators[Language.Cpp].push('.h/.hpp/.hxx header files');
|
|
82
|
-
}
|
|
83
|
-
if (files.includes('conanfile.txt') || files.includes('conanfile.py')) {
|
|
84
|
-
indicators[Language.Cpp].push('Conan package manager');
|
|
85
|
-
}
|
|
86
|
-
if (files.includes('vcpkg.json')) {
|
|
87
|
-
indicators[Language.Cpp].push('vcpkg package manager');
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// Check for Python indicators
|
|
91
|
-
if (files.includes('requirements.txt')) {
|
|
92
|
-
indicators[Language.Python].push('requirements.txt');
|
|
93
|
-
}
|
|
94
|
-
if (files.includes('setup.py') || files.includes('setup.cfg')) {
|
|
95
|
-
indicators[Language.Python].push('setup.py/setup.cfg');
|
|
96
|
-
}
|
|
97
|
-
if (files.includes('pyproject.toml')) {
|
|
98
|
-
indicators[Language.Python].push('pyproject.toml');
|
|
99
|
-
}
|
|
100
|
-
if (files.includes('Pipfile') || files.includes('Pipfile.lock')) {
|
|
101
|
-
indicators[Language.Python].push('Pipfile');
|
|
102
|
-
}
|
|
103
|
-
if (files.includes('poetry.lock')) {
|
|
104
|
-
indicators[Language.Python].push('poetry.lock');
|
|
105
|
-
}
|
|
106
|
-
if (files.some(file => file.endsWith('.py'))) {
|
|
107
|
-
indicators[Language.Python].push('.py files');
|
|
108
|
-
}
|
|
109
|
-
if (files.includes('__pycache__') || files.some(file => file === '__init__.py')) {
|
|
110
|
-
indicators[Language.Python].push('Python cache/module markers');
|
|
111
|
-
}
|
|
112
|
-
if (files.includes('venv') || files.includes('.venv') || files.includes('env')) {
|
|
113
|
-
indicators[Language.Python].push('virtual environment');
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// Check for Delphi indicators
|
|
117
|
-
if (files.some(file => file.endsWith('.dpr') || file.endsWith('.dproj'))) {
|
|
118
|
-
indicators[Language.Delphi].push('.dpr/.dproj project files');
|
|
119
|
-
}
|
|
120
|
-
if (files.some(file => file.endsWith('.pas') || file.endsWith('.pp'))) {
|
|
121
|
-
indicators[Language.Delphi].push('.pas/.pp unit files');
|
|
122
|
-
}
|
|
123
|
-
if (files.some(file => file.endsWith('.dfm') || file.endsWith('.fmx'))) {
|
|
124
|
-
indicators[Language.Delphi].push('.dfm/.fmx form files');
|
|
125
|
-
}
|
|
126
|
-
if (files.some(file => file.endsWith('.dpk'))) {
|
|
127
|
-
indicators[Language.Delphi].push('.dpk package files');
|
|
128
|
-
}
|
|
129
|
-
if (files.some(file => file.endsWith('.dcu') || file.endsWith('.dcu'))) {
|
|
130
|
-
indicators[Language.Delphi].push('compiled unit files');
|
|
131
|
-
}
|
|
132
|
-
if (files.includes('Win32') || files.includes('Win64')) {
|
|
133
|
-
indicators[Language.Delphi].push('Delphi platform directories');
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// Check for Kotlin indicators
|
|
137
|
-
if (files.includes('build.gradle.kts')) {
|
|
138
|
-
indicators[Language.Kotlin].push('build.gradle.kts');
|
|
139
|
-
}
|
|
140
|
-
if (files.some(file => file.endsWith('.kt') || file.endsWith('.kts'))) {
|
|
141
|
-
indicators[Language.Kotlin].push('.kt/.kts files');
|
|
142
|
-
}
|
|
143
|
-
if (files.includes('build.gradle')) {
|
|
144
|
-
try {
|
|
145
|
-
const buildGradle = fs.readFileSync(path.join(directoryPath, 'build.gradle'), 'utf8');
|
|
146
|
-
if (buildGradle.includes('kotlin') || buildGradle.includes('org.jetbrains.kotlin')) {
|
|
147
|
-
indicators[Language.Kotlin].push('Kotlin plugin in Gradle');
|
|
148
|
-
}
|
|
149
|
-
} catch (error) {
|
|
150
|
-
console.error(error);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
if (files.includes('pom.xml')) {
|
|
154
|
-
try {
|
|
155
|
-
const pomXml = fs.readFileSync(path.join(directoryPath, 'pom.xml'), 'utf8');
|
|
156
|
-
if (pomXml.includes('kotlin-maven-plugin') || pomXml.includes('kotlin-stdlib')) {
|
|
157
|
-
indicators[Language.Kotlin].push('Kotlin plugin in Maven');
|
|
158
|
-
}
|
|
159
|
-
} catch (error) {
|
|
160
|
-
console.error(error);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
if (files.includes('settings.gradle.kts')) {
|
|
164
|
-
indicators[Language.Kotlin].push('settings.gradle.kts');
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
// Determine the most likely language
|
|
168
|
-
const counts = {
|
|
169
|
-
[Language.JavaScript]: indicators[Language.JavaScript].length,
|
|
170
|
-
[Language.TypeScript]: indicators[Language.TypeScript].length,
|
|
171
|
-
[Language.Java]: indicators[Language.Java].length,
|
|
172
|
-
[Language.Cpp]: indicators[Language.Cpp].length,
|
|
173
|
-
[Language.Python]: indicators[Language.Python].length,
|
|
174
|
-
[Language.Delphi]: indicators[Language.Delphi].length,
|
|
175
|
-
[Language.Kotlin]: indicators[Language.Kotlin].length, // Added Kotlin to counts
|
|
176
|
-
[Language.Unknown]: 0,
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
let detectedLanguage = Language.Unknown;
|
|
180
|
-
let maxCount = 0;
|
|
181
|
-
|
|
182
|
-
for (const [language, count] of Object.entries(counts)) {
|
|
183
|
-
if (count > maxCount) {
|
|
184
|
-
maxCount = count;
|
|
185
|
-
detectedLanguage = language as Language;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// Calculate confidence (0-1)
|
|
190
|
-
const totalIndicators = Object.values(counts).reduce((sum, count) => sum + count, 0);
|
|
191
|
-
const confidence = totalIndicators > 0 ? maxCount / totalIndicators : 0;
|
|
192
|
-
|
|
193
|
-
return {
|
|
194
|
-
language: detectedLanguage,
|
|
195
|
-
confidence,
|
|
196
|
-
indicators: indicators[detectedLanguage],
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
export async function isJavaScriptRoot(directoryPath: string): Promise<boolean> {
|
|
201
|
-
const files = fs.readdirSync(directoryPath);
|
|
202
|
-
return files.includes('package.json') && !files.includes('tsconfig.json');
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
export async function isTypeScriptRoot(directoryPath: string): Promise<boolean> {
|
|
206
|
-
const files = fs.readdirSync(directoryPath);
|
|
207
|
-
return files.includes('tsconfig.json') && files.includes('package.json');
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
export async function isJavaRoot(directoryPath: string): Promise<boolean> {
|
|
211
|
-
const files = fs.readdirSync(directoryPath);
|
|
212
|
-
return (
|
|
213
|
-
files.includes('pom.xml') ||
|
|
214
|
-
files.some(file => file.endsWith('.java')) ||
|
|
215
|
-
files.includes('build.gradle') ||
|
|
216
|
-
files.includes('build.gradle.kts')
|
|
217
|
-
);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
export async function isCppRoot(directoryPath: string): Promise<boolean> {
|
|
221
|
-
const files = fs.readdirSync(directoryPath);
|
|
222
|
-
return (
|
|
223
|
-
files.includes('CMakeLists.txt') ||
|
|
224
|
-
files.includes('Makefile') ||
|
|
225
|
-
files.some(file => file.endsWith('.cpp') || file.endsWith('.cc') || file.endsWith('.cxx'))
|
|
226
|
-
);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
export async function isPythonRoot(directoryPath: string): Promise<boolean> {
|
|
230
|
-
const files = fs.readdirSync(directoryPath);
|
|
231
|
-
return (
|
|
232
|
-
files.includes('requirements.txt') ||
|
|
233
|
-
files.includes('setup.py') ||
|
|
234
|
-
files.includes('pyproject.toml') ||
|
|
235
|
-
files.some(file => file.endsWith('.py'))
|
|
236
|
-
);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
export async function isDelphiRoot(directoryPath: string): Promise<boolean> {
|
|
240
|
-
const files = fs.readdirSync(directoryPath);
|
|
241
|
-
return (
|
|
242
|
-
files.some(file => file.endsWith('.dpr') || file.endsWith('.dproj')) ||
|
|
243
|
-
files.some(file => file.endsWith('.pas') || file.endsWith('.pp'))
|
|
244
|
-
);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
export async function isKotlinRoot(directoryPath: string): Promise<boolean> {
|
|
248
|
-
const files = fs.readdirSync(directoryPath);
|
|
249
|
-
return (
|
|
250
|
-
files.includes('build.gradle.kts') ||
|
|
251
|
-
files.some(file => file.endsWith('.kt')) ||
|
|
252
|
-
(files.includes('build.gradle') &&
|
|
253
|
-
fs.readFileSync(path.join(directoryPath, 'build.gradle'), 'utf8').includes('kotlin'))
|
|
254
|
-
);
|
|
255
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const headers = { contentType: 'application/json' };
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Fetches JSON data from the specified URL.
|
|
5
|
-
* @param url - The URL to fetch JSON data from.
|
|
6
|
-
* @returns The fetched JSON data typed as T.
|
|
7
|
-
*/
|
|
8
|
-
export async function getJsonAsync<T>(url: string) {
|
|
9
|
-
const res = await fetch(url, { headers });
|
|
10
|
-
const json: T = await res.json();
|
|
11
|
-
|
|
12
|
-
return json;
|
|
13
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parses an environment variable value into the appropriate type.
|
|
3
|
-
* @example 'true' => true
|
|
4
|
-
* @example 'false' => false
|
|
5
|
-
* @example '123' => 123
|
|
6
|
-
* @example 'text' => 'text'
|
|
7
|
-
*/
|
|
8
|
-
export const parseEnv = (name: string, value: string | undefined) => {
|
|
9
|
-
if (!value) return undefined;
|
|
10
|
-
if (value === 'true') return true;
|
|
11
|
-
if (value === 'false') return false;
|
|
12
|
-
if (!isNaN(Number(value))) return Number(value);
|
|
13
|
-
return value;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Determines the active Cytoscape layout
|
|
18
|
-
* @default 'concentric'
|
|
19
|
-
* @todo Create enum for the layouts
|
|
20
|
-
* @returns 'grid' | 'circle' | 'elk' | 'concentric'
|
|
21
|
-
*/
|
|
22
|
-
export const getCytoscapeLayout = () => {
|
|
23
|
-
const env = parseEnv('NEXT_PUBLIC_SETTINGS_LAYOUT', process.env.NEXT_PUBLIC_SETTINGS_LAYOUT);
|
|
24
|
-
return env === 'grid'
|
|
25
|
-
? 'grid'
|
|
26
|
-
: env === 'circle'
|
|
27
|
-
? 'circle'
|
|
28
|
-
: env === 'elk'
|
|
29
|
-
? 'elk'
|
|
30
|
-
: 'concentric';
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Determines the active Cytoscape layout spacing.
|
|
35
|
-
* @returns number
|
|
36
|
-
* @default 1
|
|
37
|
-
* @min 0.1
|
|
38
|
-
* @max 1
|
|
39
|
-
*/
|
|
40
|
-
export const getCytoscapeLayoutSpacing = () => {
|
|
41
|
-
const env = parseEnv(
|
|
42
|
-
'NEXT_PUBLIC_SETTINGS_LAYOUT_SPACING',
|
|
43
|
-
process.env.NEXT_PUBLIC_SETTINGS_LAYOUT_SPACING
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
return isNaN(Number(env)) ? 1 : Number(env);
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Determines whether to show compound nodes.
|
|
51
|
-
* @default true
|
|
52
|
-
* @returns boolean
|
|
53
|
-
*/
|
|
54
|
-
export const getShowCompoundNodes = () => {
|
|
55
|
-
const env = parseEnv(
|
|
56
|
-
'NEXT_PUBLIC_SETTINGS_SHOW_COMPOUNDNODES',
|
|
57
|
-
process.env.NEXT_PUBLIC_SETTINGS_SHOW_COMPOUNDNODES
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
return env === false ? false : true;
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Determines whether to show vendor packages.
|
|
65
|
-
* @default false
|
|
66
|
-
* @returns boolean
|
|
67
|
-
*/
|
|
68
|
-
export const getShowVendorPackages = () => {
|
|
69
|
-
const env = parseEnv(
|
|
70
|
-
'NEXT_PUBLIC_SETTINGS_SHOW_VENDORPACKAGES',
|
|
71
|
-
process.env.NEXT_PUBLIC_SETTINGS_SHOW_VENDORPACKAGES
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
return env === true ? true : false;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Determines how many subpackage levels to show.
|
|
79
|
-
* @default 1
|
|
80
|
-
* @min 1
|
|
81
|
-
* @max {automatic based on package depth}
|
|
82
|
-
* @returns number
|
|
83
|
-
*/
|
|
84
|
-
export const getSubPackageDepth = () => {
|
|
85
|
-
const env = parseEnv(
|
|
86
|
-
'NEXT_PUBLIC_SETTINGS_SUBPACKAGE_DEPTH',
|
|
87
|
-
process.env.NEXT_PUBLIC_SETTINGS_SUBPACKAGE_DEPTH
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
return typeof env === 'string' && env.length ? parseInt(env) : 1;
|
|
91
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
|
|
3
|
-
export function useLocalStorage<T>(key: string, initialValue: T) {
|
|
4
|
-
const [storedValue, setStoredValue] = useState<T>(() => {
|
|
5
|
-
if (typeof window === 'undefined') return initialValue;
|
|
6
|
-
|
|
7
|
-
try {
|
|
8
|
-
const item = window.localStorage.getItem(key);
|
|
9
|
-
return item ? (JSON.parse(item) as T) : initialValue;
|
|
10
|
-
} catch (error) {
|
|
11
|
-
console.warn(`Error reading localStorage key "${key}":`, error);
|
|
12
|
-
return initialValue;
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const setValue = (value: T | ((val: T) => T)) => {
|
|
17
|
-
try {
|
|
18
|
-
const valueToStore = value instanceof Function ? value(storedValue) : value;
|
|
19
|
-
setStoredValue(valueToStore);
|
|
20
|
-
if (typeof window !== 'undefined') {
|
|
21
|
-
window.localStorage.setItem(key, JSON.stringify(valueToStore));
|
|
22
|
-
}
|
|
23
|
-
} catch (error) {
|
|
24
|
-
console.warn(`Error setting localStorage key "${key}":`, error);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
return [storedValue, setValue] as const;
|
|
29
|
-
}
|
package/src/utils/hasChildren.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { NodeDataDefinition, NodeDefinition } from 'cytoscape';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Checks if a node (package) has children based on id prefix.
|
|
5
|
-
*/
|
|
6
|
-
export const hasChildren = (node: NodeDefinition, nodes: NodeDataDefinition[]) =>
|
|
7
|
-
nodes.some(n => n.data.id?.startsWith(`${node.data.id}.`));
|
|
File without changes
|
|
File without changes
|
|
File without changes
|