@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,265 @@
|
|
|
1
|
+
// the Fly.io InfraAdapter (v0).
|
|
2
|
+
//
|
|
3
|
+
// Surfaces the Fly.io deployment topology from `fly.toml` (and optionally a
|
|
4
|
+
// Dockerfile and `.fly/` overlays). Entirely declared provenance — fly.toml
|
|
5
|
+
// names every Machine and Volume explicitly; no LLM needed (classificationsNeeded: []).
|
|
6
|
+
//
|
|
7
|
+
// Kind mapping (locked 8-kind InfraModuleKind enum — never weaken):
|
|
8
|
+
// Fly Machine / process group → container (Docker container running on Firecracker)
|
|
9
|
+
// Fly Volume (mount source) → datastore (persistent block storage)
|
|
10
|
+
//
|
|
11
|
+
// Edge taxonomy (8-verb EdgeKind — FORBIDDEN: imports/depends-on/uses):
|
|
12
|
+
// container → datastore : stores-in (from [[mounts]] source)
|
|
13
|
+
// container → container : calls (only if statically declared between processes)
|
|
14
|
+
//
|
|
15
|
+
// v0 scope:
|
|
16
|
+
// * [processes] with N named processes → N container nodes (one per process).
|
|
17
|
+
// Without [processes], a single container node labelled from `app`.
|
|
18
|
+
// * [[mounts]] → one datastore node per unique `source` volume name;
|
|
19
|
+
// each container that mounts it gets a `stores-in` edge.
|
|
20
|
+
// * Machine-to-machine `calls` edges: only emitted when [processes] declares
|
|
21
|
+
// a relationship — we do NOT invent edges that aren't statically declared.
|
|
22
|
+
// (In practice fly.toml has no cross-process dependency field, so no `calls`
|
|
23
|
+
// edges in the default implementation — see DoD note in .)
|
|
24
|
+
// * Dockerfile presence → metadata.image on the app container node.
|
|
25
|
+
// * regions / [[vm]] sizing / internal_port → metadata only.
|
|
26
|
+
// * `.fly/` overlays are read if present but treated as additional fly.toml
|
|
27
|
+
// fragments; they don't change the node/edge model.
|
|
28
|
+
import { readFileSync, existsSync } from 'node:fs';
|
|
29
|
+
import { join, relative, dirname, basename } from 'node:path';
|
|
30
|
+
import { findFiles } from '../walk.js';
|
|
31
|
+
import { parseFlyConfig } from './fly-parse.js';
|
|
32
|
+
/**
|
|
33
|
+
* Locate every `fly.toml` in the repo (bounded recursive walk).
|
|
34
|
+
* Also picks up `.fly/fly.toml` overlays.
|
|
35
|
+
*/
|
|
36
|
+
function findFlyConfigs(repoDir) {
|
|
37
|
+
return findFiles(repoDir, (_abs, e) => e.name === 'fly.toml', { maxDepth: 5 });
|
|
38
|
+
}
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
// Source-root helper. Repo-relative, normalized.
|
|
41
|
+
/** Normalize a repo-relative path: backslashes→/, collapse `.`/`./`, strip trailing `/`. */
|
|
42
|
+
function normalizeRoot(p) {
|
|
43
|
+
return p.replace(/\\/g, '/').replace(/^\.(?:\/|$)/, '').replace(/\/+$/, '');
|
|
44
|
+
}
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
// Node-id helpers (adapter-local; registry prefixes `fly:` at merge time).
|
|
47
|
+
//
|
|
48
|
+
// IDs are scoped by app name to prevent monorepo collisions:
|
|
49
|
+
// single-process: machine:<app>
|
|
50
|
+
// multi-process: machine:<app>/<process>
|
|
51
|
+
// volume: volume:<app>/<volumeName>
|
|
52
|
+
const machineId = (app, processName) => processName ? `machine:${app}/${processName}` : `machine:${app}`;
|
|
53
|
+
const volumeId = (app, volumeName) => `volume:${app}/${volumeName}`;
|
|
54
|
+
function findDockerfile(repoDir, configFile, buildDockerfile) {
|
|
55
|
+
const configDir = dirname(configFile);
|
|
56
|
+
// 1. Honour an explicit [build] dockerfile declaration.
|
|
57
|
+
if (buildDockerfile) {
|
|
58
|
+
const explicit = join(configDir, buildDockerfile);
|
|
59
|
+
if (existsSync(explicit)) {
|
|
60
|
+
return { path: relative(repoDir, explicit), isCustom: true };
|
|
61
|
+
}
|
|
62
|
+
// Declared but not found — still record the declared path so it isn't lost.
|
|
63
|
+
return { path: buildDockerfile, isCustom: true };
|
|
64
|
+
}
|
|
65
|
+
// 2 + 3. Default probe locations.
|
|
66
|
+
for (const candidate of [join(configDir, 'Dockerfile'), join(repoDir, 'Dockerfile')]) {
|
|
67
|
+
if (existsSync(candidate))
|
|
68
|
+
return { path: relative(repoDir, candidate), isCustom: false };
|
|
69
|
+
}
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
export function buildFlyGraph(configs, root) {
|
|
73
|
+
const nodes = new Map();
|
|
74
|
+
const edges = [];
|
|
75
|
+
const addNode = (n) => {
|
|
76
|
+
// First declaration wins (same pattern as cloudflare.ts).
|
|
77
|
+
if (!nodes.has(n.id))
|
|
78
|
+
nodes.set(n.id, n);
|
|
79
|
+
};
|
|
80
|
+
for (const { config, file } of configs) {
|
|
81
|
+
const rel = relative(root, file) || file;
|
|
82
|
+
const { appMissing, primary_region, build, processes, services, mounts, vms } = config;
|
|
83
|
+
// -----------------------------------------------------------------------
|
|
84
|
+
// Fix #5: stable app identifier.
|
|
85
|
+
//
|
|
86
|
+
// When `app` was missing/unparseable in the TOML, derive a fallback from
|
|
87
|
+
// the config file path (e.g. "apps/api/fly.toml" → "apps/api") rather
|
|
88
|
+
// than silently using a fixed constant ('app') that causes all anonymous
|
|
89
|
+
// configs to merge into one node.
|
|
90
|
+
const app = appMissing
|
|
91
|
+
? (relative(root, dirname(file)) || basename(dirname(file)) || 'unknown')
|
|
92
|
+
: config.app;
|
|
93
|
+
// -----------------------------------------------------------------------
|
|
94
|
+
// Fix #4: Dockerfile resolution respects [build] dockerfile declaration.
|
|
95
|
+
const dfResult = findDockerfile(root, file, build?.dockerfile);
|
|
96
|
+
// -----------------------------------------------------------------------
|
|
97
|
+
// the app's source root = Fly's build CONTEXT, which is the dir
|
|
98
|
+
// that holds fly.toml (Fly's deploy cwd). The `[build].dockerfile` is just
|
|
99
|
+
// the recipe path within that context, so the context — not the Dockerfile's
|
|
100
|
+
// own dir — is what actually deploys (a `docker/Dockerfile.api` recipe still
|
|
101
|
+
// builds the whole app dir). A `[build].image` (prebuilt) app runs no code of
|
|
102
|
+
// ours → no source root (honest "Other"); image-only is deferred to the
|
|
103
|
+
// resolver path, not Fly's primary in-repo-Dockerfile path. The bare
|
|
104
|
+
// repo root ('') is never emitted — no catch-all swallowing sibling units.
|
|
105
|
+
const configDir = normalizeRoot(relative(root, dirname(file)));
|
|
106
|
+
const buildsFromSource = !build?.image;
|
|
107
|
+
const appSourceRoots = buildsFromSource && configDir ? [configDir] : [];
|
|
108
|
+
// -----------------------------------------------------------------------
|
|
109
|
+
// 1. Determine container node(s).
|
|
110
|
+
//
|
|
111
|
+
// If [processes] is declared, one container per named process (e.g. `web`,
|
|
112
|
+
// `worker`, `release`). Otherwise, a single container for the whole app.
|
|
113
|
+
//
|
|
114
|
+
// Fix #1 + #3: IDs are scoped by app name → machine:<app> (single-process)
|
|
115
|
+
// or machine:<app>/<proc> (multi-process), preventing cross-app collisions.
|
|
116
|
+
const processNames = Object.keys(processes);
|
|
117
|
+
const containerIds = [];
|
|
118
|
+
if (processNames.length > 0) {
|
|
119
|
+
for (const pName of processNames) {
|
|
120
|
+
// Fix #1: scope by app/proc
|
|
121
|
+
const id = machineId(app, pName);
|
|
122
|
+
containerIds.push(id);
|
|
123
|
+
// vm sizing metadata for this process group
|
|
124
|
+
const vmForProcess = vms.find((v) => v.processes?.includes(pName));
|
|
125
|
+
const vmMeta = vmForProcess
|
|
126
|
+
? { vmSize: vmForProcess.size, vmMemory: vmForProcess.memory, vmCpuKind: vmForProcess.cpu_kind }
|
|
127
|
+
: {};
|
|
128
|
+
// service port metadata for this process group
|
|
129
|
+
const svcForProcess = services.find((s) => s.processes?.includes(pName));
|
|
130
|
+
const svcMeta = svcForProcess ? { internalPort: svcForProcess.internal_port } : {};
|
|
131
|
+
addNode({
|
|
132
|
+
id,
|
|
133
|
+
label: `${app} / ${pName}`,
|
|
134
|
+
kind: 'container',
|
|
135
|
+
provenance: 'declared',
|
|
136
|
+
metadata: {
|
|
137
|
+
app,
|
|
138
|
+
process: pName,
|
|
139
|
+
command: processes[pName],
|
|
140
|
+
config: rel,
|
|
141
|
+
...(primary_region ? { primaryRegion: primary_region } : {}),
|
|
142
|
+
...(dfResult ? { dockerfile: dfResult.path } : {}),
|
|
143
|
+
// Fix #4: surface explicit build.dockerfile path under buildDockerfile key
|
|
144
|
+
...(dfResult?.isCustom ? { buildDockerfile: dfResult.path } : {}),
|
|
145
|
+
...(build?.image ? { image: build.image } : {}),
|
|
146
|
+
...vmMeta,
|
|
147
|
+
...svcMeta,
|
|
148
|
+
},
|
|
149
|
+
...(appSourceRoots.length ? { sourceRoots: appSourceRoots } : {}),
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
// Single-process app.
|
|
155
|
+
// Fix #3: use machineId(app) — same app-scoped form as multi-process
|
|
156
|
+
const id = machineId(app);
|
|
157
|
+
containerIds.push(id);
|
|
158
|
+
const vmMeta = vms[0]
|
|
159
|
+
? { vmSize: vms[0].size, vmMemory: vms[0].memory, vmCpuKind: vms[0].cpu_kind }
|
|
160
|
+
: {};
|
|
161
|
+
const svcMeta = services[0] ? { internalPort: services[0].internal_port } : {};
|
|
162
|
+
addNode({
|
|
163
|
+
id,
|
|
164
|
+
label: app,
|
|
165
|
+
kind: 'container',
|
|
166
|
+
provenance: 'declared',
|
|
167
|
+
metadata: {
|
|
168
|
+
app,
|
|
169
|
+
config: rel,
|
|
170
|
+
...(primary_region ? { primaryRegion: primary_region } : {}),
|
|
171
|
+
...(dfResult ? { dockerfile: dfResult.path } : {}),
|
|
172
|
+
// Fix #4: surface explicit build.dockerfile path under buildDockerfile key
|
|
173
|
+
...(dfResult?.isCustom ? { buildDockerfile: dfResult.path } : {}),
|
|
174
|
+
...(build?.image ? { image: build.image } : {}),
|
|
175
|
+
...vmMeta,
|
|
176
|
+
...svcMeta,
|
|
177
|
+
},
|
|
178
|
+
...(appSourceRoots.length ? { sourceRoots: appSourceRoots } : {}),
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
// -----------------------------------------------------------------------
|
|
182
|
+
// 2. Volumes from [[mounts]].
|
|
183
|
+
//
|
|
184
|
+
// Fix #2: volume IDs are scoped by app (`volume:<app>/<name>`) because
|
|
185
|
+
// Fly volumes are per-app — two apps with the same volume name are
|
|
186
|
+
// distinct resources.
|
|
187
|
+
for (const mount of mounts) {
|
|
188
|
+
const volId = volumeId(app, mount.source);
|
|
189
|
+
addNode({
|
|
190
|
+
id: volId,
|
|
191
|
+
label: mount.source,
|
|
192
|
+
kind: 'datastore',
|
|
193
|
+
provenance: 'declared',
|
|
194
|
+
metadata: {
|
|
195
|
+
provider: 'fly',
|
|
196
|
+
app,
|
|
197
|
+
volumeName: mount.source,
|
|
198
|
+
destination: mount.destination,
|
|
199
|
+
config: rel,
|
|
200
|
+
},
|
|
201
|
+
});
|
|
202
|
+
// Determine which containers mount this volume.
|
|
203
|
+
let mountingContainers;
|
|
204
|
+
if (mount.processes && mount.processes.length > 0) {
|
|
205
|
+
// Mount scoped to specific process groups.
|
|
206
|
+
// Fix #1: resolve process names using the app-scoped machineId
|
|
207
|
+
mountingContainers = mount.processes
|
|
208
|
+
.map((proc) => machineId(app, proc))
|
|
209
|
+
.filter((id) => containerIds.includes(id));
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
// Mount shared across all containers in this config.
|
|
213
|
+
mountingContainers = [...containerIds];
|
|
214
|
+
}
|
|
215
|
+
for (const cId of mountingContainers) {
|
|
216
|
+
edges.push({
|
|
217
|
+
source: cId,
|
|
218
|
+
target: volId,
|
|
219
|
+
kind: 'stores-in',
|
|
220
|
+
metadata: { destination: mount.destination, config: rel },
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
// -----------------------------------------------------------------------
|
|
225
|
+
// NOTE on Machine-to-machine `calls` edges:
|
|
226
|
+
// fly.toml has no cross-process dependency declaration syntax. We do NOT
|
|
227
|
+
// invent edges — "Only test edge kinds you actually emit". If a
|
|
228
|
+
// future fly.toml extension adds a declared dependency field, add it here.
|
|
229
|
+
}
|
|
230
|
+
return {
|
|
231
|
+
root,
|
|
232
|
+
adapter: 'fly',
|
|
233
|
+
nodes: [...nodes.values()],
|
|
234
|
+
edges,
|
|
235
|
+
classificationsNeeded: [], // Fly's model is tight + static — no LLM needed
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
// ---------------------------------------------------------------------------
|
|
239
|
+
// Adapter
|
|
240
|
+
export const flyAdapter = {
|
|
241
|
+
name: 'fly',
|
|
242
|
+
async detect(repoDir) {
|
|
243
|
+
// Cheap: just check if fly.toml exists anywhere (bounded walk).
|
|
244
|
+
return findFlyConfigs(repoDir).length > 0;
|
|
245
|
+
},
|
|
246
|
+
async extract(repoDir) {
|
|
247
|
+
const files = findFlyConfigs(repoDir);
|
|
248
|
+
const entries = [];
|
|
249
|
+
for (const file of files) {
|
|
250
|
+
try {
|
|
251
|
+
const text = readFileSync(file, 'utf8');
|
|
252
|
+
const config = parseFlyConfig(text);
|
|
253
|
+
// Dockerfile resolution now happens inside buildFlyGraph (Fix #4),
|
|
254
|
+
// so we no longer pre-compute dockerfilePath here.
|
|
255
|
+
entries.push({ config, file });
|
|
256
|
+
}
|
|
257
|
+
catch (err) {
|
|
258
|
+
// A single malformed config shouldn't sink the whole infra layer.
|
|
259
|
+
console.warn(` [fly] skipping unparseable ${file}: ${err.message}`);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
return buildFlyGraph(entries, repoDir);
|
|
263
|
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
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type GcpResourceKind = 'cloud-run' | 'app-engine' | 'cloud-functions' | 'k8s-deployment' | 'k8s-statefulset' | 'k8s-job' | 'k8s-cronjob' | 'k8s-service' | 'k8s-ingress';
|
|
2
|
+
export interface GcpResource {
|
|
3
|
+
kind: GcpResourceKind;
|
|
4
|
+
name: string;
|
|
5
|
+
/** Raw document object (the parsed YAML map). */
|
|
6
|
+
raw: Record<string, unknown>;
|
|
7
|
+
/** Source file (absolute path). */
|
|
8
|
+
file: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Classify a single parsed YAML document object into a GcpResource, or
|
|
12
|
+
* return `null` if it doesn't match any recognised GCP/k8s shape.
|
|
13
|
+
*
|
|
14
|
+
* Deliberately defensive: every field access is guarded. A YAML doc that
|
|
15
|
+
* looks like `{ foo: bar }` silently returns null.
|
|
16
|
+
*/
|
|
17
|
+
export declare function classifyYamlDoc(doc: unknown, file: string): GcpResource | null;
|
|
18
|
+
/**
|
|
19
|
+
* Parse a raw YAML string (possibly multi-document) and return all recognised
|
|
20
|
+
* GCP/k8s resources found in it. Per-document parse errors are swallowed with
|
|
21
|
+
* a `console.warn` — one broken doc must never crash the whole file.
|
|
22
|
+
*/
|
|
23
|
+
export declare function parseGcpFile(content: string, file: string): GcpResource[];
|
|
24
|
+
//# sourceMappingURL=gcp-parse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gcp-parse.d.ts","sourceRoot":"","sources":["../../../src/infra/gcp/gcp-parse.ts"],"names":[],"mappings":"AAsBA,MAAM,MAAM,eAAe,GACvB,WAAW,GACX,YAAY,GACZ,iBAAiB,GACjB,gBAAgB,GAChB,iBAAiB,GACjB,SAAS,GACT,aAAa,GACb,aAAa,GACb,aAAa,CAAC;AAElB,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7B,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;CACd;AAkBD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CA6D9E;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE,CAqBzE"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// GCP-native InfraAdapter parser.
|
|
2
|
+
//
|
|
3
|
+
// Classifies a raw YAML document (already parsed via `yaml`) into a
|
|
4
|
+
// GcpResource descriptor. Called from gcp.ts after the bounded file walk
|
|
5
|
+
// pulls each *.yaml / *.yml through `yaml.parseAllDocuments`.
|
|
6
|
+
//
|
|
7
|
+
// Supported in v0 (declared, no LLM needed):
|
|
8
|
+
// - Cloud Run service.yaml (apiVersion: serving.knative.dev/v1, kind: Service)
|
|
9
|
+
// - App Engine app.yaml (top-level `runtime:` key, optional `service:` key)
|
|
10
|
+
// - Cloud Functions (top-level `name:` + `runtime:` without AE `service:`)
|
|
11
|
+
// - GKE / k8s manifests (standard k8s apiVersions, kind: Deployment / Service /
|
|
12
|
+
// Ingress / StatefulSet / Job / CronJob)
|
|
13
|
+
//
|
|
14
|
+
// DEFERRED: Deployment Manager .jinja, cloudbuild.yaml deploy-mechanism,
|
|
15
|
+
// GKE Autopilot node-pool configs. Tracked .
|
|
16
|
+
import { parseAllDocuments } from 'yaml';
|
|
17
|
+
import { isK8sApiVersion } from '../k8s/index.js';
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
// Helpers.
|
|
20
|
+
function str(v) {
|
|
21
|
+
return typeof v === 'string' && v ? v : undefined;
|
|
22
|
+
}
|
|
23
|
+
function rec(v) {
|
|
24
|
+
return v && typeof v === 'object' && !Array.isArray(v)
|
|
25
|
+
? v
|
|
26
|
+
: undefined;
|
|
27
|
+
}
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
// Classification.
|
|
30
|
+
/**
|
|
31
|
+
* Classify a single parsed YAML document object into a GcpResource, or
|
|
32
|
+
* return `null` if it doesn't match any recognised GCP/k8s shape.
|
|
33
|
+
*
|
|
34
|
+
* Deliberately defensive: every field access is guarded. A YAML doc that
|
|
35
|
+
* looks like `{ foo: bar }` silently returns null.
|
|
36
|
+
*/
|
|
37
|
+
export function classifyYamlDoc(doc, file) {
|
|
38
|
+
const d = rec(doc);
|
|
39
|
+
if (!d)
|
|
40
|
+
return null;
|
|
41
|
+
const kind = str(d['kind']);
|
|
42
|
+
const apiVersion = str(d['apiVersion']);
|
|
43
|
+
const metadata = rec(d['metadata']);
|
|
44
|
+
const name = str(metadata?.['name']) ?? 'unnamed';
|
|
45
|
+
// --- Cloud Run (Knative serving) -----------------------------------------
|
|
46
|
+
// apiVersion: serving.knative.dev/v1 (or v1alpha1/v1beta1), kind: Service
|
|
47
|
+
if (apiVersion?.startsWith('serving.knative.dev') && kind === 'Service') {
|
|
48
|
+
return { kind: 'cloud-run', name, raw: d, file };
|
|
49
|
+
}
|
|
50
|
+
// --- Kubernetes / GKE manifests -------------------------------------------
|
|
51
|
+
// Standard k8s apiVersions (apps/v1, batch/v1, networking.k8s.io/v1, v1 core,
|
|
52
|
+
// extensions/v1beta1, …) — recognised by the shared k8s primitive.
|
|
53
|
+
// Check this BEFORE app.yaml: k8s Service/Deployment always have apiVersion.
|
|
54
|
+
if (isK8sApiVersion(apiVersion) && kind) {
|
|
55
|
+
switch (kind) {
|
|
56
|
+
case 'Deployment':
|
|
57
|
+
return { kind: 'k8s-deployment', name, raw: d, file };
|
|
58
|
+
case 'StatefulSet':
|
|
59
|
+
return { kind: 'k8s-statefulset', name, raw: d, file };
|
|
60
|
+
case 'Job':
|
|
61
|
+
return { kind: 'k8s-job', name, raw: d, file };
|
|
62
|
+
case 'CronJob':
|
|
63
|
+
return { kind: 'k8s-cronjob', name, raw: d, file };
|
|
64
|
+
case 'Service':
|
|
65
|
+
return { kind: 'k8s-service', name, raw: d, file };
|
|
66
|
+
case 'Ingress':
|
|
67
|
+
return { kind: 'k8s-ingress', name, raw: d, file };
|
|
68
|
+
default:
|
|
69
|
+
return null; // ConfigMap, Namespace, ServiceAccount, etc. — not topology
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// --- App Engine app.yaml --------------------------------------------------
|
|
73
|
+
// No apiVersion/kind — identified by top-level `runtime:` field (required by
|
|
74
|
+
// AE). The `service:` field names the service; default is "default".
|
|
75
|
+
// Must come after k8s check (k8s docs always have apiVersion).
|
|
76
|
+
if (!apiVersion && !kind && str(d['runtime'])) {
|
|
77
|
+
// Distinguish from Cloud Functions: App Engine uses `service:`, Cloud
|
|
78
|
+
// Functions uses `name:`. Both require `runtime:` but CF lacks `service:`.
|
|
79
|
+
const hasService = 'service' in d;
|
|
80
|
+
const fnName = str(d['name']);
|
|
81
|
+
// Cloud Functions (gen1 YAML): requires `name:` + a strong signal —
|
|
82
|
+
// either `entryPoint:` or a `trigger:` block — to avoid false-positives
|
|
83
|
+
// on unrelated YAML that happens to have `runtime:` + `name:`.
|
|
84
|
+
// DEFERRED: package.json-based framework detection path.
|
|
85
|
+
const hasFunctionSignal = 'entryPoint' in d || 'trigger' in d;
|
|
86
|
+
if (!hasService && fnName && hasFunctionSignal) {
|
|
87
|
+
return { kind: 'cloud-functions', name: fnName, raw: d, file };
|
|
88
|
+
}
|
|
89
|
+
// App Engine: has `service:`, or has `runtime:` but no strong CF signal.
|
|
90
|
+
const aeName = str(d['service']) ?? 'default';
|
|
91
|
+
return { kind: 'app-engine', name: aeName, raw: d, file };
|
|
92
|
+
}
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Parse a raw YAML string (possibly multi-document) and return all recognised
|
|
97
|
+
* GCP/k8s resources found in it. Per-document parse errors are swallowed with
|
|
98
|
+
* a `console.warn` — one broken doc must never crash the whole file.
|
|
99
|
+
*/
|
|
100
|
+
export function parseGcpFile(content, file) {
|
|
101
|
+
const results = [];
|
|
102
|
+
let docs;
|
|
103
|
+
try {
|
|
104
|
+
docs = parseAllDocuments(content, { strict: false });
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
console.warn(` [gcp] failed to parse YAML in ${file} — skipping file`);
|
|
108
|
+
return results;
|
|
109
|
+
}
|
|
110
|
+
for (const doc of docs) {
|
|
111
|
+
try {
|
|
112
|
+
const obj = doc.toJS({ reviver: undefined });
|
|
113
|
+
const resource = classifyYamlDoc(obj, file);
|
|
114
|
+
if (resource)
|
|
115
|
+
results.push(resource);
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
// Individual doc parse/conversion error — skip, not fatal.
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return results;
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=gcp-parse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gcp-parse.js","sourceRoot":"","sources":["../../../src/infra/gcp/gcp-parse.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,EAAE;AACF,oEAAoE;AACpE,yEAAyE;AACzE,8DAA8D;AAC9D,EAAE;AACF,6CAA6C;AAC7C,kFAAkF;AAClF,kFAAkF;AAClF,qFAAqF;AACrF,sFAAsF;AACtF,sEAAsE;AACtE,EAAE;AACF,yEAAyE;AACzE,uDAAuD;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAyBlD,8EAA8E;AAC9E,WAAW;AAEX,SAAS,GAAG,CAAC,CAAU;IACrB,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACpD,CAAC;AAED,SAAS,G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C;QACD,yEAAyE;QACzE,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,SAAS,CAAC;QAC9C,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;IAC5D,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,OAAe,EAAE,IAAY;IACxD,MAAM,OAAO,GAAkB,EAAE,CAAC;IAClC,IAAI,IAA0C,CAAC;IAC/C,IAAI,CAAC;QACH,IAAI,GAAG,iBAAiB,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IACvD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,IAAI,CAAC,mCAAmC,IAAI,kBAAkB,CAAC,CAAC;QACxE,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;YAC7C,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YAC5C,IAAI,QAAQ;gBAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,CAAC;QAAC,MAAM,CAAC;YACP,2DAA2D;QAC7D,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { InfraAdapter, InfraGraph } from '../types.js';
|
|
2
|
+
import { type DockerfileIndex } from '../image-resolve.js';
|
|
3
|
+
import { type GcpResource } from './gcp-parse.js';
|
|
4
|
+
/**
|
|
5
|
+
* Pure graph builder — takes already-parsed GcpResources and emits the
|
|
6
|
+
* InfraGraph. Separated from the file walk so it can be unit-tested.
|
|
7
|
+
*/
|
|
8
|
+
export declare function buildGcpGraph(resources: GcpResource[], root: string, dockerfileIndex?: DockerfileIndex): InfraGraph;
|
|
9
|
+
export declare const gcpAdapter: InfraAdapter;
|
|
10
|
+
//# sourceMappingURL=gcp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gcp.d.ts","sourceRoot":"","sources":["../../../src/infra/gcp/gcp.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,YAAY,EAAa,UAAU,EAAa,MAAM,aAAa,CAAC;AAIlF,OAAO,EAAmD,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC5G,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAoIhE;;;GAGG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,eAAe,GAAG,UAAU,CA6SnH;AAqCD,eAAO,MAAM,UAAU,EAAE,YAuCxB,CAAC"}
|