ruff
ruff copied to clipboard
Upload WASM packages for each release
I was interested in uploading the wasm to npm and could contribute a PR to add this.
What would the desired npm package name be? @astral-sh/ruff
?
Charlie created a new astral-sh
organisation.
I would call it @astral-sh/ruff-api
just to give us the option to publish the ruff binary to NPM in the future (we don't plan on doing this but you can never know).
What's important to me is that we very clearly mark the package as experimental. I suspect significant API changes to the linter API with the work of red-knot (multifile analysis).
@mattrunyon I suspect you need me to initialize an empty package to get started?
I don't think an empty package needs to be created.
The main question would be how does this get handled w/ your organization's versioning/changelog tool. It looks like the package version is not available to the Rust workspaces, but is updated in just the published files (I think via some internal tool?). Without knowing how to tell that tool to update the cargo file version field for ruff_wasm
, it could just be a step in the CI job that replaces the version (e.g. with sed
) before running wasm-pack
. The cargo version is used in the generated package.json
.
We use rooster for our release process and it can bump the version number for you.
All you need to do is to list the ruff_wasm/Cargo.toml
in the version_files
section
https://github.com/astral-sh/ruff/blob/49a5a9ccc2b6b8f69bb64f87d3a915aff47eb02a/pyproject.toml#L107-L113
I'm really interested in this. While working on ViperIDE for MicroPython ( https://viper-ide.org ) I integrated the mpy-cross
compiler using WebAssembly and it does report syntax errors. But it's not nearly as cool as ruff :)
Being able to install ruff as an NPM package would simplify things a lot.
I'm using CodeMirror 6 editor and bundling it with Rollup.
Just some feedback. It was really easy to integrate ruff, the Workspace API is simple and clear, bundling with Rollup works like a charm. Kudos to the ruff team!
If anyone needs a CodeMirror 6 linter, see https://github.com/vshymanskyy/ViperIDE/blob/main/src/editor.js#L203
The first version of the packages are up!
- Node.js: https://www.npmjs.com/package/@astral-sh/ruff-wasm-nodejs
- Bundler: https://www.npmjs.com/package/@astral-sh/ruff-wasm-bundler
- Web: https://www.npmjs.com/package/@astral-sh/ruff-wasm-web
Awesome, thank you