diff --git a/docs/assemblyscript-hello-world/.gitignore b/docs/assemblyscript-hello-world/.gitignore index c2658d7d1b..39901aeaa4 100644 --- a/docs/assemblyscript-hello-world/.gitignore +++ b/docs/assemblyscript-hello-world/.gitignore @@ -1 +1,4 @@ node_modules/ +package-lock.json +*.lock +*.{wat,wasm} \ No newline at end of file diff --git a/docs/assemblyscript-hello-world/asconfig.json b/docs/assemblyscript-hello-world/asconfig.json new file mode 100644 index 0000000000..65c9ea8f09 --- /dev/null +++ b/docs/assemblyscript-hello-world/asconfig.json @@ -0,0 +1,9 @@ +{ + "targets": { + "helloworld": { + "outFile": "build/wasi-hello-world.wasm", + "textFile": "build/wasi-hello-world.wat" + } + }, + "options": {} +} \ No newline at end of file diff --git a/docs/assemblyscript-hello-world/package-lock.json b/docs/assemblyscript-hello-world/package-lock.json deleted file mode 100644 index fa465fe3c0..0000000000 --- a/docs/assemblyscript-hello-world/package-lock.json +++ /dev/null @@ -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 - } - } -} diff --git a/docs/assemblyscript-hello-world/package.json b/docs/assemblyscript-hello-world/package.json index 121c4e8ec8..8135b4c884 100644 --- a/docs/assemblyscript-hello-world/package.json +++ b/docs/assemblyscript-hello-world/package.json @@ -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": {} } diff --git a/docs/assemblyscript-hello-world/wasi-hello-world.ts b/docs/assemblyscript-hello-world/wasi-hello-world.ts index 1cd3065fe4..ef1b673157 100644 --- a/docs/assemblyscript-hello-world/wasi-hello-world.ts +++ b/docs/assemblyscript-hello-world/wasi-hello-world.ts @@ -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 \ No newline at end of file diff --git a/docs/assemblyscript-hello-world/wasi-hello-world.wasm b/docs/assemblyscript-hello-world/wasi-hello-world.wasm deleted file mode 100644 index bb85a774da..0000000000 Binary files a/docs/assemblyscript-hello-world/wasi-hello-world.wasm and /dev/null differ