Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions packages/core/core-wasm/pkg/core_wasm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,16 +254,6 @@ export interface InitOutput {
readonly server_on_error: (a: number, b: any) => any;
readonly server_sign_in: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => any;
readonly server_sign_in_anonymous: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;
readonly wasm_bindgen__convert__closures_____invoke__h329e9bd1f6ebd81c: (a: number, b: number, c: any) => [number, number];
readonly wasm_bindgen__convert__closures_____invoke__hc618b3d57c150041: (a: number, b: number, c: any) => [number, number];
readonly wasm_bindgen__convert__closures_____invoke__h40e10e1132bc43bd: (a: number, b: number, c: any, d: any) => void;
readonly wasm_bindgen__convert__closures_____invoke__h17c8cfd1267240e9: (a: number, b: number, c: any) => void;
readonly wasm_bindgen__convert__closures_____invoke__h38a7baa7ae265ab7: (a: number, b: number, c: any) => void;
readonly wasm_bindgen__convert__closures_____invoke__h17c8cfd1267240e9_3: (a: number, b: number, c: any) => void;
readonly wasm_bindgen__convert__closures_____invoke__h17c8cfd1267240e9_5: (a: number, b: number, c: any) => void;
readonly wasm_bindgen__convert__closures_____invoke__h54442ea4986df817: (a: number, b: number) => void;
readonly wasm_bindgen__convert__closures_____invoke__h825215c0288dbb8b: (a: number, b: number) => void;
readonly wasm_bindgen__convert__closures_____invoke__h94dacc021d8dd016: (a: number, b: number) => void;
readonly __wbindgen_malloc: (a: number, b: number) => number;
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
readonly __wbindgen_exn_store: (a: number) => void;
Expand Down
14 changes: 14 additions & 0 deletions packages/core/core-wasm/postbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import fs from "node:fs"
import path from "node:path"

const pkg = path.join(import.meta.dirname, "pkg")

fs.rmSync(path.join(pkg, ".gitignore"))

// The closure shims in InitOutput are named after mangled Rust symbols, so they
// change with the toolchain even when the API doesn't. Nothing in TS calls them,
// and dropping them keeps the committed d.ts the same on every machine.
const dts = path.join(pkg, "core_wasm.d.ts")
const source = fs.readFileSync(dts, "utf8")

fs.writeFileSync(dts, source.replace(/^ *readonly \w*convert__closures\w*: .*\n/gm, ""))
4 changes: 0 additions & 4 deletions packages/core/core-wasm/rm-generated-gitignore.js

This file was deleted.

4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
},
"scripts": {
"build": "wasm-pack build core-wasm --target web && node ./core-wasm/rm-generated-gitignore.js",
"dev": "cargo watch -i core-wasm/pkg -s 'wasm-pack build core-wasm --target web'"
"build": "wasm-pack build core-wasm --target web && node ./core-wasm/postbuild.js",
"dev": "cargo watch -i core-wasm/pkg -s 'wasm-pack build core-wasm --target web && node ./core-wasm/postbuild.js'"
}
}
Loading