@backthread/extractor 0.1.0
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/LICENSE +21 -0
- package/README.md +83 -0
- package/dist/cluster/domain-grouping.d.ts +113 -0
- package/dist/cluster/domain-grouping.d.ts.map +1 -0
- package/dist/cluster/domain-grouping.js +277 -0
- package/dist/cluster/domain-grouping.js.map +1 -0
- package/dist/cluster/grouping-gate.d.ts +54 -0
- package/dist/cluster/grouping-gate.d.ts.map +1 -0
- package/dist/cluster/grouping-gate.js +0 -0
- package/dist/cluster/grouping-gate.js.map +1 -0
- package/dist/cluster/louvain.d.ts +88 -0
- package/dist/cluster/louvain.d.ts.map +1 -0
- package/dist/cluster/louvain.js +674 -0
- package/dist/cluster/louvain.js.map +1 -0
- package/dist/cluster/overrides.d.ts +19 -0
- package/dist/cluster/overrides.d.ts.map +1 -0
- package/dist/cluster/overrides.js +32 -0
- package/dist/cluster/overrides.js.map +1 -0
- package/dist/cluster/subsystem.d.ts +45 -0
- package/dist/cluster/subsystem.d.ts.map +1 -0
- package/dist/cluster/subsystem.js +299 -0
- package/dist/cluster/subsystem.js.map +1 -0
- package/dist/cluster/workspaces.d.ts +64 -0
- package/dist/cluster/workspaces.d.ts.map +1 -0
- package/dist/cluster/workspaces.js +739 -0
- package/dist/cluster/workspaces.js.map +1 -0
- package/dist/extract.d.ts +52 -0
- package/dist/extract.d.ts.map +1 -0
- package/dist/extract.js +48 -0
- package/dist/extract.js.map +1 -0
- package/dist/framework/celery/celery.d.ts +17 -0
- package/dist/framework/celery/celery.d.ts.map +1 -0
- package/dist/framework/celery/celery.js +524 -0
- package/dist/framework/celery/celery.js.map +1 -0
- package/dist/framework/contribute-step.d.ts +38 -0
- package/dist/framework/contribute-step.d.ts.map +1 -0
- package/dist/framework/contribute-step.js +403 -0
- package/dist/framework/contribute-step.js.map +1 -0
- package/dist/framework/detect-step.d.ts +8 -0
- package/dist/framework/detect-step.d.ts.map +1 -0
- package/dist/framework/detect-step.js +54 -0
- package/dist/framework/detect-step.js.map +1 -0
- package/dist/framework/detect-util.d.ts +24 -0
- package/dist/framework/detect-util.d.ts.map +1 -0
- package/dist/framework/detect-util.js +59 -0
- package/dist/framework/detect-util.js.map +1 -0
- package/dist/framework/django/django.d.ts +22 -0
- package/dist/framework/django/django.d.ts.map +1 -0
- package/dist/framework/django/django.js +940 -0
- package/dist/framework/django/django.js.map +1 -0
- package/dist/framework/fastapi/fastapi.d.ts +27 -0
- package/dist/framework/fastapi/fastapi.d.ts.map +1 -0
- package/dist/framework/fastapi/fastapi.js +477 -0
- package/dist/framework/fastapi/fastapi.js.map +1 -0
- package/dist/framework/faststream/faststream.d.ts +19 -0
- package/dist/framework/faststream/faststream.d.ts.map +1 -0
- package/dist/framework/faststream/faststream.js +765 -0
- package/dist/framework/faststream/faststream.js.map +1 -0
- package/dist/framework/flask/flask.d.ts +17 -0
- package/dist/framework/flask/flask.d.ts.map +1 -0
- package/dist/framework/flask/flask.js +507 -0
- package/dist/framework/flask/flask.js.map +1 -0
- package/dist/framework/graphql/graphql.d.ts +17 -0
- package/dist/framework/graphql/graphql.d.ts.map +1 -0
- package/dist/framework/graphql/graphql.js +708 -0
- package/dist/framework/graphql/graphql.js.map +1 -0
- package/dist/framework/grpc/grpc.d.ts +22 -0
- package/dist/framework/grpc/grpc.d.ts.map +1 -0
- package/dist/framework/grpc/grpc.js +618 -0
- package/dist/framework/grpc/grpc.js.map +1 -0
- package/dist/framework/litestar/litestar.d.ts +17 -0
- package/dist/framework/litestar/litestar.d.ts.map +1 -0
- package/dist/framework/litestar/litestar.js +536 -0
- package/dist/framework/litestar/litestar.js.map +1 -0
- package/dist/framework/nest/nest.d.ts +19 -0
- package/dist/framework/nest/nest.d.ts.map +1 -0
- package/dist/framework/nest/nest.js +613 -0
- package/dist/framework/nest/nest.js.map +1 -0
- package/dist/framework/next/next.d.ts +22 -0
- package/dist/framework/next/next.d.ts.map +1 -0
- package/dist/framework/next/next.js +449 -0
- package/dist/framework/next/next.js.map +1 -0
- package/dist/framework/node/node.d.ts +24 -0
- package/dist/framework/node/node.d.ts.map +1 -0
- package/dist/framework/node/node.js +1009 -0
- package/dist/framework/node/node.js.map +1 -0
- package/dist/framework/orchestrator/orchestrator.d.ts +34 -0
- package/dist/framework/orchestrator/orchestrator.d.ts.map +1 -0
- package/dist/framework/orchestrator/orchestrator.js +691 -0
- package/dist/framework/orchestrator/orchestrator.js.map +1 -0
- package/dist/framework/orm/orm.d.ts +61 -0
- package/dist/framework/orm/orm.d.ts.map +1 -0
- package/dist/framework/orm/orm.js +620 -0
- package/dist/framework/orm/orm.js.map +1 -0
- package/dist/framework/python/analyze.d.ts +38 -0
- package/dist/framework/python/analyze.d.ts.map +1 -0
- package/dist/framework/python/analyze.js +98 -0
- package/dist/framework/python/analyze.js.map +1 -0
- package/dist/framework/python/py-ast.d.ts +130 -0
- package/dist/framework/python/py-ast.d.ts.map +1 -0
- package/dist/framework/python/py-ast.js +344 -0
- package/dist/framework/python/py-ast.js.map +1 -0
- package/dist/framework/python-orm/python-orm.d.ts +19 -0
- package/dist/framework/python-orm/python-orm.d.ts.map +1 -0
- package/dist/framework/python-orm/python-orm.js +516 -0
- package/dist/framework/python-orm/python-orm.js.map +1 -0
- package/dist/framework/react-native/react-native.d.ts +35 -0
- package/dist/framework/react-native/react-native.d.ts.map +1 -0
- package/dist/framework/react-native/react-native.js +1181 -0
- package/dist/framework/react-native/react-native.js.map +1 -0
- package/dist/framework/register.d.ts +2 -0
- package/dist/framework/register.d.ts.map +1 -0
- package/dist/framework/register.js +59 -0
- package/dist/framework/register.js.map +1 -0
- package/dist/framework/registry.d.ts +31 -0
- package/dist/framework/registry.d.ts.map +1 -0
- package/dist/framework/registry.js +70 -0
- package/dist/framework/registry.js.map +1 -0
- package/dist/framework/routing/expo-router.d.ts +31 -0
- package/dist/framework/routing/expo-router.d.ts.map +1 -0
- package/dist/framework/routing/expo-router.js +356 -0
- package/dist/framework/routing/expo-router.js.map +1 -0
- package/dist/framework/routing/index.d.ts +4 -0
- package/dist/framework/routing/index.d.ts.map +1 -0
- package/dist/framework/routing/index.js +16 -0
- package/dist/framework/routing/index.js.map +1 -0
- package/dist/framework/routing/next-router.d.ts +45 -0
- package/dist/framework/routing/next-router.d.ts.map +1 -0
- package/dist/framework/routing/next-router.js +378 -0
- package/dist/framework/routing/next-router.js.map +1 -0
- package/dist/framework/routing/route-tree.d.ts +73 -0
- package/dist/framework/routing/route-tree.d.ts.map +1 -0
- package/dist/framework/routing/route-tree.js +120 -0
- package/dist/framework/routing/route-tree.js.map +1 -0
- package/dist/framework/types.d.ts +230 -0
- package/dist/framework/types.d.ts.map +1 -0
- package/dist/framework/types.js +25 -0
- package/dist/framework/types.js.map +1 -0
- package/dist/graph/cross-language.d.ts +11 -0
- package/dist/graph/cross-language.d.ts.map +1 -0
- package/dist/graph/cross-language.js +123 -0
- package/dist/graph/cross-language.js.map +1 -0
- package/dist/graph/extract.d.ts +13 -0
- package/dist/graph/extract.d.ts.map +1 -0
- package/dist/graph/extract.js +79 -0
- package/dist/graph/extract.js.map +1 -0
- package/dist/graph/file-graph.d.ts +186 -0
- package/dist/graph/file-graph.d.ts.map +1 -0
- package/dist/graph/file-graph.js +427 -0
- package/dist/graph/file-graph.js.map +1 -0
- package/dist/graph/http-callsites.d.ts +14 -0
- package/dist/graph/http-callsites.d.ts.map +1 -0
- package/dist/graph/http-callsites.js +107 -0
- package/dist/graph/http-callsites.js.map +1 -0
- package/dist/graph/incremental.d.ts +122 -0
- package/dist/graph/incremental.d.ts.map +1 -0
- package/dist/graph/incremental.js +448 -0
- package/dist/graph/incremental.js.map +1 -0
- package/dist/graph/language.d.ts +31 -0
- package/dist/graph/language.d.ts.map +1 -0
- package/dist/graph/language.js +146 -0
- package/dist/graph/language.js.map +1 -0
- package/dist/graph/noise-filter.d.ts +46 -0
- package/dist/graph/noise-filter.d.ts.map +1 -0
- package/dist/graph/noise-filter.js +199 -0
- package/dist/graph/noise-filter.js.map +1 -0
- package/dist/graph/python-adapter.d.ts +36 -0
- package/dist/graph/python-adapter.d.ts.map +1 -0
- package/dist/graph/python-adapter.js +402 -0
- package/dist/graph/python-adapter.js.map +1 -0
- package/dist/graph/python-manifest.d.ts +22 -0
- package/dist/graph/python-manifest.d.ts.map +1 -0
- package/dist/graph/python-manifest.js +137 -0
- package/dist/graph/python-manifest.js.map +1 -0
- package/dist/graph/python-stdlib.d.ts +2 -0
- package/dist/graph/python-stdlib.d.ts.map +1 -0
- package/dist/graph/python-stdlib.js +53 -0
- package/dist/graph/python-stdlib.js.map +1 -0
- package/dist/graph/ts-morph-adapter.d.ts +65 -0
- package/dist/graph/ts-morph-adapter.d.ts.map +1 -0
- package/dist/graph/ts-morph-adapter.js +265 -0
- package/dist/graph/ts-morph-adapter.js.map +1 -0
- package/dist/graph/types.d.ts +37 -0
- package/dist/graph/types.d.ts.map +1 -0
- package/dist/graph/types.js +50 -0
- package/dist/graph/types.js.map +1 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/infra/aws/aws-parse.d.ts +39 -0
- package/dist/infra/aws/aws-parse.d.ts.map +1 -0
- package/dist/infra/aws/aws-parse.js +149 -0
- package/dist/infra/aws/aws-parse.js.map +1 -0
- package/dist/infra/aws/aws.d.ts +6 -0
- package/dist/infra/aws/aws.d.ts.map +1 -0
- package/dist/infra/aws/aws.js +425 -0
- package/dist/infra/aws/aws.js.map +1 -0
- package/dist/infra/azure/azure-parse.d.ts +73 -0
- package/dist/infra/azure/azure-parse.d.ts.map +1 -0
- package/dist/infra/azure/azure-parse.js +178 -0
- package/dist/infra/azure/azure-parse.js.map +1 -0
- package/dist/infra/azure/azure.d.ts +12 -0
- package/dist/infra/azure/azure.d.ts.map +1 -0
- package/dist/infra/azure/azure.js +673 -0
- package/dist/infra/azure/azure.js.map +1 -0
- package/dist/infra/cloudflare/cloudflare.d.ts +50 -0
- package/dist/infra/cloudflare/cloudflare.d.ts.map +1 -0
- package/dist/infra/cloudflare/cloudflare.js +382 -0
- package/dist/infra/cloudflare/cloudflare.js.map +1 -0
- package/dist/infra/cloudflare/wrangler-parse.d.ts +6 -0
- package/dist/infra/cloudflare/wrangler-parse.d.ts.map +1 -0
- package/dist/infra/cloudflare/wrangler-parse.js +278 -0
- package/dist/infra/cloudflare/wrangler-parse.js.map +1 -0
- package/dist/infra/compose/compose-parse.d.ts +24 -0
- package/dist/infra/compose/compose-parse.d.ts.map +1 -0
- package/dist/infra/compose/compose-parse.js +77 -0
- package/dist/infra/compose/compose-parse.js.map +1 -0
- package/dist/infra/compose/compose.d.ts +12 -0
- package/dist/infra/compose/compose.d.ts.map +1 -0
- package/dist/infra/compose/compose.js +201 -0
- package/dist/infra/compose/compose.js.map +1 -0
- package/dist/infra/convex/convex-parse.d.ts +28 -0
- package/dist/infra/convex/convex-parse.d.ts.map +1 -0
- package/dist/infra/convex/convex-parse.js +74 -0
- package/dist/infra/convex/convex-parse.js.map +1 -0
- package/dist/infra/convex/convex.d.ts +18 -0
- package/dist/infra/convex/convex.d.ts.map +1 -0
- package/dist/infra/convex/convex.js +199 -0
- package/dist/infra/convex/convex.js.map +1 -0
- package/dist/infra/digitalocean/digitalocean.d.ts +33 -0
- package/dist/infra/digitalocean/digitalocean.d.ts.map +1 -0
- package/dist/infra/digitalocean/digitalocean.js +204 -0
- package/dist/infra/digitalocean/digitalocean.js.map +1 -0
- package/dist/infra/firebase/firebase.d.ts +43 -0
- package/dist/infra/firebase/firebase.d.ts.map +1 -0
- package/dist/infra/firebase/firebase.js +271 -0
- package/dist/infra/firebase/firebase.js.map +1 -0
- package/dist/infra/fly/fly-parse.d.ts +52 -0
- package/dist/infra/fly/fly-parse.d.ts.map +1 -0
- package/dist/infra/fly/fly-parse.js +114 -0
- package/dist/infra/fly/fly-parse.js.map +1 -0
- package/dist/infra/fly/fly.d.ts +15 -0
- package/dist/infra/fly/fly.d.ts.map +1 -0
- package/dist/infra/fly/fly.js +265 -0
- package/dist/infra/fly/fly.js.map +1 -0
- package/dist/infra/gcp/gcp-parse.d.ts +24 -0
- package/dist/infra/gcp/gcp-parse.d.ts.map +1 -0
- package/dist/infra/gcp/gcp-parse.js +123 -0
- package/dist/infra/gcp/gcp-parse.js.map +1 -0
- package/dist/infra/gcp/gcp.d.ts +10 -0
- package/dist/infra/gcp/gcp.d.ts.map +1 -0
- package/dist/infra/gcp/gcp.js +502 -0
- package/dist/infra/gcp/gcp.js.map +1 -0
- package/dist/infra/heroku/heroku-parse.d.ts +33 -0
- package/dist/infra/heroku/heroku-parse.d.ts.map +1 -0
- package/dist/infra/heroku/heroku-parse.js +63 -0
- package/dist/infra/heroku/heroku-parse.js.map +1 -0
- package/dist/infra/heroku/heroku.d.ts +24 -0
- package/dist/infra/heroku/heroku.d.ts.map +1 -0
- package/dist/infra/heroku/heroku.js +253 -0
- package/dist/infra/heroku/heroku.js.map +1 -0
- package/dist/infra/image-resolve.d.ts +56 -0
- package/dist/infra/image-resolve.d.ts.map +1 -0
- package/dist/infra/image-resolve.js +229 -0
- package/dist/infra/image-resolve.js.map +1 -0
- package/dist/infra/infra-step.d.ts +39 -0
- package/dist/infra/infra-step.d.ts.map +1 -0
- package/dist/infra/infra-step.js +57 -0
- package/dist/infra/infra-step.js.map +1 -0
- package/dist/infra/k8s/index.d.ts +78 -0
- package/dist/infra/k8s/index.d.ts.map +1 -0
- package/dist/infra/k8s/index.js +251 -0
- package/dist/infra/k8s/index.js.map +1 -0
- package/dist/infra/kamal/kamal-parse.d.ts +23 -0
- package/dist/infra/kamal/kamal-parse.d.ts.map +1 -0
- package/dist/infra/kamal/kamal-parse.js +66 -0
- package/dist/infra/kamal/kamal-parse.js.map +1 -0
- package/dist/infra/kamal/kamal.d.ts +17 -0
- package/dist/infra/kamal/kamal.d.ts.map +1 -0
- package/dist/infra/kamal/kamal.js +162 -0
- package/dist/infra/kamal/kamal.js.map +1 -0
- package/dist/infra/netlify/netlify.d.ts +33 -0
- package/dist/infra/netlify/netlify.d.ts.map +1 -0
- package/dist/infra/netlify/netlify.js +247 -0
- package/dist/infra/netlify/netlify.js.map +1 -0
- package/dist/infra/opentofu/opentofu.d.ts +3 -0
- package/dist/infra/opentofu/opentofu.d.ts.map +1 -0
- package/dist/infra/opentofu/opentofu.js +157 -0
- package/dist/infra/opentofu/opentofu.js.map +1 -0
- package/dist/infra/pulumi/pulumi-parse.d.ts +60 -0
- package/dist/infra/pulumi/pulumi-parse.d.ts.map +1 -0
- package/dist/infra/pulumi/pulumi-parse.js +155 -0
- package/dist/infra/pulumi/pulumi-parse.js.map +1 -0
- package/dist/infra/pulumi/pulumi.d.ts +23 -0
- package/dist/infra/pulumi/pulumi.d.ts.map +1 -0
- package/dist/infra/pulumi/pulumi.js +260 -0
- package/dist/infra/pulumi/pulumi.js.map +1 -0
- package/dist/infra/railway/railway-parse.d.ts +54 -0
- package/dist/infra/railway/railway-parse.d.ts.map +1 -0
- package/dist/infra/railway/railway-parse.js +200 -0
- package/dist/infra/railway/railway-parse.js.map +1 -0
- package/dist/infra/railway/railway.d.ts +19 -0
- package/dist/infra/railway/railway.d.ts.map +1 -0
- package/dist/infra/railway/railway.js +397 -0
- package/dist/infra/railway/railway.js.map +1 -0
- package/dist/infra/register.d.ts +2 -0
- package/dist/infra/register.d.ts.map +1 -0
- package/dist/infra/register.js +81 -0
- package/dist/infra/register.js.map +1 -0
- package/dist/infra/registry.d.ts +64 -0
- package/dist/infra/registry.d.ts.map +1 -0
- package/dist/infra/registry.js +205 -0
- package/dist/infra/registry.js.map +1 -0
- package/dist/infra/relevance.d.ts +16 -0
- package/dist/infra/relevance.d.ts.map +1 -0
- package/dist/infra/relevance.js +132 -0
- package/dist/infra/relevance.js.map +1 -0
- package/dist/infra/render/render-parse.d.ts +76 -0
- package/dist/infra/render/render-parse.d.ts.map +1 -0
- package/dist/infra/render/render-parse.js +155 -0
- package/dist/infra/render/render-parse.js.map +1 -0
- package/dist/infra/render/render.d.ts +11 -0
- package/dist/infra/render/render.d.ts.map +1 -0
- package/dist/infra/render/render.js +303 -0
- package/dist/infra/render/render.js.map +1 -0
- package/dist/infra/sst/sst-parse.d.ts +25 -0
- package/dist/infra/sst/sst-parse.d.ts.map +1 -0
- package/dist/infra/sst/sst-parse.js +45 -0
- package/dist/infra/sst/sst-parse.js.map +1 -0
- package/dist/infra/sst/sst.d.ts +19 -0
- package/dist/infra/sst/sst.d.ts.map +1 -0
- package/dist/infra/sst/sst.js +236 -0
- package/dist/infra/sst/sst.js.map +1 -0
- package/dist/infra/supabase/supabase-parse.d.ts +34 -0
- package/dist/infra/supabase/supabase-parse.d.ts.map +1 -0
- package/dist/infra/supabase/supabase-parse.js +113 -0
- package/dist/infra/supabase/supabase-parse.js.map +1 -0
- package/dist/infra/supabase/supabase.d.ts +15 -0
- package/dist/infra/supabase/supabase.d.ts.map +1 -0
- package/dist/infra/supabase/supabase.js +198 -0
- package/dist/infra/supabase/supabase.js.map +1 -0
- package/dist/infra/terraform/hcl-parse.d.ts +34 -0
- package/dist/infra/terraform/hcl-parse.d.ts.map +1 -0
- package/dist/infra/terraform/hcl-parse.js +203 -0
- package/dist/infra/terraform/hcl-parse.js.map +1 -0
- package/dist/infra/terraform/terraform.d.ts +14 -0
- package/dist/infra/terraform/terraform.d.ts.map +1 -0
- package/dist/infra/terraform/terraform.js +264 -0
- package/dist/infra/terraform/terraform.js.map +1 -0
- package/dist/infra/types.d.ts +151 -0
- package/dist/infra/types.d.ts.map +1 -0
- package/dist/infra/types.js +14 -0
- package/dist/infra/types.js.map +1 -0
- package/dist/infra/vercel/vercel-parse.d.ts +70 -0
- package/dist/infra/vercel/vercel-parse.d.ts.map +1 -0
- package/dist/infra/vercel/vercel-parse.js +194 -0
- package/dist/infra/vercel/vercel-parse.js.map +1 -0
- package/dist/infra/vercel/vercel.d.ts +30 -0
- package/dist/infra/vercel/vercel.d.ts.map +1 -0
- package/dist/infra/vercel/vercel.js +523 -0
- package/dist/infra/vercel/vercel.js.map +1 -0
- package/dist/infra/walk.d.ts +36 -0
- package/dist/infra/walk.d.ts.map +1 -0
- package/dist/infra/walk.js +85 -0
- package/dist/infra/walk.js.map +1 -0
- package/dist/safety.d.ts +13 -0
- package/dist/safety.d.ts.map +1 -0
- package/dist/safety.js +67 -0
- package/dist/safety.js.map +1 -0
- package/dist/types.d.ts +47 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +111 -0
- package/dist/types.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +35 -0
- package/dist/version.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
// (Slice 1) — the Expo Router convention parser.
|
|
2
|
+
//
|
|
3
|
+
// Expo Router is file-system routing: every file under `app/` (or `src/app/`)
|
|
4
|
+
// is a route, derived from its PATH. This parser builds the convention-agnostic
|
|
5
|
+
// RouteTree (route-tree.ts) for that convention:
|
|
6
|
+
// * route TREE (paths + roles + parent nesting) from file PATHS/NAMES alone —
|
|
7
|
+
// no source content needed;
|
|
8
|
+
// * nav EDGES from statically-resolvable `<Link href>` / `<Redirect href>` /
|
|
9
|
+
// `router.push|replace|navigate('…')` / `redirect('…')` targets — these DO
|
|
10
|
+
// read source CONTENT (install-free ts-morph, the same parsing style as the
|
|
11
|
+
// structural extractor + the RN adapter).
|
|
12
|
+
//
|
|
13
|
+
// Never-store-source: this reads the route dir + file contents server-side and
|
|
14
|
+
// returns ONLY the derived tree/edges. It persists nothing itself (the library
|
|
15
|
+
// is pure; the consuming adapter declares `scansSourcePath` and the pipeline
|
|
16
|
+
// persists only the derived data Slice B / ).
|
|
17
|
+
//
|
|
18
|
+
// Filename → role + URL rules (Expo Router):
|
|
19
|
+
// * `_layout.{tsx,ts,jsx,js}` → role `layout`; governs its dir's URL
|
|
20
|
+
// * `*+api.{ts,js}` · `+html.*` → role `endpoint` (server / web shell)
|
|
21
|
+
// * `index.*` → the segment ROOT (drops `index`)
|
|
22
|
+
// * `[param].*` / `[...rest].*` → DYNAMIC segment (kept in the path)
|
|
23
|
+
// * `(group)/…` → route GROUP (stripped from the URL)
|
|
24
|
+
// * any other screen file → role `page`
|
|
25
|
+
//
|
|
26
|
+
// Per the convention, EVERY file under `app/` is a route — so a non-route helper
|
|
27
|
+
// accidentally colocated there (e.g. `app/utils/format.ts`) becomes a phantom
|
|
28
|
+
// `page`. That's the documented Expo gotcha (keep non-route code out of `app/`),
|
|
29
|
+
// not a parser bug; a default-export check to demote such files to `route` is a
|
|
30
|
+
// Slice-2 refinement.
|
|
31
|
+
//
|
|
32
|
+
// Nesting (NOT an edge — locked): a route's `parentFileId` is the nearest
|
|
33
|
+
// enclosing `_layout`; a layout's parent is the nearest layout in an ANCESTOR
|
|
34
|
+
// dir; the root layout has none.
|
|
35
|
+
import { readdirSync, statSync } from 'node:fs';
|
|
36
|
+
import { join } from 'node:path';
|
|
37
|
+
import { SyntaxKind } from 'ts-morph';
|
|
38
|
+
import { buildExtractionProject, toId } from '../../graph/ts-morph-adapter.js';
|
|
39
|
+
import { SOURCE_EXTENSIONS, EXCLUDE_DIRS } from '../../graph/file-graph.js';
|
|
40
|
+
import { buildHrefResolver } from './route-tree.js';
|
|
41
|
+
export const EXPO_ROUTER_CONVENTION = 'expo-router';
|
|
42
|
+
const SOURCE_EXT_SET = new Set(SOURCE_EXTENSIONS);
|
|
43
|
+
const EXCLUDE_SET = new Set(EXCLUDE_DIRS);
|
|
44
|
+
// `router.<m>('…')` methods whose first arg is a navigation target.
|
|
45
|
+
const ROUTER_NAV_METHODS = new Set(['push', 'replace', 'navigate']);
|
|
46
|
+
// The identifier(s) that name the Expo Router imperative API in practice
|
|
47
|
+
// (`const router = useRouter(); router.push(…)`, or the imported `router`).
|
|
48
|
+
// DELIBERATELY a literal name match: a `useRouter()` result bound to a DIFFERENT
|
|
49
|
+
// name (`const nav = useRouter(); nav.push(…)`) is not recognized as a nav call
|
|
50
|
+
// — so it's not a dropped target either (it's just not seen). Tracking the
|
|
51
|
+
// binding is a Slice-2 refinement; `router` is the overwhelming convention.
|
|
52
|
+
const ROUTER_RECEIVERS = new Set(['router']);
|
|
53
|
+
// JSX components whose `href` prop is a navigation target.
|
|
54
|
+
const NAV_COMPONENTS = new Set(['Link', 'Redirect']);
|
|
55
|
+
// Bare function nav (`redirect('/x')`). NOT an Expo Router primitive — included
|
|
56
|
+
// for the SHARED/Next path (Next's `redirect()`); harmless under Expo since it
|
|
57
|
+
// only emits an edge when its string arg resolves to a real route.
|
|
58
|
+
const NAV_FUNCS = new Set(['redirect']);
|
|
59
|
+
function isDir(p) {
|
|
60
|
+
try {
|
|
61
|
+
return statSync(p).isDirectory();
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Locate the Expo Router route dir for a repo (or workspace package). Expo
|
|
69
|
+
* Router lives at `app/` or `src/app/`. Returns the ABSOLUTE dir, or `null`.
|
|
70
|
+
*/
|
|
71
|
+
export function findExpoRouterAppDir(repoDir, rootPath = '') {
|
|
72
|
+
const base = rootPath ? join(repoDir, rootPath) : repoDir;
|
|
73
|
+
for (const cand of ['app', join('src', 'app')]) {
|
|
74
|
+
const abs = join(base, cand);
|
|
75
|
+
if (isDir(abs))
|
|
76
|
+
return abs;
|
|
77
|
+
}
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
// Recursively collect repo-relative posix file ids of source files under a dir,
|
|
81
|
+
// skipping dot-entries + excluded dirs (mirror the extractor's glob). Sorted.
|
|
82
|
+
function walkSourceFiles(absDir, repoDir) {
|
|
83
|
+
const out = [];
|
|
84
|
+
const stack = [absDir];
|
|
85
|
+
while (stack.length > 0) {
|
|
86
|
+
const dir = stack.pop();
|
|
87
|
+
let entries;
|
|
88
|
+
try {
|
|
89
|
+
entries = readdirSync(dir, { withFileTypes: true });
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
for (const e of entries) {
|
|
95
|
+
if (e.name.startsWith('.'))
|
|
96
|
+
continue; // Expo Router ignores dot-entries
|
|
97
|
+
const abs = join(dir, e.name);
|
|
98
|
+
if (e.isDirectory()) {
|
|
99
|
+
if (EXCLUDE_SET.has(e.name))
|
|
100
|
+
continue;
|
|
101
|
+
stack.push(abs);
|
|
102
|
+
}
|
|
103
|
+
else if (e.isFile()) {
|
|
104
|
+
const ext = e.name.split('.').pop();
|
|
105
|
+
if (ext && SOURCE_EXT_SET.has(ext))
|
|
106
|
+
out.push(toId(repoDir, abs));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return out.sort();
|
|
111
|
+
}
|
|
112
|
+
function stripExt(name) {
|
|
113
|
+
return name.replace(/\.[^.]+$/, '');
|
|
114
|
+
}
|
|
115
|
+
function isGroupSeg(seg) {
|
|
116
|
+
return seg.startsWith('(') && seg.endsWith(')');
|
|
117
|
+
}
|
|
118
|
+
// Derive role + URL-shaped route path from a route file's path relative to the
|
|
119
|
+
// route root dir (e.g. 'profile/[id].tsx', '_layout.tsx', '(tabs)/home.tsx',
|
|
120
|
+
// 'hello+api.ts'). Pure — no content read.
|
|
121
|
+
export function expoRouteInfo(relToRoot) {
|
|
122
|
+
const segments = relToRoot.split('/');
|
|
123
|
+
const fileName = segments.pop() ?? relToRoot;
|
|
124
|
+
const dirSegments = segments;
|
|
125
|
+
const stem = stripExt(fileName);
|
|
126
|
+
let role;
|
|
127
|
+
let urlSegments;
|
|
128
|
+
if (stem === '_layout') {
|
|
129
|
+
role = 'layout';
|
|
130
|
+
urlSegments = [...dirSegments]; // a layout governs its directory's URL
|
|
131
|
+
}
|
|
132
|
+
else if (stem === '+html') {
|
|
133
|
+
role = 'endpoint';
|
|
134
|
+
urlSegments = [...dirSegments, '+html'];
|
|
135
|
+
}
|
|
136
|
+
else if (stem.endsWith('+api')) {
|
|
137
|
+
role = 'endpoint';
|
|
138
|
+
const apiStem = stem.slice(0, -'+api'.length);
|
|
139
|
+
urlSegments = apiStem === '' ? [...dirSegments] : [...dirSegments, apiStem];
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
role = 'page';
|
|
143
|
+
urlSegments = stem === 'index' ? [...dirSegments] : [...dirSegments, stem];
|
|
144
|
+
}
|
|
145
|
+
const visible = urlSegments.filter((s) => !isGroupSeg(s)); // route groups don't appear in the URL
|
|
146
|
+
const routePath = visible.length > 0 ? `/${visible.join('/')}` : '/';
|
|
147
|
+
return { routePath, role };
|
|
148
|
+
}
|
|
149
|
+
// dir of a repo-relative file id ('app/profile/[id].tsx' → 'app/profile').
|
|
150
|
+
function dirOf(fileId) {
|
|
151
|
+
const i = fileId.lastIndexOf('/');
|
|
152
|
+
return i === -1 ? '' : fileId.slice(0, i);
|
|
153
|
+
}
|
|
154
|
+
// Ancestor dirs from `dir` up to (and including) `rootDir`, nearest first.
|
|
155
|
+
function ancestorDirs(dir, rootDir) {
|
|
156
|
+
const out = [];
|
|
157
|
+
let cur = dir;
|
|
158
|
+
// Walk up while still inside (or equal to) the route root.
|
|
159
|
+
while (cur === rootDir || cur.startsWith(`${rootDir}/`)) {
|
|
160
|
+
out.push(cur);
|
|
161
|
+
if (cur === rootDir)
|
|
162
|
+
break;
|
|
163
|
+
cur = dirOf(cur);
|
|
164
|
+
}
|
|
165
|
+
return out;
|
|
166
|
+
}
|
|
167
|
+
// ---------------------------------------------------------------------------
|
|
168
|
+
// Nav-target extraction (reads source content via ts-morph).
|
|
169
|
+
// A string nav target from a literal arg/attr: a bare string literal, or an
|
|
170
|
+
// object literal's `pathname` string (`<Link href={{ pathname:'/x', params }}>`,
|
|
171
|
+
// `router.push({ pathname:'/x' })`). Anything else (template literal, variable)
|
|
172
|
+
// → null (a DYNAMIC target the caller logs + skips).
|
|
173
|
+
function literalTarget(node) {
|
|
174
|
+
if (!node)
|
|
175
|
+
return null;
|
|
176
|
+
if (node.getKind() === SyntaxKind.StringLiteral)
|
|
177
|
+
return node.getLiteralValue();
|
|
178
|
+
if (node.getKind() === SyntaxKind.ObjectLiteralExpression) {
|
|
179
|
+
const pathname = node.getProperty('pathname');
|
|
180
|
+
if (pathname && pathname.getKind() === SyntaxKind.PropertyAssignment) {
|
|
181
|
+
const init = pathname.getInitializer();
|
|
182
|
+
if (init && init.getKind() === SyntaxKind.StringLiteral)
|
|
183
|
+
return init.getLiteralValue();
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
// Pull nav targets from one source file: <Link href> / <Redirect href> JSX
|
|
189
|
+
// attributes + router.push|replace|navigate('…') + redirect('…') calls.
|
|
190
|
+
function collectNavTargets(sf) {
|
|
191
|
+
const literals = [];
|
|
192
|
+
let dynamic = 0;
|
|
193
|
+
// JSX <Link href> / <Redirect href>.
|
|
194
|
+
const jsxEls = [
|
|
195
|
+
...sf.getDescendantsOfKind(SyntaxKind.JsxOpeningElement),
|
|
196
|
+
...sf.getDescendantsOfKind(SyntaxKind.JsxSelfClosingElement),
|
|
197
|
+
];
|
|
198
|
+
for (const el of jsxEls) {
|
|
199
|
+
const tag = el.getTagNameNode().getText();
|
|
200
|
+
const local = tag.split('.').pop() ?? tag; // `ExpoRouter.Link` → `Link`
|
|
201
|
+
if (!NAV_COMPONENTS.has(local))
|
|
202
|
+
continue;
|
|
203
|
+
const hrefAttr = el.getAttribute('href');
|
|
204
|
+
if (!hrefAttr || hrefAttr.getKind() !== SyntaxKind.JsxAttribute)
|
|
205
|
+
continue;
|
|
206
|
+
const init = hrefAttr.getInitializer();
|
|
207
|
+
if (!init)
|
|
208
|
+
continue;
|
|
209
|
+
let target = null;
|
|
210
|
+
if (init.getKind() === SyntaxKind.StringLiteral) {
|
|
211
|
+
target = init.getLiteralValue();
|
|
212
|
+
}
|
|
213
|
+
else if (init.getKind() === SyntaxKind.JsxExpression) {
|
|
214
|
+
target = literalTarget(init.getExpression());
|
|
215
|
+
}
|
|
216
|
+
if (target !== null)
|
|
217
|
+
literals.push(target);
|
|
218
|
+
else
|
|
219
|
+
dynamic++;
|
|
220
|
+
}
|
|
221
|
+
// router.push|replace|navigate('…') + redirect('…').
|
|
222
|
+
for (const call of sf.getDescendantsOfKind(SyntaxKind.CallExpression)) {
|
|
223
|
+
const callee = call.getExpression();
|
|
224
|
+
let isNav = false;
|
|
225
|
+
if (callee.getKind() === SyntaxKind.PropertyAccessExpression) {
|
|
226
|
+
const pae = callee;
|
|
227
|
+
const base = pae.getExpression();
|
|
228
|
+
isNav =
|
|
229
|
+
ROUTER_NAV_METHODS.has(pae.getName()) &&
|
|
230
|
+
base.getKind() === SyntaxKind.Identifier &&
|
|
231
|
+
ROUTER_RECEIVERS.has(base.getText());
|
|
232
|
+
}
|
|
233
|
+
else if (callee.getKind() === SyntaxKind.Identifier) {
|
|
234
|
+
isNav = NAV_FUNCS.has(callee.getText());
|
|
235
|
+
}
|
|
236
|
+
if (!isNav)
|
|
237
|
+
continue;
|
|
238
|
+
const arg = call.getArguments()[0];
|
|
239
|
+
if (!arg)
|
|
240
|
+
continue; // `router.back()`-style no-arg → not a target
|
|
241
|
+
const target = literalTarget(arg);
|
|
242
|
+
if (target !== null)
|
|
243
|
+
literals.push(target);
|
|
244
|
+
else
|
|
245
|
+
dynamic++;
|
|
246
|
+
}
|
|
247
|
+
return { literals, dynamic };
|
|
248
|
+
}
|
|
249
|
+
// ---------------------------------------------------------------------------
|
|
250
|
+
// The convention entrypoint.
|
|
251
|
+
/**
|
|
252
|
+
* Extract the Expo Router route tree for a repo (or workspace package). Returns
|
|
253
|
+
* `null` when there is no Expo Router `app/` dir or it holds no route files
|
|
254
|
+
* (→ the caller contributes nothing). Output is fully deterministic (routes
|
|
255
|
+
* sorted by fileId; navEdges deduped + sorted) — snapshot-stable by construction.
|
|
256
|
+
*/
|
|
257
|
+
export function extractExpoRouterTree(opts) {
|
|
258
|
+
const { repoDir } = opts;
|
|
259
|
+
const rootPath = opts.rootPath ?? '';
|
|
260
|
+
const appDirAbs = findExpoRouterAppDir(repoDir, rootPath);
|
|
261
|
+
if (!appDirAbs)
|
|
262
|
+
return null;
|
|
263
|
+
const rootDir = toId(repoDir, appDirAbs); // repo-relative posix, e.g. 'app' or 'apps/mobile/app'
|
|
264
|
+
const fileIds = walkSourceFiles(appDirAbs, repoDir);
|
|
265
|
+
if (fileIds.length === 0)
|
|
266
|
+
return null;
|
|
267
|
+
// --- route nodes (paths + roles) from file paths -------------------------
|
|
268
|
+
const routes = [];
|
|
269
|
+
const layoutByDir = new Map(); // dir → layout fileId (one per dir; lexical-first)
|
|
270
|
+
for (const fileId of fileIds) {
|
|
271
|
+
// fileId is always `${rootDir}/<suffix>` (walkSourceFiles ran under rootDir),
|
|
272
|
+
// so a slice is exact + platform-independent (no cwd-relative resolution).
|
|
273
|
+
const relToRoot = fileId.slice(rootDir.length + 1);
|
|
274
|
+
const { routePath, role } = expoRouteInfo(relToRoot);
|
|
275
|
+
routes.push({ routePath, fileId, role });
|
|
276
|
+
if (role === 'layout') {
|
|
277
|
+
const dir = dirOf(fileId);
|
|
278
|
+
if (!layoutByDir.has(dir))
|
|
279
|
+
layoutByDir.set(dir, fileId);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
// --- nesting (parentFileId = nearest enclosing layout) -------------------
|
|
283
|
+
for (const node of routes) {
|
|
284
|
+
const fileDir = dirOf(node.fileId);
|
|
285
|
+
// A layout's own dir-layout is itself; its parent must be a STRICT ancestor.
|
|
286
|
+
const searchDirs = node.role === 'layout'
|
|
287
|
+
? ancestorDirs(fileDir, rootDir).slice(1)
|
|
288
|
+
: ancestorDirs(fileDir, rootDir);
|
|
289
|
+
for (const dir of searchDirs) {
|
|
290
|
+
const layoutId = layoutByDir.get(dir);
|
|
291
|
+
if (layoutId && layoutId !== node.fileId) {
|
|
292
|
+
node.parentFileId = layoutId;
|
|
293
|
+
break;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
routes.sort((a, b) => (a.fileId < b.fileId ? -1 : a.fileId > b.fileId ? 1 : 0));
|
|
298
|
+
// --- nav edges (statically-resolvable targets; reads source content) -----
|
|
299
|
+
const resolve = buildHrefResolver(routes);
|
|
300
|
+
const project = buildExtractionProject(repoDir);
|
|
301
|
+
const sfById = new Map();
|
|
302
|
+
for (const fileId of fileIds) {
|
|
303
|
+
try {
|
|
304
|
+
sfById.set(fileId, project.addSourceFileAtPath(join(repoDir, fileId)));
|
|
305
|
+
}
|
|
306
|
+
catch {
|
|
307
|
+
// Unreadable / unparseable route file — skip its nav edges (logged below).
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
const edgeKeys = new Set();
|
|
311
|
+
const navEdges = [];
|
|
312
|
+
let dynamicTargets = 0;
|
|
313
|
+
const unresolvedTargets = new Set();
|
|
314
|
+
for (const fileId of fileIds) {
|
|
315
|
+
const sf = sfById.get(fileId);
|
|
316
|
+
if (!sf)
|
|
317
|
+
continue;
|
|
318
|
+
const { literals, dynamic } = collectNavTargets(sf);
|
|
319
|
+
dynamicTargets += dynamic;
|
|
320
|
+
for (const href of literals) {
|
|
321
|
+
const targetFile = resolve(href);
|
|
322
|
+
if (!targetFile) {
|
|
323
|
+
unresolvedTargets.add(href);
|
|
324
|
+
continue;
|
|
325
|
+
}
|
|
326
|
+
if (targetFile === fileId)
|
|
327
|
+
continue; // self-navigation — not a route→route edge
|
|
328
|
+
const key = `${fileId}→${targetFile}`;
|
|
329
|
+
if (edgeKeys.has(key))
|
|
330
|
+
continue;
|
|
331
|
+
edgeKeys.add(key);
|
|
332
|
+
navEdges.push({ fromFileId: fileId, toFileId: targetFile });
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
navEdges.sort((a, b) => a.fromFileId < b.fromFileId
|
|
336
|
+
? -1
|
|
337
|
+
: a.fromFileId > b.fromFileId
|
|
338
|
+
? 1
|
|
339
|
+
: a.toFileId < b.toFileId
|
|
340
|
+
? -1
|
|
341
|
+
: a.toFileId > b.toFileId
|
|
342
|
+
? 1
|
|
343
|
+
: 0);
|
|
344
|
+
// No silent caps: log every dynamic + unresolvable nav target once.
|
|
345
|
+
if (dynamicTargets > 0 || unresolvedTargets.size > 0) {
|
|
346
|
+
const parts = [];
|
|
347
|
+
if (dynamicTargets > 0)
|
|
348
|
+
parts.push(`${dynamicTargets} dynamic target(s)`);
|
|
349
|
+
if (unresolvedTargets.size > 0) {
|
|
350
|
+
parts.push(`${unresolvedTargets.size} unresolvable target(s): ${[...unresolvedTargets].sort().join(', ')}`);
|
|
351
|
+
}
|
|
352
|
+
console.log(` [expo-router] skipped ${parts.join(' · ')} (logged, not silently dropped)`);
|
|
353
|
+
}
|
|
354
|
+
return { convention: EXPO_ROUTER_CONVENTION, rootDir, routes, navEdges };
|
|
355
|
+
}
|
|
356
|
+
//# sourceMappingURL=expo-router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expo-router.js","sourceRoot":"","sources":["../../../src/framework/routing/expo-router.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,EAAE;AACF,8EAA8E;AAC9E,gFAAgF;AAChF,iDAAiD;AACjD,gFAAgF;AAChF,gCAAgC;AAChC,+EAA+E;AAC/E,+EAA+E;AAC/E,gFAAgF;AAChF,8CAA8C;AAC9C,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,6EAA6E;AAC7E,8CAA8C;AAC9C,EAAE;AACF,6CAA6C;AAC7C,kFAAkF;AAClF,kFAAkF;AAClF,8EAA8E;AAC9E,gFAAgF;AAChF,iFAAiF;AACjF,yDAAyD;AACzD,EAAE;AACF,iFAAiF;AACjF,8EAA8E;AAC9E,iFAAiF;AACjF,gFAAgF;AAChF,sBAAsB;AACtB,EAAE;AACF,0EAA0E;AAC1E,8EAA8E;AAC9E,iCAAiC;AAEjC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAA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AAC,CAAC;gBACJ,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ;oBACvB,CAAC,CAAC,CAAC;oBACH,CAAC,CAAC,CAAC,CACZ,CAAC;IAEF,oEAAoE;IACpE,IAAI,cAAc,GAAG,CAAC,IAAI,iBAAiB,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;QACrD,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,IAAI,cAAc,GAAG,CAAC;YAAE,KAAK,CAAC,IAAI,CAAC,GAAG,cAAc,oBAAoB,CAAC,CAAC;QAC1E,IAAI,iBAAiB,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YAC/B,KAAK,CAAC,IAAI,CAAC,GAAG,iBAAiB,CAAC,IAAI,4BAA4B,CAAC,GAAG,iBAAiB,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC9G,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,2BAA2B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;IAC7F,CAAC;IAED,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAC3E,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { type RouteRole, type RouteNode, type RouteNavEdge, type RouteTree, ROUTE_ROLES, normalizeHref, buildHrefResolver, } from './route-tree.js';
|
|
2
|
+
export { type ExpoRouterOptions, EXPO_ROUTER_CONVENTION, extractExpoRouterTree, findExpoRouterAppDir, expoRouteInfo, } from './expo-router.js';
|
|
3
|
+
export { type NextRouter, NEXT_CONVENTION, extractNextRouteTree, findNextRouteDirs, walkNextSourceFiles, nextRouteInfo, nextSegmentKey, } from './next-router.js';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/framework/routing/index.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,KAAK,iBAAiB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,aAAa,GACd,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,KAAK,UAAU,EACf,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,cAAc,GACf,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// (Slice 1) — the shared file-based-routing extractor.
|
|
2
|
+
//
|
|
3
|
+
// A pure, reusable LIBRARY (no pipeline wiring): a convention-agnostic route-tree
|
|
4
|
+
// model + the Expo Router convention parser. The RN/Expo adapter ( Slice
|
|
5
|
+
// B) and the Next.js adapter call these from their FrameworkAdapter
|
|
6
|
+
// hooks and map the RouteTree onto contribute-step contributions:
|
|
7
|
+
// * navEdges → `syntheticEdges` (each a `calls` FrameworkEdge — nav = `calls`)
|
|
8
|
+
// * routes → `roleTags` (role per fileId; the adapter maps role → ModuleKind)
|
|
9
|
+
// * routePath + parentFileId → carried as nesting METADATA (NOT an edge)
|
|
10
|
+
//
|
|
11
|
+
// Slice 1 of 2: Expo Router only. Next (app + pages) / Remix / Nuxt / SvelteKit /
|
|
12
|
+
// TanStack are Slice 2 (partly folded into ).
|
|
13
|
+
export { ROUTE_ROLES, normalizeHref, buildHrefResolver, } from './route-tree.js';
|
|
14
|
+
export { EXPO_ROUTER_CONVENTION, extractExpoRouterTree, findExpoRouterAppDir, expoRouteInfo, } from './expo-router.js';
|
|
15
|
+
export { NEXT_CONVENTION, extractNextRouteTree, findNextRouteDirs, walkNextSourceFiles, nextRouteInfo, nextSegmentKey, } from './next-router.js';
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/framework/routing/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,EAAE;AACF,kFAAkF;AAClF,yEAAyE;AACzE,oEAAoE;AACpE,kEAAkE;AAClE,kFAAkF;AAClF,mFAAmF;AACnF,4EAA4E;AAC5E,EAAE;AACF,kFAAkF;AAClF,8CAA8C;AAE9C,OAAO,EAKL,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAEL,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,aAAa,GACd,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAEL,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,cAAc,GACf,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type RouteRole, type RouteTree } from './route-tree.js';
|
|
2
|
+
export declare const NEXT_CONVENTION = "next";
|
|
3
|
+
/** Which Next router a route dir belongs to. */
|
|
4
|
+
export type NextRouter = 'app' | 'pages';
|
|
5
|
+
/**
|
|
6
|
+
* Locate the Next route dirs for a repo (or workspace package). Next uses EITHER
|
|
7
|
+
* the repo-root layout (`app` / `pages`) OR the `src/` layout (`src/app` /
|
|
8
|
+
* `src/pages`) — root takes precedence. Both routers can co-exist (a migration).
|
|
9
|
+
*/
|
|
10
|
+
export declare function findNextRouteDirs(repoDir: string, rootPath?: string): {
|
|
11
|
+
appDirAbs: string | null;
|
|
12
|
+
pagesDirAbs: string | null;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Recursively collect repo-relative posix file ids of source files under a dir,
|
|
16
|
+
* skipping dot-entries + excluded dirs (mirror expo-router's walk). Sorted.
|
|
17
|
+
*/
|
|
18
|
+
export declare function walkNextSourceFiles(absDir: string, repoDir: string): string[];
|
|
19
|
+
/**
|
|
20
|
+
* Derive role + URL-shaped route path from a route file's path relative to its
|
|
21
|
+
* route-root dir, or `null` when the file is NOT a route node (an App Router
|
|
22
|
+
* co-located component, or `pages/_document`). Pure — no content read.
|
|
23
|
+
*/
|
|
24
|
+
export declare function nextRouteInfo(relToRoot: string, router: NextRouter): {
|
|
25
|
+
routePath: string;
|
|
26
|
+
role: RouteRole;
|
|
27
|
+
} | null;
|
|
28
|
+
/**
|
|
29
|
+
* The top-level route SEGMENT key a file belongs to (for the route-segment
|
|
30
|
+
* grouping prior): the first URL-visible directory segment, or `''` (the root
|
|
31
|
+
* segment) for a file sitting directly in the route root (or only inside
|
|
32
|
+
* groups/slots). Pure — path only.
|
|
33
|
+
*/
|
|
34
|
+
export declare function nextSegmentKey(relToRoot: string, _router: NextRouter): string;
|
|
35
|
+
/**
|
|
36
|
+
* Extract the Next route tree for a repo (or workspace package), spanning BOTH
|
|
37
|
+
* the App Router and Pages Router when present (a migration). Returns `null` when
|
|
38
|
+
* neither route dir exists or holds route files. Fully deterministic (routes
|
|
39
|
+
* sorted by fileId; navEdges deduped + sorted) — snapshot-stable by construction.
|
|
40
|
+
*/
|
|
41
|
+
export declare function extractNextRouteTree(opts: {
|
|
42
|
+
repoDir: string;
|
|
43
|
+
rootPath?: string;
|
|
44
|
+
}): RouteTree | null;
|
|
45
|
+
//# sourceMappingURL=next-router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next-router.d.ts","sourceRoot":"","sources":["../../../src/framework/routing/next-router.ts"],"names":[],"mappings":"AA0CA,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,iBAAiB,CAAC;AAEzB,eAAO,MAAM,eAAe,SAAS,CAAC;AAEtC,gDAAgD;AAChD,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,OAAO,CAAC;AAyBzC;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,QAAQ,SAAK,GACZ;IAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAa1D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAwB7E;AAaD;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,UAAU,GACjB;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GAAG,IAAI,CA0B/C;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,MAAM,CAK7E;AAyGD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,SAAS,GAAG,IAAI,CAgHnB"}
|