@colbymchenry/codegraph-win32-arm64 1.6.0 → 1.6.2
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/bin/codegraph +5 -0
- package/lib/dist/.test-build-engine.json +1 -0
- package/lib/dist/.test-build-viewer.json +1 -0
- package/lib/dist/bin/codegraph.d.ts +1 -0
- package/lib/dist/bin/codegraph.d.ts.map +1 -1
- package/lib/dist/bin/codegraph.js +605 -291
- package/lib/dist/bin/codegraph.js.map +1 -1
- package/lib/dist/bin/command-supervision.d.ts +7 -0
- package/lib/dist/bin/command-supervision.d.ts.map +1 -1
- package/lib/dist/bin/command-supervision.js +39 -27
- package/lib/dist/bin/command-supervision.js.map +1 -1
- package/lib/dist/bin/viewer-gate.d.ts +17 -0
- package/lib/dist/bin/viewer-gate.d.ts.map +1 -0
- package/lib/dist/bin/viewer-gate.js +31 -0
- package/lib/dist/bin/viewer-gate.js.map +1 -0
- package/lib/dist/context/index.d.ts.map +1 -1
- package/lib/dist/context/index.js +43 -2
- package/lib/dist/context/index.js.map +1 -1
- package/lib/dist/db/index.d.ts +21 -2
- package/lib/dist/db/index.d.ts.map +1 -1
- package/lib/dist/db/index.js +86 -31
- package/lib/dist/db/index.js.map +1 -1
- package/lib/dist/db/migrations.d.ts +1 -1
- package/lib/dist/db/migrations.d.ts.map +1 -1
- package/lib/dist/db/migrations.js +40 -1
- package/lib/dist/db/migrations.js.map +1 -1
- package/lib/dist/db/queries.d.ts +454 -10
- package/lib/dist/db/queries.d.ts.map +1 -1
- package/lib/dist/db/queries.js +1080 -41
- package/lib/dist/db/queries.js.map +1 -1
- package/lib/dist/db/schema.sql +11 -1
- package/lib/dist/db/sqlite-adapter.d.ts +2 -0
- package/lib/dist/db/sqlite-adapter.d.ts.map +1 -1
- package/lib/dist/db/sqlite-adapter.js +56 -7
- package/lib/dist/db/sqlite-adapter.js.map +1 -1
- package/lib/dist/db/synthesis-stage.d.ts +12 -0
- package/lib/dist/db/synthesis-stage.d.ts.map +1 -0
- package/lib/dist/db/synthesis-stage.js +89 -0
- package/lib/dist/db/synthesis-stage.js.map +1 -0
- package/lib/dist/db/wal-valve.d.ts +32 -12
- package/lib/dist/db/wal-valve.d.ts.map +1 -1
- package/lib/dist/db/wal-valve.js +65 -22
- package/lib/dist/db/wal-valve.js.map +1 -1
- package/lib/dist/db/wsl-shared-index.d.ts +53 -0
- package/lib/dist/db/wsl-shared-index.d.ts.map +1 -0
- package/lib/dist/db/wsl-shared-index.js +121 -0
- package/lib/dist/db/wsl-shared-index.js.map +1 -0
- package/lib/dist/directory.d.ts +131 -2
- package/lib/dist/directory.d.ts.map +1 -1
- package/lib/dist/directory.js +299 -23
- package/lib/dist/directory.js.map +1 -1
- package/lib/dist/errors.d.ts +14 -0
- package/lib/dist/errors.d.ts.map +1 -1
- package/lib/dist/errors.js +16 -1
- package/lib/dist/errors.js.map +1 -1
- package/lib/dist/extraction/astro-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/astro-extractor.js +7 -35
- package/lib/dist/extraction/astro-extractor.js.map +1 -1
- package/lib/dist/extraction/cfml-extractor.d.ts +77 -10
- package/lib/dist/extraction/cfml-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/cfml-extractor.js +302 -71
- package/lib/dist/extraction/cfml-extractor.js.map +1 -1
- package/lib/dist/extraction/commonjs-requires.d.ts +23 -0
- package/lib/dist/extraction/commonjs-requires.d.ts.map +1 -0
- package/lib/dist/extraction/commonjs-requires.js +68 -0
- package/lib/dist/extraction/commonjs-requires.js.map +1 -0
- package/lib/dist/extraction/dfm-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/dfm-extractor.js +14 -10
- package/lib/dist/extraction/dfm-extractor.js.map +1 -1
- package/lib/dist/extraction/extraction-version.d.ts +1 -1
- package/lib/dist/extraction/extraction-version.js +1 -1
- package/lib/dist/extraction/function-ref.d.ts +6 -4
- package/lib/dist/extraction/function-ref.d.ts.map +1 -1
- package/lib/dist/extraction/function-ref.js +35 -14
- package/lib/dist/extraction/function-ref.js.map +1 -1
- package/lib/dist/extraction/generated-detection.d.ts +9 -0
- package/lib/dist/extraction/generated-detection.d.ts.map +1 -1
- package/lib/dist/extraction/generated-detection.js +42 -2
- package/lib/dist/extraction/generated-detection.js.map +1 -1
- package/lib/dist/extraction/grammars.d.ts +40 -0
- package/lib/dist/extraction/grammars.d.ts.map +1 -1
- package/lib/dist/extraction/grammars.js +171 -1
- package/lib/dist/extraction/grammars.js.map +1 -1
- package/lib/dist/extraction/index.d.ts +132 -19
- package/lib/dist/extraction/index.d.ts.map +1 -1
- package/lib/dist/extraction/index.js +825 -195
- package/lib/dist/extraction/index.js.map +1 -1
- package/lib/dist/extraction/kernel/index.d.ts.map +1 -1
- package/lib/dist/extraction/kernel/index.js +6 -0
- package/lib/dist/extraction/kernel/index.js.map +1 -1
- package/lib/dist/extraction/languages/c-cpp.d.ts +73 -0
- package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
- package/lib/dist/extraction/languages/c-cpp.js +412 -16
- package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
- package/lib/dist/extraction/languages/csharp.d.ts.map +1 -1
- package/lib/dist/extraction/languages/csharp.js +14 -5
- package/lib/dist/extraction/languages/csharp.js.map +1 -1
- package/lib/dist/extraction/languages/dart.d.ts.map +1 -1
- package/lib/dist/extraction/languages/dart.js +16 -3
- package/lib/dist/extraction/languages/dart.js.map +1 -1
- package/lib/dist/extraction/languages/javascript.js +1 -1
- package/lib/dist/extraction/languages/javascript.js.map +1 -1
- package/lib/dist/extraction/languages/kotlin.d.ts +4 -0
- package/lib/dist/extraction/languages/kotlin.d.ts.map +1 -1
- package/lib/dist/extraction/languages/kotlin.js +237 -36
- package/lib/dist/extraction/languages/kotlin.js.map +1 -1
- package/lib/dist/extraction/languages/lua.d.ts.map +1 -1
- package/lib/dist/extraction/languages/lua.js +4 -1
- package/lib/dist/extraction/languages/lua.js.map +1 -1
- package/lib/dist/extraction/languages/python.d.ts.map +1 -1
- package/lib/dist/extraction/languages/python.js +71 -0
- package/lib/dist/extraction/languages/python.js.map +1 -1
- package/lib/dist/extraction/languages/rust.d.ts.map +1 -1
- package/lib/dist/extraction/languages/rust.js +3 -0
- package/lib/dist/extraction/languages/rust.js.map +1 -1
- package/lib/dist/extraction/languages/scala.d.ts.map +1 -1
- package/lib/dist/extraction/languages/scala.js +18 -3
- package/lib/dist/extraction/languages/scala.js.map +1 -1
- package/lib/dist/extraction/languages/swift.d.ts +15 -0
- package/lib/dist/extraction/languages/swift.d.ts.map +1 -1
- package/lib/dist/extraction/languages/swift.js +50 -0
- package/lib/dist/extraction/languages/swift.js.map +1 -1
- package/lib/dist/extraction/languages/typescript.d.ts +7 -0
- package/lib/dist/extraction/languages/typescript.d.ts.map +1 -1
- package/lib/dist/extraction/languages/typescript.js +30 -2
- package/lib/dist/extraction/languages/typescript.js.map +1 -1
- package/lib/dist/extraction/liquid-extractor.d.ts +18 -0
- package/lib/dist/extraction/liquid-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/liquid-extractor.js +98 -22
- package/lib/dist/extraction/liquid-extractor.js.map +1 -1
- package/lib/dist/extraction/mybatis-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/mybatis-extractor.js +6 -4
- package/lib/dist/extraction/mybatis-extractor.js.map +1 -1
- package/lib/dist/extraction/parse-budget.d.ts +16 -0
- package/lib/dist/extraction/parse-budget.d.ts.map +1 -0
- package/lib/dist/extraction/parse-budget.js +24 -0
- package/lib/dist/extraction/parse-budget.js.map +1 -0
- package/lib/dist/extraction/parse-pool.d.ts +12 -0
- package/lib/dist/extraction/parse-pool.d.ts.map +1 -1
- package/lib/dist/extraction/parse-pool.js +51 -3
- package/lib/dist/extraction/parse-pool.js.map +1 -1
- package/lib/dist/extraction/parse-worker.js +3 -1
- package/lib/dist/extraction/parse-worker.js.map +1 -1
- package/lib/dist/extraction/sfc-script.d.ts +43 -0
- package/lib/dist/extraction/sfc-script.d.ts.map +1 -0
- package/lib/dist/extraction/sfc-script.js +135 -0
- package/lib/dist/extraction/sfc-script.js.map +1 -0
- package/lib/dist/extraction/store-worker.js +5 -0
- package/lib/dist/extraction/store-worker.js.map +1 -1
- package/lib/dist/extraction/store-writer.d.ts +10 -2
- package/lib/dist/extraction/store-writer.d.ts.map +1 -1
- package/lib/dist/extraction/store-writer.js +12 -4
- package/lib/dist/extraction/store-writer.js.map +1 -1
- package/lib/dist/extraction/svelte-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/svelte-extractor.js +7 -37
- package/lib/dist/extraction/svelte-extractor.js.map +1 -1
- package/lib/dist/extraction/syntax-tokens.d.ts +103 -0
- package/lib/dist/extraction/syntax-tokens.d.ts.map +1 -0
- package/lib/dist/extraction/syntax-tokens.js +382 -0
- package/lib/dist/extraction/syntax-tokens.js.map +1 -0
- package/lib/dist/extraction/tree-sitter-helpers.d.ts +5 -0
- package/lib/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter-helpers.js +17 -0
- package/lib/dist/extraction/tree-sitter-helpers.js.map +1 -1
- package/lib/dist/extraction/tree-sitter-types.d.ts +29 -3
- package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.d.ts +104 -17
- package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.js +943 -88
- package/lib/dist/extraction/tree-sitter.js.map +1 -1
- package/lib/dist/extraction/vue-extractor.d.ts +7 -0
- package/lib/dist/extraction/vue-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/vue-extractor.js +73 -35
- package/lib/dist/extraction/vue-extractor.js.map +1 -1
- package/lib/dist/extraction/vue-options-api.d.ts +28 -0
- package/lib/dist/extraction/vue-options-api.d.ts.map +1 -0
- package/lib/dist/extraction/vue-options-api.js +196 -0
- package/lib/dist/extraction/vue-options-api.js.map +1 -0
- package/lib/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-kotlin.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
- package/lib/dist/file-limits.d.ts +40 -0
- package/lib/dist/file-limits.d.ts.map +1 -0
- package/lib/dist/file-limits.js +147 -0
- package/lib/dist/file-limits.js.map +1 -0
- package/lib/dist/graph/branch-guards.d.ts +265 -0
- package/lib/dist/graph/branch-guards.d.ts.map +1 -0
- package/lib/dist/graph/branch-guards.js +2326 -0
- package/lib/dist/graph/branch-guards.js.map +1 -0
- package/lib/dist/graph/dead-code.d.ts +251 -0
- package/lib/dist/graph/dead-code.d.ts.map +1 -0
- package/lib/dist/graph/dead-code.js +776 -0
- package/lib/dist/graph/dead-code.js.map +1 -0
- package/lib/dist/graph/dynamic-boundary-report.d.ts +121 -0
- package/lib/dist/graph/dynamic-boundary-report.d.ts.map +1 -0
- package/lib/dist/graph/dynamic-boundary-report.js +283 -0
- package/lib/dist/graph/dynamic-boundary-report.js.map +1 -0
- package/lib/dist/graph/index.d.ts +4 -0
- package/lib/dist/graph/index.d.ts.map +1 -1
- package/lib/dist/graph/index.js +16 -1
- package/lib/dist/graph/index.js.map +1 -1
- package/lib/dist/graph/named-symbol-flow.d.ts +125 -0
- package/lib/dist/graph/named-symbol-flow.d.ts.map +1 -0
- package/lib/dist/graph/named-symbol-flow.js +559 -0
- package/lib/dist/graph/named-symbol-flow.js.map +1 -0
- package/lib/dist/graph/symbol-lookup.d.ts +83 -0
- package/lib/dist/graph/symbol-lookup.d.ts.map +1 -0
- package/lib/dist/graph/symbol-lookup.js +181 -0
- package/lib/dist/graph/symbol-lookup.js.map +1 -0
- package/lib/dist/graph/traversal.d.ts +9 -0
- package/lib/dist/graph/traversal.d.ts.map +1 -1
- package/lib/dist/graph/traversal.js +61 -35
- package/lib/dist/graph/traversal.js.map +1 -1
- package/lib/dist/graph/type-hierarchy.d.ts +155 -0
- package/lib/dist/graph/type-hierarchy.d.ts.map +1 -0
- package/lib/dist/graph/type-hierarchy.js +382 -0
- package/lib/dist/graph/type-hierarchy.js.map +1 -0
- package/lib/dist/index.d.ts +256 -11
- package/lib/dist/index.d.ts.map +1 -1
- package/lib/dist/index.js +402 -34
- package/lib/dist/index.js.map +1 -1
- package/lib/dist/installer/index.d.ts.map +1 -1
- package/lib/dist/installer/index.js +3 -2
- package/lib/dist/installer/index.js.map +1 -1
- package/lib/dist/installer/targets/antigravity.d.ts.map +1 -1
- package/lib/dist/installer/targets/antigravity.js +14 -2
- package/lib/dist/installer/targets/antigravity.js.map +1 -1
- package/lib/dist/installer/targets/claude.d.ts +3 -0
- package/lib/dist/installer/targets/claude.d.ts.map +1 -1
- package/lib/dist/installer/targets/claude.js +35 -7
- package/lib/dist/installer/targets/claude.js.map +1 -1
- package/lib/dist/installer/targets/codex.d.ts +2 -1
- package/lib/dist/installer/targets/codex.d.ts.map +1 -1
- package/lib/dist/installer/targets/codex.js +14 -4
- package/lib/dist/installer/targets/codex.js.map +1 -1
- package/lib/dist/installer/targets/copilot-cli.d.ts.map +1 -1
- package/lib/dist/installer/targets/copilot-cli.js +7 -1
- package/lib/dist/installer/targets/copilot-cli.js.map +1 -1
- package/lib/dist/installer/targets/opencode.d.ts +16 -5
- package/lib/dist/installer/targets/opencode.d.ts.map +1 -1
- package/lib/dist/installer/targets/opencode.js +73 -22
- package/lib/dist/installer/targets/opencode.js.map +1 -1
- package/lib/dist/installer/targets/shared.d.ts +14 -3
- package/lib/dist/installer/targets/shared.d.ts.map +1 -1
- package/lib/dist/installer/targets/shared.js +39 -11
- package/lib/dist/installer/targets/shared.js.map +1 -1
- package/lib/dist/installer/targets/types.d.ts +7 -0
- package/lib/dist/installer/targets/types.d.ts.map +1 -1
- package/lib/dist/mcp/answer-freshness.d.ts +10 -0
- package/lib/dist/mcp/answer-freshness.d.ts.map +1 -0
- package/lib/dist/mcp/answer-freshness.js +68 -0
- package/lib/dist/mcp/answer-freshness.js.map +1 -0
- package/lib/dist/mcp/daemon-manager.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-manager.js +16 -0
- package/lib/dist/mcp/daemon-manager.js.map +1 -1
- package/lib/dist/mcp/daemon-paths.d.ts +2 -0
- package/lib/dist/mcp/daemon-paths.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-paths.js +20 -5
- package/lib/dist/mcp/daemon-paths.js.map +1 -1
- package/lib/dist/mcp/daemon-registry.d.ts +11 -4
- package/lib/dist/mcp/daemon-registry.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-registry.js +132 -36
- package/lib/dist/mcp/daemon-registry.js.map +1 -1
- package/lib/dist/mcp/daemon.d.ts +17 -7
- package/lib/dist/mcp/daemon.d.ts.map +1 -1
- package/lib/dist/mcp/daemon.js +116 -24
- package/lib/dist/mcp/daemon.js.map +1 -1
- package/lib/dist/mcp/dynamic-boundaries.d.ts +1 -10
- package/lib/dist/mcp/dynamic-boundaries.d.ts.map +1 -1
- package/lib/dist/mcp/dynamic-boundaries.js +46 -42
- package/lib/dist/mcp/dynamic-boundaries.js.map +1 -1
- package/lib/dist/mcp/engine.d.ts +30 -9
- package/lib/dist/mcp/engine.d.ts.map +1 -1
- package/lib/dist/mcp/engine.js +158 -66
- package/lib/dist/mcp/engine.js.map +1 -1
- package/lib/dist/mcp/explore-dedup.d.ts +5 -2
- package/lib/dist/mcp/explore-dedup.d.ts.map +1 -1
- package/lib/dist/mcp/explore-dedup.js +8 -5
- package/lib/dist/mcp/explore-dedup.js.map +1 -1
- package/lib/dist/mcp/index-freshness-worker.d.ts +2 -0
- package/lib/dist/mcp/index-freshness-worker.d.ts.map +1 -0
- package/lib/dist/mcp/index-freshness-worker.js +36 -0
- package/lib/dist/mcp/index-freshness-worker.js.map +1 -0
- package/lib/dist/mcp/index-freshness.d.ts +13 -0
- package/lib/dist/mcp/index-freshness.d.ts.map +1 -0
- package/lib/dist/mcp/index-freshness.js +117 -0
- package/lib/dist/mcp/index-freshness.js.map +1 -0
- package/lib/dist/mcp/index.d.ts +3 -1
- package/lib/dist/mcp/index.d.ts.map +1 -1
- package/lib/dist/mcp/index.js +95 -11
- package/lib/dist/mcp/index.js.map +1 -1
- package/lib/dist/mcp/liveness-watchdog.d.ts +4 -1
- package/lib/dist/mcp/liveness-watchdog.d.ts.map +1 -1
- package/lib/dist/mcp/liveness-watchdog.js +11 -2
- package/lib/dist/mcp/liveness-watchdog.js.map +1 -1
- package/lib/dist/mcp/project-lifecycle.d.ts +9 -0
- package/lib/dist/mcp/project-lifecycle.d.ts.map +1 -0
- package/lib/dist/mcp/project-lifecycle.js +182 -0
- package/lib/dist/mcp/project-lifecycle.js.map +1 -0
- package/lib/dist/mcp/proxy.d.ts +9 -2
- package/lib/dist/mcp/proxy.d.ts.map +1 -1
- package/lib/dist/mcp/proxy.js +201 -32
- package/lib/dist/mcp/proxy.js.map +1 -1
- package/lib/dist/mcp/query-pool.d.ts +18 -3
- package/lib/dist/mcp/query-pool.d.ts.map +1 -1
- package/lib/dist/mcp/query-pool.js +67 -11
- package/lib/dist/mcp/query-pool.js.map +1 -1
- package/lib/dist/mcp/query-worker.js +2 -2
- package/lib/dist/mcp/query-worker.js.map +1 -1
- package/lib/dist/mcp/server-instructions.d.ts +1 -1
- package/lib/dist/mcp/server-instructions.d.ts.map +1 -1
- package/lib/dist/mcp/server-instructions.js +6 -3
- package/lib/dist/mcp/server-instructions.js.map +1 -1
- package/lib/dist/mcp/startup-handshake.d.ts +3 -1
- package/lib/dist/mcp/startup-handshake.d.ts.map +1 -1
- package/lib/dist/mcp/startup-handshake.js +10 -2
- package/lib/dist/mcp/startup-handshake.js.map +1 -1
- package/lib/dist/mcp/tools.d.ts +306 -36
- package/lib/dist/mcp/tools.d.ts.map +1 -1
- package/lib/dist/mcp/tools.js +2395 -966
- package/lib/dist/mcp/tools.js.map +1 -1
- package/lib/dist/mcp/writer-lock.d.ts +61 -0
- package/lib/dist/mcp/writer-lock.d.ts.map +1 -0
- package/lib/dist/mcp/writer-lock.js +260 -0
- package/lib/dist/mcp/writer-lock.js.map +1 -0
- package/lib/dist/resolution/alias-binding.d.ts +56 -0
- package/lib/dist/resolution/alias-binding.d.ts.map +1 -0
- package/lib/dist/resolution/alias-binding.js +143 -0
- package/lib/dist/resolution/alias-binding.js.map +1 -0
- package/lib/dist/resolution/angular-template-synthesizer.d.ts +49 -0
- package/lib/dist/resolution/angular-template-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/angular-template-synthesizer.js +359 -0
- package/lib/dist/resolution/angular-template-synthesizer.js.map +1 -0
- package/lib/dist/resolution/callback-synthesizer.d.ts +23 -1
- package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/callback-synthesizer.js +460 -144
- package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
- package/lib/dist/resolution/cpp-constructor.d.ts +4 -0
- package/lib/dist/resolution/cpp-constructor.d.ts.map +1 -0
- package/lib/dist/resolution/cpp-constructor.js +123 -0
- package/lib/dist/resolution/cpp-constructor.js.map +1 -0
- package/lib/dist/resolution/cpp-macro-visibility.d.ts +12 -0
- package/lib/dist/resolution/cpp-macro-visibility.d.ts.map +1 -0
- package/lib/dist/resolution/cpp-macro-visibility.js +392 -0
- package/lib/dist/resolution/cpp-macro-visibility.js.map +1 -0
- package/lib/dist/resolution/expo-router-synthesizer.d.ts +32 -0
- package/lib/dist/resolution/expo-router-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/expo-router-synthesizer.js +189 -0
- package/lib/dist/resolution/expo-router-synthesizer.js.map +1 -0
- package/lib/dist/resolution/frameworks/angular-router.d.ts +142 -0
- package/lib/dist/resolution/frameworks/angular-router.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/angular-router.js +1126 -0
- package/lib/dist/resolution/frameworks/angular-router.js.map +1 -0
- package/lib/dist/resolution/frameworks/astro.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/astro.js +32 -6
- package/lib/dist/resolution/frameworks/astro.js.map +1 -1
- package/lib/dist/resolution/frameworks/csharp.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/csharp.js +186 -24
- package/lib/dist/resolution/frameworks/csharp.js.map +1 -1
- package/lib/dist/resolution/frameworks/expo-modules.d.ts +10 -0
- package/lib/dist/resolution/frameworks/expo-modules.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/expo-modules.js +95 -1
- package/lib/dist/resolution/frameworks/expo-modules.js.map +1 -1
- package/lib/dist/resolution/frameworks/expo-router.d.ts +195 -0
- package/lib/dist/resolution/frameworks/expo-router.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/expo-router.js +847 -0
- package/lib/dist/resolution/frameworks/expo-router.js.map +1 -0
- package/lib/dist/resolution/frameworks/express.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/express.js +339 -45
- package/lib/dist/resolution/frameworks/express.js.map +1 -1
- package/lib/dist/resolution/frameworks/fabric.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/fabric.js +13 -11
- package/lib/dist/resolution/frameworks/fabric.js.map +1 -1
- package/lib/dist/resolution/frameworks/go.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/go.js +11 -28
- package/lib/dist/resolution/frameworks/go.js.map +1 -1
- package/lib/dist/resolution/frameworks/index.d.ts +8 -2
- package/lib/dist/resolution/frameworks/index.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/index.js +39 -1
- package/lib/dist/resolution/frameworks/index.js.map +1 -1
- package/lib/dist/resolution/frameworks/java.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/java.js +88 -68
- package/lib/dist/resolution/frameworks/java.js.map +1 -1
- package/lib/dist/resolution/frameworks/laravel.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/laravel.js +369 -26
- package/lib/dist/resolution/frameworks/laravel.js.map +1 -1
- package/lib/dist/resolution/frameworks/name-heuristic.d.ts +35 -0
- package/lib/dist/resolution/frameworks/name-heuristic.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/name-heuristic.js +45 -0
- package/lib/dist/resolution/frameworks/name-heuristic.js.map +1 -0
- package/lib/dist/resolution/frameworks/nestjs.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/nestjs.js +288 -55
- package/lib/dist/resolution/frameworks/nestjs.js.map +1 -1
- package/lib/dist/resolution/frameworks/nextjs.d.ts +76 -0
- package/lib/dist/resolution/frameworks/nextjs.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/nextjs.js +329 -0
- package/lib/dist/resolution/frameworks/nextjs.js.map +1 -0
- package/lib/dist/resolution/frameworks/object-literal.d.ts +32 -0
- package/lib/dist/resolution/frameworks/object-literal.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/object-literal.js +139 -0
- package/lib/dist/resolution/frameworks/object-literal.js.map +1 -0
- package/lib/dist/resolution/frameworks/package-deps.d.ts +14 -0
- package/lib/dist/resolution/frameworks/package-deps.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/package-deps.js +78 -0
- package/lib/dist/resolution/frameworks/package-deps.js.map +1 -0
- package/lib/dist/resolution/frameworks/page-component.d.ts +20 -0
- package/lib/dist/resolution/frameworks/page-component.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/page-component.js +45 -0
- package/lib/dist/resolution/frameworks/page-component.js.map +1 -0
- package/lib/dist/resolution/frameworks/play.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/play.js +3 -1
- package/lib/dist/resolution/frameworks/play.js.map +1 -1
- package/lib/dist/resolution/frameworks/python.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/python.js +279 -26
- package/lib/dist/resolution/frameworks/python.js.map +1 -1
- package/lib/dist/resolution/frameworks/react-native.d.ts +26 -0
- package/lib/dist/resolution/frameworks/react-native.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/react-native.js +153 -14
- package/lib/dist/resolution/frameworks/react-native.js.map +1 -1
- package/lib/dist/resolution/frameworks/react-router.d.ts +47 -0
- package/lib/dist/resolution/frameworks/react-router.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/react-router.js +201 -0
- package/lib/dist/resolution/frameworks/react-router.js.map +1 -0
- package/lib/dist/resolution/frameworks/react.d.ts +13 -2
- package/lib/dist/resolution/frameworks/react.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/react.js +542 -144
- package/lib/dist/resolution/frameworks/react.js.map +1 -1
- package/lib/dist/resolution/frameworks/ruby.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/ruby.js +177 -17
- package/lib/dist/resolution/frameworks/ruby.js.map +1 -1
- package/lib/dist/resolution/frameworks/rust.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/rust.js +24 -22
- package/lib/dist/resolution/frameworks/rust.js.map +1 -1
- package/lib/dist/resolution/frameworks/svelte.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/svelte.js +14 -6
- package/lib/dist/resolution/frameworks/svelte.js.map +1 -1
- package/lib/dist/resolution/frameworks/sveltekit-router.d.ts +36 -0
- package/lib/dist/resolution/frameworks/sveltekit-router.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/sveltekit-router.js +156 -0
- package/lib/dist/resolution/frameworks/sveltekit-router.js.map +1 -0
- package/lib/dist/resolution/frameworks/swift.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/swift.js +253 -124
- package/lib/dist/resolution/frameworks/swift.js.map +1 -1
- package/lib/dist/resolution/frameworks/tanstack-router.d.ts +84 -0
- package/lib/dist/resolution/frameworks/tanstack-router.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/tanstack-router.js +437 -0
- package/lib/dist/resolution/frameworks/tanstack-router.js.map +1 -0
- package/lib/dist/resolution/frameworks/vue-router.d.ts +98 -0
- package/lib/dist/resolution/frameworks/vue-router.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/vue-router.js +500 -0
- package/lib/dist/resolution/frameworks/vue-router.js.map +1 -0
- package/lib/dist/resolution/frameworks/vue.d.ts +9 -2
- package/lib/dist/resolution/frameworks/vue.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/vue.js +45 -11
- package/lib/dist/resolution/frameworks/vue.js.map +1 -1
- package/lib/dist/resolution/import-resolver.d.ts +66 -0
- package/lib/dist/resolution/import-resolver.d.ts.map +1 -1
- package/lib/dist/resolution/import-resolver.js +643 -61
- package/lib/dist/resolution/import-resolver.js.map +1 -1
- package/lib/dist/resolution/index.d.ts +124 -25
- package/lib/dist/resolution/index.d.ts.map +1 -1
- package/lib/dist/resolution/index.js +769 -152
- package/lib/dist/resolution/index.js.map +1 -1
- package/lib/dist/resolution/js-builtins.d.ts +13 -0
- package/lib/dist/resolution/js-builtins.d.ts.map +1 -0
- package/lib/dist/resolution/js-builtins.js +48 -0
- package/lib/dist/resolution/js-builtins.js.map +1 -0
- package/lib/dist/resolution/name-matcher.d.ts +101 -22
- package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
- package/lib/dist/resolution/name-matcher.js +8267 -287
- package/lib/dist/resolution/name-matcher.js.map +1 -1
- package/lib/dist/resolution/next-router-synthesizer.d.ts +27 -0
- package/lib/dist/resolution/next-router-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/next-router-synthesizer.js +113 -0
- package/lib/dist/resolution/next-router-synthesizer.js.map +1 -0
- package/lib/dist/resolution/react-router-synthesizer.d.ts +35 -0
- package/lib/dist/resolution/react-router-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/react-router-synthesizer.js +197 -0
- package/lib/dist/resolution/react-router-synthesizer.js.map +1 -0
- package/lib/dist/resolution/resolver-pool.d.ts +22 -1
- package/lib/dist/resolution/resolver-pool.d.ts.map +1 -1
- package/lib/dist/resolution/resolver-pool.js +35 -5
- package/lib/dist/resolution/resolver-pool.js.map +1 -1
- package/lib/dist/resolution/resolver-worker.js +3 -0
- package/lib/dist/resolution/resolver-worker.js.map +1 -1
- package/lib/dist/resolution/strip-comments.d.ts +6 -0
- package/lib/dist/resolution/strip-comments.d.ts.map +1 -1
- package/lib/dist/resolution/strip-comments.js +58 -0
- package/lib/dist/resolution/strip-comments.js.map +1 -1
- package/lib/dist/resolution/sveltekit-synthesizer.d.ts +58 -0
- package/lib/dist/resolution/sveltekit-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/sveltekit-synthesizer.js +173 -0
- package/lib/dist/resolution/sveltekit-synthesizer.js.map +1 -0
- package/lib/dist/resolution/swift-type-visibility.d.ts +68 -0
- package/lib/dist/resolution/swift-type-visibility.d.ts.map +1 -0
- package/lib/dist/resolution/swift-type-visibility.js +454 -0
- package/lib/dist/resolution/swift-type-visibility.js.map +1 -0
- package/lib/dist/resolution/synth-utils.d.ts +26 -0
- package/lib/dist/resolution/synth-utils.d.ts.map +1 -0
- package/lib/dist/resolution/synth-utils.js +75 -0
- package/lib/dist/resolution/synth-utils.js.map +1 -0
- package/lib/dist/resolution/tanstack-router-synthesizer.d.ts +31 -0
- package/lib/dist/resolution/tanstack-router-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/tanstack-router-synthesizer.js +114 -0
- package/lib/dist/resolution/tanstack-router-synthesizer.js.map +1 -0
- package/lib/dist/resolution/tier-synthesizer.d.ts +54 -0
- package/lib/dist/resolution/tier-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/tier-synthesizer.js +1294 -0
- package/lib/dist/resolution/tier-synthesizer.js.map +1 -0
- package/lib/dist/resolution/type-parameters.d.ts +11 -0
- package/lib/dist/resolution/type-parameters.d.ts.map +1 -0
- package/lib/dist/resolution/type-parameters.js +287 -0
- package/lib/dist/resolution/type-parameters.js.map +1 -0
- package/lib/dist/resolution/types.d.ts +105 -2
- package/lib/dist/resolution/types.d.ts.map +1 -1
- package/lib/dist/resolution/types.js +64 -0
- package/lib/dist/resolution/types.js.map +1 -1
- package/lib/dist/resolution/vue-router-synthesizer.d.ts +30 -0
- package/lib/dist/resolution/vue-router-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/vue-router-synthesizer.js +115 -0
- package/lib/dist/resolution/vue-router-synthesizer.js.map +1 -0
- package/lib/dist/search/query-paths.d.ts +50 -1
- package/lib/dist/search/query-paths.d.ts.map +1 -1
- package/lib/dist/search/query-paths.js +227 -12
- package/lib/dist/search/query-paths.js.map +1 -1
- package/lib/dist/search/query-utils.d.ts +15 -0
- package/lib/dist/search/query-utils.d.ts.map +1 -1
- package/lib/dist/search/query-utils.js +35 -7
- package/lib/dist/search/query-utils.js.map +1 -1
- package/lib/dist/sync/watch-policy.d.ts +14 -0
- package/lib/dist/sync/watch-policy.d.ts.map +1 -1
- package/lib/dist/sync/watch-policy.js +19 -0
- package/lib/dist/sync/watch-policy.js.map +1 -1
- package/lib/dist/sync/watcher.d.ts +52 -35
- package/lib/dist/sync/watcher.d.ts.map +1 -1
- package/lib/dist/sync/watcher.js +236 -100
- package/lib/dist/sync/watcher.js.map +1 -1
- package/lib/dist/sync/worktree.d.ts +22 -0
- package/lib/dist/sync/worktree.d.ts.map +1 -1
- package/lib/dist/sync/worktree.js +54 -0
- package/lib/dist/sync/worktree.js.map +1 -1
- package/lib/dist/telemetry/index.d.ts +4 -2
- package/lib/dist/telemetry/index.d.ts.map +1 -1
- package/lib/dist/telemetry/index.js +159 -66
- package/lib/dist/telemetry/index.js.map +1 -1
- package/lib/dist/types.d.ts +1 -1
- package/lib/dist/types.d.ts.map +1 -1
- package/lib/dist/types.js +1 -0
- package/lib/dist/types.js.map +1 -1
- package/lib/dist/ui-server/api/deadcode.d.ts +84 -0
- package/lib/dist/ui-server/api/deadcode.d.ts.map +1 -0
- package/lib/dist/ui-server/api/deadcode.js +136 -0
- package/lib/dist/ui-server/api/deadcode.js.map +1 -0
- package/lib/dist/ui-server/api/effects.d.ts +94 -0
- package/lib/dist/ui-server/api/effects.d.ts.map +1 -0
- package/lib/dist/ui-server/api/effects.js +527 -0
- package/lib/dist/ui-server/api/effects.js.map +1 -0
- package/lib/dist/ui-server/api/entrypoints.d.ts +92 -0
- package/lib/dist/ui-server/api/entrypoints.d.ts.map +1 -0
- package/lib/dist/ui-server/api/entrypoints.js +364 -0
- package/lib/dist/ui-server/api/entrypoints.js.map +1 -0
- package/lib/dist/ui-server/api/events.d.ts +183 -0
- package/lib/dist/ui-server/api/events.d.ts.map +1 -0
- package/lib/dist/ui-server/api/events.js +430 -0
- package/lib/dist/ui-server/api/events.js.map +1 -0
- package/lib/dist/ui-server/api/file.d.ts +66 -0
- package/lib/dist/ui-server/api/file.d.ts.map +1 -0
- package/lib/dist/ui-server/api/file.js +235 -0
- package/lib/dist/ui-server/api/file.js.map +1 -0
- package/lib/dist/ui-server/api/filecode.d.ts +126 -0
- package/lib/dist/ui-server/api/filecode.d.ts.map +1 -0
- package/lib/dist/ui-server/api/filecode.js +205 -0
- package/lib/dist/ui-server/api/filecode.js.map +1 -0
- package/lib/dist/ui-server/api/flow.d.ts +226 -0
- package/lib/dist/ui-server/api/flow.d.ts.map +1 -0
- package/lib/dist/ui-server/api/flow.js +612 -0
- package/lib/dist/ui-server/api/flow.js.map +1 -0
- package/lib/dist/ui-server/api/hierarchy.d.ts +81 -0
- package/lib/dist/ui-server/api/hierarchy.d.ts.map +1 -0
- package/lib/dist/ui-server/api/hierarchy.js +92 -0
- package/lib/dist/ui-server/api/hierarchy.js.map +1 -0
- package/lib/dist/ui-server/api/index.d.ts +90 -0
- package/lib/dist/ui-server/api/index.d.ts.map +1 -0
- package/lib/dist/ui-server/api/index.js +332 -0
- package/lib/dist/ui-server/api/index.js.map +1 -0
- package/lib/dist/ui-server/api/map.d.ts +273 -0
- package/lib/dist/ui-server/api/map.d.ts.map +1 -0
- package/lib/dist/ui-server/api/map.js +781 -0
- package/lib/dist/ui-server/api/map.js.map +1 -0
- package/lib/dist/ui-server/api/node.d.ts +81 -0
- package/lib/dist/ui-server/api/node.d.ts.map +1 -0
- package/lib/dist/ui-server/api/node.js +394 -0
- package/lib/dist/ui-server/api/node.js.map +1 -0
- package/lib/dist/ui-server/api/nodes.d.ts +25 -0
- package/lib/dist/ui-server/api/nodes.d.ts.map +1 -0
- package/lib/dist/ui-server/api/nodes.js +45 -0
- package/lib/dist/ui-server/api/nodes.js.map +1 -0
- package/lib/dist/ui-server/api/program.d.ts +139 -0
- package/lib/dist/ui-server/api/program.d.ts.map +1 -0
- package/lib/dist/ui-server/api/program.js +315 -0
- package/lib/dist/ui-server/api/program.js.map +1 -0
- package/lib/dist/ui-server/api/respond.d.ts +76 -0
- package/lib/dist/ui-server/api/respond.d.ts.map +1 -0
- package/lib/dist/ui-server/api/respond.js +186 -0
- package/lib/dist/ui-server/api/respond.js.map +1 -0
- package/lib/dist/ui-server/api/route-roots.d.ts +45 -0
- package/lib/dist/ui-server/api/route-roots.d.ts.map +1 -0
- package/lib/dist/ui-server/api/route-roots.js +117 -0
- package/lib/dist/ui-server/api/route-roots.js.map +1 -0
- package/lib/dist/ui-server/api/routes.d.ts +61 -0
- package/lib/dist/ui-server/api/routes.d.ts.map +1 -0
- package/lib/dist/ui-server/api/routes.js +164 -0
- package/lib/dist/ui-server/api/routes.js.map +1 -0
- package/lib/dist/ui-server/api/screens.d.ts +117 -0
- package/lib/dist/ui-server/api/screens.d.ts.map +1 -0
- package/lib/dist/ui-server/api/screens.js +626 -0
- package/lib/dist/ui-server/api/screens.js.map +1 -0
- package/lib/dist/ui-server/api/search.d.ts +29 -0
- package/lib/dist/ui-server/api/search.d.ts.map +1 -0
- package/lib/dist/ui-server/api/search.js +232 -0
- package/lib/dist/ui-server/api/search.js.map +1 -0
- package/lib/dist/ui-server/api/session.d.ts +52 -0
- package/lib/dist/ui-server/api/session.d.ts.map +1 -0
- package/lib/dist/ui-server/api/session.js +196 -0
- package/lib/dist/ui-server/api/session.js.map +1 -0
- package/lib/dist/ui-server/api/source.d.ts +200 -0
- package/lib/dist/ui-server/api/source.d.ts.map +1 -0
- package/lib/dist/ui-server/api/source.js +422 -0
- package/lib/dist/ui-server/api/source.js.map +1 -0
- package/lib/dist/ui-server/api/stats.d.ts +27 -0
- package/lib/dist/ui-server/api/stats.d.ts.map +1 -0
- package/lib/dist/ui-server/api/stats.js +164 -0
- package/lib/dist/ui-server/api/stats.js.map +1 -0
- package/lib/dist/ui-server/api/steps.d.ts +274 -0
- package/lib/dist/ui-server/api/steps.d.ts.map +1 -0
- package/lib/dist/ui-server/api/steps.js +1554 -0
- package/lib/dist/ui-server/api/steps.js.map +1 -0
- package/lib/dist/ui-server/api/trail-store.d.ts +142 -0
- package/lib/dist/ui-server/api/trail-store.d.ts.map +1 -0
- package/lib/dist/ui-server/api/trail-store.js +323 -0
- package/lib/dist/ui-server/api/trail-store.js.map +1 -0
- package/lib/dist/ui-server/api/trails.d.ts +163 -0
- package/lib/dist/ui-server/api/trails.d.ts.map +1 -0
- package/lib/dist/ui-server/api/trails.js +370 -0
- package/lib/dist/ui-server/api/trails.js.map +1 -0
- package/lib/dist/ui-server/api/when.d.ts +133 -0
- package/lib/dist/ui-server/api/when.d.ts.map +1 -0
- package/lib/dist/ui-server/api/when.js +275 -0
- package/lib/dist/ui-server/api/when.js.map +1 -0
- package/lib/dist/ui-server/api/wire.d.ts +179 -0
- package/lib/dist/ui-server/api/wire.d.ts.map +1 -0
- package/lib/dist/ui-server/api/wire.js +231 -0
- package/lib/dist/ui-server/api/wire.js.map +1 -0
- package/lib/dist/ui-server/assets.d.ts +40 -0
- package/lib/dist/ui-server/assets.d.ts.map +1 -0
- package/lib/dist/ui-server/assets.js +110 -0
- package/lib/dist/ui-server/assets.js.map +1 -0
- package/lib/dist/ui-server/constants.d.ts +32 -0
- package/lib/dist/ui-server/constants.d.ts.map +1 -0
- package/lib/dist/ui-server/constants.js +35 -0
- package/lib/dist/ui-server/constants.js.map +1 -0
- package/lib/dist/ui-server/highlight/bounded-tokenize.d.ts +28 -0
- package/lib/dist/ui-server/highlight/bounded-tokenize.d.ts.map +1 -0
- package/lib/dist/ui-server/highlight/bounded-tokenize.js +139 -0
- package/lib/dist/ui-server/highlight/bounded-tokenize.js.map +1 -0
- package/lib/dist/ui-server/highlight/index.d.ts +113 -0
- package/lib/dist/ui-server/highlight/index.d.ts.map +1 -0
- package/lib/dist/ui-server/highlight/index.js +312 -0
- package/lib/dist/ui-server/highlight/index.js.map +1 -0
- package/lib/dist/ui-server/highlight/languages.d.ts +36 -0
- package/lib/dist/ui-server/highlight/languages.d.ts.map +1 -0
- package/lib/dist/ui-server/highlight/languages.js +50 -0
- package/lib/dist/ui-server/highlight/languages.js.map +1 -0
- package/lib/dist/ui-server/highlight/tokenize-worker.d.ts +7 -0
- package/lib/dist/ui-server/highlight/tokenize-worker.d.ts.map +1 -0
- package/lib/dist/ui-server/highlight/tokenize-worker.js +20 -0
- package/lib/dist/ui-server/highlight/tokenize-worker.js.map +1 -0
- package/lib/dist/ui-server/index.d.ts +92 -0
- package/lib/dist/ui-server/index.d.ts.map +1 -0
- package/lib/dist/ui-server/index.js +399 -0
- package/lib/dist/ui-server/index.js.map +1 -0
- package/lib/dist/ui-server/open-browser.d.ts +31 -0
- package/lib/dist/ui-server/open-browser.d.ts.map +1 -0
- package/lib/dist/ui-server/open-browser.js +79 -0
- package/lib/dist/ui-server/open-browser.js.map +1 -0
- package/lib/dist/ui-server/security.d.ts +127 -0
- package/lib/dist/ui-server/security.d.ts.map +1 -0
- package/lib/dist/ui-server/security.js +332 -0
- package/lib/dist/ui-server/security.js.map +1 -0
- package/lib/dist/ui-server/static.d.ts +45 -0
- package/lib/dist/ui-server/static.d.ts.map +1 -0
- package/lib/dist/ui-server/static.js +165 -0
- package/lib/dist/ui-server/static.js.map +1 -0
- package/lib/dist/upgrade/index.d.ts +43 -5
- package/lib/dist/upgrade/index.d.ts.map +1 -1
- package/lib/dist/upgrade/index.js +157 -35
- package/lib/dist/upgrade/index.js.map +1 -1
- package/lib/dist/utils.d.ts +14 -2
- package/lib/dist/utils.d.ts.map +1 -1
- package/lib/dist/utils.js +25 -10
- package/lib/dist/utils.js.map +1 -1
- package/lib/dist/viewer/assets/archivo-latin-ext-wght-normal-C4zznr8T.woff2 +0 -0
- package/lib/dist/viewer/assets/archivo-latin-wght-normal-E0tuGl4L.woff2 +0 -0
- package/lib/dist/viewer/assets/archivo-vietnamese-wght-normal-XAtsl5Q_.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-italic-2syK4fUT.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-italic-CBJ8pzag.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-600-normal-CTOM6hUh.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-600-normal-fLZuRloM.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-italic-B4oTjJdl.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-italic-CBjNughH.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-600-normal-9HEixskS.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-600-normal-V-xxqcpd.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-italic-66oory27.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-italic-BqAiT5Ww.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-600-normal-BgSNZQsw.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-600-normal-DWFSQ4vo.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-italic-B7_fu1kp.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-italic-Bg0ZHwF4.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-600-normal-D38SheWl.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-600-normal-DmB0ttJJ.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-italic-D6eaYXMU.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-italic-DRuN92E5.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-600-normal-D2EvbN8M.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-600-normal-iLQfcSjf.woff +0 -0
- package/lib/dist/viewer/assets/index-BSGpxBr9.js +99 -0
- package/lib/dist/viewer/assets/index-CF9yvio6.css +1 -0
- package/lib/dist/viewer/index.html +16 -0
- package/lib/dist/worker-teardown.d.ts +48 -0
- package/lib/dist/worker-teardown.d.ts.map +1 -0
- package/lib/dist/worker-teardown.js +100 -0
- package/lib/dist/worker-teardown.js.map +1 -0
- package/lib/kernel/codegraph-kernel.node +2 -2
- package/lib/node_modules/.package-lock.json +4 -4
- package/lib/node_modules/picomatch/README.md +56 -51
- package/lib/node_modules/picomatch/lib/constants.js +4 -0
- package/lib/node_modules/picomatch/lib/parse.js +341 -1
- package/lib/node_modules/picomatch/lib/picomatch.js +25 -5
- package/lib/node_modules/picomatch/lib/scan.js +30 -18
- package/lib/node_modules/picomatch/package.json +4 -4
- package/lib/package.json +9 -2
- package/package.json +1 -1
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* React Framework Resolver
|
|
4
4
|
*
|
|
5
|
-
* Handles React
|
|
5
|
+
* Handles React patterns: React Router routes, components, hooks, contexts.
|
|
6
|
+
* Next.js pages, route handlers and navigation are `nextjs.ts`'s.
|
|
6
7
|
*/
|
|
7
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
9
|
exports.reactResolver = void 0;
|
|
10
|
+
exports.configHrefExpression = configHrefExpression;
|
|
11
|
+
const package_deps_1 = require("./package-deps");
|
|
12
|
+
const import_resolver_1 = require("../import-resolver");
|
|
13
|
+
/** The languages React components, hooks and contexts are written and used in. */
|
|
14
|
+
const REACT_SCRIPT_LANGUAGES = new Set(['typescript', 'javascript', 'tsx', 'jsx']);
|
|
9
15
|
exports.reactResolver = {
|
|
10
16
|
name: 'react',
|
|
11
17
|
// Includes 'tsx'/'jsx' so route extraction runs on JSX files (where
|
|
@@ -15,25 +21,34 @@ exports.reactResolver = {
|
|
|
15
21
|
// of language; only the extract pass filters on `languages`.)
|
|
16
22
|
languages: ['javascript', 'typescript', 'tsx', 'jsx'],
|
|
17
23
|
detect(context) {
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
try {
|
|
22
|
-
const pkg = JSON.parse(packageJson);
|
|
23
|
-
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
24
|
-
if (deps.react || deps.next || deps['react-native']) {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
// Invalid JSON
|
|
30
|
-
}
|
|
31
|
-
}
|
|
24
|
+
// React in a package.json — the root's, or a workspace's (`frontend/`, `apps/web/`).
|
|
25
|
+
if ((0, package_deps_1.dependsOn)(context, 'react', 'next', 'react-native'))
|
|
26
|
+
return true;
|
|
32
27
|
// Check for .jsx/.tsx files
|
|
33
28
|
const allFiles = context.getAllFiles();
|
|
34
29
|
return allFiles.some((f) => f.endsWith('.jsx') || f.endsWith('.tsx'));
|
|
35
30
|
},
|
|
31
|
+
// A data-router `lazy: () => import('./routes/x')` route names a module, not a symbol.
|
|
32
|
+
claimsReference(name) {
|
|
33
|
+
return name.startsWith(LAZY_ROUTE_PREFIX);
|
|
34
|
+
},
|
|
36
35
|
resolve(ref, context) {
|
|
36
|
+
// Components, hooks and contexts are a script's: halo's Java
|
|
37
|
+
// `import org.springframework…SecurityContext` is no React context.
|
|
38
|
+
if (!REACT_SCRIPT_LANGUAGES.has(ref.language))
|
|
39
|
+
return null;
|
|
40
|
+
if (ref.referenceName.startsWith(LAZY_ROUTE_PREFIX)) {
|
|
41
|
+
const target = lazyRouteComponent(ref.referenceName.slice(LAZY_ROUTE_PREFIX.length), ref.filePath, context);
|
|
42
|
+
return target ? { original: ref, targetNodeId: target, confidence: 0.9, resolvedBy: 'framework' } : null;
|
|
43
|
+
}
|
|
44
|
+
// A component, hook or context the file IMPORTS is the import's: the
|
|
45
|
+
// package's (`useQuery` from `@tanstack/react-query`, `<Button>` from a UI
|
|
46
|
+
// kit), or the module the import names, which import resolution finds.
|
|
47
|
+
// Framework resolution runs first, and a name lookup here bound trpc's
|
|
48
|
+
// tests' `useQuery` to a hook nested in one of trpc's own factories.
|
|
49
|
+
if (context.getImportMappings?.(ref.filePath, ref.language)?.some((m) => m.localName === ref.referenceName)) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
37
52
|
// Pattern 1: Component references (PascalCase). Only from JSX-capable
|
|
38
53
|
// files — a component is USED in markup, which only parses in .tsx/.jsx.
|
|
39
54
|
// Without this gate, every PascalCase TYPE reference in plain .ts files
|
|
@@ -57,7 +72,7 @@ exports.reactResolver = {
|
|
|
57
72
|
}
|
|
58
73
|
// Pattern 2: Hook references (use*)
|
|
59
74
|
if (ref.referenceName.startsWith('use') && ref.referenceName.length > 3) {
|
|
60
|
-
const result = resolveHook(ref.referenceName, context);
|
|
75
|
+
const result = resolveHook(ref.referenceName, ref.filePath, context, ref.language);
|
|
61
76
|
if (result) {
|
|
62
77
|
return {
|
|
63
78
|
original: ref,
|
|
@@ -69,7 +84,7 @@ exports.reactResolver = {
|
|
|
69
84
|
}
|
|
70
85
|
// Pattern 3: Context references
|
|
71
86
|
if (ref.referenceName.endsWith('Context') || ref.referenceName.endsWith('Provider')) {
|
|
72
|
-
const result = resolveContext(ref.referenceName, context);
|
|
87
|
+
const result = resolveContext(ref.referenceName, ref, context);
|
|
73
88
|
if (result) {
|
|
74
89
|
return {
|
|
75
90
|
original: ref,
|
|
@@ -96,21 +111,10 @@ exports.reactResolver = {
|
|
|
96
111
|
// what tree-sitter can't: route nodes (React Router + Next.js conventions),
|
|
97
112
|
// which is why 'tsx'/'jsx' are now in `languages` — `<Route>`/`element={<X/>}`
|
|
98
113
|
// routes live in JSX files and were previously skipped entirely.
|
|
99
|
-
//
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const routeTagRegex = /<Route\b/g;
|
|
104
|
-
let routeMatch;
|
|
105
|
-
while ((routeMatch = routeTagRegex.exec(content)) !== null) {
|
|
106
|
-
const window = content.slice(routeMatch.index, routeMatch.index + 400);
|
|
107
|
-
const pathMatch = window.match(/\bpath\s*=\s*["']([^"']+)["']/);
|
|
108
|
-
if (!pathMatch)
|
|
109
|
-
continue; // index/layout routes without a path
|
|
110
|
-
const routePath = pathMatch[1];
|
|
111
|
-
const compMatch = window.match(/\bcomponent\s*=\s*\{\s*([A-Z][A-Za-z0-9_]*)/) ||
|
|
112
|
-
window.match(/\belement\s*=\s*\{\s*<\s*([A-Z][A-Za-z0-9_]*)/);
|
|
113
|
-
const line = content.slice(0, routeMatch.index).split('\n').length;
|
|
114
|
+
// Read only each opening tag's own attributes, including expression values.
|
|
115
|
+
const declarations = scanRouteDeclarations(content, !/\.(?:ts|mts|cts)$/.test(filePath));
|
|
116
|
+
for (const { path: routePath, parts, component, lazy, at } of declarations) {
|
|
117
|
+
const line = content.slice(0, at).split('\n').length;
|
|
114
118
|
const routeNode = {
|
|
115
119
|
id: `route:${filePath}:${line}:${routePath}`,
|
|
116
120
|
kind: 'route',
|
|
@@ -123,12 +127,15 @@ exports.reactResolver = {
|
|
|
123
127
|
endColumn: 0,
|
|
124
128
|
language: filePath.endsWith('.tsx') ? 'tsx' : 'jsx',
|
|
125
129
|
updatedAt: now,
|
|
130
|
+
// A path built from a constant (`paths.app.root.path`) is named in postExtract.
|
|
131
|
+
...(parts.some((p) => p.expr) ? { signature: ROUTE_PARTS_PREFIX + JSON.stringify(parts) } : {}),
|
|
126
132
|
};
|
|
127
133
|
nodes.push(routeNode);
|
|
128
|
-
|
|
134
|
+
const target = component ?? (lazy ? LAZY_ROUTE_PREFIX + lazy : undefined);
|
|
135
|
+
if (target) {
|
|
129
136
|
references.push({
|
|
130
137
|
fromNodeId: routeNode.id,
|
|
131
|
-
referenceName:
|
|
138
|
+
referenceName: target,
|
|
132
139
|
referenceKind: 'references',
|
|
133
140
|
line,
|
|
134
141
|
column: 0,
|
|
@@ -137,73 +144,488 @@ exports.reactResolver = {
|
|
|
137
144
|
});
|
|
138
145
|
}
|
|
139
146
|
}
|
|
140
|
-
//
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
kind: 'route',
|
|
158
|
-
name: routePath,
|
|
159
|
-
qualifiedName: `${filePath}::route:${routePath}`,
|
|
160
|
-
filePath,
|
|
161
|
-
startLine: line,
|
|
162
|
-
endLine: line,
|
|
163
|
-
startColumn: 0,
|
|
164
|
-
endColumn: 0,
|
|
165
|
-
language: filePath.endsWith('.tsx') ? 'tsx' : 'jsx',
|
|
166
|
-
updatedAt: now,
|
|
167
|
-
};
|
|
168
|
-
nodes.push(routeNode);
|
|
169
|
-
references.push({
|
|
170
|
-
fromNodeId: routeNode.id,
|
|
171
|
-
referenceName: compMatch[1],
|
|
172
|
-
referenceKind: 'references',
|
|
173
|
-
line,
|
|
174
|
-
column: 0,
|
|
175
|
-
filePath,
|
|
176
|
-
language: filePath.endsWith('.tsx') ? 'tsx' : 'jsx',
|
|
177
|
-
});
|
|
147
|
+
// Next.js pages and route handlers are `frameworks/nextjs.ts`'s.
|
|
148
|
+
return { nodes, references };
|
|
149
|
+
},
|
|
150
|
+
/**
|
|
151
|
+
* Name the routes whose path is built from a constant — bulletproof-react's
|
|
152
|
+
* `path: paths.app.discussions.path` under `path: paths.app.root.path` is
|
|
153
|
+
* `/app/discussions` — by reading the constant's object literal where it is
|
|
154
|
+
* declared. Idempotent: the parts ride on the node's signature.
|
|
155
|
+
*/
|
|
156
|
+
postExtract(context) {
|
|
157
|
+
const updates = [];
|
|
158
|
+
for (const route of context.getNodesByKind('route')) {
|
|
159
|
+
if (!route.signature?.startsWith(ROUTE_PARTS_PREFIX))
|
|
160
|
+
continue;
|
|
161
|
+
let parts;
|
|
162
|
+
try {
|
|
163
|
+
parts = JSON.parse(route.signature.slice(ROUTE_PARTS_PREFIX.length));
|
|
178
164
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
if (filePath.includes('pages/') || filePath.includes('app/')) {
|
|
182
|
-
// Default export in pages becomes a route
|
|
183
|
-
if (content.includes('export default')) {
|
|
184
|
-
const routePath = filePathToRoute(filePath);
|
|
185
|
-
if (routePath) {
|
|
186
|
-
const line = content.indexOf('export default');
|
|
187
|
-
const lineNum = content.slice(0, line).split('\n').length;
|
|
188
|
-
nodes.push({
|
|
189
|
-
id: `route:${filePath}:${routePath}:${lineNum}`,
|
|
190
|
-
kind: 'route',
|
|
191
|
-
name: routePath,
|
|
192
|
-
qualifiedName: `${filePath}::route:${routePath}`,
|
|
193
|
-
filePath,
|
|
194
|
-
startLine: lineNum,
|
|
195
|
-
endLine: lineNum,
|
|
196
|
-
startColumn: 0,
|
|
197
|
-
endColumn: 0,
|
|
198
|
-
language: filePath.endsWith('.tsx') ? 'tsx' : filePath.endsWith('.ts') ? 'typescript' : 'javascript',
|
|
199
|
-
updatedAt: now,
|
|
200
|
-
});
|
|
201
|
-
}
|
|
165
|
+
catch {
|
|
166
|
+
continue;
|
|
202
167
|
}
|
|
168
|
+
const values = parts.map((p) => p.lit ?? (p.expr ? constantPathValue(p.expr, route.filePath, context) : null));
|
|
169
|
+
if (values.some((v) => v === null))
|
|
170
|
+
continue;
|
|
171
|
+
const name = composeRoutePath(values);
|
|
172
|
+
if (name !== route.name)
|
|
173
|
+
updates.push({ ...route, name });
|
|
203
174
|
}
|
|
204
|
-
return
|
|
175
|
+
return updates;
|
|
205
176
|
},
|
|
206
177
|
};
|
|
178
|
+
const LAZY_ROUTE_PREFIX = 'lazy-import:';
|
|
179
|
+
const ROUTE_PARTS_PREFIX = 'route-parts:';
|
|
180
|
+
/** React Router's nesting: a child path is relative unless it starts with `/`. */
|
|
181
|
+
function composeRoutePath(parts) {
|
|
182
|
+
let path = '';
|
|
183
|
+
for (const part of parts) {
|
|
184
|
+
if (part.startsWith('/'))
|
|
185
|
+
path = part;
|
|
186
|
+
else if (part)
|
|
187
|
+
path = `${path.replace(/\/+$/, '')}/${part}`;
|
|
188
|
+
}
|
|
189
|
+
return ('/' + path.replace(/^\/+/, '')).replace(/\/{2,}/g, '/').replace(/(.)\/$/, '$1');
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* The string a member expression like `paths.app.root.path` reads from a
|
|
193
|
+
* constant object literal — the constant found through the route file's
|
|
194
|
+
* import of its root name, or in the file itself.
|
|
195
|
+
*/
|
|
196
|
+
function constantPathValue(expr, fromFile, context) {
|
|
197
|
+
const [root, ...keys] = expr.split('.');
|
|
198
|
+
if (!root || keys.length === 0)
|
|
199
|
+
return null;
|
|
200
|
+
let file = fromFile;
|
|
201
|
+
let name = root;
|
|
202
|
+
const mapping = context.getImportMappings(fromFile, 'tsx').find((m) => m.localName === root) ??
|
|
203
|
+
context.getImportMappings(fromFile, 'typescript').find((m) => m.localName === root);
|
|
204
|
+
if (mapping) {
|
|
205
|
+
const resolved = (0, import_resolver_1.resolveImportPath)(mapping.source, fromFile, 'typescript', context);
|
|
206
|
+
if (!resolved)
|
|
207
|
+
return null;
|
|
208
|
+
file = resolved;
|
|
209
|
+
if (mapping.exportedName && mapping.exportedName !== 'default' && mapping.exportedName !== '*')
|
|
210
|
+
name = mapping.exportedName;
|
|
211
|
+
}
|
|
212
|
+
const decl = context.getNodesInFile(file).find((n) => n.name === name && (n.kind === 'constant' || n.kind === 'variable'));
|
|
213
|
+
if (!decl)
|
|
214
|
+
return null;
|
|
215
|
+
const lines = context.readFile(file)?.split('\n') ?? [];
|
|
216
|
+
const text = lines.slice(decl.startLine - 1, decl.endLine).join('\n');
|
|
217
|
+
const open = text.indexOf('{', Math.max(0, text.search(new RegExp(`\\b${name}\\b`))));
|
|
218
|
+
return open < 0 ? null : readObjectPath(text, open, keys);
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* The href a route-config object names — `paths.app.discussion.getHref(id)`
|
|
222
|
+
* or `paths.app.discussion.path` against `export const paths = { app: {
|
|
223
|
+
* discussion: { path: 'discussions/:discussionId', getHref: (id: string) =>
|
|
224
|
+
* \`/app/discussions/${id}\` } } }` (bulletproof-react's `config/paths.ts`)
|
|
225
|
+
* — as the string or template literal it returns, ready for the href reader.
|
|
226
|
+
* A `${…}` glued to a segment (a `?redirectTo=` suffix) is dropped; one
|
|
227
|
+
* that is a whole segment stays a hole. Null for anything else.
|
|
228
|
+
*/
|
|
229
|
+
function configHrefExpression(expr, fromFile, context) {
|
|
230
|
+
const m = /^\s*([A-Za-z_$][\w$]*)((?:\s*\??\.\s*[A-Za-z_$][\w$]*)+)\s*(\((?:[^()]|\([^()]*\))*\))?\s*$/.exec(expr);
|
|
231
|
+
if (!m)
|
|
232
|
+
return null;
|
|
233
|
+
const root = m[1];
|
|
234
|
+
const keys = m[2].split('.').map((k) => k.replace(/[?\s]/g, '')).filter(Boolean);
|
|
235
|
+
let file = fromFile;
|
|
236
|
+
let name = root;
|
|
237
|
+
const mapping = context.getImportMappings(fromFile, 'tsx').find((x) => x.localName === root) ??
|
|
238
|
+
context.getImportMappings(fromFile, 'typescript').find((x) => x.localName === root);
|
|
239
|
+
if (mapping) {
|
|
240
|
+
const resolved = (0, import_resolver_1.resolveImportPath)(mapping.source, fromFile, 'typescript', context);
|
|
241
|
+
if (!resolved)
|
|
242
|
+
return null;
|
|
243
|
+
file = resolved;
|
|
244
|
+
if (mapping.exportedName && mapping.exportedName !== 'default' && mapping.exportedName !== '*')
|
|
245
|
+
name = mapping.exportedName;
|
|
246
|
+
}
|
|
247
|
+
const decl = context.getNodesInFile(file).find((n) => n.name === name && (n.kind === 'constant' || n.kind === 'variable'));
|
|
248
|
+
if (!decl)
|
|
249
|
+
return null;
|
|
250
|
+
const lines = context.readFile(file)?.split('\n') ?? [];
|
|
251
|
+
const text = lines.slice(decl.startLine - 1, decl.endLine).join('\n');
|
|
252
|
+
const open = text.indexOf('{', Math.max(0, text.search(new RegExp(`\\b${name}\\b`))));
|
|
253
|
+
if (open < 0)
|
|
254
|
+
return null;
|
|
255
|
+
let value = readObjectValue(text, open, keys);
|
|
256
|
+
if (value === null)
|
|
257
|
+
return null;
|
|
258
|
+
// A function's value is what it returns: `(id: string) => \`/app/…\``, `() => { return '/'; }`.
|
|
259
|
+
if (m[3] !== undefined) {
|
|
260
|
+
const body = /^(?:async\s+)?(?:\([^()]*(?:\([^()]*\)[^()]*)*\)|[A-Za-z_$][\w$]*)\s*(?::\s*[^=]+?)?=>\s*/.exec(value);
|
|
261
|
+
if (!body)
|
|
262
|
+
return null;
|
|
263
|
+
value = value.slice(body[0].length).trim();
|
|
264
|
+
if (value.startsWith('{'))
|
|
265
|
+
value = /\breturn\s+([`'"][\s\S]*?[`'"])\s*;?\s*}/.exec(value)?.[1] ?? '';
|
|
266
|
+
}
|
|
267
|
+
if (!/^[`'"]/.test(value))
|
|
268
|
+
return null;
|
|
269
|
+
// `/auth/login${redirectTo ? … : ''}`: a hole glued to a segment is a suffix, not a segment.
|
|
270
|
+
return value.startsWith('`') ? dropGluedTemplateHoles(value) : value;
|
|
271
|
+
}
|
|
272
|
+
/** Remove each `${…}` of a template literal that is not a whole path segment. */
|
|
273
|
+
function dropGluedTemplateHoles(template) {
|
|
274
|
+
let out = '';
|
|
275
|
+
for (let i = 0; i < template.length; i++) {
|
|
276
|
+
if (template[i] === '$' && template[i + 1] === '{') {
|
|
277
|
+
let depth = 0;
|
|
278
|
+
let j = i + 1;
|
|
279
|
+
for (; j < template.length; j++) {
|
|
280
|
+
if (template[j] === '{')
|
|
281
|
+
depth++;
|
|
282
|
+
else if (template[j] === '}' && --depth === 0)
|
|
283
|
+
break;
|
|
284
|
+
}
|
|
285
|
+
const hole = template.slice(i, j + 1);
|
|
286
|
+
const next = template[j + 1];
|
|
287
|
+
if (out.endsWith('/') && (next === '/' || next === '`' || next === '?' || next === undefined))
|
|
288
|
+
out += hole;
|
|
289
|
+
i = j;
|
|
290
|
+
continue;
|
|
291
|
+
}
|
|
292
|
+
out += template[i];
|
|
293
|
+
}
|
|
294
|
+
return out;
|
|
295
|
+
}
|
|
296
|
+
/** Walk `keys` into the object literal opening at `at`; the final value's source text, or null. */
|
|
297
|
+
function readObjectValue(text, at, keys) {
|
|
298
|
+
const skipString = (j) => {
|
|
299
|
+
const quote = text[j];
|
|
300
|
+
for (j++; j < text.length && text[j] !== quote; j++)
|
|
301
|
+
if (text[j] === '\\')
|
|
302
|
+
j++;
|
|
303
|
+
return j + 1;
|
|
304
|
+
};
|
|
305
|
+
const skipValue = (j) => {
|
|
306
|
+
let depth = 0;
|
|
307
|
+
for (; j < text.length; j++) {
|
|
308
|
+
const ch = text[j];
|
|
309
|
+
if (ch === '"' || ch === "'" || ch === '`') {
|
|
310
|
+
j = skipString(j) - 1;
|
|
311
|
+
continue;
|
|
312
|
+
}
|
|
313
|
+
if (ch === '{' || ch === '[' || ch === '(')
|
|
314
|
+
depth++;
|
|
315
|
+
else if (ch === '}' || ch === ']' || ch === ')') {
|
|
316
|
+
if (depth === 0)
|
|
317
|
+
return j;
|
|
318
|
+
depth--;
|
|
319
|
+
}
|
|
320
|
+
else if (ch === ',' && depth === 0)
|
|
321
|
+
return j;
|
|
322
|
+
}
|
|
323
|
+
return j;
|
|
324
|
+
};
|
|
325
|
+
let i = at + 1;
|
|
326
|
+
while (i < text.length) {
|
|
327
|
+
const m = /^\s*(?:([A-Za-z_$][\w$]*)|["']([^"']+)["'])\s*:\s*/.exec(text.slice(i));
|
|
328
|
+
if (!m) {
|
|
329
|
+
const next = skipValue(i);
|
|
330
|
+
if (text[next] !== ',')
|
|
331
|
+
return null;
|
|
332
|
+
i = next + 1;
|
|
333
|
+
continue;
|
|
334
|
+
}
|
|
335
|
+
const key = m[1] ?? m[2];
|
|
336
|
+
const valueAt = i + m[0].length;
|
|
337
|
+
const end = skipValue(valueAt);
|
|
338
|
+
if (key === keys[0]) {
|
|
339
|
+
if (keys.length === 1)
|
|
340
|
+
return text.slice(valueAt, end).trim();
|
|
341
|
+
return text[valueAt] === '{' ? readObjectValue(text, valueAt, keys.slice(1)) : null;
|
|
342
|
+
}
|
|
343
|
+
if (text[end] !== ',')
|
|
344
|
+
return null;
|
|
345
|
+
i = end + 1;
|
|
346
|
+
}
|
|
347
|
+
return null;
|
|
348
|
+
}
|
|
349
|
+
/** Walk `keys` into the object literal opening at `at`; the string literal at the end, or null. */
|
|
350
|
+
function readObjectPath(text, at, keys) {
|
|
351
|
+
const skipString = (j) => {
|
|
352
|
+
const quote = text[j];
|
|
353
|
+
for (j++; j < text.length && text[j] !== quote; j++)
|
|
354
|
+
if (text[j] === '\\')
|
|
355
|
+
j++;
|
|
356
|
+
return j + 1;
|
|
357
|
+
};
|
|
358
|
+
const skipValue = (j) => {
|
|
359
|
+
let depth = 0;
|
|
360
|
+
for (; j < text.length; j++) {
|
|
361
|
+
const ch = text[j];
|
|
362
|
+
if (ch === '"' || ch === "'" || ch === '`') {
|
|
363
|
+
j = skipString(j) - 1;
|
|
364
|
+
continue;
|
|
365
|
+
}
|
|
366
|
+
if (ch === '{' || ch === '[' || ch === '(')
|
|
367
|
+
depth++;
|
|
368
|
+
else if (ch === '}' || ch === ']' || ch === ')') {
|
|
369
|
+
if (depth === 0)
|
|
370
|
+
return j;
|
|
371
|
+
depth--;
|
|
372
|
+
}
|
|
373
|
+
else if (ch === ',' && depth === 0)
|
|
374
|
+
return j;
|
|
375
|
+
}
|
|
376
|
+
return j;
|
|
377
|
+
};
|
|
378
|
+
let i = at + 1;
|
|
379
|
+
while (i < text.length) {
|
|
380
|
+
const m = /^\s*(?:([A-Za-z_$][\w$]*)|["']([^"']+)["'])\s*:\s*/.exec(text.slice(i));
|
|
381
|
+
if (!m) {
|
|
382
|
+
const next = skipValue(i);
|
|
383
|
+
if (text[next] !== ',')
|
|
384
|
+
return null;
|
|
385
|
+
i = next + 1;
|
|
386
|
+
continue;
|
|
387
|
+
}
|
|
388
|
+
const key = m[1] ?? m[2];
|
|
389
|
+
const valueAt = i + m[0].length;
|
|
390
|
+
if (key === keys[0]) {
|
|
391
|
+
if (keys.length === 1) {
|
|
392
|
+
const lit = /^(["'])((?:\\.|(?!\1).)*)\1/.exec(text.slice(valueAt));
|
|
393
|
+
return lit ? lit[2] : null;
|
|
394
|
+
}
|
|
395
|
+
return text[valueAt] === '{' ? readObjectPath(text, valueAt, keys.slice(1)) : null;
|
|
396
|
+
}
|
|
397
|
+
const end = skipValue(valueAt);
|
|
398
|
+
if (text[end] !== ',')
|
|
399
|
+
return null;
|
|
400
|
+
i = end + 1;
|
|
401
|
+
}
|
|
402
|
+
return null;
|
|
403
|
+
}
|
|
404
|
+
/** The component a lazy route module renders: its default export, else its `Component` export. */
|
|
405
|
+
function lazyRouteComponent(spec, fromFile, context) {
|
|
406
|
+
const file = (0, import_resolver_1.resolveImportPath)(spec, fromFile, 'typescript', context);
|
|
407
|
+
if (!file)
|
|
408
|
+
return null;
|
|
409
|
+
const source = context.readFile(file) ?? '';
|
|
410
|
+
const named = /\bexport\s+default\s+(?:async\s+)?(?:function\s*\*?\s*|class\s+)?([A-Za-z_$][\w$]*)/.exec(source)?.[1] ??
|
|
411
|
+
(/\bexport\s+(?:const|function|class)\s+Component\b/.test(source) ? 'Component' : null);
|
|
412
|
+
if (!named)
|
|
413
|
+
return null;
|
|
414
|
+
const node = context.getNodesInFile(file).find((n) => n.name === named &&
|
|
415
|
+
(n.kind === 'function' || n.kind === 'component' || n.kind === 'class' || n.kind === 'constant' || n.kind === 'variable'));
|
|
416
|
+
return node?.id ?? null;
|
|
417
|
+
}
|
|
418
|
+
/** Structural scanner: strings, comments, JSX and balanced expressions are units. */
|
|
419
|
+
function scanRouteDeclarations(source, allowJsx) {
|
|
420
|
+
const routes = [];
|
|
421
|
+
const scopes = [];
|
|
422
|
+
const dataRouter = /\b(?:createBrowserRouter|createHashRouter|createMemoryRouter|createRoutesFromElements)\b/.test(source);
|
|
423
|
+
if (!dataRouter && !/<Route\b/.test(source))
|
|
424
|
+
return routes;
|
|
425
|
+
const literal = (value) => {
|
|
426
|
+
const match = /^(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)')$/.exec(value.trim());
|
|
427
|
+
return match ? match[1] ?? match[2] : undefined;
|
|
428
|
+
};
|
|
429
|
+
// A guard or boundary wrapping the screen (`<ProtectedRoute><AppRoot/></ProtectedRoute>`,
|
|
430
|
+
// `<Suspense>`) is not what the route renders; the first element inside it is.
|
|
431
|
+
const WRAPPER = /^(?:Suspense|ErrorBoundary|\w*(?:Guard|Provider)|(?:Protected|Private|Auth|Require\w*)\w*)$/;
|
|
432
|
+
const componentName = (value, jsx) => {
|
|
433
|
+
if (!value)
|
|
434
|
+
return undefined;
|
|
435
|
+
if (!jsx)
|
|
436
|
+
return /^\s*([A-Z][\w]*)\s*$/.exec(value)?.[1];
|
|
437
|
+
const inner = value.replace(/^\s*\(\s*/, '');
|
|
438
|
+
if (!/^<\s*[A-Z]/.test(inner))
|
|
439
|
+
return undefined;
|
|
440
|
+
const tags = [...inner.matchAll(/<\s*([A-Z][\w]*)\s*(?=[\s/>])/g)].map((m) => m[1]);
|
|
441
|
+
return tags.find((t) => !WRAPPER.test(t)) ?? tags[0];
|
|
442
|
+
};
|
|
443
|
+
// The few characters before `at`, trailing whitespace skipped: enough for the
|
|
444
|
+
// end-anchored checks below without copying the whole prefix per `/` or `<`.
|
|
445
|
+
const tokenBefore = (at) => {
|
|
446
|
+
let j = at - 1;
|
|
447
|
+
while (j >= 0 && /\s/.test(source[j]))
|
|
448
|
+
j--;
|
|
449
|
+
return source.slice(Math.max(0, j - 11), j + 1);
|
|
450
|
+
};
|
|
451
|
+
const trivia = (at) => {
|
|
452
|
+
while (at < source.length) {
|
|
453
|
+
if (/\s/.test(source[at])) {
|
|
454
|
+
at++;
|
|
455
|
+
continue;
|
|
456
|
+
}
|
|
457
|
+
if (source.startsWith('//', at)) {
|
|
458
|
+
const end = source.indexOf('\n', at + 2);
|
|
459
|
+
at = end < 0 ? source.length : end;
|
|
460
|
+
}
|
|
461
|
+
else if (source.startsWith('/*', at)) {
|
|
462
|
+
const end = source.indexOf('*/', at + 2);
|
|
463
|
+
at = end < 0 ? source.length : end + 2;
|
|
464
|
+
}
|
|
465
|
+
else
|
|
466
|
+
break;
|
|
467
|
+
}
|
|
468
|
+
return at;
|
|
469
|
+
};
|
|
470
|
+
function unit(at) {
|
|
471
|
+
const ch = source[at];
|
|
472
|
+
if (ch === '"' || ch === "'" || ch === '`') {
|
|
473
|
+
let i = at + 1;
|
|
474
|
+
while (i < source.length) {
|
|
475
|
+
if (source[i] === '\\') {
|
|
476
|
+
i += 2;
|
|
477
|
+
continue;
|
|
478
|
+
}
|
|
479
|
+
if (source[i] === ch)
|
|
480
|
+
return i + 1;
|
|
481
|
+
if (ch === '`' && source.startsWith('${', i)) {
|
|
482
|
+
i = unit(i + 1);
|
|
483
|
+
continue;
|
|
484
|
+
}
|
|
485
|
+
i++;
|
|
486
|
+
}
|
|
487
|
+
return i;
|
|
488
|
+
}
|
|
489
|
+
// A regex can contain braces or JSX-looking text without ending an expression.
|
|
490
|
+
if (ch === '/') {
|
|
491
|
+
const before = tokenBefore(at);
|
|
492
|
+
if (!before || /[=(:,[!&|?{};]$/.test(before) || /\b(?:return|throw|case|yield)\s*$/.test(before)) {
|
|
493
|
+
let inClass = false;
|
|
494
|
+
for (let i = at + 1; i < source.length && source[i] !== '\n'; i++) {
|
|
495
|
+
if (source[i] === '\\') {
|
|
496
|
+
i++;
|
|
497
|
+
continue;
|
|
498
|
+
}
|
|
499
|
+
if (source[i] === '[')
|
|
500
|
+
inClass = true;
|
|
501
|
+
else if (source[i] === ']')
|
|
502
|
+
inClass = false;
|
|
503
|
+
else if (source[i] === '/' && !inClass) {
|
|
504
|
+
i++;
|
|
505
|
+
while (/[a-z]/i.test(source[i] ?? '') && i < source.length)
|
|
506
|
+
i++;
|
|
507
|
+
return i;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
if (allowJsx && ch === '<' && /^<(?:[A-Za-z][\w.:-]*|>)/.test(source.slice(at))) {
|
|
513
|
+
const before = tokenBefore(at);
|
|
514
|
+
// `count<limit` and `factory<Type>()` are not JSX opening tags.
|
|
515
|
+
if (!/[\w$)\]'"]$/.test(before) || /\breturn$/.test(before))
|
|
516
|
+
return jsx(at);
|
|
517
|
+
}
|
|
518
|
+
const close = ch === '{' ? '}' : ch === '[' ? ']' : ch === '(' ? ')' : undefined;
|
|
519
|
+
if (!close)
|
|
520
|
+
return at + 1;
|
|
521
|
+
let i = at + 1;
|
|
522
|
+
const fields = new Map();
|
|
523
|
+
while ((i = trivia(i)) < source.length && source[i] !== close) {
|
|
524
|
+
// A property must start at an object entry, never inside its value.
|
|
525
|
+
const key = ch === '{' ? /^(?:([A-Za-z_$][\w$]*)|["']([^"']+)["'])\s*:/.exec(source.slice(i)) : null;
|
|
526
|
+
if (key) {
|
|
527
|
+
const start = i;
|
|
528
|
+
const valueAt = trivia(i + key[0].length);
|
|
529
|
+
i = valueAt;
|
|
530
|
+
let valueEnd = i;
|
|
531
|
+
while ((i = trivia(i)) < source.length && source[i] !== ',' && source[i] !== close) {
|
|
532
|
+
i = unit(i);
|
|
533
|
+
valueEnd = i;
|
|
534
|
+
}
|
|
535
|
+
fields.set(key[1] ?? key[2], { value: source.slice(valueAt, valueEnd).trim(), at: start });
|
|
536
|
+
}
|
|
537
|
+
else {
|
|
538
|
+
// Skip a whole entry (spread, method, shorthand), but still visit nested units.
|
|
539
|
+
while ((i = trivia(i)) < source.length && source[i] !== ',' && source[i] !== close)
|
|
540
|
+
i = unit(i);
|
|
541
|
+
}
|
|
542
|
+
if (source[i] === ',')
|
|
543
|
+
i++;
|
|
544
|
+
}
|
|
545
|
+
if (dataRouter && ch === '{' && source[i] === close) {
|
|
546
|
+
const pathField = fields.get('path');
|
|
547
|
+
const path = pathField && literal(pathField.value);
|
|
548
|
+
const expr = pathField && path === undefined && /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+$/.test(pathField.value) ? pathField.value : undefined;
|
|
549
|
+
const component = componentName(fields.get('element')?.value, true)
|
|
550
|
+
?? componentName(fields.get('Component')?.value, false);
|
|
551
|
+
const lazy = /\bimport\s*\(\s*["']([^"']+)["']\s*\)/.exec(fields.get('lazy')?.value ?? '')?.[1];
|
|
552
|
+
if (pathField && (path !== undefined || expr)) {
|
|
553
|
+
scopes.push({ part: path !== undefined ? { lit: path } : { expr }, at: pathField.at, end: i, component, lazy });
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
return i < source.length ? i + 1 : i;
|
|
557
|
+
}
|
|
558
|
+
function jsx(at) {
|
|
559
|
+
const tag = /^<([\w.:-]*)/.exec(source.slice(at));
|
|
560
|
+
let i = at + tag[0].length;
|
|
561
|
+
const attrs = new Map();
|
|
562
|
+
while ((i = trivia(i)) < source.length && source[i] !== '>' && !source.startsWith('/>', i)) {
|
|
563
|
+
const attr = /^[\w:-]+/.exec(source.slice(i));
|
|
564
|
+
if (!attr) {
|
|
565
|
+
i = unit(i);
|
|
566
|
+
continue;
|
|
567
|
+
}
|
|
568
|
+
i = trivia(i + attr[0].length);
|
|
569
|
+
if (source[i] !== '=')
|
|
570
|
+
continue;
|
|
571
|
+
i = trivia(i + 1);
|
|
572
|
+
const start = i;
|
|
573
|
+
i = unit(i);
|
|
574
|
+
attrs.set(attr[0], source.slice(start, i));
|
|
575
|
+
}
|
|
576
|
+
let scope;
|
|
577
|
+
if (tag[1] === 'Route' && i < source.length) {
|
|
578
|
+
const path = literal(attrs.get('path') ?? '');
|
|
579
|
+
const expression = (name) => attrs.get(name)?.replace(/^\{([\s\S]*)\}$/, '$1');
|
|
580
|
+
const component = componentName(expression('component'), false) ?? componentName(expression('element'), true);
|
|
581
|
+
const lazy = /\bimport\s*\(\s*["']([^"']+)["']\s*\)/.exec(expression('lazy') ?? '')?.[1];
|
|
582
|
+
if (path) {
|
|
583
|
+
scope = { part: { lit: path }, at, end: source.length, component, lazy, jsx: true };
|
|
584
|
+
scopes.push(scope);
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
if (source.startsWith('/>', i)) {
|
|
588
|
+
if (scope)
|
|
589
|
+
scope.end = i + 2;
|
|
590
|
+
return i + 2;
|
|
591
|
+
}
|
|
592
|
+
i++;
|
|
593
|
+
while (i < source.length) {
|
|
594
|
+
if (source.startsWith('</', i)) {
|
|
595
|
+
const end = source.indexOf('>', i + 2);
|
|
596
|
+
const after = end < 0 ? source.length : end + 1;
|
|
597
|
+
if (scope)
|
|
598
|
+
scope.end = after;
|
|
599
|
+
return after;
|
|
600
|
+
}
|
|
601
|
+
if (source[i] === '<' && /^<(?:[A-Za-z]|>)/.test(source.slice(i)))
|
|
602
|
+
i = jsx(i);
|
|
603
|
+
else if (source[i] === '{')
|
|
604
|
+
i = unit(i);
|
|
605
|
+
else
|
|
606
|
+
i++;
|
|
607
|
+
}
|
|
608
|
+
if (scope)
|
|
609
|
+
scope.end = i;
|
|
610
|
+
return i;
|
|
611
|
+
}
|
|
612
|
+
let at = 0;
|
|
613
|
+
while ((at = trivia(at)) < source.length)
|
|
614
|
+
at = unit(at);
|
|
615
|
+
// A child route's path is relative to the routes around it: compose each
|
|
616
|
+
// rendering route's path from the path-bearing scopes that contain it.
|
|
617
|
+
for (const scope of scopes) {
|
|
618
|
+
if (!scope.component && !scope.lazy && !scope.jsx)
|
|
619
|
+
continue;
|
|
620
|
+
const chain = scopes
|
|
621
|
+
.filter((outer) => outer !== scope && outer.at < scope.at && outer.end >= scope.end)
|
|
622
|
+
.sort((a, b) => a.at - b.at);
|
|
623
|
+
const parts = [...chain.map((c) => c.part), scope.part];
|
|
624
|
+
const shown = parts.map((p) => p.lit ?? `{${p.expr}}`);
|
|
625
|
+
routes.push({ path: composeRoutePath(shown), parts, component: scope.component, lazy: scope.lazy, at: scope.at });
|
|
626
|
+
}
|
|
627
|
+
return routes.sort((a, b) => a.at - b.at);
|
|
628
|
+
}
|
|
207
629
|
/**
|
|
208
630
|
* Check if string is PascalCase
|
|
209
631
|
*/
|
|
@@ -247,16 +669,31 @@ function resolveComponent(name, fromFile, context) {
|
|
|
247
669
|
// repo (#764) — let the name-matcher's proximity scoring decide instead.
|
|
248
670
|
return components.length === 1 ? components[0].id : null;
|
|
249
671
|
}
|
|
672
|
+
/** JS/TS (and their JSX dialects): modules where a cross-file name needs an import. */
|
|
673
|
+
function isEsmLanguage(language) {
|
|
674
|
+
return language === 'typescript' || language === 'tsx' || language === 'javascript' || language === 'jsx';
|
|
675
|
+
}
|
|
250
676
|
/**
|
|
251
677
|
* Resolve a custom hook reference using name-based lookup
|
|
252
678
|
*/
|
|
253
|
-
function resolveHook(name, context) {
|
|
679
|
+
function resolveHook(name, fromFile, context, language) {
|
|
254
680
|
const candidates = context.getNodesByName(name);
|
|
255
681
|
if (candidates.length === 0)
|
|
256
682
|
return null;
|
|
257
|
-
|
|
683
|
+
// A hook nested inside another function is only callable in there.
|
|
684
|
+
const nested = (n) => context.getNodesInFile(n.filePath).some((f) => f.id !== n.id && (f.kind === 'function' || f.kind === 'method') && f.startLine <= n.startLine && f.endLine >= n.endLine &&
|
|
685
|
+
(f.startLine < n.startLine || f.endLine > n.endLine));
|
|
686
|
+
const hooks = candidates.filter((n) => n.kind === 'function' && n.name.startsWith('use') && !nested(n));
|
|
258
687
|
if (hooks.length === 0)
|
|
259
688
|
return null;
|
|
689
|
+
const sameFile = hooks.find((n) => n.filePath === fromFile);
|
|
690
|
+
if (sameFile)
|
|
691
|
+
return sameFile.id;
|
|
692
|
+
// A JS/TS module reaches another file's hook only by importing it — the
|
|
693
|
+
// import resolver's to follow (an imported name never gets here) — never
|
|
694
|
+
// by name alone.
|
|
695
|
+
if (isEsmLanguage(language))
|
|
696
|
+
return null;
|
|
260
697
|
// Prefer hooks directories
|
|
261
698
|
const HOOK_DIRS = ['/hooks/', '/src/hooks/', '/lib/hooks/', '/utils/hooks/'];
|
|
262
699
|
const preferred = hooks.filter((n) => HOOK_DIRS.some((d) => n.filePath.includes(d)));
|
|
@@ -267,7 +704,13 @@ function resolveHook(name, context) {
|
|
|
267
704
|
/**
|
|
268
705
|
* Resolve a context reference using name-based lookup
|
|
269
706
|
*/
|
|
270
|
-
function resolveContext(name, context) {
|
|
707
|
+
function resolveContext(name, ref, context) {
|
|
708
|
+
// In a JS/TS module only the file's own context is in reach by name; another
|
|
709
|
+
// file's comes through an import (trpc's adapters' `createContext?.(…)` is an
|
|
710
|
+
// option, not an example app's `createContext`).
|
|
711
|
+
if (isEsmLanguage(ref.language)) {
|
|
712
|
+
return context.getNodesByName(name).find((n) => n.filePath === ref.filePath)?.id ?? null;
|
|
713
|
+
}
|
|
271
714
|
const candidates = context.getNodesByName(name);
|
|
272
715
|
if (candidates.length === 0) {
|
|
273
716
|
// Try without Context/Provider suffix
|
|
@@ -286,49 +729,4 @@ function resolveContext(name, context) {
|
|
|
286
729
|
return preferred[0].id;
|
|
287
730
|
return candidates[0].id;
|
|
288
731
|
}
|
|
289
|
-
/**
|
|
290
|
-
* Convert file path to Next.js route
|
|
291
|
-
*/
|
|
292
|
-
function filePathToRoute(filePath) {
|
|
293
|
-
// pages/index.tsx -> /
|
|
294
|
-
// pages/about.tsx -> /about
|
|
295
|
-
// pages/blog/[slug].tsx -> /blog/:slug
|
|
296
|
-
// app/page.tsx -> /
|
|
297
|
-
// app/about/page.tsx -> /about
|
|
298
|
-
// Only real page-component files are routes. Exclude non-page extensions
|
|
299
|
-
// (.mjs/.json/.cjs), config files (next.config.ts, vite.config.ts…), and
|
|
300
|
-
// Next.js special files (_app/_document). This also stops a `*.config.mjs`
|
|
301
|
-
// with `export default` in a dir like `nextjs-pages/` from being a "route".
|
|
302
|
-
const base = filePath.split('/').pop() ?? '';
|
|
303
|
-
if (!/\.(tsx?|jsx?)$/.test(base))
|
|
304
|
-
return null;
|
|
305
|
-
if (base.startsWith('_') || /\.config\.[a-z]+$/.test(base))
|
|
306
|
-
return null;
|
|
307
|
-
// Match pages/ and app/ as PATH SEGMENTS (not a substring — `nextjs-pages/`
|
|
308
|
-
// must not count as a `pages/` router dir).
|
|
309
|
-
if (/(?:^|\/)pages\//.test(filePath)) {
|
|
310
|
-
let route = filePath
|
|
311
|
-
.replace(/^.*pages\//, '/')
|
|
312
|
-
.replace(/\/index\.(tsx?|jsx?)$/, '')
|
|
313
|
-
.replace(/\.(tsx?|jsx?)$/, '')
|
|
314
|
-
.replace(/\[([^\]]+)\]/g, ':$1');
|
|
315
|
-
if (route === '')
|
|
316
|
-
route = '/';
|
|
317
|
-
return route;
|
|
318
|
-
}
|
|
319
|
-
if (/(?:^|\/)app\//.test(filePath)) {
|
|
320
|
-
// App router - only page.tsx files are routes
|
|
321
|
-
if (!filePath.includes('page.')) {
|
|
322
|
-
return null;
|
|
323
|
-
}
|
|
324
|
-
let route = filePath
|
|
325
|
-
.replace(/^.*app\//, '/')
|
|
326
|
-
.replace(/\/page\.(tsx?|jsx?)$/, '')
|
|
327
|
-
.replace(/\[([^\]]+)\]/g, ':$1');
|
|
328
|
-
if (route === '')
|
|
329
|
-
route = '/';
|
|
330
|
-
return route;
|
|
331
|
-
}
|
|
332
|
-
return null;
|
|
333
|
-
}
|
|
334
732
|
//# sourceMappingURL=react.js.map
|