Skip to content

swamp model type describe shows no methods when model uses local imports #875

@bixu

Description

@bixu

Description

When an extension model uses local imports (companion .ts files in a subdirectory), swamp model type describe returns the type with globalArguments but an empty methods array. The bundler appears to not resolve the imports into the main model.

Steps to Reproduce

  1. Create a model with local imports:

    extensions/models/gcp_resourcemanager.ts          # main model, imports from ./gcp_resourcemanager/
    extensions/models/gcp_resourcemanager/client.ts    # GCP API client
    extensions/models/gcp_resourcemanager/methods.ts   # business logic (methods imported by main)
    extensions/models/gcp_resourcemanager/types.ts     # shared types
    
  2. Create a manifest:

    manifestVersion: 1
    name: "@hivemq/gcp/resourcemanager"
    version: 2026.03.25.1
    models:
      - gcp_resourcemanager.ts
  3. Run swamp model type describe @hivemq/gcp/resourcemanager --json

Expected: JSON includes methods array with all methods defined in the model.

Actual: JSON includes globalArguments and resources but methods is empty or missing.

Additional Context

  • swamp extension push --dry-run lists the companion files as separate model entries, suggesting the bundler treats them as independent models rather than imports of the main model
  • This works locally when .swamp/bundles/ has been populated by prior runs, but fails in fresh CI checkouts
  • The @hivemq/gcp/iam extension has the same structure and exhibits the same behavior in CI
  • Workaround: none found so far. swamp model type search, swamp extension fmt, and swamp extension push --dry-run all fail to produce a working bundle

Environment

  • swamp: installed via brew install systeminit/tap/swamp in CI (latest)
  • OS: Ubuntu 24.04 (GitHub Actions runner)
  • Deno: v2.x

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinglifecycle/implementingImplementation is in progress

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions