From 2b0d31e2db3c6a884d0427475b9efcf4f8e07c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikkel=20M=C3=B8rk=20Hegnh=C3=B8j?= Date: Fri, 10 Jan 2025 17:12:23 +0100 Subject: [PATCH] Updates to common-samples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updating to use knitwit Signed-off-by: Mikkel Mørk Hegnhøj --- .../outbound-http/package.json | 46 ++++++++++--------- .../routing-requests/package.json | 45 +++++++++--------- .../routing-requests/spin.toml | 10 ++-- 3 files changed, 52 insertions(+), 49 deletions(-) diff --git a/examples/common-patterns/outbound-http/package.json b/examples/common-patterns/outbound-http/package.json index ddea98eb..59ffee96 100644 --- a/examples/common-patterns/outbound-http/package.json +++ b/examples/common-patterns/outbound-http/package.json @@ -1,23 +1,25 @@ { - "name": "outbound-http", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "build": "npx webpack --mode=production && npx mkdirp target && npx j2w -i dist.js -n spin-http -o target/outbound-http.wasm", - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC", - "devDependencies": { - "mkdirp": "^3.0.1", - "ts-loader": "^9.4.1", - "typescript": "^4.8.4", - "webpack": "^5.74.0", - "webpack-cli": "^4.10.0" - }, - "dependencies": { - "@fermyon/spin-sdk": "^2.0.0" - } -} \ No newline at end of file + "name": "outbound-http", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "build": "npx webpack --mode=production && npx mkdirp target && npx j2w -i dist.js -d combined-wit -n combined -o target/outbound-http.wasm", + "test": "echo \"Error: no test specified\" && exit 1", + "postinstall": "knitwit" + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "mkdirp": "^3.0.1", + "ts-loader": "^9.4.1", + "typescript": "^4.8.4", + "webpack": "^5.74.0", + "webpack-cli": "^4.10.0" + }, + "dependencies": { + "@fermyon/spin-sdk": "^2.3.0" + } +} + diff --git a/examples/common-patterns/routing-requests/package.json b/examples/common-patterns/routing-requests/package.json index ddea98eb..5df38630 100644 --- a/examples/common-patterns/routing-requests/package.json +++ b/examples/common-patterns/routing-requests/package.json @@ -1,23 +1,24 @@ { - "name": "outbound-http", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "build": "npx webpack --mode=production && npx mkdirp target && npx j2w -i dist.js -n spin-http -o target/outbound-http.wasm", - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC", - "devDependencies": { - "mkdirp": "^3.0.1", - "ts-loader": "^9.4.1", - "typescript": "^4.8.4", - "webpack": "^5.74.0", - "webpack-cli": "^4.10.0" - }, - "dependencies": { - "@fermyon/spin-sdk": "^2.0.0" - } -} \ No newline at end of file + "name": "routing-requests", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "build": "npx webpack --mode=production && npx mkdirp target && npx j2w -i dist.js -d combined-wit -n combined -o target/routing-requests.wasm", + "test": "echo \"Error: no test specified\" && exit 1", + "postinstall": "knitwit" + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "mkdirp": "^3.0.1", + "ts-loader": "^9.4.1", + "typescript": "^4.8.4", + "webpack": "^5.74.0", + "webpack-cli": "^4.10.0" + }, + "dependencies": { + "@fermyon/spin-sdk": "^2.3.0" + } +} diff --git a/examples/common-patterns/routing-requests/spin.toml b/examples/common-patterns/routing-requests/spin.toml index 08645f37..df919267 100644 --- a/examples/common-patterns/routing-requests/spin.toml +++ b/examples/common-patterns/routing-requests/spin.toml @@ -3,16 +3,16 @@ spin_manifest_version = 2 [application] authors = ["karthik2804 "] description = "" -name = "outbound-http" +name = "routing-requests" version = "0.1.0" [[trigger.http]] route = "/..." -component = "outbound-http" +component = "routing-requests" -[component.outbound-http] -source = "target/outbound-http.wasm" +[component.routing-requests] +source = "target/routing-requests.wasm" exclude_files = ["**/node_modules"] -[component.outbound-http.build] +[component.routing-requests.build] command = "npm run build" watch = ["src/**/*.ts", "package.json"]