diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 831f55c..88a678a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -22,7 +22,7 @@ jobs: with: node-version: 22 - - uses: mlugg/setup-zig@v2.0.5 + - uses: mlugg/setup-zig@v2 - name: Install binaryen run: | diff --git a/build.zig.zon b/build.zig.zon index 579d11a..59181e0 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -2,15 +2,15 @@ .name = .playground, .version = "0.0.0", .fingerprint = 0xdc188848360fd988, // Changing this has security and trust implications. - .minimum_zig_version = "0.15.1", + .minimum_zig_version = "0.15.2", .dependencies = .{ .zls = .{ - .url = "git+https://github.com/zigtools/zls?ref=0.15.0#ce6c8f02c78e622421cfc2405c67c5222819ec03", - .hash = "zls-0.15.0-rmm5fkjqIwDZpmDHyKwxa9K2gcI3FPaGVFPwjYWFBM5B", + .url = "git+https://github.com/zigtools/zls?ref=0.15.1#f91b2e1e305e5d5bd3725aea90f9f9bfb3dce055", + .hash = "zls-0.15.1-rmm5fgQ2JADjDh84Ja3pDBZ1io_kKdHS2YhQyvBYz66r", }, .zig = .{ - .url = "git+https://github.com/zigtools/zig?ref=wasm32-wasi#3ee3d1aaf1db2e0501cd5372b68408be0c4c2133", - .hash = "zig-0.0.0-Fp4XJA38IQ3PPwA7sizQuTm_Ru1bH1ok-Yo6LH5a-F-B", + .url = "git+https://github.com/zigtools/zig?ref=wasm32-wasi#e123e17142e0576498ba7f14971e24565c242bd4", + .hash = "zig-0.0.0-Fp4XJMPnIg0zUDsFeLUD3kzBiBYbT_YSvJZo0pVB3tnR", }, }, .paths = .{""}, diff --git a/src/utils.ts b/src/utils.ts index 29348c5..f714c53 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,12 +1,9 @@ -// @ts-ignore -import zigTarGz from "../zig-out/zig.tar.gz?inline"; import { untar } from "@andrewbranch/untar.js"; import { Directory, File, ConsoleStdout, wasi as wasi_defs } from "@bjorn3/browser_wasi_shim"; export async function getLatestZigArchive() { - const ds = new DecompressionStream("gzip"); - const zigTarResponse = new Response((await fetch(zigTarGz)).body?.pipeThrough(ds)); - const entries = await untar(await zigTarResponse.arrayBuffer()); + const zigTarResponse = await fetch(new URL("../zig-out/zig.tar.gz", import.meta.url)); + const entries = untar(await zigTarResponse.arrayBuffer()); let root: TreeNode = new Map(); diff --git a/src/workers/zig.ts b/src/workers/zig.ts index f4905c4..58efb0f 100644 --- a/src/workers/zig.ts +++ b/src/workers/zig.ts @@ -1,7 +1,5 @@ import { WASI, PreopenDirectory, Fd, File, OpenFile, Inode } from "@bjorn3/browser_wasi_shim"; import { getLatestZigArchive, stderrOutput } from "../utils"; -// @ts-ignore -import zigWasm from "../../zig-out/bin/zig.wasm?url"; let currentlyRunning = false; async function run(source: string) { @@ -36,7 +34,7 @@ async function run(source: string) { ] satisfies Fd[]; let wasi = new WASI(args, env, fds, { debug: false }); - const { instance } = await WebAssembly.instantiateStreaming(fetch(zigWasm), { + const { instance } = await WebAssembly.instantiateStreaming(fetch(new URL("../../zig-out/bin/zig.wasm", import.meta.url)), { "wasi_snapshot_preview1": wasi.wasiImport, }); diff --git a/src/workers/zls.ts b/src/workers/zls.ts index 3d8a12f..7a6bcc5 100644 --- a/src/workers/zls.ts +++ b/src/workers/zls.ts @@ -1,7 +1,5 @@ import { WASI, PreopenDirectory, Fd, ConsoleStdout } from "@bjorn3/browser_wasi_shim"; import { getLatestZigArchive } from "../utils"; -// @ts-ignore -import zlsWasm from "../../zig-out/bin/zls.wasm?url"; class Stdio extends Fd { constructor() { @@ -58,7 +56,7 @@ onmessage = (event) => { ]; let wasi = new WASI(args, env, fds, { debug: false }); - const { instance: localInstance } = await WebAssembly.instantiateStreaming(fetch(zlsWasm), { + const { instance: localInstance } = await WebAssembly.instantiateStreaming(fetch(new URL("../../zig-out/bin/zls.wasm", import.meta.url)), { "wasi_snapshot_preview1": wasi.wasiImport, }); diff --git a/vite.config.js b/vite.config.js index cd9eb04..aca9f77 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,5 +1,4 @@ import { defineConfig } from "vite"; export default defineConfig({ - assetsInclude: ['**/*.tar.gz'], plugins: [], }); \ No newline at end of file