Update and clean up AssemblyScript example (#4233)

* Update and clean up AssemblyScript example

* Remove wasm build files

* Remove wasm source files
This commit is contained in:
Jairus Tanaka
2022-06-07 10:51:52 -07:00
committed by GitHub
parent 479def00b9
commit 8ca3af0e37
6 changed files with 22 additions and 96 deletions

View File

@@ -1 +1,4 @@
node_modules/
package-lock.json
*.lock
*.{wat,wasm}

View File

@@ -0,0 +1,9 @@
{
"targets": {
"helloworld": {
"outFile": "build/wasi-hello-world.wasm",
"textFile": "build/wasi-hello-world.wat"
}
},
"options": {}
}

View File

@@ -1,86 +0,0 @@
{
"name": "wasi-hello-world",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "wasi-hello-world",
"version": "1.0.0",
"license": "MIT",
"dependencies": {
"as-wasi": "^0.4.6"
},
"devDependencies": {
"assemblyscript": "^0.19.10"
}
},
"node_modules/as-wasi": {
"version": "0.4.6",
"resolved": "https://registry.npmjs.org/as-wasi/-/as-wasi-0.4.6.tgz",
"integrity": "sha512-HFWdxLVHrOfchf/M+gE2IczsHBkWXqekZZfHYmDj6WP1UnpQC4k44OeyjqmSwC/db1tppEwCUssDCuFGnMdJZw=="
},
"node_modules/assemblyscript": {
"version": "0.19.10",
"resolved": "https://registry.npmjs.org/assemblyscript/-/assemblyscript-0.19.10.tgz",
"integrity": "sha512-HavcUBXB3mBTRGJcpvaQjmnmaqKHBGREjSPNsIvnAk2f9dj78y4BkMaSSdvBQYWcDDzsHQjyUC8stICFkD1Odg==",
"dev": true,
"dependencies": {
"binaryen": "101.0.0-nightly.20210723",
"long": "^4.0.0"
},
"bin": {
"asc": "bin/asc",
"asinit": "bin/asinit"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/assemblyscript"
}
},
"node_modules/binaryen": {
"version": "101.0.0-nightly.20210723",
"resolved": "https://registry.npmjs.org/binaryen/-/binaryen-101.0.0-nightly.20210723.tgz",
"integrity": "sha512-eioJNqhHlkguVSbblHOtLqlhtC882SOEPKmNFZaDuz1hzQjolxZ+eu3/kaS10n3sGPONsIZsO7R9fR00UyhEUA==",
"dev": true,
"bin": {
"wasm-opt": "bin/wasm-opt"
}
},
"node_modules/long": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz",
"integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==",
"dev": true
}
},
"dependencies": {
"as-wasi": {
"version": "0.4.6",
"resolved": "https://registry.npmjs.org/as-wasi/-/as-wasi-0.4.6.tgz",
"integrity": "sha512-HFWdxLVHrOfchf/M+gE2IczsHBkWXqekZZfHYmDj6WP1UnpQC4k44OeyjqmSwC/db1tppEwCUssDCuFGnMdJZw=="
},
"assemblyscript": {
"version": "0.19.10",
"resolved": "https://registry.npmjs.org/assemblyscript/-/assemblyscript-0.19.10.tgz",
"integrity": "sha512-HavcUBXB3mBTRGJcpvaQjmnmaqKHBGREjSPNsIvnAk2f9dj78y4BkMaSSdvBQYWcDDzsHQjyUC8stICFkD1Odg==",
"dev": true,
"requires": {
"binaryen": "101.0.0-nightly.20210723",
"long": "^4.0.0"
}
},
"binaryen": {
"version": "101.0.0-nightly.20210723",
"resolved": "https://registry.npmjs.org/binaryen/-/binaryen-101.0.0-nightly.20210723.tgz",
"integrity": "sha512-eioJNqhHlkguVSbblHOtLqlhtC882SOEPKmNFZaDuz1hzQjolxZ+eu3/kaS10n3sGPONsIZsO7R9fR00UyhEUA==",
"dev": true
},
"long": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz",
"integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==",
"dev": true
}
}
}

View File

@@ -4,15 +4,16 @@
"description": "Hello world in Wasi with AS and as-wasi",
"main": "index.js",
"scripts": {
"build": "asc wasi-hello-world.ts -b wasi-hello-world.wasm",
"wasmtime": "wasmtime wasi-hello-world.wasm"
"build": "asc wasi-hello-world.ts --target helloworld",
"wasmtime": "wasmtime ./build/wasi-hello-world.wasm"
},
"author": "Aaron Turner",
"contributors": [
"Jairus Tanaka (JairusSW)"
],
"license": "MIT",
"devDependencies": {
"assemblyscript": "^0.19.10"
"assemblyscript": "^0.20.7"
},
"dependencies": {
"as-wasi": "^0.4.6"
}
"dependencies": {}
}

View File

@@ -1,5 +1,4 @@
import "wasi"
import {Console} from "as-wasi"
Console.log('Hello World!\n');
// Import the WASI environment and additional WASI-enabled APIs
console.log('Hello World!\n');
// Call AssemblyScript console.log which in turn calls WASI