feat: init

This commit is contained in:
2026-02-13 22:02:30 +01:00
commit 8f9ff830fb
16711 changed files with 3307340 additions and 0 deletions

3
node_modules/unwasm/examples/add-esmi-deps.mjs generated vendored Normal file
View File

@@ -0,0 +1,3 @@
export function getValue() {
return 41;
}

BIN
node_modules/unwasm/examples/add-esmi.wasm generated vendored Normal file

Binary file not shown.

34
node_modules/unwasm/examples/build.mjs generated vendored Normal file
View File

@@ -0,0 +1,34 @@
import { fileURLToPath } from "node:url";
import fs from 'node:fs/promises';
import Module from "node:module";
import { main as asc } from "assemblyscript/asc";
const require = Module.createRequire(import.meta.url);
const wabt = await require("wabt")();
async function compile(name) {
// https://www.assemblyscript.org/compiler.html#programmatic-usage
const res = await asc([`${name}.asc.ts`, "-o", `${name}.wasm`], {});
if (res.error) {
console.log(`Compilation failed for ${name}:`, res.error);
console.log(res.stderr.toString());
} else {
console.log(`Compiled: ${name}.wasm`);
console.log(res.stdout.toString());
}
}
async function compileWat(name) {
const module = wabt.parseWat(`${name}.wat`, await fs.readFile(`${name}.wat`));
module.resolveNames();
const binaryOutput = module.toBinary({write_debug_names:true});
const binaryBuffer = binaryOutput.buffer;
await fs.writeFile(`${name}.wasm`, binaryBuffer);
}
process.chdir(fileURLToPath(new URL(".", import.meta.url)));
await compile("sum");
await compile("rand");
await compileWat("add-esmi");

1
node_modules/unwasm/examples/env.mjs generated vendored Normal file
View File

@@ -0,0 +1 @@
export const seed = () => Math.random() * Date.now()

5
node_modules/unwasm/examples/package.json generated vendored Normal file
View File

@@ -0,0 +1,5 @@
{
"imports": {
"#env": "./env.mjs"
}
}

BIN
node_modules/unwasm/examples/rand.wasm generated vendored Normal file

Binary file not shown.

BIN
node_modules/unwasm/examples/sum.wasm generated vendored Normal file

Binary file not shown.