From 667e7d1c4e8cadf06d8f4940964ffbcdf3fa424a Mon Sep 17 00:00:00 2001 From: t0yohei Date: Mon, 15 Dec 2025 12:33:24 +0900 Subject: [PATCH 1/2] bump: update to v0.9.0 --- Makefile | 53 +++++++++++++++++++ README.md | 2 +- lib/ruby_wasm_ui/version.rb | 2 +- package-lock.json | 4 +- package.json | 2 +- .../npm-packages/runtime/package-lock.json | 4 +- packages/npm-packages/runtime/package.json | 2 +- 7 files changed, 61 insertions(+), 8 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..726c57a --- /dev/null +++ b/Makefile @@ -0,0 +1,53 @@ +.PHONY: bump help + +help: + @echo "Usage: make bump " + @echo " make bump VERSION=" + @echo "Example: make bump 0.9.0" + @echo "" + @echo "This command updates the version number in the following files:" + @echo " - lib/ruby_wasm_ui/version.rb" + @echo " - package.json" + @echo " - packages/npm-packages/runtime/package.json" + @echo " - README.md" + @echo " - package-lock.json (via npm install)" + @echo " - packages/npm-packages/runtime/package-lock.json (via npm install)" + +# Get version from position argument (if VERSION is not already set) +VERSION_ARG := $(word 2,$(MAKECMDGOALS)) +ifndef VERSION + ifneq ($(VERSION_ARG),) + VERSION := $(VERSION_ARG) + endif +endif + +bump: + @if [ -z "$(VERSION)" ]; then \ + echo "Error: VERSION is required. Usage: make bump 0.9.0"; \ + exit 1; \ + fi + @echo "Bumping version to $(VERSION)..." + @# Update lib/ruby_wasm_ui/version.rb + @sed -i '' 's/VERSION = ".*"/VERSION = "$(VERSION)"/' lib/ruby_wasm_ui/version.rb + @echo "✓ Updated lib/ruby_wasm_ui/version.rb" + @# Update root package.json + @sed -i '' 's/"version": ".*"/"version": "$(VERSION)"/' package.json + @echo "✓ Updated package.json" + @# Update packages/npm-packages/runtime/package.json + @sed -i '' 's/"version": ".*"/"version": "$(VERSION)"/' packages/npm-packages/runtime/package.json + @echo "✓ Updated packages/npm-packages/runtime/package.json" + @# Update README.md (unpkg.com URL) + @sed -i '' 's|unpkg.com/ruby-wasm-ui@[0-9.]*|unpkg.com/ruby-wasm-ui@$(VERSION)|' README.md + @echo "✓ Updated README.md" + @echo "" + @echo "Updating package-lock.json files..." + @npm install --package-lock-only + @echo "✓ Updated root package-lock.json" + @cd packages/npm-packages/runtime && npm install --package-lock-only && cd ../../.. + @echo "✓ Updated packages/npm-packages/runtime/package-lock.json" + @echo "" + @echo "Version bumped to $(VERSION) successfully!" + +# Prevent make from treating the version argument as a target +%: + @: diff --git a/README.md b/README.md index 4de4847..ffe7bf4 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Create an HTML file: - + diff --git a/lib/ruby_wasm_ui/version.rb b/lib/ruby_wasm_ui/version.rb index 1d71fb0..887d3f5 100644 --- a/lib/ruby_wasm_ui/version.rb +++ b/lib/ruby_wasm_ui/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module RubyWasmUi - VERSION = "0.8.3" + VERSION = "0.9.0" end diff --git a/package-lock.json b/package-lock.json index c0ebb6c..3274b45 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ruby-wasm-ui-project", - "version": "0.8.2", + "version": "0.9.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ruby-wasm-ui-project", - "version": "0.8.2", + "version": "0.9.0", "license": "MIT", "workspaces": [ "packages/*" diff --git a/package.json b/package.json index 57cf195..08ab3ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ruby-wasm-ui-project", - "version": "0.8.2", + "version": "0.9.0", "private": true, "description": "A project to ruby.wasm ui framework", "scripts": { diff --git a/packages/npm-packages/runtime/package-lock.json b/packages/npm-packages/runtime/package-lock.json index 761e1fa..10f2079 100644 --- a/packages/npm-packages/runtime/package-lock.json +++ b/packages/npm-packages/runtime/package-lock.json @@ -1,12 +1,12 @@ { "name": "ruby-wasm-ui", - "version": "0.8.3", + "version": "0.9.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ruby-wasm-ui", - "version": "0.8.3", + "version": "0.9.0", "license": "MIT", "devDependencies": { "@rollup/plugin-replace": "^6.0.2", diff --git a/packages/npm-packages/runtime/package.json b/packages/npm-packages/runtime/package.json index 5ac9ea1..f1d49e7 100644 --- a/packages/npm-packages/runtime/package.json +++ b/packages/npm-packages/runtime/package.json @@ -1,6 +1,6 @@ { "name": "ruby-wasm-ui", - "version": "0.8.3", + "version": "0.9.0", "description": "", "main": "dist/ruby-wasm-ui.js", "files": [ From 1821944e42011dc1c0c930095af10c6d18997c67 Mon Sep 17 00:00:00 2001 From: t0yohei Date: Mon, 15 Dec 2025 12:36:12 +0900 Subject: [PATCH 2/2] docs: Add command description on Readme --- Gemfile.lock | 2 +- README.md | 24 +++++++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index cdf5b22..b5762d4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - ruby_wasm_ui (0.8.3) + ruby_wasm_ui (0.9.0) js (~> 2.7) listen (~> 3.8) puma (~> 6.0) diff --git a/README.md b/README.md index ffe7bf4..3a4a419 100644 --- a/README.md +++ b/README.md @@ -112,20 +112,38 @@ bundle install ### Building Your Application -1. Build Ruby WASM: +1. Set up your project (first time only): ```bash -bundle exec rbwasm build --ruby-version 3.4 -o ruby.wasm +bundle exec ruby-wasm-ui setup ``` +This command will: +- Configure excluded gems for WASM build +- Build Ruby WASM file +- Update `.gitignore` +- Create initial `src/index.html` and `src/index.rb` files + 2. Pack your application files: ```bash -bundle exec rbwasm pack ruby.wasm --dir ./src::./src -o src.wasm +bundle exec ruby-wasm-ui pack ``` This command packs your Ruby files from the `./src` directory into the WASM file. +**Additional Commands:** + +- **Development server**: Start a development server with file watching and auto-build: + ```bash + bundle exec ruby-wasm-ui dev + ``` + +- **Rebuild Ruby WASM**: Rebuild the Ruby WASM file when you add new gems: + ```bash + bundle exec ruby-wasm-ui rebuild + ``` + ### Creating Your HTML File Create an HTML file in the `src` directory that loads the WASM file: