1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
The library crate, the CLI crate and its prebuilt binaries, the WASM/npm package,
and docs.rs. Run from a clean `main` with green CI. Keep all versions in lock-step
(`Cargo.toml`, `cli/Cargo.toml`, `wasm/Cargo.toml`).
```sh
cargo test --workspace --all-features
cargo clippy --workspace --all-features --all-targets -- -D warnings
cargo fmt --all -- --check
cargo +1.88.0 check --no-default-features --features json,serde,query,markdown,std,derive # MSRV
cargo doc --no-deps --all-features # docs build
cargo publish --dry-run # packaging
```
Bump the version in `Cargo.toml` and move the `CHANGELOG.md` "unreleased"
section under the new version. Commit, then tag:
```sh
git tag v0.5.0 && git push origin main --tags
```
```sh
cargo login # paste a token from https://crates.io/me
cargo publish -p domq-derive # the derive macro first (the library's `derive` feature needs it)…
cargo publish -p domq # …then the library…
cargo publish -p domq-cli # …then the CLI, which depends on it
```
Pushing the `v*` tag runs `.github/workflows/release.yml`, which attaches
prebuilt `domq` binaries and `SHA256SUMS` to the GitHub release (and
`cargo binstall domq-cli` picks them up).
docs.rs builds automatically from the published crate (config is already in
`Cargo.toml` under `[package.metadata.docs.rs]`, building all features).
**Automated:** pushing a `v*` tag runs the `npm` job in
`.github/workflows/release.yml`, which builds, smoke-tests and publishes with
npm *trusted publishing* (OIDC, with provenance) — no token in the repo. One-time
setup: npmjs.com → `domq` → Settings → Trusted publishing → GitHub
Actions, repository `iamsaquib8/domq`, workflow `release.yml`,
environment `npm`. The manual steps below are the fallback.
The npm version comes from `wasm/Cargo.toml`; bump it there. The
package is one `--target web` build plus a small Node entry point
(`npm/node.js`) and an `"exports"` map that `npm/finish.mjs` adds. Don't build
with `--target nodejs` or `bundler`: the one package serves every runtime.
```sh
cd wasm
wasm-pack build --target web --release
node npm/finish.mjs # Node entry point + "exports" in pkg/package.json
wasm-pack test --node # binding tests
sh npm/smoke-test.sh # npm-pack pkg/, install it, run tests/node.mjs
The npm package is `domq-wasm`, like the crate. npm refuses plain `domq` as too
similar to an existing package (`dom-q`). Up to 0.3.0 it was published as
`dom-tree-wasm`, which is now deprecated in favour of `domq-wasm`.
The playground (<https://iamsaquib8.github.io/domq/>) redeploys by
itself on pushes to `main` that touch `src/`, `wasm/` or `playground/`
(`.github/workflows/pages.yml`). It needs a one-time setting: Settings → Pages
→ Build and deployment → Source: **GitHub Actions**.
- --