wash icon indicating copy to clipboard operation
wash copied to clipboard

[FEATURE] Finding the intended wit world

Open ricochet opened this issue 4 months ago • 1 comments

I built the examples in wasmcloud/go with beta.4.

For most of these examples, we have only one world defined in the project's wit package.

We should be able to determine the desired world automatically and set it accordingly. I think it's still helpful to output a similar message that we have to provide config in this project as the tooling does not have an equivalent language specfic project definition to reference (perhaps also with a doc link or is that too much?).

wash build
TinyGo builds require wit_world to be specified in the configuration. A config file has been created at ./.wash/config.json with a placeholder. Please update the wit_world field to match your WIT world name.
{
  "build": {
    "tinygo": {
      "target": "wasip2",
      "build_flags": [],
      "disable_go_generate": false,
      "scheduler": "asyncify",
      "gc": "conservative",
      "wit_world": "PLACEHOLDER_WIT_WORLD"
    },
    "artifact_path": "build/output.wasm"
  },
  "templates": [
    {
      "name": "cosmonic-control-welcome-tour",
      "description": "Welcome to Cosmonic!",
      "repository": "https://github.com/cosmonic-labs/control-demos",
      "subfolder": "welcome-tour",
      "ref": "welcome-tour",
      "language": "TypeScript"
    },
    {
      "name": "sample-wasi-http-rust",
      "description": "An example wasi:http server component written in Rust",
      "repository": "https://github.com/bytecodealliance/sample-wasi-http-rust",
      "subfolder": null,
      "ref": null,
      "language": "Rust"
    },
    {
      "name": "sample-wasi-http-js",
      "description": "An example wasi:http server component written in JavaScript",
      "repository": "https://github.com/bytecodealliance/sample-wasi-http-js",
      "subfolder": null,
      "ref": null,
      "language": "TypeScript"
    },
    {
      "name": "http-hello-world",
      "description": "A simple HTTP hello world component",
      "repository": "https://github.com/wasmcloud/wasmcloud",
      "subfolder": "examples/rust/components/http-hello-world",
      "ref": null,
      "language": "Rust"
    },
    {
      "name": "http-hello-world",
      "description": "A simple HTTP hello world component",
      "repository": "https://github.com/wasmcloud/wasmcloud",
      "subfolder": "examples/tinygo/components/http-hello-world",
      "ref": null,
      "language": "TinyGo"
    },
    {
      "name": "http-hello-world",
      "description": "A simple HTTP hello world component",
      "repository": "https://github.com/wasmcloud/wasmcloud",
      "subfolder": "examples/typescript/components/http-hello-world",
      "ref": null,
      "language": "TypeScript"
    }
  ],
  "wit": {
    "registries": [],
    "skip_fetch": false,
    "wit_dir": null, // fill this in by default with top level wit dir
    // set wit_world here as well
    "sources": {}
  }
}

ricochet avatar Aug 28 '25 14:08 ricochet