@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 @@
|
|
|
1
|
+
{"version":3,"file":"opentofu.js","sourceRoot":"","sources":["../../../src/infra/opentofu/opentofu.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,EAAE;AACF,+EAA+E;AAC/E,4EAA4E;AAC5E,gFAAgF;AAChF,2EAA2E;AAC3E,iEAAiE;AACjE,+EAA+E;AAC/E,sCAAsC;AACtC,EAAE;AACF,wCAAwC;AACxC,iFAAiF;AACjF,+EAA+E;AAC/E,6EAA6E;AAC7E,8DAA8D;AAC9D,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,iFAAiF;AACjF,8EAA8E;AAC9E,8EAA8E;AAC9E,aAAa;AACb,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,yEAAyE;AACzE,+EAA+E;AAC/E,oDAAoD;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,yDAAy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AE,GAAG,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;IAC3C,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export interface PulumiResource {
|
|
2
|
+
/** Variable name the `new` expression is assigned to (if any). */
|
|
3
|
+
varName?: string;
|
|
4
|
+
/**
|
|
5
|
+
* Dotted class path as written in source: `aws.lambda.Function`,
|
|
6
|
+
* `gcp.cloudrun.Service`, `azure.storage.Account`, etc.
|
|
7
|
+
*/
|
|
8
|
+
resourceType: string;
|
|
9
|
+
/**
|
|
10
|
+
* Adapter-local node id: `resource:<resourceType>.<logicalName>`.
|
|
11
|
+
* Logical name = first string-literal argument to the constructor.
|
|
12
|
+
*/
|
|
13
|
+
refAddr: string;
|
|
14
|
+
/**
|
|
15
|
+
* Identifiers that appear as the object of a PropertyAccessExpression inside
|
|
16
|
+
* the constructor arguments (excluding the first logical-name arg).
|
|
17
|
+
* E.g. `bucket.bucket` → `bucket`; `queue.url` → `queue`.
|
|
18
|
+
*
|
|
19
|
+
* Using AST-level identifier extraction (not regex over raw text) prevents
|
|
20
|
+
* false matches from identifier substrings inside string literals
|
|
21
|
+
* (e.g. `topic` inside `{ name: 'topic-handler' }` is NOT extracted).
|
|
22
|
+
*
|
|
23
|
+
* This replaces the earlier `argsText` string field.
|
|
24
|
+
*/
|
|
25
|
+
referencedIdentifiers: string[];
|
|
26
|
+
/**
|
|
27
|
+
* raw text of the constructor args AFTER the first (logical-name)
|
|
28
|
+
* arg — i.e. the props object. Used ONLY for deterministic source-signal
|
|
29
|
+
* extraction (`image:`, `build.context`, `FileArchive(...)` paths), NEVER for
|
|
30
|
+
* edges (edges use {@link referencedIdentifiers} so string-literal content
|
|
31
|
+
* can't invent phantom edges). Empty string when there are no further args.
|
|
32
|
+
*/
|
|
33
|
+
argsText: string;
|
|
34
|
+
}
|
|
35
|
+
export interface PulumiProject {
|
|
36
|
+
name?: string;
|
|
37
|
+
runtime?: string;
|
|
38
|
+
}
|
|
39
|
+
/** First segment of a dotted type path: `aws.lambda.Function` → `aws`. */
|
|
40
|
+
export declare function providerOf(resourceType: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* Parse the minimal fields we care about from Pulumi.yaml.
|
|
43
|
+
* Tolerates missing or malformed YAML: always returns an object.
|
|
44
|
+
*/
|
|
45
|
+
export declare function parsePulumiProject(yamlText: string): PulumiProject;
|
|
46
|
+
/**
|
|
47
|
+
* Walk a TypeScript source file (in-memory) and collect every
|
|
48
|
+
* `new <Provider>.<Module>.<Class>(logicalName, args...)` call site.
|
|
49
|
+
*
|
|
50
|
+
* Matching criterion: the callee is a property-access chain (at least two
|
|
51
|
+
* segments) — `aws.lambda.Function`, `gcp.cloudrun.Service`, etc. We do NOT
|
|
52
|
+
* match single-segment constructors (e.g. `new MyClass(...)`) to avoid false
|
|
53
|
+
* positives from user-defined classes.
|
|
54
|
+
*
|
|
55
|
+
* Tolerates unparseable or empty source: returns an empty array rather than
|
|
56
|
+
* throwing (the calling layer also wraps in try/catch, but belt-and-suspenders
|
|
57
|
+
* here so unit tests can verify the non-throw contract directly).
|
|
58
|
+
*/
|
|
59
|
+
export declare function extractPulumiResources(sourceText: string, file: string): PulumiResource[];
|
|
60
|
+
//# sourceMappingURL=pulumi-parse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pulumi-parse.d.ts","sourceRoot":"","sources":["../../../src/infra/pulumi/pulumi-parse.ts"],"names":[],"mappings":"AAuBA,MAAM,WAAW,cAAc;IAC7B,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;;;;;OAUG;IACH,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAKD,0EAA0E;AAC1E,wBAAgB,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAGvD;AAKD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa,CAkBlE;AAKD;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,EAAE,CA0FzF"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
// Pulumi infra-extraction, pure parsing layer.
|
|
2
|
+
//
|
|
3
|
+
// Two entry points:
|
|
4
|
+
// extractPulumiResources(sourceText, file) — ts-morph AST walk over a
|
|
5
|
+
// TypeScript program file; finds NewExpression call sites for Pulumi SDK
|
|
6
|
+
// classes (e.g. `new aws.lambda.Function('name', {...})`).
|
|
7
|
+
// parsePulumiProject(yamlText) — YAML parse of Pulumi.yaml for the project
|
|
8
|
+
// name + runtime.
|
|
9
|
+
//
|
|
10
|
+
// Deliberately pure: no file I/O, no global state. The ts-morph Project is
|
|
11
|
+
// created with an in-memory filesystem per call so every test is isolated.
|
|
12
|
+
//
|
|
13
|
+
// TS-only note: Python/Go Pulumi programs require a separate AST walk
|
|
14
|
+
// (py-ast / go/parser) — deferred to Phase-5 multilingual work. When
|
|
15
|
+
// `runtime` in Pulumi.yaml is not `nodejs` / `typescript` / `typescript-v8`
|
|
16
|
+
// the calling code skips source extraction but does not crash.
|
|
17
|
+
import { Project, SyntaxKind } from 'ts-morph';
|
|
18
|
+
import { parse as parseYaml } from 'yaml';
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
// Helpers
|
|
21
|
+
/** First segment of a dotted type path: `aws.lambda.Function` → `aws`. */
|
|
22
|
+
export function providerOf(resourceType) {
|
|
23
|
+
const dot = resourceType.indexOf('.');
|
|
24
|
+
return dot > 0 ? resourceType.slice(0, dot) : resourceType.toLowerCase();
|
|
25
|
+
}
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
// YAML helper — Pulumi.yaml / Pulumi.<stack>.yaml
|
|
28
|
+
/**
|
|
29
|
+
* Parse the minimal fields we care about from Pulumi.yaml.
|
|
30
|
+
* Tolerates missing or malformed YAML: always returns an object.
|
|
31
|
+
*/
|
|
32
|
+
export function parsePulumiProject(yamlText) {
|
|
33
|
+
try {
|
|
34
|
+
const doc = parseYaml(yamlText);
|
|
35
|
+
if (!doc || typeof doc !== 'object')
|
|
36
|
+
return {};
|
|
37
|
+
const obj = doc;
|
|
38
|
+
const name = typeof obj['name'] === 'string' ? obj['name'] : undefined;
|
|
39
|
+
// runtime may be a plain string ("nodejs") or a dict ({ name: "nodejs" })
|
|
40
|
+
let runtime;
|
|
41
|
+
if (typeof obj['runtime'] === 'string') {
|
|
42
|
+
runtime = obj['runtime'];
|
|
43
|
+
}
|
|
44
|
+
else if (obj['runtime'] && typeof obj['runtime'] === 'object') {
|
|
45
|
+
const rt = obj['runtime'];
|
|
46
|
+
if (typeof rt['name'] === 'string')
|
|
47
|
+
runtime = rt['name'];
|
|
48
|
+
}
|
|
49
|
+
return { name, runtime };
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return {};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
// ts-morph extraction — TypeScript source files
|
|
57
|
+
/**
|
|
58
|
+
* Walk a TypeScript source file (in-memory) and collect every
|
|
59
|
+
* `new <Provider>.<Module>.<Class>(logicalName, args...)` call site.
|
|
60
|
+
*
|
|
61
|
+
* Matching criterion: the callee is a property-access chain (at least two
|
|
62
|
+
* segments) — `aws.lambda.Function`, `gcp.cloudrun.Service`, etc. We do NOT
|
|
63
|
+
* match single-segment constructors (e.g. `new MyClass(...)`) to avoid false
|
|
64
|
+
* positives from user-defined classes.
|
|
65
|
+
*
|
|
66
|
+
* Tolerates unparseable or empty source: returns an empty array rather than
|
|
67
|
+
* throwing (the calling layer also wraps in try/catch, but belt-and-suspenders
|
|
68
|
+
* here so unit tests can verify the non-throw contract directly).
|
|
69
|
+
*/
|
|
70
|
+
export function extractPulumiResources(sourceText, file) {
|
|
71
|
+
if (!sourceText || !sourceText.trim())
|
|
72
|
+
return [];
|
|
73
|
+
let project;
|
|
74
|
+
try {
|
|
75
|
+
project = new Project({ useInMemoryFileSystem: true });
|
|
76
|
+
project.createSourceFile(file, sourceText);
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
81
|
+
const resources = [];
|
|
82
|
+
for (const sourceFile of project.getSourceFiles()) {
|
|
83
|
+
const newExprs = sourceFile.getDescendantsOfKind(SyntaxKind.NewExpression);
|
|
84
|
+
let resourceIndex = 0;
|
|
85
|
+
for (const expr of newExprs) {
|
|
86
|
+
const callee = expr.getExpression();
|
|
87
|
+
// Only match property-access chains (Provider.Module.Class or Provider.Class)
|
|
88
|
+
if (callee.getKind() !== SyntaxKind.PropertyAccessExpression)
|
|
89
|
+
continue;
|
|
90
|
+
const resourceType = callee.getText();
|
|
91
|
+
// Must have at least one dot (two segments)
|
|
92
|
+
if (!resourceType.includes('.'))
|
|
93
|
+
continue;
|
|
94
|
+
// First arg: StringLiteral or NoSubstitutionTemplateLiteral give the Pulumi logical name.
|
|
95
|
+
const args = expr.getArguments();
|
|
96
|
+
if (args.length === 0)
|
|
97
|
+
continue;
|
|
98
|
+
const firstArg = args[0];
|
|
99
|
+
const firstArgKind = firstArg.getKind();
|
|
100
|
+
let logicalName;
|
|
101
|
+
if (firstArgKind === SyntaxKind.StringLiteral ||
|
|
102
|
+
firstArgKind === SyntaxKind.NoSubstitutionTemplateLiteral) {
|
|
103
|
+
// Strip surrounding quotes / backticks
|
|
104
|
+
logicalName = firstArg.getText().replace(/^['"`]|['"`]$/g, '');
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
// Non-literal first arg (template expression, variable, etc.) — use the
|
|
108
|
+
// resourceType's final segment + file + positional index as the logical
|
|
109
|
+
// name so distinct call sites of the same type get distinct refAddrs.
|
|
110
|
+
const lastDot = resourceType.lastIndexOf('.');
|
|
111
|
+
const typeSuffix = resourceType.slice(lastDot + 1).toLowerCase();
|
|
112
|
+
logicalName = `${typeSuffix}:${file}:${resourceIndex}`;
|
|
113
|
+
}
|
|
114
|
+
resourceIndex++;
|
|
115
|
+
const refAddr = `${resourceType}.${logicalName}`;
|
|
116
|
+
// Collect identifiers referenced as the *object* of PropertyAccessExpressions
|
|
117
|
+
// inside the constructor arguments (first arg excluded — it's the logical name).
|
|
118
|
+
// Walking AST nodes ensures string-literal content (e.g. `'topic-handler'`)
|
|
119
|
+
// is never scanned, eliminating phantom edges from name-substring matches.
|
|
120
|
+
const referencedIdentifiers = [];
|
|
121
|
+
const remainingArgs = args.slice(1);
|
|
122
|
+
for (const argNode of remainingArgs) {
|
|
123
|
+
for (const propAccess of argNode.getDescendantsOfKind(SyntaxKind.PropertyAccessExpression)) {
|
|
124
|
+
const obj = propAccess.getExpression();
|
|
125
|
+
if (obj.getKind() === SyntaxKind.Identifier) {
|
|
126
|
+
referencedIdentifiers.push(obj.getText());
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
// Also capture bare Identifier references that are not part of a PropertyAccess
|
|
130
|
+
// (e.g. spreading a resource object: `...bucket`)
|
|
131
|
+
for (const ident of argNode.getDescendantsOfKind(SyntaxKind.Identifier)) {
|
|
132
|
+
const identParent = ident.getParent();
|
|
133
|
+
// Only add if not already covered by the PropertyAccessExpression walk
|
|
134
|
+
// (i.e., not the object of a property access, and not the property name)
|
|
135
|
+
if (!identParent || identParent.getKind() !== SyntaxKind.PropertyAccessExpression) {
|
|
136
|
+
referencedIdentifiers.push(ident.getText());
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
// varName: check if this NewExpression is the init of a VariableDeclaration
|
|
141
|
+
let varName;
|
|
142
|
+
const parent = expr.getParent();
|
|
143
|
+
if (parent && parent.getKind() === SyntaxKind.VariableDeclaration) {
|
|
144
|
+
const nameNode = parent.getName?.();
|
|
145
|
+
if (nameNode)
|
|
146
|
+
varName = nameNode;
|
|
147
|
+
}
|
|
148
|
+
// raw props-args text for source-signal extraction (not edges).
|
|
149
|
+
const argsText = remainingArgs.map((a) => a.getText()).join(' ');
|
|
150
|
+
resources.push({ varName, resourceType, refAddr, referencedIdentifiers, argsText });
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return resources;
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=pulumi-parse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pulumi-parse.js","sourceRoot":"","sources":["../../../src/infra/pulumi/pulumi-parse.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,EAAE;AACF,oBAAoB;AACpB,wEAAwE;AACxE,6EAA6E;AAC7E,+DAA+D;AAC/D,6EAA6E;AAC7E,sBAAsB;AACtB,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAC3E,EAAE;AACF,sEAAsE;AACtE,qEAAqE;AACrE,4EAA4E;AAC5E,+DAA+D;AAE/D,OAAO,EAAE,OAAO,EAAE,UAAU,EAA8C,MAAM,UAAU,CAAC;AAC3F,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AA6C1C,8EAA8E;AAC9E,UAAU;AAEV,0EAA0E;AAC1E,MAAM,UAAU,UAAU,CAAC,YAAoB;IAC7C,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;AAC3E,CAAC;AAED,8EAA8E;AAC9E,kDAAkD;AAElD;;;GAGG;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,EAAE,CAAC,CAAC;oBAC9C,CAAC;gBACH,CAAC;YACH,CAAC;YAED,4EAA4E;YAC5E,IAAI,OAA2B,CAAC;YAChC,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;YAChC,IAAI,MAAM,IAAI,MAAM,CAAC,OAAO,EAAE,KAAK,UAAU,CAAC,mBAAmB,EAAE,CAAC;gBAClE,MAAM,QAAQ,GAAI,MAA4C,CAAC,OAAO,EAAE,EAAE,CAAC;gBAC3E,IAAI,QAAQ;oBAAE,OAAO,GAAG,QAAQ,CAAC;YACnC,CAAC;YAED,gEAAgE;YAChE,MAAM,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAEjE,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,CAAC,CAAC;QACtF,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { InfraAdapter, InfraGraph } from '../types.js';
|
|
2
|
+
import { type DockerfileIndex } from '../image-resolve.js';
|
|
3
|
+
import { type PulumiResource } from './pulumi-parse.js';
|
|
4
|
+
/**
|
|
5
|
+
* The repo-relative source roots a Pulumi resource deploys, from its props-args
|
|
6
|
+
* text. `dockerfileIndex` (when present) powers the image→source resolver. Pure.
|
|
7
|
+
*/
|
|
8
|
+
export declare function pulumiSourceRoots(resourceType: string, argsText: string, dockerfileIndex?: DockerfileIndex): string[];
|
|
9
|
+
/**
|
|
10
|
+
* Build an InfraGraph from already-extracted Pulumi resources.
|
|
11
|
+
* Separated from the FS walk for unit-testability.
|
|
12
|
+
*/
|
|
13
|
+
export declare function buildPulumiGraph({ resources, project, root, dockerfileIndex, }: {
|
|
14
|
+
resources: PulumiResource[];
|
|
15
|
+
project?: {
|
|
16
|
+
name?: string;
|
|
17
|
+
runtime?: string;
|
|
18
|
+
};
|
|
19
|
+
root: string;
|
|
20
|
+
dockerfileIndex?: DockerfileIndex;
|
|
21
|
+
}): InfraGraph;
|
|
22
|
+
export declare const pulumiAdapter: InfraAdapter;
|
|
23
|
+
//# sourceMappingURL=pulumi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pulumi.d.ts","sourceRoot":"","sources":["../../../src/infra/pulumi/pulumi.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,YAAY,EAAa,UAAU,EAAgC,MAAM,aAAa,CAAC;AAGrG,OAAO,EAAmD,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC5G,OAAO,EAA0D,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAkFhH;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,eAAe,CAAC,EAAE,eAAe,GAChC,MAAM,EAAE,CA0BV;AAoBD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,OAAO,EACP,IAAI,EACJ,eAAe,GAChB,EAAE;IACD,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC,GAAG,UAAU,CAkEb;AAKD,eAAO,MAAM,aAAa,EAAE,YAgD3B,CAAC"}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
// Pulumi InfraAdapter (v0, TypeScript programs only).
|
|
2
|
+
//
|
|
3
|
+
// Code-IaC counterpart to 's Terraform adapter. Sources:
|
|
4
|
+
// • Pulumi.yaml — project name + runtime
|
|
5
|
+
// • Pulumi.<stack>.yaml — stack config (read but not deeply parsed in v0)
|
|
6
|
+
// • *.ts program files — resource creation call sites (ts-morph)
|
|
7
|
+
//
|
|
8
|
+
// Approach mirrors Terraform exactly:
|
|
9
|
+
// 1. Emit one InfraNode per resource with a deterministic heuristic kind
|
|
10
|
+
// (`inferred` provenance) so a --no-llm run yields a usable topology.
|
|
11
|
+
// 2. Emit one ClassificationRef per resource so 's classifyResourceTypes()
|
|
12
|
+
// can upgrade each node to `llm-classified`. The `provider` key is
|
|
13
|
+
// `pulumi/<providerSegment>` (e.g. `pulumi/aws`) — this intentionally
|
|
14
|
+
// shares the classification CACHE with Terraform's open-ended resource
|
|
15
|
+
// space: `aws.lambda.Function` (Pulumi) and `aws_lambda_function` (TF)
|
|
16
|
+
// often resolve to the same cache row because normalises
|
|
17
|
+
// (provider, resourceType) pairs. The Terraform adapter uses `terraform/aws`
|
|
18
|
+
// and we use `pulumi/aws` — different provider strings, but dedupes
|
|
19
|
+
// across them in a single bulk call so same-kind resources get consistent
|
|
20
|
+
// InfraModuleKind labels globally.
|
|
21
|
+
// 3. Emit `calls` edges from cross-resource variable references: if resource
|
|
22
|
+
// A's referencedIdentifiers (AST-extracted from constructor args) contains
|
|
23
|
+
// resource B's varName, A→B is a structural dependency. `calls` is the
|
|
24
|
+
// honest verb (same reasoning as Terraform's HCL-ref edges — we don't know
|
|
25
|
+
// if it's a read or write without deeper analysis).
|
|
26
|
+
//
|
|
27
|
+
// Non-TS (Python/Go) deferral: when Pulumi.yaml declares `runtime: python` or
|
|
28
|
+
// `runtime: go`, v0 emits an empty but valid InfraGraph and logs a note. Phase-5
|
|
29
|
+
// multilingual work will add py-ast / go/parser walkers.
|
|
30
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
31
|
+
import { join, relative } from 'node:path';
|
|
32
|
+
import { findFiles } from '../walk.js';
|
|
33
|
+
import { buildDockerfileIndex, resolveImageToSourceRoots } from '../image-resolve.js';
|
|
34
|
+
import { extractPulumiResources, parsePulumiProject, providerOf } from './pulumi-parse.js';
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
// FS walk config
|
|
37
|
+
const PULUMI_SKIP_DIRS = ['node_modules', '.git', 'dist', '.wrangler', '.next', 'build', 'coverage', '.pulumi'];
|
|
38
|
+
/**
|
|
39
|
+
* Find every `*.ts` source file under repoDir (bounded recursive walk).
|
|
40
|
+
*
|
|
41
|
+
* Note (v0 known limitation): detect() only checks for Pulumi.yaml at the
|
|
42
|
+
* repo root, while extract() walks recursively for TS sources. In a monorepo
|
|
43
|
+
* where Pulumi projects live in subdirectories, detect() will miss them unless
|
|
44
|
+
* the caller passes the subdirectory directly. This coarse mismatch is
|
|
45
|
+
* acceptable at v0 and tracked for Phase-5 multilingual/monorepo work.
|
|
46
|
+
*/
|
|
47
|
+
function findPulumiFiles(repoDir) {
|
|
48
|
+
const tsFiles = findFiles(repoDir, (_abs, e) => e.name.endsWith('.ts') && !e.name.endsWith('.d.ts') && !e.name.endsWith('.test.ts'), { skipDirs: PULUMI_SKIP_DIRS, maxDepth: 8 });
|
|
49
|
+
return { tsFiles };
|
|
50
|
+
}
|
|
51
|
+
// ---------------------------------------------------------------------------
|
|
52
|
+
// Heuristic kind mapping (mirrors Terraform's KIND_RULES)
|
|
53
|
+
const KIND_RULES = [
|
|
54
|
+
// Compute / serverless (check before container — "Function", "CloudRun", "AppRunner", "Fargate", "EcsTask" are compute)
|
|
55
|
+
[/[Ll]ambda|[Ff]unction|[Cc]loud[Rr]un|[Cc]loud[Ff]unction|[Aa]pp[Rr]unner|[Ff]argate|[Ee]cs[Tt]ask/, 'worker'],
|
|
56
|
+
// Containers / machines (more generic; comes after the serverless check)
|
|
57
|
+
[/[Cc]ontainer[Ii]nstance|[Ee]cs[Ss]ervice|[Kk]ubernetes|[Dd]roplet|[Ff]ly[Mm]achine|[Cc]omputeInstance/, 'container'],
|
|
58
|
+
// Queues / pub-sub
|
|
59
|
+
[/[Qq]ueue|[Ss][Qq][Ss]|[Pp]ub[Ss]ub|[Kk]inesis|[Ee]vent[Bb]us|[Ee]vent[Gg]rid|[Kk]afka|[Tt]opic/, 'queue'],
|
|
60
|
+
// Persistent storage / databases
|
|
61
|
+
[/[Bb]ucket|[Dd]ynamo|[Rr]ds[Ii]nstance|[Dd]atabase|[Ss]torage[Aa]ccount|[Ss][Qq][Ll]|[Ss]panner|[Ff]irestore|[Bb]ig[Tt]able|[Rr]edis|[Ee]lasticache|[Tt]able|[Bb]lob/, 'datastore'],
|
|
62
|
+
// Secret / key management
|
|
63
|
+
[/[Ss]ecret|[Kk][Mm][Ss]|[Vv]ault|[Kk]ey[Vv]ault/, 'secret-store'],
|
|
64
|
+
// CDN
|
|
65
|
+
[/[Cc]loud[Ff]ront|[Cc][Dd][Nn]|[Ff]astly/, 'cdn'],
|
|
66
|
+
// Static sites
|
|
67
|
+
[/[Ss]tatic[Ss]ite|[Ss]tatic[Ww]eb/, 'static-site'],
|
|
68
|
+
];
|
|
69
|
+
function heuristicKind(resourceType) {
|
|
70
|
+
for (const [re, kind] of KIND_RULES)
|
|
71
|
+
if (re.test(resourceType))
|
|
72
|
+
return kind;
|
|
73
|
+
return 'datastore'; // least-bad fallback; same rationale as Terraform adapter
|
|
74
|
+
}
|
|
75
|
+
// ---------------------------------------------------------------------------
|
|
76
|
+
// source-root extraction (deterministic, no LLM).
|
|
77
|
+
//
|
|
78
|
+
// Pulumi asset/build paths are resolved relative to the program's CWD (the
|
|
79
|
+
// Pulumi.yaml dir = repoDir), so they're repo-root-relative — no per-file base
|
|
80
|
+
// needed. Two signals: DIRECT source (docker `build: { context }`,
|
|
81
|
+
// `FileArchive`/`FileAsset`/`AssetArchive("path")` code assets) and IMAGE refs
|
|
82
|
+
// (`image: "…"` → the resolver). Read off the props-args text; literal
|
|
83
|
+
// strings only (a `${…}` template is unresolvable → skipped, never guessed).
|
|
84
|
+
/** Normalize a repo-relative path: backslashes→/, collapse `.`/`./`, strip trailing `/`. */
|
|
85
|
+
function normalizeRoot(p) {
|
|
86
|
+
return p.replace(/\\/g, '/').replace(/^\.(?:\/|$)/, '').replace(/\/+$/, '');
|
|
87
|
+
}
|
|
88
|
+
/** The repo-relative directory of a repo-relative file path ('' = repo root). */
|
|
89
|
+
function dirOfPath(relPath) {
|
|
90
|
+
const n = normalizeRoot(relPath);
|
|
91
|
+
const i = n.lastIndexOf('/');
|
|
92
|
+
return i === -1 ? '' : n.slice(0, i);
|
|
93
|
+
}
|
|
94
|
+
/** An asset path → its source dir: a built artifact (.zip/.tar/.jar) → its dir; else the dir itself. */
|
|
95
|
+
function assetToDir(p) {
|
|
96
|
+
return /\.(zip|tar|tgz|tar\.gz|jar)$/i.test(p) ? dirOfPath(p) : normalizeRoot(p);
|
|
97
|
+
}
|
|
98
|
+
function literalValues(text, re) {
|
|
99
|
+
const out = [];
|
|
100
|
+
let m;
|
|
101
|
+
re.lastIndex = 0;
|
|
102
|
+
while ((m = re.exec(text)) !== null)
|
|
103
|
+
out.push(m[1]);
|
|
104
|
+
return out;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The repo-relative source roots a Pulumi resource deploys, from its props-args
|
|
108
|
+
* text. `dockerfileIndex` (when present) powers the image→source resolver. Pure.
|
|
109
|
+
*/
|
|
110
|
+
export function pulumiSourceRoots(resourceType, argsText, dockerfileIndex) {
|
|
111
|
+
if (!argsText)
|
|
112
|
+
return [];
|
|
113
|
+
const roots = new Set();
|
|
114
|
+
const addDir = (d) => {
|
|
115
|
+
if (d)
|
|
116
|
+
roots.add(d);
|
|
117
|
+
};
|
|
118
|
+
const isDocker = /docker/i.test(resourceType);
|
|
119
|
+
// (1) Direct source: FileArchive/FileAsset/AssetArchive("path") code assets.
|
|
120
|
+
for (const v of literalValues(argsText, /(?:FileArchive|FileAsset|AssetArchive)\s*\(\s*["'`]([^"'`$]+)["'`]/g)) {
|
|
121
|
+
addDir(assetToDir(v));
|
|
122
|
+
}
|
|
123
|
+
// docker build context.
|
|
124
|
+
if (isDocker) {
|
|
125
|
+
for (const v of literalValues(argsText, /context\s*:\s*["'`]([^"'`$]+)["'`]/g))
|
|
126
|
+
addDir(normalizeRoot(v));
|
|
127
|
+
}
|
|
128
|
+
// (2) Image refs → resolver (literal only; a `${…}` template is skipped by the
|
|
129
|
+
// [^"'`$] class which refuses to match across an interpolation marker).
|
|
130
|
+
if (dockerfileIndex) {
|
|
131
|
+
for (const v of literalValues(argsText, /\bimage\s*:\s*["'`]([^"'`$]+)["'`]/g)) {
|
|
132
|
+
for (const r of resolveImageToSourceRoots(v, dockerfileIndex))
|
|
133
|
+
roots.add(r);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return [...roots].sort();
|
|
137
|
+
}
|
|
138
|
+
// ---------------------------------------------------------------------------
|
|
139
|
+
// TS runtime detection
|
|
140
|
+
const TS_RUNTIMES = new Set(['nodejs', 'typescript', 'typescript-v8', 'ts-node']);
|
|
141
|
+
function isTypescriptRuntime(runtime) {
|
|
142
|
+
if (!runtime)
|
|
143
|
+
return true; // assume TS if unspecified (Pulumi.yaml omitted or v0 blank)
|
|
144
|
+
return TS_RUNTIMES.has(runtime.toLowerCase());
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Build an InfraGraph from already-extracted Pulumi resources.
|
|
148
|
+
* Separated from the FS walk for unit-testability.
|
|
149
|
+
*/
|
|
150
|
+
export function buildPulumiGraph({ resources, project, root, dockerfileIndex, }) {
|
|
151
|
+
const resolved = resources.map((r) => ({
|
|
152
|
+
pulumiRes: r,
|
|
153
|
+
nodeId: `resource:${r.refAddr}`,
|
|
154
|
+
}));
|
|
155
|
+
const nodes = [];
|
|
156
|
+
const classificationsNeeded = [];
|
|
157
|
+
for (const { pulumiRes, nodeId } of resolved) {
|
|
158
|
+
const provider = providerOf(pulumiRes.resourceType);
|
|
159
|
+
const kind = heuristicKind(pulumiRes.resourceType);
|
|
160
|
+
// deployment-target source roots (code assets + build context +
|
|
161
|
+
// image→resolver).
|
|
162
|
+
const roots = pulumiSourceRoots(pulumiRes.resourceType, pulumiRes.argsText, dockerfileIndex);
|
|
163
|
+
nodes.push({
|
|
164
|
+
id: nodeId,
|
|
165
|
+
label: `${pulumiRes.resourceType} (${pulumiRes.refAddr.split('.').pop() ?? ''})`,
|
|
166
|
+
kind,
|
|
167
|
+
provenance: 'inferred',
|
|
168
|
+
metadata: {
|
|
169
|
+
provider,
|
|
170
|
+
resourceType: pulumiRes.resourceType,
|
|
171
|
+
...(pulumiRes.varName ? { varName: pulumiRes.varName } : {}),
|
|
172
|
+
...(project?.name ? { pulumiProject: project.name } : {}),
|
|
173
|
+
},
|
|
174
|
+
...(roots.length ? { sourceRoots: roots } : {}),
|
|
175
|
+
});
|
|
176
|
+
classificationsNeeded.push({
|
|
177
|
+
provider: `pulumi/${provider}`,
|
|
178
|
+
resourceType: pulumiRes.resourceType,
|
|
179
|
+
forNodeId: nodeId,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
// Cross-resource edges: resource A's referencedIdentifiers (AST-extracted
|
|
183
|
+
// identifier names from constructor args, first arg stripped) contains
|
|
184
|
+
// resource B's varName.
|
|
185
|
+
//
|
|
186
|
+
// Performance: build a Map<varName, nodeId> once, then for each source do a
|
|
187
|
+
// plain Set/Map lookup per identifier — O(n·k) where k is average arg-refs,
|
|
188
|
+
// no regex compilation at all. This also eliminates the phantom-edge class
|
|
189
|
+
// entirely: string-literal content is never present in referencedIdentifiers
|
|
190
|
+
// (ts-morph Identifier walk does not descend into StringLiteral nodes), so
|
|
191
|
+
// a varName that appears only inside a name string (e.g. `topic` inside
|
|
192
|
+
// `{ name: 'topic-handler' }`) can never produce an edge.
|
|
193
|
+
const varToNodeId = new Map();
|
|
194
|
+
for (const { pulumiRes, nodeId } of resolved) {
|
|
195
|
+
if (pulumiRes.varName)
|
|
196
|
+
varToNodeId.set(pulumiRes.varName, nodeId);
|
|
197
|
+
}
|
|
198
|
+
const edges = [];
|
|
199
|
+
const seen = new Set();
|
|
200
|
+
for (const src of resolved) {
|
|
201
|
+
for (const identName of src.pulumiRes.referencedIdentifiers) {
|
|
202
|
+
const tgtNodeId = varToNodeId.get(identName);
|
|
203
|
+
if (!tgtNodeId || tgtNodeId === src.nodeId)
|
|
204
|
+
continue;
|
|
205
|
+
const key = `${src.nodeId}→${tgtNodeId}`;
|
|
206
|
+
if (seen.has(key))
|
|
207
|
+
continue;
|
|
208
|
+
seen.add(key);
|
|
209
|
+
edges.push({ source: src.nodeId, target: tgtNodeId, kind: 'calls', metadata: { via: 'pulumi-ref' } });
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return { root, adapter: 'pulumi', nodes, edges, classificationsNeeded };
|
|
213
|
+
}
|
|
214
|
+
// ---------------------------------------------------------------------------
|
|
215
|
+
// Adapter
|
|
216
|
+
export const pulumiAdapter = {
|
|
217
|
+
name: 'pulumi',
|
|
218
|
+
async detect(repoDir) {
|
|
219
|
+
return existsSync(join(repoDir, 'Pulumi.yaml'));
|
|
220
|
+
},
|
|
221
|
+
async extract(repoDir) {
|
|
222
|
+
// 1. Parse Pulumi.yaml (project root only — stack yamls are config, not topology)
|
|
223
|
+
const pulumiYamlPath = join(repoDir, 'Pulumi.yaml');
|
|
224
|
+
let project = {};
|
|
225
|
+
try {
|
|
226
|
+
project = parsePulumiProject(readFileSync(pulumiYamlPath, 'utf8'));
|
|
227
|
+
}
|
|
228
|
+
catch (err) {
|
|
229
|
+
console.warn(` [pulumi] could not read Pulumi.yaml: ${err.message}`);
|
|
230
|
+
}
|
|
231
|
+
// 2. Non-TS runtime → skip source extraction but emit valid empty graph
|
|
232
|
+
if (!isTypescriptRuntime(project.runtime)) {
|
|
233
|
+
console.warn(` [pulumi] runtime "${project.runtime}" is not TypeScript — source extraction deferred to Phase-5. ` +
|
|
234
|
+
`Emitting empty graph for project "${project.name ?? '(unknown)'}"`);
|
|
235
|
+
return { root: repoDir, adapter: 'pulumi', nodes: [], edges: [], classificationsNeeded: [] };
|
|
236
|
+
}
|
|
237
|
+
// 3. Walk TS files, extract resources
|
|
238
|
+
const { tsFiles } = findPulumiFiles(repoDir);
|
|
239
|
+
const allResources = [];
|
|
240
|
+
for (const file of tsFiles) {
|
|
241
|
+
try {
|
|
242
|
+
const text = readFileSync(file, 'utf8');
|
|
243
|
+
const found = extractPulumiResources(text, relative(repoDir, file));
|
|
244
|
+
allResources.push(...found);
|
|
245
|
+
}
|
|
246
|
+
catch (err) {
|
|
247
|
+
console.warn(` [pulumi] skipping unparseable ${relative(repoDir, file)}: ${err.message}`);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
// Dockerfile index for image-referencing resources (docker.Image,
|
|
251
|
+
// ECS/CloudRun image refs).
|
|
252
|
+
return buildPulumiGraph({
|
|
253
|
+
resources: allResources,
|
|
254
|
+
project,
|
|
255
|
+
root: repoDir,
|
|
256
|
+
dockerfileIndex: buildDockerfileIndex(repoDir),
|
|
257
|
+
});
|
|
258
|
+
},
|
|
259
|
+
};
|
|
260
|
+
//# sourceMappingURL=pulumi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pulumi.js","sourceRoot":"","sources":["../../../src/infra/pulumi/pulumi.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,EAAE;AACF,yDAAyD;AACzD,oDAAoD;AACpD,6EAA6E;AAC7E,qEAAqE;AACrE,EAAE;AACF,sCAAsC;AACtC,2EAA2E;AAC3E,2EAA2E;AAC3E,6EAA6E;AAC7E,wEAAwE;AACxE,2EAA2E;AAC3E,4EAA4E;AAC5E,4EAA4E;AAC5E,+DAA+D;AAC/D,kFAAkF;AAClF,0EAA0E;AAC1E,+EAA+E;AAC/E,wCAAwC;AACxC,+EAA+E;AAC/E,gFAAgF;AAChF,4EAA4E;AAC5E,gFAAgF;AAChF,yDAAyD;AACzD,EAAE;AACF,8EAA8E;AAC9E,iFAAiF;AACjF,yDAAyD;AAEzD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CA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AC,CAAC;IACL,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export type { WranglerTree as RailwayTree } from '../cloudflare/wrangler-parse.js';
|
|
2
|
+
export interface RailwayService {
|
|
3
|
+
/** Canonical service name (from config or inferred). */
|
|
4
|
+
name: string;
|
|
5
|
+
/** Builder / Nixpacks / Dockerfile / … */
|
|
6
|
+
builder?: string;
|
|
7
|
+
/** Explicit build command if declared. */
|
|
8
|
+
buildCommand?: string;
|
|
9
|
+
/** Explicit start command if declared. */
|
|
10
|
+
startCommand?: string;
|
|
11
|
+
/** Source directory (monorepo sub-path). */
|
|
12
|
+
source?: string;
|
|
13
|
+
/** Health-check path, if configured. */
|
|
14
|
+
healthcheck?: string;
|
|
15
|
+
/** Raw env declarations map (may contain ref templates). */
|
|
16
|
+
envVars?: Record<string, string>;
|
|
17
|
+
}
|
|
18
|
+
export interface RailwayConfig {
|
|
19
|
+
/** All services found. Single-service repos have exactly one entry. */
|
|
20
|
+
services: RailwayService[];
|
|
21
|
+
/** Project-level env declarations (from top-level `envVars`/`env` block). */
|
|
22
|
+
projectEnvVars?: Record<string, string>;
|
|
23
|
+
}
|
|
24
|
+
export interface EnvRef {
|
|
25
|
+
/** The referent name as it appears in the template (original casing). */
|
|
26
|
+
name: string;
|
|
27
|
+
/** Lowercased for comparison. */
|
|
28
|
+
nameLower: string;
|
|
29
|
+
/** True if this name matches a known Railway plugin. */
|
|
30
|
+
isPlugin: boolean;
|
|
31
|
+
/** The env var key being interpolated. */
|
|
32
|
+
varKey: string;
|
|
33
|
+
/** Original template string, e.g. `${{Postgres.DATABASE_URL}}`. */
|
|
34
|
+
raw: string;
|
|
35
|
+
}
|
|
36
|
+
/** Extract all `${{Name.VAR}}` references from a block of text. */
|
|
37
|
+
export declare function extractEnvRefs(text: string): EnvRef[];
|
|
38
|
+
/** Collect all env-var references from a config's services + project level. */
|
|
39
|
+
export declare function extractConfigRefs(config: RailwayConfig): EnvRef[];
|
|
40
|
+
/** Parse a railway.json or railway.toml (auto-detected by filename suffix). */
|
|
41
|
+
export declare function parseRailwayConfig(text: string, filename: string): RailwayConfig;
|
|
42
|
+
export interface NixpacksConfig {
|
|
43
|
+
buildCmd?: string;
|
|
44
|
+
startCmd?: string;
|
|
45
|
+
providers?: string[];
|
|
46
|
+
}
|
|
47
|
+
export declare function parseNixpacksConfig(text: string): NixpacksConfig;
|
|
48
|
+
export interface ProcfileEntry {
|
|
49
|
+
process: string;
|
|
50
|
+
command: string;
|
|
51
|
+
}
|
|
52
|
+
export declare function parseProcfile(text: string): ProcfileEntry[];
|
|
53
|
+
export declare function detectFramework(packageJsonText: string): string | undefined;
|
|
54
|
+
//# sourceMappingURL=railway-parse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"railway-parse.d.ts","sourceRoot":"","sources":["../../../src/infra/railway/railway-parse.ts"],"names":[],"mappings":"AA2BA,YAAY,EAAE,YAAY,IAAI,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAMnF,MAAM,WAAW,cAAc;IAC7B,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wCAAwC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,aAAa;IAC5B,uEAAuE;IACvE,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,6EAA6E;IAC7E,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC;AAOD,MAAM,WAAW,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