Skip to content

Commit

Permalink
Move to src dir since everything should be in src dir
Browse files Browse the repository at this point in the history
  • Loading branch information
bbckr committed Sep 13, 2024
1 parent c6206de commit dadb165
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
10 changes: 6 additions & 4 deletions packages/node-hcl/scripts/go-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
# Copyright SeatGeek
# Licensed under the terms of the Apache-2.0 license. See LICENSE file in project root for terms.
#
wasm_dir="src/wasm"
echo "Copying wasm_exec.js from GOROOT"
cp -rf "$(go env GOROOT)/misc/wasm/wasm_exec.js" wasm/
cp -rf "$(go env GOROOT)/misc/wasm/wasm_exec.js" $wasm_dir

echo "Building WASM"

wasm_path="$wasm_dir/main.wasm"
GOOS=js GOARCH=wasm go get .
GOOS=js GOARCH=wasm go build -o wasm/main.wasm
gzip -9 -v -c wasm/main.wasm > wasm/main.wasm.gz
GOOS=js GOARCH=wasm go build -o $wasm_path
gzip -9 -v -c $wasm_path > $wasm_path.gz

echo "WASM exported to main.wasm.gz"
echo "WASM exported to $wasm_path.gz"
4 changes: 2 additions & 2 deletions packages/node-hcl/src/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function goBridge(getBytes: Promise<Buffer>) {
let ready = false;

async function init() {
await import(`../wasm/bridge_wasm_exec.js`);
await import(`./wasm/bridge_wasm_exec.js`);
const go = new (global as any).Go();
const bytes = await getBytes;
const result = await WebAssembly.instantiate(bytes, go.importObject);
Expand Down Expand Up @@ -77,7 +77,7 @@ function goBridge(getBytes: Promise<Buffer>) {

const loadWasm = async () => {
return gunzipSync(
await fs.readFile(join(__dirname, '..', 'wasm/main.wasm.gz')),
await fs.readFile(join(__dirname, 'wasm/main.wasm.gz')),
);
};

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"extends": "@backstage/cli/config/tsconfig.json",
"include": [
"packages/*/src",
"packages/*/wasm",
"plugins/*/src",
"plugins/*/dev",
"plugins/*/migrations"
Expand Down

0 comments on commit dadb165

Please sign in to comment.