From 71006005dead581163ddccb2612730ad05058378 Mon Sep 17 00:00:00 2001 From: Matt Johnson-Pint Date: Tue, 26 Mar 2024 17:29:45 -0700 Subject: [PATCH] Update build (#7) --- functions/asconfig.json | 13 ++++--------- functions/package-lock.json | 11 +++++++++++ functions/package.json | 8 +++++--- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/functions/asconfig.json b/functions/asconfig.json index 75cee36..ea5f6b0 100644 --- a/functions/asconfig.json +++ b/functions/asconfig.json @@ -1,24 +1,19 @@ { "extends": "./node_modules/@assemblyscript/wasi-shim/asconfig.json", + "options": { + "transform": ["@hypermode/functions-as/transform", "json-as/transform"], + "exportRuntime": true + }, "targets": { "debug": { - "outFile": "build/debug.wasm", - "textFile": "build/debug.wat", "sourceMap": true, "debug": true }, "release": { - "outFile": "build/release.wasm", - "textFile": "build/release.wat", - "sourceMap": true, "optimizeLevel": 3, "shrinkLevel": 0, "converge": false, "noAssert": false } - }, - "options": { - "transform": ["@hypermode/functions-as/transform", "json-as/transform"], - "exportRuntime": true } } diff --git a/functions/package-lock.json b/functions/package-lock.json index e7fb9e8..c67d022 100644 --- a/functions/package-lock.json +++ b/functions/package-lock.json @@ -20,6 +20,7 @@ "assemblyscript-prettier": "^3.0.1", "eslint": "^8.57.0", "prettier": "^3.2.5", + "run-script-os": "^1.1.6", "visitor-as": "^0.11.4" } }, @@ -1587,6 +1588,16 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/run-script-os": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/run-script-os/-/run-script-os-1.1.6.tgz", + "integrity": "sha512-ql6P2LzhBTTDfzKts+Qo4H94VUKpxKDFz6QxxwaUZN0mwvi7L3lpOI7BqPCq7lgDh3XLl0dpeXwfcVIitlrYrw==", + "dev": true, + "bin": { + "run-os": "index.js", + "run-script-os": "index.js" + } + }, "node_modules/semver": { "version": "7.6.0", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", diff --git a/functions/package.json b/functions/package.json index 5df1b46..2283676 100644 --- a/functions/package.json +++ b/functions/package.json @@ -7,9 +7,10 @@ "license": "MIT", "type": "module", "scripts": { - "build:debug": "asc assembly/index.ts --target debug", - "build:release": "asc assembly/index.ts --target release", - "build": "npm run build:debug && npm run build:release", + "build": "run-script-os", + "build:windows": "asc assembly\\index.ts -o build\\%npm_package_name%.wasm --target debug", + "build:default": "asc assembly/index.ts -o build/$npm_package_name.wasm --target debug", + "build:release": "asc assembly/index.ts -o build/$npm_package_name.wasm --target release", "pretty": "prettier --write .", "pretty:check": "prettier --check .", "lint": "eslint --ext .ts .", @@ -27,6 +28,7 @@ "assemblyscript-prettier": "^3.0.1", "eslint": "^8.57.0", "prettier": "^3.2.5", + "run-script-os": "^1.1.6", "visitor-as": "^0.11.4" }, "overrides": {