build: change npm library from czv to czv-wasm

This commit is contained in:
rzmk 2024-06-20 18:14:39 -04:00
parent 55aa4457b8
commit bc05a9f46e
No known key found for this signature in database
7 changed files with 20 additions and 10 deletions

View file

@ -6,13 +6,13 @@ WebAssembly (JavaScript and TypeScript) library for [czv](https://github.com/rzm
- czv GitHub repository: <https://github.com/rzmk/czv>
- Rust: [crates.io/crates/czv](https://crates.io/crates/czv) ([source code](https://github.com/rzmk/czv/tree/main/czv))
- WebAssembly (JavaScript/TypeScript): [npmjs.com/package/czv](https://www.npmjs.com/package/czv) ([source code](https://github.com/rzmk/czv/tree/main/czv-wasm))
- WebAssembly (JavaScript/TypeScript): [npmjs.com/package/czv-wasm](https://www.npmjs.com/package/czv-wasm) ([source code](https://github.com/rzmk/czv/tree/main/czv-wasm))
- Python: [pypi.org/project/czv](https://pypi.org/project/czv/) ([source code](https://github.com/rzmk/czv/tree/main/czv-python))
## Installation and example
```bash
bun install czv
bun install czv-wasm
```
Or use `npm`, `pnpm`, or `yarn` instead of `bun`.
@ -60,3 +60,13 @@ wasm-pack test --firefox --release
```
You may replace `--firefox` with another browser such as `--chrome` and `--safari`.
### Publish package to npmjs.com
Getting a `Package name too similar to existing package csv` when trying to publish the package as `czv` so we publish the package as `czv-wasm`.
0. Build the `pkg` folder with `wasm-pack build --release --target web`.
1. Run `cd pkg`.
<!-- 1. Based on https://github.com/rustwasm/wasm-pack/issues/427#issuecomment-435966644, rename the `name` in `pkg/package.json` from `czv-wasm` to `czv`. -->
2. Run `npm pkg fix` as suggested.
3. Run `npm publish`.