diff --git a/Cargo.lock b/Cargo.lock index 3e1934f..4ed4393 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -25,7 +25,7 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "decodal" -version = "0.1.1" +version = "0.1.2" dependencies = [ "decodal-derive", "regex", @@ -33,14 +33,14 @@ dependencies = [ [[package]] name = "decodal-cli" -version = "0.1.1" +version = "0.1.2" dependencies = [ "decodal", ] [[package]] name = "decodal-derive" -version = "0.1.1" +version = "0.1.2" dependencies = [ "decodal", "proc-macro2", @@ -50,7 +50,7 @@ dependencies = [ [[package]] name = "decodal-wasm" -version = "0.1.1" +version = "0.1.2" dependencies = [ "decodal", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 4c451ea..d3b63c2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ members = [ resolver = "2" [workspace.package] -version = "0.1.1" +version = "0.1.2" edition = "2024" rust-version = "1.85" license = "MIT OR Apache-2.0" diff --git a/crates/decodal-cli/Cargo.toml b/crates/decodal-cli/Cargo.toml index d71f434..d74aef5 100644 --- a/crates/decodal-cli/Cargo.toml +++ b/crates/decodal-cli/Cargo.toml @@ -20,4 +20,4 @@ default = [] regex = ["decodal/regex"] [dependencies] -decodal = { version = "0.1.1", path = "../decodal-core" } +decodal = { version = "0.1.2", path = "../decodal-core" } diff --git a/crates/decodal-wasm/Cargo.toml b/crates/decodal-wasm/Cargo.toml index 98a0c71..f15b342 100644 --- a/crates/decodal-wasm/Cargo.toml +++ b/crates/decodal-wasm/Cargo.toml @@ -15,7 +15,7 @@ publish = false crate-type = ["cdylib", "rlib"] [dependencies] -decodal = { version = "0.1.1", path = "../decodal-core" } +decodal = { version = "0.1.2", path = "../decodal-core" } serde_json.workspace = true wasm-bindgen.workspace = true diff --git a/doc/manual/souce/development.md b/doc/manual/souce/development.md index 9d5f79a..ecd3a74 100644 --- a/doc/manual/souce/development.md +++ b/doc/manual/souce/development.md @@ -23,25 +23,32 @@ cargo run -q -p decodal-cli --features regex -- examples/regex/main.dcdl ## crates.io release The primary crates.io package is `decodal`, which contains the embeddable library. -`decodal-derive` provides optional derive macros for Rust struct integration. -Workspace support crates such as `decodal-cli` and `decodal-wasm` are not published for 0.1.0. +`decodal-derive` provides optional derive macros for Rust struct integration and is published only when the derive crate changes. +Workspace support crates such as `decodal-cli` and the Rust source crate `decodal-wasm` are not published to crates.io. +The generated WebAssembly package under `site/decodal-site/src/wasm/` is published to npm and JSR. The project is dual licensed as `MIT OR Apache-2.0`. ```sh -cargo publish -p decodal-derive cargo publish -p decodal ``` +Publish `decodal-derive` first only when that crate has a new version: + +```sh +cargo publish -p decodal-derive +``` + Before publishing, run: ```sh cargo fmt --check cargo test cargo check -p decodal --no-default-features -cargo publish -p decodal-derive --dry-run cargo publish -p decodal --dry-run ``` +If `decodal-derive` changed, also run `cargo publish -p decodal-derive --dry-run`. + ## Web site and playground The Astro documentation site and browser playground are kept in: @@ -85,6 +92,24 @@ site/decodal-site/src/wasm/ These generated files are committed so the site can be built without requiring every consumer to regenerate the wasm package first. +Publish the generated WebAssembly package from its package directory: + +```sh +cd site/decodal-site/src/wasm +npm publish +npx jsr publish +``` + +Run dry-runs first when preparing a release: + +```sh +npm pack --dry-run +npx jsr publish --dry-run +``` + +The npm package name is `decodal-wasm`. +The JSR package name is `@hare/decodal-wasm`. + The playground editor uses CodeMirror 6 with the generated Lezer parser in `src/lib/codemirror/decodal-parser.js`. The canonical grammar is documented in `doc/manual/souce/language/grammar.md`; regenerate the Lezer parser when that grammar or `editors/lezer-decodal/decodal.grammar` changes. The documentation build still uses the lightweight JavaScript fallback highlighter so Astro can render Markdown without initializing WASM at build time. diff --git a/site/decodal-site/src/wasm/decodal_wasm_bg.wasm b/site/decodal-site/src/wasm/decodal_wasm_bg.wasm index 8e76bca..c03a15e 100644 Binary files a/site/decodal-site/src/wasm/decodal_wasm_bg.wasm and b/site/decodal-site/src/wasm/decodal_wasm_bg.wasm differ diff --git a/site/decodal-site/src/wasm/jsr.json b/site/decodal-site/src/wasm/jsr.json new file mode 100644 index 0000000..f34d71b --- /dev/null +++ b/site/decodal-site/src/wasm/jsr.json @@ -0,0 +1,15 @@ +{ + "name": "@hare/decodal-wasm", + "version": "0.1.2", + "license": "MIT OR Apache-2.0", + "exports": "./decodal_wasm.js", + "publish": { + "include": [ + "README.md", + "decodal_wasm.js", + "decodal_wasm.d.ts", + "decodal_wasm_bg.wasm", + "package.json" + ] + } +} diff --git a/site/decodal-site/src/wasm/package.json b/site/decodal-site/src/wasm/package.json index ec5ba71..547be75 100644 --- a/site/decodal-site/src/wasm/package.json +++ b/site/decodal-site/src/wasm/package.json @@ -2,7 +2,7 @@ "name": "decodal-wasm", "type": "module", "description": "WebAssembly wrapper for evaluating Decodal in browser playgrounds.", - "version": "0.1.1", + "version": "0.1.2", "license": "MIT OR Apache-2.0", "repository": { "type": "git",