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:
3
docs/assemblyscript-hello-world/.gitignore
vendored
3
docs/assemblyscript-hello-world/.gitignore
vendored
@@ -1 +1,4 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
|
package-lock.json
|
||||||
|
*.lock
|
||||||
|
*.{wat,wasm}
|
||||||
9
docs/assemblyscript-hello-world/asconfig.json
Normal file
9
docs/assemblyscript-hello-world/asconfig.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"targets": {
|
||||||
|
"helloworld": {
|
||||||
|
"outFile": "build/wasi-hello-world.wasm",
|
||||||
|
"textFile": "build/wasi-hello-world.wat"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"options": {}
|
||||||
|
}
|
||||||
86
docs/assemblyscript-hello-world/package-lock.json
generated
86
docs/assemblyscript-hello-world/package-lock.json
generated
@@ -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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,15 +4,16 @@
|
|||||||
"description": "Hello world in Wasi with AS and as-wasi",
|
"description": "Hello world in Wasi with AS and as-wasi",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "asc wasi-hello-world.ts -b wasi-hello-world.wasm",
|
"build": "asc wasi-hello-world.ts --target helloworld",
|
||||||
"wasmtime": "wasmtime wasi-hello-world.wasm"
|
"wasmtime": "wasmtime ./build/wasi-hello-world.wasm"
|
||||||
},
|
},
|
||||||
"author": "Aaron Turner",
|
"author": "Aaron Turner",
|
||||||
|
"contributors": [
|
||||||
|
"Jairus Tanaka (JairusSW)"
|
||||||
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"assemblyscript": "^0.19.10"
|
"assemblyscript": "^0.20.7"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {}
|
||||||
"as-wasi": "^0.4.6"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import "wasi"
|
import "wasi"
|
||||||
|
// Import the WASI environment and additional WASI-enabled APIs
|
||||||
import {Console} from "as-wasi"
|
console.log('Hello World!\n');
|
||||||
Console.log('Hello World!\n');
|
// Call AssemblyScript console.log which in turn calls WASI
|
||||||
|
|
||||||
Binary file not shown.
Reference in New Issue
Block a user