@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
|
@@ -0,0 +1,1126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Angular Router — routes declared in `Routes` arrays, navigation written as
|
|
4
|
+
* command arrays.
|
|
5
|
+
*
|
|
6
|
+
* export const routes: Routes = [
|
|
7
|
+
* { path: 'login', component: AuthComponent },
|
|
8
|
+
* { path: 'article/:slug', loadComponent: () => import('./article.component') },
|
|
9
|
+
* { path: 'editor', children: [{ path: ':slug', loadComponent: … }] },
|
|
10
|
+
* { path: 'profile', loadChildren: () => import('./profile/profile.routes') },
|
|
11
|
+
* ];
|
|
12
|
+
*
|
|
13
|
+
* `extract()` reads every such array — typed `Routes` / `Route[]`, passed to
|
|
14
|
+
* `RouterModule.forRoot/forChild(…)` or `provideRouter(…)`, or a routes
|
|
15
|
+
* file's `export default [...]` — into one `route` node per screen, named by
|
|
16
|
+
* its path the way every other framework's routes are. Angular paths are
|
|
17
|
+
* relative: a child's path joins its parent's, and a `loadChildren` file's
|
|
18
|
+
* routes sit under the path that lazy-loads them, which only a cross-file
|
|
19
|
+
* pass can know — so `extract()` names a routes file's routes as if it were
|
|
20
|
+
* mounted at `/`, and `postExtract()` puts each under its mount (following an
|
|
21
|
+
* NgModule `loadChildren` through to the routing module it imports).
|
|
22
|
+
*
|
|
23
|
+
* A route with `children` is a layout, not a screen: its component renders
|
|
24
|
+
* an outlet the children fill, and the `''` child is the screen at its
|
|
25
|
+
* address. It is a screen only when no child claims that address. A
|
|
26
|
+
* `redirectTo` entry and a `**` catch-all are not screens either.
|
|
27
|
+
*
|
|
28
|
+
* A path written as a constant (`path: internalRoutes.account.path`) is read
|
|
29
|
+
* from the object the constant names, `$localize` defaults included, in the
|
|
30
|
+
* same cross-file pass.
|
|
31
|
+
*
|
|
32
|
+
* A route binds to its component with a `references` edge — `route-roots.ts`
|
|
33
|
+
* takes a class as the handler a resolver named. A lazy `loadComponent`
|
|
34
|
+
* names a file, and its component is the `@Component` class that file
|
|
35
|
+
* exports.
|
|
36
|
+
*
|
|
37
|
+
* **Navigation is a command array.** `router.navigate(['/article', slug])`
|
|
38
|
+
* is `/article/${…}`; `navigateByUrl('/login')`, a guard's
|
|
39
|
+
* `router.createUrlTree(['/login'])` and `parseUrl('/login')` name a path the
|
|
40
|
+
* way every other router's calls do. A relative navigation (`relativeTo`) is
|
|
41
|
+
* left unresolved rather than guessed. `routerLink` is markup, read by
|
|
42
|
+
* `angular-template-synthesizer.ts`.
|
|
43
|
+
*/
|
|
44
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
45
|
+
if (k2 === undefined) k2 = k;
|
|
46
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
47
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
48
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
49
|
+
}
|
|
50
|
+
Object.defineProperty(o, k2, desc);
|
|
51
|
+
}) : (function(o, m, k, k2) {
|
|
52
|
+
if (k2 === undefined) k2 = k;
|
|
53
|
+
o[k2] = m[k];
|
|
54
|
+
}));
|
|
55
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
56
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
57
|
+
}) : function(o, v) {
|
|
58
|
+
o["default"] = v;
|
|
59
|
+
});
|
|
60
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
61
|
+
var ownKeys = function(o) {
|
|
62
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
63
|
+
var ar = [];
|
|
64
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
65
|
+
return ar;
|
|
66
|
+
};
|
|
67
|
+
return ownKeys(o);
|
|
68
|
+
};
|
|
69
|
+
return function (mod) {
|
|
70
|
+
if (mod && mod.__esModule) return mod;
|
|
71
|
+
var result = {};
|
|
72
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
73
|
+
__setModuleDefault(result, mod);
|
|
74
|
+
return result;
|
|
75
|
+
};
|
|
76
|
+
})();
|
|
77
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
78
|
+
exports.angularRouterResolver = void 0;
|
|
79
|
+
exports.localizeDefault = localizeDefault;
|
|
80
|
+
exports.staticString = staticString;
|
|
81
|
+
exports.parseAngularRoutes = parseAngularRoutes;
|
|
82
|
+
exports.isAngularRoute = isAngularRoute;
|
|
83
|
+
exports.componentClassesIn = componentClassesIn;
|
|
84
|
+
exports.constantText = constantText;
|
|
85
|
+
exports.angularRouteTable = angularRouteTable;
|
|
86
|
+
exports.angularRoutesFor = angularRoutesFor;
|
|
87
|
+
exports.commandsHref = commandsHref;
|
|
88
|
+
exports.namesSomewhere = namesSomewhere;
|
|
89
|
+
exports.propertyInitializer = propertyInitializer;
|
|
90
|
+
exports.angularDestination = angularDestination;
|
|
91
|
+
exports.templatePathFor = templatePathFor;
|
|
92
|
+
const path = __importStar(require("path"));
|
|
93
|
+
const import_resolver_1 = require("../import-resolver");
|
|
94
|
+
const strip_comments_1 = require("../strip-comments");
|
|
95
|
+
const object_literal_1 = require("./object-literal");
|
|
96
|
+
const package_deps_1 = require("./package-deps");
|
|
97
|
+
const expo_router_1 = require("./expo-router");
|
|
98
|
+
const nextjs_1 = require("./nextjs");
|
|
99
|
+
/** A file that could hold a routes array — the cheap gate before scanning. */
|
|
100
|
+
const ROUTER_IMPORT = /['"]@angular\/router['"]/;
|
|
101
|
+
/**
|
|
102
|
+
* Where a routes array opens: typed `Routes` / `Route[]`, handed to
|
|
103
|
+
* `RouterModule.forRoot/forChild` or `provideRouter`, or a routes file's
|
|
104
|
+
* default export. `children: [` is reached by walking an entry, never here.
|
|
105
|
+
*/
|
|
106
|
+
const ARRAY_OPENERS = /(?::\s*(?:Routes|Route\s*\[\s*\])\s*=\s*|\bRouterModule\s*\.\s*for(?:Root|Child)\s*\(\s*|\bprovideRouter\s*\(\s*|\bexport\s+default\s+(?:<\s*Routes\s*>\s*)?|\b(?:const|let)\s+[A-Za-z_$][\w$]*\s*=\s*)\[/g;
|
|
107
|
+
/** The fields that make an object a route rather than any object in an array. */
|
|
108
|
+
const ROUTE_KEYS = ['component', 'loadComponent', 'children', 'loadChildren', 'redirectTo'];
|
|
109
|
+
/** A path value the pass can name later: `internalRoutes.account.path`. */
|
|
110
|
+
const CONSTANT_PATH = /^[A-Za-z_$][\w$]*(?:\s*\.\s*[A-Za-z_$][\w$]*)+$/;
|
|
111
|
+
/** A `$localize` tagged template's default text: `` $localize`:kebab-case@@routes.about:about` `` is `about`. */
|
|
112
|
+
function localizeDefault(text) {
|
|
113
|
+
const m = /^\$localize\s*`((?:[^`\\$]|\\.)*)`$/.exec(text.trim());
|
|
114
|
+
if (!m)
|
|
115
|
+
return null;
|
|
116
|
+
const body = m[1];
|
|
117
|
+
// `:meaning|description@@id:text` — the metadata block is the leading `:…:`.
|
|
118
|
+
const meta = /^:[^:]*:/.exec(body);
|
|
119
|
+
return meta ? body.slice(meta[0].length) : body;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* A string written statically: a literal, a `$localize` default, or `+`
|
|
123
|
+
* between those — `'/' + $localize`:…:about``, as Ghostfolio builds its
|
|
124
|
+
* links. Null when any part is computed.
|
|
125
|
+
*/
|
|
126
|
+
function staticString(text) {
|
|
127
|
+
const parts = [];
|
|
128
|
+
let rest = text.trim();
|
|
129
|
+
while (rest.length > 0) {
|
|
130
|
+
let part = null;
|
|
131
|
+
let used = 0;
|
|
132
|
+
const q = rest[0];
|
|
133
|
+
if (q === '"' || q === "'") {
|
|
134
|
+
part = (0, expo_router_1.readStringAt)(rest, 0);
|
|
135
|
+
used = part === null ? 0 : (0, object_literal_1.skipString)(rest, 0) + 1;
|
|
136
|
+
}
|
|
137
|
+
else if (rest.startsWith('$localize')) {
|
|
138
|
+
const tick = rest.indexOf('`');
|
|
139
|
+
const end = tick < 0 ? -1 : (0, object_literal_1.skipString)(rest, tick);
|
|
140
|
+
if (end > 0) {
|
|
141
|
+
part = localizeDefault(rest.slice(0, end + 1));
|
|
142
|
+
used = end + 1;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
else if (q === '`') {
|
|
146
|
+
const end = (0, object_literal_1.skipString)(rest, 0);
|
|
147
|
+
const body = end > 0 ? rest.slice(1, end) : '';
|
|
148
|
+
if (end > 0 && !body.includes('${')) {
|
|
149
|
+
part = body;
|
|
150
|
+
used = end + 1;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (part === null || used === 0)
|
|
154
|
+
return null;
|
|
155
|
+
parts.push(part);
|
|
156
|
+
rest = rest.slice(used).trim();
|
|
157
|
+
if (rest.length === 0)
|
|
158
|
+
break;
|
|
159
|
+
if (rest[0] !== '+')
|
|
160
|
+
return null;
|
|
161
|
+
rest = rest.slice(1).trim();
|
|
162
|
+
}
|
|
163
|
+
return parts.length > 0 ? parts.join('') : null;
|
|
164
|
+
}
|
|
165
|
+
/** A route's own path segment(s): a string, a `$localize` default, or a constant kept as `{expr}`; null when it cannot be named. */
|
|
166
|
+
function pathSegments(text) {
|
|
167
|
+
const trimmed = text.trim();
|
|
168
|
+
const value = staticString(trimmed);
|
|
169
|
+
if (value !== null) {
|
|
170
|
+
if (value.includes('**'))
|
|
171
|
+
return null;
|
|
172
|
+
return value.split('/').filter((s) => s.length > 0);
|
|
173
|
+
}
|
|
174
|
+
if (CONSTANT_PATH.test(trimmed))
|
|
175
|
+
return [`{${trimmed.replace(/\s+/g, '')}}`];
|
|
176
|
+
// `` `issue/:${ProjectConst.IssueId}` ``: a template whose holes are constants.
|
|
177
|
+
if (trimmed.startsWith('`') && (0, object_literal_1.skipString)(trimmed, 0) === trimmed.length - 1) {
|
|
178
|
+
let ok = true;
|
|
179
|
+
const body = trimmed.slice(1, -1).replace(/\$\{([^}]*)\}/g, (_all, hole) => {
|
|
180
|
+
if (!CONSTANT_PATH.test(hole.trim()))
|
|
181
|
+
ok = false;
|
|
182
|
+
return `{${hole.replace(/\s+/g, '')}}`;
|
|
183
|
+
});
|
|
184
|
+
if (ok && !body.includes('**'))
|
|
185
|
+
return body.split('/').filter((seg) => seg.length > 0);
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
// `internalRoutes.account.subRoutes.access.path + '/:id'`: each part a
|
|
189
|
+
// string or a constant, the constant a whole segment of its own.
|
|
190
|
+
if (trimmed.includes('+')) {
|
|
191
|
+
const joined = [];
|
|
192
|
+
for (const part of splitPlus(trimmed)) {
|
|
193
|
+
const literal = staticString(part);
|
|
194
|
+
if (literal !== null)
|
|
195
|
+
joined.push(literal);
|
|
196
|
+
else if (CONSTANT_PATH.test(part.trim()))
|
|
197
|
+
joined.push(`{${part.trim().replace(/\s+/g, '')}}`);
|
|
198
|
+
else
|
|
199
|
+
return null;
|
|
200
|
+
}
|
|
201
|
+
const value = joined.join('');
|
|
202
|
+
return value.includes('**') ? null : value.split('/').filter((seg) => seg.length > 0);
|
|
203
|
+
}
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
/** An expression's `+` operands at depth 0, strings and brackets stepped over. */
|
|
207
|
+
function splitPlus(text) {
|
|
208
|
+
const parts = [];
|
|
209
|
+
let start = 0;
|
|
210
|
+
for (let i = 0; i < text.length; i++) {
|
|
211
|
+
const ch = text[i];
|
|
212
|
+
if (ch === '"' || ch === "'" || ch === '`') {
|
|
213
|
+
const end = (0, object_literal_1.skipString)(text, i);
|
|
214
|
+
if (end < 0)
|
|
215
|
+
return [text];
|
|
216
|
+
i = end;
|
|
217
|
+
}
|
|
218
|
+
else if (ch === '(' || ch === '[' || ch === '{') {
|
|
219
|
+
const end = (0, object_literal_1.matchBracket)(text, i);
|
|
220
|
+
if (end < 0)
|
|
221
|
+
return [text];
|
|
222
|
+
i = end;
|
|
223
|
+
}
|
|
224
|
+
else if (ch === '+') {
|
|
225
|
+
parts.push(text.slice(start, i));
|
|
226
|
+
start = i + 1;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
parts.push(text.slice(start));
|
|
230
|
+
return parts;
|
|
231
|
+
}
|
|
232
|
+
/** The component a `component:` / `loadComponent:` value names. */
|
|
233
|
+
function componentRef(field, text) {
|
|
234
|
+
if (field === 'component') {
|
|
235
|
+
const ident = /^\s*([A-Z][\w$]*)\s*$/.exec(text);
|
|
236
|
+
return ident ? { name: ident[1], spec: null } : null;
|
|
237
|
+
}
|
|
238
|
+
const lazy = lazyImport(text);
|
|
239
|
+
return lazy ? { name: lazy.member, spec: lazy.spec } : null;
|
|
240
|
+
}
|
|
241
|
+
/** `() => import('./x')` → `./x`; `.then(m => m.X)` / `.then((c) => c.X)` names the member. */
|
|
242
|
+
function lazyImport(text) {
|
|
243
|
+
const imp = /\bimport\s*\(\s*(['"`])([^'"`]+)\1\s*\)/.exec(text);
|
|
244
|
+
if (!imp)
|
|
245
|
+
return null;
|
|
246
|
+
const after = text.slice(imp.index + imp[0].length);
|
|
247
|
+
const then = /^\s*\.then\s*\(\s*\(?\s*([A-Za-z_$][\w$]*)\s*\)?\s*=>\s*\(?\s*\1\s*\.\s*([A-Za-z_$][\w$]*)/.exec(after);
|
|
248
|
+
// `async () => (await import('./x')).HomeModule`
|
|
249
|
+
const awaited = /^\s*\)\s*\.\s*([A-Za-z_$][\w$]*)/.exec(after);
|
|
250
|
+
return { spec: imp[2], member: then ? then[2] : awaited ? awaited[1] : null };
|
|
251
|
+
}
|
|
252
|
+
function joinPath(segs) {
|
|
253
|
+
return '/' + segs.join('/');
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Every screen and lazy mount a file's routes arrays declare. Entries are
|
|
257
|
+
* walked as objects (`object-literal.ts`), never read out of a window of
|
|
258
|
+
* text: `path` may be written after `component`.
|
|
259
|
+
*/
|
|
260
|
+
function parseAngularRoutes(content) {
|
|
261
|
+
const routes = [];
|
|
262
|
+
const mounts = [];
|
|
263
|
+
const redirects = [];
|
|
264
|
+
if (!ROUTER_IMPORT.test(content))
|
|
265
|
+
return { routes, mounts, redirects };
|
|
266
|
+
const safe = (0, strip_comments_1.stripCommentsForRegex)(content, 'typescript');
|
|
267
|
+
const lineOf = (at) => safe.slice(0, at).split('\n').length;
|
|
268
|
+
const seenPaths = new Set();
|
|
269
|
+
const walked = new Set();
|
|
270
|
+
const walk = (open, close, prefix, depth, layouts) => {
|
|
271
|
+
if (walked.has(open) || depth > 12)
|
|
272
|
+
return;
|
|
273
|
+
walked.add(open);
|
|
274
|
+
for (const obj of (0, object_literal_1.topLevelObjects)(safe, open + 1, close)) {
|
|
275
|
+
const fields = (0, object_literal_1.readFields)(safe, obj.start, obj.end);
|
|
276
|
+
if (!ROUTE_KEYS.some((k) => fields.has(k)))
|
|
277
|
+
continue;
|
|
278
|
+
// A custom `matcher` decides the address at run time — no path to name.
|
|
279
|
+
if (fields.has('matcher'))
|
|
280
|
+
continue;
|
|
281
|
+
const pathField = fields.get('path');
|
|
282
|
+
// `{ path: '**', redirectTo: 'home' }`: where an address nothing else matches lands.
|
|
283
|
+
if (pathField && fields.has('redirectTo') && staticString(pathField.text) === '**') {
|
|
284
|
+
const target = staticString(fields.get('redirectTo').text);
|
|
285
|
+
if (target !== null && !target.includes('**')) {
|
|
286
|
+
const absolute = target.startsWith('/');
|
|
287
|
+
redirects.push({ from: joinPath([...prefix, '**']), to: joinPath([...(absolute ? [] : prefix), ...target.split('/').filter((t) => t.length > 0)]), absolute });
|
|
288
|
+
}
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
291
|
+
const own = pathField ? pathSegments(pathField.text) : [];
|
|
292
|
+
if (own === null)
|
|
293
|
+
continue; // a computed path, or a `**` catch-all
|
|
294
|
+
const segs = [...prefix, ...own];
|
|
295
|
+
const line = lineOf(pathField ? pathField.at : obj.start);
|
|
296
|
+
const redirectTo = fields.get('redirectTo');
|
|
297
|
+
if (redirectTo) {
|
|
298
|
+
// `{ path: '', redirectTo: 'home' }`: arriving at `/` is arriving at
|
|
299
|
+
// `/home`. A relative target is a sibling, under the same parent.
|
|
300
|
+
const target = staticString(redirectTo.text);
|
|
301
|
+
if (target !== null && !target.includes('**')) {
|
|
302
|
+
const absolute = target.startsWith('/');
|
|
303
|
+
const to = joinPath([...(absolute ? [] : prefix), ...target.split('/').filter((t) => t.length > 0)]);
|
|
304
|
+
redirects.push({ from: joinPath(segs), to, absolute });
|
|
305
|
+
}
|
|
306
|
+
continue;
|
|
307
|
+
}
|
|
308
|
+
const loadChildren = fields.get('loadChildren');
|
|
309
|
+
if (loadChildren) {
|
|
310
|
+
const lazy = lazyImport(loadChildren.text);
|
|
311
|
+
if (lazy)
|
|
312
|
+
mounts.push({ prefix: joinPath(segs), spec: lazy.spec, line });
|
|
313
|
+
continue;
|
|
314
|
+
}
|
|
315
|
+
const componentField = fields.get('component') ? 'component' : fields.get('loadComponent') ? 'loadComponent' : null;
|
|
316
|
+
const component = componentField ? componentRef(componentField, fields.get(componentField).text) : null;
|
|
317
|
+
const children = fields.get('children');
|
|
318
|
+
let childClaimsAddress = false;
|
|
319
|
+
if (children) {
|
|
320
|
+
const childOpen = safe.indexOf('[', children.at);
|
|
321
|
+
const childClose = childOpen < 0 ? -1 : (0, object_literal_1.matchBracket)(safe, childOpen);
|
|
322
|
+
if (childOpen >= 0 && childClose > childOpen) {
|
|
323
|
+
for (const child of (0, object_literal_1.topLevelObjects)(safe, childOpen + 1, childClose)) {
|
|
324
|
+
const childPath = (0, object_literal_1.readFields)(safe, child.start, child.end).get('path');
|
|
325
|
+
if (!childPath || pathSegments(childPath.text)?.length === 0)
|
|
326
|
+
childClaimsAddress = true;
|
|
327
|
+
}
|
|
328
|
+
walk(childOpen, childClose, segs, depth + 1, component ? [...layouts, component] : layouts);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
// A layout is a screen only where no child claims its address; a
|
|
332
|
+
// redirect and a componentless grouping are no screen at all.
|
|
333
|
+
if (!componentField || (children && childClaimsAddress))
|
|
334
|
+
continue;
|
|
335
|
+
const route = joinPath(segs);
|
|
336
|
+
if (seenPaths.has(route))
|
|
337
|
+
continue;
|
|
338
|
+
seenPaths.add(route);
|
|
339
|
+
routes.push({ path: route, line, component, layouts: [...layouts] });
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
ARRAY_OPENERS.lastIndex = 0;
|
|
343
|
+
let m;
|
|
344
|
+
while ((m = ARRAY_OPENERS.exec(safe)) !== null) {
|
|
345
|
+
const open = m.index + m[0].length - 1;
|
|
346
|
+
const close = (0, object_literal_1.matchBracket)(safe, open);
|
|
347
|
+
if (close < 0)
|
|
348
|
+
continue;
|
|
349
|
+
// `const x = [` is a routes array only when it says so: `] as Routes` / `] satisfies Routes`.
|
|
350
|
+
if (/^\b(?:const|let)\b/.test(m[0]) && !/^\]\s*(?:as|satisfies)\s+Routes\b/.test(safe.slice(close, close + 32)))
|
|
351
|
+
continue;
|
|
352
|
+
walk(open, close, [], 0, []);
|
|
353
|
+
}
|
|
354
|
+
return { routes, mounts, redirects };
|
|
355
|
+
}
|
|
356
|
+
/** The id a config-declared route carries — reconstructed exactly, so the resolver recognises its own. */
|
|
357
|
+
function routeId(filePath, line, inFilePath) {
|
|
358
|
+
return `route:${filePath}:${line}:${inFilePath}:angular`;
|
|
359
|
+
}
|
|
360
|
+
/** True for a route node this resolver emitted. */
|
|
361
|
+
function isAngularRoute(node) {
|
|
362
|
+
return node.kind === 'route' && node.id.endsWith(':angular') && node.id === routeId(node.filePath, node.startLine, inFilePath(node));
|
|
363
|
+
}
|
|
364
|
+
/** The path a route has within its own file, before any mount — kept in the qualified name so the cross-file pass is idempotent. */
|
|
365
|
+
function inFilePath(node) {
|
|
366
|
+
const marker = '::route:';
|
|
367
|
+
const at = node.qualifiedName.indexOf(marker);
|
|
368
|
+
return at < 0 ? node.name : node.qualifiedName.slice(at + marker.length);
|
|
369
|
+
}
|
|
370
|
+
// =============================================================================
|
|
371
|
+
// The component a file lazily exports
|
|
372
|
+
// =============================================================================
|
|
373
|
+
/** `@Component({…}) export default class X` / `export class X` — the classes a file declares as components. */
|
|
374
|
+
const COMPONENT_CLASS = /@Component\s*\(/g;
|
|
375
|
+
/** The `@Component` classes a file declares, in order, with whether each is the default export. */
|
|
376
|
+
function componentClassesIn(content) {
|
|
377
|
+
const out = [];
|
|
378
|
+
const safe = (0, strip_comments_1.stripCommentsForRegex)(content, 'typescript');
|
|
379
|
+
COMPONENT_CLASS.lastIndex = 0;
|
|
380
|
+
let m;
|
|
381
|
+
while ((m = COMPONENT_CLASS.exec(safe)) !== null) {
|
|
382
|
+
const open = m.index + m[0].length - 1;
|
|
383
|
+
const close = (0, object_literal_1.matchBracket)(safe, open);
|
|
384
|
+
if (close < 0)
|
|
385
|
+
continue;
|
|
386
|
+
const after = /^\s*(export\s+)?(default\s+)?(?:abstract\s+)?class\s+([A-Za-z_$][\w$]*)/.exec(safe.slice(close + 1, close + 400));
|
|
387
|
+
if (after)
|
|
388
|
+
out.push({ name: after[3], isDefault: !!after[2], decoratorAt: m.index });
|
|
389
|
+
COMPONENT_CLASS.lastIndex = close;
|
|
390
|
+
}
|
|
391
|
+
return out;
|
|
392
|
+
}
|
|
393
|
+
/** The component class a lazily loaded file provides: the member named, else its default export, else its only component. */
|
|
394
|
+
function lazyComponent(spec, member, fromFile, context) {
|
|
395
|
+
const file = (0, import_resolver_1.resolveImportPath)(spec, fromFile, 'typescript', context);
|
|
396
|
+
if (!file)
|
|
397
|
+
return null;
|
|
398
|
+
let name = member;
|
|
399
|
+
if (!name) {
|
|
400
|
+
const content = context.readFile(file);
|
|
401
|
+
if (!content)
|
|
402
|
+
return null;
|
|
403
|
+
const classes = componentClassesIn(content);
|
|
404
|
+
name = (classes.find((c) => c.isDefault) ?? (classes.length === 1 ? classes[0] : undefined))?.name ?? null;
|
|
405
|
+
if (!name) {
|
|
406
|
+
const plain = /\bexport\s+default\s+class\s+([A-Za-z_$][\w$]*)/.exec(content);
|
|
407
|
+
name = plain ? plain[1] : null;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
if (!name)
|
|
411
|
+
return null;
|
|
412
|
+
return context.getNodesInFile(file).find((n) => n.kind === 'class' && n.name === name) ?? null;
|
|
413
|
+
}
|
|
414
|
+
/** A path's segments with each `{expr}` read from the constant it names, as seen from `file` — where the route (or the mount) is written. */
|
|
415
|
+
function resolvedSegments(pathText, file, context) {
|
|
416
|
+
return pathText
|
|
417
|
+
.split('/')
|
|
418
|
+
.filter((seg) => seg.length > 0)
|
|
419
|
+
.flatMap((seg) => {
|
|
420
|
+
if (seg.startsWith('{') && seg.endsWith('}') && seg.indexOf('{', 1) < 0) {
|
|
421
|
+
const value = constantValue(seg.slice(1, -1), file, context);
|
|
422
|
+
return value === null ? [seg] : value.split('/').filter((v) => v.length > 0);
|
|
423
|
+
}
|
|
424
|
+
// `:{ProjectConst.IssueId}` — a constant inside a segment.
|
|
425
|
+
return [seg.replace(/\{([^{}]+)\}/g, (all, expr) => constantValue(expr, file, context) ?? all)];
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
/** The class a route's component names, by its import (or this file) — or a lazy import's. */
|
|
429
|
+
function routeComponent(encoded, fromFile, context) {
|
|
430
|
+
const lazy = LAZY_COMPONENT_REF.exec(encoded);
|
|
431
|
+
if (lazy)
|
|
432
|
+
return lazyComponent(lazy[1], lazy[2] === 'default' ? null : lazy[2], fromFile, context);
|
|
433
|
+
const file = declaringFile(encoded, fromFile, context);
|
|
434
|
+
return file ? (context.getNodesInFile(file).find((n) => n.kind === 'class' && n.name === encoded) ?? null) : null;
|
|
435
|
+
}
|
|
436
|
+
// =============================================================================
|
|
437
|
+
// The cross-file pass: mounts and constant paths
|
|
438
|
+
// =============================================================================
|
|
439
|
+
/**
|
|
440
|
+
* The file a routes import names, and — for an NgModule — the routing modules
|
|
441
|
+
* it imports. A barrel is looked through first: an Nx library is imported by
|
|
442
|
+
* its alias (`@angular-spotify/web/home/feature`), which names the library's
|
|
443
|
+
* `src/index.ts`, whose `export * from './lib/home.module'` names the module.
|
|
444
|
+
*/
|
|
445
|
+
function routeFilesLoadedBy(spec, fromFile, context, routeFiles, mountFiles) {
|
|
446
|
+
const target = (0, import_resolver_1.resolveImportPath)(spec, fromFile, 'typescript', context);
|
|
447
|
+
const seen = new Set();
|
|
448
|
+
const out = [];
|
|
449
|
+
// A barrel can re-export another barrel; a few hops settle it.
|
|
450
|
+
let barrels = target ? [target] : [];
|
|
451
|
+
for (let hop = 0; hop < 4 && barrels.length > 0; hop++) {
|
|
452
|
+
const next = [];
|
|
453
|
+
for (const file of barrels) {
|
|
454
|
+
if (seen.has(file))
|
|
455
|
+
continue;
|
|
456
|
+
seen.add(file);
|
|
457
|
+
if (routeFiles.has(file) || mountFiles.has(file)) {
|
|
458
|
+
out.push(file);
|
|
459
|
+
continue;
|
|
460
|
+
}
|
|
461
|
+
const content = context.readFile(file);
|
|
462
|
+
if (!content)
|
|
463
|
+
continue;
|
|
464
|
+
// `loadChildren: () => import('./layout/layout.module').then(m => m.LayoutModule)`:
|
|
465
|
+
// the module holds no routes; the routing module it imports does.
|
|
466
|
+
if (/@NgModule\s*\(/.test(content)) {
|
|
467
|
+
const imports = /\bimport\s+[^'"]*?from\s+(['"])([^'"]+)\1/g;
|
|
468
|
+
let m;
|
|
469
|
+
while ((m = imports.exec(content)) !== null) {
|
|
470
|
+
const imported = (0, import_resolver_1.resolveImportPath)(m[2], file, 'typescript', context);
|
|
471
|
+
if (imported && (routeFiles.has(imported) || mountFiles.has(imported)) && !out.includes(imported))
|
|
472
|
+
out.push(imported);
|
|
473
|
+
}
|
|
474
|
+
continue;
|
|
475
|
+
}
|
|
476
|
+
const reexports = /\bexport\s+(?:\*|\{[^}]*\})\s*(?:as\s+[\w$]+\s*)?from\s+(['"])([^'"]+)\1/g;
|
|
477
|
+
let m;
|
|
478
|
+
while ((m = reexports.exec(content)) !== null) {
|
|
479
|
+
const reexported = (0, import_resolver_1.resolveImportPath)(m[2], file, 'typescript', context);
|
|
480
|
+
if (reexported && !seen.has(reexported))
|
|
481
|
+
next.push(reexported);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
barrels = next;
|
|
485
|
+
}
|
|
486
|
+
return out;
|
|
487
|
+
}
|
|
488
|
+
/** Per context, renewed with the route list (whose identity changes when the resolver's caches do). */
|
|
489
|
+
const constantTexts = new WeakMap();
|
|
490
|
+
/**
|
|
491
|
+
* The source text a constant member chain names — `internalRoutes.account.path`
|
|
492
|
+
* is the `path:` field of `account` in `export const internalRoutes = {…}` —
|
|
493
|
+
* read from the file the chain's root is imported from (or declared in).
|
|
494
|
+
*/
|
|
495
|
+
function constantText(expr, fromFile, context) {
|
|
496
|
+
const source = context.getNodesByKind('route');
|
|
497
|
+
let entry = constantTexts.get(context);
|
|
498
|
+
if (!entry || entry.source !== source)
|
|
499
|
+
constantTexts.set(context, (entry = { source, memo: new Map() }));
|
|
500
|
+
const memo = entry.memo;
|
|
501
|
+
const key = `${fromFile}\0${expr}`;
|
|
502
|
+
if (memo.has(key))
|
|
503
|
+
return memo.get(key);
|
|
504
|
+
// `const { create } = internalRoutes.accounts.subRoutes;` / `const accounts = internalRoutes.accounts;`
|
|
505
|
+
// make `create.path` a chain rooted at the import.
|
|
506
|
+
const aliased = localAlias(expr, fromFile, context);
|
|
507
|
+
if (aliased !== null && aliased !== expr) {
|
|
508
|
+
const value = constantText(aliased, fromFile, context);
|
|
509
|
+
memo.set(key, value);
|
|
510
|
+
return value;
|
|
511
|
+
}
|
|
512
|
+
const [root, ...chain] = expr.split('.').map((part) => part.trim());
|
|
513
|
+
let value = null;
|
|
514
|
+
const file = root ? declaringFile(root, fromFile, context) : null;
|
|
515
|
+
const content = file && root ? declarationSource(root, file, context, 0) : null;
|
|
516
|
+
if (content && root && chain.length > 0) {
|
|
517
|
+
const safe = (0, strip_comments_1.stripCommentsForRegex)(content, 'typescript');
|
|
518
|
+
const readChain = (open, links) => {
|
|
519
|
+
let start = open;
|
|
520
|
+
let end = (0, object_literal_1.matchBracket)(safe, start);
|
|
521
|
+
for (let i = 0; i < links.length && end > start; i++) {
|
|
522
|
+
const field = (0, object_literal_1.readFields)(safe, start, end).get(links[i]);
|
|
523
|
+
if (!field)
|
|
524
|
+
return null;
|
|
525
|
+
if (i === links.length - 1)
|
|
526
|
+
return field.text.trim();
|
|
527
|
+
start = safe.indexOf('{', field.at);
|
|
528
|
+
end = start < 0 ? -1 : (0, object_literal_1.matchBracket)(safe, start);
|
|
529
|
+
}
|
|
530
|
+
return null;
|
|
531
|
+
};
|
|
532
|
+
const decl = new RegExp(String.raw `\b(?:const|let)\s+${root}\s*(?::[^=]+)?=\s*\{`).exec(safe);
|
|
533
|
+
const enumDecl = decl ? null : new RegExp(String.raw `\benum\s+${root}\s*\{`).exec(safe);
|
|
534
|
+
const classDecl = decl || enumDecl ? null : new RegExp(String.raw `\bclass\s+${root}\b[^{]*\{`).exec(safe);
|
|
535
|
+
if (decl)
|
|
536
|
+
value = readChain(decl.index + decl[0].length - 1, chain);
|
|
537
|
+
else if (enumDecl && chain.length === 1) {
|
|
538
|
+
// `enum Paths { Board = 'board' }`
|
|
539
|
+
const open = enumDecl.index + enumDecl[0].length - 1;
|
|
540
|
+
const body = safe.slice(open, Math.max(open, (0, object_literal_1.matchBracket)(safe, open)));
|
|
541
|
+
value = new RegExp(String.raw `\b${chain[0]}\s*=\s*(['"\`][^'"\`]*['"\`])`).exec(body)?.[1] ?? null;
|
|
542
|
+
}
|
|
543
|
+
else if (classDecl) {
|
|
544
|
+
// `class ProjectConst { static readonly IssueId = 'issueId' }`, and
|
|
545
|
+
// `class RouterUtil { static Configuration = { Visualizer: 'visualizer' } }`.
|
|
546
|
+
const open = classDecl.index + classDecl[0].length - 1;
|
|
547
|
+
const close = (0, object_literal_1.matchBracket)(safe, open);
|
|
548
|
+
const body = close > open ? safe.slice(open, close) : '';
|
|
549
|
+
const field = new RegExp(String.raw `\bstatic\s+(?:readonly\s+)?${chain[0]}\s*(?::[^=;]+)?=\s*`).exec(body);
|
|
550
|
+
if (field) {
|
|
551
|
+
const at = open + field.index + field[0].length;
|
|
552
|
+
if (safe[at] === '{')
|
|
553
|
+
value = chain.length > 1 ? readChain(at, chain.slice(1)) : null;
|
|
554
|
+
else if (chain.length === 1)
|
|
555
|
+
value = /^(['"\`])[^'"\`]*\1/.exec(safe.slice(at))?.[0] ?? null;
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
memo.set(key, value);
|
|
560
|
+
return value;
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* The source that declares `root`: `file` itself, or — when `file` is a
|
|
564
|
+
* barrel (an Nx library's `src/index.ts`) — the module it re-exports it from.
|
|
565
|
+
*/
|
|
566
|
+
function declarationSource(root, file, context, hops) {
|
|
567
|
+
const content = context.readFile(file);
|
|
568
|
+
if (!content)
|
|
569
|
+
return null;
|
|
570
|
+
if (new RegExp(String.raw `\b(?:const|let|class|enum)\s+${root}\b`).test(content))
|
|
571
|
+
return content;
|
|
572
|
+
if (hops >= 3)
|
|
573
|
+
return null;
|
|
574
|
+
const reexports = /\bexport\s+(\*|\{[^}]*\})\s*from\s+(['"])([^'"]+)\2/g;
|
|
575
|
+
let m;
|
|
576
|
+
while ((m = reexports.exec(content)) !== null) {
|
|
577
|
+
if (m[1] !== '*' && !new RegExp(String.raw `\b${root}\b`).test(m[1]))
|
|
578
|
+
continue;
|
|
579
|
+
const target = (0, import_resolver_1.resolveImportPath)(m[3], file, 'typescript', context);
|
|
580
|
+
const found = target ? declarationSource(root, target, context, hops + 1) : null;
|
|
581
|
+
if (found)
|
|
582
|
+
return found;
|
|
583
|
+
}
|
|
584
|
+
return null;
|
|
585
|
+
}
|
|
586
|
+
/** `create.path` as the chain its root was destructured from in `fromFile`, or null when the root is no local alias. */
|
|
587
|
+
function localAlias(expr, fromFile, context) {
|
|
588
|
+
const content = context.readFile(fromFile);
|
|
589
|
+
if (!content)
|
|
590
|
+
return null;
|
|
591
|
+
const [root, ...rest] = expr.split('.');
|
|
592
|
+
if (!root)
|
|
593
|
+
return null;
|
|
594
|
+
const destructure = /\b(?:const|let)\s*\{([^}]*)\}\s*=\s*([A-Za-z_$][\w$]*(?:\s*\.\s*[A-Za-z_$][\w$]*)*)\s*;?/g;
|
|
595
|
+
let m;
|
|
596
|
+
while ((m = destructure.exec(content)) !== null) {
|
|
597
|
+
for (const binding of m[1].split(',')) {
|
|
598
|
+
const [prop, local] = binding.split(':').map((part) => part.trim());
|
|
599
|
+
if ((local ?? prop) === root && prop)
|
|
600
|
+
return [`${m[2].replace(/\s+/g, '')}.${prop}`, ...rest].join('.');
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
const simple = new RegExp(String.raw `\b(?:const|let)\s+${root}\s*=\s*([A-Za-z_$][\w$]*(?:\s*\.\s*[A-Za-z_$][\w$]*)+)\s*;`).exec(content);
|
|
604
|
+
return simple ? [simple[1].replace(/\s+/g, ''), ...rest].join('.') : null;
|
|
605
|
+
}
|
|
606
|
+
/** A constant path's value: `internalRoutes.account.path` → `account`. */
|
|
607
|
+
function constantValue(expr, fromFile, context) {
|
|
608
|
+
const text = constantText(expr, fromFile, context);
|
|
609
|
+
return text === null ? null : staticString(text);
|
|
610
|
+
}
|
|
611
|
+
/** The file declaring `name` for code in `fromFile`: its import, else the file itself. */
|
|
612
|
+
function declaringFile(name, fromFile, context) {
|
|
613
|
+
const content = context.readFile(fromFile);
|
|
614
|
+
if (!content)
|
|
615
|
+
return null;
|
|
616
|
+
const imports = /\bimport\s*\{([^}]*)\}\s*from\s*(['"])([^'"]+)\2/g;
|
|
617
|
+
let m;
|
|
618
|
+
while ((m = imports.exec(content)) !== null) {
|
|
619
|
+
const names = m[1].split(',').map((s) => s.trim().split(/\s+as\s+/).pop().trim());
|
|
620
|
+
if (names.includes(name))
|
|
621
|
+
return (0, import_resolver_1.resolveImportPath)(m[3], fromFile, 'typescript', context);
|
|
622
|
+
}
|
|
623
|
+
return fromFile;
|
|
624
|
+
}
|
|
625
|
+
const mountMemo = new WeakMap();
|
|
626
|
+
/**
|
|
627
|
+
* Where every routes file is mounted — the `loadChildren` chain from the app
|
|
628
|
+
* down, settled from the top. Shared by the cross-file pass, which names the
|
|
629
|
+
* routes, and the route table, which reads the redirects in files that only
|
|
630
|
+
* mount others (jira-clone's `app.routes.ts` holds nothing but two mounts and
|
|
631
|
+
* `'' → 'project'`).
|
|
632
|
+
*/
|
|
633
|
+
function angularMounts(context, routes) {
|
|
634
|
+
const source = context.getNodesByKind('route');
|
|
635
|
+
const cached = mountMemo.get(context);
|
|
636
|
+
if (cached && cached.source === source)
|
|
637
|
+
return cached.mounts;
|
|
638
|
+
const routeFiles = new Set(routes.map((r) => r.filePath));
|
|
639
|
+
const mountsByFile = new Map();
|
|
640
|
+
for (const file of context.getAllFiles()) {
|
|
641
|
+
if (!/\.[cm]?ts$/.test(file) || !(context.fileContains?.(file, 'loadChildren') ?? context.readFile(file)?.includes('loadChildren')))
|
|
642
|
+
continue;
|
|
643
|
+
const content = context.readFile(file);
|
|
644
|
+
if (!content)
|
|
645
|
+
continue;
|
|
646
|
+
const { mounts } = parseAngularRoutes(content);
|
|
647
|
+
if (mounts.length > 0)
|
|
648
|
+
mountsByFile.set(file, mounts);
|
|
649
|
+
}
|
|
650
|
+
const mountFiles = new Set(mountsByFile.keys());
|
|
651
|
+
const loadedBy = new Map();
|
|
652
|
+
for (const [file, mounts] of mountsByFile) {
|
|
653
|
+
for (const mount of mounts) {
|
|
654
|
+
for (const target of routeFilesLoadedBy(mount.spec, file, context, routeFiles, mountFiles)) {
|
|
655
|
+
// A file mounted from two places keeps its first mount.
|
|
656
|
+
if (target !== file && !loadedBy.has(target))
|
|
657
|
+
loadedBy.set(target, { parent: file, prefix: mount.prefix });
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
const memo = new Map();
|
|
662
|
+
const prefixOf = (file, seen = new Set()) => {
|
|
663
|
+
const hit = memo.get(file);
|
|
664
|
+
if (hit !== undefined)
|
|
665
|
+
return hit;
|
|
666
|
+
const mount = loadedBy.get(file);
|
|
667
|
+
let prefix = [];
|
|
668
|
+
if (mount && !seen.has(file)) {
|
|
669
|
+
seen.add(file);
|
|
670
|
+
prefix = [...prefixOf(mount.parent, seen), ...resolvedSegments(mount.prefix, mount.parent, context)];
|
|
671
|
+
}
|
|
672
|
+
memo.set(file, prefix);
|
|
673
|
+
return prefix;
|
|
674
|
+
};
|
|
675
|
+
const mounts = { mountFiles, prefixOf: (file) => prefixOf(file) };
|
|
676
|
+
mountMemo.set(context, { source, mounts });
|
|
677
|
+
return mounts;
|
|
678
|
+
}
|
|
679
|
+
const workspaceRoots = new WeakMap();
|
|
680
|
+
/**
|
|
681
|
+
* The app a routes file belongs to. An Angular workspace — the directory an
|
|
682
|
+
* `angular.json` or an Nx `nx.json` sits in — is one app however its routes
|
|
683
|
+
* are split: angular-spotify declares its screens across a dozen `libs/*`
|
|
684
|
+
* packages, each with a `src/` of its own, and keyed by those every
|
|
685
|
+
* template's `routerLink` looked for its routes in the wrong table. Outside a
|
|
686
|
+
* workspace, the conventional app root.
|
|
687
|
+
*/
|
|
688
|
+
function angularAppRoot(filePath, context) {
|
|
689
|
+
let memo = workspaceRoots.get(context);
|
|
690
|
+
if (!memo)
|
|
691
|
+
workspaceRoots.set(context, (memo = new Map()));
|
|
692
|
+
const slash = filePath.lastIndexOf('/');
|
|
693
|
+
const dir = slash < 0 ? '' : filePath.slice(0, slash);
|
|
694
|
+
let found = memo.get(dir);
|
|
695
|
+
if (found === undefined) {
|
|
696
|
+
found = null;
|
|
697
|
+
for (let d = dir; d !== null; d = d === '' ? null : d.includes('/') ? d.slice(0, d.lastIndexOf('/')) : '') {
|
|
698
|
+
const at = d === '' ? '' : `${d}/`;
|
|
699
|
+
if (context.fileExists(`${at}angular.json`) || context.fileExists(`${at}nx.json`)) {
|
|
700
|
+
found = at;
|
|
701
|
+
break;
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
memo.set(dir, found);
|
|
705
|
+
}
|
|
706
|
+
return found ?? (0, expo_router_1.appRootFor)(filePath);
|
|
707
|
+
}
|
|
708
|
+
const tables = new WeakMap();
|
|
709
|
+
function angularRouteTable(context) {
|
|
710
|
+
const all = context.getNodesByKind('route');
|
|
711
|
+
const cached = tables.get(context);
|
|
712
|
+
if (cached && cached.source === all)
|
|
713
|
+
return cached;
|
|
714
|
+
const byRoot = new Map();
|
|
715
|
+
const byFile = new Map();
|
|
716
|
+
for (const node of all) {
|
|
717
|
+
if (!isAngularRoute(node) || !node.name.startsWith('/'))
|
|
718
|
+
continue;
|
|
719
|
+
const root = angularAppRoot(node.filePath, context);
|
|
720
|
+
let t = byRoot.get(root);
|
|
721
|
+
if (!t)
|
|
722
|
+
byRoot.set(root, (t = { source: all, exact: new Map(), dynamic: [] }));
|
|
723
|
+
(0, expo_router_1.addRouteTo)(t, node.name, node);
|
|
724
|
+
if (!byFile.has(node.filePath))
|
|
725
|
+
byFile.set(node.filePath, node);
|
|
726
|
+
}
|
|
727
|
+
// Redirects: arriving at `/` is arriving at wherever `redirectTo` sends
|
|
728
|
+
// the user. A file's mount prefix is what its routes' names add to their
|
|
729
|
+
// in-file paths. A chain (`/` → `/pages` → `/pages/dashboard`) settles in
|
|
730
|
+
// a few passes.
|
|
731
|
+
const aliases = [];
|
|
732
|
+
const mounts = byFile.size > 0 ? angularMounts(context, all.filter(isAngularRoute)) : null;
|
|
733
|
+
const redirectFiles = new Map();
|
|
734
|
+
for (const [file, sample] of byFile) {
|
|
735
|
+
const own = resolvedSegments(inFilePath(sample), file, context);
|
|
736
|
+
const full = sample.name.split('/').filter((seg) => seg.length > 0);
|
|
737
|
+
redirectFiles.set(file, full.slice(0, Math.max(0, full.length - own.length)));
|
|
738
|
+
}
|
|
739
|
+
// A file that only mounts others can still redirect: its prefix is where it is mounted.
|
|
740
|
+
for (const file of mounts?.mountFiles ?? []) {
|
|
741
|
+
if (!redirectFiles.has(file))
|
|
742
|
+
redirectFiles.set(file, mounts.prefixOf(file));
|
|
743
|
+
}
|
|
744
|
+
for (const [file, prefix] of redirectFiles) {
|
|
745
|
+
const content = context.readFile(file);
|
|
746
|
+
if (!content || !content.includes('redirectTo'))
|
|
747
|
+
continue;
|
|
748
|
+
const table = byRoot.get(angularAppRoot(file, context)) ?? (byRoot.size === 1 ? [...byRoot.values()][0] : undefined);
|
|
749
|
+
if (!table)
|
|
750
|
+
continue;
|
|
751
|
+
for (const r of parseAngularRoutes(content).redirects) {
|
|
752
|
+
const from = joinPath([...prefix, ...resolvedSegments(r.from, file, context)]);
|
|
753
|
+
const to = joinPath([...(r.absolute ? [] : prefix), ...resolvedSegments(r.to, file, context)]);
|
|
754
|
+
aliases.push({ table, from, to });
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
for (let pass = 0; pass < 4; pass++) {
|
|
758
|
+
let added = false;
|
|
759
|
+
for (const a of aliases) {
|
|
760
|
+
const target = a.table.exact.get(a.to);
|
|
761
|
+
if (target && !a.table.exact.has(a.from)) {
|
|
762
|
+
a.table.exact.set(a.from, target);
|
|
763
|
+
added = true;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
if (!added)
|
|
767
|
+
break;
|
|
768
|
+
}
|
|
769
|
+
// `/` that no route or redirect serves falls through to the app's root
|
|
770
|
+
// `**` redirect. Only `/`: letting the wildcard answer any path would draw
|
|
771
|
+
// every destination this reading could not name as a trip home.
|
|
772
|
+
for (const a of aliases) {
|
|
773
|
+
if (a.from !== '/**')
|
|
774
|
+
continue;
|
|
775
|
+
const target = a.table.exact.get(a.to);
|
|
776
|
+
if (target && !a.table.exact.has('/'))
|
|
777
|
+
a.table.exact.set('/', target);
|
|
778
|
+
}
|
|
779
|
+
const table = { source: all, byRoot };
|
|
780
|
+
tables.set(context, table);
|
|
781
|
+
return table;
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
784
|
+
* The routes a file navigates among: its app's, or — for a shared library
|
|
785
|
+
* outside any app (an Nx `libs/ui`) — the one app's, when there is only one.
|
|
786
|
+
*/
|
|
787
|
+
function angularRoutesFor(table, filePath) {
|
|
788
|
+
const own = (0, expo_router_1.routesForFile)(table, filePath);
|
|
789
|
+
if (own && own.exact.size > 0)
|
|
790
|
+
return own;
|
|
791
|
+
return table.byRoot.size === 1 ? [...table.byRoot.values()][0] : null;
|
|
792
|
+
}
|
|
793
|
+
// =============================================================================
|
|
794
|
+
// Navigation
|
|
795
|
+
// =============================================================================
|
|
796
|
+
/** `this.router.navigate`, `router.navigateByUrl`, `this._router.createUrlTree`, `router.parseUrl`. */
|
|
797
|
+
const NAV_CALL = /^(?:this\.)?_?[rR]outer\.(navigate|navigateByUrl|createUrlTree|parseUrl)$/;
|
|
798
|
+
/** The destination a command array names: `['/article', slug]` is `/article/${…}`; null when it is relative or not a literal array. */
|
|
799
|
+
function commandsHref(text, fromRoot = false) {
|
|
800
|
+
const arr = text.trim();
|
|
801
|
+
if (arr[0] !== '[')
|
|
802
|
+
return null;
|
|
803
|
+
const close = (0, object_literal_1.matchBracket)(arr, 0);
|
|
804
|
+
if (close < 0)
|
|
805
|
+
return null;
|
|
806
|
+
const parts = [];
|
|
807
|
+
let i = 1;
|
|
808
|
+
let element = '';
|
|
809
|
+
const flush = () => {
|
|
810
|
+
const e = element.trim();
|
|
811
|
+
element = '';
|
|
812
|
+
if (e.length === 0)
|
|
813
|
+
return true;
|
|
814
|
+
const literal = staticString(e);
|
|
815
|
+
if (literal !== null) {
|
|
816
|
+
parts.push(...literal.split('/').filter((seg) => seg.length > 0));
|
|
817
|
+
return true;
|
|
818
|
+
}
|
|
819
|
+
// A matrix-params object says nothing about the path.
|
|
820
|
+
if (e.startsWith('{'))
|
|
821
|
+
return true;
|
|
822
|
+
parts.push(expo_router_1.HOLE);
|
|
823
|
+
return true;
|
|
824
|
+
};
|
|
825
|
+
while (i < close) {
|
|
826
|
+
const ch = arr[i];
|
|
827
|
+
if (ch === '"' || ch === "'" || ch === '`') {
|
|
828
|
+
const end = (0, object_literal_1.skipString)(arr, i);
|
|
829
|
+
if (end < 0)
|
|
830
|
+
return null;
|
|
831
|
+
element += arr.slice(i, end + 1);
|
|
832
|
+
i = end + 1;
|
|
833
|
+
continue;
|
|
834
|
+
}
|
|
835
|
+
if (ch === '[' || ch === '{' || ch === '(') {
|
|
836
|
+
const end = (0, object_literal_1.matchBracket)(arr, i);
|
|
837
|
+
if (end < 0)
|
|
838
|
+
return null;
|
|
839
|
+
element += arr.slice(i, end + 1);
|
|
840
|
+
i = end + 1;
|
|
841
|
+
continue;
|
|
842
|
+
}
|
|
843
|
+
if (ch === ',')
|
|
844
|
+
flush();
|
|
845
|
+
else
|
|
846
|
+
element += ch;
|
|
847
|
+
i++;
|
|
848
|
+
}
|
|
849
|
+
flush();
|
|
850
|
+
// Only an absolute destination: `['/login']`. In a template, `['../', id]`
|
|
851
|
+
// and a bare `['edit']` are relative to wherever the component is; a
|
|
852
|
+
// `router.navigate(['project', 'issue', id])` with no `relativeTo` starts
|
|
853
|
+
// from the root.
|
|
854
|
+
const firstElement = arr.slice(1, close).split(',')[0] ?? '';
|
|
855
|
+
const first = staticString(firstElement);
|
|
856
|
+
if (first === null || (!first.startsWith('/') && !(fromRoot && !first.startsWith('.'))))
|
|
857
|
+
return null;
|
|
858
|
+
const pathText = '/' + parts.filter((p) => p.length > 0).join('/');
|
|
859
|
+
return namesSomewhere({ path: pathText, display: pathText.split(expo_router_1.HOLE).join('${…}') });
|
|
860
|
+
}
|
|
861
|
+
/**
|
|
862
|
+
* The href, when it names at least one segment of its own. A path made only
|
|
863
|
+
* of holes (`[\`/${a}\`, b, c]`) would match any route of its length — a
|
|
864
|
+
* hole scores against a literal segment — so it names nothing.
|
|
865
|
+
*/
|
|
866
|
+
function namesSomewhere(href) {
|
|
867
|
+
if (!href)
|
|
868
|
+
return null;
|
|
869
|
+
const segs = href.path.split('/').filter((seg) => seg.length > 0);
|
|
870
|
+
return segs.length === 0 || segs.some((seg) => !seg.includes(expo_router_1.HOLE)) ? href : null;
|
|
871
|
+
}
|
|
872
|
+
/** A class property's initializer, read from its body: `routerLinkAbout = publicRoutes.about.routerLink;`. */
|
|
873
|
+
function propertyInitializer(owner, name, content) {
|
|
874
|
+
const body = content.split('\n').slice(owner.startLine - 1, owner.endLine).join('\n');
|
|
875
|
+
const decl = new RegExp(String.raw `(?:^|[\s;{])(?:(?:public|private|protected|readonly|static|override)\s+)*${name}\s*(?::[^=;\n]+)?=\s*`).exec(body);
|
|
876
|
+
if (!decl)
|
|
877
|
+
return null;
|
|
878
|
+
let i = decl.index + decl[0].length;
|
|
879
|
+
const start = i;
|
|
880
|
+
while (i < body.length) {
|
|
881
|
+
const ch = body[i];
|
|
882
|
+
if (ch === '"' || ch === "'" || ch === '`') {
|
|
883
|
+
const end = (0, object_literal_1.skipString)(body, i);
|
|
884
|
+
if (end < 0)
|
|
885
|
+
return null;
|
|
886
|
+
i = end + 1;
|
|
887
|
+
continue;
|
|
888
|
+
}
|
|
889
|
+
if (ch === '[' || ch === '{' || ch === '(') {
|
|
890
|
+
const end = (0, object_literal_1.matchBracket)(body, i);
|
|
891
|
+
if (end < 0)
|
|
892
|
+
return null;
|
|
893
|
+
i = end + 1;
|
|
894
|
+
continue;
|
|
895
|
+
}
|
|
896
|
+
if (ch === ';' || ch === '\n')
|
|
897
|
+
break;
|
|
898
|
+
i++;
|
|
899
|
+
}
|
|
900
|
+
return body.slice(start, i).trim() || null;
|
|
901
|
+
}
|
|
902
|
+
/** The array an arrow function returns: `(id) => ['/x', id]` or `(id) => { return ['/x', id]; }`. */
|
|
903
|
+
function arrowReturn(fn) {
|
|
904
|
+
const arrow = fn.indexOf('=>');
|
|
905
|
+
if (arrow < 0)
|
|
906
|
+
return null;
|
|
907
|
+
let i = arrow + 2;
|
|
908
|
+
while (i < fn.length && /\s/.test(fn[i]))
|
|
909
|
+
i++;
|
|
910
|
+
if (fn[i] === '(')
|
|
911
|
+
i++;
|
|
912
|
+
if (fn[i] === '[') {
|
|
913
|
+
const end = (0, object_literal_1.matchBracket)(fn, i);
|
|
914
|
+
return end > i ? fn.slice(i, end + 1) : null;
|
|
915
|
+
}
|
|
916
|
+
if (fn[i] === '{') {
|
|
917
|
+
const ret = /\breturn\s*\[/.exec(fn.slice(i));
|
|
918
|
+
if (!ret)
|
|
919
|
+
return null;
|
|
920
|
+
const open = i + ret.index + ret[0].length - 1;
|
|
921
|
+
const end = (0, object_literal_1.matchBracket)(fn, open);
|
|
922
|
+
return end > open ? fn.slice(open, end + 1) : null;
|
|
923
|
+
}
|
|
924
|
+
return null;
|
|
925
|
+
}
|
|
926
|
+
/**
|
|
927
|
+
* Where an Angular destination expression leads — the argument of
|
|
928
|
+
* `router.navigate(…)`, or a `[routerLink]` binding:
|
|
929
|
+
*
|
|
930
|
+
* - a command array, `['/article', slug]`;
|
|
931
|
+
* - a static string, `'/login'` or `'/' + $localize…`, and `'/editor/' + slug`;
|
|
932
|
+
* - a route constant, `internalRoutes.zen.routerLink`;
|
|
933
|
+
* - a property of the class it is written in, `this.routerLinkAbout`,
|
|
934
|
+
* holding one of those;
|
|
935
|
+
* - any of those `.concat(id)`, one more segment.
|
|
936
|
+
*
|
|
937
|
+
* `owner` is the class the expression is written in, for `this.` properties.
|
|
938
|
+
*/
|
|
939
|
+
function angularDestination(expr, file, owner, context, depth = 0, fromRoot = false) {
|
|
940
|
+
return namesSomewhere(destinationOf(expr, file, owner, context, depth, fromRoot));
|
|
941
|
+
}
|
|
942
|
+
function destinationOf(expr, file, owner, context, depth, fromRoot) {
|
|
943
|
+
const text = expr.trim();
|
|
944
|
+
if (text.length === 0 || depth > 4)
|
|
945
|
+
return null;
|
|
946
|
+
if (text[0] === '[')
|
|
947
|
+
return commandsHref(text, fromRoot);
|
|
948
|
+
const literal = staticString(text);
|
|
949
|
+
if (literal !== null)
|
|
950
|
+
return (0, expo_router_1.toHref)(literal);
|
|
951
|
+
// `'/editor/' + article.slug`: the literal head, a hole for the rest.
|
|
952
|
+
if (/^['"]/.test(text) && text.includes('+')) {
|
|
953
|
+
const head = staticString(text.slice(0, text.indexOf('+')));
|
|
954
|
+
if (head !== null && head.startsWith('/'))
|
|
955
|
+
return (0, expo_router_1.toHref)(head.replace(/\/?$/, '/') + expo_router_1.HOLE);
|
|
956
|
+
}
|
|
957
|
+
// `this.routerLinkAdminControlUsers.concat(userId)`: one segment more.
|
|
958
|
+
const concat = /^(.*?)\.concat\s*\((.*)\)$/s.exec(text);
|
|
959
|
+
if (concat) {
|
|
960
|
+
const base = angularDestination(concat[1], file, owner, context, depth + 1, fromRoot);
|
|
961
|
+
const added = concat[2].split(',').filter((a) => a.trim().length > 0).length;
|
|
962
|
+
return base && added > 0 ? (0, expo_router_1.toHref)(base.path.replace(/\/$/, '') + ('/' + expo_router_1.HOLE).repeat(added)) : base;
|
|
963
|
+
}
|
|
964
|
+
// `update.routerLink(dataSource, symbol)`: a route constant that builds its
|
|
965
|
+
// commands — its returned array, the arguments holes.
|
|
966
|
+
const call = /^((?:this\s*\.\s*)?[A-Za-z_$][\w$]*(?:\s*\.\s*[A-Za-z_$][\w$]*)+)\s*\((.*)\)$/s.exec(text);
|
|
967
|
+
if (call) {
|
|
968
|
+
const fn = constantText(call[1].replace(/\s+/g, '').replace(/^this\./, ''), file, context);
|
|
969
|
+
const returned = fn ? arrowReturn(fn) : null;
|
|
970
|
+
return returned ? commandsHref(returned, fromRoot) : null;
|
|
971
|
+
}
|
|
972
|
+
const chain = /^(?:this\s*\.\s*)?([A-Za-z_$][\w$]*(?:\s*\.\s*[A-Za-z_$][\w$]*)*)$/.exec(text);
|
|
973
|
+
if (!chain)
|
|
974
|
+
return (0, expo_router_1.parseHrefExpression)(text);
|
|
975
|
+
const parts = chain[1].replace(/\s+/g, '').split('.');
|
|
976
|
+
const content = context.readFile(file);
|
|
977
|
+
if (content && owner && (text.startsWith('this') || parts.length === 1)) {
|
|
978
|
+
const init = propertyInitializer(owner, parts[0], content);
|
|
979
|
+
if (init !== null) {
|
|
980
|
+
if (parts.length === 1)
|
|
981
|
+
return angularDestination(init, file, owner, context, depth + 1, fromRoot);
|
|
982
|
+
return angularDestination(`${init}.${parts.slice(1).join('.')}`, file, owner, context, depth + 1, fromRoot);
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
const constant = constantText(parts.join('.'), file, context);
|
|
986
|
+
return constant ? angularDestination(constant, file, owner, context, depth + 1, fromRoot) : null;
|
|
987
|
+
}
|
|
988
|
+
// =============================================================================
|
|
989
|
+
// The resolver
|
|
990
|
+
// =============================================================================
|
|
991
|
+
/** A route's lazily loaded component: `import:./x.component#default` / `#XComponent`. */
|
|
992
|
+
const LAZY_COMPONENT_REF = /^import:([^#]+)#([\w$]+)$/;
|
|
993
|
+
/** A layout a screen renders inside: `layout:ProfileComponent`, `layout:import:./x#default`. */
|
|
994
|
+
const LAYOUT_REF = /^layout:(.+)$/;
|
|
995
|
+
exports.angularRouterResolver = {
|
|
996
|
+
name: 'angular-router',
|
|
997
|
+
languages: ['typescript', 'javascript'],
|
|
998
|
+
detect(context) {
|
|
999
|
+
return (0, package_deps_1.dependsOn)(context, '@angular/router', '@angular/core');
|
|
1000
|
+
},
|
|
1001
|
+
claimsReference(name) {
|
|
1002
|
+
return NAV_CALL.test(name) || LAZY_COMPONENT_REF.test(name) || LAYOUT_REF.test(name);
|
|
1003
|
+
},
|
|
1004
|
+
extract(filePath, content) {
|
|
1005
|
+
if (!/\.[cm]?ts$/.test(filePath) || filePath.endsWith('.d.ts'))
|
|
1006
|
+
return { nodes: [], references: [] };
|
|
1007
|
+
const { routes } = parseAngularRoutes(content);
|
|
1008
|
+
if (routes.length === 0)
|
|
1009
|
+
return { nodes: [], references: [] };
|
|
1010
|
+
const now = Date.now();
|
|
1011
|
+
const nodes = [];
|
|
1012
|
+
const references = [];
|
|
1013
|
+
for (const route of routes) {
|
|
1014
|
+
const node = {
|
|
1015
|
+
id: routeId(filePath, route.line, route.path),
|
|
1016
|
+
kind: 'route',
|
|
1017
|
+
name: route.path,
|
|
1018
|
+
qualifiedName: `${filePath}::route:${route.path}`,
|
|
1019
|
+
filePath,
|
|
1020
|
+
startLine: route.line,
|
|
1021
|
+
endLine: route.line,
|
|
1022
|
+
startColumn: 0,
|
|
1023
|
+
endColumn: 0,
|
|
1024
|
+
language: 'typescript',
|
|
1025
|
+
updatedAt: now,
|
|
1026
|
+
};
|
|
1027
|
+
nodes.push(node);
|
|
1028
|
+
const ref = (component, layout) => ({
|
|
1029
|
+
fromNodeId: node.id,
|
|
1030
|
+
referenceName: `${layout ? 'layout:' : ''}${component.spec === null ? component.name : `import:${component.spec}#${component.name ?? 'default'}`}`,
|
|
1031
|
+
referenceKind: 'references',
|
|
1032
|
+
line: route.line,
|
|
1033
|
+
column: 0,
|
|
1034
|
+
filePath,
|
|
1035
|
+
language: 'typescript',
|
|
1036
|
+
});
|
|
1037
|
+
if (route.component)
|
|
1038
|
+
references.push(ref(route.component, false));
|
|
1039
|
+
// The layouts around it: their links and buttons are on this screen too.
|
|
1040
|
+
for (const layout of route.layouts)
|
|
1041
|
+
references.push(ref(layout, true));
|
|
1042
|
+
}
|
|
1043
|
+
return { nodes, references };
|
|
1044
|
+
},
|
|
1045
|
+
/**
|
|
1046
|
+
* Put each routes file's routes under the path that lazy-loads it, and read
|
|
1047
|
+
* constant path segments. Recomputed from each route's in-file path (its
|
|
1048
|
+
* qualified name), so a second run changes nothing.
|
|
1049
|
+
*/
|
|
1050
|
+
postExtract(context) {
|
|
1051
|
+
const routes = context.getNodesByKind('route').filter(isAngularRoute);
|
|
1052
|
+
if (routes.length === 0)
|
|
1053
|
+
return [];
|
|
1054
|
+
const { prefixOf } = angularMounts(context, routes);
|
|
1055
|
+
const resolved = (pathText, file) => resolvedSegments(pathText, file, context);
|
|
1056
|
+
const changed = [];
|
|
1057
|
+
for (const route of routes) {
|
|
1058
|
+
const name = joinPath([...prefixOf(route.filePath), ...resolved(inFilePath(route), route.filePath)]);
|
|
1059
|
+
if (name !== route.name)
|
|
1060
|
+
changed.push({ ...route, name });
|
|
1061
|
+
}
|
|
1062
|
+
return changed;
|
|
1063
|
+
},
|
|
1064
|
+
resolve(ref, context) {
|
|
1065
|
+
const layout = LAYOUT_REF.exec(ref.referenceName);
|
|
1066
|
+
if (layout) {
|
|
1067
|
+
if (!ref.fromNodeId.endsWith(':angular'))
|
|
1068
|
+
return null;
|
|
1069
|
+
const component = routeComponent(layout[1], ref.filePath, context);
|
|
1070
|
+
return component
|
|
1071
|
+
? { original: ref, targetNodeId: component.id, confidence: 0.95, resolvedBy: 'framework', metadata: { layout: true } }
|
|
1072
|
+
: null;
|
|
1073
|
+
}
|
|
1074
|
+
const lazy = LAZY_COMPONENT_REF.exec(ref.referenceName);
|
|
1075
|
+
if (lazy) {
|
|
1076
|
+
if (!ref.fromNodeId.endsWith(':angular'))
|
|
1077
|
+
return null;
|
|
1078
|
+
const component = lazyComponent(lazy[1], lazy[2] === 'default' ? null : lazy[2], ref.filePath, context);
|
|
1079
|
+
return component ? { original: ref, targetNodeId: component.id, confidence: 0.95, resolvedBy: 'framework' } : null;
|
|
1080
|
+
}
|
|
1081
|
+
const nav = NAV_CALL.exec(ref.referenceName);
|
|
1082
|
+
if (!nav || ref.referenceKind !== 'calls')
|
|
1083
|
+
return null;
|
|
1084
|
+
const verb = nav[1];
|
|
1085
|
+
const routes = angularRoutesFor(angularRouteTable(context), ref.filePath);
|
|
1086
|
+
if (!routes || routes.exact.size === 0)
|
|
1087
|
+
return null;
|
|
1088
|
+
const lines = context.getFileLines?.(ref.filePath) ?? context.readFile(ref.filePath)?.split(/\r?\n/) ?? null;
|
|
1089
|
+
if (!lines)
|
|
1090
|
+
return null;
|
|
1091
|
+
const arg = (0, expo_router_1.firstArgumentText)(lines, ref.line, ref.column, verb);
|
|
1092
|
+
if (arg === null)
|
|
1093
|
+
return null;
|
|
1094
|
+
// `navigate(['..', id], { relativeTo: this.route })` goes somewhere relative to here.
|
|
1095
|
+
const extras = (0, expo_router_1.nthArgumentText)(lines, ref.line, ref.column, verb, 1);
|
|
1096
|
+
if (extras && /\brelativeTo\b/.test(extras))
|
|
1097
|
+
return null;
|
|
1098
|
+
const owner = context
|
|
1099
|
+
.getNodesInFile(ref.filePath)
|
|
1100
|
+
.filter((n) => n.kind === 'class' && n.startLine <= ref.line && n.endLine >= ref.line)
|
|
1101
|
+
.reduce((inner, n) => (!inner || n.startLine >= inner.startLine ? n : inner), null);
|
|
1102
|
+
const href = angularDestination(arg, ref.filePath, owner, context, 0, true);
|
|
1103
|
+
if (!href || !href.path.startsWith('/'))
|
|
1104
|
+
return null;
|
|
1105
|
+
const targets = (0, nextjs_1.destinationsForHref)(href, routes);
|
|
1106
|
+
const target = targets[0];
|
|
1107
|
+
if (!target)
|
|
1108
|
+
return null;
|
|
1109
|
+
return {
|
|
1110
|
+
original: ref,
|
|
1111
|
+
targetNodeId: target.node.id,
|
|
1112
|
+
...(targets.length > 1
|
|
1113
|
+
? { alsoTargets: targets.slice(1).map((t) => ({ targetNodeId: t.node.id, metadata: { href: t.href.display, navMethod: verb } })) }
|
|
1114
|
+
: {}),
|
|
1115
|
+
confidence: 0.95,
|
|
1116
|
+
resolvedBy: 'framework',
|
|
1117
|
+
edgeKind: 'navigates',
|
|
1118
|
+
metadata: { href: target.href.display, navMethod: verb },
|
|
1119
|
+
};
|
|
1120
|
+
},
|
|
1121
|
+
};
|
|
1122
|
+
/** For the template synthesizer: a template file's path, from the component file that names it. */
|
|
1123
|
+
function templatePathFor(componentFile, templateUrl) {
|
|
1124
|
+
return path.posix.normalize(path.posix.join(path.posix.dirname(componentFile), templateUrl));
|
|
1125
|
+
}
|
|
1126
|
+
//# sourceMappingURL=angular-router.js.map
|