Skip to content

wesl-plugin wesl.toml schema diverges from wesl-spec (dependencies array vs. table) β€” breaks wgsl-analyzerΒ #198

Description

@andyinabox

Hi πŸ‘‹πŸ» -- human being here,

I'm starting to learn WESL/WGSL/WebGPU and running into some tooling issues on my machine. It seems like there's some divergence between the most recent wesl.toml spec and the one used by wesl-js. I'm just learning about this ecosystem so I'm having to use an LLM to troubleshoot, so apologies for the slop. Clanker-generated output below:


Problem

wesl-plugin reads wesl.toml with a schema that doesn't match the official wesl-spec/WeslToml.md. Two differences:

  • Top-level keys: wesl-plugin reads edition, root, and include at the top level, whereas the spec nests them under a [package] section.
  • dependencies: wesl-plugin (0.6.53 through the latest 0.6.75) expects an array of strings β€” ["random_wgsl"] or ["auto"] β€” whereas the spec expects a [dependencies] table, e.g. random_wgsl = {}.

Because the formats are incompatible (TOML can't express both an array and a table for the same key, and the section layout differs), a single wesl.toml cannot satisfy both wesl-plugin and wgsl-analyzer:

  • Array form β†’ builds with Vite, but wgsl-analyzer (v0.11.318) errors: Project discovery failed: ... invalid type: sequence, expected a map.
  • Spec table form β†’ wgsl-analyzer is happy, but vite build fails with [wesl-plugin] ... dep.replaceAll is not a function.

The relevant code (confirmed in 0.6.75):

const depsArray = Array.isArray(dependencies) ? dependencies : [dependencies ?? "auto"];
const sanitizedDeps = autoDeps.map((dep) => dep.replaceAll("/", "_")); // assumes string deps

What I'd like

wesl-plugin to accept the spec-compliant wesl.toml format ([package] section + [dependencies] table), ideally while still accepting the current array form for backwards compatibility, so the same manifest works across the JS tooling and wgsl-analyzer/wesl-rs.

Repro

wesl@0.7.4 + wesl-plugin@0.6.53, Vite 7, with:

edition = "unstable_2025"
include = [ "./shaders/**/*.wesl" ]
root = "./shaders"
dependencies = ["random_wgsl"]

shaders/app.wesl: import random_wgsl::pcg_2u_3f;

Companion issue filed on wgsl-analyzer for the editor-side symptom: wgsl-analyzer/wgsl-analyzer#1211.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Unprioritized

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions