Skip to content
Merged
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
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
53 changes: 53 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
.PHONY: bump help

help:
@echo "Usage: make bump <version>"
@echo " make bump VERSION=<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
%:
@:
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Create an HTML file:
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/ruby-wasm-ui@0.8.3"></script>
<script src="https://unpkg.com/ruby-wasm-ui@0.9.0"></script>
<script defer type="text/ruby" src="app.rb"></script>
</head>
<body>
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion lib/ruby_wasm_ui/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module RubyWasmUi
VERSION = "0.8.3"
VERSION = "0.9.0"
end
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions packages/npm-packages/runtime/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/npm-packages/runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ruby-wasm-ui",
"version": "0.8.3",
"version": "0.9.0",
"description": "",
"main": "dist/ruby-wasm-ui.js",
"files": [
Expand Down
Loading