Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,27 @@ E.g. to lint a file called `openapi.json` using the "API" ruleset run:
```bash
spectral lint -r https://raw.githubusercontent.com/SchwarzIT/api-linter-rules/main/spectral-api.yml openapi.json
```

## WebAssembly (WASM) Linter

This project also provides a WebAssembly component for linting, targeting the WebAssembly Component Model.

### Build

To build the WASM component, run:

```bash
pnpm run build:wasm
```

This will build the native packages and generate `wasm/dist/spectral.wasm`.

### Test

To run the WASM-specific tests (including local wasmtime verification):

```bash
pnpm run test:wasm
```

For more details on the WASM architecture and implementation, see [wasm/GEMINI.md](./wasm/GEMINI.md).
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"license": "Apache-2.0",
"scripts": {
"build": "pnpm run -r build",
"build:wasm": "pnpm run build && vite build -c wasm/vite.config.ts && mkdir -p wasm/dist && mv dist/spectral-lint.js wasm/dist/ && jco componentize wasm/dist/spectral-lint.js --wit wasm/wit/spectral-linter.wit -n spectral-linter -o wasm/dist/spectral.wasm --disable all --enable random --enable clocks --enable stdio",
"test": "pnpm run -r test --run",
"test:wasm": "pnpm run build:wasm && vitest wasm/test/ --run",
"lint": "pnpm prettier --check .",
"format": "pnpm prettier --write ."
},
Expand All @@ -17,8 +19,12 @@
"@stoplight/spectral-rulesets": "1.22.0"
},
"devDependencies": {
"@bytecodealliance/componentize-js": "^0.19.3",
"@bytecodealliance/jco": "^1.17.0",
"@bytecodealliance/preview2-shim": "^0.17.8",
"@stoplight/spectral-core": "1.21.0",
"prettier": "3.8.1",
"testcontainers": "^11.12.0",
"typescript": "5.9.3",
"vite": "7.3.1",
"vitest": "^4.0.16"
Expand Down
Loading