.DEFAULT_GOAL := build
VERSION := $(shell cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | select(.name=="lindera-wasm") | .version')
default:
@echo $(MAKEFILE_LIST)
clean:
cargo clean
rm -rf pkg
format:
cargo fmt
lint:
cargo clippy --features=cjk
test:
wasm-pack test --node
build:
wasm-pack build --release --features=cjk --target=bundler
publish:
wasm-pack publish --access=public --target=bundler
build_example:
jq '.version = "$(VERSION)"' ./example/package.json > ./example/temp.json && mv ./example/temp.json ./example/package.json
cd example && npm install && npm run build && cp index.html dist/index.html
run_example:
cd example && npm run start
tag:
git tag v$(VERSION)
git push origin v$(VERSION)
help:
@echo "Available targets:"
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-15s %s\n", $$1, $$2}'