diff --git a/language_server/playground/.gitignore b/language_server/playground/.gitignore index 3252fa36..bf923824 100644 --- a/language_server/playground/.gitignore +++ b/language_server/playground/.gitignore @@ -1,4 +1,5 @@ build_output.lua node_modules *.bundle.* -yarn.lock \ No newline at end of file +yarn.lock +public/glue.wasm \ No newline at end of file diff --git a/language_server/playground/build.js b/language_server/playground/build.js index 860ec19a..99183cd2 100644 --- a/language_server/playground/build.js +++ b/language_server/playground/build.js @@ -1,6 +1,8 @@ const { execSync } = require("child_process") const fs = require("fs") const path = require("path") +const { finished } = require("stream/promises") +const { Readable } = require("stream") const getAllFiles = function (dirPath, arrayOfFiles) { files = fs.readdirSync(dirPath) @@ -33,6 +35,16 @@ for (let path of getAllFiles("../../test/nattlua/analyzer/")) { } fs.writeFileSync("src/random.json", JSON.stringify(tests)) +;(async () => { + const res = await fetch("https://unpkg.com/wasmoon@1.14.1/dist/glue.wasm") + fs.unlink("public/glue.wasm", (err) => { + if (err) { + console.error(err) + } + }) + const fileStream = fs.createWriteStream("public/glue.wasm", { flags: "wx" }) + await finished(Readable.fromWeb(res.body).pipe(fileStream)) +})() execSync("cd ../../ && luajit nattlua.lua build fast") diff --git a/language_server/playground/publish.sh b/language_server/playground/publish.sh index e27f249e..d8e6b20c 100644 --- a/language_server/playground/publish.sh +++ b/language_server/playground/publish.sh @@ -4,4 +4,5 @@ git remote add origin git@github.com:CapsAdmin/NattLua.git git checkout -b gh-pages git add --all git commit -m "Deploy" -git push -f origin gh-pages \ No newline at end of file +git push -f origin gh-pages +rm -rf .git \ No newline at end of file diff --git a/language_server/playground/src/.gitignore b/language_server/playground/src/.gitignore index 77542444..f85b615c 100644 --- a/language_server/playground/src/.gitignore +++ b/language_server/playground/src/.gitignore @@ -1 +1,2 @@ -random.json \ No newline at end of file +random.json +public/glue.wasm \ No newline at end of file