Skip to content

Commit

Permalink
Rename wasm dependency in telegram build
Browse files Browse the repository at this point in the history
  • Loading branch information
printfn committed Dec 7, 2024
1 parent 2c77442 commit 0299e07
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
6 changes: 2 additions & 4 deletions telegram-bot/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
set -euo pipefail
cd "$(dirname "$0")"

(cd ../wasm && wasm-pack build --out-dir pkg-nodejs)
echo "Renaming package to 'fend-wasm-nodejs'..."
jq "setpath([\"name\"]; \"fend-wasm-nodejs\")" ../wasm/pkg-nodejs/package.json >temp
mv temp ../wasm/pkg-nodejs/package.json
rm -rfv ../wasm/pkg
(cd ../wasm && wasm-pack build)

npm install
npm exec tsc
Expand Down
2 changes: 1 addition & 1 deletion telegram-bot/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as fend from 'fend-wasm-nodejs';
import * as fend from 'fend-wasm';

const two = fend.evaluateFendWithTimeout('1+1', 500);
if (two !== '2') {
Expand Down
10 changes: 5 additions & 5 deletions telegram-bot/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion telegram-bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"homepage": "https://github.com/printfn/fend#readme",
"dependencies": {
"fend-wasm-nodejs": "file:../wasm/pkg-nodejs"
"fend-wasm": "file:../wasm/pkg"
},
"devDependencies": {
"@types/node": "^22.10.1",
Expand Down

0 comments on commit 0299e07

Please sign in to comment.