forked from wasmerio/wasmer-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwasm_transformer_build.sh
executable file
·91 lines (70 loc) · 2.5 KB
/
wasm_transformer_build.sh
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
84
85
86
87
88
89
90
#!/bin/bash
set -e
echo " "
echo "============================================="
echo "Running Formatter"
echo "============================================="
echo " "
cargo fmt --all
echo " "
echo "============================================="
echo "Running Clippy"
echo "============================================="
echo " "
cargo clippy
echo " "
echo "============================================="
echo "Running Tests"
echo "============================================="
echo " "
cargo test -- --nocapture
echo " "
echo "============================================="
echo "Compiling Wasm for web"
echo "============================================="
echo " "
wasm-pack build --target web
npx json -I -f pkg/package.json -e 'this.name="@wasmer/wasm-transformer"'
npx json -I -f pkg/package.json -e 'this.publishConfig={"access": "public"}'
echo " "
echo "============================================="
echo "Moving pkg to wasm-transformer"
echo "============================================="
echo " "
cp -r pkg/ ../../packages/wasm-transformer/wasm-pack/web
rm ../../packages/wasm-transformer/wasm-pack/web/.gitignore || true
echo " "
echo "============================================="
echo "Compiling Wasm for node"
echo "============================================="
echo " "
wasm-pack build --target nodejs
npx json -I -f pkg/package.json -e 'this.name="@wasmer/wasm-transformer"'
npx json -I -f pkg/package.json -e 'this.publishConfig={"access": "public"}'
echo " "
echo "============================================="
echo "Moving pkg to wasm-transformer"
echo "============================================="
echo " "
cp -r pkg/ ../../packages/wasm-transformer/wasm-pack/node
rm ../../packages/wasm-transformer/wasm-pack/node/.gitignore || true
echo " "
echo "============================================="
echo "Compiling Wasm for bundler"
echo "============================================="
echo " "
wasm-pack build --target bundler
npx json -I -f pkg/package.json -e 'this.name="@wasmer/wasm-transformer"'
npx json -I -f pkg/package.json -e 'this.publishConfig={"access": "public"}'
echo " "
echo "============================================="
echo "Moving pkg to wasm-transformer"
echo "============================================="
echo " "
cp -r pkg/ ../../packages/wasm-transformer/wasm-pack/bundler
rm ../../packages/wasm-transformer/wasm-pack/bundler/.gitignore || true
echo " "
echo "============================================="
echo "Done!"
echo "============================================="
echo " "