Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload WASM packages for each release #1385

Closed
charliermarsh opened this issue Dec 26, 2022 · 8 comments · Fixed by #12317
Closed

Upload WASM packages for each release #1385

charliermarsh opened this issue Dec 26, 2022 · 8 comments · Fixed by #12317
Labels
playground A playground-specific issue

Comments

@charliermarsh
Copy link
Member

No description provided.

@charliermarsh charliermarsh added the playground A playground-specific issue label Dec 26, 2022
@mattrunyon
Copy link
Contributor

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?

@MichaReiser
Copy link
Member

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?

@mattrunyon
Copy link
Contributor

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.

@MichaReiser
Copy link
Member

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

ruff/pyproject.toml

Lines 107 to 113 in 49a5a9c

version_files = [
"README.md",
"docs/integrations.md",
"crates/ruff/Cargo.toml",
"crates/ruff_linter/Cargo.toml",
"scripts/benchmarks/pyproject.toml",
]

@vshymanskyy
Copy link

vshymanskyy commented Jul 12, 2024

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.

@vshymanskyy
Copy link

vshymanskyy commented Jul 13, 2024

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

image

@dhruvmanila
Copy link
Member

The first version of the packages are up!

@vshymanskyy
Copy link

Awesome, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
playground A playground-specific issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants