convex-rust 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/dist/cli/bin.js +2 -2
- package/package.json +10 -1
package/README.md
CHANGED
|
@@ -9,7 +9,8 @@ Spec: `contracts/V8HOST.md` (guest ABI: `contracts/ABI.md`, manifest: `contracts
|
|
|
9
9
|
|
|
10
10
|
## Quickstart
|
|
11
11
|
|
|
12
|
-
In an existing Convex project (`npx convex dev` has been run once,
|
|
12
|
+
In an existing, configured Convex project (`npx convex dev` has been run once, which creates/links the deployment and
|
|
13
|
+
`convex/_generated`; or, for CI / deploy-key users, `CONVEX_DEPLOY_KEY` is set in the environment),
|
|
13
14
|
with [rustup](https://rustup.rs) installed:
|
|
14
15
|
|
|
15
16
|
```sh
|
|
@@ -27,7 +28,8 @@ comes from that file; if toolchain or target is missing `build` shows the exact
|
|
|
27
28
|
asks `Run ... now? (Y/n)` (never silently; with no TTY it just fails with the command).
|
|
28
29
|
`npx convex-rust doctor` checks cargo, rustup, toolchain + target, the shipped `convex_fn` crate and `wasm-opt`.
|
|
29
30
|
`wasm-opt` (binaryen, `brew install binaryen`) is optional: it makes release wasm about 30% smaller (`-O3`).
|
|
30
|
-
|
|
31
|
+
The first `build` downloads the crates (and, only if a dependency compiles C code, the ~180 MB wasi-sdk), so it can take a
|
|
32
|
+
few minutes; later builds take seconds. Wasm SIMD is on by default (`--no-simd` to opt out). Instance reuse, `CONVEX_RUST_TRACE` and build flags: docs/rust/cloud.md.
|
|
31
33
|
|
|
32
34
|
The scaffolded crate depends on `convex_fn` by path into `node_modules/convex-rust/rust/convex_fn` (shipped in this
|
|
33
35
|
package; nothing is fetched from crates.io for it). Commit `convex/rust/Cargo.lock`, `src/_generated/api.rs` and
|
|
@@ -124,6 +126,14 @@ surfaces as `Uncaught Error: <panic message> at file:line`.
|
|
|
124
126
|
|
|
125
127
|
See `docs/rust/cloud.md` for the full guide.
|
|
126
128
|
|
|
129
|
+
## Troubleshooting
|
|
130
|
+
|
|
131
|
+
- `ExperimentalWarning: localStorage is not available because --localstorage-file was not provided` on every `convex`
|
|
132
|
+
command comes from the stock `convex` CLI on newer Node (webstorage) and is harmless. Silence it with
|
|
133
|
+
`NODE_OPTIONS=--no-experimental-webstorage`.
|
|
134
|
+
- npm 11 `install-scripts ... esbuild ... not yet covered by allowScripts` comes from `convex`'s own esbuild dependency and
|
|
135
|
+
is harmless (its postinstall is only an optimization). To silence it: `npm install-scripts approve esbuild`.
|
|
136
|
+
|
|
127
137
|
## Limitations
|
|
128
138
|
|
|
129
139
|
- Convex default-runtime limits apply (30 minute actions, 64 MiB RAM documented, code size per the [limits page](https://docs.convex.dev/production/state/limits), actions only, no `"use node"`).
|
package/dist/cli/bin.js
CHANGED
|
@@ -164,8 +164,8 @@ async function main(argv) {
|
|
|
164
164
|
console.error([
|
|
165
165
|
"",
|
|
166
166
|
"Next:",
|
|
167
|
-
" npx convex-rust build # compiles the crate (first build downloads crates
|
|
168
|
-
" npx convex dev --once # pushes it (or: npx convex deploy). Needs a configured project: run `npx convex dev` once
|
|
167
|
+
" npx convex-rust build # compiles the crate, writes the wasm + TS wrappers (the first build downloads crates and can take a few minutes; later builds take seconds)",
|
|
168
|
+
" npx convex dev --once # pushes it (or: npx convex deploy). Needs a configured Convex project: run `npx convex dev` once (creates/links one), or set CONVEX_DEPLOY_KEY (CI).",
|
|
169
169
|
` npx convex run rust/example:greet '{"name":"you"}'`,
|
|
170
170
|
"",
|
|
171
171
|
`While editing Rust, run \`npx convex-rust dev\` next to \`npx convex dev\`. Commit ${rel}/Cargo.lock and ${rel}/src/_generated/api.rs.`,
|
package/package.json
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "convex-rust",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "\"use rust\" for stock Convex: write Convex actions in Rust, compiled to wasm and hosted inside a normal Convex action (cloud or self-hosted).",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/toomingos/convex-rust.git",
|
|
9
|
+
"directory": "packages/convex-rust"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/toomingos/convex-rust/tree/main/packages/convex-rust#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/toomingos/convex-rust/issues"
|
|
14
|
+
},
|
|
6
15
|
"keywords": [
|
|
7
16
|
"convex",
|
|
8
17
|
"rust",
|