Skip to content

Commit dbd5312

Browse files
[skip ci] Add instructions for adding support for a new Ruby version
1 parent 4f9aef8 commit dbd5312

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

CONTRIBUTING.md

+40
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,43 @@ $ npm install --save @ruby/wasm-wasi@next
131131
# or you can specify the exact snapshot version
132132
$ npm install --save @ruby/wasm-wasi@2.7.0-2024-11-11-a
133133
```
134+
135+
136+
## Adding Support for a New Ruby Version
137+
138+
When a new version of Ruby is released, the following steps need to be taken to add support for it in ruby.wasm:
139+
140+
1. Update `lib/ruby_wasm/cli.rb`:
141+
- Add a new entry in the `build_source_aliases` method for the new version
142+
- Specify the tarball URL and required default extensions
143+
144+
2. Update `Rakefile`:
145+
- Add the new version to `BUILD_SOURCES`
146+
- Add a new entry in `NPM_PACKAGES` for the new version
147+
148+
3. Create a new npm package:
149+
```console
150+
# Copy from head package
151+
$ cp -r packages/npm-packages/ruby-head-wasm-wasi packages/npm-packages/ruby-NEW.VERSION-wasm-wasi
152+
153+
# Update version references
154+
# - In package.json: Update name, version, and description
155+
# - In README.md: Update version references
156+
```
157+
Note: Most of the package contents can be reused from the head package as is, since the JavaScript API and build configuration remain the same across versions.
158+
159+
4. Update `package-lock.json` by `npm install`
160+
161+
4. Update documentation:
162+
- Update version references in `README.md`
163+
- Update examples in `docs/cheat_sheet.md`
164+
- Update the package list in `packages/npm-packages/ruby-wasm-wasi/README.md`
165+
166+
5. Test the build:
167+
```console
168+
$ rake build:NEW.VERSION-wasm32-unknown-wasip1-full
169+
$ rake npm:ruby-NEW.VERSION-wasm-wasi:build
170+
$ rake npm:ruby-NEW.VERSION-wasm-wasi:check
171+
```
172+
173+
6. Create a pull request with all the changes

0 commit comments

Comments
 (0)